/*
  Dime Intercompany. One stylesheet. Visual reference: design/prototype.html.
  Rules for every screen (the full list is in CLAUDE.md, Design):
  - Colors, fonts, radii and shadows come from the tokens below. Nothing hardcoded in screen CSS.
  - Purple is for AI only (phase 8). Never anything else.
  - A status color always comes with a text label.
  - Small green text uses --green-dark. --green is for buttons, bars and large accents.
  - Playfair only for the auth headline, auth card title, topbar title, dashboard greeting and stat numbers.
  - No inline style attributes: the CSP is style-src 'self'.
*/

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('fonts/playfair-display-latin.woff2') format('woff2');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('fonts/playfair-display-italic-latin.woff2') format('woff2');
  font-weight: 700 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand */
  --green: #31A449;
  --green-dark: #27873C;
  --green-light: #EBF6ED;
  --green-mid: #C6E8CE;
  --black: #0D0D0D;
  --ink: #1A1A1A;
  --stone: #5A5A5A;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --bg: #F0F3F7;
  --surface: #FFFFFF;
  --border: #E5E5E5;
  --border-mid: #D1D5DB;
  --row-hover: #FAFBFA;
  --placeholder: #BDBDBD;

  /* Status */
  --red: #DC2626;
  --red-text: #B91C1C;
  --red-light: #FEF2F2;
  --red-mid: #FECACA;
  --amber: #F59E0B;
  --amber-text: #92400E;
  --amber-light: #FFFBEB;
  --amber-mid: #FDE68A;
  --blue: #3B82F6;
  --blue-text: #1E40AF;
  --blue-light: #EFF6FF;
  --blue-mid: #BFDBFE;

  /* AI only (phase 8) */
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --purple-mid: #DDD6FE;

  /* On the black auth panel and footer */
  --on-dark: #FFFFFF;
  --on-dark-sub: rgba(255, 255, 255, .5);
  --on-dark-strong: rgba(255, 255, 255, .6);
  --on-dark-faint: rgba(255, 255, 255, .35);
  --on-dark-footer: rgba(255, 255, 255, .3);
  --on-dark-rule: rgba(255, 255, 255, .12);
  --on-dark-hairline: rgba(255, 255, 255, .06);
  --glow: rgba(49, 164, 73, .10);

  /* Type */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', Arial, sans-serif;

  /* Shape */
  --r: 10px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --sh: 0 1px 3px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .05);
  --sh-md: 0 4px 16px rgba(0, 0, 0, .08), 0 1px 4px rgba(0, 0, 0, .04);
  --sh-auth: 0 4px 24px rgba(0, 0, 0, .06), 0 1px 4px rgba(0, 0, 0, .04);
  --sh-pill: 0 1px 2px rgba(0, 0, 0, .08);
  --focus: 0 0 0 3px rgba(49, 164, 73, .18);

  /* Layout */
  --sidebar-w: 244px;
  --topbar-h: 56px;
  --tabbar-h: 64px;
  --max: 1240px;

  color-scheme: light;
}

/* ============ Base ============ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--green-dark); }

img { display: block; max-width: 100%; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

[hidden] { display: none !important; }

svg.i {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.num { font-variant-numeric: tabular-nums; }

/* ============ Auth screens (login, MFA enroll, MFA verify, errors) ============ */

.auth { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--surface); }

.auth-brand {
  position: relative;
  width: 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 80px 116px;
  background: var(--black);
  overflow: hidden;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -160px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  pointer-events: none;
}

.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; }

.auth-logo { margin-bottom: 64px; }

.auth-logo img { width: 200px; height: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--green); }

.auth-headline {
  margin-bottom: 20px;
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: clamp(32px, 3.2vw, 48px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -1px;
}

.auth-headline em { font-style: italic; color: var(--green); }

.auth-sub { max-width: 380px; color: var(--on-dark-sub); font-size: 15px; line-height: 1.75; }

.auth-rule { width: 40px; height: 2px; margin: 40px 0; background: var(--on-dark-rule); }

.auth-trust { color: var(--on-dark-faint); font-size: 12px; font-weight: 500; }

.auth-trust strong { color: var(--on-dark-strong); font-weight: 600; }

.auth-form {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 64px 116px;
  overflow: hidden;
}

.auth-form::before {
  content: '';
  position: absolute;
  bottom: -120px;
  right: -100px;
  width: 360px;
  height: 360px;
  background: var(--green-light);
  border-radius: 50%;
  opacity: .55;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 44px 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-auth);
}

