/* ============================================================
   FitLog · 样式
   深色 / 荧光绿 / 响应式
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #070b10;
  --panel: #0f1620;
  --panel-2: #131c28;
  --panel-3: #182333;
  --line: #1e2a3a;
  --line-soft: #16202c;
  --text: #e9eff8;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #b6f36a;
  --accent-strong: #a4ee4f;
  --accent-ink: #0a1304;
  --blue: #5ab0ff;
  --danger: #ff7676;
  --warn: #ffc14d;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 26px 60px -34px rgba(0, 0, 0, .95);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1000px 560px at 4% -12%, rgba(182, 243, 106, .075), transparent 58%),
    radial-gradient(900px 520px at 102% -6%, rgba(90, 176, 255, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(182, 243, 106, .25); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #223044; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3e57; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; }
.icon svg { width: 100%; height: 100%; display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- 布局 ---------------- */
.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(15, 22, 32, .82), rgba(7, 11, 16, .35));
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--accent-ink);
  background: linear-gradient(160deg, #d3fa96, #9fe847);
  box-shadow: 0 8px 22px -10px rgba(182, 243, 106, .8);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: .01em; font-weight: 750; }
.brand-text small { font-size: 10.5px; color: var(--dim); letter-spacing: .18em; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10.5px; color: var(--dim); letter-spacing: .14em;
  padding: 14px 12px 7px; font-weight: 600;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-size: 13.5px; font-weight: 550;
  transition: background .16s, color .16s;
}
.nav-item .icon { opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .035); color: var(--text); }
.nav-item.active { background: rgba(182, 243, 106, .09); color: var(--accent); }
.nav-item.active .icon { opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; color: var(--dim);
  background: rgba(255, 255, 255, .05); padding: 1px 7px; border-radius: 99px;
}

.side-foot { margin-top: auto; }
.mini-goal {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(182, 243, 106, .07), rgba(255, 255, 255, .01));
  border-radius: 14px; padding: 13px 14px;
}
.mini-goal-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.mini-goal-top b { font-size: 15px; color: var(--text); font-weight: 700; letter-spacing: .01em; }
.mini-goal-bar { height: 5px; border-radius: 99px; background: #1a2534; margin: 9px 0 8px; overflow: hidden; }
.mini-goal-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8fe23e, var(--accent)); }
.mini-goal-note { font-size: 11px; color: var(--dim); }

.main-wrap { min-width: 0; padding: 0 34px 80px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 0 15px;
  background: linear-gradient(180deg, rgba(7, 11, 16, .97) 62%, rgba(7, 11, 16, .78));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 22px;
}
.eyebrow { font-size: 10.5px; letter-spacing: .16em; color: var(--dim); font-weight: 600; margin-bottom: 3px; }
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }

