/* private dashboard — its own quiet look, separate from the rest of the site.
   cool gray desk, a lighter paper panel, one steel-blue accent for anything
   interactive, sage for done, burnt orange only for "important". */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../font/atkinson-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../font/atkinson-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --desk: #e3e7eb;
  --paper: #f9fafb;
  --paper-2: #eef1f4;
  --ink: #1f2a33;
  --ink-2: #5c6a75;
  --line: #d2d9df;
  --line-2: #e4e9ed;
  --accent: #2b6c8f;
  --accent-ink: #1e4f6a;
  --accent-soft: #dbe8f1;
  --done: #4f8a66;
  --done-soft: #e0efe5;
  --imp: #b9531f;
  --imp-soft: #f8e6db;
  --danger: #b03a3a;
  --shadow: 0 6px 24px rgba(31, 42, 51, .14);
  --r: 3px;
}
:root[data-theme="dark"] {
  --desk: #14191e;
  --paper: #1e252c;
  --paper-2: #252d35;
  --ink: #e7ecf0;
  --ink-2: #9fb0bd;
  --line: #36414b;
  --line-2: #2b343c;
  --accent: #8cc3e4;
  --accent-ink: #b9dcf2;
  --accent-soft: #223747;
  --done: #8ccaa2;
  --done-soft: #22372b;
  --imp: #f0a678;
  --imp-soft: #46301f;
  --danger: #e38585;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

html { background: var(--desk); }
body {
  margin: 0; color: var(--ink);
  font-family: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.dash-page { max-width: 1040px; margin: 0 auto; padding: 22px 20px 120px; }
.dash-top { display: flex; gap: 16px; font-size: 14px; margin-bottom: 20px; }
.dash-top a { color: var(--ink-2); text-decoration: none; }
.dash-top a:hover { color: var(--accent); text-decoration: underline; }
a { color: var(--accent); }

/* visually hidden, still read by screen readers */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- panels ---- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px 24px; }
.empty { color: var(--ink-2); margin: 10px 4px; }

/* ---- controls ---- */
.dash input[type="text"], .dash input[type="search"], .dash input[type="url"],
.dash input[type="number"], .dash input[type="date"], .dash input[type="month"],
.dash select, .dash textarea, .dash-login input {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 10px; margin: 0; box-sizing: border-box;
}
.dash input::placeholder, .dash textarea::placeholder { color: var(--ink-2); opacity: .8; }
.dash input[type="search"] { -webkit-appearance: none; appearance: none; }
.dash button, .dash-login button {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px; margin: 0; cursor: pointer;
  line-height: 1.3;
}
.dash button:hover, .dash-login button:hover { border-color: var(--accent); color: var(--accent-ink); }
.dash button:disabled { opacity: .5; cursor: default; }
.dash button.primary, .dash-login button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.dash button.primary:hover, .dash-login button.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.dash button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.dash button.danger { color: var(--danger); }
.dash button.danger:hover { border-color: var(--danger); color: var(--danger); }
.dash button.mini, .dash button.plain {
  background: transparent; border-color: transparent; color: var(--accent); padding: 3px 8px; font-size: 14px; border-radius: var(--r);
}
.dash button.mini:hover, .dash button.plain:hover { background: var(--accent-soft); border-color: transparent; }
.dash button.mini.danger { color: var(--danger); }
.dash button.mini.danger:hover { background: var(--imp-soft); }
.dash :focus-visible, .dash-login :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- login gate ---- */
.dash-gate-panel { max-width: 380px; margin: 40px auto; }
.dash-gate-panel h1 { margin: 0 0 16px; font-size: 24px; }
.dash-login label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 15px; }
.dash-login input { width: 100%; }
.dash-login button { margin-top: 12px; width: 100%; padding: 9px; }
.dash-error { color: var(--danger); min-height: 1.4em; margin-top: 10px; font-size: 15px; }
.dash-checking { color: var(--ink-2); text-align: center; margin: 60px 0; }

