*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0c0d10;
  --surface: #16181d;
  --surface-2: #1f2229;
  --surface-3: #2b2f38;
  --line: rgba(255, 255, 255, .07);
  --text: #f3f4f6;
  --muted: #9aa0ab;
  --faint: #626a76;
  --accent: #c6f135;
  --accent-ink: #151a05;
  --accent-soft: rgba(198, 241, 53, .13);
  --accent-text: #c6f135;
  --b: #62e3d0;
  --b-soft: rgba(98, 227, 208, .13);
  --low: #4ade80;
  --mid: #fbbf24;
  --high: #fb7185;
  --high-soft: rgba(251, 113, 133, .14);
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --tab-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #f0f1f4;
    --surface-3: #e1e4e9;
    --line: rgba(15, 18, 25, .08);
    --text: #12151b;
    --muted: #5d6470;
    --faint: #9aa1ac;
    --accent-soft: rgba(140, 190, 0, .14);
    --accent-text: #5a7d00;
    --b: #0f9483;
    --b-soft: rgba(15, 148, 131, .12);
    --low: #16a34a;
    --mid: #c47f00;
    --high: #e11d48;
    --high-soft: rgba(225, 29, 72, .1);
    --shadow: 0 12px 32px rgba(20, 25, 35, .14);
    color-scheme: light;
  }
}

html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
input, select { font: inherit; font-size: 16px; color: var(--text); }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.blank { color: var(--faint); }

/* ---------- 版面 ---------- */
.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--tab-h) + var(--safe-b) + 28px);
}
body.has-ab .view-today { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 118px); }

.page-title { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 12px; }
.page-title h1 { font-size: 28px; letter-spacing: .01em; }
.lead { color: var(--muted); font-size: 13px; margin: -4px 2px 4px; }
.group { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .08em; margin: 20px 4px 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; }