.auth-card-eyebrow {
  margin-bottom: 10px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.auth-card-title {
  margin-bottom: 28px;
  color: var(--black);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.5px;
}

.auth-card-sub { margin: -18px 0 24px; color: var(--muted); font-size: 13px; }

.auth-card-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-card-foot button { border: none; background: none; color: var(--stone); font-weight: 600; }

.auth-card-foot button:hover { color: var(--green-dark); }

.auth-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 10px 12px;
  background: var(--red-light);
  border: 1px solid var(--red-mid);
  border-radius: var(--r-sm);
  color: var(--red-text);
  font-size: 12px;
  font-weight: 500;
}

.auth-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 80px;
  background: var(--black);
  border-top: 1px solid var(--on-dark-hairline);
  color: var(--on-dark-footer);
  font-size: 11px;
}

.auth-footer-links { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.auth-footer-links a { display: flex; align-items: center; min-height: 40px; color: var(--on-dark-sub); text-decoration: none; }

.auth-footer-links a:hover { color: var(--on-dark); }

/* MFA enroll steps */

.steps { display: grid; gap: 20px; margin-bottom: 4px; list-style: none; counter-reset: step; }

.steps > li { display: grid; gap: 12px; counter-increment: step; }

.step-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

.step-title::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green-light);
  border: 1px solid var(--green-mid);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
}

.qr {
  justify-self: center;
  width: 168px;
  height: 168px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.secret {
  display: block;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 1px;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

/* ============ Forms ============ */

.field { margin-bottom: 18px; }

.label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 600; }

.hint { margin-top: 5px; color: var(--muted); font-size: 11px; }

.input-lg {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.input-lg:focus { border-color: var(--green); box-shadow: var(--focus); }

.input-lg::placeholder { color: var(--placeholder); }

.code-input {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.select, .input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.select:focus, .input:focus { border-color: var(--green); box-shadow: var(--focus); }

.input::placeholder { color: var(--muted); }

.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
}

.select.is-empty { color: var(--muted); border-style: dashed; border-color: var(--border-mid); }

.select:disabled, .input:disabled { background-color: var(--bg); cursor: default; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }

.form-grid .full { grid-column: 1 / -1; }

.input-pair { display: flex; gap: 8px; }

/* A pick QuickBooks no longer accepts: inactive, gone, or the wrong type. */
.select.is-invalid, .input.is-invalid { border-color: var(--red); }

.field-error { margin-top: 5px; color: var(--red-text); font-size: 11px; font-weight: 600; }

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.btn svg.i { width: 13px; height: 13px; stroke-width: 2.25; }

.btn-primary { background: var(--green); color: var(--surface); }

.btn-primary:hover:not(:disabled) { background: var(--green-dark); }

.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border); }

.btn-outline:hover:not(:disabled) { background: var(--bg); }

.btn-ghost { background: none; color: var(--stone); }

.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--ink); }

.btn-danger { background: var(--surface); color: var(--red-text); border-color: var(--red-mid); }

.btn-danger:hover:not(:disabled) { background: var(--red-light); }

.btn:disabled { opacity: .55; cursor: default; }

.btn-block {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  border: none;
  border-radius: var(--r-md);
  color: var(--surface);
  font-size: 15px;
  font-weight: 700;
  transition: background .2s, transform .15s;
}

.btn-block:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }

.btn-block:disabled { opacity: .55; cursor: default; }

