/* The ozowConnect look: Poppins, Ozow navy, teal and one green highlight, hard 4px edges and flat cards
   with a thin border. Light ("Salt") and dark ("Graphite and Teal") redefine the same tokens; the
   sidebar is navy in both. Light or dark follows the viewer's system unless they choose one
   (theme.js sets data-theme). Shared by the staff page and the merchant upload page. */
:root {
  color-scheme: light;
  --navy: #1E2330; --teal: #00B8AD; --green: #00E587;
  --bg: #F9F9F9; --surface: #FFFFFF; --surface-2: #F2F4F7; --text: #1E2330; --muted: #3F4A65;
  --border: #D9DDE3; --input: #D9DDE3;
  --pri: #1E2330; --pri-ink: #FFFFFF; --pri-hover: #2B3142;
  --hl-text: #00965A; --accent-soft: rgba(0, 229, 135, 0.16); --teal-soft: rgba(0, 184, 173, 0.10);
  --danger: #D62F36; --danger-soft: rgba(214, 47, 54, 0.08); --ring: rgba(0, 184, 173, 0.35);
  --top-bg: rgba(255, 255, 255, 0.94); --raised-shadow: 0 12px 32px rgba(30, 35, 48, 0.14);
  --radius: 4px; --side: 276px;
}
/* Dark appears twice: once for an explicit choice, once for the system setting when no choice overrides it. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12151C; --surface: #181C25; --surface-2: #1F2430; --text: #F4F5F7; --muted: #A6AEBF;
  --border: #2A3040; --input: #2A3040;
  --pri: #00B8AD; --pri-ink: #0A0B0C; --pri-hover: #1FCFC4;
  --hl-text: #00B8AD; --accent-soft: rgba(0, 229, 135, 0.13); --teal-soft: rgba(0, 184, 173, 0.13);
  --danger: #F87171; --danger-soft: rgba(248, 113, 113, 0.12); --ring: rgba(0, 184, 173, 0.45);
  --top-bg: rgba(18, 21, 28, 0.92); --raised-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12151C; --surface: #181C25; --surface-2: #1F2430; --text: #F4F5F7; --muted: #A6AEBF;
    --border: #2A3040; --input: #2A3040;
    --pri: #00B8AD; --pri-ink: #0A0B0C; --pri-hover: #1FCFC4;
    --hl-text: #00B8AD; --accent-soft: rgba(0, 229, 135, 0.13); --teal-soft: rgba(0, 184, 173, 0.13);
    --danger: #F87171; --danger-soft: rgba(248, 113, 113, 0.12); --ring: rgba(0, 184, 173, 0.45);
    --top-bg: rgba(18, 21, 28, 0.92); --raised-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

/* Poppins, self-hosted (SIL Open Font Licence, fonts/OFL.txt), so the page policy keeps font-src 'self'. */
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-latin-600-normal.woff2") format("woff2");
  font-weight: 600 900; font-style: normal; font-display: swap; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--muted); font: 400 14px/1.5 "Poppins", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); }
a { color: var(--text); text-decoration-color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* --- shell: navy sidebar with grouped sections, top bar, content ------------------------------ */

#app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden;
  color: #FFFFFF; background: linear-gradient(180deg, #232A3A 0%, #1A1F2B 100%); }
.brand { display: block; padding: 22px 18px 16px; text-decoration: none; }
.wm { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 21px; letter-spacing: -0.02em;
  line-height: 1; color: #FFFFFF; }
.wm i { font-style: normal; color: var(--green); margin-left: -8px; }
.tagl { display: block; margin-top: 8px; font-size: 11px; white-space: nowrap; color: rgba(255, 255, 255, 0.62); }
.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 12px; display: grid; align-content: start; gap: 2px; }
.nav-gl { margin: 16px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--teal); }
#tabs button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 0; padding: 9px 12px;
  border: 0; border-radius: var(--radius); background: transparent; color: rgba(255, 255, 255, 0.82); font-weight: 400;
  font-size: 13.5px; text-align: left; white-space: normal; }