.view { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; outline: none; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: linear-gradient(180deg, #111925, #0e141d);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-link { font-size: 12px; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; background: none; border: 0; padding: 2px; }
.card-link:hover { text-decoration: underline; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: #121b27; color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: #182433; border-color: #2a3a4e; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, #c9fb86, #a8ec55);
  color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 10px 26px -14px rgba(182, 243, 106, .85);
}
.btn-primary:hover { filter: brightness(1.045); background: linear-gradient(180deg, #c9fb86, #a8ec55); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .045); color: var(--text); }
.btn-danger { color: #ff9a9a; border-color: rgba(255, 118, 118, .28); background: rgba(255, 118, 118, .08); }
.btn-danger:hover { background: rgba(255, 118, 118, .14); border-color: rgba(255, 118, 118, .45); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 11px; border: 1px solid var(--line); background: #101823;
  color: var(--muted); cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--text); background: #182433; border-color: #2a3a4e; }
.icon-btn .icon { width: 18px; height: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line); background: #0b1119; color: var(--muted);
  font-size: 12px; font-weight: 550; cursor: pointer; transition: .15s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #2a3a4e; }
.chip.on { background: rgba(182, 243, 106, .12); border-color: rgba(182, 243, 106, .45); color: var(--accent); }
.chip .dot { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 650; line-height: 1.4;
  white-space: nowrap;
}
.tag .dot { width: 5px; height: 5px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px;
  background: rgba(182, 243, 106, .12); color: var(--accent);
}
.badge.gray { background: rgba(148, 163, 184, .12); color: var(--muted); }
.badge.warn { background: rgba(255, 193, 77, .12); color: var(--warn); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; }
.delta.up { color: var(--accent); }
.delta.down { color: var(--blue); }
.delta.flat { color: var(--dim); }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }

.empty {
  border: 1px dashed #26344a; border-radius: 16px;
  padding: 34px 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--muted); background: rgba(255, 255, 255, .012);
}
.empty-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(182, 243, 106, .08); color: var(--accent); margin-bottom: 3px;
}
.empty-title { font-size: 14px; font-weight: 650; color: var(--text); }
.empty-text { font-size: 12.5px; color: var(--dim); max-width: 360px; }
.empty-actions { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; justify-content: center; }

.banner {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 12px;
  background: rgba(90, 176, 255, .08); border: 1px solid rgba(90, 176, 255, .22);
  color: #b9d8f7; font-size: 12.5px;
}
.banner .icon { color: var(--blue); }
.banner-warn { background: rgba(255, 193, 77, .07); border-color: rgba(255, 193, 77, .24); color: #f3d69a; }
.banner-warn .icon { color: var(--warn); }
.banner .btn { margin-left: auto; }
.banner-text { flex: 1; min-width: 0; }

/* ---------------- 概览 ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  background:
    radial-gradient(560px 240px at 92% -30%, rgba(182, 243, 106, .2), transparent 62%),
    radial-gradient(420px 220px at 100% 120%, rgba(90, 176, 255, .1), transparent 60%),
    linear-gradient(135deg, #131d2a, #0d141d 62%);
  border-color: #263527;
}
.hero::after {
  content: ""; position: absolute; right: -90px; top: -110px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(182, 243, 106, .14);
  pointer-events: none;
}
.hero-kicker { font-size: 11px; letter-spacing: .12em; color: #9db18b; font-weight: 650; margin-bottom: 8px; }
.hero-title { font-size: clamp(22px, 2.4vw, 29px); font-weight: 720; letter-spacing: -.02em; line-height: 1.25; }
.hero-sub { font-size: 13px; color: #9dacbe; margin-top: 9px; max-width: 520px; }
.hero-actions { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }
.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; padding-right: 6px; }
.hero-ring-label { font-size: 11px; color: #9dacbe; text-align: center; line-height: 1.45; }
.hero-ring-label b { color: var(--text); }

.stat { padding: 16px 18px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 27px; font-weight: 720; letter-spacing: -.02em; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 550; color: var(--dim); margin-left: 4px; letter-spacing: 0; }
.stat-sub { font-size: 11px; color: var(--dim); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.week-day {
  border: 1px solid var(--line); background: #0c121b; border-radius: 12px;
  padding: 9px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; transition: .15s; color: var(--text); min-height: 84px;
}
.week-day:hover { background: var(--panel-2); border-color: #2a3a4e; }
.week-day-name { font-size: 10px; color: var(--dim); font-weight: 600; }
.week-day-num { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.week-day.today { border-color: rgba(182, 243, 106, .5); background: rgba(182, 243, 106, .055); }
.week-day.today .week-day-num { color: var(--accent); }
.week-day.has-workout { background: #121c27; }
.week-dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; justify-content: center; }
.week-dots .dot { width: 5px; height: 5px; }
.week-card { display: flex; flex-direction: column; }
.week-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 14px; font-size: 11px; color: var(--dim);
}
.week-foot b { color: var(--text); font-weight: 650; margin-left: 2px; }

.list { display: flex; flex-direction: column; }
.wrow {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 6px; border-top: 1px solid var(--line-soft);
  cursor: pointer; border-radius: 10px; transition: background .14s;
}
.wrow:first-child { border-top: 0; }
.wrow:hover { background: rgba(255, 255, 255, .025); }
.wrow-date {
  width: 48px; flex: 0 0 48px; text-align: center;
  background: #0b1119; border: 1px solid var(--line); border-radius: 10px; padding: 5px 0;
}
.wrow-day { font-size: 17px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wrow-mon { font-size: 9.5px; color: var(--dim); letter-spacing: .04em; margin-top: 2px; }
.wrow-main { flex: 1; min-width: 0; }
.wrow-title { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wrow-meta { font-size: 11.5px; color: var(--dim); margin-top: 4px; display: flex; gap: 9px; flex-wrap: wrap; }
.wrow-meta span { display: inline-flex; align-items: center; gap: 4px; }
.wrow-right { text-align: right; flex: 0 0 auto; }
.wrow-vol { font-size: 13px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.wrow-vol span { font-size: 10px; color: var(--dim); font-weight: 500; }
.wrow-chev { color: #3b4a5e; display: flex; }

.pr-list { display: flex; flex-direction: column; gap: 2px; }
.pr-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line-soft); }
.pr-item:first-child { border-top: 0; }
.pr-medal {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(182, 243, 106, .1); color: var(--accent); font-size: 13px; flex: 0 0 auto;
}
.pr-main { flex: 1; min-width: 0; }
.pr-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-date { font-size: 10.5px; color: var(--dim); margin-top: 1px; }
.pr-delta { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.balance { display: flex; flex-direction: column; gap: 11px; }
.balance-row { display: flex; flex-direction: column; gap: 5px; }
.balance-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.balance-name { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; }
.balance-val { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.balance-bar { height: 6px; border-radius: 99px; background: #16202e; overflow: hidden; }
.balance-fill { height: 100%; border-radius: 99px; opacity: .9; }

.metric-strip { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.metric-block { min-width: 96px; }
.metric-label { font-size: 11px; color: var(--dim); }
.metric-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }
.metric-value small { font-size: 11px; color: var(--dim); font-weight: 500; margin-left: 3px; }
.spark { display: block; overflow: visible; }
.spark-empty { color: var(--dim); }

/* ---------------- 日历 ---------------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-title { display: flex; align-items: baseline; gap: 10px; }
.cal-title h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.cal-title span { font-size: 11.5px; color: var(--dim); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow {
  font-size: 10.5px; color: var(--dim); text-align: center;
  padding: 2px 0 6px; font-weight: 650; letter-spacing: .04em;
}
.cal-cell {
  position: relative; min-height: 92px; border-radius: 12px;
  border: 1px solid transparent; background: rgba(255, 255, 255, .014);
  padding: 7px 8px; display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; text-align: left; color: var(--text);
  transition: background .14s, border-color .14s, transform .06s;
  overflow: hidden;
}
.cal-cell:hover { border-color: #2a3a4e; background: var(--panel-2); }
.cal-cell:active { transform: scale(.995); }
.cal-cell.is-out { opacity: .34; }
.cal-cell.is-today { border-color: rgba(182, 243, 106, .45); box-shadow: inset 0 0 0 1px rgba(182, 243, 106, .12); }
.cal-cell.is-selected { border-color: rgba(182, 243, 106, .7); background: rgba(182, 243, 106, .07); }
.cal-num { font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cal-cell.is-today .cal-num { color: var(--accent); }
.cal-cell.trained .cal-num { color: var(--text); }
.cal-parts { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; flex: 0 0 auto; }
.cal-pill {
  font-size: 9px; font-weight: 700; padding: 1.5px 4.5px; border-radius: 4px;
  line-height: 1.35; letter-spacing: .01em; white-space: nowrap;
}
.pill-short { display: none; }
.cal-vol { margin-top: auto; font-size: 9.5px; color: var(--dim); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 16px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--dim); }
.legend-item .dot { width: 6px; height: 6px; }

/* ---------------- 图表 ---------------- */
.chart-host { position: relative; width: 100%; margin-top: 4px; }
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty {
  min-height: 200px; display: grid; place-items: center;
  border: 1px dashed #26344a; border-radius: 14px; color: var(--dim); font-size: 12.5px;
}
.chart-tip {
  position: absolute; z-index: 6; pointer-events: none;
  background: rgba(11, 17, 25, .97); border: 1px solid #2b3b50;
  border-radius: 10px; padding: 8px 10px; min-width: 118px;
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .95);
  font-size: 11.5px; backdrop-filter: blur(4px);
}
.tip-date { color: var(--dim); font-size: 10.5px; margin-bottom: 5px; }
.tip-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.tip-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.tip-name { color: var(--muted); margin-right: auto; padding-right: 10px; }
.tip-row b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 650; }
.tip-total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; color: var(--muted); font-size: 10.5px; }