.btn-block svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.link-btn {
  padding: 0;
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.link-btn:hover { text-decoration: underline; }

/* ============ App shell ============ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo img { width: 112px; height: auto; }

.sidebar-logo span { padding-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }

.nav-group { padding: 16px 10px 8px; }

.nav-label {
  margin-bottom: 4px;
  padding: 0 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--stone);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: background .12s, color .12s;
}

.nav-item:hover { background: var(--bg); color: var(--ink); }

.nav-item.active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  padding: 1px 7px;
  background: var(--amber-light);
  border: 1px solid var(--amber-mid);
  border-radius: var(--r-pill);
  color: var(--amber-text);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.sidebar-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--border); }

/* Sandbox or Live books. Always visible: sidebar on desktop, topbar on phone. */
.env-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: var(--r-sm);
  color: var(--blue-text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.env-chip::before { content: ''; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--blue); }

.env-chip.live { background: var(--green-light); border-color: var(--green-mid); color: var(--green-dark); }

.env-chip.live::before { background: var(--green); }

.sidebar-foot .env-chip { margin-bottom: 10px; }

.topbar .env-chip { display: none; padding: 4px 9px; border-radius: var(--r-pill); }

.user-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  text-align: left;
}

.user-row:hover { background: var(--bg); }

.user-meta { min-width: 0; }

.av {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--black);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.user-name { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-role { display: block; color: var(--muted); font-size: 11px; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 90;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--black);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  white-space: nowrap;
}

.topbar-title em { font-style: italic; color: var(--green); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.next-run {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--stone);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.next-run svg.i { width: 13px; height: 13px; }

.topbar-logo { display: none; }

.page { width: 100%; max-width: var(--max); padding: 24px 28px 64px; }

.greeting {
  margin-bottom: 2px;
  color: var(--black);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.greeting em { font-style: italic; color: var(--green); }

.page-sub { margin-bottom: 20px; color: var(--muted); font-size: 13px; }

/* Phone tab bar and More sheet, shown under 760px */
.tabbar, .more-sheet { display: none; }

/* ============ Components ============ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}

.card-head {
  min-height: 50px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  color: var(--stone);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.spacer { flex: 1; }

.count {
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--stone);
  font-size: 11px;
  font-weight: 700;
}

.card-body { padding: 16px; }

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  margin: 24px 0 10px;
  color: var(--stone);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-title:first-child { margin-top: 0; }

.page-note { margin-top: 12px; }

/* Cards stacked in the page without a section title between them. */
.page > .card + .card { margin-top: 16px; }

/* Filter pills: segmented track with counts inside */
.pills {
  max-width: 100%;
  display: flex;
  gap: 1px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow-x: auto;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--stone);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-pill); }

.pill .n { color: var(--muted); font-size: 11px; }

/* Status pills: always a text label with a dot. Color is never the only signal. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.st-ready, .st-posted { background: var(--green-light); color: var(--green-dark); border-color: var(--green-mid); }

.st-held { background: var(--amber-light); color: var(--amber-text); border-color: var(--amber-mid); }

.st-input { background: var(--blue-light); color: var(--blue-text); border-color: var(--blue-mid); }

.st-half { background: var(--red-light); color: var(--red-text); border-color: var(--red-mid); }

.st-new { background: var(--bg); color: var(--stone); border-color: var(--border); }

.st-ai { background: var(--purple-light); color: var(--purple); border-color: var(--purple-mid); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--stone);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip.hub { background: var(--black); border-color: var(--black); color: var(--surface); }

/* Avatars: entity is green-light, the hub is black, merchants are neutral */
.ent-av, .merch-av {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-weight: 700;
}

.ent-av { width: 36px; height: 36px; background: var(--green-light); border: 1px solid var(--green-mid); color: var(--green-dark); font-size: 11px; }

.ent-av.hub { background: var(--black); border-color: var(--black); color: var(--surface); }

.merch-av { width: 34px; height: 34px; background: var(--bg); border: 1px solid var(--border); color: var(--stone); font-size: 12px; }

/* Segmented toggle: Auto-post and Name on each line */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }

.seg.fill { display: flex; }

.seg.fill button { flex: 1; }

.seg button { padding: 6px 11px; background: transparent; border: none; color: var(--stone); font-size: 12px; font-weight: 600; white-space: nowrap; }

.seg button + button { border-left: 1px solid var(--border); }

.seg button.on { background: var(--green-light); color: var(--green-dark); }

.seg button.off-on { background: var(--amber-light); color: var(--amber-text); }

.seg button.ai { color: var(--purple); opacity: .6; cursor: not-allowed; }

/* Alerts: title, one sentence of what happened, one action */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: var(--r);
}

.alert svg.i { width: 18px; height: 18px; margin-top: 1px; }