/* ---- page head + toolbar ---- */
.td-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.td-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.01em; }
.td-head form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.td-head form input { font-size: 22px; font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 14px; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: var(--r) 0 0 var(--r); }
.seg button:last-child { border-radius: 0 var(--r) var(--r) 0; }
.seg button + button { margin-left: -1px; }
.toolbar label { font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.toolbar label .cnt { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.dash input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.openall { display: inline-flex; gap: 2px; }
.td-status { color: var(--ink-2); font-size: 14px; margin-left: auto; white-space: nowrap; }
.td-status.err { color: var(--danger); font-weight: 700; }
.toolbar input[type="search"] { min-width: 150px; flex: 1 1 150px; }

/* ---- layout: section list on the left, the list itself on the right ---- */
.td-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.td-main { min-width: 0; }
.sections { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.dash .tab {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%;
  padding: 8px 10px 8px 12px; border: none; border-left: 3px solid transparent; border-radius: 0;
  background: transparent; color: var(--ink-2); font-size: 15px; text-align: left; line-height: 1.35;
}
.dash .tab:hover { color: var(--accent-ink); background: var(--paper-2); border-color: transparent; }
.dash .tab[aria-selected="true"] { color: var(--ink); font-weight: 700; border-left-color: var(--accent); background: var(--paper); }
.tab-name { min-width: 0; overflow-wrap: anywhere; }
.tab-count { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--accent); font-weight: 700; }
.tab-count.zero { color: var(--done); font-weight: 400; }
.tab-count.empty { color: var(--ink-2); font-weight: 400; }
.dash .tab-add { color: var(--accent); margin-top: 6px; }

/* ---- section head inside the panel ---- */
.sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.sec-name { margin: 0; font-size: 22px; }
.sec-count { margin-left: auto; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-left { color: var(--accent); font-weight: 700; }
.of { color: var(--ink-2); font-weight: 400; }
.sec-note, .cat-note { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: 15px; }
.sec-note { margin: 2px 0 14px; }
.cat-note { padding: 4px 4px 8px 34px; }
.filter-note { color: var(--ink-2); font-size: 14px; margin: 6px 4px 12px; }

/* ---- categories ---- */
.cat { border-top: 1px solid var(--line-2); }
.cat:first-of-type { border-top: none; }
.cat > summary {
  list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; cursor: pointer; color: var(--ink);
}
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary::before {
  content: ''; width: 8px; height: 8px; margin: 0 6px 2px 6px; flex: 0 0 auto;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg);
}
.cat[open] > summary::before { transform: rotate(45deg); margin-bottom: 6px; }
.cat-name { margin: 0; font-size: 17px; font-weight: 700; display: inline; }
.cat-count { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-count .num-left { font-size: 15px; }
.bar { display: inline-block; width: 72px; height: 6px; border-radius: 0; background: var(--line-2); overflow: hidden; flex: 0 0 auto; }
.bar > span { display: block; height: 100%; background: var(--done); }
.cat.complete > summary .cat-name { color: var(--ink-2); font-weight: 400; }
.cat.complete .of { color: var(--done); }

/* ---- items ---- */
.items { list-style: none; margin: 0; padding: 0 0 4px; }
.item { padding: 5px 4px 5px 30px; border-radius: var(--r); }
.item.selected { background: var(--accent-soft); }
.item .row { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.dash .chk, .dash .sel {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0; position: relative; box-sizing: border-box;
  border: 2px solid var(--ink-2); border-radius: var(--r); background: var(--paper); cursor: pointer; line-height: 0;
}
.dash .chk:hover { border-color: var(--done); }
.dash .chk.on { background: var(--done); border-color: var(--done); }
.dash .chk.on::after, .dash .sel.on::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.dash .chk.small { width: 18px; height: 18px; }
.dash .chk.small.on::after { left: 4px; top: 1px; width: 4px; height: 8px; border-width: 0 2px 2px 0; }
.dash .sel { border-color: var(--accent); }
.dash .sel:hover { border-color: var(--accent-ink); }
.dash .sel.on { background: var(--accent); border-color: var(--accent); }
.dash .sel.some { background: linear-gradient(var(--accent), var(--accent)) center / 10px 3px no-repeat; }
.item .name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.item .name[data-action], .step .name[data-action] { cursor: pointer; }
.item .name a, .step .name a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.item .name a:hover, .step .name a:hover { text-decoration-color: var(--accent); }
.item .name a::after, .step .name a::after { content: '↗'; font-size: 12px; margin-left: 4px; color: var(--accent); }
.item.done .name { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.ess {
  display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: var(--r);
  font-size: 12px; font-weight: 700; color: var(--imp); background: var(--imp-soft); vertical-align: 2px; letter-spacing: .02em;
}
.item.done .ess { opacity: .55; }
.row-actions { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.item > .row > .row-actions, .cat > summary > .mini, .sec-head > .mini, .td-head > .mini { opacity: 0; pointer-events: none; }
.item:hover > .row > .row-actions, .item:focus-within > .row > .row-actions,
.cat > summary:hover > .mini, .cat > summary:focus-within > .mini,
.sec-head:hover > .mini, .sec-head:focus-within > .mini,
.td-head:hover > .mini, .td-head:focus-within > .mini,
.row-actions:focus-within, .dash .mini:focus-visible { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .item > .row > .row-actions, .cat > summary > .mini, .sec-head > .mini, .td-head > .mini { opacity: 1; pointer-events: auto; }
}

/* the little step bar: one cell per step */
.segbar { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.segbar i { display: block; width: 10px; height: 10px; background: var(--line); }
.segbar i.on { background: var(--done); }
.segbar .n { font-size: 13px; color: var(--ink-2); margin: 0 4px 0 6px; font-variant-numeric: tabular-nums; }

.item-extra { margin: 0 0 4px 34px; font-size: 15px; }
.note { color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.thumb img { display: block; max-height: 90px; max-width: 200px; border-radius: var(--r); margin-top: 6px; }
.thumb.broken { color: var(--ink-2); font-size: 13px; }
.steps { list-style: none; margin: 4px 0 2px; padding: 0; }
.step { display: flex; align-items: center; gap: 10px; font-size: 15.5px; padding: 3px 0; }
.step.done .name { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---- add rows ---- */
.add { display: flex; gap: 8px; padding: 6px 4px 12px 30px; }
.add input { flex: 1 1 auto; min-width: 0; border-style: dashed; background: transparent; }
.add input:focus { background: var(--paper); border-style: solid; }
.add-cat { padding: 14px 4px 0; border-top: 1px solid var(--line-2); margin-top: 4px; }
.add-sec { padding: 4px 0; }

/* ---- edit forms ---- */
.edit-form {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; align-items: center;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin: 6px 0 10px; font-size: 15px;
}
.edit-form .k { color: var(--ink-2); text-align: right; }
.edit-form input[type="text"], .edit-form input[type="url"], .edit-form select, .edit-form textarea { width: 100%; }
.edit-form textarea { min-height: 72px; resize: vertical; }
.edit-form label.inline { display: flex; align-items: center; gap: 8px; }
.edit-form .imgrow { display: flex; gap: 8px; align-items: center; }
.edit-form .imgrow input { flex: 1; }
.edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.edit-actions .spacer { flex: 1; }
.steps-edit { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: var(--r); padding: 8px 10px 10px; margin: 0; min-width: 0; }
.steps-edit legend { color: var(--ink-2); font-size: 14px; padding: 0 6px; }
.steps-edit ol { list-style: none; margin: 0 0 6px; padding: 0; }
.steps-edit li { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.steps-edit li .n { color: var(--ink-2); font-size: 14px; width: 1.4em; text-align: right; flex: 0 0 auto; }
.steps-edit li .sname { flex: 2 1 120px; min-width: 0; }
.steps-edit li .slink { flex: 1 1 100px; min-width: 0; }
.steps-edit li.done .sname { color: var(--ink-2); }

/* ---- select mode bar ---- */
.selbar { position: sticky; top: 8px; z-index: 6; margin: 0 0 10px; }
.selbar[hidden] { display: none; }
.selbar-inner {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  background: var(--paper); border: 1px solid var(--accent); border-radius: var(--r);
  padding: 10px 14px; box-shadow: var(--shadow);
}
.sel-count { font-variant-numeric: tabular-nums; }
.sel-quick { color: var(--ink-2); font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.selbar .spacer { flex: 1; }

/* ---- notes, footer, toast ---- */
.notes { margin-top: 26px; }
.notes summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.notes textarea { width: 100%; min-height: 180px; margin-top: 8px; }
.dash-foot { margin-top: 26px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 15px; color: var(--ink-2); }
/* ---- inline notices: nothing floats over the page ---- */
.notice { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 10px; border: 1px solid var(--line); background: var(--paper-2); font-size: 15px; }
.notice[hidden] { display: none; }
.notice.err { border-color: var(--danger); color: var(--danger); }
.notice .spacer { flex: 1; }
.dash button.undo { font-weight: 700; color: var(--accent); background: var(--paper); border-color: var(--accent); padding: 3px 12px; font-size: 14px; }
.dash button.undo:hover { background: var(--accent-soft); }
.item.ghost { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 15px; padding: 7px 8px 7px 30px; border: 1px dashed var(--line); margin: 3px 0; }
.item.ghost .name { flex: 1 1 auto; }
.cat.ghost { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 15px; padding: 10px 8px; border-top: 1px solid var(--line-2); }
.cat.ghost .name { flex: 1 1 auto; }

/* ---- hub ---- */
.hub-list { font-size: 19px; }
.hub-row { display: flex; align-items: baseline; gap: 12px; padding: 12px 6px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-2); }
.hub-row:first-child { border-top: none; }
.hub-row:hover { color: var(--accent-ink); }
.hub-row .when { margin-left: auto; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.hub-list + .hub-list { border-top: 1px solid var(--line-2); }

/* ---- fingers instead of a mouse: bigger targets ---- */
@media (pointer: coarse) {
  .dash .chk, .dash .sel { width: 26px; height: 26px; }
  .dash .chk.on::after, .dash .sel.on::after { left: 8px; top: 3px; width: 6px; height: 12px; }
  .dash .chk.small { width: 22px; height: 22px; }
  .dash .chk.small.on::after { left: 6px; top: 2px; width: 5px; height: 10px; }
  .dash button.mini, .dash button.plain { padding: 7px 10px; min-height: 36px; }
  .dash button, .dash-login button { min-height: 38px; }
  .item .row { gap: 12px; min-height: 40px; }
  .step { padding: 5px 0; }
  .cat > summary { padding: 14px 4px; }
  .dash input[type="checkbox"] { width: 22px; height: 22px; }
}

/* ---- small screens ---- */
@media (max-width: 760px) {
  .td-layout { display: block; }
  .sections { position: static; gap: 0; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .dash .tab { padding: 8px 10px; border-left-width: 3px; }
  .dash .tab-add { margin-top: 0; }
}
@media (max-width: 640px) {
  .dash-page { padding: 14px 10px 110px; }
  .panel { padding: 16px 12px 18px; }
  .td-head h1 { font-size: 24px; }
  .toolbar { gap: 8px 10px; }
  .td-status { margin-left: auto; }
  .toolbar input[type="search"] { flex: 1 1 100%; }
  .sec-name { font-size: 20px; }
  .cat .bar { display: none; }
  .item { padding-left: 10px; }
  .item-extra { margin-left: 34px; }
  .add { padding-left: 10px; }
  .edit-form { grid-template-columns: 1fr; }
  .edit-form .k { text-align: left; margin-bottom: -6px; }
  .steps-edit li { flex-wrap: wrap; }
  .selbar { top: 4px; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width .25s ease; }
  .segbar i, .dash .chk { transition: background-color .15s ease, border-color .15s ease; }
  .cat > summary::before { transition: transform .15s ease; }
}

/* ---- pgp tool ---- */
.pgp-lockstate { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.pgp-lockstate .unlocked { color: var(--done); font-weight: 700; }
.pgp-row { margin: 0 0 16px; }
.pgp-row:last-child { margin-bottom: 0; }
.k-label { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.k-label .mini { margin-left: 6px; }
.pgp textarea { width: 100%; resize: vertical; }
.pgp-armor { font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 12.5px; line-height: 1.45; min-height: 150px; white-space: pre; }
.pgp-msg-in { min-height: 120px; }
.pgp-plain { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dash button.chip { border-radius: 14px; padding: 5px 14px; font-size: 15px; }
.dash button.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pgp-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.fp { font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 13px; color: var(--ink-2); letter-spacing: .05em; overflow-wrap: anywhere; }
.sig-line { margin-top: 10px; font-size: 15px; }
.sig-ok { color: var(--done); font-weight: 700; }
.sig-bad { color: var(--danger); font-weight: 700; }
.sig-warn { color: var(--imp); font-weight: 700; }
.pgp-warn { border: 1px solid var(--imp); background: var(--imp-soft); border-radius: var(--r); padding: 10px 14px; font-size: 15px; margin: 0 0 16px; }
.pgp-unlock { border: 1px solid var(--accent); background: var(--paper-2); border-radius: var(--r); padding: 12px 14px; margin: 0 0 16px; }
.pgp-unlock form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pgp-unlock input { flex: 1 1 180px; }
.pgp-unlock .k-label { flex: 1 1 100%; margin: 0; }
.contact-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--line-2); }
.contact-row:first-child { border-top: none; }
.contact-row .c-main { flex: 1 1 auto; min-width: 0; }
.c-name { font-weight: 700; }
.c-uid { color: var(--ink-2); font-size: 14.5px; overflow-wrap: anywhere; }
.contact-row .row-actions { opacity: 1; pointer-events: auto; flex: 0 0 auto; }
.pgp-add { border-top: 1px solid var(--line-2); margin-top: 8px; padding-top: 16px; }
.pgp-add h2, .pgp-setup h2 { font-size: 17px; margin: 0 0 10px; }
.pgp-form { display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; align-items: center; font-size: 15px; max-width: 560px; }
.pgp-form .k { color: var(--ink-2); text-align: right; }
.pgp-form input { width: 100%; }
.pgp-form .full { grid-column: 1 / -1; }
.pgp-setup + .pgp-setup { border-top: 1px solid var(--line-2); margin-top: 22px; padding-top: 20px; }
.pgp-me-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.pgp-reveal { margin-top: 14px; }
.pgp-reveal summary { cursor: pointer; color: var(--ink-2); font-size: 15px; }
.pgp-hint { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
@media (max-width: 640px) {
  .pgp-form { grid-template-columns: 1fr; }
  .pgp-form .k { text-align: left; margin-bottom: -6px; }
}

/* inline contact add/remove on write + read */
.chip-wrap { display: inline-flex; align-items: center; }
.dash button.chip-x { border: none; background: transparent; color: var(--danger); padding: 2px 5px; margin-left: -4px; font-size: 16px; line-height: 1; opacity: 0; }
.chip-wrap:hover .chip-x, .chip-wrap:focus-within .chip-x { opacity: 1; }
.dash button.chip-x:hover { background: var(--imp-soft); border-color: transparent; color: var(--danger); }
@media (hover: none) { .dash button.chip-x { opacity: 1; } }
.pgp-inline-add { border: 1px dashed var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 10px; }
.pgp-inline-add .pgp-actions input[type="text"] { flex: 1 1 200px; }

/* ---- fitness tool ---- */
.fit-streak { font-size: 14px; color: var(--ink-2); }
.fit-dayrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.fit-dayrow input[type="date"] { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.fit-hint { color: var(--ink-2); font-size: 14.5px; }
.fit-ex { border-top: 1px solid var(--line-2); padding: 14px 4px; }
.fit-ex:first-of-type { border-top: none; }
.fit-ex-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fit-ex-name { font-weight: 700; }
.fit-target { color: var(--ink-2); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.fit-badge { font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); letter-spacing: .02em; }
.fit-last { color: var(--ink-2); font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fit-bump { color: var(--accent-ink); font-size: 14.5px; font-weight: 700; margin-top: 2px; }
.fit-note { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.fit-inputs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.fit-inputs input[type="number"] { width: 74px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.fit-inputs .x { color: var(--ink-2); font-size: 14px; }
.fit-row-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.fit-row-form .fld { display: flex; flex-direction: column; gap: 4px; }
.fit-row-form .fld span { font-size: 13.5px; color: var(--ink-2); }
.fit-row-form input[type="number"] { width: 90px; }
.fit-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.fit-table th { text-align: left; color: var(--ink-2); font-size: 13.5px; font-weight: 400; padding: 6px 10px 6px 4px; border-bottom: 1px solid var(--line); }
.fit-table td { padding: 7px 10px 7px 4px; border-bottom: 1px solid var(--line-2); }
.fit-table .num { text-align: right; }
.fit-table th.num { text-align: right; }
.fit-sess { padding: 10px 4px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fit-sess .when { font-weight: 700; white-space: nowrap; }
.fit-sess .what { color: var(--ink-2); font-size: 14.5px; flex: 1 1 240px; min-width: 0; font-variant-numeric: tabular-nums; }
.fit-h2 { font-size: 17px; margin: 22px 0 8px; }
.fit-h2:first-child { margin-top: 0; }
.chart-card { margin: 0 0 22px; }
.chart-card h2 { font-size: 16px; margin: 0 0 2px; }
.chart-card .sub { color: var(--ink-2); font-size: 13.5px; margin: 0 0 8px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.ch-grid { stroke: var(--line-2); stroke-width: 1; }
.ch-txt { fill: var(--ink-2); font-size: 11px; font-family: inherit; }
.ch-line { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.ch-hover-dot { fill: var(--accent-ink); stroke: var(--paper); stroke-width: 2; }
.ch-target { stroke: var(--imp); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ch-tip {
  position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 5px 9px; font-size: 13px;
  white-space: nowrap; transform: translate(-50%, -110%); font-variant-numeric: tabular-nums;
}
.fit-empty-chart { color: var(--ink-2); font-size: 14.5px; padding: 18px 0; }
@media (max-width: 640px) {
  .fit-inputs input[type="number"] { width: 62px; }
}
.fit-inputs .set-n { min-width: 3.2em; }
.fit-ex.skipped .fit-ex-name { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.fit-skiptext { color: var(--imp); font-size: 14px; font-weight: 700; margin-top: 4px; }

/* ---- journal tool ---- */
.jr-compose textarea { width: 100%; min-height: 140px; }
.jr-compose .fit-dayrow { margin-bottom: 10px; }
.jr-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.jr-thumb { position: relative; }
.jr-thumb img, .jr-entry .jr-thumbs img { display: block; height: 84px; width: 84px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.dash button.jr-rm {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; line-height: 1; font-size: 13px; color: var(--danger); background: var(--paper);
}
.jr-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.jr-entry { border-top: 1px solid var(--line-2); padding: 18px 4px 14px; }
.jr-entry:first-child { border-top: none; }
.jr-day { font-size: 16px; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.jr-day .row-actions { margin-left: auto; opacity: 1; pointer-events: auto; }
.jr-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; }
.jr-list-head { margin: 26px 0 4px; font-size: 17px; }

/* ---- fitness: aligned set ledgers + sticky save bar ---- */
.fit-ex { padding: 16px 4px 12px; }
.fit-ex-head { gap: 10px; }
.fit-ex .row-actions { margin-left: auto; opacity: 0; pointer-events: none; }
.fit-ex:hover .row-actions, .fit-ex:focus-within .row-actions { opacity: 1; pointer-events: auto; }
@media (hover: none) { .fit-ex .row-actions { opacity: 1; pointer-events: auto; } }
.fit-sets { display: grid; grid-template-columns: max-content 96px 96px max-content; gap: 6px 10px; align-items: center; margin-top: 10px; }
.fit-sets .h { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.fit-sets .n { color: var(--ink-2); font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; padding-right: 2px; }
.fit-sets input { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.fit-sets .rm { justify-self: start; }
.fit-sets .addwrap { grid-column: 1 / -1; padding-top: 2px; }
.fit-savebar {
  position: sticky; bottom: 10px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--accent); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 10px 12px; margin-top: 18px;
}
.fit-savebar .ctx { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.fit-savebar input { flex: 1 1 160px; min-width: 0; }
.fit-targets { margin: 4px 0 18px; }
.fit-targets summary { cursor: pointer; color: var(--ink-2); font-size: 15px; padding: 4px 0; }
@media (max-width: 640px) {
  .fit-sets { grid-template-columns: max-content 1fr 1fr max-content; }
  .fit-savebar { bottom: calc(6px + env(safe-area-inset-bottom)); }
  .fit-savebar .ctx { flex: 1 1 100%; }
}
.fit-adj { display: flex; gap: 4px; margin-top: 4px; align-items: center; }
.fit-adj input { width: 64px; }
.dash .fit-adj button { padding: 6px 10px; font-weight: 700; min-width: 34px; }

/* ---- fitness polish: autosave era ---- */
.fit-row-form { align-items: flex-start; }
.fit-table { max-width: 620px; }
.fit-sets .rm { opacity: .35; }
.fit-sets .rm:hover, .fit-sets .rm:focus-visible { opacity: 1; }
@media (hover: none) { .fit-sets .rm { opacity: .6; } }
.fit-notesrow { margin-top: 16px; display: flex; align-items: center; }
.fit-notesrow input { width: 100%; max-width: 480px; }
.dash .fit-ex .grip {
  cursor: grab; touch-action: none; background: transparent; border: none;
  color: var(--ink-2); padding: 2px 8px 2px 0; font-size: 15px; line-height: 1;
}
.dash .fit-ex .grip:active { cursor: grabbing; }
.fit-ex.dragging { background: var(--paper-2); opacity: .92; position: relative; z-index: 3; }
.fit-budgets { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 18px; }
.fit-budget { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.fit-budget .lbl { flex: 0 0 60px; }
.fit-bar { flex: 0 1 240px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.fit-bar > span { display: block; height: 100%; width: 0; background: var(--accent); }
.fit-bar > span.over { background: var(--imp); }
.fit-bar > span.done { background: var(--done); }
.fit-budget .t { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) { .fit-bar > span { transition: width .2s ease; } }
.fit-ex[data-exrow] { transition: transform .16s ease; }
.fit-ex[data-exrow].dragging { transition: none; box-shadow: var(--shadow); }
.reordering, .reordering * { user-select: none; }
@media (prefers-reduced-motion: reduce) { .fit-ex[data-exrow] { transition: none; } }
.ch-band { fill: var(--accent-soft); opacity: .5; }
.ch-tdee { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 5; }

/* ---- hub panels ---- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.hub-panel { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.hub-head { display: flex; align-items: baseline; gap: 10px; }
.hub-head h2 { margin: 0; font-size: 17px; }
.hub-head a { margin-left: auto; font-size: 14px; text-decoration: none; white-space: nowrap; }
.hub-head a:hover { text-decoration: underline; }
.hp-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hp-line { color: var(--ink-2); font-size: 14.5px; }
.hp-line strong { color: var(--ink); }
.hub-panel textarea { width: 100%; min-height: 96px; resize: vertical; }
.hub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash a.hub-btn { display: inline-block; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 14px; text-decoration: none; }
.dash a.hub-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.hp-todo { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.hp-todo li { padding: 5px 0; border-top: 1px solid var(--line-2); overflow-wrap: anywhere; }
.hp-todo li:first-child { border-top: none; }
.hp-spark svg { display: block; width: 100%; height: auto; }
.ch-zero { stroke: var(--ink-2); stroke-width: 1; }
.ch-bar.over { fill: var(--imp); }
.ch-bar.under { fill: var(--accent); }
.ch-bar.zero { fill: var(--ink-2); opacity: .5; }
.ch-bar.good { fill: var(--done); }

/* no native number-spinner arrows anywhere on the dash */
.dash input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.dash input[type="number"]::-webkit-inner-spin-button,
.dash input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* loose masonry hub: panels flow into columns and keep their natural height */
.hub-grid { display: block; columns: 330px; column-gap: 14px; }
.hub-panel { break-inside: avoid; margin: 0 0 14px; }
.ch-dot.over { fill: var(--imp); }
.fit-stats { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; font-size: 14px; }
.fit-stats .k { color: var(--ink-2); display: inline-block; min-width: 96px; }
.fit-stats .v { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 12px; }
.fit-stats .v.over { color: var(--imp); }
.fit-stats .v.good { color: var(--done); }
.fit-stats .u { color: var(--ink-2); font-size: 12.5px; margin-left: 4px; }

/* ---- identity: one color per tool, worn everywhere on its page ---- */
.dash.fit, .hub-panel.c-fit { --accent: #2b6c8f; --accent-ink: #1e4f6a; --accent-soft: #dbe8f1; }
.dash.jr, .hub-panel.c-jr { --accent: #7c5cbf; --accent-ink: #5f4496; --accent-soft: #ece4f9; }
.dash.pgp, .hub-panel.c-pgp { --accent: #2a7f74; --accent-ink: #1f6159; --accent-soft: #d9efec; }
.dash.td, .hub-panel.c-td { --accent: #a34a6f; --accent-ink: #7f3856; --accent-soft: #f6e1ea; }
.hub-panel.c-vault { --accent: #96781c; --accent-ink: #745d13; --accent-soft: #f3ead0; }
:root[data-theme="dark"] .dash.fit, :root[data-theme="dark"] .hub-panel.c-fit { --accent: #8cc3e4; --accent-ink: #b9dcf2; --accent-soft: #223747; }
:root[data-theme="dark"] .dash.jr, :root[data-theme="dark"] .hub-panel.c-jr { --accent: #b9a3e3; --accent-ink: #d3c8ef; --accent-soft: #33294a; }
:root[data-theme="dark"] .dash.pgp, :root[data-theme="dark"] .hub-panel.c-pgp { --accent: #8fd4c9; --accent-ink: #b5e5dd; --accent-soft: #1f3d38; }
:root[data-theme="dark"] .dash.td, :root[data-theme="dark"] .hub-panel.c-td { --accent: #e79ab8; --accent-ink: #f2bfd3; --accent-soft: #402331; }
:root[data-theme="dark"] .hub-panel.c-vault { --accent: #e0c25c; --accent-ink: #ecd68e; --accent-soft: #3d3418; }

/* ---- depth: the flat gray gets shadows, rounder panels, colored edges ---- */
:root { --r-lg: 9px; --panel-shadow: 0 1px 2px rgba(31, 42, 51, .05), 0 10px 28px rgba(31, 42, 51, .07); }
:root[data-theme="dark"] { --panel-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .3); }
.panel { border-radius: var(--r-lg); box-shadow: var(--panel-shadow); }
.dash .panel { border-top: 3px solid var(--accent); }
.dash .td-head h1 { color: var(--accent-ink); }
.hub-head h2 { color: var(--accent-ink); }

/* ---- sharp, vibrant, alive ---- */
:root {
  --r: 0; --r-lg: 0;
  --accent: #2469a3; --accent-ink: #17517f; --accent-soft: #d8e8f6;
}
.dash.fit, .hub-panel.c-fit { --accent: #2469a3; --accent-ink: #17517f; --accent-soft: #d8e8f6; }
.dash.jr, .hub-panel.c-jr { --accent: #7a4fd0; --accent-ink: #5c37a8; --accent-soft: #eae1fb; }
.dash.pgp, .hub-panel.c-pgp { --accent: #0f8a7a; --accent-ink: #0a6759; --accent-soft: #d2f0ea; }
.dash.td, .hub-panel.c-td { --accent: #c2447a; --accent-ink: #98305d; --accent-soft: #faddeb; }
.hub-panel.c-vault { --accent: #a07d0a; --accent-ink: #7c6007; --accent-soft: #f5ecc8; }
.dash button.chip, .dash button.jr-rm { border-radius: 0; }
.fit-bar { border-radius: 0; }

:root[data-theme="dark"] {
  --desk: #0e1013;
  --paper: #171a1f;
  --paper-2: #1f232a;
  --ink: #eef1f5;
  --ink-2: #a6b2bf;
  --line: #333a44;
  --line-2: #262c34;
  --accent: #6cbcf0; --accent-ink: #a5d8fa; --accent-soft: #16344a;
  --done: #6fe0a0; --done-soft: #143526;
  --imp: #ffa066; --imp-soft: #3d2413;
  --danger: #ff7a7a;
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] .dash.fit, :root[data-theme="dark"] .hub-panel.c-fit { --accent: #6cbcf0; --accent-ink: #a5d8fa; --accent-soft: #16344a; }
:root[data-theme="dark"] .dash.jr, :root[data-theme="dark"] .hub-panel.c-jr { --accent: #b195f5; --accent-ink: #cfbcfa; --accent-soft: #2c2347; }
:root[data-theme="dark"] .dash.pgp, :root[data-theme="dark"] .hub-panel.c-pgp { --accent: #4fd6c3; --accent-ink: #97e8db; --accent-soft: #123b34; }
:root[data-theme="dark"] .dash.td, :root[data-theme="dark"] .hub-panel.c-td { --accent: #f78bb8; --accent-ink: #fbb8d3; --accent-soft: #3c1c2b; }
:root[data-theme="dark"] .hub-panel.c-vault { --accent: #f5c95c; --accent-ink: #fadf9b; --accent-soft: #3a2f12; }

::selection { background: var(--accent-soft); }

@media (prefers-reduced-motion: no-preference) {
  @keyframes dash-rise { from { opacity: 0; transform: translateY(10px); } }
  @keyframes dash-pop { from { opacity: 0; transform: translateY(3px); } }
  .hub-panel { animation: dash-rise .35s ease backwards; }
  .hub-panel:nth-child(2) { animation-delay: .06s; }
  .hub-panel:nth-child(3) { animation-delay: .12s; }
  .hub-panel:nth-child(4) { animation-delay: .18s; }
  .hub-panel:nth-child(5) { animation-delay: .24s; }
  .dash button, .dash-login button, .dash a.hub-btn { transition: transform .06s ease, border-color .12s ease, background-color .12s ease, color .12s ease; }
  .dash button:active, .dash a.hub-btn:active { transform: translateY(1px); }
  .td-status:not(:empty) { animation: dash-pop .2s ease; }
  .panel { transition: border-color .16s ease; }
}
.hub-tint { width: 16px; height: 16px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; align-self: center; }
.hub-tint::-webkit-color-swatch-wrapper { padding: 0; }
.hub-tint::-webkit-color-swatch { border: none; }
.dash .seg button:active { transform: none; }

/* ---- site editor ---- */
.dash.site, .hub-panel.c-site { --accent: #b45f3f; --accent-ink: #8f4527; --accent-soft: #f6e3db; }
:root[data-theme="dark"] .dash.site, :root[data-theme="dark"] .hub-panel.c-site { --accent: #f0a58a; --accent-ink: #f6c4ae; --accent-soft: #452b1f; }
.site-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.site-files { display: flex; flex-direction: column; gap: 1px; padding: 10px; max-height: 75vh; overflow-y: auto; }
.dash button.sfile { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: none; background: transparent; padding: 7px 8px; font-size: 14.5px; }
.dash button.sfile:hover { background: var(--paper-2); }
.dash button.sfile.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.sfile .t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sfile .d { flex: 0 0 auto; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sfile.snew { color: var(--accent); font-weight: 700; }
.sdraft { margin-left: 8px; font-size: 11.5px; font-weight: 700; color: var(--imp); background: var(--imp-soft); padding: 0 6px; }
.site-edhead { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.site-edhead .row-actions { margin-left: auto; opacity: 1; pointer-events: auto; }
.site-text { width: 100%; min-height: 58vh; font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 14px; line-height: 1.55; resize: vertical; }
.site-preview { border: 1px dashed var(--line); padding: 14px 18px; margin-top: 10px; overflow-wrap: anywhere; }
.site-preview img { max-width: 100%; }
.site-compose { display: flex; flex-direction: column; gap: 10px; }
.site-compose textarea { min-height: 40vh; }
.tagchip { display: inline-block; padding: 2px 10px; font-size: 13.5px; background: var(--accent-soft); color: var(--accent-ink); }
.tagchip.tag-new { background: var(--imp-soft); color: var(--imp); border: 1px dashed var(--imp); font-weight: 700; }
@media (max-width: 800px) { .site-layout { display: block; } .site-files { max-height: 240px; margin-bottom: 12px; } }
.hub-settings { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.hub-set-title { font-weight: 700; font-size: 15px; }
.hub-set-row { display: flex; gap: 10px; align-items: center; }
.hub-set-row .lbl { flex: 0 0 110px; color: var(--ink-2); font-size: 14.5px; }
.dash .hub-head .pgrip { cursor: grab; touch-action: none; background: transparent; border: none; color: var(--ink-2); padding: 0 6px 0 0; font-size: 14px; opacity: 0; }
.hub-panel:hover .pgrip, .pgrip:focus-visible { opacity: 1; }
@media (hover: none) { .dash .hub-head .pgrip { opacity: .5; } }
.hub-panel.dragging { opacity: .85; outline: 2px solid var(--accent); }
#hp-site input[type="text"], #hp-site textarea { width: 100%; }
#hp-site textarea { min-height: 110px; }
.hub-settings[hidden] { display: none; }
.hp-sub { font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); }
.hub-panel.dragging { z-index: 20; position: relative; pointer-events: none; }
.hub-panel.drop-before { box-shadow: 0 -3px 0 0 var(--accent), var(--panel-shadow); }
.hub-panel.drop-after { box-shadow: 0 3px 0 0 var(--accent), var(--panel-shadow); }
.site-form { display: flex; flex-direction: column; gap: 8px; }
.site-frow { display: flex; gap: 12px; align-items: flex-start; }
.site-frow .k { flex: 0 0 90px; color: var(--ink-2); font-size: 14px; padding-top: 8px; }
.site-frow input[type="text"], .site-frow input[type="date"], .site-frow textarea { flex: 1 1 auto; min-width: 0; }
.site-frow input[type="checkbox"] { margin-top: 10px; }
.site-frow.extra .k { color: var(--imp); }
.site-extras-label { margin-top: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.site-fileline { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; }
.site-fileline input { flex: 1 1 auto; min-width: 0; }
.site-form .chips { flex-basis: 100%; margin-left: 102px; }
.dash .site-frow textarea.site-text { min-height: 42vh; }
/* grips live in the panel gutter, not the header flow; grid waits for its saved order */
.hub-panel { position: relative; }
.dash .hub-head .pgrip { position: absolute; top: 15px; left: 2px; padding: 0 3px; }
#hub-grid { opacity: 0; }
#hub-grid.ready { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { #hub-grid.ready { transition: opacity .15s ease; } }
.hub-movebar { display: flex; gap: 8px; margin: -4px 0 8px; }
.hub-movebar button { min-width: 44px; min-height: 34px; }
.hub-panel.moving { outline: 2px solid var(--accent); }
@media (pointer: coarse) {
  .dash .hub-head .pgrip { font-size: 19px; padding: 8px 10px; top: 8px; left: -4px; opacity: .6; }
}
.tagpick { display: flex; flex-direction: column; gap: 6px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chips:empty { display: none; }
.dash .tp-chips .tagchip { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); padding: 4px 10px; font-size: 14px; cursor: pointer; }
.dash .tp-chips .tagchip.tag-new { border: 1px dashed var(--imp); background: var(--imp-soft); color: var(--imp); }
.tp-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.dash .tp-sug button { padding: 6px 12px; font-size: 14px; min-height: 36px; }
.hub-panel.dragging { opacity: .35; outline: 2px dashed var(--accent); pointer-events: auto; }
.drag-ghost { position: fixed; z-index: 99; color: #fff; font-weight: 700; font-size: 14px; padding: 6px 14px; box-shadow: var(--shadow); pointer-events: none; }
/* grip lives with the header meta, right-aligned, titles stay flush */
.dash .hub-head .pgrip { position: static; margin-left: auto; padding: 2px 8px; font-size: 16px; line-height: 1; align-self: center; }
.dash .hub-head a { margin-left: 0; }
@media (pointer: coarse) { .dash .hub-head .pgrip { font-size: 18px; padding: 6px 10px; } }
.llm-row { display: flex; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line-2); align-items: flex-start; cursor: pointer; }
.llm-row:first-of-type { border-top: none; }
.llm-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.llm-add { color: var(--accent-ink); font-weight: 700; }
.llm-quote { color: var(--ink-2); font-size: 13.5px; font-style: italic; overflow-wrap: anywhere; }
.llm-main input[type="text"] { margin-top: 4px; }
.frevert { align-self: center; white-space: nowrap; }
.hist-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 4px; border-top: 1px solid var(--line-2); }
.hist-row:first-of-type { border-top: none; }
.hist-row .when { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; }
.hist-row .what { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
#site-histbox { border: 1px dashed var(--line); padding: 8px 12px; margin: 10px 0; max-height: 300px; overflow-y: auto; }
.fit-bar { height: 15px; position: relative; }
.fit-barpct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: var(--ink); text-shadow: 0 0 4px var(--paper), 0 0 2px var(--paper); font-variant-numeric: tabular-nums; pointer-events: none; }
.fit-bar { height: 6px; position: static; }
.fit-barpct { display: none; }
/* rounded budget bars with the percent clipped into the fill: white on the
   filled part, ink on the track, no shadows */
.fit-bar { height: 16px; border-radius: 9px; position: relative; overflow: hidden; container-type: inline-size; }
.fit-bar > .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); overflow: hidden; border-radius: 9px; }
.fit-bar > .fill.over { background: var(--imp); }
.fit-bar > .fill.done { background: var(--done); }
.fit-barpct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: none; background: transparent; color: var(--ink); }
.fit-bar > .fill > .fit-barpct { width: 100cqw; left: 0; top: 0; height: 100%; inset: auto; color: #fff; }
:root[data-theme="dark"] .fit-bar > .fill > .fit-barpct { color: #0e1013; }
@media (prefers-reduced-motion: no-preference) { .fit-bar > .fill { transition: width .2s ease; } }
/* final bars: slim rounded, one plain ink number overlaid, no two-tone tricks */
.fit-bar { height: 9px; border-radius: 5px; overflow: visible; container-type: normal; }
.fit-bar > .fill { border-radius: 5px; }
.fit-bar > .fill > .fit-barpct { display: none; }
.fit-barpct { position: absolute; inset: -5px 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink); text-shadow: none; }
.fit-bar { position: relative; }
.fit-bar > .fit-barpct { display: flex; width: 100%; height: auto; background: transparent; }
/* panel rearranging is a mode, not a permanent affordance */
.dash .hub-head .pgrip { display: none; }
.dash.hub.rearranging .hub-head .pgrip { display: inline-block; opacity: 1; pointer-events: auto; }
.dash.hub.rearranging .hub-panel { outline: 1px dashed var(--line); }
.dash .hub-head a { margin-left: auto; }
.dash.hub.rearranging .hub-head .pgrip { margin-left: auto; }
.dash.hub.rearranging .hub-head a { margin-left: 0; }
.fit-bar > .fit-barpct { z-index: 2; opacity: .75; }
.fit-budget { gap: 8px; }
.fit-budget .lbl { flex: 0 0 54px; }
.hub-tintwrap { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.dash.hub.rearranging .hub-head .pgrip { margin-left: 0; }

/* ---- oblique strategies ---- */
.dash.strat, .hub-panel.c-strat { --accent: #556270; --accent-ink: #3d4a56; --accent-soft: #e2e7ea; }
:root[data-theme="dark"] .hub-panel.c-strat { --accent: #9fb3c0; --accent-ink: #c3d2db; --accent-soft: #262e35; }
.strat-card {
  border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--panel-shadow);
  min-height: 96px; padding: 20px 22px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 16px; line-height: 1.45;
}
.dash button.strat-redraw { font-size: 17px; padding: 4px 12px; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes strat-out { to { transform: translateX(46px) rotate(5deg); opacity: 0; } }
  @keyframes strat-in { from { transform: translateY(-18px) rotate(-3deg); opacity: 0; } }
  .strat-card.out { animation: strat-out .17s ease-in forwards; }
  .strat-card.in { animation: strat-in .24s ease-out; }
}
.st-add { display: flex; gap: 8px; margin-bottom: 14px; }
.st-add input { flex: 1 1 auto; min-width: 0; }
.st-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.st-row input { flex: 1 1 auto; min-width: 0; }
.fit-barpct { text-shadow: 0 1px 2px var(--paper); }
.strat-card { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; will-change: transform; }
.strat-card:active { cursor: grabbing; }

/* ---- fitness calendar ---- */
.cal-nav { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.cal-nav > span:first-of-type { font-weight: 700; min-width: 140px; text-align: center; }
.cal-sum { min-height: 24px; font-size: 14px; color: var(--ink-2); margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); text-align: center; padding-bottom: 2px; }
.cal-day { border: 1px solid var(--line-2); min-height: 58px; padding: 4px 5px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.cal-day { min-height: 66px; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.blank { border: none; cursor: default; }
.cal-day.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-day.cal-sel { outline: 2px solid var(--accent); }
.cal-day .d { font-size: 11.5px; color: var(--ink-2); }
.cal-day .marks { display: flex; gap: 4px; align-items: center; min-height: 15px; }
.cw { font-size: 12.5px; color: var(--accent-ink); font-weight: 700; }
.cw.skip { color: var(--ink-2); }
.cm { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cm.miss { border: 2px solid var(--imp); }
.cm.due { border: 2px solid var(--accent); opacity: .55; }
.cf { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cf.in { background: var(--done); }
.cf.over { background: var(--imp); }
.cf.under { background: var(--accent); }
.cp { color: var(--done); font-size: 10px; }
.cwt { font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: auto; }
@media (max-width: 640px) { .cal-day { min-height: 46px; padding: 3px 4px; } }
.cal-day { position: relative; overflow: hidden; }
.cal-grid { position: relative; }
.cal-lines { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }
.cal-lines .cl-zone { fill: none; stroke: var(--imp); stroke-width: 1.5; opacity: .3; stroke-linejoin: round; }
.cal-lines .cl-tdee { fill: none; stroke: var(--done); stroke-width: 1.5; opacity: .26; stroke-dasharray: 3 2.5; stroke-linejoin: round; }
.cal-lines circle.cl-zone { fill: var(--imp); stroke: none; }
.cal-lines circle.cl-tdee { fill: var(--done); stroke: none; }
.cal-lines .cl-base { stroke: var(--line-2); stroke-width: 1; opacity: .3; }
.cal-day > * { position: relative; z-index: 1; }
.cw.pend { display: inline-block; width: 10px; height: 10px; padding: 0;
  border: 1.5px dashed currentColor; opacity: .6; }
.cw.pend.now { border-style: solid; opacity: 1; }

/* ---- A/B workout identity: A red, B blue ---- */
:root { --var-a: #c14b3a; --var-a-soft: #f6e0dc; --var-b: #2b6cb0; --var-b-soft: #dbe9f7; }
:root[data-theme="dark"] { --var-a: #f0907e; --var-a-soft: #45241d; --var-b: #82bdf2; --var-b-soft: #1c3550; }
.vtag { font-weight: 700; }
.vtag.v-a, .cw.v-a { color: var(--var-a); }
.vtag.v-b, .cw.v-b { color: var(--var-b); }
.fit-badge.v-a { color: var(--var-a); background: var(--var-a-soft); }
.fit-badge.v-b { color: var(--var-b); background: var(--var-b-soft); }
.dash .seg button.v-a { color: var(--var-a); }
.dash .seg button.v-b { color: var(--var-b); }
.dash .seg button.v-a.on { background: var(--var-a-soft); border-color: var(--var-a); color: var(--var-a); }
.dash .seg button.v-b.on { background: var(--var-b-soft); border-color: var(--var-b); color: var(--var-b); }
.cal-sum { display: block; }
.cal-card { border: 1px solid var(--line-2); background: var(--paper-2); padding: 10px 14px; }
.cs-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14.5px; }
.cs-head .cs-actions { margin-left: auto; display: flex; gap: 6px; }
.cs-row { font-size: 13.5px; margin-top: 4px; overflow-wrap: anywhere; }
.cs-mut { color: var(--ink-2); }
.cs-prog { color: var(--done); font-weight: 700; }
.cs-miss { color: var(--imp); }
.cs-over { color: var(--imp); }
.cs-under { color: var(--accent); }
.cs-ok { color: var(--done); }
.seg button { position: relative; }
.seg button:hover, .seg button:active { z-index: 1; }
.seg button.on { z-index: 2; }
.fit-budget .lbl { display: inline-flex; align-items: center; gap: 6px; }
.fit-budget .cf { flex: 0 0 auto; }
.wg { width: 12px; height: 12px; display: inline-block; flex: 0 0 auto; color: var(--ink-2); overflow: visible; }
.wg rect { fill: none; stroke: currentColor; stroke-width: 1.3; }
.wg circle { fill: currentColor; }
.wg.miss { color: var(--imp); }
.wg-due { color: var(--accent); }
.fld .wgwrap { margin-left: 7px; }
.wgwrap { display: inline-flex; vertical-align: -2px; }
:root { --prog: #8a4fd3; --weigh: #1f998b; }
:root[data-theme="dark"] { --prog: #c7a1f2; --weigh: #5fd3c4; }
.cp { color: var(--prog); }
.cs-prog { color: var(--prog); }
.wg.done { color: var(--weigh); }
.wg.done rect { fill: currentColor; fill-opacity: .16; }
.ctrain { position: absolute; top: 3px; right: 5px; display: flex; gap: 3px; align-items: center; }
.cpr { width: 7px; height: 7px; display: inline-block; }
.cpr.in { background: var(--done); }
.cpr.over { background: var(--imp); }
.cpr.under { background: var(--accent); }
.cs-ex { display: grid; grid-template-columns: max-content max-content 1fr; gap: 2px 14px; }
.cs-ex .s { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cs-ex .p { color: var(--prog); font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .cwt .u { display: none; } .cs-ex { gap: 2px 9px; font-size: 12.5px; } .ctrain { top: 2px; right: 3px; } }
.cal-day.other { border-color: color-mix(in srgb, var(--line-2) 40%, var(--paper)); }
.cal-day.other > * { opacity: .5; }

/* mobile calendar fixes: keep short cells, stop the month field truncating */
@media (max-width: 640px) {
  .cal-day { min-height: 48px; }
  .cal-nav { gap: 6px; }
  .cal-nav #cal-month { flex: 1 1 auto; min-width: 0; padding-left: 6px; padding-right: 6px; font-size: 14px; }
  .cs-head .cs-actions { margin-left: 0; width: 100%; }
}

/* month nav reads as a heading you can click, not a form field */
.cal-nav { gap: 2px; }
.dash .cal-nav #cal-month {
  border: none; background: none; box-shadow: none; cursor: pointer;
  font-size: 15.5px; font-weight: 700; color: var(--ink);
  padding: 3px 4px; width: auto; min-width: 0; flex: 0 0 auto;
}
.dash .cal-nav #cal-month:hover { color: var(--accent-ink); }
.dash .cal-nav #cal-month:focus { outline: none; color: var(--accent-ink); }
.dash .cal-nav #cal-month::-webkit-calendar-picker-indicator { opacity: 0; width: 0; padding: 0; margin: 0; }

/* categories flow into columns on wide screens instead of one long ribbon */
@media (min-width: 900px) {
  .cat-grid { columns: 360px auto; column-gap: 26px; }
  .cat-grid > .cat, .cat-grid > .cat.ghost { break-inside: avoid; }
  .cat-grid > .cat:first-of-type { border-top: 1px solid var(--line-2); }
  .cat-grid .cat-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  .cat-grid .cat-count .bar { display: none; }
}

/* todo drag reorder */
.dash .grip { background: none; border: none; cursor: grab; touch-action: none; color: var(--ink-2);
  opacity: 0; padding: 0 2px; font-size: 13px; line-height: 1; flex: 0 0 auto; user-select: none; }
.dash .grip:active { cursor: grabbing; }
.cat > summary:hover .grip, .dash .grip:focus-visible { opacity: .65; }
.item.editing .grip { opacity: .7; font-size: 15px; padding: 0 6px; }
@media (hover: none) { .dash .cat > summary .grip { opacity: .4; } }
.item.dragging, .cat.dragging { opacity: .35; }
body.td-dragging { user-select: none; cursor: grabbing; }
.item.drop-before, .cat.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.item.drop-after, .cat.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.cat.drop-into { outline: 2px dashed var(--accent); outline-offset: -2px; }
.dash .drag-ghost { background: var(--accent); color: var(--paper); border-radius: var(--r); }

.cal-lines circle.cl-zone { opacity: .35; }
.cal-lines circle.cl-tdee { opacity: .3; }
.dash .tab .grip { opacity: 0; margin-right: 6px; font-size: 12px; vertical-align: 1px; }
.dash .tab:hover .grip { opacity: .5; }
.tab.dragging { opacity: .35; }
.tab.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.tab.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
@media (hover: none) { .dash .tab .grip { opacity: .35; } }

/* both budget rows share one bar geometry, so they start and end together
   no matter how long the status text beside them runs */
.fit-budget .lbl { flex: 0 0 72px; }
.dash .fit-bar, .hub-panel .fit-bar { flex: 0 0 clamp(110px, 42%, 260px); }
.fit-budget .t { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .fit-budget .lbl { flex: 0 0 64px; } }
@media (max-width: 640px) {
  .dash .fit-bar, .hub-panel .fit-bar { flex: 0 0 clamp(64px, 28%, 120px); }
  .fit-budget { gap: 7px; }
  .fit-budget .lbl { flex: 0 0 58px; }
}
/* min-width:auto lets a flex item outgrow its basis — "calories" is wider than
   "protein", which knocked the two bars out of line */
.fit-budget .lbl { min-width: 0; }
@media (max-width: 640px) { .fit-budget .lbl { flex: 0 0 68px; } }

/* phone: the status text moves up beside the label and the bar takes its own
   full-width line, so the bars are wide, aligned, and nothing truncates */
@media (max-width: 640px) {
  .fit-budget { flex-wrap: wrap; row-gap: 3px; }
  .fit-budget .lbl { flex: 0 0 auto; order: 1; }
  .fit-budget .t { order: 2; flex: 1 1 auto; text-align: right; overflow: visible; }
  .dash .fit-bar, .hub-panel .fit-bar { order: 3; flex: 0 0 100%; }
  .fit-budgets { gap: 12px; }
}

/* stack by CONTAINER width, not viewport: a hub panel is narrow even when the
   phone is in desktop mode, and truncating the status text was never ok */
.fit-budgets, #hp-fitness { container-type: inline-size; }
.fit-budget .t { overflow: visible; text-overflow: clip; }
@container (max-width: 430px) {
  .fit-budget { flex-wrap: wrap; row-gap: 3px; }
  .fit-budget .lbl { flex: 0 0 auto; order: 1; }
  .fit-budget .t { order: 2; flex: 1 1 auto; text-align: right; white-space: normal; }
  .dash .fit-bar, .hub-panel .fit-bar { order: 3; flex: 0 0 100%; }
}
@media (max-width: 640px) { .fit-budget .t { white-space: normal; } }

/* +/- feedback: the field that just changed tints for a beat and the delta
   floats off it, so a new number never looks like one you typed */
.dash .fld { position: relative; }
.adj-chip { position: absolute; right: 2px; top: -2px; font-size: 12.5px; font-weight: 700;
  pointer-events: none; font-variant-numeric: tabular-nums; }
.adj-chip.up { color: var(--done); }
.adj-chip.down { color: var(--accent); }
.dash input.adj-flash.up { border-color: var(--done); }
.dash input.adj-flash.down { border-color: var(--accent); }
.hp-line.adj-flash { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes adj-rise {
    0% { opacity: 0; transform: translateY(7px); }
    18% { opacity: 1; transform: translateY(0); }
    68% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-11px); }
  }
  @keyframes adj-tint-up {
    0% { background: color-mix(in srgb, var(--done) 22%, var(--paper)); }
    100% { background: var(--paper); }
  }
  @keyframes adj-tint-down {
    0% { background: color-mix(in srgb, var(--accent) 22%, var(--paper)); }
    100% { background: var(--paper); }
  }
  .adj-chip { animation: adj-rise 1.2s ease forwards; }
  .dash input.adj-flash.up { animation: adj-tint-up 1s ease; }
  .dash input.adj-flash.down { animation: adj-tint-down 1s ease; }
  .hp-line.adj-flash.up { animation: adj-tint-up 1s ease; }
  .hp-line.adj-flash.down { animation: adj-tint-down 1s ease; }
}

/* weigh-in check card */
#fit-wcheck { margin-top: 12px; }
.wc-chart { margin-top: 10px; }
.wc-grid { display: grid; grid-template-columns: max-content max-content minmax(0, max-content) 1fr;
  gap: 5px 14px; align-items: baseline; margin-top: 8px; font-size: 13.5px; }
.wc-grid .k { grid-column: 1; color: var(--ink-2); }
.wc-grid .v { grid-column: 2; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wc-grid .n { grid-column: 3; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wc-grid .a { grid-column: 4; justify-self: start; margin-left: -8px; }
.wc-grid .a .mini { white-space: nowrap; }
.wc-card .nw { white-space: nowrap; }
.wc-verdict { grid-column: 1 / -1; margin: 4px 0; padding: 6px 10px; font-weight: 600; line-height: 1.35;
  border-left: 3px solid currentColor; background: color-mix(in srgb, currentColor 9%, transparent); }
.wc-verdict.cs-mut { font-weight: 500; }
.wc-verdict .cs-mut { font-weight: 500; }
@media (max-width: 640px) {
  .wc-grid { grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; }
  .wc-grid .n, .wc-grid .a { grid-column: 2; }
  .wc-grid .a { margin-bottom: 4px; }
  .wc-grid .k { padding-top: 1px; }
  .wc-verdict { margin: 6px 0; }
}
.ch-trend { stroke: var(--weigh); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }

/* zone-start tick on the budget bars (bar = 0 → zone top) */
.fit-bar > .zm { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); opacity: .55; z-index: 1; pointer-events: none; }
.fit-bar > .zm[hidden] { display: none; }

/* food log: one adder for calories + protein, entries listed under it */
.food-box { margin: 0 0 16px; max-width: 620px; }
.food-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.food-add .fa-label { flex: 1 1 140px; min-width: 0; }
.food-add .fa-nums { display: flex; gap: 6px; align-items: center; flex: 1 0 auto; }
.dash .food-add input[type="number"] { width: 72px; min-width: 0; flex: 1 1 72px; }
.dash .food-add .fa-prot { width: 60px; flex: 1 1 60px; }
.dash .food-add .fa-nums button { flex: 0 0 auto; }
.dash .food-add button { padding: 6px 10px; font-weight: 700; min-width: 34px; }
.food-log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14.5px; }
.food-log li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-top: 1px solid var(--line-2); cursor: pointer; }
.food-log li:first-child { border-top: none; }
.food-log li:hover { background: var(--accent-soft); }
.food-log .at { flex: 0 0 40px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.food-log .lb { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-log .n { flex: 0 0 58px; text-align: right; font-variant-numeric: tabular-nums; }
.food-log .n.neg { color: var(--accent); }
.food-log li.editing { cursor: default; background: transparent; flex-wrap: wrap; gap: 6px; }
.food-log li.editing .fe-label { flex: 1 1 120px; min-width: 0; }
.dash .food-log li.editing input { font-size: 15px; padding: 5px 8px; }
.dash .food-log li.editing input[type="number"] { width: 66px; }
.dash .food-log li.editing .mini { font-size: 16px; padding: 2px 8px; }
.dash input[readonly] { color: var(--ink-2); background: var(--paper-2, var(--paper)); }
#hp-fitness .food-add { margin-top: 10px; }
#hp-fitness .food-log { font-size: 14px; }

/* ---- code: the remote opencode picker (dash-code.js) ---- */
.dash.code, .hub-panel.c-code { --accent: #4a7d2c; --accent-ink: #36601f; --accent-soft: #e2efd9; }
:root[data-theme="dark"] .dash.code, :root[data-theme="dark"] .hub-panel.c-code { --accent: #9ad46f; --accent-ink: #bfe6a0; --accent-soft: #223a17; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.cd-panel { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; min-width: 0; }
.cd-panel h2 { margin: 0; font-size: 17px; color: var(--accent-ink); }
.cd-list { display: flex; flex-direction: column; min-width: 0; }
.cd-row { flex-wrap: wrap; gap: 2px 12px; }
.cd-row.busy { opacity: .5; }
.cd-row .cd-title { flex: 1 1 100%; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-row .cd-where { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.cd-path { display: flex; gap: 8px; align-items: center; margin: 0; }
.cd-path input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14.5px; }
.cd-tools { display: flex; gap: 8px; align-items: center; }
.cd-tools input { flex: 1 1 auto; min-width: 0; }
.cd-dirs { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; transition: opacity .15s; }
.cd-dirs.loading { opacity: .4; }
.cd-dirs:empty { min-height: 40px; }
.dash button.cd-dir { text-align: left; border: none; border-top: 1px solid var(--line-2); border-radius: 0; background: transparent; padding: 11px 6px; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.dash button.cd-dir:first-child { border-top: none; }
.dash button.cd-dir::before { content: '▸ '; color: var(--accent); }
.dash button.cd-dir:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.dash button.cd-open { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; padding: 11px 14px; }
.cd-actions { display: flex; gap: 8px; }
.cd-actions .cd-open { flex: 1 1 auto; }
.dash button.cd-codex { padding: 11px 14px; font-weight: 700; }
@media (max-width: 640px) { .cd-actions { position: sticky; bottom: 0; padding: 8px 0 12px; background: var(--paper); } }
.cd-recent:empty { display: none; }
.cd-recent .chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash button.cd-dir.link::before { content: '↪ '; }
.cd-target { display: block; color: var(--ink-2); font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; margin-top: 1px; }
.cd-marks:empty { display: none; }
.cd-marks .chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash button.cd-star { font-size: 20px; line-height: 1; padding: 4px 8px; }
.dash button.cd-star.on { color: var(--accent); }
.cd-row .cd-kill { opacity: 1; margin-left: 8px; font-size: 18px; padding: 0 6px; }