#tabs button svg { flex: none; opacity: 0.85; }
#tabs button:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
#tabs button[aria-selected=true] { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; box-shadow: inset 3px 0 0 var(--green); }
#tabs button:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 3px; background: var(--green); color: var(--navy);
  font-size: 11px; font-weight: 600; text-align: center; }
.side-f { padding: 14px 18px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.look { display: grid; gap: 6px; }
.look > span { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.look-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; }
.look-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 0; padding: 6px 4px;
  border: 0; border-radius: 6px; background: transparent; color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 400; }
.look-seg button:hover { color: #FFFFFF; background: transparent; }
.look-seg button[aria-pressed=true] { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; box-shadow: inset 0 -2px 0 var(--green); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); }
.ic { display: inline-grid; place-items: center; color: var(--teal); }

/* --- signed out: the trust story beside the staff sign-in -------------------------------------- */

#signed-out { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100%; }
.trust { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 48px 56px; color: #FFFFFF;
  background: radial-gradient(120% 120% at 0% 0%, rgba(0, 229, 135, 0.18) 0%, rgba(0, 229, 135, 0) 55%), #1E2330; }
.wm-lg { font-size: 30px; }
.trust-tag { margin: 0; font-size: 20px; line-height: 1.4; color: #FFFFFF; max-width: 26ch; }
.trust-points { display: grid; gap: 14px; }
.trust-points li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; border: 0; background: transparent;
  color: rgba(255, 255, 255, 0.85); }
.trust-points .ic { color: var(--green); }
.trust-foot { margin: 0; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.signin-pane { display: grid; place-items: center; padding: 48px 24px; background: var(--bg); }
.signin-card { width: 100%; max-width: 380px; }
.signin-card h1 { margin: 6px 0 8px; font-size: 26px; font-weight: 500; color: var(--text); }
button.wide { width: 100%; margin: 18px 0 6px; }

.main { display: flex; flex-direction: column; min-width: 0; overflow-x: clip; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px;
  background: var(--top-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.crumb { margin: 0 auto 0 0; font-size: 14px; color: var(--muted); }
#section-title { color: var(--text); font-weight: 500; }
.brand-m { display: none; text-decoration: none; }
.brand-m .wm { color: var(--text); font-size: 18px; }
.find { width: 260px; }
.find input { min-height: 34px; }
.user-menu { position: relative; }
#who { display: inline-grid; place-items: center; min-height: 0; padding: 2px; border-radius: 50%;
  border-color: transparent; background: transparent; }
#who .avatar { width: 32px; height: 32px; }
#who:hover, #who[aria-expanded=true] { background: var(--surface-2); }
#user-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--green);
  border-radius: var(--radius); box-shadow: var(--raised-shadow); }
#user-name { margin: 8px 8px 0; font-weight: 500; color: var(--text); }
#user-menu .user-roles-heading { margin: 8px 8px 2px; }
#user-roles { margin: 0 8px 8px; }
#user-roles li { margin: 0; padding: 1px 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; }
#signout { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px; }
#signout:hover, #signout:focus-visible { background: var(--surface-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.initials { display: inline-grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--text); }

/* The merchant upload page has one page, so a slim navy bar replaces the sidebar. */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  background: radial-gradient(120% 220% at 0% 0%, rgba(0, 229, 135, 0.18) 0%, rgba(0, 229, 135, 0) 55%), #1E2330;
  color: #FFFFFF; }
.topbar .wm { font-size: 20px; margin-right: auto; }
.topbar #theme { color: rgba(255, 255, 255, 0.8); border-color: rgba(255, 255, 255, 0.2); }
.topbar #theme:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }

main { width: 100%; max-width: 1040px; padding: 30px 32px 96px; }
body > main { margin: 0 auto; }
#status { color: var(--muted); }
#status:empty { display: none; }
section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  margin-top: 16px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset; }
main > section:first-of-type, #status + section, main > [role=tabpanel] { margin-top: 0; }
#add-merchant-open { margin-top: 10px; }
h2, h3 { color: var(--text); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 24px 0 8px; }
.meta { color: var(--muted); opacity: 0.85; font-size: 12.5px; margin: 8px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.figure { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0 8px; }

/* --- forms ----------------------------------------------------------------------------------- */

label { display: block; margin: 18px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal); }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--input); border-radius: var(--radius); padding: 7px 11px; min-height: 38px;
  transition: border-color 0.15s, background-color 0.15s; }
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); background: var(--surface); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: none;
  accent-color: var(--teal); }