.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #0a1018; border: 1px solid var(--line); border-radius: 10px; }
.seg button {
  border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 7px; cursor: pointer; transition: .14s; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: #1c2838; color: var(--text); box-shadow: inset 0 0 0 1px #2a3a4e; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
input, select, textarea {
  width: 100%; background: #0a1018; border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); padding: 9px 11px;
  font-family: inherit; font-size: 14px; line-height: 1.4; outline: none;
  transition: border-color .14s, box-shadow .14s;
}
input:hover, select:hover, textarea:hover { border-color: #2a3a4e; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(182, 243, 106, .55);
  box-shadow: 0 0 0 3px rgba(182, 243, 106, .08);
}
input::placeholder, textarea::placeholder { color: #4b5a6e; }
textarea { resize: vertical; min-height: 70px; }
input[type="date"] { color-scheme: dark; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.input-unit { position: relative; }
.input-unit input { padding-right: 34px; }
.input-unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--dim); pointer-events: none; }
.hint { font-size: 11px; color: var(--dim); line-height: 1.5; }

/* ---------------- 弹层 ---------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4, 7, 11, .66); backdrop-filter: blur(6px);
  display: flex; justify-content: flex-end;
  animation: fadeIn .18s ease;
}
.sheet {
  width: min(640px, 100%); height: 100%;
  background: #0d131c; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  box-shadow: -40px 0 100px rgba(0, 0, 0, .55);
  animation: sheetIn .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet.narrow { width: min(460px, 100%); }
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 20px 22px 15px; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(182, 243, 106, .04), transparent);
}
.sheet-kicker { font-size: 10.5px; letter-spacing: .14em; color: var(--dim); font-weight: 650; margin-bottom: 4px; }
.sheet-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sheet-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sheet-close { flex: 0 0 auto; }
.sheet-body {
  flex: 1; overflow-y: auto; padding: 18px 22px 22px;
  display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain;
}
.sheet-body > * { flex-shrink: 0; }
.sheet-foot {
  border-top: 1px solid var(--line-soft); padding: 13px 22px calc(13px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: #0b1119;
}
.sheet-foot .foot-info { font-size: 11.5px; color: var(--dim); }
.sheet-foot .foot-info b { color: var(--text); font-size: 14px; margin-left: 5px; }
.sheet-actions { display: flex; gap: 8px; align-items: center; }
.section-title { font-size: 12px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent); opacity: .8; }
.divider { height: 1px; background: var(--line-soft); }

/* 动作选择器 */
.picker { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0a1018; }
.picker-head { padding: 11px 12px 9px; display: flex; flex-direction: column; gap: 8px; }
.picker-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.picker-top strong { font-size: 12.5px; font-weight: 650; }
.picker-top span { font-size: 10.5px; color: var(--dim); }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); width: 15px; height: 15px; }
.search-box input { padding-left: 33px; }
.picker-list { max-height: 190px; overflow-y: auto; border-top: 1px solid var(--line-soft); }
.ex-option {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 12px; background: none; border: 0; border-bottom: 1px solid rgba(30, 42, 58, .5);
  color: var(--text); cursor: pointer; text-align: left; transition: background .12s;
}
.ex-option:hover { background: rgba(182, 243, 106, .055); }
.ex-option:last-child { border-bottom: 0; }
.ex-name { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-meta { font-size: 10px; color: var(--dim); }
.ex-add {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .045); color: var(--muted); flex: 0 0 auto;
}
.ex-option:hover .ex-add { background: rgba(182, 243, 106, .16); color: var(--accent); }
.picker-empty { padding: 20px 12px; text-align: center; color: var(--dim); font-size: 12px; }

