/* Smooth Operations v8. One line per thing, details in a panel, me first. System font for text, a display face for
   titles, a mono face for times. Light by default (follows the device), dark with the theme switch. No framework. */
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url(fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url(fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url(fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url(fonts/jetbrains-mono-latin-600-normal.woff2) format('woff2'); }

/* ============ tokens ============ */
:root {
  --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f1f2f5; --surface-3: #e9eaef; --field: #ffffff; --side: #fbfbfc;
  --border: #e5e6eb; --border-2: #d2d4dc; --text: #17181c; --text-2: #3f424b; --muted: #70737e; --text-3: #9b9ea8;
  --accent: #2f6df6; --accent-2: #1d5be3; --accent-ink: #fff; --accent-soft: rgb(47 109 246 / .10); --accent-line: rgb(47 109 246 / .35);
  --ok: #1a9e5c; --ok-2: #138a4e; --ok-soft: rgb(26 158 92 / .12); --ok-ink: #fff;
  --warn: #d98a06; --warn-soft: rgb(217 138 6 / .14); --warn-ink: #fff;
  --danger: #dc3d43; --danger-soft: rgb(220 61 67 / .11); --danger-ink: #fff;
  --improve: #7a4ff0; --improve-soft: rgb(122 79 240 / .10); --shop: #b4600b; --shop-soft: rgb(180 96 11 / .11);
  --live: #1a9e5c;
  --shadow: 0 1px 2px rgb(23 24 28 / .05);
  --shadow-2: 0 12px 32px -12px rgb(23 24 28 / .22), 0 2px 6px rgb(23 24 28 / .06);
  --ring: 0 0 0 3px rgb(47 109 246 / .25);
  --r: 12px; --r-sm: 8px; --r-xs: 6px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side-w: 232px; --top-h: 56px; --tabbar-h: 62px; --panel-w: 460px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1d2129; --surface-3: #262b35; --field: #12151b; --side: #12141a;
  --border: #262a33; --border-2: #363c49; --text: #e8e9ee; --text-2: #b9bcc6; --muted: #868b98; --text-3: #5f6472;
  --accent: #5b8cff; --accent-2: #7aa2ff; --accent-ink: #0b1430; --accent-soft: rgb(91 140 255 / .14); --accent-line: rgb(91 140 255 / .4);
  --ok: #38c47d; --ok-2: #52d08f; --ok-soft: rgb(56 196 125 / .14); --ok-ink: #04130d;
  --warn: #f0a93a; --warn-soft: rgb(240 169 58 / .14); --warn-ink: #1a1000;
  --danger: #f2626a; --danger-soft: rgb(242 98 106 / .14); --danger-ink: #fff;
  --improve: #a98cff; --improve-soft: rgb(169 140 255 / .14); --shop: #f0a93a; --shop-soft: rgb(240 169 58 / .12);
  --live: #38c47d;
  --shadow: 0 1px 2px rgb(0 0 0 / .35);
  --shadow-2: 0 18px 40px -16px rgb(0 0 0 / .7), 0 2px 8px rgb(0 0 0 / .3);
  --ring: 0 0 0 3px rgb(91 140 255 / .3);
  color-scheme: dark; } }
:root[data-theme=dark] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1d2129; --surface-3: #262b35; --field: #12151b; --side: #12141a;
  --border: #262a33; --border-2: #363c49; --text: #e8e9ee; --text-2: #b9bcc6; --muted: #868b98; --text-3: #5f6472;
  --accent: #5b8cff; --accent-2: #7aa2ff; --accent-ink: #0b1430; --accent-soft: rgb(91 140 255 / .14); --accent-line: rgb(91 140 255 / .4);
  --ok: #38c47d; --ok-2: #52d08f; --ok-soft: rgb(56 196 125 / .14); --ok-ink: #04130d;
  --warn: #f0a93a; --warn-soft: rgb(240 169 58 / .14); --warn-ink: #1a1000;
  --danger: #f2626a; --danger-soft: rgb(242 98 106 / .14); --danger-ink: #fff;
  --improve: #a98cff; --improve-soft: rgb(169 140 255 / .14); --shop: #f0a93a; --shop-soft: rgb(240 169 58 / .12);
  --live: #38c47d;
  --shadow: 0 1px 2px rgb(0 0 0 / .35);
  --shadow-2: 0 18px 40px -16px rgb(0 0 0 / .7), 0 2px 8px rgb(0 0 0 / .3);
  --ring: 0 0 0 3px rgb(91 140 255 / .3);
  color-scheme: dark; }