input[type=file] { padding: 5px; min-height: 0; cursor: pointer; background: var(--surface); }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 12px; margin-right: 10px; cursor: pointer; }
label.confirm, label:has(> input[type=radio]), li label { display: flex; gap: 10px; align-items: center; font-size: 13.5px;
  font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text); }

/* --- buttons --------------------------------------------------------------------------------- */

button { font: inherit; font-weight: 500; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 14px; min-height: 36px; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--pri); border-color: var(--pri); color: var(--pri-ink); font-weight: 600; padding: 8px 20px; }
button.primary:hover { background: var(--pri-hover); border-color: var(--pri-hover); }
form > button.primary, section > button.primary { margin-top: 20px; }
.top button { min-height: 32px; padding: 5px 12px; }
#theme { display: inline-grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0;
  color: var(--muted); border-color: var(--border); background: transparent; }

/* --- lists, checklists and cards ------------------------------------------------------------- */

ul { list-style: none; padding: 0; margin: 0; }
li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; }
li label { margin: 0; cursor: pointer; }
li:has(input[type=checkbox]:checked) { border-color: var(--green); background: var(--accent-soft); }
#checklist li { display: grid; gap: 10px; padding: 16px; border-top: 2px solid var(--green); }
#checklist li strong { font-weight: 500; color: var(--text); }

/* --- messages -------------------------------------------------------------------------------- */

.error, .ok { font-size: 13px; margin: 12px 0 0; }
.error:not(:empty) { color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--radius); padding: 9px 12px; }
.ok:not(:empty) { color: var(--hl-text); }
.error:empty, .ok:empty { display: none; }
.notice { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--teal); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0 0; }
.flag { display: inline-block; font-size: 11.5px; font-weight: 500; color: var(--text); background: transparent;
  border: 1px solid var(--muted); border-radius: 999px; padding: 0 9px; }
.flag.done { color: var(--hl-text); border-color: var(--green); }
.empty { color: var(--muted); margin: 16px 0 0; }

/* --- tables ---------------------------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td:first-child { white-space: nowrap; }
td input { min-width: 120px; }
td .row { flex-wrap: wrap; }
/* A table wider than its section scrolls inside it, never the whole page. */
section:has(> table), section > div:has(> table) { overflow-x: auto; }
td button { min-height: 30px; padding: 4px 12px; font-size: 13px; }

/* --- merchant picker ------------------------------------------------------------------------- */

.picker { position: relative; }
.picker [role=listbox] { position: absolute; z-index: 10; left: 0; right: 0; margin: 4px 0 0; padding: 4px; max-height: 280px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--green);
  border-radius: var(--radius); box-shadow: var(--raised-shadow); }
.picker [role=option], .picker .none { margin: 0; border: 0; padding: 8px 10px; background: transparent; color: var(--text); }
.picker [role=option] { cursor: pointer; }
.picker [role=option]:hover, .picker [role=option][aria-selected=true] { background: var(--surface-2); }
.picker .none { color: var(--muted); }

/* --- viewer ---------------------------------------------------------------------------------- */

#viewer { margin-top: 24px; }
#viewer .row { justify-content: space-between; }
#pages img { display: block; max-width: 100%; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius);
  user-select: none; }

/* --- FAQ ------------------------------------------------------------------------------------- */

details { border-bottom: 1px solid var(--border); }
details:last-of-type { border-bottom: 0; }
summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  cursor: pointer; padding: 14px 2px; font-weight: 500; color: var(--text); }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 7px; height: 7px; flex: none; border-right: 1.5px solid var(--teal);
  border-bottom: 1.5px solid var(--teal); transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
summary:hover { color: var(--teal); }
details p { margin: 0 2px 16px; color: var(--muted); line-height: 1.6; }
section h2:not(:first-child) { margin-top: 28px; }
.item-heading { justify-content: space-between; }
li .meta:empty { display: none; }

