/* BeePrecise Company OS. Colours, type and spacing follow the BeePrecise design tokens
   (docs/design-system/identity/tokens.json in the company repo). One button pair, one card,
   one radius scale. */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #FBFAF8;
  --paper: #FFFFFF;
  --ghost: #F7F5FA;
  --ink: #0E0A14;
  --text: #1F1B25;
  --muted: #6C6770;
  --line: #E7E4EA;
  --line-strong: #D4CFD9;
  --brand: #470165;
  --brand-deep: #36014D;
  --yellow: #FFCE50;
  --ok: #2F5E3B;
  --ok-solid: #4A7C59;
  --ok-bg: #EDF3EC;
  --stop: #9B2C24;
  --stop-bg: #FCEDEB;
  --wait: #7A4A00;
  --wait-bg: #FBF3DB;
  --r1: 4px;
  --r2: 8px;
  --r3: 12px;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 17px/26px var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
strong { font-weight: 600; color: var(--ink); }
code, .mono {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
code { background: var(--ghost); border: 1px solid var(--line); border-radius: var(--r1); padding: 1px 5px; color: var(--ink); }
.mono { color: var(--muted); }
q { quotes: "“" "”"; color: var(--ink); font-weight: 500; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r1); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r2); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- top bar and the four screens ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter);
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  font-weight: 600; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 10px; min-height: 44px; line-height: 44px;
}
.brand-sub { font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.signout { margin: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: var(--r2);
  color: var(--muted); text-decoration: none; font-size: 12px; line-height: 16px; font-weight: 500;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.tab .ic { width: 22px; height: 22px; }
.tab-long { display: none; }
.tab[aria-current="page"] { color: var(--brand); background: var(--ghost); }
.dot {
  position: absolute; top: 4px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9999px;
  background: var(--yellow); color: var(--ink); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center;
}
.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ---- page ---- */
.shell { max-width: 720px; margin: 0 auto; padding: 28px var(--gutter) 120px; }
.shell.narrow { max-width: 460px; }
.shell.medium { max-width: 640px; }
.public .shell { padding-bottom: 64px; }
h1 { font-size: 26px; line-height: 32px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
h2 { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.lead { margin-top: 10px; color: var(--muted); max-width: 60ch; text-wrap: pretty; }
.lead strong { color: var(--ink); }
.sec-h {
  margin: 36px 0 12px; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted);
  font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.meta { color: var(--muted); font-size: 13px; line-height: 20px; }
.bad { color: var(--stop); font-weight: 500; }
.foot { margin-top: 28px; color: var(--muted); font-size: 15px; line-height: 24px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -10px 0 4px -2px;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
}
.back .ic { width: 16px; height: 16px; transition: transform 150ms var(--ease); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r3); }
.list { display: grid; gap: 12px; margin-top: 20px; }
.sec-h + .list { margin-top: 0; }

/* ---- buttons: one pair ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r2);
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: 500 16px/24px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease);
}
.btn.quiet { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn.quiet.stop-btn { color: var(--stop); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn:active { transform: scale(0.98); }
.textlink {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 500;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center;
  transition: text-decoration-color 150ms var(--ease);
}

/* ---- rows you can tap ---- */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; text-decoration: none;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.row-main { display: grid; gap: 2px; min-width: 0; }
.row-main > span:not(.meta):not(.mono) { color: var(--text); }
.go { color: var(--line-strong); display: inline-flex; transition: transform 150ms var(--ease), color 150ms var(--ease); }
.go .ic { width: 18px; height: 18px; }

/* ---- a sign-up waiting for a yes ---- */
.ask { display: grid; gap: 16px; padding: 20px; }
.ask-who { display: grid; gap: 2px; min-width: 0; }
.ask-btns { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 0; }
.nudge {
  margin-top: 20px; padding: 20px; display: grid; gap: 16px; text-decoration: none;
  border-color: var(--yellow); box-shadow: inset 4px 0 0 var(--yellow);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.nudge-text { display: grid; gap: 2px; }
.nudge-text span { color: var(--muted); }

/* ---- calm "not yet" and empty states ---- */
.soon, .empty { margin-top: 24px; padding: 24px 20px; display: grid; gap: 14px; }
.soon p, .empty p { color: var(--muted); max-width: 56ch; }
.soon h2 + p { margin-top: 6px; }
.empty p strong { color: var(--ink); }
.calm { margin-top: 24px; display: grid; gap: 14px; justify-items: start; }
.calm-ic {
  width: 44px; height: 44px; border-radius: var(--r3); background: var(--ghost); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.calm-ic.wait { background: var(--wait-bg); color: var(--wait); }
.calm-ic .ic { width: 22px; height: 22px; }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 9999px;
  font-size: 12px; line-height: 24px; font-weight: 500; white-space: nowrap;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.wait { background: var(--wait-bg); color: var(--wait); }
.tag.stop { background: var(--stop-bg); color: var(--stop); }
.quiet-tag { background: var(--ghost); color: var(--muted); border: 1px solid var(--line); }
.soon-tag { background: var(--ghost); color: var(--brand); margin-top: 16px; width: max-content; max-width: 100%; }
.legend { margin: 14px 0 0; display: grid; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.git { color: var(--muted); font-size: 15px; }

/* ---- time range ---- */
.seg {
  margin-top: 20px; display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px;
  background: var(--ghost); border: 1px solid var(--line); border-radius: var(--r3); max-width: 100%;
}
.seg a {
  min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r2); color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.seg a[aria-current="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(14, 10, 20, 0.06); }
.seg + .lead { margin-top: 20px; }

/* ---- the logbook, one sentence per line ---- */
.day-h { margin: 32px 0 10px; font-size: 15px; line-height: 24px; font-weight: 600; color: var(--ink); }
.log { overflow: hidden; }
.log-row {
  display: grid; grid-template-columns: 68px minmax(0, 1fr); column-gap: 12px; row-gap: 2px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.log-row:first-child { border-top: 0; }
.log-row time { font-family: var(--mono); font-size: 13px; line-height: 26px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-row p { font-size: 16px; line-height: 26px; min-width: 0; overflow-wrap: anywhere; }
.log-row p code { display: inline-block; max-width: 100%; vertical-align: top; line-height: 22px; margin: 1px 0; }
.log-row .amount { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 20px; }
.after { display: block; color: var(--muted); font-size: 14px; line-height: 22px; }
.after.bad { color: var(--stop); }
.is-blocked { background: var(--stop-bg); box-shadow: inset 3px 0 0 var(--stop); }
.is-blocked code { background: #fff; border-color: #F1CFCB; }

/* ---- folder switches ---- */
.folders { overflow: hidden; }
.folder {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 12px 12px 20px; border-top: 1px solid var(--line); min-height: 68px;
}
.folder:first-child { border-top: 0; }
.folder-name { display: grid; gap: 0; min-width: 0; }
.folder-name strong { font-size: 16px; line-height: 24px; }
.folder-name .mono { font-size: 12px; line-height: 18px; }
.folder form { margin: 0; flex: none; }
.switch {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px;
  background: none; border: 0; border-radius: var(--r2); cursor: pointer; font: 500 14px/20px var(--sans); color: var(--muted);
}
.switch-word { min-width: 44px; text-align: right; }
.track {
  width: 48px; height: 28px; border-radius: 9999px; background: var(--line-strong); position: relative; flex: none;
  transition: background-color 200ms var(--ease);
}
.knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(14, 10, 20, 0.2); transition: transform 200ms var(--ease);
}
.switch[aria-checked="true"] { color: var(--ok); }
.switch[aria-checked="true"] .track { background: var(--ok-solid); }
.switch[aria-checked="true"] .knob { transform: translateX(20px); }
.switch[aria-busy="true"] { opacity: 0.6; }

.danger { margin-top: 12px; padding: 0 20px; }
.danger summary {
  min-height: 56px; display: flex; align-items: center; cursor: pointer; color: var(--stop); font-weight: 500; font-size: 15px;
  list-style: none;
}
.danger summary::-webkit-details-marker { display: none; }
.danger p { color: var(--muted); font-size: 15px; line-height: 24px; }
.danger form { margin: 14px 0 20px; }

/* ---- forms ---- */
.form { margin-top: 24px; padding: 24px 20px; display: grid; gap: 6px; }
.form label { font-size: 15px; line-height: 24px; font-weight: 500; color: var(--ink); margin-top: 10px; }
.form label:first-of-type { margin-top: 0; }
.form input[type="text"], .form input[type="email"], .form input[type="password"] {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r2);
  background: var(--paper); color: var(--ink); font: 400 16px/24px var(--sans);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.form input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(71, 1, 101, 0.14); }
.form .btn { margin-top: 18px; width: 100%; }
.help { color: var(--muted); font-size: 13px; line-height: 20px; }
.form .btn + .help { margin-top: 10px; text-align: center; }
.alert { background: var(--stop-bg); color: var(--stop); border-radius: var(--r2); padding: 10px 14px; font-size: 15px; line-height: 24px; margin-bottom: 10px; }

/* ---- set-up page ---- */
.steps { margin-top: 28px; display: grid; gap: 12px; }
.step { padding: 20px; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
.step p { color: var(--muted); margin-top: 6px; }
.step p .btn { margin-top: 6px; }
.num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff;
  font: 500 14px/32px var(--mono); text-align: center;
}
.copy { margin-top: 12px; display: grid; gap: 10px; }
.copy code { display: block; padding: 12px 14px; border-radius: var(--r2); font-size: 13px; line-height: 20px; }
.copy .btn { justify-self: start; }
.notes { margin-top: 36px; }
.plain { margin-top: 10px; display: grid; gap: 10px; color: var(--muted); font-size: 16px; line-height: 25px; }
.plain li { padding-left: 18px; position: relative; }
.plain code, .step p code, .calm code { white-space: nowrap; }
.plain li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

/* ---- pointer feedback, only where a real pointer exists ---- */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
  .btn.quiet:hover { background: var(--ghost); border-color: var(--muted); }
  .textlink:hover { text-decoration-color: var(--ink); }
  .tab:hover { color: var(--ink); }
  .row:hover, .nudge:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(14, 10, 20, 0.06); }
  .row:hover { border-color: var(--line-strong); }
  .nudge:hover { box-shadow: inset 4px 0 0 var(--yellow), 0 4px 12px rgba(14, 10, 20, 0.06); }
  .row:hover .go { transform: translateX(3px); color: var(--ink); }
  .back:hover { color: var(--ink); }
  .back:hover .ic { transform: translateX(-3px); }
  .seg a:hover { color: var(--ink); }
  .switch:hover .track { box-shadow: 0 0 0 4px var(--ghost); }
}

/* ---- wider screens: tabs move to the top bar ---- */
@media (min-width: 860px) {
  :root { --gutter: 32px; }
  .top-in { height: 64px; }
  .tabs { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; margin: 0 auto 0 16px; }
  .tab { flex-direction: row; gap: 8px; min-height: 44px; padding: 0 12px; font-size: 15px; line-height: 24px; }
  .tab .ic { width: 18px; height: 18px; }
  .tab-long { display: inline; }
  .tab-short { display: none; }
  .tab[aria-current="page"] { color: var(--ink); background: none; box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
  .dot { position: static; }
  .shell { padding: 48px var(--gutter) 96px; }
  h1 { font-size: 32px; line-height: 40px; }
  .ask { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 20px 24px; }
  .nudge { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 20px 24px; }
  .row { padding: 18px 24px; }
  .soon { grid-template-columns: 44px minmax(0, 1fr); gap: 20px; padding: 28px 24px; }
  .log-row { grid-template-columns: 76px minmax(0, 1fr) auto; padding: 14px 24px; }
  .log-row .amount { grid-column: 3; line-height: 26px; white-space: nowrap; }
  .folder { padding: 12px 16px 12px 24px; }
  .form { padding: 28px 24px; }
  .step { padding: 24px; }
  .copy { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

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