/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14.5px/1.45 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
a.link, .crumbs a, .prose a { color: var(--accent); text-decoration: none; font-weight: 500; }
a.link:hover, .crumbs a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: none; box-shadow: var(--ring); }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: 1px 5px; border-radius: var(--r-xs); border: 1px solid var(--border); }
kbd { font: 600 11px/1 var(--mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; min-width: 20px; display: inline-block; text-align: center; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.012em; font-family: var(--display); font-weight: 600; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.02rem; } h3 { font-size: .92rem; }
p { margin: 0 0 .6em; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); } .neg { color: var(--danger); } .pos { color: var(--ok); }
.grow { flex: 1; }
[hidden] { display: none !important; }
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.18em; }
.timer { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .92em; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.timer.running { color: var(--live); font-weight: 600; }
.timer.inaccurate { color: var(--warn); }
.timer.big { font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
html.saving { cursor: progress; }
html.saving .top::after, html.loading .top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent) 0 0 / 40% 100% no-repeat; animation: slide .9s linear infinite; }
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(26 158 92 / .45); } 70% { box-shadow: 0 0 0 7px rgb(26 158 92 / 0); } }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============ shell ============ */
#app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.content { min-width: 0; display: flex; flex-direction: column; }
.only-m { display: none !important; }

/* sidebar */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--border); padding: 12px 10px; gap: 6px; overflow: hidden auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand b { color: var(--accent); }
.logo { width: 24px; height: 24px; border-radius: 7px; flex: none; position: relative; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.logo::after { content: ''; position: absolute; inset: 6px; border-radius: 3px; background: var(--side); }
.brand.big { font-size: 1.5rem; justify-content: center; } .brand.big .logo { width: 34px; height: 34px; border-radius: 10px; } .brand.big .logo::after { inset: 8px; border-radius: 4px; background: var(--surface); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.ng { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 4px; }
.ni { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-weight: 500; font-size: .92rem; transition: background .12s; }
.ni .ic { width: 17px; height: 17px; color: var(--muted); }
.ni:hover { background: var(--surface-2); color: var(--text); }
.ni.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .ni.on .ic { color: var(--accent); }
.ni .badge { margin-left: auto; }
.badge { font: 600 11px/1 var(--sans); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.badge.hot { background: var(--danger); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); text-decoration: none; }
.me-card:hover, .me-card.on { background: var(--surface-2); }
.me-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; } .me-t .nm { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me-t .rl { font-size: .76rem; color: var(--muted); }
.side-tools { display: flex; gap: 2px; padding: 0 4px; } .side-tools form { display: contents; }
.online { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 2px 8px 4px; font-size: .76rem; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 5px; } .who i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); } .who.none { font-style: italic; }
.side-bg { display: none; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.search { display: flex; align-items: center; gap: 8px; height: 36px; width: min(420px, 40vw); padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--field); color: var(--muted); text-align: left; transition: border-color .12s, box-shadow .12s; }
.search:hover { border-color: var(--border-2); } .search .bt { flex: 1; font-size: .9rem; } .search .keys { display: flex; gap: 3px; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.running-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 32px; padding: 0 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: .84rem; text-decoration: none; }
.running-pill .rt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.running-pill .ic { animation: blink 1.6s infinite; } @keyframes blink { 50% { opacity: .35; } }
.running-pill.act { background: var(--accent-soft); color: var(--accent); border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: .84rem; } .running-pill.act .ic { animation: none; }
.clock-f { display: contents; }
.btn.clock { height: 36px; gap: 8px; } .clock-f.in .btn.clock { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn.clock .dot { width: 8px; height: 8px; }

/* phone tab bar + FAB */
.tabbar { display: none; }

/* ============ page ============ */
.page { flex: 1; display: flex; align-items: flex-start; min-width: 0; }
.page-main { flex: 1; min-width: 0; width: 100%; margin: 0 auto; padding: 22px 28px 80px; }
.w-narrow .page-main { max-width: 760px; } .w-normal .page-main { max-width: 1020px; } .w-wide .page-main { max-width: 1320px; } .w-full .page-main { max-width: none; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ph-l { min-width: 0; } .ph h1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ph .sub { font: 400 .9rem/1.3 var(--sans); color: var(--muted); letter-spacing: 0; }
.ph-r { display: flex; gap: 8px; align-items: center; flex: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin-bottom: 4px; } .crumbs i { font-style: normal; color: var(--text-3); } .crumbs a { font-weight: 500; }
.toolbar { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.tb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-row .search-f { margin-left: auto; }
.pb.two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.pb-aside { position: sticky; top: calc(var(--top-h) + 20px); display: flex; flex-direction: column; gap: 14px; }

/* side panel */
.panel { width: var(--panel-w); flex: none; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); animation: slidein .18s ease-out; }
.panel-top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 8px 10px 0; background: linear-gradient(var(--surface) 70%, transparent); }
.panel-b { padding: 0 22px 60px; }
.has-panel .w-normal .page-main { max-width: none; }

/* ============ kit ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-weight: 500; font-size: .88rem; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }
.btn.sm { height: 28px; padding: 0 9px; font-size: .82rem; gap: 5px; } .btn.sm .ic { width: 14px; height: 14px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 1rem; }
.btn.icon { padding: 0; width: 34px; } .btn.icon.sm { width: 28px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--ok-ink); } .btn.ok:hover { background: var(--ok-2); }
.btn.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); } .btn.warn:hover { background: var(--warn); color: var(--warn-ink); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); } .btn.danger:hover { background: var(--danger); color: var(--danger-ink); }
.btn.ghost { background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-2); } .btn.quiet:hover { background: var(--surface-2); color: var(--text); }
.btn.on { background: var(--accent-soft); color: var(--accent); }
.btn.busy { opacity: .6; pointer-events: none; }
.bl { display: inline; }
form.inline, .inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill .ic { width: 12px; height: 12px; }
.pill.accent { background: var(--accent-soft); color: var(--accent); } .pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); } .pill.muted { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.pill.improve { background: var(--improve-soft); color: var(--improve); } .pill.shop { background: var(--shop-soft); color: var(--shop); }
.n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 600 .74rem/1 var(--sans); background: var(--surface-3); color: var(--text-2); vertical-align: middle; letter-spacing: 0; }
h1 .n, h2 .n { margin-left: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.live, .dot.ok { background: var(--live); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); } .dot.accent { background: var(--accent); } .dot.muted { background: var(--border-2); }
.dot.live { animation: pulse 1.8s infinite; }
.av { --h: 200; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font: 700 .68rem/1 var(--sans); letter-spacing: .02em; color: hsl(var(--h) 45% 28%); background: hsl(var(--h) 70% 88%); flex: none; width: 26px; height: 26px; }
:root[data-theme=dark] .av, :root:not([data-theme=light]) .av { color: hsl(var(--h) 70% 85%); background: hsl(var(--h) 35% 30%); }
@media (prefers-color-scheme: light) { :root:not([data-theme=dark]) .av { color: hsl(var(--h) 45% 28%); background: hsl(var(--h) 70% 88%); } }
.av-xs { width: 20px; height: 20px; font-size: .58rem; } .av-md { width: 32px; height: 32px; font-size: .76rem; } .av-lg { width: 44px; height: 44px; font-size: 1rem; }
.bar { display: inline-block; width: 46px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 2px; }
.bar.wide { display: block; width: 100%; height: 6px; margin: 8px 0; }
.hint { font-size: .82rem; color: var(--muted); margin: 6px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* fields */
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fl { font-size: .8rem; font-weight: 600; color: var(--text-2); } .fl small { font-weight: 400; color: var(--muted); }
.fh { font-size: .78rem; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--field); color: var(--text); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; } .check small { color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.qty-in { width: 84px !important; } .time-in { width: 110px !important; }
.copy-box { font-family: var(--mono); font-size: .84rem; }
.fld.wide { grid-column: 1 / -1; }

/* properties (the panel) */
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; margin: 14px 0 8px; }
.prop { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prop .pl { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); display: flex; align-items: center; gap: 5px; } .prop .pl .ic { width: 12px; height: 12px; }
.prop select { height: 30px; padding: 0 24px 0 8px; border-color: transparent; background-color: var(--surface-2); font-weight: 500; font-size: .86rem; border-radius: var(--r-xs); }
.prop select:hover { background-color: var(--surface-3); }
.prop .pv { height: 30px; display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: .86rem; padding: 0 2px; }
.prop.p-urgent select { color: var(--danger); background-color: var(--danger-soft); } .prop.p-high select { color: var(--warn); background-color: var(--warn-soft); } .prop.p-low select { color: var(--muted); }
.prop.inline { flex-direction: row; align-items: center; } .prop.inline .pl:empty { display: none; } .prop.inline select { height: 26px; font-size: .78rem; width: auto; }

