/* Pull-up tracker · style built on the taste-skill "achromatic ledger" app sheet (seed 233555575).
   Chrome in ink and stone; the one hue (#1d5fbf) on this week's data only. No shadows at rest, no gradients,
   one border tone, tight radii (8 / 6), one gutter. RTL throughout: logical properties only. */

:root {
  --ground: #f4f3f1;            /* chalk / magnesium dust: the product's world, one level off white, low chroma */
  --surface: #ffffff;
  --raised: #efeeec;
  --active: #e8e7e4;
  --border: #e6e6e6;
  --rule: #f0f0f0;
  --control: #d4d4d4;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --faint: #6b6b6b;
  --accent: #141414;
  --primary: #141414;
  --primary-ink: #ffffff;
  --hue: #1d5fbf;               /* the one chart hue: this week */
  --positive: #2e7d32;
  --negative: #c4242a;
  --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #eeeeee; --pill-neutral-ink: #3d3d3d;
  --chart-1: var(--hue);
  --chart-2: #8a8a8a;
  --chart-muted: #c4c4c4;
  --chart-mark: var(--text);
  --grid: #e5e5e5;
  --axis-ink: var(--muted);
  --ink: var(--text);
  --chart-span: 0.06;

  --radius-card: 8px;
  --radius-control: 6px;
  --gap: 12px;
  --pad: 24px;
  --card-pad: 20px;
  --control-height: 36px;
  --row-height: 44px;
  --nav-row: 32px;
  --sidebar-width: 240px;
  --column: 880px;

  --font: "Heebo", "Segoe UI", Roboto, -apple-system, system-ui, sans-serif;
  --fs-title: 24px; --fs-section: 16px; --fs-kpi: 30px; --fs-body: 14px; --fs-small: 12px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms; --t-hover: 150ms; --t-ui: 200ms;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #000000; --surface: #111111; --raised: #1c1c1c; --active: #222222;
    --border: #262626; --rule: #1c1c1c; --control: #444444;
    --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
    --accent: #ffffff; --primary: #ffffff; --primary-ink: #000000;
    --hue: #5b8fe0;
    --positive: #3fc07a; --negative: #e5566f; --warning: #e5a93b;
    --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;
    --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
    --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b;
    --pill-neutral-bg: #222222; --pill-neutral-ink: #ffffff;
    --chart-muted: #4a4a4a; --grid: #2b2b2b; --chart-span: 0.12;
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, table, .kpi-value, .cell, .mini { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); line-height: 16px; }
.pre { white-space: pre-wrap; word-break: break-word; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 28px 24px; }
.login-panel .brand { margin-bottom: 20px; }
.login-panel .login-title { font-size: var(--fs-title); line-height: 1.2; font-weight: 600; }
.login-panel .sub { color: var(--muted); margin-top: 4px; margin-bottom: 20px; }
.login-panel .input { width: 100%; height: 44px; font-size: 18px; text-align: center; letter-spacing: .25em; margin-bottom: 12px; }
.err { color: var(--negative); min-height: 16px; margin-top: 8px; font-size: var(--fs-small); line-height: 16px; }