/* 组数编辑 */
.entry {
  border: 1px solid var(--line); border-radius: 14px; background: #0b111a;
  overflow: hidden;
}
.entry + .entry { margin-top: 10px; }
.entry-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(255, 255, 255, .018); border-bottom: 1px solid var(--line-soft); }
.entry-name { font-size: 13px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-vol { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-body { padding: 9px 12px 11px; }
.set-head, .set-row {
  display: grid; grid-template-columns: 24px 1fr 1fr 32px 26px;
  gap: 7px; align-items: center;
}
.set-head { font-size: 9.5px; color: var(--dim); padding: 0 2px 5px; letter-spacing: .03em; }
.set-row + .set-row { margin-top: 6px; }
.set-idx { font-size: 11px; color: var(--dim); text-align: center; font-variant-numeric: tabular-nums; }
.set-row input { padding: 7px 8px; font-size: 13.5px; text-align: center; border-radius: 8px; }
.set-check {
  width: 27px; height: 27px; border-radius: 8px; border: 1px solid #2a3a4e;
  background: #0d141e; color: #3f4f63; display: grid; place-items: center;
  cursor: pointer; transition: .14s; padding: 0;
}
.set-check .icon { width: 14px; height: 14px; }
.set-check.on { background: rgba(182, 243, 106, .15); border-color: rgba(182, 243, 106, .5); color: var(--accent); }
.set-del { border: 0; background: none; color: #4b5a6e; cursor: pointer; padding: 3px; display: grid; place-items: center; border-radius: 6px; }
.set-del:hover { color: var(--danger); background: rgba(255, 118, 118, .08); }
.set-del .icon { width: 14px; height: 14px; }
.entry-actions { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.entry-actions .btn { padding: 4px 8px; font-size: 11px; border-radius: 7px; }
.entry-note { font-size: 10.5px; color: var(--dim); margin-left: auto; }
.set-hint { font-size: 10.5px; color: var(--dim); padding: 4px 2px 6px; }
.set-hint b { color: var(--muted); font-weight: 600; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 600; color: var(--dim);
  padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.table .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .mini-btn { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 3px; border-radius: 5px; display: grid; place-items: center; }
.table .mini-btn:hover { color: var(--danger); background: rgba(255, 118, 118, .08); }

/* ---------------- 设置 ---------------- */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.settings-row:first-of-type { border-top: 0; padding-top: 0; }
.settings-info { min-width: 0; }
.settings-info b { font-size: 13px; font-weight: 600; display: block; }
.settings-info span { font-size: 11.5px; color: var(--dim); display: block; margin-top: 2px; line-height: 1.5; }
.settings-control { flex: 0 0 auto; width: 140px; }
.settings-control.wide { width: 190px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.about-list { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); }
.about-list li { margin-left: 16px; }

/* ---------------- 提示 / 计时器 ---------------- */
.toast-root {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #131c28; border: 1px solid #2a3a4e; border-radius: 12px;
  padding: 10px 15px; font-size: 12.5px; color: var(--text);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .95);
  animation: toastIn .22s cubic-bezier(.2, .8, .2, 1);
  pointer-events: auto;
}
.toast .icon { color: var(--accent); width: 16px; height: 16px; }
.toast.err .icon { color: var(--danger); }

.timer-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 70;
  display: flex; align-items: center; gap: 7px;
  background: #131d2a; border: 1px solid #2a3a4e; color: var(--text);
  padding: 9px 13px; border-radius: 99px; cursor: pointer; font-size: 12px; font-weight: 600;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .9);
}
.timer-fab:hover { border-color: var(--accent); color: var(--accent); }
.timer-fab[hidden] { display: none; }
.timer-fab .icon { color: var(--accent); }
.timer-panel {
  position: fixed; right: 24px; bottom: 72px; z-index: 95; width: 240px;
  background: #0f1722; border: 1px solid #2a3a4e; border-radius: 18px;
  padding: 16px; box-shadow: 0 26px 60px -20px rgba(0, 0, 0, .95);
  animation: toastIn .18s ease;
}
.timer-close {
  position: absolute; top: 7px; right: 7px; width: 24px; height: 24px;
  border: 0; background: transparent; color: var(--dim); border-radius: 6px;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.timer-close .icon { width: 13px; height: 13px; }
.timer-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
@media (min-width: 981px) {
  body.editor-open .timer-panel { right: 680px; bottom: 24px; }
}
.timer-time { font-size: 38px; font-weight: 720; text-align: center; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer-time.zero { color: var(--accent); }
.timer-sub { text-align: center; font-size: 10.5px; color: var(--dim); margin-top: 3px; }
.timer-presets { display: flex; gap: 5px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.timer-presets button {
  border: 1px solid var(--line); background: #0a1018; color: var(--muted);
  font-size: 11px; padding: 3px 8px; border-radius: 7px; cursor: pointer;
}
.timer-presets button:hover { color: var(--accent); border-color: rgba(182, 243, 106, .4); }
.timer-actions { display: flex; gap: 7px; }
.timer-actions .btn { flex: 1; padding: 7px; font-size: 12px; }

/* ---------------- 补充组件 ---------------- */
.cal-cell { font-family: inherit; font-size: inherit; }

.chart-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin: 14px 0 8px;
}
.chart-sub { font-size: 11px; color: var(--dim); margin-bottom: 2px; }
.select-inline { width: auto; min-width: 160px; max-width: 240px; padding: 8px 30px 8px 11px; font-size: 12.5px; }

/* 进步曲线：先选部位，再选动作 */
.progress-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 14px; }
.part-chips { flex: 1 1 280px; min-width: 0; }
.ex-picker { display: flex; align-items: center; gap: 7px; flex: 0 1 320px; min-width: 200px; }
.ex-picker > span { font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.ex-picker .select-inline { flex: 1; width: 100%; max-width: none; min-width: 0; }

@media (max-width: 760px) {
  .progress-filters { align-items: stretch; gap: 9px; }
  .part-chips { flex: 1 1 100%; }
  .ex-picker { flex: 1 1 100%; }
  .ex-picker > span { font-size: 11px; }
}


.filter-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filter-bar .search-box { max-width: 420px; }

.log-month { margin-top: 8px; }
.log-month-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 650; color: var(--muted);
  padding: 14px 6px 4px; border-top: 1px solid var(--line-soft);
}
.log-month:first-child .log-month-head { border-top: 0; padding-top: 4px; }
.log-month-head .dim { font-size: 10.5px; }

.mini-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent;
  color: var(--dim); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.mini-btn .icon { width: 14px; height: 14px; }
.mini-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.mini-btn.danger:hover { background: rgba(255, 118, 118, .1); color: var(--danger); }

.day-body-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(182, 243, 106, .05); border: 1px solid rgba(182, 243, 106, .14);
  border-radius: 11px; padding: 9px 12px; font-size: 12px; color: var(--muted);
}
.day-body-line .icon { width: 15px; height: 15px; color: var(--accent); }
.day-body-line b { color: var(--text); font-weight: 650; }

.day-ex {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-top: 1px dashed rgba(30, 42, 58, .7);
}
.day-ex:first-child { border-top: 0; }
.day-ex-name { font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.day-ex-sets { font-size: 11px; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.custom-form {
  padding: 10px 12px; background: rgba(182, 243, 106, .04);
  border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 7px;
}
.custom-row { display: flex; gap: 6px; }
.custom-row input { flex: 1.4; }
.custom-row select { flex: 1; }
.custom-row .btn { flex: 0 0 auto; }
.custom-row .btn-primary { flex: 0 0 auto; }
.picker-foot { padding: 8px 12px; border-top: 1px solid var(--line-soft); text-align: center; }

.onboarding .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 18px; }
.step {
  display: flex; gap: 10px; padding: 14px; border: 1px solid var(--line);
  border-radius: 13px; background: rgba(255, 255, 255, .015);
}
.step-no {
  width: 24px; height: 24px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--accent); background: rgba(182, 243, 106, .12);
}
.step b { font-size: 12.5px; display: block; margin-bottom: 3px; }
.step p { font-size: 11.5px; color: var(--dim); line-height: 1.55; margin: 0; }

.stat-spark { margin-top: 8px; }
.body-spark { margin-top: 14px; }
.body-spark .spark, .stat-spark .spark { max-width: 100%; height: auto; }
.spark { max-width: 100%; }

.pr-strip { margin-bottom: 4px; }
.pr-strip .metric-block { min-width: 118px; }

.timer-bar { height: 4px; border-radius: 99px; background: #1a2534; overflow: hidden; margin-top: 12px; }
.timer-bar i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, #8fe23e, var(--accent)); transition: width .2s linear; }
.timer-fab.running { border-color: rgba(182, 243, 106, .5); color: var(--accent); background: rgba(182, 243, 106, .08); }
.timer-fab.running .icon { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.wrow:focus-visible, .cal-cell:focus-visible, .week-day:focus-visible, .ex-option:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible {
  outline: 2px solid rgba(182, 243, 106, .65); outline-offset: 2px;
}
a.btn { text-decoration: none; }
.banner strong { color: var(--text); font-weight: 650; }

.ring text { font-family: var(--font); }

/* ---------------- 移动端 ---------------- */
.tabbar { display: none; }

@media (max-width: 1180px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-wrap { padding: 0 18px 96px; }
  .topbar { padding: 15px 0 12px; margin-bottom: 16px; }
  .topbar h1 { font-size: 19px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(9, 14, 20, .96); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 2px 5px; border-radius: 10px; color: var(--dim);
    font-size: 9.5px; font-weight: 600; border: 0; background: none; cursor: pointer;
  }
  .tab-item .icon { width: 20px; height: 20px; }
  .tab-item.active { color: var(--accent); background: rgba(182, 243, 106, .07); }
  .split, .split-even { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 20px; }
  .toast-root { bottom: 84px; }
  .timer-fab { bottom: 84px; right: 16px; }
  .timer-panel { bottom: 130px; right: 16px; }
}

@media (max-width: 760px) {
  .cols-3, .cols-4, .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboarding .steps { grid-template-columns: minmax(0, 1fr); }
  .seg { flex-wrap: wrap; }  .chart-toolbar { align-items: flex-start; }
  .cal-cell { min-height: 72px; padding: 6px; }
  .cal-vol { display: none; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-ring { flex-direction: row; align-self: stretch; justify-content: flex-start; gap: 12px; }
  .hero-ring .ring { width: 60px; height: 60px; }
  .sheet-actions { flex-wrap: wrap; justify-content: flex-end; }
  .sheet-foot { flex-wrap: wrap; }
  .picker-list { max-height: 170px; }
  input, select, textarea { font-size: 16px; }
}

@media (max-width: 560px) {
  .main-wrap { padding: 0 12px 92px; }
  .view { gap: 12px; }
  .card { padding: 14px; border-radius: 15px; }
  .grid { gap: 12px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .cols-3.keep-2, .cols-4.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 23px; }
  .topbar .btn-label { display: none; }
  .topbar .btn-primary { width: 38px; height: 38px; padding: 0; }
  .topbar .btn-primary .icon { width: 18px; height: 18px; }
  .eyebrow { font-size: 9.5px; }
  .topbar h1 { font-size: 18px; }
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 62px; border-radius: 9px; padding: 4px 5px; gap: 3px; }
  .cal-num { font-size: 10.5px; }
  .cal-pill { font-size: 8px; padding: 1px 3px; border-radius: 3px; }
  .pill-full { display: none; }
  .pill-short { display: inline; }
  .cal-parts { gap: 2px; }
  .cal-dow { font-size: 9.5px; }
  .week-grid { gap: 4px; }
  .week-day { min-height: 70px; padding: 7px 2px 6px; }
  .week-day-name { font-size: 9px; }
  .week-day-num { font-size: 12.5px; }
  .week-dots .dot { width: 4px; height: 4px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .sheet { width: 100%; border-left: 0; animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
  .sheet-body { padding: 14px 14px 18px; }
  .sheet-head { padding: 15px 14px 12px; }
  .sheet-foot { padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); }
  .set-head, .set-row { grid-template-columns: 20px 1fr 1fr 30px 24px; gap: 5px; }
  .set-row input { font-size: 16px; padding: 6px 4px; }
  .entry-body { padding: 8px 9px 10px; }
  .entry-head { padding: 9px 10px; }
  .btn { font-size: 12.5px; }
  .hero-title { font-size: 21px; }
  .metric-strip { gap: 12px; }
  .tabbar { padding-left: 2px; padding-right: 2px; }
  .table { font-size: 12px; }
  .cal-head { margin-bottom: 10px; }
  .cal-title h2 { font-size: 16px; }
}

@media (max-width: 400px) {
  .week-day { min-height: 66px; }
  .cal-cell { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { transform: translateX(40px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(30px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastIn { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* ---------------- 手机/PWA ---------------- */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
button, a, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sync-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #5d6b7d; margin-left: 7px; vertical-align: middle; flex: 0 0 auto;
}
.sync-dot.on { background: var(--accent); box-shadow: 0 0 8px rgba(182, 243, 106, .55); }
.sync-dot.off { background: #ffbd5c; }

@media (max-width: 980px) {
  .topbar { padding-top: max(15px, env(safe-area-inset-top)); }
  .main-wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .sheet-head { padding-top: calc(20px + env(safe-area-inset-top)); }
  .sheet-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

@media (display-mode: standalone) {
  body { min-height: 100dvh; }
  .topbar { padding-top: max(15px, env(safe-area-inset-top)); }
}