/* containers */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 0; } .card-h h2 small { font: 400 .82rem/1 var(--sans); color: var(--muted); margin-left: 6px; }
.card-b { padding: 12px 16px 14px; } .card.flush .card-b { padding: 0; } .card-h + .card-b { padding-top: 10px; }
.sec { margin: 0 0 22px; } .sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding: 0 2px; }
.sec-h h2 small, .sec-d summary h2 small { font: 400 .82rem/1 var(--sans); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.sec-d { margin: 0 0 22px; } .sec-d > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 2px; color: var(--muted); }
.sec-d > summary::-webkit-details-marker { display: none; } .sec-d > summary::before { content: '▸'; font-size: .8rem; transition: transform .15s; } .sec-d[open] > summary::before { transform: rotate(90deg); }
.sec-d > summary h2 { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .sl { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.stat .sv { font: 600 1.45rem/1.15 var(--display); letter-spacing: -.02em; } .stat .sv small { font: 500 .8rem var(--sans); color: var(--muted); }
.stat .ss { font-size: .78rem; color: var(--muted); }
.stat.ok .sv { color: var(--ok); } .stat.warn .sv { color: var(--warn); } .stat.danger .sv { color: var(--danger); } .stat.accent .sv { color: var(--accent); }
.stats.compact { grid-template-columns: 1fr 1fr; gap: 8px; } .stats.compact .stat { padding: 10px 12px; } .stats.compact .sv { font-size: 1.2rem; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); margin: 0 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { border-top: 2px solid var(--border-2); font-weight: 600; }
.tbl .empty-cell { text-align: center; color: var(--muted); padding: 22px; }
.tbl a { text-decoration: none; font-weight: 500; } .tbl a:hover { text-decoration: underline; }
.tbl td .inline input, .tbl td .inline select { height: 30px; }
.tbl.compact td, .tbl.compact th { padding: 6px 10px; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); border: 1px dashed var(--border-2); border-radius: var(--r); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .ic { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 4px; } .empty .et { color: var(--text); font-weight: 600; margin: 0; } .empty .es { margin: 0 0 6px; font-size: .86rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .9rem; margin: 10px 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.prose { white-space: pre-wrap; line-height: 1.55; font-size: .92rem; }
.log { list-style: none; margin: 0; padding: 0; font-size: .86rem; } .log li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.flash { padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-weight: 500; margin: 0 0 14px; }
.flash.err { background: var(--danger-soft); color: var(--danger); } .flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.secret { background: var(--warn-soft); color: var(--text); } .flash.secret code { font-size: 1rem; }

/* segmented, chips, tabs */
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-sm); background: var(--surface-3); gap: 2px; }
.seg a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 6px; text-decoration: none; font-size: .84rem; font-weight: 500; color: var(--text-2); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; } .seg .ic { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; white-space: nowrap; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .82rem; font-weight: 500; color: var(--text-2); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--border-2); background: var(--surface-2); } .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); } .chip.on .n { background: rgb(255 255 255 / .2); color: inherit; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; text-decoration: none; font-weight: 500; font-size: .9rem; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); } .tabs a.on { color: var(--text); border-color: var(--accent); font-weight: 600; }
.search-f { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--field); }
.search-f .ic { color: var(--muted); width: 15px; height: 15px; } .search-f input { border: 0; height: 30px; width: 150px; padding: 0 4px; background: transparent; } .search-f input:focus { box-shadow: none; }
.search-f select { border: 0; height: 30px; width: auto; background-color: transparent; font-size: .84rem; color: var(--muted); }