/* ---------- shell: sidebar + canvas ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; margin-bottom: 24px; }
.brand svg { width: 28px; height: 28px; flex: none; color: var(--text); }
.brand-name { font-weight: 700; font-size: 16px; line-height: 20px; }
.brand-scope { color: var(--muted); font-size: var(--fs-small); line-height: 16px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: var(--nav-row); padding: 0 8px; border-radius: 8px; color: var(--muted); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--text); }
.sidebar .bottom { margin-top: auto; padding: 0 8px; color: var(--faint); font-size: var(--fs-small); line-height: 16px; }
.sidebar .bottom div + div { margin-top: 4px; }
.canvas { min-width: 0; padding: 32px var(--pad) 48px; }
.column { max-width: var(--column); margin: 0 auto; }

/* title row */
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.title-row h1 { font-size: var(--fs-title); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.title-row .sub { margin-top: 4px; color: var(--muted); }
.title-actions { display: flex; gap: 8px; flex: none; }

/* ---------- panels, grid, rows ---------- */
.stack > * + * { margin-top: var(--gap); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel > header:last-child { margin-bottom: 0; }
.panel h2 { font-size: var(--fs-section); line-height: 1.3; font-weight: 600; }
.panel .meta { color: var(--faint); font-size: var(--fs-small); line-height: 16px; }
.panel.quiet { background: var(--raised); border-color: transparent; }
.panel.tight { padding-top: 4px; padding-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.rows { display: grid; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--row-height); padding: 10px 0; }
.row + .row { border-top: 1px solid var(--rule); }
.row .lead { min-width: 0; }
.row .lead .sub { display: block; color: var(--muted); font-size: var(--fs-small); line-height: 16px; margin-top: 2px; }
.row .end { flex: none; display: flex; align-items: center; gap: 8px; }
.group-label { color: var(--faint); font-size: var(--fs-small); line-height: 16px; margin: 16px 0 4px; }
.group-label:first-child { margin-top: 0; }
.list { padding-inline-start: 18px; margin: 0; }
.list li { margin-bottom: 6px; }
.list li:last-child { margin-bottom: 0; }

/* KPIs: one container split by hairlines, a label over a number */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.kpi { padding: 16px var(--card-pad); min-width: 0; }
.kpi + .kpi { border-inline-start: 1px solid var(--border); }
.kpi-label { color: var(--muted); }
.kpi-value { margin-top: 6px; font-size: var(--fs-kpi); line-height: 1.15; font-weight: 400; letter-spacing: -0.01em; }
.kpi-value.lead { font-weight: 500; }
.kpi-value.hue { color: var(--hue); }
.kpi-value.zero { color: var(--muted); }
.kpi-value .dash { font-size: 16px; line-height: 1; vertical-align: middle; }
.kpi-value small { font-size: 0.5em; color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.kpi-note { margin-top: 4px; font-size: var(--fs-small); line-height: 16px; color: var(--muted); }
.kpi .counter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.kpi .counter .kpi-value { margin: 0; min-width: 2ch; text-align: center; }

/* pills: a pale tint with dark ink of its hue; one per row */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); font-weight: 500; white-space: nowrap; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { background: var(--primary); opacity: .92; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--negative); }
.btn.wide { width: 100%; height: 44px; }
.btn.icon { width: var(--control-height); padding: 0; }
.btn svg { width: 16px; height: 16px; }
.field { display: grid; gap: 8px; }
.field + .field { margin-top: 16px; }
.field label { font-weight: 500; }
.input { height: 38px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); width: 100%; }
.input::placeholder { color: var(--faint); }
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.segmented { display: inline-flex; width: max-content; max-width: 100%; padding: 2px; border-radius: 8px; background: var(--raised); }
.segmented button { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; }
.actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 16px; }
.link { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); }
.link:hover { text-decoration-color: currentColor; }
.link svg { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; margin-inline-end: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-small); line-height: 16px; margin-top: 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--text); }