.alert-title { font-size: 13px; font-weight: 700; }

.alert-desc { margin-top: 2px; font-size: 12px; }

.alert .btn { margin-left: auto; flex-shrink: 0; }

.alert-red { background: var(--red-light); border-color: var(--red-mid); color: var(--red-text); }

.alert-amber { background: var(--amber-light); border-color: var(--amber-mid); color: var(--amber-text); }

/* Empty state: what is missing and what to do next */
.empty { padding: 32px 20px; text-align: center; }

.empty-title { margin-bottom: 4px; color: var(--stone); font-size: 14px; font-weight: 600; }

.empty-desc { max-width: 36rem; margin: 0 auto; color: var(--muted); font-size: 13px; }

.empty .btn { margin-top: 14px; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  max-width: calc(100vw - 48px);
  padding: 10px 18px;
  background: var(--ink);
  border-radius: var(--r-sm);
  color: var(--surface);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: none; }

/* Rows: the list item used on every screen */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }

.row:last-child { border-bottom: none; }

.row.click { cursor: pointer; }

a.row { color: inherit; text-decoration: none; }

.row.click:hover { background: var(--row-hover); }

.row-main { flex: 1; min-width: 0; }

.row-title { color: var(--ink); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-sub { margin-top: 1px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-amt { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.row-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.age { color: var(--faint); font-size: 11px; white-space: nowrap; }

.age.old { color: var(--amber-text); font-weight: 600; }

/* ============ Dashboard ============ */

.stat-banner {
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}

.stat {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  border-top: 3px solid transparent;
  text-align: left;
}

.stat:last-child { border-right: none; }

a.stat { color: inherit; text-decoration: none; }

a.stat:hover { background: var(--row-hover); }

/* Lining figures: Playfair defaults to old-style, where 0 reads as a lowercase o. */
.stat-num { color: var(--ink); font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }

.stat-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 12px; }

.stat.t-amber { border-top-color: var(--amber); }

.stat.t-blue { border-top-color: var(--blue); }

.stat.t-green { border-top-color: var(--green); }

.stat.t-ink { border-top-color: var(--ink); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

.col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.tie { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }

.tie:last-child { border-bottom: none; }

.tie-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }

.tie-amt { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* An entry the tie-out flagged, under its company, with the Changed in QuickBooks note. */
.tie-entry { padding-left: 28px; background: var(--bg); }

.tie-entry.is-open { flex-wrap: wrap; }

.ack-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

.ack-label { flex-basis: 100%; color: var(--stone); font-size: 12px; font-weight: 600; }

.ack-form .input { flex: 1 1 240px; }

.ack-form .field-error { flex-basis: 100%; margin-top: 0; }

/* ============ Inbox ============ */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }

.toolbar .search { max-width: 320px; }

.pull-info { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }

.pull-info strong { color: var(--ink); font-weight: 600; }

.txn {
  display: grid;
  grid-template-columns: 34px minmax(130px, 1.3fr) 84px minmax(130px, 1fr) minmax(150px, 1.3fr) 96px 172px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.txn:last-child { border-bottom: none; }

.txn > :nth-child(2) { min-width: 0; }

.txn .amt { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.txn .reason { margin-top: 2px; color: var(--amber-text); font-size: 11px; font-weight: 600; }

.txn .reason.blue { color: var(--blue-text); }

.txn .reason.red { color: var(--red-text); }

.txn .reason.muted { color: var(--muted); font-weight: 500; }

.txn .reason:empty { display: none; }

/* Read-only entity and account in an Inbox row */
.cell-text { display: block; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.cell-text.is-empty { color: var(--muted); }

.txn-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.txn .select { width: 100%; }

/* "Use for future charges" under the entity select */
.check { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--stone); font-size: 12px; font-weight: 500; cursor: pointer; }

.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }

.check[hidden] { display: none; }

/* A row's inline panel: Post now confirm, hold reason, acknowledge note, refund original */
.txn-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--r-sm);
}

.txn-panel[hidden] { display: none; }

.txn-panel .ack-form { flex: 1 1 100%; margin-top: 0; }

.panel-text { flex: 1 1 280px; color: var(--ink); font-size: 13px; }

.panel-list { display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; }

.panel-list .btn { justify-content: flex-start; }

.group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  row-gap: 2px;
  color: var(--stone);
  font-size: 11px;
  font-weight: 700;
}