/* ⋯ menu */
.menu { position: relative; display: inline-block; } .menu > summary { list-style: none; } .menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 200px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-2); animation: pop .12s ease-out; }
.menu-list > *, .menu-list form > button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; font-size: .88rem; font-weight: 500; text-align: left; text-decoration: none; color: var(--text); cursor: pointer; }
.menu-list form { padding: 0; } .menu-list > *:hover, .menu-list form > button:hover { background: var(--surface-2); }
.menu-list .ic { width: 15px; height: 15px; color: var(--muted); } .menu-list .danger { color: var(--danger); } .menu-list .danger .ic { color: var(--danger); }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; padding: 0; }
.menu.up .menu-list { top: auto; bottom: calc(100% + 4px); }

/* details "more" */
.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 500; color: var(--muted); padding: 4px 0; }
.more > summary::-webkit-details-marker { display: none; } .more > summary:hover { color: var(--text); } .more > summary .ic { width: 14px; height: 14px; }
.more[open] > summary { color: var(--text); margin-bottom: 8px; }
.more > :not(summary) { animation: pop .12s ease-out; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-2); font-size: .9rem; font-weight: 500; animation: pop .15s ease-out; max-width: min(92vw, 520px); }
.toast.bad { background: var(--danger); color: #fff; }
.toast button { background: none; border: 0; color: var(--accent-2); font-weight: 700; padding: 0 2px; cursor: pointer; }
.toast.bad button { color: #fff; }

/* dialogs */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.dlg::backdrop { background: rgb(10 12 18 / .45); backdrop-filter: blur(2px); }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100vh - 64px); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; } .dlg-h h2 { font-size: 1.1rem; }
.dlg-b { display: flex; flex-direction: column; gap: 12px; padding: 8px 18px 16px; overflow-y: auto; }
.dlg-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dlg-f:empty { display: none; }
.dlg.sheet { width: min(640px, calc(100vw - 32px)); }
.new-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 18px 18px; }
.new-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--text); text-align: left; cursor: pointer; transition: background .12s, border-color .12s; }
.new-opt:hover { background: var(--surface-2); border-color: var(--border-2); } .new-opt .ic { width: 20px; height: 20px; color: var(--accent); margin-bottom: 4px; }
.new-opt b { font-weight: 600; font-size: .9rem; } .new-opt small { color: var(--muted); font-size: .76rem; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.keys-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; padding: 4px 18px 18px; margin: 0; font-size: .9rem; align-items: center; } .keys-list dd { margin: 0; color: var(--text-2); }

