/* Deal Desk — a calm surface for an unglamorous job.
 *
 * THREE RULES CARRY THE WHOLE DESIGN
 *
 * 1. COLOUR MEANS "NEEDS YOU". Late is red, due-soon is amber, and everything
 *    else — including done — is neutral. Done needs nothing, so it does not
 *    get to shout. That frees the accent to mean one thing only: an action you
 *    can take.
 *
 * 2. SEVERITY IS ENCODED TWICE. A stripe at the leading edge and a signed day
 *    figure. A pill says something is bad; "−18" says how bad.
 *
 * 3. THE SERIF DOES THE HEAVY LIFTING. Page titles and the big figures are
 *    Instrument Serif over an Instrument Sans interface. A single sans at four
 *    sizes reads like a bug tracker whatever else you do to it.
 */

:root {
  color-scheme: light;

  --ground:      #F7F7F8;
  --surface:     #FFFFFF;
  --surface-2:   #F1F1F3;
  --surface-3:   #E8E8EB;

  --ink:         #14151A;
  --ink-2:       #5A5D68;
  --ink-3":      #8B8E99;
  --ink-3:       #8B8E99;
  --rule:        #E6E6EA;
  --rule-2:      #D3D3DA;

  /* One accent. Deep teal — an action, never a status. */
  --accent:      #0D6E6E;
  --accent-2:    #0A5A5A;
  --accent-ink:  #FFFFFF;
  --accent-soft: #E1F0EF;

  /* Attention only. There is deliberately no "success" colour. */
  --late:        #C2382C;
  --late-soft:   #FBEAE8;
  --soon:        #A66A0B;
  --soon-soft:   #FBF0DC;

  --lift-1: 0 1px 2px rgba(20,21,26,.04), 0 1px 3px rgba(20,21,26,.06);
  --lift-2: 0 2px 4px rgba(20,21,26,.04), 0 8px 24px rgba(20,21,26,.07);
  --ring:   0 0 0 3px rgba(13,110,110,.16);

  --radius:    10px;
  --radius-sm: 7px;

  --f-ui:      "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail: 15.5rem;
  --tap:  160ms cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground:      #0B0C0F;
    --surface:     #14161B;
    --surface-2:   #1B1E24;
    --surface-3:   #242830;
    --ink:         #ECEDF1;
    --ink-2:       #9FA4B0;
    --ink-3:       #6E7481;
    --rule:        #22252C;
    --rule-2:      #333843;
    --accent:      #3FBFAE;
    --accent-2:    #57D0BF;
    --accent-ink:  #06201E;
    --accent-soft: #0F2A28;
    --late:        #F0776A;
    --late-soft:   #2A1614;
    --soon:        #E0A93F;
    --soon-soft:   #2A2011;
    --lift-1: 0 1px 2px rgba(0,0,0,.5);
    --lift-2: 0 2px 6px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.35);
    --ring:   0 0 0 3px rgba(63,191,174,.22);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0B0C0F; --surface: #14161B; --surface-2: #1B1E24; --surface-3: #242830;
  --ink: #ECEDF1; --ink-2: #9FA4B0; --ink-3: #6E7481;
  --rule: #22252C; --rule-2: #333843;
  --accent: #3FBFAE; --accent-2: #57D0BF; --accent-ink: #06201E; --accent-soft: #0F2A28;
  --late: #F0776A; --late-soft: #2A1614; --soon: #E0A93F; --soon-soft: #2A2011;
  --lift-1: 0 1px 2px rgba(0,0,0,.5);
  --lift-2: 0 2px 6px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.35);
  --ring: 0 0 0 3px rgba(63,191,174,.22);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
svg { flex: none; }