/* --- Home --------------------------------------------------------------------------------------- */

#home { background: transparent; border: 0; padding: 0; }
.greet { margin: 6px 0 18px; font-size: 24px; font-weight: 500; }
.home-search input { min-height: 52px; padding: 12px 16px; font-size: 15px; background: var(--surface); border-color: var(--text); }
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.task { display: grid; justify-items: start; align-content: start; gap: 8px; padding: 18px; text-align: left; white-space: normal;
  background: var(--surface); border: 1px solid var(--border); }
.task:hover { border-color: var(--teal); }
.task strong { font-size: 15px; font-weight: 500; color: var(--text); }
.task .meta { margin: 0; }
.task-ic { display: grid; place-items: center; width: 38px; height: 38px; background: var(--surface-2); color: var(--text); }
.go { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13.5px; }
.home-lower { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { margin: 0 0 8px; }
button.link { min-height: 0; padding: 0; border: 0; background: transparent; text-decoration: underline;
  text-decoration-color: var(--teal); text-underline-offset: 3px; font-weight: 400; }
.merchant-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; text-align: left;
  white-space: normal; }
.merchant-row:last-child { border-bottom: 0; }
.merchant-row strong { display: block; font-weight: 500; color: var(--text); }
.merchant-row .meta { margin: 0; }
.ini { display: grid; place-items: center; width: 34px; height: 34px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text); }
.waiting { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; width: 100%; margin: 8px 0;
  padding: 14px; text-align: left; white-space: normal; background: var(--surface); }
.waiting:hover { border-color: var(--teal); }
.waiting .n { font-size: 18px; color: var(--text); }
.flag.closed { color: var(--pri-ink); background: var(--pri); border-color: var(--pri); }

/* --- Request documents: links and reminders ------------------------------------------------- */

.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-panel { margin-top: 16px; border-left: 3px solid var(--teal); }
.action-panel h3 { margin-top: 0; }
#links-actions { margin-top: 12px; }

/* --- Approvals: tabs and asks for new links ------------------------------------------------- */

.seg { display: inline-flex; gap: 2px; margin: 12px 0 4px; padding: 2px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); }
.seg button { border: 0; background: transparent; min-height: 32px; }
.seg button[aria-pressed=true] { background: var(--surface); box-shadow: inset 0 -2px 0 var(--green); }
.ask { margin-top: 14px; }
.ask h3 { margin: 6px 0 4px; }
.still li { padding: 8px 12px; margin: 4px 0; }
.signin-card hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0 14px; }
.signin-card button.link { display: inline-flex; align-items: center; gap: 8px; }

/* --- Offboarding, document types, settings sections (slice D) ------------------------------ */

.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.holdings dl, .stage dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; }
.holdings dt { color: var(--muted); }
.holdings dd { margin: 0; color: var(--text); font-weight: 500; }
.timeline { list-style: none; margin: 18px 0 8px; padding: 0 0 0 18px; border-left: 2px solid var(--teal); }
.timeline li { display: grid; gap: 2px; margin: 0 0 14px; padding: 0; border: 0; background: transparent; }
.timeline strong { color: var(--text); font-weight: 500; }
#hold-details { margin-top: 18px; }
.type-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.type-row strong { display: block; font-weight: 500; color: var(--text); }
.type-row .meta { margin: 0; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100%); overflow-y: auto;
  padding: 24px; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--raised-shadow); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { margin: 0; }
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; margin-top: 16px; }
.settings-nav { display: grid; align-content: start; gap: 4px; }
.settings-nav button { text-align: left; border: 0; background: transparent; white-space: normal; }
.settings-nav button[aria-pressed=true] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--green); }
.templates { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; margin-top: 12px; }
.template-list { display: grid; align-content: start; gap: 2px; }
.template-list button { text-align: left; border: 0; background: transparent; white-space: normal; display: grid; }
.template-list button span { color: var(--muted); font-size: 12px; }
.template-list button[aria-pressed=true] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--green); }
.row.sp { justify-content: space-between; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-family: ui-monospace, monospace; font-size: 13px; padding: 4px 8px; }
.locked { background: var(--surface-2); border-left: 3px solid var(--teal); padding: 8px 12px; font-size: 13px; color: var(--muted); }
.email-preview { border: 1px solid var(--border); overflow-x: auto; background: #F2F4F7; }
#template-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100% - 32px); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); }
#template-dialog::backdrop { background: rgba(18, 21, 28, 0.6); }
#template-dialog-list h4 { margin: 20px 0 6px; }
.label-like { margin: 18px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal); }
#contacts-search { margin-top: 12px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; font-size: 15px; font-weight: 500; color: var(--text); }

