/* TaskSnap app. Palette from Boss's logo and visual reference (23 Oct 2026):
   navy #133862, mint #CFE3D2, coral #E07A5F, soft grey background, white cards. */
:root {
  --navy: #133862; --navy-2: #0c2a4b; --mint: #cfe3d2; --mint-ink: #2f5b3e; --coral: #e07a5f; --coral-2: #c9654b;
  --bg: #f3f6f8; --card: #ffffff; --text: #14253a; --muted: #5e6d7d; --line: #e3e9ee;
  --shadow: 0 6px 20px rgba(19, 56, 98, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1626; --card: #13233a; --text: #e9eef4; --muted: #9fb0c2; --line: #22354f; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }

/* Navy band at the top; the first card overlaps it, as in the reference. */
.bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px 64px; padding-top: max(14px, env(safe-area-inset-top));
  background: var(--navy); color: #fff; font-weight: 600; font-size: 1.15rem; border-radius: 0 0 28px 28px; }
.bar img { width: 34px; height: 34px; }
main { max-width: 520px; margin: -48px auto 0; padding: 0 16px 40px; }

section { background: var(--card); border-radius: 18px; padding: 22px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
h1 { font-size: 1.35rem; margin: 0 0 10px; line-height: 1.3; color: var(--text); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

button { font: inherit; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 10px 14px; cursor: pointer; }
button.primary { width: 100%; background: var(--coral); color: #fff; border: 0; border-radius: 999px; font-weight: 600; padding: 15px; margin: 8px 0 12px; }
button.primary:active { background: var(--coral-2); }
button:disabled { opacity: 0.6; cursor: default; }
button:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.roles { list-style: none; padding: 0; margin: 4px 0 12px; }
.roles li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; }
.roles li b { font-weight: 600; }
.pill { display: inline-block; background: var(--mint); color: var(--mint-ink); border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; white-space: nowrap; }

.probe { margin-top: 28px; font-size: 0.9rem; }
.probe summary { color: var(--muted); cursor: pointer; padding: 6px 0; }
.probe-body { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 14px; }
.probe dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; }
.probe dt { color: var(--muted); }
.probe dd { margin: 0; word-break: break-word; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
pre { white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }

/* ── app-1 (23 Oct 2026): send a document, waiting list, role badges ── */
h2 { font-size: 1.1rem; margin: 0 0 8px; }
button.link { background: none; border: 0; color: var(--muted); width: 100%; padding: 8px; text-decoration: underline; }
button.big { flex: 1 1 140px; padding: 14px; font-weight: 600; border: 2px solid var(--navy); color: var(--navy); background: var(--card); }
@media (prefers-color-scheme: dark) { button.big { border-color: var(--mint); color: var(--mint); } }

.badge { border: 0; background: var(--mint); color: var(--mint-ink); border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.badge::after { content: " ⓘ"; font-weight: 400; }
.badge.waiting { background: var(--line); color: var(--text); }
.badge.waiting::after { content: ""; }

dialog { border: 0; border-radius: 18px; padding: 20px; max-width: 420px; width: calc(100% - 32px); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(12, 42, 75, 0.55); }
dialog ul { margin: 0 0 12px; padding-left: 20px; }
.ri-head { font-weight: 700; margin: 8px 0 4px; }

.choice-list { list-style: none; padding: 0; margin: 0 0 8px; }
.choice-list button { width: 100%; text-align: left; margin: 0 0 8px; padding: 14px; }
.choice-list .sub { display: block; color: var(--muted); font-size: 0.85rem; }
input[type=search] { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); margin: 0 0 10px; background: var(--card); color: var(--text); }

.for-line { margin: 0 0 4px; color: var(--muted); }
.pages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.pages figure { margin: 0; position: relative; }
.pages img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.pages figcaption { font-size: 0.8rem; color: var(--muted); text-align: center; }
.pages .drop { position: absolute; top: 4px; right: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; }
.pdf-line { background: var(--bg); border-radius: 10px; padding: 10px 12px; word-break: break-word; }
.notice { background: #fdeee9; color: #7a2e1b; border-radius: 10px; padding: 10px 12px; }
@media (prefers-color-scheme: dark) { .notice { background: #3a2119; color: #f6d3c8; } }

.list-card h2 { margin-bottom: 4px; }
.doc-list { list-style: none; padding: 0; margin: 4px 0 8px; }
.doc-list li { border-top: 1px solid var(--line); padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.doc-list .what { font-weight: 600; }
.doc-list .state { display: block; font-size: 0.85rem; color: var(--muted); }
.doc-list .state.bad { color: var(--coral-2); }
.doc-list button { font-size: 0.85rem; padding: 6px 10px; white-space: nowrap; }

/* ── app-2 (26 Oct 2026): My documents ── */
button.secondary { width: 100%; background: var(--card); color: var(--navy); border: 2px solid var(--navy); border-radius: 999px; font-weight: 600; padding: 13px; margin: 0 0 12px; }
@media (prefers-color-scheme: dark) { button.secondary { color: var(--mint); border-color: var(--mint); } }
.doc-list .pill { flex: none; font-weight: 600; }
.pill.st-SENT, .pill.st-NOT_FILED { background: var(--line); color: var(--text); }
.pill.st-BEING_READ { background: #dce8f5; color: #1c4272; }
.pill.st-FILED { background: var(--mint); color: var(--mint-ink); }
.pill.st-NEEDS_LOOK { background: #fdeee9; color: #7a2e1b; }
@media (prefers-color-scheme: dark) { .pill.st-BEING_READ { background: #1d3557; color: #cfe0f5; } .pill.st-NEEDS_LOOK { background: #3a2119; color: #f6d3c8; } }

/* ── app-3 (27 Oct 2026): Needs you, review card, reasons, full-screen document ── */
main.wide { max-width: 1040px; }
button.link-left { background: none; border: 0; color: var(--muted); padding: 6px 0; text-decoration: underline; }
.needs-card { border-left: 6px solid var(--coral); }
.needs-card h2 { font-size: 1.25rem; margin-bottom: 2px; }
.needs-card.clear { border-left-color: var(--mint); }
.needs-card button.primary { margin-bottom: 0; }

.rv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rv-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 820px) { .rv-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.rv-image { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; min-height: 220px; max-height: 70vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center; cursor: zoom-in; position: relative; }
.rv-image img, .rv-image canvas { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.rv-image .rv-wait { color: var(--muted); padding: 40px 16px; text-align: center; }
.rv-pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 0; }
.rv-pager button { padding: 8px 12px; }

.rv-sentences { list-style: none; padding: 0; margin: 0 0 12px; }
.rv-sentences li { background: #fdeee9; color: #7a2e1b; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .rv-sentences li { background: #3a2119; color: #f6d3c8; } }
.rv-figures { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rv-figures dt, .rv-figures dd { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); }
.rv-figures dt:first-of-type, .rv-figures dt:first-of-type + dd { border-top: 0; }
.rv-figures dt { color: var(--muted); }
.rv-figures dd { text-align: right; font-weight: 600; word-break: break-word; }
.rv-figures .suspect { background: #fff0c9; color: #5c3b00; box-shadow: inset 4px 0 0 var(--coral); }
.rv-figures dt.suspect { box-shadow: inset 4px 0 0 var(--coral); }
.rv-figures .suspect small { display: block; font-weight: 400; color: #7a2e1b; }
@media (prefers-color-scheme: dark) { .rv-figures .suspect { background: #4a3a10; color: #ffe9b0; } .rv-figures .suspect small { color: #f6d3c8; } }
.rv-items { margin: 0 0 12px; }
.rv-items summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.rv-items ul { margin: 4px 0 0; padding-left: 18px; }
.rv-head { font-weight: 700; margin: 0 0 6px; }
.rv-fixes button { display: block; width: 100%; text-align: left; margin: 0 0 8px; padding: 12px; border: 2px solid var(--navy); color: var(--navy); font-weight: 600; background: var(--card); }
@media (prefers-color-scheme: dark) { .rv-fixes button { border-color: var(--mint); color: var(--mint); } }
.rv-dup { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.rv-actions { display: grid; gap: 8px; margin: 12px 0 6px; }
.rv-actions button { width: 100%; padding: 13px 14px; text-align: center; font-weight: 600; border-radius: 14px; }
.rv-actions button small { display: block; font-weight: 400; font-size: 0.8rem; opacity: 0.85; }
.rv-actions button.go { background: var(--coral); color: #fff; border: 0; }
.rv-actions button.alt { border: 2px solid var(--navy); color: var(--navy); }
.rv-actions button.out { border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .rv-actions button.alt { border-color: var(--mint); color: var(--mint); } }
.rv-actions button:disabled { opacity: 0.45; }
.rv-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.rv-nav button { flex: 1; }

.fld { display: block; margin: 0 0 12px; }
.fld span { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 4px; }
.fld input, .fld textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.opts { margin: 0 0 8px; }
.opts label { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.opts input { width: 20px; height: 20px; flex: none; }
.opts label.on { border-color: var(--navy); background: var(--bg); }

dialog.viewer { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border-radius: 0; background: #0b1626; color: #fff; }
.vw-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: #0c2a4b; }
.vw-bar button { background: #13233a; color: #fff; border-color: #22354f; padding: 8px 14px; font-weight: 600; }
.vw-no { flex: 1; text-align: center; font-size: 0.9rem; }
.vw-scroll { overflow: auto; height: calc(100% - 56px); touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
.vw-scroll img, .vw-scroll canvas { display: block; height: auto; background: #fff; }
[hidden] { display: none !important; }
.notice.ok { background: var(--mint); color: var(--mint-ink); }
@media (prefers-color-scheme: dark) { .notice.ok { background: #1d3a2a; color: #cfe3d2; } }

/* app-4: worked sum under a failed figure check */
.rv-sum { border: 1px dashed var(--line); border-radius: 12px; padding: 6px 12px; margin: 0 0 12px; }
.rv-sum .sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.rv-sum .sumrow.line { border-top: 1px solid var(--line); }
.rv-sum .sumrow.bad { color: #7a2e1b; font-weight: 700; }
@media (prefers-color-scheme: dark) { .rv-sum .sumrow.bad { color: #f6d3c8; } }

/* ── app-5 (29 Oct 2026): inbox ── */
.inbox-card { border-left-color: var(--navy); }
.inbox-card h2 { font-size: 1.25rem; margin-bottom: 2px; }
.inbox-card button.secondary { margin-bottom: 0; }
.ib-tabs { display: flex; gap: 8px; margin: 4px 0 10px; }
.ib-tab { flex: 1; border-radius: 999px; font-weight: 600; padding: 10px; }
.ib-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .ib-tab.on { background: var(--mint); color: #0b1626; border-color: var(--mint); } }
.ib-list { list-style: none; padding: 0; margin: 4px 0 8px; }
.ib-item { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 12px 0; }
.ib-item.unread { cursor: pointer; }
.ib-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; }
.ib-dot.blue { background: #2f6fd0; }
.ib-dot.red { background: var(--coral-2); }
.ib-dot.read { background: transparent; border: 2px solid var(--line); }
.ib-body { display: block; min-width: 0; }
.ib-body .what { display: block; font-weight: 700; }
.ib-item:not(.unread) .what { font-weight: 500; }
.ib-text { display: block; margin: 2px 0 2px; overflow-wrap: anywhere; }
.ib-body .state { display: block; font-size: 0.85rem; color: var(--muted); }
.ib-body .state.bad { color: var(--coral-2); }
.ib-more { padding: 8px 0; border: 0; }
.roles .jobtitle { display: block; font-size: 0.85rem; color: var(--muted); }

/* ── app-6 (29 Oct 2026): waiting rows that open their review card (N132) ── */
.doc-list li.tap { cursor: pointer; align-items: center; }
.doc-list li.tap:active { background: var(--bg); }
.doc-list .tap-go { flex: none; color: var(--navy); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .doc-list .tap-go { color: var(--mint); } }

/* ── app-7 (29 Oct 2026): navigation bar and the amber dot ── */
.ib-dot.amber { background: #d99a1d; }
body.has-tabs main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(19, 56, 98, 0.08); }
.tabbar[hidden] { display: none; }
.tabbar button { flex: 1 1 0; min-width: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 14px 4px 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px; border-top: 3px solid transparent; margin-top: -1px; }
.tabbar button[hidden] { display: none; }
.tabbar button.on { color: var(--navy); border-top-color: var(--navy); }
@media (prefers-color-scheme: dark) { .tabbar button.on { color: var(--mint); border-top-color: var(--mint); } }
.tab-n { background: var(--coral); color: #fff; border-radius: 999px; font-size: 0.75rem; line-height: 1; padding: 3px 7px; font-weight: 700; }
.tabbar .tab-n[hidden] { display: none; }

/* "Mark all as read": small, at the bottom of the list, needs a second tap (cannot be undone) */
button.markall { display: block; margin: 14px auto 4px; width: auto; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; font-size: 0.85rem; font-weight: 600; padding: 8px 16px; }
button.markall.armed { border-color: var(--coral-2); color: var(--coral-2); }

button.blockbtn { display: inline-block; margin: 8px 0 2px; width: auto; background: none; border: 1px solid var(--coral-2); color: var(--coral-2); border-radius: 999px; font-size: 0.85rem; font-weight: 600; padding: 7px 14px; }
button.blockbtn.armed, button.tt.armed { background: var(--coral-2); color: #fff; }
#s-newphone h2, #s-settings h2 { margin-top: 22px; }

/* ── app-9 (N150): greyed buttons, update notice ── */
button.blockbtn:disabled { opacity: 0.6; border-color: var(--line); color: var(--muted); background: none; cursor: default; }
.updbar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(19, 56, 98, 0.3); font-size: 0.9rem; }
.updbar[hidden] { display: none; }
.updbar button { width: auto; flex: none; background: #fff; color: var(--navy); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.ib-body .ib-text { white-space: pre-line; }   /* N150: manager cards may have short lines */

/* N154: if the page is still on "Loading..." after 15 seconds, this line appears by itself (no script needed). */
#s-loading .slow { opacity: 0; animation: slowin 0s linear 15s forwards; }
@keyframes slowin { to { opacity: 1; } }
#s-loading .rescue-btn { margin-top: 12px; }
/* N165: Hide for me, a quiet one-tap button on a read message */
button.hidebtn { display: inline-block; margin: 8px 0 2px; width: auto; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; font-size: 0.85rem; font-weight: 600; padding: 7px 14px; }

/* ── app-12 (N152): More, Team, the code for your manager ── */
.tabbar button#tab-more[hidden] { display: none; }
.more-scrim { position: fixed; inset: 0; z-index: 24; background: rgba(0, 0, 0, 0.3); }
.more-scrim[hidden], .more-sheet[hidden] { display: none; }
.more-sheet { position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 25; background: var(--card); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 8px 12px 12px; box-shadow: 0 -8px 24px rgba(19, 56, 98, 0.18); }
.more-sheet button { display: flex; width: 100%; align-items: center; justify-content: space-between; text-align: left; background: none; border: 0; color: var(--text);
  font-size: 1rem; font-weight: 600; padding: 16px 8px; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.more-sheet button:last-child { border-bottom: 0; }
.tm-list { list-style: none; margin: 0; padding: 0; }
.tm-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.tm-list li:first-child { border-top: 0; }
.tm-row { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.tm-row b { font-size: 1rem; }
.tm-sub { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.tm-badge { background: var(--mint); color: var(--mint-ink); border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.tm-code { margin-top: 8px; }
.tm-code input { text-transform: uppercase; letter-spacing: 0.15em; }
.tm-resp { font-size: 0.85rem; color: var(--text); margin: 6px 0; }
#tm-blocked { margin-bottom: 18px; }
.np-nw { margin: 18px 0; }
.np-nw summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.paircode { font-size: 2.2rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; margin: 10px 0; font-variant-numeric: tabular-nums; }

.tm-lost { display: inline-block; width: auto; margin: 6px 0 0; padding: 4px 0; font-size: 0.85rem; text-align: left; }
/* app-14: a sender sees a plain tile for each page, never the page (R14 addendum 10); hidden helper text for the PIN box */
.pages figure.plain { aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.pages .pagetile { color: var(--muted); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