/* ---------- 下方分頁列 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(12, 13, 16, .84);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
@media (prefers-color-scheme: light) { .tabbar { background: rgba(255, 255, 255, .86); } }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--accent-text); }

/* ---------- 今日：頂部 ---------- */
.hero {
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: radial-gradient(130% 120% at 100% 0%, var(--accent-soft), transparent 58%), var(--surface);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.hero h1 { margin: 6px 0 10px; font-size: 30px; line-height: 1.15; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.chip.warn { background: rgba(251, 191, 36, .16); color: var(--mid); }
.wk { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: .04em; white-space: nowrap; }
.wk-A { background: var(--accent-soft); color: var(--accent-text); }
.wk-B { background: var(--b-soft); color: var(--b); }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.progress .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress .bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .35s ease; }
.cycle { margin-top: 8px; font-size: 12px; color: var(--faint); }

.celebrate { padding: 18px; text-align: center; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.celebrate .big { font-size: 24px; font-weight: 800; color: var(--accent-text); }
.celebrate p { color: var(--muted); margin-top: 4px; }
.notice { padding: 14px 16px; }
.notice b { color: var(--mid); }
.rest-card { padding: 22px 18px; text-align: center; }
.rest-card h2 { font-size: 22px; }
.rest-card p { margin-top: 4px; }
.tomorrow { margin-top: 16px; padding: 12px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.kicker { font-size: 11px; font-weight: 800; color: var(--accent-text); letter-spacing: .06em; }

/* ---------- 今日：區塊與每一組 ---------- */
.block { padding: 14px 10px 8px; }
.block.simple { padding: 6px; }
.block-head { padding: 0 6px 10px; }
.block-head h2 { font-size: 17px; display: flex; align-items: baseline; gap: 8px; }
.block-head h2 small { font-size: 13px; color: var(--muted); font-weight: 700; }
.notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.notes span { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 8px; }

.ex-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-bottom: 4px; }
.ex-sum { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); }
.ex-sum:active { background: var(--surface-3); }
.es-top { display: flex; align-items: center; gap: 8px; }
.es-top b { font-size: 15px; }
.es-top .m { font-size: 12px; color: var(--muted); }
.up { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.up svg { width: 12px; height: 12px; }
.es-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.es-meta .blank { color: var(--faint); }
.es-last { font-size: 12px; color: var(--faint); margin-top: 3px; font-variant-numeric: tabular-nums; }

.group-label { display: flex; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .05em; padding: 12px 8px 4px; }
.group-label small { font-weight: 600; color: var(--faint); letter-spacing: 0; }

.step { position: relative; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; }
.step + .step { margin-top: 2px; }
.step.current { background: var(--accent-soft); }
.step.current::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.check { width: 32px; height: 32px; margin-left: 4px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s; }
.step.current .check { border-color: var(--accent-text); }
.check svg { width: 16px; height: 16px; }
.step.done .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.skipped .check { border-style: dashed; color: var(--faint); }
.step.done .step-name, .step.skipped .step-name { color: var(--muted); }
.step-main { min-width: 0; }
.step-name { font-weight: 700; font-size: 15px; display: flex; align-items: baseline; gap: 6px; }
.step-name small { font-size: 12px; color: var(--faint); font-weight: 700; }
.step-sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.tag.fire { background: var(--high-soft); color: var(--high); }
.tag svg { width: 11px; height: 11px; }
.step-side { padding-right: 8px; text-align: right; }
.reps { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.reps small { font-size: 11px; color: var(--muted); margin-left: 2px; font-weight: 700; }
.lv { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.lv-low { background: var(--low); }
.lv-mid { background: var(--mid); }
.lv-high { background: var(--high); }

/* ---------- 下一步操作列 ---------- */
.actionbar {
  position: fixed; left: 10px; right: 10px; z-index: 25;
  bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  max-width: 540px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 10px 16px;
  border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ab-info { flex: 1; min-width: 0; }
.ab-kicker { font-size: 11px; font-weight: 800; color: var(--accent-text); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-title { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.ab-skip { font-size: 13px; font-weight: 700; color: var(--muted); padding: 12px 8px; }

.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 12px 20px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; white-space: nowrap; }
.btn-primary svg { width: 15px; height: 15px; }
.btn-primary:active, .btn-ghost:active { transform: scale(.97); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.btn-ghost.danger { color: var(--high); }
.wide { width: 100%; margin-top: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.btn-row .btn-ghost { flex: 1; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.link { color: var(--accent-text); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }

/* ---------- 計時面板 ---------- */
.panel {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 6, 8, .62);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: fade .2s ease;
}
.panel-card {
  width: 100%; max-width: 560px; max-height: 100dvh; overflow: auto;
  padding: 12px 20px calc(var(--safe-b) + 18px);
  border-radius: 28px 28px 0 0; background: var(--surface); border: 1px solid var(--line);
}
.panel-card.enter { animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.panel-head { display: flex; justify-content: space-between; align-items: center; min-height: 42px; }
.panel-title { font-size: 14px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.ring-wrap { position: relative; width: min(60vw, 236px); aspect-ratio: 1; margin: 2px auto 12px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring-fg.sw { stroke: var(--b); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.t-time { font-size: clamp(48px, 15vw, 66px); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t-sub { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.finished .t-time { color: var(--accent-text); animation: pulse 1s ease-in-out infinite; }
.t-adjust { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.t-adjust button { padding: 9px 18px; border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.t-note { text-align: center; font-size: 13px; color: var(--muted); margin: 0 8px 14px; }

.log { padding: 10px 12px; margin-bottom: 8px; border-radius: 16px; background: var(--surface-2); }
.log-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: 13px; font-weight: 800; }
.log-title small { font-size: 11px; font-weight: 600; color: var(--faint); }
.logrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.logrow + .logrow { border-top: 1px solid var(--line); }
.lr-name { min-width: 0; }
.lr-name b { display: block; font-size: 15px; }
.lr-name small { font-size: 12px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); font-size: 20px; font-weight: 800; display: grid; place-items: center; }
.stepper .val { width: 56px; background: var(--accent); color: var(--accent-ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.stepper.tentative .val { background: transparent; color: var(--faint); border: 2px dashed var(--surface-3); }
.stepper .solid { display: grid; place-items: center; width: 56px; height: 42px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.next { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px 2px; }
.next b { font-size: 17px; }
.next span:last-child { font-size: 13px; color: var(--muted); }

/* ---------- 浮窗 ---------- */
.pill {
  position: fixed; right: 14px; z-index: 45;
  bottom: calc(var(--tab-h) + var(--safe-b) + 96px);
  display: flex; align-items: center; gap: 8px;
  padding: 7px 15px 7px 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
  touch-action: none; cursor: grab; animation: fade .2s ease;
}
.pill svg { width: 32px; height: 32px; transform: rotate(-90deg); }
.pill .bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.pill .fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.pill.finished { background: var(--accent); color: var(--accent-ink); animation: pulse 1s ease-in-out infinite; }
.pill.finished .fg { stroke: var(--accent-ink); }
.pill.finished .bg { stroke: rgba(0, 0, 0, .15); }

/* ---------- 下方抽屜 ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 6, 8, .5); animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 18px calc(var(--safe-b) + 22px);
  border-radius: 24px 24px 0 0; background: var(--surface); border: 1px solid var(--line);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet.open { transform: none; }
.sheet:not(.open) { pointer-events: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 4px auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.sheet-head h2 { font-size: 20px; }
.sheet-head p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.inset { padding: 12px 14px; background: var(--surface-2); border: 0; }
.big-sub { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.guide { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--high); }
.guide svg { width: 14px; height: 14px; }
.guide.calm { color: var(--muted); }

.field { margin: 16px 0; }
.field > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; color: var(--muted); }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.inline select { width: auto !important; flex: none; }
.unit { color: var(--muted); font-weight: 700; flex: none; }
.ref { display: block; margin-top: 6px; font-size: 12px; color: var(--faint); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { padding: 7px 11px; border-radius: 10px; background: var(--surface-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick button.on { background: var(--accent); color: var(--accent-ink); }
.seg { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.seg button { flex: 1; padding: 9px 8px; border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: light) { .seg button.on { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); } }
.seg.narrow { flex: none; }
.warm-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.warm-row input[type=number] { width: 74px !important; flex: none; }
.warm-row input[type=text] { flex: 1; min-width: 0; }
.last { font-size: 14px; font-variant-numeric: tabular-nums; }

/* 課表細節 */
.d-block { padding: 12px 0; border-top: 1px solid var(--line); }
.d-block:first-of-type { border-top: 0; }
.d-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.d-line { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 14px; }
.d-line .tag { flex: none; }
.d-ex { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-ex b { width: 100%; color: var(--text); font-size: 14px; }

/* ---------- 本週課表 ---------- */
.view-week { height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 10px); }
.dots { display: flex; gap: 6px; align-items: center; }
.dots button { width: 8px; height: 8px; border-radius: 9px; background: var(--surface-3); transition: width .2s, background .2s; }
.dots button.on { width: 20px; background: var(--accent); }
.pager { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; overscroll-behavior-x: contain; }
.pager::-webkit-scrollbar { display: none; }
.wpage { flex: 0 0 100%; min-height: 0; display: flex; flex-direction: column; padding: 0 16px; scroll-snap-align: start; scroll-snap-stop: always; }
.wpage-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.wpage-head > div { display: flex; align-items: center; gap: 8px; }
.wdays { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wday { min-height: 0; overflow: hidden; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border-radius: 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); }
.wday:active { background: var(--surface-2); }
.wday.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wday.rest { background: transparent; border-style: dashed; }
.wday.missed { opacity: .5; }
.wd-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wd-date b { font-size: 18px; }
.wd-date small { margin-top: 3px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.wday.today .wd-date b { color: var(--accent-text); }
.wd-main { min-width: 0; }
.wd-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; }
.wd-sum { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wd-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.act { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 800; white-space: nowrap; }
.act::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.act.lv-low { color: var(--low); }
.act.lv-mid { color: var(--mid); }
.act.lv-high { color: var(--high); }
.status { flex: none; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.status.done { background: var(--accent); color: var(--accent-ink); }
.status.partial { background: var(--surface-3); color: var(--muted); }
.status.missed { color: var(--faint); border: 1px solid var(--surface-3); }
.hint { margin-top: 8px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------- 動作配置 ---------- */
.list { padding: 4px; }
.ex-item { display: block; width: 100%; padding: 12px; text-align: left; border-radius: 14px; }
.ex-item:active { background: var(--surface-2); }
.ex-item + .ex-item { border-top: 1px solid var(--line); border-radius: 0; }
.ei-top { display: flex; align-items: center; gap: 8px; }
.ei-name { font-size: 16px; font-weight: 800; }
.ei-kind { font-size: 11px; font-weight: 800; color: var(--muted); background: var(--surface-2); padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.ei-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ei-days { margin-top: 3px; font-size: 12px; color: var(--faint); }

/* ---------- 設定 ---------- */
.set-card { padding: 4px 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 8px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row > span:first-child { font-weight: 700; }
.row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row input, .row select { width: 128px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); text-align: right; outline: none; }
.row input[type=date] { width: auto; }
.with-unit { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; }
.with-unit input { width: 76px; }
.explain { padding: 8px 0 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.switch { position: relative; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; width: 100% !important; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
table.sets { width: 100%; border-collapse: collapse; margin: 6px 0 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
table.sets th { padding: 8px 4px; text-align: left; font-size: 12px; font-weight: 800; color: var(--muted); }
table.sets td { padding: 7px 4px; border-top: 1px solid var(--line); }
.principles { margin: 0; padding: 12px 4px 12px 20px; font-size: 14px; line-height: 1.65; }
.principles li + li { margin-top: 4px; }
.ver { margin: 18px 0 6px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(var(--tab-h) + var(--safe-b) + 104px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 9px 16px; border-radius: 99px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 800; white-space: nowrap; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
