:root {
  --bg: #f6f7f9; --panel: #fff; --line: #e2e5e9; --line2: #eef0f3; --text: #1f2328; --muted: #6b7280;
  --accent: #c2410c; --accent-weak: #fff1e8; --accent-2: #9a3412;
  --blue: #1d6fd8; --blue-weak: #e8f1fd;
  --head: #a8a29e; --cell: #e7e5e4; --cell-open: #f5f5f4; --blk: #8a837b; --blk-pick: #4b4640;
  --booked: #8a837b; --seated: #16a34a; --left: #a8a29e; --cancel: #d1d5db; --danger: #c81e1e; --warn: #b45309; --warn-bg: #fff7e6;
  --sidew: 186px; --panelw: 330px; --slot: 44px; --rowh: 52px; --namew: 150px; --barh: 48px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 6px 12px; }
button:hover { background: #f3f4f6; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-2); }
button.primary-line { border-color: var(--blue); color: var(--blue); background: #fff; }
button.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
button.blue:disabled { opacity: .5; }
button.danger { color: var(--danger); border-color: #f1c0c0; }
button.wide { width: 100%; }
button.ghost-line { background: #fff; color: var(--muted); margin-top: 12px; padding: 8px; }
input, select, textarea { border: 1px solid #d1d5db; border-radius: 4px; padding: 6px 8px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.chk { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.muted { color: var(--muted); } .err { color: var(--danger); font-size: 12px; margin: 4px 0; } .hint { color: var(--muted); font-size: 12px; margin: 4px 0; }
.sep { flex: 1; }
[hidden] { display: none !important; }

/* 合言葉 */
.gate { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.gate-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(380px, 100%); }
.gate-card h1 { margin: 0 0 6px; font-size: 22px; }
.gate-note { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.gate-card form { display: grid; gap: 12px; }
.gate-card input { font-size: 16px; padding: 10px; }
.gate-card button { padding: 10px; }
.gate-dir { color: var(--muted); font-size: 11px; margin: 16px 0 0; }

/* 枠 */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar { height: var(--barh); display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.icon-btn { background: transparent; border: none; font-size: 20px; line-height: 1; padding: 6px 10px; }
.brand { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.logo-dot { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); flex: none; }
.layout { flex: 1; min-height: 0; display: flex; position: relative; }
.side { width: var(--sidew); flex: none; background: #fff; border-right: 1px solid var(--line); overflow: auto; padding: 8px 0; display: flex; flex-direction: column; }
.side button { border: none; background: transparent; border-radius: 0; text-align: left; padding: 11px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; color: #374151; }
.side button i { font-style: normal; width: 20px; text-align: center; font-size: 16px; color: #4b5563; }
.side button.on { font-weight: 700; color: var(--text); background: #f3f4f6; }
.side .car { margin-left: auto; color: var(--muted); }
.side .sub { display: none; flex-direction: column; }
.side .sub.open { display: flex; }
.side .sub button { padding: 8px 14px 8px 44px; font-size: 12px; }
body.side-closed .side { display: none; }
main { flex: 1; min-width: 0; overflow: auto; padding: 14px 16px 40px; }
.view > * + * { margin-top: 12px; }
.vt { font-size: 20px; margin: 4px 0 8px; font-weight: 700; }
.tb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-title { font-size: 20px; font-weight: 700; white-space: nowrap; }
.nav3 { display: inline-flex; }
.nav3 button { border-radius: 0; padding: 5px 12px; font-size: 12px; color: #374151; }
.nav3 button + button { border-left: none; }
.nav3 button:first-child { border-radius: 4px 0 0 4px; } .nav3 button:last-child { border-radius: 0 4px 4px 0; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; font-size: 12px; padding: 6px 14px; color: #4b5563; }
.seg button + button { border-left: none; }
.seg button:first-child { border-radius: 4px 0 0 4px; } .seg button:last-child { border-radius: 0 4px 4px 0; }
.seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg.dark button.on { background: #4b5563; border-color: #4b5563; }
.date-pick { flex-direction: row; align-items: center; gap: 6px; position: relative; cursor: pointer; color: var(--text); }
.date-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.cal-ic { font-size: 18px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.box.gray { background: #eceef1; min-height: 100px; }
.box.info { display: flex; gap: 8px; align-items: flex-start; }
.box.info .ic { color: #16a34a; }
.box.info .txt { flex: 1; white-space: pre-wrap; }
.box.info .ttl { font-weight: 700; display: block; margin-bottom: 4px; }
.link { color: var(--blue); background: none; border: none; padding: 0 4px; font-size: 13px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.tabs.scroll { overflow-x: auto; }
.tabs button { border: 1px solid transparent; border-bottom: none; background: transparent; color: var(--blue); border-radius: 4px 4px 0 0; padding: 8px 14px; font-size: 13px; white-space: nowrap; margin-bottom: -1px; }
.tabs button.on { border-color: var(--line); background: #fff; color: var(--text); }
.morebox { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; }
.searchbar { display: flex; }
.searchbar.grow { flex: 1; min-width: 220px; }
.searchbar input { flex: 1; border-radius: 4px 0 0 4px; padding: 8px 10px; }
.searchbar button { border-radius: 0 4px 4px 0; border-left: none; font-size: 16px; padding: 4px 12px; }

/* ホームのカレンダー */
.mcal { display: grid; grid-template-columns: repeat(7, 1fr); background: #fff; border: 1px solid var(--line); }
.mcal .wd { text-align: center; font-size: 12px; padding: 6px 0; background: var(--bg); }
.mcal .wd.sun { color: #dc2626; } .mcal .wd.sat { color: var(--blue); }
.mcal .day { border-top: 1px solid var(--line); border-left: 1px solid var(--line2); min-height: 92px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: #fff; text-align: left; border-radius: 0; border-right: none; border-bottom: none; }
.mcal .day:hover { background: #fafafa; }
.mcal .dn { font-size: 22px; color: #9ca3af; line-height: 1.1; margin-bottom: 4px; }
.mcal .day.sun .dn, .mcal .day.hol .dn { color: #f19999; } .mcal .day.sat .dn { color: #8fb6ec; }
.mcal .day.other { opacity: .45; }
.mcal .day.today .dn { color: #fff; background: #f59e0b; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; font-size: 18px; }
.mcal .cnt { font-size: 11px; color: #4b5563; white-space: nowrap; }
.mcal .memo { font-size: 11px; color: #374151; white-space: pre-wrap; overflow: hidden; max-height: 48px; }

/* タイムテーブル */
.grid-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); max-height: calc(100vh - 220px); }
.grid { position: relative; width: max-content; min-width: 100%; }
.g-head { position: sticky; top: 0; z-index: 3; display: flex; background: var(--head); color: #fff; font-size: 12px; font-weight: 700; }
.g-corner { position: sticky; left: 0; z-index: 4; width: var(--namew); flex: none; background: var(--head); text-align: center; padding: 6px 0; border-right: 4px solid #fff; }
.g-hour { flex: none; width: calc(var(--slot) * 2); padding: 6px 4px; border-left: 1px solid rgba(255,255,255,.7); }
.g-row { display: flex; height: var(--rowh); border-bottom: 1px solid #fff; position: relative; }
.g-name { position: sticky; left: 0; z-index: 2; width: var(--namew); flex: none; background: #fff; border-right: 4px solid #fff; border-bottom: 1px solid var(--line); padding: 6px 8px; display: flex; flex-direction: column; justify-content: center; font-size: 13px; }
.g-name .tn { display: flex; gap: 4px; align-items: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-name .tc { font-size: 11px; color: var(--muted); padding-left: 20px; }
.g-name .smk { font-size: 12px; width: 16px; text-align: center; }
.g-row.waiting .g-name { background: var(--warn-bg); }
.g-row.drop .g-name { background: var(--accent-weak); }
.g-cells { position: relative; flex: none; display: flex; background: var(--cell); }
.g-cell { width: var(--slot); flex: none; border-left: 1px dashed #d6d3d1; }
.g-cell.h { border-left: 1px solid #fff; }
.g-cell.open { background: var(--cell-open); }
.g-cell:hover { background: #fde7d9; cursor: pointer; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 1; pointer-events: none; }
.blk { position: absolute; top: 4px; height: calc(var(--rowh) - 8px); border-radius: 3px; padding: 3px 6px; font-size: 11px; line-height: 1.35; overflow: hidden; cursor: grab; z-index: 1; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--blk); color: #fff; display: flex; gap: 4px; }
.blk .bi { flex: 1; min-width: 0; }
.blk .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .95; }
.blk .n { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .vc { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; border: 1px solid currentColor; font-size: 9px; text-align: center; margin-left: 3px; }
.blk .warn-ic { background: #fff; color: var(--blk); border-radius: 50%; width: 16px; height: 16px; display: grid; place-items: center; font-weight: 900; font-size: 11px; flex: none; align-self: center; }
.blk .tg { align-self: flex-end; font-size: 11px; }
.blk.seated { background: #2f8a4f; } .blk.left { background: #b9b2aa; }
.blk.cancel, .blk.noshow { background: #e5e7eb; color: #6b7280; text-decoration: line-through; }
.blk.over { outline: 2px solid var(--danger); }
.blk.dragging { opacity: .35; }
.blk.sel { outline: 3px solid var(--blue); }
.ghost-blk { position: fixed; z-index: 60; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.25); opacity: .95; }
.drop-mark { position: absolute; top: 2px; bottom: 2px; border: 2px dashed var(--accent); border-radius: 4px; background: rgba(194,65,12,.08); pointer-events: none; z-index: 2; }
/* テーブルを選ぶ時（右の入力欄が開いている時） */
.slot { position: absolute; top: 4px; height: calc(var(--rowh) - 8px); border-radius: 3px; background: #45403b; z-index: 2; cursor: pointer; display: grid; place-items: center; color: #fff; font-size: 18px; }
.slot.busy { background: repeating-linear-gradient(45deg, #9ca3af, #9ca3af 6px, #6b7280 6px, #6b7280 12px); }
.slot.on { background: var(--blue); }
.slot.unfit:not(.on) { background: #6b645d; }

.movebar { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 12px 14px; min-width: 260px; max-width: calc(100vw - 32px); }
.mv-text { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
.mv-acts { display: flex; gap: 8px; justify-content: flex-end; }
.mv-acts button { min-width: 96px; }

/* 右側の入力欄 */
.panel { width: var(--panelw); flex: none; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pn-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 10px 14px; border-bottom: 1px solid var(--line); font-size: 18px; }
.pn-body { flex: 1; overflow: auto; padding: 12px 14px; }
.pn-foot { border-top: 1px solid var(--line); padding: 10px 14px; display: grid; gap: 8px; }
.pn-foot .row2 { display: flex; gap: 8px; justify-content: center; }
.pn-sec { font-size: 18px; font-weight: 700; margin: 6px 0 10px; }
.fld { margin-bottom: 12px; }
.fld > .fl { font-size: 12px; color: #374151; margin-bottom: 4px; display: block; }
.fld .pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.fld .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fld .with-btn { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.fld .with-btn + .with-btn, .fld .two + .two { margin-top: 6px; }
.fld input, .fld select, .fld textarea { width: 100%; }
.fld input[type=checkbox], .fld input[type=radio], .cform input[type=checkbox] { width: auto; min-height: 0; }
.fld label.chk { margin-top: 4px; font-size: 12px; }
.circle-btn { width: 30px; height: 30px; border-radius: 50%; padding: 0; color: var(--muted); }
.fld .red { color: var(--danger); font-size: 11px; }
hr.thin { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.addlink { color: var(--blue); background: none; border: none; padding: 4px 0; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-size: 12px; padding: 5px 10px; border-radius: 3px; background: #ddd6ce; border-color: #ddd6ce; color: #fff; display: flex; gap: 6px; align-items: center; }
.chips button::before { content: ""; width: 12px; height: 12px; background: #fff; border-radius: 2px; }
.chips button.on { background: #22a06b; border-color: #22a06b; }
.chips button.on::before { content: "✓"; color: #22a06b; font-size: 10px; display: grid; place-items: center; font-weight: 900; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tchips button { font-size: 12px; padding: 6px 10px; background: #45403b; color: #fff; border-color: #45403b; }
.tchips button.on { background: var(--blue); border-color: var(--blue); }
.tchips button.busy:not(.on) { background: #d1d5db; border-color: #d1d5db; color: #6b7280; text-decoration: line-through; }
.tchips button.unfit:not(.on):not(.busy) { background: #8a837b; border-color: #8a837b; }
.hits { display: grid; gap: 6px; margin-top: 6px; }
.hit { border: 1px solid #f7d2bb; background: var(--accent-weak); border-radius: 6px; padding: 6px 8px; font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hit.linked { background: #e7f6ec; border-color: #b9e3c8; }
.hit button { padding: 3px 8px; font-size: 11px; }
.dl { display: grid; gap: 8px; font-size: 14px; }
.dl .ln { display: flex; gap: 10px; align-items: flex-start; }
.dl .ln i { font-style: normal; width: 18px; color: #4b5563; text-align: center; }
.dl hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.st-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.st-row button { padding: 8px 4px; font-size: 12px; }
.st-row button.on { background: #4b5563; color: #fff; border-color: #4b5563; }
.hist { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* 表 */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-weight: 700; font-size: 12px; color: #374151; background: #fff; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl tbody tr.click { cursor: pointer; } .tbl tbody tr.click:hover { background: #fafafa; }
.tbl tr.total td { font-weight: 700; }
.rtbl td { border-right: 1px solid var(--line); }
.rtbl td:first-child { border-left: none; }
.who::before { content: "☺ "; color: var(--muted); }
.badge { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 700; color: #fff; background: #3b82f6; margin: 2px 2px 0 0; }
.badge.new { background: #3b82f6; } .badge.change { background: #22a06b; } .badge.cancel { background: #f59e0b; }
.badge.flag { background: #3b82f6; } .badge.flag.f2 { background: #f97316; }
.badge.tag { background: transparent; color: #374151; font-weight: 500; padding: 0; }
.badge.vip { background: #dc2626; }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 600; background: #e5e7eb; }
.pill.seated { background: #dcf3e4; color: #16a34a; } .pill.cancel, .pill.noshow { background: #fde8e8; color: var(--danger); }
.vbadge { display: inline-block; min-width: 20px; padding: 0 6px; border: 1px solid #9ca3af; border-radius: 10px; font-size: 10px; text-align: center; color: #4b5563; margin-left: 4px; }

/* 配置図 */
.floor { display: grid; gap: 14px; margin-top: 10px; }
.area-h { font-weight: 700; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: #fff; border: 2px solid var(--line); border-radius: 8px; padding: 10px; min-height: 96px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.tile .tt { display: flex; justify-content: space-between; font-weight: 700; }
.tile .tt small { font-weight: 400; color: var(--muted); }
.tile .who2 { font-weight: 700; } .tile .sub { font-size: 12px; color: var(--muted); }
.tile.booked { border-color: var(--blk); background: #f5f5f4; } .tile.seated { border-color: var(--seated); background: #e7f6ec; }

/* 分析 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opts { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.opts label { flex-direction: row; align-items: center; gap: 4px; color: var(--text); font-size: 13px; }
.opts select { padding: 4px 6px; }
.chart { overflow-x: auto; }
.chart svg { display: block; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 11px; margin-top: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pie-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; }
.pie { width: 200px; height: 200px; border-radius: 50%; }
.pie.empty { border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 12px; color: #374151; width: 240px; height: 240px; }
.updated { text-align: right; color: var(--muted); font-size: 12px; }

/* 印刷マネージャー・CSV */
.pm { background: #fff; border: 1px solid var(--line); border-top: none; padding: 16px; display: grid; gap: 14px; max-width: 760px; }
.pm .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pm .checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.csv-sec { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px; max-width: 760px; }
.csv-sec h3 { margin: 0 0 10px; font-size: 16px; }

/* 設定 */
.settings { display: grid; gap: 14px; max-width: 980px; }
.panel-box { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; min-width: 0; }
.panel-box h3 { margin: 0 0 8px; font-size: 15px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.row > * { min-width: 0; }
.edit-table td input, .edit-table td select { width: 100%; }
.edit-table td.small input { width: 64px; }
.edit-table td.btns { width: 1%; white-space: nowrap; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.kvs { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0; font-size: 13px; }
.kvs dt { color: var(--muted); } .kvs dd { margin: 0; overflow-wrap: anywhere; }
.cform { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px 18px; max-width: 560px; }
.cform .cf { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; align-items: start; margin-bottom: 10px; }
.cform .cf > .fl { font-size: 13px; padding-top: 8px; }
.cform .cf .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cform .cf .stack { display: grid; gap: 6px; }
.cform input, .cform textarea { width: 100%; }

/* 確認の小窓 */
.ask { border: none; border-radius: 6px; padding: 0; width: min(460px, calc(100vw - 24px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.ask::backdrop { background: rgba(17,24,39,.45); }
.ask-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 18px; }
.ask-body { padding: 16px 14px; font-size: 13px; white-space: pre-wrap; }
.ask-body textarea { width: 100%; min-height: 120px; }
.ask-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 70; max-width: calc(100vw - 32px); display: flex; gap: 12px; align-items: center; }
.toast.show { opacity: 1; pointer-events: auto; }
.toast.bad { background: var(--danger); }
.toast button { background: transparent; color: #fdba74; border: 1px solid #fdba74; padding: 4px 10px; font-weight: 700; }
.print-area { display: none; }

/* 指で操作する端末 */
@media (pointer: coarse) {
  :root { --rowh: 56px; --slot: 48px; }
  button { min-height: 38px; }
  input, select, textarea { font-size: 16px; min-height: 38px; }
  .side button { padding: 13px 14px; }
}
/* 縦向きのiPad・スマホ：メニューと入力欄は上に重ねて出す */
@media (max-width: 1000px) {
  .side { position: absolute; z-index: 30; top: 0; bottom: 0; left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  body:not(.side-open) .side { display: none; }
  body.side-closed .side { display: none; }
  .panel { position: absolute; z-index: 25; top: 0; bottom: 0; right: 0; width: min(380px, 100%); box-shadow: -4px 0 20px rgba(0,0,0,.15); }
  .cards2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --namew: 92px; --slot: 36px; }
  main { padding: 10px 10px 40px; }
  .tb-title { font-size: 16px; }
  .mcal .day { min-height: 74px; padding: 4px; }
  .mcal .dn { font-size: 16px; }
  .mcal .cnt { font-size: 9px; }
  .cform .cf { grid-template-columns: 1fr; }
  .panel { width: 100%; }
}
@media print {
  body > *:not(#print-area) { display: none !important; }
  .print-area { display: block !important; font-size: 11px; color: #000; }
  .print-area h1 { font-size: 16px; margin: 0 0 6px; }
  .print-area table { border-collapse: collapse; width: 100%; }
  .print-area th, .print-area td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
  .print-area .pg { page-break-after: always; }
  .print-area .kit { font-size: 13px; }
  .print-area .kit h1 { font-size: 18px; }
  .print-area .kit th { width: 32%; background: #f3f3f3; }
  .print-area .kit td { padding: 10px 8px; }
  .print-area .kit-val { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 700; word-break: break-all; }
  .print-area .kit-blank { height: 34px; }
  .print-area .kit li { margin: 4px 0; }
  .print-area .tt-grid { display: grid; font-size: 9px; }
  .print-area .tt-cell { border: 1px solid #ccc; min-height: 22px; padding: 2px; overflow: hidden; }
  .print-area .tt-blk { background: #ddd; border: 1px solid #666; }
  body { background: #fff; padding: 0; }
}

/* メールアドレスとパスワードの入口 */
.gate-acct form { display: grid; gap: 12px; }
.gate-acct label { display: grid; gap: 4px; font-size: 13px; }
.gate-acct .err { margin: 0; }
.gate-who { margin: 0; font-weight: 700; word-break: break-all; }
.gate-msg { margin: 0; padding: 8px 10px; background: var(--blue-weak); border-radius: 6px; font-size: 13px; }
.gate-links { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; }
.linkbtn { background: none; border: none; padding: 6px 0; color: var(--blue); font-size: 13px; }
.gate-rc { display: grid; gap: 10px; }
.gate-rc h2 { margin: 0; font-size: 17px; }
.rc-code { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 16px; font-weight: 700; letter-spacing: 0; text-align: center; padding: 12px 8px; background: var(--accent-weak); border: 2px dashed var(--accent); border-radius: 8px; word-break: break-all; }
.warn-box { margin: 0; padding: 8px 10px; background: #fff7e6; border: 1px solid #f3d19c; border-radius: 6px; font-size: 13px; }
.rc-label { font-size: 12px; font-weight: 700; margin: 2px 0 -4px; }
.gate-rc .chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.gate-rc .chk input { width: auto; }

/* 受け口とそろえた状態（上の帯） */
.sync-state { margin-left: auto; font-size: 12px; white-space: nowrap; padding: 3px 8px; border-radius: 999px; color: var(--muted); }
.sync-state.ok { color: #15803d; background: #ecfdf3; }
.sync-state.busy { color: var(--blue); background: var(--blue-weak); }
.sync-state.warn { color: #b45309; background: #fff7e6; }
@media (max-width: 700px) { .sync-state { font-size: 11px; padding: 2px 6px; } }