/* palette */
.dlg.pal { width: min(640px, calc(100vw - 32px)); margin-top: 10vh; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); } .pal-in .ic { color: var(--muted); width: 18px; height: 18px; }
.pal-in input { border: 0; height: 32px; padding: 0; font-size: 1.05rem; background: transparent; } .pal-in input:focus { box-shadow: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.pal-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; }
.pal-list li .ic { width: 16px; height: 16px; color: var(--muted); } .pal-list li small { margin-left: auto; color: var(--muted); font-size: .78rem; }
#ic-tpl { display: none; }
.pal-list li.on, .pal-list li:hover { background: var(--accent-soft); } .pal-list li.on .ic { color: var(--accent); }
.pal-list .pal-g { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; cursor: default; } .pal-list .pal-g:hover { background: none; }
.pal-list .pal-none { color: var(--muted); cursor: default; } .pal-list .pal-none:hover { background: none; }
.pal-f { display: flex; gap: 16px; padding: 8px 16px 10px; border-top: 1px solid var(--border); font-size: .76rem; color: var(--muted); }

/* suggestions while typing */
.suggest { position: fixed; z-index: 70; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-2); max-height: 260px; overflow-y: auto; }
.suggest li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: .88rem; } .suggest li.on, .suggest li:hover { background: var(--accent-soft); } .suggest li small { color: var(--muted); }
.sug-hint { display: block; font-size: .76rem; color: var(--muted); margin-top: 3px; min-height: 1em; }

/* ============ rows ============ */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: visible; }
.row { border-top: 1px solid var(--border); position: relative; }
.row:first-child { border-top: 0; }
.rl { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 10px 6px 12px; }
.rc { width: 24px; display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-3); }
.rc .ic { width: 16px; height: 16px; }
.rm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rt { font-weight: 500; font-size: .94rem; text-decoration: none; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
a.rt:hover { color: var(--accent); }
.rb { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-height: 0; }
.b { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--text-2); text-decoration: none; white-space: nowrap; border: 0; background: none; padding: 0; cursor: default; font-family: inherit; }
.b .ic { width: 13px; height: 13px; color: var(--muted); } .b.muted { color: var(--muted); } a.b:hover { color: var(--accent); cursor: pointer; }
.b.note { color: var(--text-2); max-width: 320px; } .b.note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b.steps { cursor: pointer; } .b.steps:hover { color: var(--accent); } .b.steps .bar { width: 36px; }
.rs { display: flex; align-items: center; gap: 10px; flex: none; }
.ra { display: flex; align-items: center; gap: 4px; flex: none; }
.ra form { display: contents; }
.row .ra .btn.quiet, .row .ra .menu > summary { opacity: 0; transition: opacity .1s; }
.row:hover .ra .btn.quiet, .row:hover .ra .menu > summary, .row:focus-within .ra .btn.quiet, .row:focus-within .ra .menu > summary, .row .ra .menu[open] > summary { opacity: 1; }
.ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: transparent; padding: 0; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.ck .ic { width: 13px; height: 13px; stroke-width: 2.6; } .ck:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.ck.on { background: var(--ok); border-color: var(--ok); color: #fff; } .ck.live { border-color: var(--live); animation: pulse 1.8s infinite; }
.row.done .rt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-2); }
.row.done .rb .pill, .row.done .b { opacity: .7; }
.row.live > .rl { background: linear-gradient(90deg, var(--ok-soft), transparent 60%); }
.row.prio-urgent > .rl::before, .row.prio-high > .rl::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--danger); }
.row.prio-high > .rl::before { background: var(--warn); }
.rows > .row:first-child > .rl { border-radius: var(--r) var(--r) 0 0; } .rows > .row:last-child > .rl { border-radius: 0 0 var(--r) var(--r); }
.runner { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--live); } .runner .ic { width: 12px; height: 12px; }
.who-av { display: inline-flex; }
.qty { color: var(--muted); font-weight: 400; font-size: .9em; }
/* sub rows (steps) */
.subs { border: 0; border-radius: 0; background: var(--surface-2); display: none; }
.row.open > .subs { display: block; }
.detail .subs, .kcard .subs { display: block; }
.subs .row { border-top: 1px solid var(--border); } .subs .rl { min-height: 38px; padding: 3px 10px 3px 44px; } .subs .rt { font-size: .88rem; font-weight: 400; }
.subs .ck { width: 19px; height: 19px; } .subs .ck .ic { width: 11px; height: 11px; }
.subs .row.live > .rl { background: var(--ok-soft); }
.row.add .add-f { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 3px 10px 3px 44px; }
.row.add .rc { color: var(--text-3); margin-left: -34px; }
.row.add input { height: 30px; border-color: transparent; background: transparent; padding: 0 6px; font-size: .88rem; } .row.add input:hover, .row.add input:focus { background: var(--field); border-color: var(--border-2); }
.row.add .btn { opacity: 0; } .row.add:focus-within .btn, .row.add input:not(:placeholder-shown) ~ .btn { opacity: 1; }
.rows:last-child { margin-bottom: 0; }
.rows .row.mini .rl { min-height: 40px; } .row.mini .rt { font-size: .9rem; }
.live-sec .rows { border-color: var(--accent-line); }

