/* HQ Cloud: the phone app, the client portals and the sign-in page share HQ's look.
   Cream and void from the SAGEAEYE brand, Archivo at 14/16/18/22/28, weights 400 and 600, red only for what's late,
   green for good news. Light by default; the phone's own dark mode switches it. */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

:root {
  --red: #B3261E; --red-tint: #FBE9E7; --red-ink: #8A1D17;
  --blue: #2A5A9A; --blue-tint: #E3ECF8; --blue-ink: #1D3F6E;
  --green: #2E6B4D; --green-tint: #E3F1E8; --green-ink: #1E4A35;
  --frame: #EFEBE3; --ground: #FFFFFF; --surface: #FFFFFF; --raised: #F6F4EF; --active: #E4DED2;
  --border: #E6E1D7; --rule: #EFEBE4; --control: #CBC4B6;
  --text: #171614; --muted: #57534B; --faint: #686358;
  --primary: #171614; --on-primary: #FFFFFF; --focus: #171614;
  --pill-bg: #EFECE6; --pill-ink: #3D3A35;
  --font: "Archivo", -apple-system, system-ui, sans-serif;
  --radius: 14px; --radius-inner: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #F28B82; --red-tint: #311B1A; --red-ink: #F4A39C; --blue: #8FB5EA; --blue-tint: #18263A; --blue-ink: #A9C7F0;
    --green: #7DC9A0; --green-tint: #16291F; --green-ink: #8FD3AE;
    --frame: #0B0B0B; --ground: #141413; --surface: #1A1A18; --raised: #232321; --active: #2A2A27;
    --border: #282826; --rule: #222220; --control: #45443F; --text: #EEE8DC; --muted: #B9B4AA; --faint: #A29D93;
    --primary: #EEE8DC; --on-primary: #0B0B0B; --focus: #EEE8DC; --pill-bg: #262624; --pill-ink: #D6D1C7;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--frame); color: var(--text); font: 400 16px/24px var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
b, strong { font-weight: 600; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 28px; line-height: 34px; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 26px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }

.wrap { max-width: 760px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 16px calc(28px + var(--safe-b)); }
.brandrow { display: flex; align-items: center; gap: 10px; }
.emblem { width: 28px; height: 30px; flex: none; color: var(--text); }
.wordmark { font-size: 13px; font-weight: 600; letter-spacing: .32em; font-stretch: 125%; }
.sub { font-size: 14px; line-height: 20px; color: var(--muted); }
.faint { color: var(--faint); }
.stack { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.empty { padding: 18px; border: 1px dashed var(--control); border-radius: var(--radius-inner); color: var(--muted); }
.note { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 600; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--control); border-radius: 999px; background: transparent; text-decoration: none; }
.ghost:disabled { opacity: .45; }
.txt { border: 0; background: none; padding: 6px 0; font-weight: 600; text-decoration: none; }
.txt.muted { font-weight: 400; color: var(--muted); }
.in { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--control); border-radius: var(--radius-inner); background: var(--surface); }
textarea.in { min-height: 96px; resize: vertical; line-height: 24px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--muted); }

.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 14px; white-space: nowrap; background: var(--pill-bg); color: var(--pill-ink); flex: none; }
.pill.good { background: var(--green-tint); color: var(--green-ink); }
.pill.late { background: var(--red-tint); color: var(--red-ink); }
.pill.making { background: var(--blue-tint); color: var(--blue-ink); }
.neg { color: var(--red); }

.rows { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); }
.rows > .row:first-child { border-top: 0; padding-top: 4px; }
.row .name { font-weight: 600; overflow-wrap: anywhere; }
.row .line2 { font-size: 14px; line-height: 20px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--raised); border-radius: 999px; max-width: 100%; overflow-x: auto; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--primary); color: var(--on-primary); box-shadow: 0 12px 32px rgba(0, 0, 0, .2); z-index: 50; animation: up .25s ease both; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* the sign-in page */
.signin { min-height: 100svh; display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b)); }
.signin .box { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.signin .code { font-size: 22px; letter-spacing: .14em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }
.signin .err { color: var(--red); min-height: 24px; }
