/* くみたてタイマー Web 版。色・角丸は Android 版（ui/theme.ts：Tailwind の stone 系）に合わせる */
:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --text: #292524;
  --text-sub: #78716c;
  --text-muted: #a8a29e;
  --ink: #292524;
  --chip: #f5f5f4;
  --chip-text: #57534e;
  --play: #10b981;
  --danger: #e11d48;
  --timer-bg: #f5f3ff; --timer-text: #6d28d9; --timer-strong: #ede9fe;
  --task-bg: #f0fdfa; --task-text: #0f766e; --task-strong: #ccfbf1;
  --seq-bg: #f8fafc; --seq-text: #334155; --seq-strong: #e2e8f0; --seq-border: #94a3b8;
  --par-bg: #f0f9ff; --par-text: #0369a1; --par-strong: #e0f2fe; --par-border: #38bdf8;
  --rep-bg: #fffbeb; --rep-text: #b45309; --rep-strong: #fef3c7; --rep-border: #fbbf24;
  --text-strong: #44403c;
  --on-ink: #ffffff;
  --ink-hover: #44403c;
  --header-bg: rgba(250, 250, 249, .92);
  --float-bg: rgba(255, 255, 255, .94);
  --danger-bg: #fff1f2;
  --running-bg: #ffe4e6;
  --ok-bg: #d1fae5;
  --pro: #6d28d9; --pro-bg: #f3e8ff; --pro-border: #c4b5fd; --pro-strong: #7c3aed;
  --ok-text: #047857;
  --warn: #f59e0b;
  --warn-text: #b45309;
  --warn-strong: #d97706;
  --rep-line: #fde68a;
  --rep-strong-text: #92400e;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px;
  --w: 640px;
  color-scheme: light;
}

/* 暗い画面（ヘッダーのボタンでいつでも切りかえる。最初は OS の設定に合わせる） */
html[data-theme='dark'] {
  --pro: #c4b5fd; --pro-bg: rgba(124, 58, 237, .2); --pro-border: #6d28d9; --pro-strong: #7c3aed;
  --bg: #0c0a09; --card: #1c1917; --border: #292524; --border-strong: #44403c;
  --text: #f5f5f4; --text-sub: #a8a29e; --text-muted: #78716c; --text-strong: #e7e5e4;
  --ink: #f5f5f4; --on-ink: #1c1917; --ink-hover: #d6d3d1;
  --chip: #292524; --chip-text: #d6d3d1;
  --danger: #fb7185;
  --header-bg: rgba(12, 10, 9, .9); --float-bg: rgba(28, 25, 23, .94);
  --danger-bg: #3f0d1c; --running-bg: rgba(244, 63, 94, .18); --ok-bg: rgba(16, 185, 129, .18); --ok-text: #34d399;
  --warn-text: #fbbf24; --warn-strong: #fbbf24; --rep-line: #78350f; --rep-strong-text: #fcd34d;
  --timer-bg: #1e1a2e; --timer-text: #c4b5fd; --timer-strong: #2e1065;
  --task-bg: #0d2420; --task-text: #5eead4; --task-strong: #134e4a;
  --seq-bg: #1a1d22; --seq-text: #cbd5e1; --seq-strong: #334155; --seq-border: #64748b;
  --par-bg: #0b1f2e; --par-text: #7dd3fc; --par-strong: #0c4a6e; --par-border: #0ea5e9;
  --rep-bg: #231a08; --rep-text: #fbbf24; --rep-strong: #78350f; --rep-border: #d97706;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, sans-serif;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--par-text); }
:focus-visible { outline: 2px solid var(--par-border); outline-offset: 2px; }
.icon { display: inline-block; flex: none; vertical-align: middle; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-sub); }
.center { text-align: center; }
.pad { padding: 16px; }
.stack { display: grid; gap: 12px; }
.note { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }
.noscript { max-width: var(--w); margin: 40px auto; padding: 0 16px; }

/* ---------------- 画面の骨組み（Web 用：PC は2列、スマホは1列） ---------------- */
:root { --page: 1200px; --header-h: 60px; }
body[data-mode='run'] .app { min-height: 100vh; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.panel-note { font-size: 13px; color: var(--text-muted); }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 2px 12px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.section-hint { font-size: 13px; color: var(--text-sub); margin: 0; }
.eyebrow { font-size: 13px; color: var(--text-sub); margin: 0; }
.small { font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--chip); }
.seg-btn { border: 0; background: none; padding: 6px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.seg-btn:hover { color: var(--text-sub); }
.seg-btn.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg-lg { margin-bottom: 14px; }
.seg-lg .seg-btn { padding: 6px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: 13px; line-height: 1.6; }
.chip-par { background: var(--par-bg); color: var(--par-text); }
.chip-rep { background: var(--rep-bg); color: var(--rep-text); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: 999px; color: var(--text-sub); flex: none; }
.icon-btn:hover { background: var(--chip); color: var(--text); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--text-sub); font-size: 14px; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }

/* ヘッダー */
.app-header { position: sticky; top: 0; z-index: 10; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.app-header-inner { max-width: var(--page); margin: 0 auto; height: var(--header-h); padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex: none; }
.brand img { border-radius: 7px; display: block; }
.brand-name { font-weight: 700; font-size: 17px; }
.name-input { flex: 1; min-width: 0; max-width: 440px; font-size: 18px; font-weight: 700; padding: 6px 10px; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); }
.name-input:hover { border-color: var(--border); background: var(--card); }
.name-input:focus { border-color: var(--border-strong); background: var(--card); outline: none; }
.run-name { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.header-tools { display: flex; gap: 2px; flex: none; margin-left: -6px; }
.run-name + .header-tools { margin-left: auto; }
.hbtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--card); font-size: 14px; font-weight: 700; color: var(--chip-text); }
.hbtn:hover { background: var(--chip); color: var(--text); }
.hbtn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.hbtn.primary:hover { background: var(--ink-hover); }

/* 組み立て（編集）：PC は左に組み立て、右にプレビュー（追従） */
.edit-layout { max-width: var(--page); margin: 0 auto; padding: 24px 24px 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); grid-template-areas: 'builder preview'; gap: 28px; align-items: start; }
.builder { grid-area: builder; min-width: 0; }
.preview { grid-area: preview; position: sticky; top: calc(var(--header-h) + 20px); min-width: 0; }
.preview-panel { padding: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.preview-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--chip); }
.total { font-size: 34px; font-weight: 700; margin: 0; line-height: 1.2; font-variant-numeric: tabular-nums; }
.preview .flow, .preview .gantt { max-height: calc(100vh - var(--header-h) - 300px); min-height: 60px; overflow: auto; }
.empty-timeline { font-size: 14px; color: var(--text-muted); text-align: center; padding: 24px 0; margin: 0; }
.start-row { display: flex; gap: 8px; margin-top: 18px; }
.start-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border: 0; border-radius: var(--r-md); background: var(--play); color: #fff; font-size: 17px; font-weight: 700; box-shadow: 0 2px 6px rgba(16, 185, 129, .3); }
.start-btn:hover:not(:disabled) { background: #0ea371; }
.schedule-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 52px; padding: 0 14px; border: 0; border-radius: var(--r-md); background: var(--ink); color: var(--on-ink); font-size: 14px; font-weight: 700; }
.schedule-btn:hover:not(:disabled) { background: var(--ink-hover); }
.start-btn:disabled, .schedule-btn:disabled { background: var(--border-strong); box-shadow: none; }