/* quick add */
.quick-add { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px 0 14px; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
.quick-add:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.quick-add > .ic { color: var(--text-3); width: 18px; height: 18px; }
.quick-add input { border: 0; height: 40px; padding: 0 4px; background: transparent; font-size: .96rem; } .quick-add input:focus { box-shadow: none; }
.quick-add .btn.primary { opacity: 0; transition: opacity .12s; } .quick-add:focus-within .btn.primary, .quick-add input:not(:placeholder-shown) ~ .btn.primary { opacity: 1; }
.sec .quick-add { margin-bottom: 10px; }

/* ============ board ============ */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; min-height: 240px; transition: background .12s, border-color .12s; }
.kcol h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 2px 4px 10px; display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 600; }
.kcol[data-stage=doing] h2 { color: var(--ok); } .kcol.over { border-color: var(--accent); background: var(--accent-soft); }
.kcol-b { display: flex; flex-direction: column; gap: 8px; }
.kempty { color: var(--text-3); font-size: .84rem; text-align: center; padding: 30px 10px; border: 1px dashed var(--border-2); border-radius: var(--r-sm); margin: 0; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; position: relative; }
.kcard[draggable=true] { cursor: grab; } .kcard.dragging { opacity: .5; }
.kcard.live { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), var(--shadow); }
.kcard.prio-urgent { border-left: 3px solid var(--danger); } .kcard.prio-high { border-left: 3px solid var(--warn); }
.kc-top { display: flex; flex-wrap: wrap; gap: 4px; }
.kc-title { font-weight: 600; font-size: .94rem; line-height: 1.3; text-decoration: none; color: var(--text); } .kc-title:hover { color: var(--accent); }
.kcard .bar { width: 100%; display: block; height: 4px; }
.kc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kc-who { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-2); flex: 1 1 120px; min-width: 0; }
.kc-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-foot > .timer, .kc-foot > .small { margin-left: auto; }
.kc-act { display: flex; gap: 4px; align-items: center; width: 100%; justify-content: flex-end; } .kc-act form { display: contents; }
.kcard .kc-act .btn.quiet, .kcard .kc-act .menu > summary { opacity: 0; } .kcard:hover .kc-act .btn.quiet, .kcard:hover .kc-act .menu > summary, .kcard .menu[open] > summary { opacity: 1; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ck-row { display: flex; align-items: center; gap: 8px; font-size: .86rem; padding: 3px 0; } .ck-row form { display: contents; }
.ck-row .ck-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ck-row.done .ck-t { color: var(--muted); text-decoration: line-through; }
.ck-row.live { color: var(--ok); font-weight: 500; } .ck-row .ck { width: 18px; height: 18px; } .ck-row .ck .ic { width: 10px; height: 10px; }
.checklist-d > summary { list-style: none; cursor: pointer; font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 5px; } .checklist-d > summary::-webkit-details-marker { display: none; }
.checklist-d[open] > summary { margin-bottom: 6px; }

/* ============ the detail panel ============ */
.detail { animation: pop .15s ease-out; }
.d-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .82rem; color: var(--muted); min-height: 20px; }
.d-top .b { font-size: .82rem; }
.d-title { font-size: 1.3rem; margin: 8px 0 6px; line-height: 1.25; }
.d-note { color: var(--text-2); white-space: pre-wrap; margin: 0 0 10px; font-size: .92rem; }
.d-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; } .d-actions form { display: contents; } .d-actions .menu { margin-left: auto; }
.d-meta { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.d-sec { margin: 22px 0 0; } .d-sec h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-family: var(--sans); font-weight: 600; }
.d-sec h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.d-sec .rows { border-radius: var(--r-sm); } .d-sec .subs { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
.d-sec .subs .rl { padding-left: 10px; } .d-sec .row.add .add-f { padding-left: 10px; } .d-sec .row.add .rc { margin-left: 0; }
.sess-list, .j-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sess, .j-entry { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; font-size: .88rem; background: var(--surface); }
.sess.live { border-color: var(--accent-line); }
.sess-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin-bottom: 4px; } .sess-h b { color: var(--text); } .sess-h .timer { margin-left: auto; }
.sess-h form { display: contents; }
.j-f { margin: 6px 0 0; } .j-f b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 1px; } .j-f p { margin: 0; white-space: pre-wrap; }
.sess .more, .j-entry .more { margin-top: 8px; }