.group-label .hint { margin-top: 0; font-weight: 500; }

.group-label .link-btn { margin-left: auto; min-width: 40px; font-size: 12px; }

/* Table header rows for .txn, .map and .run grids */
.txn.head, .map.head, .run.head {
  padding-top: 9px;
  padding-bottom: 9px;
  background: var(--bg);
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.head .right { text-align: right; }

/* Labels above each select, shown only when grid rows stack */
.lbl-m { display: none; }

/* ============ Mappings ============ */

.map {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1.3fr) minmax(150px, 1fr) 250px minmax(170px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.map:last-child { border-bottom: none; }

.acct-list { display: flex; flex-direction: column; gap: 3px; color: var(--stone); font-size: 12px; }

.acct-list b { color: var(--ink); font-weight: 600; }

.acct-list .field-error { margin-top: 0; }

.acct-list .link-btn { align-self: flex-start; margin-top: 2px; }

.acct-missing { color: var(--blue-text); font-weight: 600; }

.map-merchant { min-width: 0; }

.map .row-sub { white-space: normal; }

/* Opened under a row: the vendor name and one account select per entity. */
.map > .map-detail {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.map-detail[hidden] { display: none; }

.map-name-field { max-width: 420px; }

.map-account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }

.map-account-grid .select { width: 100%; }

/* Import preview */
.import-summary { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--stone); font-size: 13px; }

.import-card .row-sub { min-width: 0; }

.import-card { margin-bottom: 16px; }

.import-list { max-height: 480px; overflow-y: auto; }

.imp {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1.1fr) minmax(110px, 1fr) 70px minmax(140px, 1.2fr) minmax(200px, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--stone);
}

.imp:last-child { border-bottom: none; }

.imp.head {
  padding-top: 9px;
  padding-bottom: 9px;
  background: var(--bg);
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.imp-n { color: var(--faint); font-variant-numeric: tabular-nums; }

.imp-merchant { min-width: 0; }

.imp-message { margin-top: 3px; color: var(--muted); font-size: 11px; }

.imp-message.is-error { color: var(--red-text); font-weight: 600; }

/* ============ Setup and Connections ============ */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.co-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }

.co-head > div:nth-child(2) { flex: 1; min-width: 0; }

.co-name { font-size: 14px; font-weight: 700; }

.co-sub { color: var(--muted); font-size: 12px; }

.conn { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }

.conn:last-child { border-bottom: none; }

.conn .row-main { min-width: 160px; }

.conn .row-sub { white-space: normal; }

/* Account picker: a checkbox list under a connection. The whole row is the label, so the
   tap target is the row, not the box. Disabled rows are listed but cannot be picked. */
.picks { border-top: 1px solid var(--border); padding: 12px 16px 4px; }

.picks-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }

.picks-title { color: var(--stone); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.picks-head .hint { margin-top: 0; }

.pick { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-sm); cursor: pointer; }

.pick:hover { background: var(--bg); }

.pick input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--green); cursor: pointer; }

.pick input:focus-visible { box-shadow: var(--focus); }

.pick .row-main { flex: 1; min-width: 0; }

.pick .row-sub { white-space: normal; }

.pick.is-off { cursor: default; }

.pick.is-off:hover { background: transparent; }

.pick.is-off .row-title { color: var(--muted); font-weight: 500; }

.pick.is-off input { cursor: default; }

.pick .status { flex: none; }

.group-note { padding: 9px 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }

/* ============ History ============ */