/* ブロックの木 */
.tree { padding-bottom: 8px; }
.children { display: grid; gap: 8px; }
.tree-empty { font-size: 14px; color: var(--text-muted); text-align: center; padding: 14px 0; margin: 0; }
.add-btn { margin-top: 8px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px; border-radius: var(--r-md); border: 1px dashed var(--border-strong); background: color-mix(in srgb, var(--card) 60%, transparent); color: var(--text-sub); font-size: 14px; font-weight: 700; }
.add-btn:hover { background: var(--card); border-color: var(--text-muted); color: var(--text); }
.tools { display: flex; align-items: center; flex: none; }
.tool { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--text-muted); border-radius: var(--r-sm); }
.tool:hover:not(:disabled) { background: var(--chip); color: var(--text); }
.tool:disabled { opacity: .2; }
.leaf { display: flex; align-items: center; gap: 12px; padding: 8px 6px 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); }
.leaf:hover { border-color: var(--border-strong); }
.leaf-color { width: 6px; align-self: stretch; border-radius: 999px; flex: none; }
.leaf-body { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; text-align: left; border: 0; background: none; padding: 6px 0; }
.leaf-label { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.leaf-sec { font-size: 14px; color: var(--text-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.leaf-body:hover .leaf-label { text-decoration: underline; text-underline-offset: 3px; }
.block { border-radius: var(--r-lg); border-left: 4px solid; padding: 10px 10px 10px 12px; }
.block-seq { background: var(--seq-bg); border-color: var(--seq-border); color: var(--seq-text); }
.block-par { background: var(--par-bg); border-color: var(--par-border); color: var(--par-text); }
.block-rep { background: var(--rep-bg); border-color: var(--rep-border); color: var(--rep-text); }
.block .leaf, .block .tree-empty { color: var(--text); }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 30px; }
.block-label { font-size: 15px; font-weight: 700; flex: none; }
.block-hint-inline { font-size: 13px; color: var(--text-sub); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-dur { flex: 1; text-align: right; font-size: 13px; color: var(--text-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; background: var(--card); border: 1px solid var(--rep-line); border-radius: 999px; flex: none; }
.step-btn { width: 30px; height: 28px; border: 0; background: none; color: var(--rep-text); font-size: 15px; border-radius: 999px; }
.step-btn:hover { background: var(--rep-bg); }
.step-val { min-width: 44px; text-align: center; font-size: 14px; font-weight: 700; color: var(--rep-strong-text); }

@media (max-width: 959px) {
  .app-header-inner { padding: 0 16px; gap: 10px; }
  .brand-name { display: none; }
  .hbtn { padding: 0 10px; }
  .edit-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'preview' 'builder'; padding: 16px 16px 120px; gap: 20px; }
  .preview { position: static; }
  .preview .flow, .preview .gantt { max-height: none; }
  .start-row { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--header-bg); border-top: 1px solid var(--border); }
  .start-btn, .schedule-btn { height: 54px; }
}
@media (max-width: 600px) {
  /* 名前は2段目に回して、ボタンが増えても名前を読めるようにする */
  .app-header-inner { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .name-input { order: 10; flex: 1 1 100%; max-width: none; padding: 4px 8px; }
  .run-name { order: 10; flex: 1 1 100%; }
  .hbtn span { display: none; }
  .hbtn { width: 38px; padding: 0; justify-content: center; }
  .block-hint-inline { display: none; }
  .schedule-label { display: none; }
  .schedule-btn { width: 56px; padding: 0; }
  .leaf-body { flex-direction: column; gap: 0; }
  .leaf { gap: 8px; padding: 6px 2px 6px 10px; }
  .block { padding: 8px 6px 8px 8px; }
  .tool { width: 28px; }
}

/* タイムライン（Gantt） */
.gantt-area { position: relative; }
.bar { position: absolute; height: 26px; border-radius: 6px; padding: 0 6px; display: flex; align-items: center; overflow: hidden; }
.bar.past { opacity: .3; }
.bar.extended { outline: 1.5px dashed #fff; outline-offset: -2.5px; }
.bar-text { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-line { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 999px; background: #f43f5e; }
.axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* フロー図 */
.flow { overflow-x: auto; }
.flow-inner { display: flex; flex-direction: column; align-items: stretch; padding: 8px 6px; }
.fcol { display: flex; flex-direction: column; align-items: stretch; }
.frow { display: flex; align-items: stretch; }
.fbranch { display: flex; flex-direction: column; align-items: stretch; padding: 0 3px; min-width: 0; }
.vline { width: 2px; height: 12px; align-self: center; background: var(--border-strong); flex: none; }
.vline.grow { flex: 1 0 12px; height: auto; }
.fpar { position: relative; }
.hline { position: absolute; height: 2px; background: var(--border-strong); }
.hline.top { top: 0; }
.hline.bottom { bottom: 0; }
.flow-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 6px 0; }
.terminal { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 700; }
.fpar-pill { align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--par-strong); color: var(--par-text); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.frep { padding: 6px; border-radius: var(--r-md); border: 1.5px dashed var(--rep-border); background: var(--rep-bg); }
.frep-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--rep-text); white-space: pre; }
.ftimer { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 6px 6px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--card); overflow: hidden; text-align: center; }
.ftimer-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.ftimer-label { font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ftimer-sub { display: flex; align-items: center; gap: 3px; font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.ftimer-sub.live { color: var(--text); font-weight: 700; }
.ftimer-wrap { position: relative; }
.ftimer.active { border: 0; padding-top: 10px; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.ftimer.active .ftimer-sub { color: #fff; }
.ftimer.paused { border-width: 2px; border-style: dashed; background: var(--chip); }
.ftimer.paused .ftimer-label { color: var(--text-sub); }
.ftimer.done { opacity: .6; background: var(--bg); }
.ftimer.done .ftimer-label, .ftimer.done .ftimer-sub { color: var(--text-muted); }
.fprog { align-self: stretch; height: 4px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.fprog i { display: block; height: 100%; border-radius: 999px; background: #fff; }
.fprog.paused { background: var(--border); }
.fprog.paused i { background: var(--text-muted); }
/* 動いているタイマーの波紋。transform で広げるとフロー図のスクロール幅が変わってちらつくので、影で描く */
.pulse { position: absolute; inset: 0; border-radius: var(--r-md); pointer-events: none; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { box-shadow: 0 0 0 0 currentColor; opacity: .55; } to { box-shadow: 0 0 0 7px currentColor; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; box-shadow: 0 0 0 3px currentColor; opacity: .35; } }

/* ---------------- 実行（全幅・大きな数字。F キーで全画面） ---------------- */
.run-layout { max-width: var(--page); margin: 0 auto; padding: 20px 24px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.run-top { display: flex; align-items: center; gap: 16px; }
.badge { padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; flex: none; }
.badge.running { background: var(--running-bg); color: var(--danger); }
.badge.paused { background: var(--border); color: var(--chip-text); }
.badge.done { background: var(--ok-bg); color: var(--ok-text); }
.overall { flex: 1; min-width: 0; }
.overall-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 15px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.overall-track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.overall-track i { display: block; height: 100%; border-radius: 999px; background: var(--ink); transition: width .2s linear; }
.notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; border-radius: var(--r-md); background: var(--rep-bg); font-size: 14px; color: var(--rep-text); }
.notice-btn { border: 1px solid var(--rep-border); background: var(--card); color: var(--rep-text); border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 700; }
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 560px); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-md); background: var(--ink); color: var(--on-ink); font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); animation: toast-in .2s ease-out; }
.fullscreen .toast { top: 20px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -6px); } }

.cards { display: grid; gap: 16px; }
.cards.single { grid-template-columns: minmax(0, 1fr); }
.cards.multi { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards.multi.n2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card-cell { min-width: 0; }
.timer-card { position: relative; height: 100%; padding: 28px 32px; border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.single .timer-card { padding: 32px 40px 36px; text-align: center; }
.single .card-title-row { justify-content: center; }
.timer-card.compact { padding: 20px 22px; }
.timer-card.paused { background: var(--bg); border: 2px dashed var(--border-strong); box-shadow: none; }
.card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; min-width: 0; padding-right: 150px; flex-wrap: wrap; }
.single .card-title-row { padding: 0 92px; }
.dot { width: 12px; height: 12px; border-radius: 999px; flex: none; }
.card-label { min-width: 0; font-size: 20px; font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact .card-label { font-size: 17px; }
.card-buttons { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
.card-btn { width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--chip); color: var(--chip-text); display: grid; place-items: center; }
.card-btn:hover { background: var(--border); color: var(--text); }
.card-btn.active { background: var(--play); color: #fff; }
.timer-card.ro .card-title-row { padding-right: 0; }
.card-btn.ext-btn { width: auto; padding: 0 12px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* 延長した分のしるし */
.ext-chip { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-text); font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.card-ctx { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.card-ctx.rep { color: var(--rep-text); }
.card-ctx.paused { color: var(--text-sub); }
.card-ctx.over { color: var(--warn-text); }
.remaining { font-size: clamp(56px, 7vw, 88px); font-weight: 700; line-height: 1.1; margin: 4px 0 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.single .remaining { font-size: clamp(88px, 15vw, 200px); line-height: 1; margin: 8px 0 4px; }
.compact .remaining { font-size: clamp(44px, 4.6vw, 64px); }
.remaining.paused { color: var(--text-muted); }
.remaining.over { color: var(--warn-text); }
.track { height: 10px; margin-top: 16px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.single .track { max-width: 760px; margin: 18px auto 0; }
.track i { display: block; height: 100%; border-radius: 999px; transition: width .2s linear; }
.track i.paused { opacity: .4; }
.complete-btn { margin: 16px auto 0; width: 100%; max-width: 360px; display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; border: 0; border-radius: var(--r-md); color: #fff; font-size: 16px; font-weight: 700; }
.complete-btn:hover { filter: brightness(.95); }
.multi-note { margin: 10px 0 0; font-size: 14px; color: var(--par-text); text-align: center; }
.wait-card, .done-card { display: grid; justify-items: center; gap: 6px; padding: 40px 24px; border-radius: var(--r-xl); text-align: center; }
.wait-card { background: var(--card); border: 1px solid var(--border); }
.wait-label { font-size: 15px; font-weight: 700; color: var(--text-sub); margin: 0; }
.wait-time { font-size: clamp(72px, 12vw, 160px); font-weight: 700; margin: 0; line-height: 1; font-variant-numeric: tabular-nums; }
.wait-sub { font-size: 15px; color: var(--text-sub); margin: 0; }
.start-now, .again { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--play); color: #fff; font-size: 15px; font-weight: 700; }
.done-wrap { display: grid; gap: 16px; justify-items: center; }
.done-card { width: 100%; background: var(--play); color: #fff; }
.done-title { margin: 6px 0 0; font-size: 28px; font-weight: 700; }
.done-sub { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .88); }
.done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.again { background: rgba(255, 255, 255, .22); }
.again:hover { background: rgba(255, 255, 255, .32); }
.again.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .5); }

.run-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.upcoming-col .section-title { margin: 4px 2px 10px; }
.upcoming { display: grid; gap: 6px; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); }
.dot-small { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.up-label { flex: 1; min-width: 0; font-size: 15px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-ctx { font-size: 13px; color: var(--text-muted); }
.up-time { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.controls { position: sticky; bottom: 16px; z-index: 8; justify-self: center; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 999px; background: var(--float-bg); border: 1px solid var(--border); box-shadow: 0 8px 28px rgba(0, 0, 0, .12); backdrop-filter: blur(8px); }
.stop-btn { width: 56px; height: 56px; border-radius: 999px; border: 0; background: var(--border); color: var(--chip-text); display: grid; place-items: center; flex: none; }
.stop-btn:hover { background: var(--border-strong); color: var(--text); }
.toggle-btn { width: 260px; height: 56px; border-radius: 999px; border: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-size: 17px; font-weight: 700; }
.toggle-btn.running { background: var(--ink); color: var(--on-ink); }
.toggle-btn.running:hover { background: var(--ink-hover); }
.toggle-btn.paused { background: var(--play); }
.toggle-btn:disabled { background: var(--border-strong); }
.dev-btn { width: 56px; height: 56px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); display: grid; place-items: center; align-content: center; line-height: 1.1; flex: none; }
.dev-btn b { font-size: 12px; color: var(--text-strong); }
.dev-btn small { font-size: 8px; color: var(--text-muted); }
.run-hint { margin: -6px 0 0; text-align: center; font-size: 13px; color: var(--text-muted); }
@media (hover: none) and (pointer: coarse) { .run-hint { display: none; } }

/* 残り1分を切ったタイマー */
.timer-card.warn .remaining, .timer-card.warn .card-ctx { color: var(--warn-strong); }
.timer-card.warn .track i { background-color: var(--warn) !important; }
.timer-card.warn { box-shadow: inset 0 0 0 2px var(--warn); }

/* ---------------- 全画面（研修・授業で映す。F キー） ---------------- */
.fs { height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 1vh; padding: clamp(16px, 2.2vw, 44px) clamp(20px, 3vw, 60px); background: var(--bg); }
.fs.warn { box-shadow: inset 0 0 0 clamp(6px, .6vw, 12px) var(--warn); }
.fs-top { display: flex; justify-content: space-between; align-items: center; gap: 2vw; min-width: 0; }
.fs-title { display: flex; align-items: center; gap: 1.2vw; min-width: 0; }
.fs-title b { font-size: clamp(16px, 1.8vw, 36px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs .badge { font-size: clamp(12px, 1.3vw, 26px); padding: .3em .9em; }
.fs-clock { text-align: right; color: var(--text-sub); font-size: clamp(13px, 1.5vw, 30px); line-height: 1.3; font-variant-numeric: tabular-nums; flex: none; }
.fs-clock strong { display: block; color: var(--text); font-size: clamp(20px, 2.4vw, 48px); }
.fs-main { display: grid; align-content: center; min-height: 0; }
.fs .cards.single .timer-card { background: none; border: 0; box-shadow: none; padding: 0; text-align: center; }
.fs .cards.single .card-title-row { justify-content: center; padding: 0 0 0 0; gap: .5em; }
.fs .cards.single .card-label { font-size: clamp(24px, 3.6vw, 76px); color: var(--text); }
.fs .cards.single .dot { width: .55em; height: .55em; font-size: clamp(24px, 3.6vw, 76px); }
.fs .cards.single .card-ctx { font-size: clamp(14px, 1.7vw, 34px); color: var(--text-sub); }
.fs .cards.single .timer-card.warn .card-ctx, .fs.warn .card-label { color: var(--warn-strong); }
.fs .cards.single .remaining { font-size: min(22vw, 44vh); line-height: .95; font-weight: 800; letter-spacing: -.03em; margin: .5vh 0 0; }
.fs .cards.single .track { width: min(70vw, 1500px); max-width: none; height: clamp(8px, 1.2vw, 22px); margin: 2.5vh auto 0; }
.fs .cards.single .card-buttons { top: 0; right: 0; }
.fs .cards.single .complete-btn { max-width: 420px; height: clamp(48px, 5vh, 72px); font-size: clamp(16px, 1.6vw, 28px); margin-top: 3vh; }
.fs .cards.multi { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 2vw; }
.fs .cards.multi .timer-card { padding: 2vw 2.2vw; border-radius: clamp(14px, 1.6vw, 32px); }
.fs .card-title-row { padding-right: 0; flex-wrap: nowrap; }
/* 全画面では、操作ボタンは名前の上に重ねて出す（マウスが止まると隠れる） */
.fs .card-buttons { padding: 3px; border-radius: 999px; background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.fs .cards.multi .card-label { font-size: clamp(18px, 2.3vw, 46px); color: var(--text); }
.fs .cards.multi .remaining { font-size: min(9vw, calc(36vh / var(--rows))); line-height: 1; font-weight: 800; }
.fs .cards.multi .track { height: clamp(6px, .9vw, 16px); }
.fs .card-buttons, .fs-controls, .fs-hide-idle { transition: opacity .25s; }
.fs-center { display: grid; justify-items: center; text-align: center; gap: 1vh; }
.fs-label { margin: 0; font-size: clamp(18px, 2.6vw, 52px); font-weight: 700; color: var(--text-sub); }
.fs-big { margin: 0; font-size: min(22vw, 44vh); font-weight: 800; line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fs-sub { margin: 0; font-size: clamp(14px, 2.2vw, 44px); color: var(--text-sub); }
.fs-done { margin: 0; font-size: min(8vw, 16vh); font-weight: 800; line-height: 1.15; color: var(--play); }
.fs-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 2vh; }
.start-now.ghost { background: transparent; color: var(--text-sub); border: 1px solid var(--border-strong); }
.fs-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 3vw; color: var(--text-sub); font-size: clamp(13px, 1.6vw, 32px); min-width: 0; }
.fs-next { display: flex; align-items: center; gap: .6em; min-width: 0; }
.fs-next b { color: var(--text); font-size: 1.35em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-pill { font-size: .8em; font-weight: 700; padding: .1em .8em; border-radius: 999px; border: 1px solid var(--border-strong); white-space: nowrap; }
.fs-overall { width: min(34vw, 640px); flex: none; display: grid; gap: .8vh; text-align: right; font-variant-numeric: tabular-nums; }
.fs-steps { display: flex; gap: .35vw; }
.fs-steps span { flex: 1; height: clamp(5px, .7vw, 12px); border-radius: 999px; background: var(--border); }
.fs-steps span.done { background: var(--text-muted); }
.fs-steps span.now { background: var(--play); }
.fs.warn .fs-steps span.now { background: var(--warn); }
.fs-track { height: clamp(5px, .7vw, 12px); border-radius: 999px; background: var(--border); overflow: hidden; }
.fs-track i { display: block; height: 100%; background: var(--text-muted); }
.fs-controls { position: fixed; left: 50%; top: clamp(12px, 1.6vw, 36px); bottom: auto; transform: translateX(-50%); }
.icon-btn.round { width: 48px; height: 48px; background: var(--chip); color: var(--text); }
.icon-btn.round:hover { background: var(--border); }
.fs .toast { font-size: clamp(15px, 1.8vw, 34px); width: auto; max-width: 80vw; padding: .7em 1.4em; }
body.idle { cursor: none; }
body.idle .fs-controls, body.idle .fs .card-buttons, body.idle .fs-hide-idle { opacity: 0; pointer-events: none; }

@media (max-width: 959px) {
  .run-layout { padding: 16px 16px 24px; gap: 14px; }
  .run-bottom { grid-template-columns: minmax(0, 1fr); }
  .single .timer-card { padding: 24px 20px 28px; }
  .single .card-title-row { padding: 0 84px 0 0; justify-content: flex-start; }
  .single .timer-card { text-align: left; }
  .timer-card { padding: 20px; }
  .card-label { font-size: 16px; }
  .controls { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toggle-btn { width: min(52vw, 240px); }
}
@media (max-width: 600px) {
  .run-top { flex-wrap: wrap; gap: 10px; }
  .overall { order: 3; flex-basis: 100%; }
  .run-top .icon-btn { margin-left: auto; }
  /* 同時に動くタイマーは1列に並べ、名前を省略しない */
  .cards.multi, .cards.multi.n2 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cards.multi .timer-card { padding: 14px 16px; border-radius: var(--r-lg); }
  .cards.multi .card-title-row { padding-right: 80px; min-height: 34px; }
  .cards.multi .card-buttons { top: 12px; right: 12px; }
  .cards.multi .card-btn { width: 34px; height: 34px; }
  .cards.multi .track { margin-top: 10px; height: 8px; }
  .cards.multi .card-ctx { margin: 2px 0 0; }
  .cards.multi .card-ctx.blank { display: none; }
  .cards.multi .remaining { margin-top: 2px; }
  .compact .remaining { font-size: clamp(40px, 12vw, 52px); }
  .single .remaining { font-size: clamp(72px, 22vw, 110px); }
}

/* ---------------- シート・ダイアログ ---------------- */
.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.overlay.center { align-items: center; padding: 16px; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--card); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); animation: slide-up .2s ease-out; }
@keyframes slide-up { from { transform: translateY(24px); } }
@media (min-width: 700px) {
  .overlay:not(.center) { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-xl); padding-bottom: 24px; }
}
.handle { width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 0 auto 16px; }
.sheet-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: var(--text-muted); border-radius: 999px; }
.sheet-close:hover { background: var(--chip); color: var(--text); }
.sheet-title { font-size: 20px; font-weight: 700; margin: 0 0 12px; }
.sheet-desc { font-size: 13.5px; line-height: 1.5; color: var(--text-sub); margin: -8px 0 12px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: none; border-radius: var(--r-md); text-align: left; }
.menu-item:hover { background: var(--chip); }
.menu-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; }
.mi-timer { background: var(--timer-strong); color: var(--timer-text); }
.mi-task { background: var(--task-strong); color: var(--task-text); }
.mi-seq { background: var(--seq-strong); color: var(--seq-text); }
.mi-par { background: var(--par-strong); color: var(--par-text); }
.mi-rep { background: var(--rep-strong); color: var(--rep-text); }
.mi-danger { background: var(--danger-bg); color: var(--danger); }
.menu-body { flex: 1; display: grid; }
.menu-title { font-size: 15px; font-weight: 700; }
.menu-title.danger { color: var(--danger); }
.menu-desc { font-size: 13px; color: var(--text-sub); }
.field-label { display: block; font-size: 14px; color: var(--chip-text); margin: 0 0 4px; }
.input { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 10px 12px; font-size: 15px; margin-bottom: 12px; background: var(--card); }
.duration-row { display: flex; align-items: center; gap: 8px; }
.num-input { width: 80px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.unit { font-size: 14px; color: var(--text-sub); margin-bottom: 12px; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quick { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: none; font-size: 14px; color: var(--text-strong); }
.quick:hover { background: var(--chip); }
.form-note { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); margin: 12px 0 0; }
.form-buttons { display: flex; gap: 8px; margin-top: 20px; }
.delete-btn { padding: 12px 16px; border: 0; border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 700; }
.save-btn { flex: 1; padding: 12px; border: 0; border-radius: var(--r-md); background: var(--ink); color: var(--on-ink); font-size: 14px; font-weight: 700; }
.save-btn.narrow { flex: none; padding: 12px 28px; }
.time-box { display: grid; justify-items: center; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--border-strong); cursor: pointer; }
.time-input { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; border: 0; background: none; text-align: center; padding: 0; }
.time-hint { font-size: 12px; color: var(--text-muted); }
.result { margin-top: 12px; padding: 12px; border-radius: var(--r-md); background: var(--chip); font-size: 14px; line-height: 1.5; color: var(--text-strong); text-align: center; }
.result.error { background: var(--danger-bg); color: var(--danger); }
.task-note { display: flex; gap: 8px; margin-top: 8px; padding: 10px; border-radius: var(--r-md); background: var(--rep-bg); color: var(--rep-text); font-size: 12px; line-height: 1.5; }
.task-note .icon { margin-top: 3px; }
.confirm-btn { margin-top: 16px; width: 100%; padding: 14px; border: 0; border-radius: var(--r-md); background: var(--play); color: #fff; font-size: 15px; font-weight: 700; }
.confirm-btn:disabled { background: var(--border-strong); }
.io-sheet .seg { margin-bottom: 10px; }
.code { width: 100%; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); padding: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, 'Noto Sans Mono CJK JP', monospace; font-size: 13px; line-height: 1.5; resize: vertical; min-height: 180px; }
.io-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.io-msg { flex: 1 1 100%; order: 2; font-size: 13px; min-height: 18px; }
@media (min-width: 480px) { .io-msg { flex: 1 1 0; order: 0; } }
.io-msg.ok { color: var(--ok-text); }
.io-msg.err { color: var(--danger); }
.small-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--card); font-size: 13px; font-weight: 700; }
.small-btn:hover { background: var(--chip); }
.small-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.file-btn { cursor: pointer; margin-bottom: 10px; }
.file-btn:focus-within { outline: 2px solid var(--par-border); outline-offset: 2px; }
.dialog { position: relative; width: min(100%, 360px); background: var(--card); border-radius: var(--r-lg); padding: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: slide-up .15s ease-out; }
.dialog-title { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.dialog-msg { font-size: 14px; color: var(--chip-text); margin: 0; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-btn { padding: 8px 16px; border-radius: var(--r-md); border: 0; font-size: 14px; font-weight: 700; background: var(--chip); }
.dialog-btn.danger { background: var(--danger); color: #fff; }
.dialog-btn.primary { background: var(--ink); color: var(--on-ink); }
.drop-hint { display: none; }
body.dragging .drop-hint { display: flex; position: fixed; inset: 8px; z-index: 40; align-items: center; justify-content: center; border: 3px dashed var(--ink); border-radius: var(--r-lg); background: var(--header-bg); font-size: 20px; font-weight: 700; }
body[data-mode='run'] .drop-hint { display: none !important; }

/* ---------------- 広告枠（0002） ---------------- */
.ad { margin: 0 auto; max-width: 100%; }
.ad-label { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
.ad-top-banner { max-width: var(--page); padding: 12px 24px 0; }
.ad-side { margin-top: 24px; }
.ad-done-mrec { width: 336px; }
.ad-guest-banner { width: min(100%, 728px); }
.ad-guest-banner .ad-ph { min-height: 60px; }
.ad-ph { display: grid; place-items: center; min-height: 90px; border: 2px dashed var(--border-strong); border-radius: var(--r-sm); color: var(--text-muted); font-size: 12px; text-align: center; padding: 8px; }
.ad-side .ad-ph { min-height: 250px; }
.ad-done-mrec .ad-ph { min-height: 280px; }
@media (max-width: 959px) { .ad-top-banner { padding: 12px 16px 0; } .ad-ph { min-height: 60px; } }

/* ---------------- 読みもの（トップの説明・使い方・プライバシーポリシーなど） ---------------- */
.intro { display: none; max-width: var(--page); margin: 8px auto 0; padding: 28px 24px 8px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-strong); }
body[data-mode='edit'] .intro { display: block; }
.intro h2 { font-size: 17px; margin: 0 0 8px; color: var(--text); }
.intro h3 { font-size: 14px; margin: 16px 0 4px; color: var(--text); }
.intro ul { padding-left: 20px; margin: 6px 0; }
.intro li { margin: 4px 0; }
.intro-grid { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 700px) { .intro-grid { grid-template-columns: repeat(3, 1fr); } }
.intro { font-size: 15px; }
.intro h2 { font-size: 20px !important; }
.intro-grid > div { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }
.intro-grid h3 { margin-top: 0; }
.intro-grid p { margin: 0; font-size: 13px; }
.site-footer { max-width: var(--page); margin: 24px auto 0; padding: 16px 16px 32px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 8px; }
.site-footer a { color: var(--text-sub); }
body[data-mode='run'] .site-footer, body[data-mode='guest'] .site-footer { display: none; }
@media (max-width: 959px) { body[data-mode='edit'] .site-footer { padding-bottom: 110px; } }
.page-head { max-width: var(--w); margin: 0 auto; padding: 20px 16px 4px; }
.page-head h1 { font-size: 24px; margin: 4px 0; }
.page-back { font-size: 13px; color: var(--text-sub); text-decoration: none; }
.page-lead { color: var(--text-sub); margin: 0; font-size: 13px; }
.article { max-width: var(--w); margin: 0 auto; padding: 0 16px; font-size: 14px; color: var(--text-strong); }
.article h2 { font-size: 16px; color: var(--text); margin: 24px 0 6px; }
.article ul { padding-left: 20px; }
.article li { margin: 4px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; background: var(--card); }
.table th, .table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.table th { background: var(--chip); white-space: nowrap; }
.code-block { background: var(--ink); color: #f5f5f4; padding: 12px 14px; border-radius: var(--r-md); overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--chip); padding: 0 4px; border-radius: 4px; font-size: .92em; }

/* ---------------- シートの中身（Web 版） ---------------- */
.sheet-templates, .sheet-share, .sheet-import, .sheet-add { max-width: 640px; }
@media (min-width: 700px) { .handle { display: none; } .sheet { padding-top: 22px; } }
.menu-grid { display: grid; gap: 2px; }
@media (min-width: 700px) { .menu-grid { grid-template-columns: 1fr 1fr; gap: 6px; } .menu-grid .menu-item { border: 1px solid var(--border); } }
.opt-icon { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--ink); color: var(--on-ink); display: grid; place-items: center; flex: none; }
.opt-icon.light { background: var(--chip); color: var(--text-sub); }
.opt-title { font-size: 16px; font-weight: 700; }
.opt-desc { font-size: 13px; line-height: 1.5; color: var(--text-sub); }
.opt-total { font-size: 12px; color: var(--chip-text); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tpl-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); }
.tpl-card:hover { border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.choice-list { display: grid; gap: 4px; margin-bottom: 8px; }
.url-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; color: var(--chip-text); }
.form-note.warn { color: var(--rep-text); }


/* ---------------- オンライン共有（0008） ---------------- */
.hbtn.live { border-color: #7dd3fc; background: #e0f2fe; color: #0369a1; }
.hbtn.live:hover { background: #bae6fd; }
html[data-theme='dark'] .hbtn.live { background: #0c2a3d; color: #7dd3fc; border-color: #075985; }
.live-pill { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #7dd3fc; background: #e0f2fe; color: #0369a1; font-size: 13.5px; font-weight: 800; white-space: nowrap; }
html[data-theme='dark'] .live-pill { background: #0c2a3d; color: #7dd3fc; border-color: #075985; }
.lp-short { display: none; }
@media (max-width: 600px) { .lp-long { display: none; } .lp-short { display: inline; } .live-pill { padding: 0 10px; gap: 6px; } }
.live-pill.retrying, .live-pill.connecting { border-color: var(--border-strong); background: var(--chip); color: var(--text-sub); }
.live-dot { width: 9px; height: 9px; border-radius: 999px; background: #0284c7; flex: none; }
.live-pill .live-dot, .live-dot.open { animation: live-blink 1.6s infinite; }
.live-dot.retrying, .live-dot.connecting, .live-pill.retrying .live-dot { background: var(--warn); animation: none; }
@keyframes live-blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none !important; } }

.live-box { display: grid; gap: 10px; border-color: #7dd3fc; }
html[data-theme='dark'] .live-box { border-color: #075985; }
.live-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.live-head b { font-size: 15px; }
.live-code b { font-size: 17px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.live-count, .live-left { color: var(--text-sub); font-variant-numeric: tabular-nums; }
.live-left.warn { color: var(--warn-strong); font-weight: 800; }
.live-more { margin-left: auto; }
.live-cur { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: #fef3c7; color: #78350f; font-size: 14px; }
html[data-theme='dark'] .live-cur { background: #3a2a06; color: #fde68a; }
.live-cur span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.live-cur .link-btn { color: inherit; }
.live-row { display: flex; gap: 8px; }
.live-row .input { margin: 0; flex: 1; min-width: 0; }
.live-row .small-btn { flex: none; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: none; color: var(--chip-text); font-size: 13px; }
.preset:hover { background: var(--chip); }

.live-sheet { display: grid; gap: 12px; }
.live-sheet .sheet-title, .live-sheet .sheet-desc { margin: 0; }
.live-points { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 14px; color: var(--text-strong); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sheet-actions .save-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; }
.live-join { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.qr { display: block; border-radius: 8px; }
.live-qr { width: 168px; height: 168px; border: 1px solid var(--border); }
.live-join-info small { color: var(--text-sub); font-size: 13px; }
.live-code-big { margin: 2px 0; font-size: 40px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.live-sheet .url-input, .live-sheet .code-input { margin: 0; }
.code-input { font-size: 28px; font-weight: 800; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; }

/* 全画面・参加者の画面：メッセージ */
.fs-msg-slot { display: grid; justify-items: center; min-height: 0; }
.fs-msg { max-width: min(100%, 1400px); display: grid; gap: .2em; padding: .55em 1.2em; border-radius: clamp(10px, 1.2vw, 24px); background: #fef3c7; color: #78350f; font-weight: 800; font-size: clamp(16px, 2.2vw, 46px); line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.fs-msg small { font-size: .55em; font-weight: 700; opacity: .8; }
html[data-theme='dark'] .fs-msg { background: #3a2a06; color: #fde68a; }
.fs-msg.flash { animation: msg-flash 1.4s ease-out; }
@keyframes msg-flash { 0%, 30% { box-shadow: 0 0 0 clamp(4px, .5vw, 10px) var(--warn); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .fs-msg.flash { animation: none; } }
/* 全画面（進行役）：参加コードと QR */
.fs-join { display: flex; align-items: center; gap: .8vw; padding: .6vw .9vw; border-radius: clamp(10px, 1.2vw, 22px); background: var(--card); border: 1px solid var(--border); flex: none; }
.fs-qr { width: clamp(64px, 7vw, 150px); height: clamp(64px, 7vw, 150px); }
.fs-join small { display: block; font-size: clamp(11px, 1vw, 20px); color: var(--text-sub); }
.fs-join b { font-size: clamp(18px, 2.2vw, 44px); letter-spacing: .06em; color: var(--text); font-variant-numeric: tabular-nums; }

/* 参加者の画面 */
.fs.guest { height: auto; min-height: 100vh; min-height: 100dvh; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.g-right { display: flex; align-items: center; gap: 1.2vw; flex: none; }
.g-tools { display: flex; gap: 2px; }
.g-conn { display: inline-flex; align-items: center; gap: 6px; font-size: clamp(12px, 1.2vw, 22px); font-weight: 800; color: var(--play); white-space: nowrap; flex: none; }
.g-conn i { width: .6em; height: .6em; border-radius: 999px; background: currentColor; }
.g-conn.off { color: var(--danger); }
.g-conn.wait, .g-conn.end { color: var(--text-muted); }
.g-sub { margin: 0; font-size: clamp(14px, 1.8vw, 34px); color: var(--text-sub); max-width: 40em; }
.g-status, .g-paused { justify-self: center; padding: .35em 1.1em; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-weight: 800; font-size: clamp(14px, 1.6vw, 30px); }
.g-paused { margin: 0 0 1vh; }
.g-wait { gap: 1.4vh; }
.g-plan { width: min(100%, 560px); display: grid; gap: 6px; text-align: left; }
.g-plan div { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); font-size: 15px; }
.g-plan-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-plan-time { color: var(--text-sub); font-variant-numeric: tabular-nums; }
.g-changed { margin: 0; min-height: 1.5em; color: #0284c7; font-weight: 700; font-size: 14px; }
.g-event { top: 12px; }
.g-event.extend { background: #064e3b; color: #ecfdf5; }
.g-note { margin: 0; text-align: center; font-size: 12px; color: var(--text-muted); }
.g-note a { color: inherit; }
@media (max-width: 700px) {
  .fs .cards.multi { grid-template-columns: minmax(0, 1fr); }
  .fs .cards.multi .remaining { font-size: clamp(40px, 13vw, 64px); }
  .fs.guest .cards.single .remaining { font-size: min(26vw, 30vh); }
  .fs-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .fs-overall { width: 100%; text-align: left; }
  .fs-join { display: none; }
  .card-title-row { padding-right: 0; padding-top: 44px; }
  .cards.multi .card-title-row { padding-right: 0; }
  .timer-card.ro .card-title-row { padding-top: 0; }
}
.run-name ~ .live-pill { margin-left: auto; }

/* ---- 予定（参加者の画面・進行役の全画面で「予定」に切りかえたとき。0008） */
.plan-panel { font-size: 14px; }
.plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-right: 40px; }
.plan-head b { font-size: 15px; }
.plan-head .seg { margin-left: auto; }
.plan-head .seg-btn { padding: 4px 14px; font-size: 13px; }
.plan-note { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }
.plan-list { display: flex; flex-direction: column; }
.plan-row { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.plan-row::before { content: ''; position: absolute; left: 16px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.plan-row:first-child::before { top: 50%; }
.plan-row:last-child::before { bottom: 50%; }
.plan-pt { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; margin-left: 3px; }
.plan-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-time { font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-row.done .plan-name, .plan-row.done .plan-time { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.plan-row.now { background: var(--par-bg); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: var(--r-md); background: var(--chip); text-align: left; color: var(--text); }
.switch-row b { display: block; font-size: 14px; }
.switch-row small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--text-sub); }
.switch { position: relative; flex: none; width: 40px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch-row[aria-checked='true'] .switch { background: var(--play); }
.switch-row[aria-checked='true'] .switch::after { transform: translateX(16px); }

/* ---- 全画面で大きく出すもの（タイマー・予定）の切りかえ */
.fs-view { flex: none; display: flex; justify-content: center; }
.fs-view .seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; font-size: clamp(13px, 1.1vw, 20px); }
.fs-main.plan { display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; }
.fs-main.plan > .g-paused { flex: none; }
.fs-planview { display: flex; flex-direction: column; justify-content: center; gap: 1.6vh; width: min(100%, 1600px); max-height: 100%; min-height: 0; }
.fs-planview > .plan-panel { flex: 0 1 auto; }
.fs-nowstrip { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4em 1.4em; font-size: clamp(16px, 2vw, 40px); }
.fs-now-label { font-size: .6em; font-weight: 800; color: var(--par-text); border: 1px solid var(--par-border); border-radius: 6px; padding: 0 .4em; align-self: center; }
.fs-now-item { display: inline-flex; align-items: baseline; gap: .4em; min-width: 0; }
.fs-now-item .dot-small { align-self: center; }
.fs-now-item b { font-weight: 800; }
.fs-now-time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.5em; letter-spacing: -.01em; }
.fs-now-more { font-size: .7em; color: var(--text-sub); }
.plan-panel.big { min-height: 0; overflow: auto; flex-shrink: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(14px, 1.6vw, 32px); font-size: clamp(14px, 1.5vw, 28px); }
.plan-panel.big .plan-head { padding-right: 0; }
.plan-panel.big .plan-head b { font-size: 1em; }
.plan-panel.big .plan-row { grid-template-columns: 1.2em minmax(0, 1fr) auto; padding: .45em .6em; }
.plan-panel.big .plan-row::before { left: calc(.6em + .6em - 1px); }
.plan-panel.big .plan-pt { width: .8em; height: .8em; margin-left: .2em; }
.plan-panel.big .plan-time { font-size: .9em; }
.plan-panel.big .bar { height: 56px; border-radius: 10px; }
.plan-panel.big .bar-text { font-size: clamp(13px, 1.2vw, 22px); }
.plan-panel.big .axis { font-size: clamp(12px, 1.1vw, 20px); }
.plan-panel.big .plan-note { font-size: clamp(11px, .9vw, 16px); }
@media (max-width: 700px) {
  .fs-top { flex-wrap: wrap; }
  .fs-view { order: 10; flex-basis: 100%; }
}
.fs-controls .fs-view .seg { padding: 4px; }
.fs-controls .fs-view .seg-btn { height: 40px; }
/* 予定のフロー：横いっぱいに広げず、中央にまとめる */
.plan-panel .flow-inner { max-width: 560px; margin: 0 auto; }
.plan-panel.big .flow-inner { max-width: min(720px, 60%); }
.plan-panel.big .ftimer-label { font-size: clamp(15px, 1.3vw, 24px); }
.plan-panel.big .ftimer-sub { font-size: clamp(13px, 1.1vw, 20px); }
.plan-panel.big .terminal, .plan-panel.big .frep-head { font-size: clamp(12px, 1vw, 18px); }
.plan-panel.big .plan-list { max-width: 900px; margin: 0 auto; }
@media (max-width: 700px) { .plan-panel.big .flow-inner { max-width: 100%; } }

/* ---- 組み立て画面の文字（2026-11-16：大きく） */
.section-title { font-size: 21px; }
.section-hint { font-size: 14px; }
.brand-name { font-size: 19px; }
.name-input { font-size: 21px; }
.hbtn { height: 42px; padding: 0 17px; font-size: 15.5px; }
.leaf-label { font-size: 19px; }
.leaf-sec { font-size: 16px; }
.block-label { font-size: 17px; }
.block-hint-inline { font-size: 14px; }
.block-dur { font-size: 15px; }
.step-val { font-size: 16px; }
.add-btn { font-size: 16px; padding: 12px; }
.tree-empty { font-size: 15px; }
.chip { font-size: 14px; }
.seg-btn { font-size: 15px; }
.total { font-size: 40px; }
.axis { font-size: 13px; }
.bar-text { font-size: 13.5px; }
.ftimer-label { font-size: 15.5px; }
.ftimer-sub { font-size: 14px; }
.terminal, .frep-head, .fpar-pill { font-size: 13px; }
.start-btn { font-size: 19px; height: 56px; }
.schedule-btn { font-size: 15.5px; height: 56px; }
.panel-note, .eyebrow { font-size: 14px; }
@media (max-width: 600px) {
  .leaf-label { font-size: 17px; }
  .leaf-sec { font-size: 14.5px; }
  .block-label { font-size: 15.5px; }
  .block-dur { font-size: 13.5px; }
  .step-val { font-size: 15px; min-width: 38px; }
  .add-btn { font-size: 15px; }
  .hbtn { height: 40px; padding: 0 13px; font-size: 14.5px; }
  .name-input { font-size: 19px; }
}
.leaf-body { padding: 8px 0; }
@media (min-width: 1500px) {
  :root { --page: 1380px; --header-h: 68px; }
  .edit-layout { grid-template-columns: minmax(0, 1fr) minmax(420px, 520px); gap: 36px; }
  .section-title { font-size: 23px; }
  .section-hint { font-size: 15px; }
  .brand-name { font-size: 20px; }
  .name-input { font-size: 23px; }
  .hbtn { height: 46px; padding: 0 19px; font-size: 16.5px; }
  .leaf-label { font-size: 21px; }
  .leaf-sec { font-size: 17px; }
  .block-label { font-size: 18.5px; }
  .block-hint-inline { font-size: 15px; }
  .block-dur { font-size: 16px; }
  .step-val { font-size: 17px; }
  .add-btn { font-size: 17px; }
  .chip { font-size: 15px; }
  .seg-btn { font-size: 16px; }
  .total { font-size: 46px; }
  .axis { font-size: 14px; }
  .bar-text { font-size: 14.5px; }
  .ftimer-label { font-size: 16.5px; }
  .ftimer-sub { font-size: 15px; }
  .start-btn { font-size: 20px; height: 60px; }
  .schedule-btn { font-size: 16.5px; height: 60px; }
  .panel-note, .eyebrow { font-size: 15px; }
}
.plan-panel.big .plan-head .seg-btn { font-size: clamp(13px, 1vw, 18px); padding: .35em 1.1em; }

/* ---- 広告の位置（2026-11-16） */
.ad-run-banner { width: min(100%, 728px); margin: 0 auto; }
.ad-run-banner .ad-ph { min-height: 90px; }
@media (max-width: 600px) { .ad-run-banner .ad-ph { min-height: 50px; } }
/* 参加者の画面：画面の高さの中に広告を収め、下端に固定する（スクロールしなくても見える） */
.fs.guest.has-ad { height: 100vh; height: 100dvh; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.fs.guest.has-ad .fs-main { overflow: hidden; }
.fs.guest.has-ad .cards.single .remaining { font-size: min(20vw, 34vh); }
.fs.guest.has-ad .ad-guest-banner { margin-top: .5vh; padding-top: 6px; border-top: 1px solid var(--border); width: 100%; max-width: none; }
.fs.guest.has-ad .ad-guest-banner > * { width: min(100%, 728px); margin-left: auto; margin-right: auto; }
.fs.guest.has-ad .ad-guest-banner .ad-ph { min-height: 70px; }
@media (max-width: 700px) {
  .fs.guest.has-ad .cards.single .remaining { font-size: min(24vw, 26vh); }
  .fs.guest.has-ad .ad-guest-banner .ad-ph { min-height: 50px; }
}
/* 読みもののページの広告 */
.page-ad { margin: 20px 0; }
.page-ad .ad-ph { min-height: 90px; }
.page-ad.rect { width: 300px; max-width: 100%; margin: 24px auto; }
.page-ad.rect .ad-ph { min-height: 250px; }

/* ---- 共有中だった部屋に戻る案内（0009） */
.resume-offer { max-width: var(--page); margin: 12px auto 0; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--par-bg); border: 1px solid var(--par-border); border-radius: var(--r-md); color: var(--par-text); }
.resume-offer > svg { flex: none; }
.resume-text { flex: 1; min-width: 220px; }
.resume-text b { display: block; font-size: 15px; color: var(--text); }
.resume-text small { font-size: 13px; color: var(--text-sub); }
.resume-btn { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); font-size: 14px; font-weight: 700; color: var(--text); }
.resume-btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.resume-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--text-sub); display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 700px) { .resume-offer { margin: 10px 12px 0; } }

/* ---- 有料版（0009） */
.hbtn.pro { background: var(--pro-bg); border-color: var(--pro-border); color: var(--pro); }
.pro-tag { flex: none; font-size: 12px; font-weight: 800; color: var(--pro); background: var(--pro-bg); border: 1px solid var(--pro-border); border-radius: 999px; padding: 1px 9px; }
.pro-sheet .sheet-desc { margin-bottom: 10px; }
.pro-cmp { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 14px; }
.pro-cmp th, .pro-cmp td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.pro-cmp th { font-size: 12.5px; color: var(--text-sub); }
.pro-cmp td.pro { color: var(--pro); font-weight: 700; }
.pro-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pro-plan { display: block; text-align: left; border: 2px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--bg); color: var(--text); }
.pro-plan.sel { border-color: var(--pro); background: var(--pro-bg); }
.pro-plan b { display: block; font-size: 13.5px; }
.pro-price { font-size: 26px; font-weight: 800; }
.pro-plan small { color: var(--text-sub); }
.pro-cta { width: 100%; margin-top: 12px; height: 50px; border: 0; border-radius: var(--r-md); background: var(--pro-strong); color: #fff; font-weight: 800; font-size: 16px; }
.pro-cta:disabled { opacity: .6; }
.pro-fine { font-size: 12.5px; color: var(--text-muted); margin: 8px 0 0; }
.pro-fine a { color: inherit; margin: 0 2px; }
.link-btn.inline { padding: 0; font-size: inherit; }
.pro-list { display: grid; gap: 8px; margin-top: 8px; }
.pro-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.pro-item > span { flex: 1; min-width: 0; }
.pro-item b { display: block; font-size: 14.5px; }
.pro-item small { display: block; color: var(--text-sub); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.pro-keyshow { font-size: 22px; font-weight: 700; background: var(--chip); border-radius: var(--r-md); padding: 12px; text-align: center; margin: 8px 0; user-select: all; }
.ok-note { background: var(--ok-bg); color: var(--ok-text); border-radius: var(--r-md); padding: 10px 12px; font-size: 14px; }
.upsell-btn { display: inline-block; margin-left: 8px; border: 0; border-radius: 999px; background: var(--pro-strong); color: #fff; padding: 3px 12px; font-size: 12.5px; font-weight: 800; }
@media (max-width: 600px) { .pro-plans { grid-template-columns: 1fr; } .hbtn.pro span { display: none; } }
@media (max-width: 1399px) { .hbtn.pro { padding: 0 11px; } .hbtn.pro span { display: none; } }
.name-input { min-width: 120px; }

/* ---- 予定：時間割（2026-11-16。タイムライン・フローをまとめた） */
.tt { display: flex; flex-direction: column; gap: 4px; max-width: 980px; margin: 0 auto; }
.tt-row { display: grid; grid-template-columns: 9.5em 12px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: .4em .7em; border-radius: 10px; }
.tt-time { color: var(--text-sub); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .9em; }
.tt-dot { width: 12px; height: 12px; border-radius: 50%; }
.tt-label { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-right { color: var(--text-sub); font-size: .9em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tt-row.now { background: var(--par-bg); }
.tt-row.now .tt-right { color: var(--danger); font-weight: 800; }
.tt-row.done { opacity: .45; }
.tt-row.done .tt-label { text-decoration: line-through; text-decoration-thickness: 1px; }
.tt-box { border-radius: 12px; padding: 4px 6px 6px; }
.tt-box.rep { background: var(--rep-bg); border: 1px dashed var(--rep-border); }
.tt-box.par { background: var(--par-bg); border: 1px dashed var(--par-border); }
.tt-box-head { display: flex; align-items: center; gap: 6px; padding: 2px 6px 4px; font-size: .72em; font-weight: 800; }
.tt-box.rep > .tt-box-head { color: var(--rep-text); }
.tt-box.par > .tt-box-head { color: var(--par-text); }
.tt-iter { margin-left: 6px; }
.tt-iters { display: inline-flex; gap: 4px; margin-left: 4px; }
.tt-iters i { width: 18px; height: 5px; border-radius: 3px; background: var(--border-strong); }
.tt-iters i.d { background: var(--rep-text); }
.tt-iters i.c { background: var(--danger); }
.tt-cols { display: grid; gap: 6px; }
.tt-col .tt-row { grid-template-columns: 8em 10px minmax(0, 1fr) auto; gap: 10px; }
.tt-sum { padding: .3em .8em; color: var(--text-sub); font-size: .85em; }
.tt-sum.done { opacity: .6; }
.tt-strip { max-width: 980px; margin: 0 auto 12px; width: 100%; }
.tt-strip-bar { position: relative; display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--chip); }
.tt-strip-bar span.done { opacity: .35; }
.tt-strip-now { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--danger); }
.tt-strip-axis { display: flex; justify-content: space-between; font-size: .72em; color: var(--text-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .tt-strip { display: none; }
  .tt-row, .tt-col .tt-row { grid-template-columns: 1fr auto; grid-template-areas: 'label right' 'time time'; gap: 0 10px; }
  .tt-row .tt-dot { display: none; }
  .tt-row .tt-label { grid-area: label; }
  .tt-row .tt-right { grid-area: right; }
  .tt-row .tt-time { grid-area: time; font-size: .78em; }
  .tt-cols { grid-template-columns: 1fr !important; }
}

/* ---------------------------------------------------------------- 実行中に時間を変える（2026-11-16） */
.ext-chip.minus { background: var(--chip); color: var(--chip-text); }
button.up-row { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.up-row:hover { border-color: var(--border-strong); background: var(--chip); }
.up-row .up-label { flex: 1; min-width: 0; }
.up-mark { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--rep-strong); color: var(--rep-strong-text); font-size: 11.5px; font-weight: 800; }
.up-pen { flex: none; display: inline-flex; color: var(--text-muted); }
button.up-row:hover .up-pen { color: var(--text); }
.run-edit .input { width: 100%; margin-bottom: 4px; }
.run-edit .field-label { margin-top: 14px; }
.stepper-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.step-big { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--card); color: var(--text); }
.step-big:hover:not(:disabled) { background: var(--chip); }
.step-big:disabled { opacity: .4; }
.step-out { min-width: 96px; text-align: center; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.step-quick { display: inline-flex; gap: 6px; margin-left: auto; }
.scope { display: grid; gap: 8px; }
.scope-opt { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--card); font: inherit; color: inherit; }
.scope-opt b { font-size: 14px; }
.scope-opt small { font-size: 12.5px; color: var(--text-sub); }
.scope-opt.on { border-color: var(--ink); background: var(--chip); }
.effect-note { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--rep-bg); color: var(--rep-strong-text); font-size: 13.5px; font-weight: 700; line-height: 1.5; }
@media (max-width: 600px) { .step-quick { margin-left: 0; width: 100%; } }
/* カードのボタンが4つになったので、名前と重ならないように */
.card-title-row { padding-right: 222px; }
.single .card-title-row { padding: 0 222px; }
@media (max-width: 600px) {
  .card-title-row, .single .card-title-row { padding: 44px 0 0; }
}
.timer-card.ro .card-title-row, .fs .card-title-row { padding-right: 0; }
.fs .cards.single .card-title-row { padding: 0; }
@media (max-width: 600px) { .timer-card.ro .card-title-row, .fs .card-title-row { padding-top: 0; } }

/* ---- 全画面の予定を広く（2026-11-16）：見出しを消し、下の「つぎ」・進み具合は隠す。表は横にも広げる */
.fs-foot.plan .fs-next, .fs-foot.plan .fs-overall { display: none; }
.fs-foot.plan:not(:has(.fs-join)) { display: none; }
.fs-planview { width: min(100%, 1700px); }
.fs-planview .tt, .fs-planview .tt-strip { max-width: 1400px; }
.fs-planview .plan-note { margin-bottom: 0; }
/* 全画面のカードのボタンは、右端の縦の並びに（時計・終了予定と重ならないように） */
.fs .cards.single .card-buttons { top: 50%; right: 0; transform: translateY(-50%); flex-direction: column; border-radius: 22px; }
.fs .cards.single .card-buttons .card-btn { width: 100%; }

/* ---- 時刻の表示を切りかえる（2026-11-16） */
.tt-row.notime { grid-template-columns: 12px minmax(0, 1fr) auto; }
.tt-col .tt-row.notime { grid-template-columns: 10px minmax(0, 1fr) auto; }
.time-mode-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 0; }
.time-mode-row > span b { display: block; font-size: 14.5px; }
.time-mode-row > span small, .time-mode-desc { color: var(--text-sub); font-size: 12.5px; }
.time-mode-desc { grid-column: 1 / -1; }
.time-mode-row .seg-btn { padding: 5px 12px; font-size: 13px; }
@media (max-width: 700px) {
  .tt-row.notime, .tt-col .tt-row.notime { grid-template-areas: 'label right'; }
}
/* 全画面の「⋯」メニュー（参加者に予定を見せる・全体の時間・音・ダークモード） */
.fs-more { position: relative; display: inline-flex; }
.fs-more-btn.on { background: var(--border); }
.fs-menu-scrim { position: fixed; inset: 0; z-index: 30; }
.fs-controls { z-index: 31; }
.fs-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 290px; max-width: calc(100vw - 32px); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); padding: 6px; display: grid; text-align: left; }
.fs-menu-cap { font-size: 11.5px; font-weight: 700; color: var(--text-muted); padding: 6px 12px 2px; }
.fs-menu-sep { height: 1px; background: var(--border); margin: 4px 8px; }
.fs-mi { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14px; text-align: left; cursor: pointer; }
.fs-mi:hover, .fs-mi:focus-visible { background: var(--chip); }
.fs-mi > span:not(.fs-sw) { flex: 1; min-width: 0; }
.fs-mi-v { color: var(--text-sub); font-size: 13px; white-space: nowrap; }
.fs-sw { flex: none; position: relative; width: 36px; height: 22px; border-radius: 11px; background: var(--border-strong); transition: background .15s; }
.fs-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.fs-sw.on { background: #10b981; }
.fs-sw.on::after { left: 17px; }

/* 横長で背の低い画面（ノート PC など）でも、残り時間の数字と下のバーが切れないように、
   大きく表示する場所（.fs-main）の高さに合わせて数字を小さくする（2026-11-16） */
.fs-main { container-type: size; }
.fs .cards.single .card-label, .fs .cards.single .dot { font-size: min(3.6vw, 76px, 10cqh); }
.fs .cards.single .card-ctx { font-size: min(1.7vw, 34px, 5.5cqh); }
.fs .cards.single .track { margin-top: min(2.5vh, 4cqh); height: min(1.2vw, 22px, 3cqh); min-height: 6px; }
.fs .cards.single .remaining { font-size: min(22vw, 44vh, 52cqh); }
.fs.guest .cards.single .remaining { font-size: min(22vw, 44vh, 52cqh); }
.fs.guest.has-ad .cards.single .remaining { font-size: min(20vw, 34vh, 52cqh); }
@media (max-width: 600px) {
  .fs.guest .cards.single .remaining { font-size: min(26vw, 30vh, 52cqh); }
  .fs.guest.has-ad .cards.single .remaining { font-size: min(24vw, 26vh, 52cqh); }
}

/* ---- メッセージ：上の帯（2026-11-16。真ん中に割りこまず、残り時間の数字のほうを縮める） */
.fs-msg-slot { justify-items: stretch; }
.fs-msg { max-width: none; width: 100%; display: flex; align-items: center; gap: clamp(10px, 1.2vw, 26px); padding: clamp(8px, .8vw, 18px) clamp(12px, 1.6vw, 32px); border-radius: clamp(8px, 1vw, 20px); border-left: clamp(4px, .45vw, 10px) solid var(--warn); text-align: left; font-size: clamp(16px, 2.2vw, 46px); }
.fs-msg-who { flex: none; display: grid; justify-items: start; grid-template-columns: auto auto; column-gap: .4em; align-items: center; font-size: clamp(11px, .9vw, 18px); font-weight: 700; opacity: .85; line-height: 1.3; }
.fs-msg-who small { grid-column: 2; font-size: 1em; opacity: .85; }
.fs-msg-who svg { grid-row: span 2; }
.fs-msg-text { min-width: 0; font-weight: 800; line-height: 1.3; }
.fs-msg-text.long { font-size: .78em; }
@media (max-width: 600px) {
  .fs-msg { align-items: flex-start; flex-direction: column; gap: 2px; }
  .fs-msg-who { grid-template-columns: auto auto auto; }
  .fs-msg-who svg { grid-row: auto; }
  .fs-msg-who small { grid-column: auto; }
}

/* ---- ダークモードのフロー（2026-11-16）：カードを背景から浮かせ、線を見えるように。端の丸ラベルは白くしない */
html[data-theme='dark'] .ftimer { background: #292524; border-color: #44403c; }
html[data-theme='dark'] .ftimer-bar { height: 4px; }
html[data-theme='dark'] .ftimer-sub { color: #d6d3d1; }
html[data-theme='dark'] .ftimer.active { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 14px rgba(0, 0, 0, .5); }
html[data-theme='dark'] .ftimer.active .ftimer-label, html[data-theme='dark'] .ftimer.active .ftimer-sub { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
html[data-theme='dark'] .ftimer.done { background: #1c1917; opacity: .55; }
html[data-theme='dark'] .ftimer.paused { background: #1c1917; }
html[data-theme='dark'] .vline, html[data-theme='dark'] .hline { background: #57534e; }
html[data-theme='dark'] .terminal { background: #44403c; color: #f5f5f4; }

/* ---- メッセージを大きく（2026-11-16）：大きく表示する場所の代わりに出す */
.fs-msg-hero { display: grid; place-items: center; min-height: 0; height: 100%; padding: 1vh 0; }
.fs-msg-hero-box { max-width: min(100%, 1500px); max-height: 100%; overflow: hidden; display: grid; justify-items: center; gap: min(1.2vw, 2cqh); padding: min(3vw, 6cqh) min(4vw, 64px); border-radius: clamp(14px, 1.8vw, 36px); background: #fef3c7; color: #78350f; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .08); }
html[data-theme='dark'] .fs-msg-hero-box { background: #3a2a06; color: #fde68a; }
.fs-msg-hero-box .fs-msg-who { grid-template-columns: auto auto auto; font-size: clamp(12px, 1.2vw, 24px); }
.fs-msg-hero-box .fs-msg-who svg { grid-row: auto; }
.fs-msg-hero-box .fs-msg-who small { grid-column: auto; }
.fs-msg-hero-text { margin: 0; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; font-size: min(5.6vw, 15cqh); }
.fs-msg-hero-text.long { font-size: min(3.8vw, 10cqh); }
.fs-msg-hero-timer { margin: 0; font-size: min(1.8vw, 5cqh); font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.fs-msg-hero-timer b { margin-left: .3em; }
.fs-msg-hero-box.flash { animation: msg-flash 1.4s ease-out; }
@media (max-width: 600px) { .fs-msg-hero-text { font-size: min(9vw, 12cqh); } .fs-msg-hero-text.long { font-size: min(6.5vw, 9cqh); } .fs-msg-hero-timer { font-size: 15px; } }
.msg-mode-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; font-size: 13px; color: var(--text-sub); }
.msg-mode-row .seg-btn { padding: 4px 12px; font-size: 13px; }
.msg-mode-row small { font-size: 12px; }

/* ---------------------------------------------------------------- 共有中の進行役：左右に分ける（2026-11-16） */
body[data-mode='run'] .run-layout:has(.run-split) { max-width: 1680px; }
.run-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr); grid-template-areas: 'pv side' 'low side'; gap: 18px; align-items: start; }
.sp-pv { grid-area: pv; display: grid; gap: 12px; min-width: 0; }
.sp-side { grid-area: side; position: sticky; top: 76px; min-width: 0; }
.sp-low { grid-area: low; min-width: 0; }
.sp-low .run-bottom { grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); }
@media (max-width: 1099px) {
  .run-split { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'pv' 'side' 'low'; }
  .sp-side { position: static; }
  .sp-low .run-bottom { grid-template-columns: minmax(0, 1fr); }
}
/* プレビュー（中は 1280×720 で描き、枠の幅に合わせて縮める） */
.pv-wrap { display: grid; gap: 6px; }
.pv-cap { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 700; color: var(--text-sub); }
.pv-cap small { font-weight: 500; color: var(--text-muted); }
.pv-box { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); border: 2px solid var(--border-strong); background: var(--bg); }
.pv-frame { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: 0; transform: scale(var(--pv-s, .5)); transform-origin: 0 0; background: var(--bg); }
/* 今のタイマーの操作 */
.ops-bar { display: grid; gap: 8px; }
.ops-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); }
.ops-row.paused { border-style: dashed; }
.ops-name { flex: 1; min-width: 140px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.ops-name b { font-size: 16px; }
.ops-name small { color: var(--text-sub); font-size: 12.5px; }
.ops-left { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.2em; text-align: right; }
.ops-btn { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; }
.ops-btn:hover:not(:disabled) { background: var(--chip); }
.ops-btn:disabled { opacity: .4; }
.ops-btn.active { background: var(--chip); }
.ops-btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
/* 右：共有の操作 */
.sp-side .live-box { gap: 10px; }
.sp-side .live-head { gap: 4px 12px; }
.sp-side .live-code b { font-size: 22px; letter-spacing: .04em; }
.live-qr-mini { margin-left: auto; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #fff; line-height: 0; }
.live-qr-svg { width: 56px; height: 56px; display: block; }
.live-sec-title { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
@media (max-width: 600px) { .time-mode-row { grid-template-columns: 1fr; } .ops-left { font-size: 18px; } }

/* ---- 予定：「同時に」は並びごとのまとまりを縦に積む（2026-11-16。行の形はほかと同じ） */
.tt-lane-group { margin: .3em 0; padding: .1em 0; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); }
.tt-lane-group .tt-row.now { border-radius: calc(var(--r-md) - 2px); }
.tt-arrow { margin-right: .4em; color: var(--text-muted); font-weight: 700; }
/* 全体の帯：段を重ねる（同時に動くもの） */
.tt-strip-lanes { position: relative; display: grid; gap: 2px; }
.tt-strip-lane { position: relative; height: 10px; border-radius: 5px; background: var(--chip); overflow: hidden; }
.tt-strip-lanes.multi .tt-strip-lane { height: 6px; border-radius: 3px; }
.tt-strip-lane span { position: absolute; top: 0; bottom: 0; }
.tt-strip-lane span.done { opacity: .35; }
.tt-strip-lanes .tt-strip-now { top: -2px; bottom: -2px; }
@media (max-width: 700px) {
  /* 時刻を出さないときも、スマホでは名前と右の文字の2列（点は出さない） */
  .tt-row.notime, .tt-col .tt-row.notime { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'label right'; }
}
/* 「同時に」の枠は塗らない（中の「いま」の行の水色と重ならないように。ほかの予定と同じ色の使い方にそろえる） */
.tt-box.par { background: transparent; }
.tt-lane-group { background: transparent; }