/* ============ run mode ============ */
.run .page-main { max-width: 720px; }
.run-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.run-hero.live { border-color: var(--accent-line); background: linear-gradient(135deg, var(--ok-soft), var(--surface) 60%); }
.run-timer { display: flex; flex-direction: column; gap: 4px; } .run-timer small { color: var(--muted); }
.run-actions { display: flex; gap: 10px; flex-wrap: wrap; } .run-actions form { display: contents; } .run-actions .btn { height: 48px; padding: 0 20px; font-size: 1rem; }
.run .bar.wide, .run > .page-main .bar { display: block; width: 100%; height: 6px; margin: 0 0 12px; }
.run-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.run-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); font-size: 1.05rem; }
.run-step .rn { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font: 600 .85rem var(--mono); flex: none; }
.run-step .rst { flex: 1; min-width: 0; display: flex; flex-direction: column; } .run-step .rst small { color: var(--muted); font-size: .82rem; }
.run-step.done { opacity: .6; } .run-step.done .rst { text-decoration: line-through; } .run-step.done .rn { background: var(--ok); color: #fff; }
.run-step.live { border-color: var(--live); box-shadow: 0 0 0 2px var(--ok-soft); } .run-step.live .rn { background: var(--live); color: #fff; }
.run-step.current:not(.live) { border-color: var(--accent-line); }
.rsa { display: flex; gap: 8px; } .rsa form { display: contents; }

/* ============ Today ============ */
.now { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); margin: 0 0 22px; flex-wrap: wrap; }
.now.live { border-color: var(--accent-line); background: linear-gradient(120deg, var(--ok-soft), var(--surface) 55%); }
.now.idle { padding: 12px 18px; gap: 12px; justify-content: flex-start; color: var(--muted); font-size: .9rem; }
.now-k { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ok); display: inline-flex; align-items: center; gap: 5px; }
.now.idle .now-k { color: var(--muted); }
.now-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.now-t { font: 600 1.35rem/1.25 var(--display); letter-spacing: -.01em; text-decoration: none; color: var(--text); } .now-t:hover { color: var(--accent); }
.now-s { color: var(--text-2); font-size: .9rem; } .now-b { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.now-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; } .now-a { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; } .now-a form { display: contents; }
.needs .rows { border-color: var(--warn); border-left-width: 3px; }
.team-now .card-b { padding-top: 8px; }
.w-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.w-p { display: flex; gap: 10px; align-items: flex-start; } .w-m { min-width: 0; flex: 1; font-size: .88rem; }
.w-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; } .w-h small { color: var(--muted); font-size: .76rem; }
.w-p.busy .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--live); }
.w-task { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; } .w-task a { text-decoration: none; font-weight: 500; } .w-task a:hover { color: var(--accent); } .w-task small { color: var(--muted); }
.w-idle { color: var(--muted); font-size: .82rem; } .w-off { font-size: .78rem; color: var(--text-3); margin: 10px 0 0; }