.run {
  display: grid;
  grid-template-columns: 150px 1fr 110px 120px 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.run:last-child { border-bottom: none; }

/* A run row opens its details: every row it wrote, with links into QuickBooks. */
.run.click { width: 100%; min-height: 56px; background: none; border: none; border-bottom: 1px solid var(--border); color: inherit; font: inherit; text-align: left; cursor: pointer; }

.run.click:hover { background: var(--row-hover); }

.run .right { text-align: right; }

.run .status { justify-self: start; }

.run-events { background: var(--bg); border-bottom: 1px solid var(--border); }

.run-events .row { padding-left: 28px; }

.run-events .group-note { padding-left: 28px; }

.row-sub.wrap { white-space: normal; }

.row-links { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 2px; }

.row-links .link-btn { min-height: 40px; display: inline-flex; align-items: center; font-size: 12px; }

/* Buttons at the end of a row: an email History cannot vouch for (Mark as received, Resend). */
.row-actions { flex-shrink: 0; display: flex; gap: 8px; }

/* ============ Style guide page only ============ */

.guide-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.guide-auth { position: relative; display: flex; min-height: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }

.guide-auth .auth-brand, .guide-auth .auth-form { padding: 48px 40px; }

.swatch { width: 120px; display: grid; gap: 4px; font-size: 11px; color: var(--stone); }

.swatch span:first-child { height: 48px; border: 1px solid var(--border); border-radius: var(--r-sm); }

.sw-green { background: var(--green); }
.sw-green-dark { background: var(--green-dark); }
.sw-green-light { background: var(--green-light); }
.sw-green-mid { background: var(--green-mid); }
.sw-black { background: var(--black); }
.sw-ink { background: var(--ink); }
.sw-stone { background: var(--stone); }
.sw-muted { background: var(--muted); }
.sw-faint { background: var(--faint); }
.sw-bg { background: var(--bg); }
.sw-surface { background: var(--surface); }
.sw-border { background: var(--border); }
.sw-amber { background: var(--amber); }
.sw-blue { background: var(--blue); }
.sw-red { background: var(--red); }
.sw-purple { background: var(--purple); }

/* ============ Responsive ============ */

/* ============ Privacy and terms pages ============ */

.doc-body { background: var(--surface); }

.doc-top {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.doc-logo { display: flex; align-items: center; min-height: 40px; }

.doc-logo img { width: 112px; height: auto; }

.doc-nav { display: flex; gap: 4px; margin-left: auto; }

.doc-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--stone);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.doc-nav a:hover { background: var(--bg); color: var(--ink); }

.doc-nav a[aria-current="page"] { background: var(--green-light); color: var(--green-dark); }

.doc { max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; color: var(--ink); font-size: 15px; line-height: 1.7; }

.doc-eyebrow { margin-bottom: 12px; color: var(--green-dark); }

.doc-eyebrow::before { background: var(--green); }

.doc-title { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }

.doc-meta { margin: 8px 0 8px; color: var(--muted); font-size: 13px; }

.doc h2 { margin: 32px 0 8px; font-size: 17px; font-weight: 700; }

.doc p, .doc ul { margin-bottom: 12px; }

.doc ul { padding-left: 22px; }

.doc li { margin-bottom: 6px; }

.doc-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.doc-foot a { display: flex; align-items: center; min-height: 40px; margin-left: auto; color: var(--stone); font-weight: 600; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }

  .txn { grid-template-columns: 34px minmax(0, 1fr) 90px; row-gap: 10px; }
  .txn.head { display: none; }
  .txn .c-entity, .txn .c-acct { grid-column: 2 / 4; }
  .txn .c-status { grid-column: 2 / 3; }
  .txn .c-actions { grid-column: 3 / 4; }
  .txn .c-status, .txn .c-actions { align-self: center; }

  .lbl-m {
    display: block;
    margin-bottom: 4px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .map { grid-template-columns: 34px minmax(0, 1fr); row-gap: 10px; }
  .map.head { display: none; }
  .map > *:nth-child(n+3) { grid-column: 2 / 3; }
  .map > .map-detail { grid-column: 1 / -1; }

  .imp { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .imp.head { display: none; }
  .imp-n { display: none; }
  .imp-merchant { grid-column: 1 / 2; }
  .imp-result { grid-column: 1 / -1; grid-row: 3; }
  .imp-entity, .imp-auto, .imp-account { grid-column: 1 / -1; }
  .imp-entity:empty, .imp-auto:empty, .imp-account:empty { display: none; }

  .run { grid-template-columns: 1fr auto; }
  .run-events .row, .run-events .group-note { padding-left: 16px; }
  .run-events .row, .hist-half-list .row { flex-wrap: wrap; }
  .run.head { display: none; }
  .run > .r-hide { display: none; }
}

@media (max-width: 900px) {
  .auth { flex-direction: column; }
  .auth-brand { width: 100%; padding: 44px 28px 40px; }
  .auth-sub, .auth-rule, .auth-trust { display: none; }
  .auth-logo { margin-bottom: 32px; }
  .auth-logo img { width: 150px; }
  .auth-form { padding: 36px 20px 88px; }
  .auth-form::before { display: none; }
  .auth-card { padding: 32px 24px 28px; }
  .auth-footer { padding: 0 20px; }
  .auth-footer-links > span { display: none; }

  .grid-2, .form-grid { grid-template-columns: 1fr; }

  .guide-auth { flex-direction: column; }
  .guide-auth .auth-brand { width: 100%; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }

  .main { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }

  .topbar { left: 0; padding: 0 16px; }
  .topbar-logo { display: flex; align-items: center; min-height: 40px; flex-shrink: 0; }
  .topbar-logo img { width: 64px; height: auto; }
  .topbar-title { font-size: 17px; }
  .topbar-title .lead { display: none; }
  .topbar .env-chip { display: flex; }
  .topbar .next-run, .topbar .av { display: none; }

  .page { padding: 18px 16px 32px; }

  .hist-emails .row { flex-wrap: wrap; }
  .row-actions { width: 100%; }
  .row-actions .btn { flex: 1; min-height: 44px; }
  .greeting { font-size: 22px; }

  .stat-banner { display: grid; grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(n+3) { border-bottom: none; }
  .stat-num { font-size: 24px; }

  .toolbar .btn-primary { flex: 1; min-height: 44px; font-size: 14px; }
  .toolbar .search { max-width: none; }
  .btn, .txn .select, .map .select { min-height: 40px; }
  /* Actions get their own row under the selects, full width, within a thumb's reach. */
  .txn .c-status { grid-column: 2 / 4; }
  .txn .c-actions { grid-column: 1 / -1; }
  .txn-actions:has(.btn) { justify-content: stretch; }
  .txn-actions .btn { flex: 1 1 0; min-height: 44px; }
  .txn-actions .age:empty { display: none; }
  .txn-panel .btn { flex: 1 1 0; min-height: 44px; }
  .panel-list .btn { flex: none; }
  .check { min-height: 40px; margin-top: 2px; }
  .check input { width: 20px; height: 20px; }
  .map .select, .map .seg { width: 100%; }
  .map .seg { display: flex; }
  .map .seg button { flex: 1; }
  .map .link-btn { min-height: 40px; }
  .card-head .link-btn { display: inline-flex; align-items: center; min-height: 40px; }
  .group-label .link-btn { display: inline-flex; align-items: center; min-height: 40px; }
  .map-account-grid { grid-template-columns: 1fr; }
  .map > .map-detail { padding: 12px; }
  .import-card .card-head .btn { flex: 1; }
  .toolbar .map-export, .toolbar .map-import { flex: 1; }
  .conn .btn { flex: 1; }

  .tie-entry { flex-wrap: wrap; padding-left: 16px; }

  .tie-entry > .btn { flex: 1 1 100%; }

  .ack-form .btn { flex: 1; }
  .conn .seg { flex-basis: 100%; display: flex; }
  .conn .seg button { flex: 1; }
  .seg button { min-height: 40px; }
  .pill { min-height: 40px; }

  /* 16px or more stops iOS zooming into a focused field */
  .input, .select, .input-lg { font-size: 16px; }
  .input, .select { height: 40px; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    display: flex;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
  }

  .tab svg.i { width: 21px; height: 21px; }

  .tab.active { color: var(--green-dark); }

  .tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 2px;
    background: var(--green);
    border-radius: 0 0 2px 2px;
  }

  .tab .dot {
    position: absolute;
    top: 8px;
    left: calc(50% + 6px);
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    background: var(--amber);
    border: 2px solid var(--surface);
    border-radius: 9px;
    color: var(--black);
    font-size: 10px;
    font-weight: 700;
  }

  .more-sheet.open {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
    z-index: 210;
    display: block;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh-md);
  }

  .more-sheet .nav-item { padding: 13px 12px; font-size: 14px; }

  .toast { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 16px); max-width: none; }
}

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