/* Grizzly Portal. Design of record: grizzly-line/design/grizzly-line-screens-PHONE-REFERENCE.html (screens 1 to 3).
   Values below are the mockup's own (sizes, radii, weights, letter-spacing, the 20px side gutter). Light only.
   No inline styles anywhere: the CSP is style-src 'self'. */
:root {
  --bg:#F5F2ED; --page:#EEE9E0; --card:#FDFBF8; --line:#E2DACD; --line-warm:#E8D9BC; --soft:#EFE9DF;
  --ink:#26211B; --muted:#6F6659; --accent:#BC5410; --deep:#93410C; --amber:#A2740E; --green:#2E7D46;
  --pill-go-bg:#F4E3D3; --pill-go-fg:#93410C; --pill-wait-bg:#F1E5C8; --pill-wait-fg:#7A5A0C; --pill-done-bg:#DEEDE2; --pill-done-fg:#205A34;
  --head:'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body:'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --gutter:20px; --radius:12px; --tabbar:71px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 14px/1.4 var(--body); min-height: 100vh; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.auth { padding-bottom: 0; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; }
svg { display: block; flex: 0 0 auto; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { padding: 0 20px; max-width: 640px; margin: 0 auto; }

/* ---------- header rows ---------- */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 0 12px; }
.brandbar .left, .brandbar .right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font: 800 18px/1 var(--head); flex: 0 0 auto; }
.logo.lg { width: 36px; height: 36px; border-radius: 10px; }
.stamp-brand { font: 400 11px/1.2 var(--mono); letter-spacing: 0.14em; color: var(--muted); white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; font: 700 13px/1 var(--head); flex: 0 0 auto; }
.adminlink { font: 600 13px/1 var(--body); color: var(--accent); text-decoration: none; padding: 10px 4px; }

.pagehead { display: flex; align-items: center; gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 0 6px; }
.pagehead h1 { font: 800 24px/1.2 var(--head); overflow-wrap: anywhere; }
.pagehead.long { align-items: flex-start; }
.pagehead.long h1 { font-size: 21px; line-height: 1.25; }
.pagehead.long .back { margin-top: 2px; }
.back { position: relative; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.back::after { content: ''; position: absolute; left: -11px; right: -11px; top: -11px; bottom: -11px; } /* 44px tap target */

/* ---------- home ---------- */
.greet { padding: 8px 0 0; }
.greet h1 { font: 800 30px/1.1 var(--head); overflow-wrap: anywhere; }
.biz { font-size: 14px; color: var(--muted); margin-top: 4px; }
.bizswitch { position: relative; display: inline-flex; align-items: center; margin-top: 4px; max-width: 100%; }
.bizswitch select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: 14px/1.4 var(--body); color: var(--muted); padding: 4px 22px 4px 0; max-width: 100%; }
.bizswitch svg { position: absolute; right: 0; pointer-events: none; color: var(--muted); }