/* --- Share documents ---------------------------------------------------------------------- */

.step { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.step h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text); }
.button-like { display: inline-flex; align-items: center; margin: 0; padding: 7px 14px; min-height: 36px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.summary { margin-top: 24px; border-left: 3px solid var(--green); }
.summary h3 { margin-top: 0; }
.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.merchant-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.merchant-head h3 { margin: 0; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.dcard { border: 1px solid var(--border); background: var(--surface); padding: 14px; display: grid; gap: 8px;
  align-content: start; }
.dcard h4 { margin: 0; font-size: 15px; font-weight: 500; }
.dcard .meta { margin: 0; }
.dcard button { width: 100%; }
.state { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: var(--radius); justify-self: start; }
.state.ready { background: var(--accent-soft); color: var(--hl-text); }
.state.waiting { background: var(--teal-soft); color: var(--text); }
.state.closed { background: var(--danger-soft); color: var(--danger); }
.state.notAsked { background: var(--surface-2); color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.stat-row > div { border: 1px solid var(--border); padding: 8px 12px; display: grid; }
.stat-row b { font-size: 20px; font-weight: 500; }
.timeline.how { margin: 8px 0 16px; }
.faq-group h3 { margin: 20px 0 8px; }
#share-contact-list li[aria-disabled=true] { color: var(--muted); cursor: not-allowed; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- How Vault works ---------------------------------------------------------------------------- */

.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 14px; }
.stage { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stage.held { border-color: var(--teal); background: var(--teal-soft); }
.stage-h { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; font-weight: 500; color: var(--text); }
.stage dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 14px 0 0; font-size: 13px; }
.stage dt { font-weight: 500; color: var(--text); }
.stage dd { margin: 0; }
.notice .ic { vertical-align: middle; margin-right: 6px; }
.stuck { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.stuck h3 { margin: 0; }
a.button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius);
  background: var(--pri); color: var(--pri-ink); text-decoration: none; font-weight: 600; }
a.button .ic { color: inherit; }

/* --- phone: bottom bar and More -------------------------------------------------------------- */

.bottom { display: none; }
.sheet { position: fixed; inset: 0 0 64px; z-index: 40; overflow-y: auto; padding: 20px 16px; background: var(--bg); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet .nav-gl { margin-left: 0; }
.more-item { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0; padding: 12px; text-align: left;
  background: var(--surface); }
#more-signout { margin-top: 20px; width: 100%; }

/* --- narrow screens: the sidebar gives way to the bottom bar and More --------------------------- */

@media (max-width: 860px) {
  #app { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; }
  .side { display: none; }
  .brand-m { display: inline-flex; margin-right: auto; }
  .crumb, .find { display: none; }
  .top, main { padding-left: 16px; padding-right: 16px; }
  .bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column;
    grid-auto-columns: 1fr; height: 64px; background: #1E2330; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .bottom button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 0; padding: 6px 2px;
    border: 0; border-radius: 0; background: transparent; color: rgba(255, 255, 255, 0.7); font-size: 11px; font-weight: 400; }
  .bottom button[aria-current=true] { color: var(--green); }
  #signed-out { grid-template-columns: minmax(0, 1fr); }
  .trust { padding: 32px 20px; gap: 16px; }
  .home-lower, .stages { grid-template-columns: minmax(0, 1fr); }
  .stuck { flex-direction: column; align-items: stretch; }
  .greet { font-size: 20px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { grid-auto-flow: column; overflow-x: auto; }
  .templates { grid-template-columns: minmax(0, 1fr); }
  .template-list { grid-auto-flow: column; overflow-x: auto; }
  .type-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .type-row .flag { display: none; }
}