/* ============ login ============ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 50% -100px, var(--accent-soft), transparent 70%), var(--bg); }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-2); }
.login-sub { text-align: center; margin: -6px 0 6px; }
.login .btn { height: 42px; margin-top: 6px; }

/* ============ responsive ============ */
@media (max-width: 1280px) { :root { --panel-w: 400px; } }
@media (max-width: 1100px) { .pb.two { grid-template-columns: 1fr; } .pb-aside { position: static; } .has-panel .pb.two { grid-template-columns: 1fr; } }
@media (max-width: 1023px) {
  :root { --top-h: 52px; }
  .only-m { display: inline-flex !important; }
  #app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-104%); transition: transform .2s ease; box-shadow: var(--shadow-2); }
  html.nav-open .side { transform: none; }
  .side-bg { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(10 12 18 / .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  html.nav-open .side-bg { opacity: 1; pointer-events: auto; }
  html.nav-open { overflow: hidden; }
  .top { padding: 0 12px; gap: 6px; }
  .search { width: auto; flex: 1; min-width: 0; } .search .keys { display: none; }
  .top-r .btn.primary.js-new { display: none; }
  .running-pill { max-width: 140px; }
  .page-main { padding: 16px 16px calc(var(--tabbar-h) + 24px); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom); display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: stretch; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .tabbar > a, .tabbar > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; text-decoration: none; font-size: .68rem; font-weight: 600; color: var(--muted); position: relative; border-radius: 10px; }
  .tabbar > a .ic, .tabbar > button .ic { width: 22px; height: 22px; } .tabbar > a.on { color: var(--accent); }
  .tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .fab { width: 52px; height: 52px; margin: -22px auto 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -6px var(--accent); align-self: start; }
  .fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
  .panel { position: fixed; inset: 0; width: auto; height: auto; z-index: 44; border: 0; animation: pop .18s ease-out; padding-bottom: 20px; }
  .panel-top { padding: 10px 10px 0; } .panel-b { padding: 0 16px 40px; }
  .kanban { grid-template-columns: repeat(3, 82vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -16px; padding-left: 16px; }
  .kcol { scroll-snap-align: start; }
  .row .ra .btn.quiet, .row .ra .menu > summary, .kcard .kc-act .btn.quiet, .kcard .kc-act .menu > summary { opacity: 1; }
  .quick-add .btn.primary { opacity: 1; } .row.add .btn { opacity: 1; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 1.3rem; }
  .bt { display: none; } .btn.clock .bt { display: none; } .btn .bl { display: none; }
  .btn:not(.icon):has(.ic):not(:has(.bl)) { padding: 0 10px; }
  .btn.primary .bt, .btn.ok .bt, .btn.warn .bt, .dlg .btn .bt, .run-actions .btn .bt, .now-a .btn .bt, .d-actions .btn .bt, .seg .bt { display: inline; }
  .quick-add .btn .bt { display: inline; }
  .ph { flex-direction: column; align-items: flex-start; gap: 8px; } .ph-r .btn.quiet { border-color: var(--border); background: var(--surface); }
  .empty .btn .bt, .hint .btn .bt { display: inline; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .new-grid { grid-template-columns: 1fr 1fr; }
  .rl { padding: 8px 6px 8px 12px; min-height: 52px; gap: 8px; }
  .rs { flex-direction: column; align-items: flex-end; gap: 3px; } .ra .btn .bt { display: none; } .ra .btn:not(.icon) { padding: 0 8px; }
  .rt { white-space: normal; }
  .tb-row { gap: 8px; } .tb-row .search-f { margin-left: 0; width: 100%; } .search-f input { flex: 1; width: auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; } .chips::-webkit-scrollbar { display: none; }
  .btn.clock .bt { display: inline; }
  .search { flex: none; width: 36px; padding: 0; justify-content: center; } .search .bt { display: none; }
  .top:not(:has(.running-pill)) .search { flex: 1; width: auto; padding: 0 10px 0 12px; justify-content: flex-start; } .top:not(:has(.running-pill)) .search .bt { display: inline; }
  .running-pill { flex: 1; min-width: 0; max-width: none; }
  .stats { grid-template-columns: 1fr 1fr; } .stats.compact { grid-template-columns: 1fr 1fr; }
  .now { padding: 14px 16px; } .now-r { align-items: flex-start; width: 100%; } .now-a { justify-content: flex-start; } .timer.big { font-size: 2.2rem; }
  .props { grid-template-columns: 1fr 1fr; }
  .dlg { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0; } .dlg-form { max-height: 92vh; }
  .dlg.pal { margin: 0; border-radius: 0 0 16px 16px; }
  .d-actions .menu { margin-left: 0; }
  .run-step { font-size: 1rem; padding: 10px 12px; gap: 10px; }
  .menu-list { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(var(--tabbar-h) + 10px); min-width: 0; }
}

/* v8.2: photos in run mode and the zoom dialog */
.run-pics { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.run-pics .js-zoom { padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; width: 96px; aspect-ratio: 4 / 3; background: var(--surface-2); cursor: zoom-in; }
.run-pics img { display: block; width: 100%; height: 100%; object-fit: cover; }
.run-step.current .run-pics .js-zoom { width: 150px; }
.photo-dlg { max-width: min(96vw, 1100px); padding: 0; background: #000; border: 0; }
.photo-dlg .dlg-form { position: relative; padding: 0; display: flex; flex-direction: column; align-items: center; }
.photo-dlg img { max-width: 96vw; max-height: 86vh; display: block; object-fit: contain; }
.photo-dlg .js-photo-cap { color: #ddd; margin: 8px 12px 12px; font-size: .9rem; min-height: 1em; }
.photo-dlg .photo-x { position: absolute; top: 8px; right: 8px; background: rgb(0 0 0 / .5); color: #fff; z-index: 1; }