.tiles { display: flex; gap: 10px; padding-top: 18px; }
.tile { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile .n { font: 800 22px/1.1 var(--head); }
.tile .l { font-size: 12px; line-height: 1.2; color: var(--muted); }
.tile.t-wait .n { color: var(--amber); }
.tile.t-done .n { color: var(--green); }

.actions { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 700 15px/1.2 var(--head); text-decoration: none; cursor: pointer; text-align: center; width: 100%; }
.btn svg { color: var(--accent); }
.btn.accent { height: 52px; border-color: var(--accent); background: var(--accent); color: #FFFFFF; font-size: 16px; }
.btn.accent svg { color: #FFFFFF; }
.btn.dark { min-height: 44px; border-color: var(--ink); background: var(--ink); color: var(--bg); font-size: 14px; border-radius: 10px; }
.btn.dark svg { color: var(--bg); }
.btn.small { width: auto; height: 40px; min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: 13px; flex: 0 0 auto; }
.btn:disabled { opacity: 0.55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 12px 0; color: var(--accent); font: 600 14px/1.2 var(--body); cursor: pointer; text-align: left; min-height: 44px; }

/* ---------- sections and cards ---------- */
.section { padding-top: 24px; }
.section.tight { padding-top: 22px; }
.label { font: 400 11px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.label.amber { color: var(--amber); }
.list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.list.loose { gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card.warm { border-color: var(--line-warm); }
.card.accent { border-color: var(--accent); }
.muted { color: var(--muted); }
.ok { color: var(--green); }
.note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.note:empty { display: none; }
.note.ok { color: var(--green); }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.empty { color: var(--muted); font-size: 14px; }

/* waiting on you */
.wait { display: flex; align-items: center; gap: 12px; }
.wait > svg { color: var(--amber); }
.wait .body { flex: 1; min-width: 0; }
.wait .t { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.wait .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sheet { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* latest rows */
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px; color: inherit; text-decoration: none; min-height: 54px; }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.row .m { font-size: 12px; color: var(--muted); margin-top: 1px; }
.row > svg { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.in_progress, .dot.received { background: var(--accent); }
.dot.waiting_on_you { background: var(--amber); }
.dot.done, .dot.report { background: var(--green); }
.dot.message { background: var(--line); }

/* ---------- requests ---------- */
.chips { display: flex; gap: 8px; padding: 7px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: 600 13px/1 var(--body); display: flex; align-items: center; white-space: nowrap; cursor: pointer; margin: 5px 0; }
.chip::after { content: ''; position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; } /* 44px tap target around a 34px pill */
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.reqlist { padding: 13px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.rcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; color: inherit; text-decoration: none; }
.rcard.waiting_on_you { border-color: var(--line-warm); }
.rtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rtop .pill { margin-top: 1px; }
.rtitle { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.rsub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.rcard .btn.dark { margin-top: 12px; }
.footnote { font-size: 12px; color: var(--muted); padding: 6px 0 0; line-height: 1.45; }

.pill { display: inline-flex; align-items: center; gap: 5px; font: 400 10px/1.2 var(--mono); letter-spacing: 0.08em; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; background: var(--soft); color: var(--muted); }
.pill.in_progress { background: var(--pill-go-bg); color: var(--pill-go-fg); }
.pill.waiting_on_you { background: var(--pill-wait-bg); color: var(--pill-wait-fg); }
.pill.done { background: var(--pill-done-bg); color: var(--pill-done-fg); }

/* stage bar: four equal stages (received, in progress, waiting on you, done). It shows where a request is, never a
   percent of work (spec P4-4: no percent-complete). */
.bar { margin-top: 10px; height: 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.bar i { display: block; height: 6px; border-radius: 3px; background: var(--soft); }
.bar i.on { background: var(--accent); }
.bar.waiting_on_you i.on { background: var(--amber); }
.bar.done i.on { background: var(--green); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 6px; }
.steps span { font-size: 10.5px; line-height: 1.25; color: var(--muted); text-align: center; }
.stagecard { padding: 14px 12px; }
.steps span.on { color: var(--ink); font-weight: 600; }

/* ---------- request detail ---------- */
.detailhead { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tl li:first-child { border-top: 0; padding-top: 0; }
.tl li:last-child { padding-bottom: 0; }
.when { flex: 0 0 104px; font: 400 11px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.filerow { display: flex; align-items: center; gap: 12px; }
.filerow .body { flex: 1; min-width: 0; }
.filerow .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.filerow .m { font-size: 12px; color: var(--muted); margin-top: 1px; }
.filerow > svg { color: var(--muted); }

/* ---------- forms ---------- */
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
input[type=email], input[type=text], input[type=url], textarea { width: 100%; font: 16px/1.4 var(--body); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-height: 48px; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, .chip:focus-visible, .row:focus-visible, .rcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font: 600 15px/1.25 var(--body); cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.opt.on { border-color: var(--accent); }
.opt.on .radio { border: 6px solid var(--accent); }
.qcard { margin-top: 10px; }
.qcard label.field:first-child { margin-top: 0; }
.formfoot { padding-top: 18px; }
.status { font-size: 14px; color: var(--muted); margin: 10px 0 0; min-height: 1em; }
.linkrow { display: flex; gap: 8px; margin-top: 6px; }
.linkrow input { flex: 1; min-width: 0; }
.upload .btn.dark { width: 100%; }

/* ---------- files ---------- */
.month { font: 400 11px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--muted); margin: 14px 0 0; }
iframe.report { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: #FFFFFF; margin-top: 12px; }
.reportmeta { font: 400 11px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--muted); margin-top: 6px; }

/* ---------- footer and tab bar ---------- */
footer.sync { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; padding: 22px var(--gutter) 6px; font: 400 10px/1.4 var(--mono); letter-spacing: 0.06em; color: var(--muted); text-align: center; }
footer.sync button, footer.sync a { background: none; border: 0; padding: 10px 2px; font: inherit; letter-spacing: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; border-top: 1px solid var(--line); background: var(--card); padding: 0 8px max(22px, env(safe-area-inset-bottom)); }
nav.tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; color: var(--muted); text-decoration: none; font: 600 10px/1.2 var(--body); white-space: nowrap; }
nav.tabs a.on { color: var(--accent); }
nav.tabs a .plus { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
nav.tabs a.new { color: var(--ink); }
nav.tabs a.new.on { color: var(--accent); }

/* ---------- Ask Grizzly (Task 13): the mockup's screen 3, TEXT THREAD ---------- */
/* The thread fills the screen above the tab bar: the header sticks to the top, the input bar sticks just above the tab
   bar (49px of tab plus its bottom inset, which is --tabbar less the 22px minimum inset), and the log grows between. */
/* --dock is the tab bar's real height (49px plus max(22px, the bottom inset)). The page's shared footer is hidden here and
   its synced line moves into the thread (public/chat.js), so the input sits directly on the tab bar as in the mockup. */
body[data-screen="chat"] { --dock: calc(var(--tabbar) - 22px + max(22px, env(safe-area-inset-bottom))); background: var(--card); padding-bottom: var(--dock); }
body[data-screen="chat"] footer.sync { display: none; }
body[data-screen="chat"] main { display: flex; flex-direction: column; min-height: calc(100vh - var(--dock)); min-height: calc(100dvh - var(--dock)); }
.chathead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) var(--gutter) 16px; margin: 0 calc(-1 * var(--gutter)); border-bottom: 1px solid var(--line); background: var(--bg); }
.chathead .who { flex: 1; min-width: 0; }
.chathead .name { font: 700 16px/1.25 var(--head); }
.chathead .sub { font-size: 12px; line-height: 1.35; color: var(--muted); }
.chatlog { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 0; }
.chatinfo { align-self: center; max-width: 300px; margin: 0 0 4px; font-size: 12px; line-height: 1.45; color: var(--muted); text-align: center; }
.chatinfo .synced { display: block; margin-top: 6px; font: 400 10px/1.4 var(--mono); letter-spacing: 0.06em; }
.daystamp { align-self: center; font: 400 10px/1.3 var(--mono); letter-spacing: 0.1em; color: var(--muted); margin-top: 6px; }
.bubble { max-width: min(290px, 82%); padding: 11px 14px; font-size: 15px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Roles: .me is the client, .them is Grizzly. Colours follow the role (client #EFE9DF, Grizzly #BC5410) and the rules
   right below are the mockup's sides (client left, Grizzly right). */
.bubble.me { align-self: flex-start; background: var(--soft); border-radius: 16px 16px 16px 4px; }
.bubble.them { align-self: flex-end; background: var(--accent); color: #FFF7F0; border-radius: 16px 16px 4px 16px; }
.chatact { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 100%; }
/* SIDES: Raj's pending default (Waiting on Raj page), iMessage style: the client's own bubbles on the RIGHT, Grizzly's on
   the LEFT. Switched by the one class on the log, set on one line in public/chat.js (const SIDES). Tails follow the side. */
.chatlog.sides-imessage .bubble.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; }
.chatlog.sides-imessage .bubble.them { align-self: flex-start; border-radius: 16px 16px 16px 4px; }
.chatlog.sides-imessage .chatact { align-self: flex-start; align-items: flex-start; }
.chatact .btn.small { gap: 8px; }
.chatact .btn.small svg { color: var(--accent); }
.chatact .note { margin-top: 0; }
.bubble.typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: #FFF7F0; opacity: 0.5; animation: chatdot 1.2s infinite ease-in-out; }
.bubble.typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatdot { 0%, 80%, 100% { opacity: 0.35; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble.typing i { animation: none; opacity: 0.8; } }
.chatbar { position: sticky; bottom: var(--dock); z-index: 5; display: flex; align-items: flex-end; gap: 10px; padding: 12px var(--gutter); margin: 0 calc(-1 * var(--gutter)); border-top: 1px solid var(--line); background: var(--bg); }
.chatbar .attach { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex: 0 0 auto; margin: 0 -8px 0 -6px; }
.chatbar textarea { flex: 1; min-width: 0; min-height: 44px; height: 44px; max-height: 132px; border-radius: 22px; padding: 11px 16px; resize: none; font-size: 16px; line-height: 1.35; field-sizing: content; }
@supports (field-sizing: content) { .chatbar textarea { height: auto; } }
.chatbar .sendbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.chatbar .sendbtn:disabled { opacity: 0.55; cursor: default; }
.chatbar .attach:focus-visible, .chatbar .sendbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- sign in (also the server-rendered /auth/verify page) ---------- */
body.auth main { padding-top: calc(40px + env(safe-area-inset-top)); }
body.auth main.card, body.auth .authcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; margin: 0 auto; max-width: 440px; }
body.auth main.card { margin: 40px auto; width: calc(100% - 40px); }
body.auth h1 { font: 800 24px/1.2 var(--head); margin: 14px 0 8px; }
body.auth p { font-size: 15px; line-height: 1.45; }
body.auth button[type=submit], body.auth main.card button { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border: 0; border-radius: 12px; background: var(--accent); color: #FFFFFF; font: 700 16px/1 var(--head); cursor: pointer; margin-top: 12px; }
.facts { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ---------- add to home screen hint ---------- */
.a2hs { margin-top: 18px; }
.a2hs h3 { font: 700 15px/1.3 var(--head); margin-bottom: 4px; }
.a2hs p { margin: 0 0 10px; font-size: 14px; }

/* ---------- Admin (Task 14): Raj only. The approved mockup's RAJ screens (screens 4 to 6 of the phone reference): dark
   page #171310, cards #201B16 on #383026 lines, mono stamps, the orange #E8813C primary with dark text. The tokens are
   redefined for this one page only, so the shared components (cards, buttons, inputs, the stage bar) follow; the
   client screens stay light. No tab bar here: /admin is not a client screen. ---------- */
body[data-screen="admin"] {
  --bg:#171310; --page:#171310; --card:#201B16; --line:#383026; --line-warm:#5A4520; --soft:#2A241D;
  --ink:#EDE5D9; --muted:#A2988A; --accent:#E8813C; --deep:#E8813C; --amber:#D9A93F; --green:#6FBE8A; --red:#E07A6E;
  --pill-go-bg:#3A2B18; --pill-go-fg:#E8813C; --pill-wait-bg:#3A3018; --pill-wait-fg:#D9A93F; --pill-done-bg:#1E3325; --pill-done-fg:#6FBE8A;
  background: var(--bg); color: var(--ink); padding-bottom: calc(28px + env(safe-area-inset-bottom));
}
body[data-screen="admin"] nav.tabs { display: none; }
body[data-screen="admin"] .logo { background: var(--accent); color: #1C1610; }
body[data-screen="admin"] .btn.accent, body[data-screen="admin"].auth button[type=submit] { color: #1C1610; }
body[data-screen="admin"] .btn.accent svg { color: #1C1610; }
body[data-screen="admin"] select { width: 100%; }
.admhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 0 4px; }
.admhead .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stamp { font: 400 11px/1.2 var(--mono); letter-spacing: 0.14em; color: var(--muted); white-space: nowrap; }
.admtitle { font: 800 28px/1.1 var(--head); padding-top: 12px; }
main.admin .section { padding-top: 26px; }
main.admin h3 { font: 700 16px/1.3 var(--head); }
.small { font-size: 13px; line-height: 1.45; }
main.admin p { margin: 8px 0 0; }
.tag { display: inline-flex; align-items: center; font: 400 10px/1.2 var(--mono); letter-spacing: 0.12em; padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.accent { background: #3A2B18; color: var(--accent); }
.tag.amber { background: #3A3018; color: var(--amber); }
.tag.green { background: #1E3325; color: var(--green); }
.tag.red { background: #3A1F1B; color: var(--red); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.clienttags { margin: 12px 0; }
.card.warnc { border-color: var(--line-warm); }
.card.danger { border-color: #4A2A24; }
.card.closed { opacity: 0.85; }
/* list rows inside one card, the mockup's QUEUE and PENDING ASKS panels */
.card.rows { padding-top: 6px; padding-bottom: 6px; }
.askrow { padding: 10px 0; border-top: 1px solid var(--line); }
.card.rows > .askrow:first-child, .card.rows > p + .askrow { border-top: 0; }
.askrow .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.askrow .who { font: 600 13px/1.3 var(--body); min-width: 0; overflow-wrap: anywhere; }
.askrow .what { font-size: 14px; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.askrow .next { font: 400 11px/1.4 var(--mono); letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }
.askrow.yours .next { color: var(--red); }
.card.rows > .muted { padding: 8px 0; }
.card.rows > p.small { margin: 8px 0 4px; }
/* the switcher */
.selectwrap { position: relative; margin-top: 10px; }
.selectwrap select { appearance: none; -webkit-appearance: none; min-height: 48px; padding: 0 40px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: 600 16px/1.2 var(--body); cursor: pointer; }
.selectwrap svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
/* ticket cards: note, Close, then the one D-P11 question */
.tcard .head, .ccard .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tcard .age { font: 400 10px/1.3 var(--mono); letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; padding-top: 5px; text-transform: uppercase; }
.tcard .title { font: 700 17px/1.3 var(--head); margin-top: 10px; overflow-wrap: anywhere; }
.tcard .stage { margin-top: 2px; }
.notelabel { display: block; margin-top: 14px; font: 400 10px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.tcard textarea { margin-top: 6px; min-height: 72px; }
.jump { display: flex; gap: 8px; margin-top: 12px; }
.jump a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 600 13px/1 var(--body); text-decoration: none; }
.jump a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
main.admin .section[id] { scroll-margin-top: 12px; }
.tcard textarea[readonly] { color: var(--muted); }
.tcard > .btn, .formcard .btn, .card > .btn { margin-top: 10px; }
.q { font: 700 17px/1.35 var(--head); margin: 14px 0 0; }
.row2 { display: flex; gap: 10px; margin-top: 10px; }
.row2 > * { flex: 1; min-width: 0; }
.res { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; line-height: 1.4; }
.why { font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.btn.danger { color: var(--red); }
.note.bad { color: var(--red); }
/* contacts */
.ccard .name { font: 700 16px/1.3 var(--head); overflow-wrap: anywhere; min-width: 0; }
.ccard .email { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btnrow > .btn { width: auto; flex: 1 1 140px; min-height: 44px; font-size: 14px; }
.confirm { width: 100%; }
.confirm p { font-size: 14px; line-height: 1.45; }
.formcard form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.formcard .selectwrap { margin-top: 0; }
main.admin input[type=text], main.admin input[type=email] { margin-top: 10px; }
.formcard input[type=text], .formcard input[type=email] { margin-top: 0 !important; }
/* outbox */
.stateline { display: flex; align-items: center; gap: 8px; margin-top: 8px; font: 700 17px/1.2 var(--head); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.sdot.paused { background: var(--amber); }
/* the step-up sheet */
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(10, 8, 6, 0.66); }
.upsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; }
.upinner { width: 100%; max-width: 640px; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55); }
.upinner h2 { font: 800 22px/1.2 var(--head); margin-top: 8px; }
.upinner > .btn { margin-top: 14px; }
.codeform { display: flex; gap: 10px; margin-top: 10px; }
.codeform input { flex: 1; min-width: 0; margin-top: 0 !important; font: 600 18px/1.2 var(--mono); letter-spacing: 0.2em; }
.codeform .btn { width: auto; flex: 0 0 auto; height: 48px; min-height: 48px; font-size: 15px; }
/* wide screens (Raj's laptop): two columns, asks over system on the left, the client on the right. The DOM stays in
   phone order, so the phone layout above is untouched. */
@media (min-width: 1024px) {
  main.admin { max-width: 1200px; }
  main.admin .cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "a b" "c b"; grid-template-rows: auto 1fr; column-gap: 32px; align-items: start; }
  main.admin .col-a { grid-area: a; }
  main.admin .col-b { grid-area: b; }
  main.admin .col-c { grid-area: c; }
  main.admin .jump { display: none; }
}