.boot { display: grid; place-items: center; height: 100vh; }
.boot-mark { opacity: .7; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  border-right: 1px solid var(--rule);
  background: var(--surface);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.rail-brand {
  padding: 1.5rem 1.35rem 1.15rem;
  display: flex; align-items: center; gap: .6rem;
}
/* The mark is an SVG that carries its own box and its own fixed colours, so
 * there is nothing to style here — a wrapper with a background would draw a
 * second box behind the first. */
.rail-brand b {
  font-family: var(--f-display); font-weight: 400; font-size: 1.32rem;
  letter-spacing: -.01em;
}
.rail nav { display: flex; flex-direction: column; padding: .35rem .7rem; gap: 2px; }
.rail a {
  display: flex; align-items: center; gap: .7rem;
  padding: .58rem .7rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .93rem;
  transition: background var(--tap), color var(--tap);
}
.rail a svg { width: 1.05rem; height: 1.05rem; opacity: .75; }
.rail a:hover { background: var(--surface-2); color: var(--ink); }
.rail a:hover svg { opacity: 1; }
.rail a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.rail a[aria-current="page"] svg { opacity: 1; }
.rail a > span:first-of-type { flex: 1; }
.rail a .count {
  font-family: var(--f-mono); font-size: .7rem; font-variant-numeric: tabular-nums;
  padding: .08rem .38rem; border-radius: 20px;
  background: var(--late); color: #fff; letter-spacing: 0;
}
.rail a[aria-current="page"] .count { background: rgba(255,255,255,.24); color: inherit; }
.rail-foot {
  margin-top: auto; padding: 1rem 1.35rem 1.15rem; border-top: 1px solid var(--rule);
}
.rail-foot b { display: block; font-weight: 600; font-size: .9rem; }
.rail-foot > span {
  display: block; font-family: var(--f-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: .1rem;
}
.rail-foot button {
  margin-top: .7rem; background: none; border: 0; padding: 0;
  color: var(--ink-3); cursor: pointer; font-size: .82rem;
  transition: color var(--tap);
}
.rail-foot button:hover { color: var(--late); }

main { min-width: 0; padding: 2.75rem 3rem 6rem; }
.page-head, .stack, .card, .grid, .scroller, .banner, h2.section, .stats,
main > form, main > p, main > div { max-width: 70rem; }

.page-head { margin-bottom: 2rem; }
.page-head h1 {
  margin: 0 0 .3rem;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.06; letter-spacing: -.02em;
}
.page-head p { margin: 0; color: var(--ink-2); max-width: 60ch; font-size: .98rem; }
.page-head .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }

/* ---------- the stat band ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 2rem; box-shadow: var(--lift-1);
}
.stat { background: var(--surface); padding: 1.05rem 1.15rem 1.15rem; }
.stat dt {
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: .45rem;
}
.stat dd {
  margin: 0; font-family: var(--f-display); font-weight: 400;
  font-size: 1.85rem; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat dd small {
  display: block; font-family: var(--f-ui); font-size: .78rem;
  color: var(--ink-3); margin-top: .4rem; letter-spacing: 0;
}
.stat.is-late dd { color: var(--late); }
.stat.is-soon dd { color: var(--soon); }

/* ---------- rows: severity encoded twice ---------- */
.stack {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--lift-1);
}
.item {
  display: grid;
  grid-template-columns: 3px 4.6rem minmax(0, 1fr) auto;
  gap: 0 1.15rem; align-items: center;
  border: 0; border-bottom: 1px solid var(--rule);
  background: none; padding: 0 1.35rem 0 0; width: 100%; text-align: left;
  cursor: pointer; font: inherit; color: inherit;
  transition: background var(--tap);
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item .stripe { align-self: stretch; background: transparent; }
.item .days {
  font-family: var(--f-display); font-variant-numeric: tabular-nums;
  font-size: 1.75rem; line-height: 1; letter-spacing: -.03em; text-align: right;
  padding: 1.1rem 0; color: var(--ink-3);
}
.item .days small {
  display: block; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin-top: .3rem;
}
.item .body { padding: 1.1rem 0; min-width: 0; }
.item .headline {
  font-weight: 600; font-size: .97rem; letter-spacing: -.008em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item .detail {
  font-size: .86rem; color: var(--ink-2); margin-top: .12rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item .trailing { padding: 1.1rem 0; text-align: right; }
.item .trailing .money { font-size: .97rem; font-weight: 500; }

/* Only attention gets colour. Done and upcoming stay neutral on purpose. */
.sev-late .stripe { background: var(--late); }
.sev-late .days   { color: var(--late); }
.sev-today .stripe { background: var(--soon); }
.sev-today .days   { color: var(--soon); }
.sev-soon .stripe { background: var(--soon); opacity: .45; }
.sev-upcoming .stripe { background: transparent; }

/* ---------- charts ---------- */
/* Every colour comes from a token, so both themes are handled by the same
 * rules. Colour still means "needs you": overdue is the only red on a chart. */
.chart { display: block; overflow: visible; }
.chart-grid    { stroke: var(--rule); stroke-width: 1; }
.chart-divider { stroke: var(--rule-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-axis {
  font-family: var(--f-mono); font-size: 10px; fill: var(--ink-3);
  letter-spacing: .06em;
}
.chart-axis-future { fill: var(--ink-3); opacity: .7; }
.chart-track    { fill: var(--surface-3); }
.chart-received { fill: var(--accent); }
.chart-overdue  { fill: var(--late); }
/* Contracted, not earned. An OUTLINE rather than a faded fill: opacity .26 on
 * a light teal over a dark ground goes muddy and nearly disappears, while a
 * hollow bar says "not real yet" in both themes and at any brightness. */
.chart-expected {
  fill: var(--accent); fill-opacity: .14;
  stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2;
}
.legend-contracted {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .8rem;
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i {
  width: .7rem; height: .7rem; border-radius: 2px; display: inline-block;
}

.panel {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--lift-1);
  padding: 1.25rem 1.35rem 1.1rem; margin-bottom: 1.5rem;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.panel-head h3 {
  margin: 0; font-family: var(--f-display); font-weight: 400;
  font-size: 1.35rem; letter-spacing: -.015em;
}
.panel-head .figure {
  font-family: var(--f-display); font-size: 1.6rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- primitives ---------- */
.money { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }

.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; padding: .22rem .45rem; border-radius: 5px;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.tag.late   { background: var(--late-soft); color: var(--late); }
.tag.soon   { background: var(--soon-soft); color: var(--soon); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.done   { background: var(--surface-3); color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--rule-2); background: var(--surface);
  color: var(--ink); font-weight: 500; font-size: .9rem; cursor: pointer;
  box-shadow: var(--lift-1);
  transition: border-color var(--tap), background var(--tap), box-shadow var(--tap),
              transform var(--tap);
}
.btn:hover { border-color: var(--ink-3); box-shadow: var(--lift-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: .95rem; height: .95rem; }
.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.danger { color: var(--late); border-color: transparent; background: transparent;
              box-shadow: none; }
.btn.danger:hover { background: var(--late-soft); border-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.sm { padding: .32rem .6rem; font-size: .82rem; border-radius: 6px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--rule-2); }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.35rem 1.45rem;
  box-shadow: var(--lift-1);
}
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

h2.section {
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
  margin: 2.5rem 0 .85rem; display: flex; align-items: center; gap: .75rem;
}
h2.section::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}
h2.section:first-child { margin-top: 0; }

/* A section that carries an explanation is a wrapper, not a bare heading, so
 * the gap between sections has to move up to the wrapper — otherwise every
 * heading becomes its parent's first child and the rhythm collapses. */
.section-block { margin-top: 2.5rem; max-width: 70rem; }
.section-block > h2.section { margin-top: 0; }
.section-block:first-child { margin-top: 0; }

/* The "what is this for" button.
 *
 * This product is full of ideas that are not self-evident — readiness,
 * exclusivity windows, contracted versus earned, rates per deliverable. A
 * heading names a thing; it does not explain why anyone should care. The
 * answer sits one tap away rather than in a manual nobody opens. */
.info-btn {
  width: 1.05rem; height: 1.05rem; border-radius: 50%; flex: none;
  border: 1px solid var(--rule-2); background: none; color: var(--ink-3);
  font-family: var(--f-display); font-size: .72rem; line-height: 1;
  cursor: pointer; padding: 0; display: inline-grid; place-items: center;
  transition: color var(--tap), border-color var(--tap), background var(--tap);
}
.info-btn:hover { color: var(--accent); border-color: var(--accent); }
.info-btn.open {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}

/* An armed delete button. It has said "Really?" and the next click fires, so
 * it has to stop looking like every other small button on the row. */
.btn.sm.danger.armed {
  background: var(--late); border-color: var(--late); color: #fff;
}
/* Row actions live in a box inside the cell, never on the cell itself:
 * display:flex on a <td> drops it out of table layout and every column width
 * in the table collapses with it. */
.cell-actions {
  display: flex; gap: .4rem; align-items: center; justify-content: flex-end;
}

.section-info {
  margin: -.2rem 0 .9rem; max-width: 62ch; font-size: .87rem;
  color: var(--ink-2); line-height: 1.5;
  border-left: 2px solid var(--accent); padding-left: .8rem;
}

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.4rem; margin: 0; }
dl.facts dt {
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); padding-top: .2rem;
}
dl.facts dd { margin: 0; font-weight: 500; }

/* ---------- form controls, not browser chrome ---------- */
label.field { display: block; margin-bottom: 1rem; }

/* A row of fields with a button at the end.
 *
 * Every one of these used to be hand-tuned: the field carried a bottom margin,
 * the button carried a guessed margin-bottom to match it, and the guess was
 * .8rem in some places, 1rem in others and 1.6rem where a field had a hint
 * underneath. Any field taller than its neighbours broke the row.
 *
 * The fix is structural. Inside a form row a field has NO bottom margin, so
 * every input bottom-aligns with every other and with the button. Hints move
 * to their own full-width line beneath, where they cannot make one field
 * taller than the rest. */
.form-row {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
  margin-top: 1rem; margin-bottom: 1rem;
}
.form-row > label.field { margin-bottom: 0; flex: 1 1 9rem; min-width: 0; }
.form-row > label.field.narrow { flex: 0 0 9rem; }
.form-row > label.field.wide   { flex: 3 1 14rem; }
.form-row > .btn { margin: 0; flex: none; }
/* A checkbox is a control like any other, so it gets a field's box: label on
 * top, control below.
 *
 * The control sits in a BOX one input tall, centred — not a checkbox with
 * margins. Margins push it up from the bottom of its label, and flex-end
 * aligns the labels, so the checkbox floats above the line while everything
 * else sits on it. The height is derived from the same tokens the input uses
 * (line-height + vertical padding + borders), so it cannot drift apart from
 * them. */
.control-box {
  display: flex; align-items: center; gap: .45rem;
  min-height: calc(1.5em + 1.16rem + 2px);
  font-size: .88rem; color: var(--ink-2);
}
.control-box input[type=checkbox] {
  width: 1.15rem; height: 1.15rem; accent-color: var(--accent);
  margin: 0; cursor: pointer; flex: none;
}

/* A textarea is inline-block by default and sits on the text baseline, which
 * leaves a few pixels of descender space beneath it — enough to knock it out
 * of line with the inputs beside it. */
.form-row textarea { display: block; min-height: 2.7rem; }
/* flex: 0 0 100%, not flex-basis alone. A basis of 100% with the default
 * flex-shrink:1 still collapses onto the previous line when there is room —
 * which is exactly what put a hint beside the Category field and knocked the
 * whole row out of alignment. */
.form-row-hint, .form-row-note { flex: 0 0 100%; }
.form-row-hint {
  font-size: .8rem; color: var(--ink-3); line-height: 1.45; margin-top: -.15rem;
}
label.field > span {
  display: block; font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: .38rem;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=file], select, textarea {
  width: 100%; padding: .58rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
  transition: border-color var(--tap), box-shadow var(--tap);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem; cursor: pointer;
}
input[type=file] { padding: .42rem .55rem; cursor: pointer; }
input[type=date] { font-family: var(--f-mono); font-size: .86rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.btn:focus-visible, .item:focus-visible, .rail a:focus-visible,
input[type=checkbox]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { min-height: 9rem; resize: vertical; font-family: inherit; line-height: 1.6; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: .3rem; line-height: 1.45; }

.empty {
  border: 1px dashed var(--rule-2); border-radius: var(--radius);
  padding: 3rem 1.5rem; text-align: center; color: var(--ink-2); background: var(--surface);
}
.empty b {
  display: block; color: var(--ink); margin-bottom: .35rem;
  font-family: var(--f-display); font-weight: 400; font-size: 1.35rem;
}

.banner {
  border: 1px solid var(--rule); border-left: 3px solid var(--soon);
  background: var(--surface); box-shadow: var(--lift-1);
  padding: .9rem 1.1rem; border-radius: var(--radius);
  margin-bottom: 1.25rem; font-size: .92rem; color: var(--ink-2);
}
.banner.late   { border-left-color: var(--late); }
.banner.accent { border-left-color: var(--accent); }
.banner b { display: block; color: var(--ink); margin-bottom: .15rem; font-weight: 600; }

.scroller {
  overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--lift-1);
}
table { border-collapse: collapse; width: 100%; font-size: .91rem; min-width: 30rem; }
th {
  text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: .62rem;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
  padding: .7rem .95rem; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
td { padding: .8rem .95rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--tap); }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-family: var(--f-mono);
  font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 24rem; }
.auth-card > svg { display: block; margin-bottom: 1.1rem; }
.auth-card .mark {
  font-family: var(--f-display); font-weight: 400; font-size: 2.1rem;
  letter-spacing: -.02em; line-height: 1.05; margin-bottom: .3rem;
}
.auth-card .tagline { color: var(--ink-2); margin: 0 0 1.9rem; font-size: .95rem; }
.auth-error {
  border: 1px solid var(--late); border-left-width: 3px;
  background: var(--late-soft); color: var(--late);
  padding: .6rem .8rem; font-size: .87rem; margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}

/* ---------- proposal review ---------- */
.proposal-line {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 1rem;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--rule); align-items: start;
  cursor: pointer; transition: background var(--tap);
}
.proposal-line:last-child { border-bottom: 0; }
.proposal-line:hover { background: var(--surface-2); }
.proposal-line input[type=checkbox] {
  margin-top: .2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent);
  cursor: pointer;
}
.proposal-line .quote {
  font-size: .84rem; color: var(--ink-2); border-left: 2px solid var(--rule-2);
  padding-left: .75rem; margin-top: .45rem; font-style: italic;
}

/* Safari still paints its own disclosure triangle unless this is set. */
summary::-webkit-details-marker { display: none; }

/* ---------- ask ---------- */
.ask { max-width: 70rem; margin: 0 0 2rem; }
.ask-row { display: flex; gap: .6rem; align-items: stretch; }
.ask-input {
  flex: 1; min-width: 0; padding: .7rem .9rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: var(--radius-sm);
  font-size: .96rem;
}
.ask-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ask-examples { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .6rem; }
.chip {
  background: transparent; border: 1px solid var(--rule-2); color: var(--ink-2);
  border-radius: 999px; padding: .3rem .75rem; font-size: .82rem; cursor: pointer;
  transition: border-color var(--tap), color var(--tap);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.ask-answer {
  margin-top: .9rem; padding: .9rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); border-left: 2px solid var(--accent);
  line-height: 1.55;
}
/* An answer that failed verification is not decorated like one that passed.
   Same colour the product uses everywhere for "this needs you". */
.ask-answer.unverified { border-left-color: var(--late); color: var(--ink-2); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 1.75rem; transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: .65rem 1.1rem;
  border-radius: var(--radius-sm); font-size: .89rem; font-weight: 500;
  box-shadow: var(--lift-2); z-index: 50; max-width: min(90vw, 42rem);
  text-align: left; line-height: 1.45;
  animation: rise 200ms cubic-bezier(.2,.8,.2,1);
}
#toast.err { background: var(--late); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, .4rem); } }

@media (max-width: 900px) {
  main { padding: 2rem 1.5rem 6rem; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto;
    flex-direction: row; border-right: 0; border-top: 1px solid var(--rule);
    z-index: 20; padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 12px rgba(0,0,0,.06);
  }
  .rail-brand, .rail-foot { display: none; }
  .rail nav { flex-direction: row; flex: 1; padding: .4rem; }
  .rail a { flex: 1; flex-direction: column; gap: .2rem; justify-content: center;
            font-size: .7rem; padding: .5rem .25rem; }
  .rail a > span:first-of-type { flex: none; }
  main { padding: 1.5rem 1.15rem 6.5rem; }
  .item { grid-template-columns: 3px 3.4rem minmax(0,1fr); padding-right: 1rem; }
  .item .trailing { display: none; }
  .item .days { font-size: 1.4rem; }
}

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