/* ---------- the set ledger: the product's own element ---------- */
.ex { padding: 14px 0; }
.ex + .ex { border-top: 1px solid var(--rule); }
.ex:first-child { padding-top: 0; }
.ex:last-child { padding-bottom: 0; }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ex-name { font-weight: 600; }
.ex-target { color: var(--muted); font-size: 13px; line-height: 18px; white-space: nowrap; }
.ex-cue { color: var(--muted); font-size: 13px; line-height: 18px; margin-top: 2px; }
.ex-links { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; line-height: 18px; }
.cells { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.cell { width: 44px; height: 44px; padding: 0; text-align: center; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-size: 16px; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.cell.hit { background: var(--text); color: var(--surface); border-color: var(--text); }
.cell.add { border-style: dashed; color: var(--muted); background: transparent; }
.cell.rm { color: var(--muted); background: transparent; }
.cells .wt { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 6px; color: var(--muted); font-size: var(--fs-small); }
.cells .wt input { width: 64px; height: 44px; text-align: center; }
.ex.skipped .cells { opacity: .35; pointer-events: none; }
.mini { display: inline-flex; gap: 3px; align-items: center; }
.mini i { display: block; width: 10px; height: 10px; border: 1px solid var(--control); border-radius: 2px; }
.mini i.hit { background: var(--text); border-color: var(--text); }
.mini-row { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: var(--fs-small); line-height: 16px; color: var(--muted); }
.mini-row span { display: inline-flex; align-items: center; gap: 6px; }

/* details (warm-up, sessions) */
details { border-top: 1px solid var(--rule); }
details:first-of-type { border-top: 0; }
details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--chevron) center / 12px no-repeat; mask: var(--chevron) center / 12px no-repeat; color: var(--muted); transition: transform var(--t-ui) var(--ease-out); }
details[open] summary::after { transform: rotate(180deg); }
details .body { padding-bottom: 12px; }
:root { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* plan */
.phase { padding: 12px 0; }
.phase + .phase { border-top: 1px solid var(--rule); }
.phase .name { font-weight: 600; }
.phase.current .name::after { content: "עכשיו"; display: inline-block; margin-inline-start: 8px; font-weight: 500; font-size: var(--fs-small); color: var(--hue); }
.phase .sub { color: var(--muted); font-size: var(--fs-small); line-height: 16px; margin-top: 2px; }
.phase ul { margin-top: 6px; }
table.sched { width: 100%; border-collapse: collapse; }
table.sched td { padding: 10px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
table.sched tr:last-child td { border-bottom: 0; }
table.sched td:first-child { width: 30%; font-weight: 500; }

/* progress */
.chart { position: relative; min-width: 0; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.chart-head .key { display: flex; gap: 14px; color: var(--muted); font-size: var(--fs-small); line-height: 16px; }
.chart-head .key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-head .key i { display: block; width: 10px; height: 10px; border-radius: 2px; background: var(--chart-muted); }
.chart-head .key i.hue { background: var(--hue); }
.chart-head .key i.target { width: 14px; height: 0; border-top: 1px dashed var(--text); border-radius: 0; }
.mark { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--control); border-radius: 50%; flex: none; }
.mark.done { background: var(--text); border-color: var(--text); }
.ms { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.ms.done { font-weight: 500; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.inline-form .input { width: 100%; }
.inline-form .wide { grid-column: 1 / -1; }

/* notes */
.thread { display: grid; gap: 8px; margin-bottom: var(--gap); }
.msg { padding: 12px 14px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); max-width: 92%; }
.msg.coach { background: var(--raised); border-color: transparent; margin-inline-start: auto; }
.msg .meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: var(--fs-small); line-height: 16px; margin-bottom: 4px; }
.msg .meta b { color: var(--text); font-weight: 500; }
.msg .meta button { border: 0; background: none; padding: 0; color: var(--muted); font-size: var(--fs-small); text-decoration: underline; text-underline-offset: 3px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; }

/* empty state keeps the frame */
.empty { display: grid; place-items: center; min-height: 72px; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-control); color: var(--muted); text-align: center; }

/* toast: the one thing that floats */
.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 999px; z-index: 20; box-shadow: 0 6px 16px rgba(0,0,0,.18); }

/* ---------- phone: the sidebar folds into a bottom bar of five destinations ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .canvas { padding: 20px 16px calc(72px + env(safe-area-inset-bottom)); }
  .title-row h1 { font-size: 22px; }
  .grid > * { grid-column: 1 / -1; }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; }
  .kpi + .kpi { border-inline-start: 0; }
  .kpi:nth-child(2n) { border-inline-start: 1px solid var(--border); }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .panel { padding: 16px; }
  .tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; color: var(--muted); font-size: 11px; line-height: 14px; }
  .tabbar a svg { width: 18px; height: 18px; }
  .tabbar a[aria-current="page"] { color: var(--text); font-weight: 500; }
  .msg { max-width: 100%; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; padding: 0 4px; font-size: 13px; white-space: nowrap; }
  .inline-form { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }
