/* ==========================================================================
   Maizodev Documents — design system
   Palette 1b "Rich emerald" (locked 2026-12-02). One accent, used sparingly.
   Mobile-first, RTL by default (dir is set on <html>).
   ========================================================================== */

:root {
  /* brand */
  --primary: #00775a;
  --primary-press: #00634a;
  --deep: #003d2c;
  --secondary: #22a07c;
  --gold: #d4a72c;
  --gold-ink: #8a6410;
  --bg: #f2f7f5;
  --surface: #ffffff;
  --text: #10241c;
  --muted: #5b6e66;
  --line: #d8e4de;
  --line-soft: #e8f0ec;
  --chip: #d6efe6;
  --light: #8fd9c2;

  /* status */
  --ok: #1e7a46;
  --ok-bg: #e6f4ec;
  --warn: #a85b00;
  --warn-bg: #fdf1df;
  --bad: #b00020;
  --bad-bg: #fcecef;
  --lost-bg: #e7ece9;

  /* shape */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --shadow-1: 0 1px 2px rgba(16, 36, 28, 0.05), 0 1px 3px rgba(16, 36, 28, 0.04);
  --shadow-2: 0 2px 6px rgba(16, 36, 28, 0.06), 0 12px 28px rgba(16, 36, 28, 0.07);
  --shadow-3: 0 18px 48px rgba(0, 61, 44, 0.18);

  /* surfaces that were hardcoded, so a dark theme can move them */
  --on-primary: #ffffff;
  --glass-top: rgba(242, 247, 245, 0.86);
  --glass-tab: rgba(255, 255, 255, 0.92);
  --placeholder: #93a49d;
  --switch-knob: #ffffff;
  --banner-line: #d3ddd8;
  --badge-ring: #ffffff;
  --note-warn-line: #f0dcc0;
  --note-warn-bg: #fdf8f0;
  --hero-cta-bg: #ffffff;
  --hero-cta-ink: #003d2c;
  --toast-bg: #10241c;
  --toast-ink: #ffffff;

  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}


/* ---------- dark theme ----------
   Chosen in Settings, or followed from the system. Same palette, rebalanced:
   the emerald stays the accent, the page goes near-black green, and text
   colours are lifted so nothing drops below readable contrast. */
[data-theme="dark"] {
  --primary: #34b48f;
  --primary-press: #2a9c7b;
  --deep: #a9e8d3;
  --secondary: #2bbd94;
  --gold: #e3b845;
  --gold-ink: #f0cf7a;
  --bg: #0c1512;
  --surface: #16211d;
  --text: #e8f2ed;
  --muted: #9db3ab;
  --line: #26332e;
  --line-soft: #1d2a25;
  --chip: #17372e;
  --light: #8fd9c2;

  --ok: #57cf90;
  --ok-bg: #12291f;
  --warn: #e6ac62;
  --warn-bg: #2a2114;
  --bad: #ff8b9b;
  --bad-bg: #2b151a;
  --lost-bg: #1b2521;

  --on-primary: #04150f;
  --glass-top: rgba(12, 21, 18, 0.86);
  --glass-tab: rgba(22, 33, 29, 0.94);
  --placeholder: #6f857d;
  --switch-knob: #e8f2ed;
  --banner-line: #2b3a34;
  --badge-ring: #0c1512;
  --note-warn-line: #4a3a1f;
  --note-warn-bg: #221a0f;
  --hero-cta-bg: rgba(255, 255, 255, 0.14);
  --hero-cta-ink: #eafff7;
  --toast-bg: #24332d;
  --toast-ink: #f2f8f5;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.45), 0 12px 28px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* In dark mode a drop shadow is nearly invisible but still rasterised for
 * every card on the screen; a hairline border reads better and costs nothing. */
[data-theme="dark"] .doc-card,
[data-theme="dark"] .card {
  box-shadow: none;
  border: 1px solid var(--line);
}

[data-theme="dark"] .hero {
  background: linear-gradient(160deg, #0b3a2c 0%, #072520 78%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .hero.is-calm { background: linear-gradient(160deg, #0d4233 0%, #082b22 80%); }
[data-theme="dark"] .wordmark { color: var(--deep); }
[data-theme="dark"] .lightbox { background: #050c0a; }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #16211d, #1d2a25, #16211d); background-size: 200% 100%; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  /* `overflow-x: hidden` on the root turns the root into a scroll container in
   * Chrome, and on Android that is a known way to end up with a document that
   * reports room to scroll but does not move under a finger. `clip` cuts the
   * same overflow without creating a scroller. */
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Plex Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* `text-rendering: optimizeLegibility` was here. With Arabic text it turns on
   * per-glyph kerning and ligature work on every layout pass, and the first
   * paint of a screen was spending 120-450ms in style and layout because of it.
   * The default is what the font was designed for. */
}

/* Chrome's own pull-to-refresh is suppressed on the ROOT scroller. Putting
 * this on body instead left the document in a state where a drag at the top
 * could be swallowed whole. */
html { overscroll-behavior-y: none; }

button, input, select, textarea { font: inherit; color: inherit; }
/* Android Chrome zooms the page when a control is focused below 16px and stays
   zoomed, which leaves the fixed tab bar wider than the visible screen. */
input, select, textarea { font-size: max(16px, 1em); }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--primary); text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--chip); }

/* ---------- app shell ---------- */

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 16px;
  /* A blur here has to be recomputed over the scrolling content on every
   * frame; on an Android phone that alone makes the page feel stuck. Solid
   * paint instead, same colour, no per-frame compositing. */
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar .brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar .brand .mark { width: 22px; height: 22px; color: var(--deep); flex: none; }
.topbar .brand .mark .flag { color: var(--gold); }

.wordmark {
  font-family: "Maizo Serif", Georgia, serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--deep);
  display: inline-flex;
  align-items: baseline;
  direction: ltr;
}
.wordmark .dev { font-weight: 300; color: var(--primary); }

.topbar .titles { flex: 1; min-width: 0; }
.topbar h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

/* home: company on the physical left, product name on the physical right —
   the same sides in Arabic and in English, so the header never mirrors */
.topbar.branded { direction: ltr; }
.topbar.branded .app-ident {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
  direction: rtl;
}
.topbar.branded h1 {
  font-size: 21px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  flex: none;
}
.topbar.branded .app-alt {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  direction: ltr;
  white-space: nowrap;
  flex: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text);
  flex: none;
}
.icon-btn:active { background: var(--line-soft); }
.icon-btn svg { width: 22px; height: 22px; }

.screen {
  padding: 8px 16px calc(var(--tab-h) + var(--safe-b) + 40px);
  min-height: calc(100dvh - 60px);
  animation: fade 0.18s ease;
}
.screen.no-tabs { padding-bottom: 40px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  inset-inline: 0;
  z-index: 40;
  width: auto;
  max-width: min(520px, 100vw);
  margin: 0 auto;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 0 2px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  position: relative;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.tabbar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}
.tabbar .badge {
  position: absolute;
  top: 6px;
  inset-inline-end: calc(50% - 22px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bad);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--badge-ring);
}

.fab {
  position: fixed;
  z-index: 41;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  inset-inline-end: max(16px, calc(50% - 260px + 16px));
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 119, 90, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab:active { transform: scale(0.94); box-shadow: 0 4px 12px rgba(0, 119, 90, 0.3); }
.fab svg { width: 26px; height: 26px; }

/* ---------- typography ---------- */

.sec-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 2px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.sec-title .more { font-size: 12px; font-weight: 600; color: var(--primary); }

h2.page-title { font-size: 24px; font-weight: 700; margin: 6px 2px 2px; letter-spacing: -0.01em; }
p.lede { margin: 0 2px 16px; color: var(--muted); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 16px;
}
.card + .card { margin-top: 10px; }
/* Secondary line inside a card. A bare .hint only picked up the small muted
 * style when it sat inside a .field, so the lines under the phone-alerts card
 * (next alert, the 9-1 line, the server note) were rendering at body size and
 * body colour. */
.card .hint { font-size: 12px; line-height: 1.5; color: var(--muted); }
.card.tight { padding: 0; overflow: hidden; }

/* Home: one quiet line when renewals are due but none of them has a known
 * cost, so there is nothing to add up. Reads as a line, not a card. */
.cost-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cost-line .ico { display: flex; flex: none; color: var(--primary); }
.cost-line .ico svg { width: 18px; height: 18px; }
.cost-line .txt { flex: 1; min-width: 0; }
.cost-line .chev { display: flex; flex: none; color: var(--placeholder); }
.cost-line .chev svg { width: 16px; height: 16px; }
.cost-line:active { background: var(--line-soft); }

/* home hero */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #00513d 0%, var(--deep) 78%);
  color: #fff;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(0, 61, 44, 0.22);
}
.hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -40px;
  top: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(143, 217, 194, 0.22), transparent 62%);
}
.hero .kicker { font-size: 12px; color: #b7e6d5; font-weight: 500; letter-spacing: 0.02em; }
.hero .big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 2px;
}
.hero .big b { font-size: 40px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.hero .big span { font-size: 15px; color: #d7f0e7; }
.hero .hint { font-size: 13px; color: #cfe9df; margin-top: 2px; }
.hero .hero-cta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--hero-cta-bg);
  color: var(--hero-cta-ink);
  font-size: 14px;
  font-weight: 600;
}
.hero .hero-cta svg { width: 16px; height: 16px; }
.hero.is-calm { background: linear-gradient(160deg, #0a6b52 0%, #00493a 80%); }
.hero .hero-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.hero .hero-ghost {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  color: #d7f0e7;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px 10px;
  box-shadow: var(--shadow-1);
  text-align: center;
}
.stat b { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.bad b { color: var(--bad); }
.stat.warn b { color: var(--warn); }
.stat.ok b { color: var(--ok); }

/* ---------- document card ---------- */

.doc-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  text-align: start;
  width: 100%;
  /* A row that is off screen is not rendered or decoded until it is scrolled
   * near: with 20 documents the phone was laying out every row on open. The
   * intrinsic size keeps the scrollbar honest before a row is rendered. */
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}
.doc-card + .doc-card { margin-top: 8px; }
.doc-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.doc-card[data-status="expired"]::before { background: var(--bad); }
.doc-card[data-status="soon"]::before { background: var(--gold); }
.doc-card[data-status="lost"]::before { background: var(--muted); }

.thumb {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  flex: none;
  background: var(--bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--primary);
  border: 1px solid var(--line-soft);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 24px; height: 24px; opacity: 0.75; }

.doc-card .body { flex: 1; min-width: 0; }
.doc-card .name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-card .meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.doc-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }
.doc-card .side { text-align: end; flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.expired { color: var(--bad); background: var(--bad-bg); }
.chip.soon { color: var(--warn); background: var(--warn-bg); }
.chip.valid { color: var(--ok); background: var(--ok-bg); }
.chip.lost { color: var(--text); background: var(--lost-bg); }
.chip.muted { color: var(--muted); background: var(--line-soft); }
.chip.count { height: 20px; padding: 0 7px; font-size: 11px; }

.days { font-size: 12px; color: var(--muted); margin-top: 5px; }
.days b { font-weight: 600; color: var(--text); }
.days.bad b { color: var(--bad); }
.days.warn b { color: var(--warn); }

/* validity bar */
.bar { height: 4px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.bar i.soon { background: var(--gold); }
.bar i.expired { background: var(--bad); }

/* ---------- filters ---------- */

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 16px 10px;
  margin: 0 -16px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

/* Reminder lead times: a checkbox grid, because more than one can be on at once.
 * Four columns keep all seven values inside the card with no horizontal scroll,
 * and each cell is a 44px tall tap target. */
.lead-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 0; }
.lead-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 44px;
  padding: 0 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}
.lead-cell .lead-box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  flex: none;
}
.lead-cell .lead-box svg { width: 12px; height: 12px; opacity: 0; }
.lead-cell[aria-checked="true"] { border-color: var(--primary); color: var(--text); font-weight: 600; }
.lead-cell[aria-checked="true"] .lead-box { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.lead-cell[aria-checked="true"] .lead-box svg { opacity: 1; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  margin: 4px 0 10px;
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font-size: 16px;
  min-width: 0;
}
.search input::placeholder { color: var(--placeholder); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn svg { width: 19px; height: 19px; }
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(0, 119, 90, 0.22); }
.btn-primary:active { background: var(--primary-press); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.sm { height: 40px; font-size: 13.5px; border-radius: 12px; padding: 0 14px; }

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

.form { display: grid; gap: 14px; }
/* A select keeps the intrinsic width of its longest option, and a grid item
   will not shrink below that by default: one long type name pushed the whole
   form wider than the phone, which widened the layout viewport and left the
   fixed tab bar hanging off both edges. */
.form > *, .field { min-width: 0; }
.field .input, .field select, .field textarea, .select-wrap { min-width: 0; max-width: 100%; }
.field select { width: 100%; }
.field label, .field .label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field .input, .field select, .field textarea {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
.field textarea { height: auto; min-height: 88px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.field .input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 90, 0.14);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field .hint.warn { color: var(--warn); }
.field.has-error .input, .field.has-error select { border-color: var(--bad); }
.field .err { font-size: 12px; color: var(--bad); margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-inline-end: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select { padding-inline-end: 38px; }

/* segmented control */
.segmented {
  display: flex;
  padding: 3px;
  gap: 3px;
  background: var(--line-soft);
  border-radius: 12px;
}
.segmented button {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

/* switch */
.row-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.row-switch + .row-switch { border-top: 1px solid var(--line-soft); }
.row-switch .txt { flex: 1; min-width: 0; }
.row-switch .txt b { display: block; font-size: 14.5px; font-weight: 600; }
.row-switch .txt span { font-size: 12.5px; color: var(--muted); }
.switch {
  width: 48px;
  height: 30px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  flex: none;
  transition: background 0.18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--switch-knob);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(-18px); }
[dir="ltr"] .switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ---------- photo ---------- */

.photo-picker {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed var(--line);
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.photo-picker.has-photo { border-style: solid; border-color: var(--line-soft); padding: 0; min-height: 0; }
.photo-picker img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-picker .pick-inner svg { width: 34px; height: 34px; color: var(--primary); margin-bottom: 8px; }
.photo-picker .pick-inner b { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.photo-picker .pick-inner span { font-size: 12.5px; }
.photo-picker input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-tools {
  position: absolute;
  inset-inline: 8px;
  bottom: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.photo-tools button {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(16, 36, 28, 0.72);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.photo-tools button svg { width: 15px; height: 15px; }

.photo-hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--deep);
  box-shadow: var(--shadow-2);
}
.photo-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 48vh;
  object-fit: contain;
  background: var(--deep);
}
/* the page strip and the view-photo pill share the row under the photo */
.photo-bar { display: flex; align-items: flex-start; gap: 10px; }
.photo-bar .pages-hero { flex: 1 1 auto; min-width: 0; }
.photo-bar .expand {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.photo-bar .expand svg { width: 15px; height: 15px; color: var(--primary); }
.photo-empty {
  border-radius: var(--r-lg);
  border: 1px dashed var(--line);
  background: var(--surface);
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.photo-empty svg { width: 30px; height: 30px; color: var(--line); margin: 0 auto 8px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #05100c;
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: fade 0.16s ease;
}
.lightbox .lb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  color: #fff;
}
.lightbox .lb-top .t { flex: 1; font-size: 14px; font-weight: 600; }
.lightbox .lb-top button { color: #fff; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.lightbox .lb-stage { display: grid; place-items: center; overflow: auto; padding: 0 8px; }
.lightbox .lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-foot {
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  color: #9db3ab;
  font-size: 12px;
  text-align: center;
}

/* ---------- detail rows ---------- */

.kv { display: grid; }
.kv .row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.kv .row:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); width: 42%; flex: none; font-size: 13px; }
.kv .v { flex: 1; font-weight: 500; text-align: start; word-break: break-word; }
.kv .v.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- sheet / dialog ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 24, 18, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.16s ease;
}
.sheet {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-3);
  animation: slide-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 92dvh;
  overflow-y: auto;
}
@keyframes slide-up { from { transform: translateY(18px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.sheet p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.sheet .sheet-actions { display: grid; gap: 8px; margin-top: 8px; }
.sheet .opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  text-align: start;
  font-size: 14.5px;
  font-weight: 500;
  background: var(--surface);
  width: 100%;
}
.sheet .opt svg { width: 20px; height: 20px; color: var(--primary); flex: none; }
.sheet .opt small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

.toast-root {
  position: fixed;
  inset-inline: 0;
  bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  z-index: 95;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 0 24px;
}
.toast {
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-size: 13.5px;
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  animation: toast-in 0.2s ease;
  max-width: 100%;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- empty state ---------- */

.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--muted);
}
.empty .art {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--primary);
  box-shadow: var(--shadow-1);
}
.empty .art svg { width: 34px; height: 34px; }
.empty b { display: block; color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { margin: 0 auto 18px; font-size: 13.5px; max-width: 280px; }

/* ---------- people ---------- */

.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  width: 100%;
  text-align: start;
}
.person-row + .person-row { margin-top: 8px; }
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  background: var(--chip);
  color: var(--primary);
  position: relative;
}
.avatar.me { background: var(--primary); color: var(--on-primary); }
.avatar .ring {
  position: absolute;
  inset-inline-end: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}
.person-row .body { flex: 1; min-width: 0; }
.person-row b { display: block; font-size: 15px; font-weight: 600; }
.person-row span { font-size: 12.5px; color: var(--muted); }
.person-row .chev { color: var(--line); flex: none; }
.person-row .chev svg { width: 18px; height: 18px; }

.person-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 4px; padding: 2px 16px 12px; scrollbar-width: none; }
.person-chips::-webkit-scrollbar { display: none; }
.pchip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.pchip .av { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--chip); color: var(--primary); }
.pchip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pchip[aria-pressed="true"] .av { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---------- lost / report ---------- */

.lost-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--lost-bg);
  border: 1px solid var(--banner-line);
}
.lost-banner svg { width: 22px; height: 22px; color: var(--text); flex: none; margin-top: 1px; }
.lost-banner b { display: block; font-size: 14.5px; }
.lost-banner span { font-size: 12.5px; color: var(--muted); }

.report {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-2);
}
.report .r-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--deep); }
.report .r-head .mark { width: 26px; height: 26px; color: var(--deep); }
.report .r-title { font-size: 17px; font-weight: 700; margin: 14px 0 2px; }
.report .r-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.report .r-photo { margin: 14px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.report .r-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.report .r-note { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; line-height: 1.6; }
.report .stamp {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--bad);
  border: 1.5px solid var(--bad);
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 0.04em;
  transform: rotate(-3deg);
}

/* ---------- misc ---------- */

.note {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  line-height: 1.6;
}
.note svg { width: 17px; height: 17px; flex: none; color: var(--primary); margin-top: 2px; }
.note.warn { border-color: var(--note-warn-line); background: var(--note-warn-bg); }
.note.warn svg { color: var(--warn); }

/* The once-a-month backup nudge on the home screen: a quiet card, not a
 * dialog, with one action and one way to put it off. */
.nudge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.nudge > .ic { flex: none; margin-top: 2px; }
.nudge > .ic svg { width: 20px; height: 20px; color: var(--primary); }
.nudge .grow { flex: 1; min-width: 0; }
.nudge b { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.nudge p { margin: 0 0 4px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.nudge .acts { display: flex; gap: 8px; margin-top: 8px; }
.nudge .acts .btn { width: auto; flex: none; }

.list-links { display: grid; }
.list-links .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  width: 100%;
  text-align: start;
  font-size: 14.5px;
}
/* Any row, wherever it sits, sizes its own icons. The rows in the phone-alerts
 * card are not inside .list-links, and an SVG with no size in a plain block
 * fills the width and renders hundreds of pixels tall. */
.row svg.lead { width: 20px; height: 20px; flex: none; }
.row svg.chev { width: 17px; height: 17px; flex: none; }

.list-links a.row { color: inherit; text-decoration: none; }
.list-links .row:last-child { border-bottom: 0; }
/* A row that destroys something, inside a normal list: red text and a red
 * icon, so it reads as dangerous without being a button that shouts. */
.list-links .row.danger { color: var(--bad); font-weight: 600; }
.list-links .row.danger svg.lead { color: var(--bad); }
.list-links .row.danger:active { background: var(--bad-bg); }
.list-links .row svg.lead { width: 20px; height: 20px; color: var(--primary); flex: none; }
.list-links .row .grow { flex: 1; min-width: 0; }
.list-links .row .grow span { display: block; font-size: 12px; color: var(--muted); }
.list-links .row .val { color: var(--muted); font-size: 13px; }
.list-links .row svg.chev { width: 17px; height: 17px; color: var(--line); flex: none; }
/* A row that leaves the app: the arrow carries the meaning, so it stays
 * readable instead of fading into the divider colour. */
.list-links .row svg.chev.ext { color: var(--muted); }

.brand-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 6px;
  color: var(--muted);
  font-size: 11.5px;
  opacity: 0.85;
}
.brand-foot .mark { width: 14px; height: 14px; color: var(--muted); }

/* copyright line under the brand footer, both languages */
.legal-foot {
  margin: 0 0 26px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  opacity: 0.8;
}
.screen.no-tabs .legal-foot { margin-bottom: 18px; }

.skeleton { background: linear-gradient(90deg, var(--line-soft), #f4f8f6, var(--line-soft)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* print view */
@media print {
  body { background: #fff; }
  .topbar, .tabbar, .fab, .no-print { display: none !important; }
  .screen { padding: 0; }
  .report { box-shadow: none; border: 0; padding: 0; }
  .app { max-width: none; }
}

/* ---------- capture & crop (photo of a document) ---------- */

.cap-root,
.crop-root {
  position: fixed;
  inset: 0;
  z-index: 92;
  background: #05130f;
  color: #f2f7f5;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.cap-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 6px;
}

.cap-title { font-size: 15px; font-weight: 600; letter-spacing: 0.2px; }
.cap-spacer { width: 40px; }

.cap-x {
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #f2f7f5;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cap-x svg { width: 20px; height: 20px; }

.cap-lead {
  margin: 4px 14px 10px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(242, 247, 245, 0.72);
}
.cap-lead.center { text-align: center; }

.cap-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 14px;
}

.cap-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cap-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #f2f7f5;
  cursor: pointer;
}
.cap-type:active { background: rgba(255, 255, 255, 0.12); }
.cap-type b { font-size: 13.5px; font-weight: 600; }

.cap-glyph {
  display: block;
  width: 58px;
  border: 1.5px solid rgba(143, 217, 194, 0.9);
  border-radius: 6px;
  background: rgba(143, 217, 194, 0.1);
}
.cap-glyph.tall { width: auto; height: 58px; }

.cap-alt {
  margin-top: auto;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f2f7f5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cap-alt svg { width: 19px; height: 19px; }

/* live camera */
.cap-cam {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}
.cap-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.cap-guide { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

.cap-frame {
  position: relative;
  border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.48);
  outline: 1px dashed rgba(255, 255, 255, 0.7);
  outline-offset: 0;
}
.cap-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid #8fd9c2;
  border-radius: 4px;
}
.cap-corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.cap-corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.cap-corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.cap-corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }

.cap-hint {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  text-align: center;
  font-size: 12.5px;
  color: #eaf6f1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.cap-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 26px 18px;
}
.cap-round {
  width: 48px;
  height: 48px;
  flex: none;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #f2f7f5;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cap-round svg { width: 21px; height: 21px; }

.cap-shutter {
  width: 70px;
  height: 70px;
  flex: none;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cap-shutter span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #f2f7f5;
  display: block;
}

/* crop */
.crop-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 12px;
}
.crop-box { position: relative; line-height: 0; max-width: 100%; max-height: 100%; }
.crop-view { display: block; border-radius: 10px; max-width: 100%; }
.crop-veil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crop-dim { fill: rgba(0, 0, 0, 0.5); }
.crop-edge { fill: none; stroke: #8fd9c2; stroke-width: 1.5; }

.crop-handle {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: rgba(242, 247, 245, 0.94);
  border: 2px solid #00775a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  touch-action: none;
  cursor: grab;
}
.crop-handle:active { cursor: grabbing; transform: scale(1.08); }

.crop-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px 4px;
}
.crop-btn {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  color: #f2f7f5;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.crop-btn svg { width: 17px; height: 17px; }
.crop-btn.primary { background: #00775a; }
.crop-apply { padding: 8px 12px 14px; }
.crop-apply .crop-btn { width: 100%; height: 50px; font-size: 15px; }

.crop-working {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 19, 15, 0.78);
  font-size: 14px;
  font-weight: 600;
  color: #f2f7f5;
}

[data-theme="dark"] .cap-root,
[data-theme="dark"] .crop-root { background: #04100c; }

/* the empty photo slot is a button now: it opens the capture flow */
button.pick-inner {
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

/* ---------- scanner: live detection, result preview ---------- */

.cap-cam.ready .cap-frame {
  outline: 2px solid #4ade80;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.55), 0 0 24px rgba(74, 222, 128, 0.35);
}
.cap-cam.ready .cap-corner { border-color: #4ade80; }

.cap-type.on {
  border-color: rgba(143, 217, 194, 0.75);
  background: rgba(143, 217, 194, 0.16);
}

.cap-busy {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  gap: 14px;
  background: #05130f;
  color: #f2f7f5;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 24px;
}
.cap-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(143, 217, 194, 0.25);
  border-top-color: #8fd9c2;
  animation: cap-spin 0.9s linear infinite;
  margin: 0 auto 10px;
}
@keyframes cap-spin { to { transform: rotate(360deg); } }

.cap-lead.warn { color: #f4c96b; }

.scan-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px 8px;
}
.scan-view {
  display: block;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  max-width: 100%;
  max-height: 100%;
}
.scan-actions {
  display: flex;
  gap: 8px;
  padding: 6px 12px 0;
}

/* ---------- scanned pages: a strip of page thumbnails in the form ---------- */
.pages-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.page-cell {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  scroll-snap-align: start;
}
.page-thumb {
  width: 96px;
  height: 128px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.page-cell.cover .page-thumb { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.page-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.page-wait { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin 0.9s linear infinite; }
.page-del {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(12, 21, 18, 0.62);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.page-del svg { width: 13px; height: 13px; }
.page-cover {
  position: absolute;
  inset-inline-start: 6px;
  bottom: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 2px 8px;
}
.page-add {
  flex: 0 0 auto;
  width: 96px;
  height: 128px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--primary);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  cursor: pointer;
  font: inherit;
}
.page-add svg { width: 22px; height: 22px; }
.page-add b { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.3; }

/* ---------- capture: page counter and the done button ---------- */
.cap-done {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.cap-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- detail: page strip ---------- */
.pages-hero { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pages-hero button {
  flex: 0 0 auto;
  width: 74px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line-soft);
  padding: 0;
  cursor: pointer;
}
.pages-hero img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.page-mini { display: block; width: 100%; height: 100%; }
/* the page shown in the big preview is marked in the strip */
.pages-hero button.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 119, 90, 0.22); }
.pages-hero button.sel .page-mini { opacity: 1; }
.pages-hero button:not(.sel) .page-mini { opacity: 0.82; }

/* the auto-shutter toggle shows when it is on */
.cap-round { position: relative; }
.cap-round.on { color: var(--primary); }
.cap-round.on::after { content: ""; position: absolute; inset-inline-end: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* the two looks offered on the scan preview */
.scan-modes { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.scan-mode {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.scan-mode.on { border-color: var(--primary); color: var(--primary); font-weight: 700; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }

.autofill-note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.autofill-note:empty { display: none; }

.back-prompt { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.back-prompt:empty { display: none; }
.back-text { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.back-text svg { width: 18px; height: 18px; color: var(--primary); }
.back-actions { display: flex; gap: 8px; }
.page-cover.back { background: var(--muted); }

/* type suggestions after a read: a guess the user taps, never a silent fill */
.type-suggest { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 10px; }
.type-suggest:empty { display: none; }
.chip-pick { border: 1px solid var(--line, #d6e0da); background: var(--card, #fff); color: inherit;
  border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip-pick:active { transform: scale(0.97); }


/* ---------- favorites ---------- */
.doc-card { cursor: pointer; }
.doc-card.is-fav { box-shadow: var(--shadow-1), inset 0 0 0 1px rgba(212, 167, 44, 0.42); }

.doc-card .fav-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--placeholder);
  background: transparent;
  margin-inline-start: -4px;
}
.doc-card .fav-btn svg { width: 19px; height: 19px; }
.doc-card .fav-btn.is-on { color: var(--gold); }
.doc-card .fav-btn:active { background: var(--line-soft); }

.topbar .icon-btn.fav-toggle.is-on { color: var(--gold); }

.sec-title .fav-mark { display: inline-flex; vertical-align: -3px; margin-inline-end: 5px; color: var(--gold); }
.sec-title .fav-mark svg { width: 15px; height: 15px; }

.fav-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  margin: 0 -2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.fav-strip::-webkit-scrollbar { display: none; }
.fav-tile {
  flex: none;
  width: 96px;
  padding: 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  display: grid;
  gap: 7px;
  justify-items: center;
  text-align: center;
  scroll-snap-align: start;
}
.fav-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--primary);
}
.fav-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fav-thumb svg { width: 24px; height: 24px; opacity: 0.75; }
.fav-name {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ---------- pull to refresh ---------- */
.ptr {
  position: fixed;
  top: 60px;
  left: 50%;
  z-index: 29;                 /* slides out from under the top bar */
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  display: grid;
  place-items: center;
  transform: translate(-50%, -44px);
  opacity: 0;
  pointer-events: none;
}
.ptr.is-anim { transition: transform 0.22s ease, opacity 0.22s ease; }
.ptr-ring {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
}
.ptr.is-busy .ptr-ring { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------- diagnostics ---------- */

/* Built to fit one phone screen: compact rows, no scrolling needed to read
 * the numbers that matter. */
.diag-wrap { display: grid; gap: 5px; }
.diag-btns { margin: 0 0 2px; }
.diag-btns .btn { height: 40px; }
.diag-badge-line { margin-top: 4px; }
.diag-hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.diag-card { padding: 4px 10px; }
.diag-card-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.diag-wrap .kv .row { padding: 2px 0; font-size: 11.5px; gap: 8px; }
.diag-wrap .kv .k { width: 36%; font-size: 11.5px; white-space: nowrap; }
.diag-wrap .kv .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diag-wrap .kv .v { font-weight: 600; }
.diag-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--line-soft);
  color: var(--muted);
}
.diag-badge.ok { background: var(--ok-bg); color: var(--ok); }
.diag-badge.bad { background: var(--bad-bg); color: var(--bad); }

/* The diagnostics entry sits in the top bar, quieter than a normal action. */
.topbar .diag-btn { opacity: 0.55; }
.topbar .diag-btn:hover, .topbar .diag-btn:active { opacity: 1; }

/* Home puts the diagnostics button in its first content row instead of the top
 * bar, so it lands in the same physical column as on every other screen. */
.diag-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 6px; }
.diag-row .diag-btn { opacity: 0.55; }
.diag-row .row-actions { display: flex; align-items: center; gap: 6px; }
.diag-row .diag-btn:active { opacity: 1; }

/* Lock screen: the fingerprint is an icon button, not a text link. */
.bio-btn {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--primary);
  border: 1.5px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.bio-btn svg { width: 34px; height: 34px; stroke-width: 1.6; }
.bio-btn:active { background: var(--primary); color: var(--surface); }

/* Licence screens: cards in the app's own style, Arabic first. */
.lg { display: grid; gap: 12px; padding-bottom: 8px; }
.lg-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--line-soft); border-radius: 12px; }
.lg-seg { min-height: 40px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; }
.lg-seg[aria-selected="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.lg .card { margin: 0; }
.lg-hero { padding: 16px; display: grid; gap: 12px; }
.lg-brand { display: flex; align-items: center; gap: 12px; }
.lg-mark { width: 44px; height: 44px; flex: none; display: block; color: var(--deep); }
.lg-mark svg { width: 44px; height: 44px; }
.lg-appname { font-size: 20px; font-weight: 700; color: var(--deep); line-height: 1.3; }
.lg-appsub { font-size: 13px; color: var(--muted); }
.lg-kv { display: grid; gap: 3px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.lg-k { font-size: 12px; color: var(--muted); font-weight: 600; }
.lg-v { font-size: 14.5px; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
.lg-mail { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; font-size: 15px; min-height: 44px; text-decoration: none; overflow-wrap: anywhere; }
.lg-mail svg { width: 20px; height: 20px; flex: none; }
.lg-sec { padding: 14px 16px; display: grid; gap: 8px; }
.lg-h { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--deep); line-height: 1.5; }
.lg-hi { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--line-soft); color: var(--primary); }
.lg-hi svg { width: 18px; height: 18px; }
.lg-p { margin: 0; font-size: 14.5px; line-height: 1.95; color: var(--text); }
.lg-muted { color: var(--muted); font-size: 13px; line-height: 1.8; }
.lg-no .lg-hi { background: var(--bad-bg); color: var(--bad); }
.lg-yes .lg-hi { background: var(--line-soft); color: var(--primary); }
.lg-btn { justify-self: start; }
.lg-num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; display: grid; place-items: center; }
.lg-name { font-family: "Plex Arabic", sans-serif; overflow-wrap: anywhere; }
.lg-chip { justify-self: start; font-size: 12.5px; font-weight: 600; color: var(--primary); background: var(--line-soft); border-radius: 999px; padding: 4px 10px; }
.lg-row { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.lg-row .lg-v { font-size: 13px; line-height: 1.7; }
.lg-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); font-weight: 600; font-size: 14px; text-decoration: none; }
.lg-raw { justify-self: center; color: var(--muted); font-size: 12.5px; min-height: 40px; display: inline-flex; align-items: center; text-decoration: underline; }
.lg-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0 18px; }

/* Erase some or all data: a tickable list inside the sheet. */
.sheet p { white-space: pre-line; }
.er-list { display: grid; gap: 4px; max-height: 50dvh; overflow-y: auto; margin-top: 4px; padding-inline-end: 2px; }
.er-sec { font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 4px 2px; }
.er-none { font-size: 13px; color: var(--muted); padding: 2px 6px 6px; }
.er-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: start; }
.er-row.er-child { margin-inline-start: 22px; width: calc(100% - 22px); min-height: 44px; border-style: dashed; }
.er-row.er-parent { background: var(--line-soft); }
.er-box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; }
.er-box svg { width: 16px; height: 16px; }
.er-row[aria-checked="true"] { border-color: var(--bad); }
.er-row[aria-checked="true"] .er-box { background: var(--bad); border-color: var(--bad); color: #fff; }
.er-row[aria-checked="mixed"] .er-box { border-color: var(--bad); background: var(--bad-bg); }
.er-row[aria-checked="mixed"] .er-box::after { content: ""; width: 10px; height: 2px; background: var(--bad); border-radius: 2px; }
.er-row[aria-checked="mixed"] .er-box svg { display: none; }
.er-txt { display: grid; gap: 1px; min-width: 0; }
.er-txt b { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.er-txt span { font-size: 12px; color: var(--muted); }
.btn:disabled { opacity: 0.45; }

/* ---------- recycle bin ---------- */
.tr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tr-lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.tr-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-seg .chip-pick { flex: 1 1 auto; text-align: center; min-height: 38px;
  background: var(--surface); border-color: var(--line); color: var(--text); }
.tr-seg .chip-pick.on { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 700; }
.tr-list { display: grid; gap: 8px; margin-top: 12px; }
.tr-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.tr-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--line-soft); color: var(--primary); flex: none; }
.tr-ico svg { width: 18px; height: 18px; }
.tr-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tr-body b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-meta { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-left { font-size: 11.5px; color: var(--muted); }
.tr-left.soon { color: var(--bad); font-weight: 700; }
.tr-act { flex: none; border: 1px solid var(--primary); background: transparent; color: var(--primary); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; }
.tr-act:active { transform: scale(0.97); }

/* result of the phone-alerts test: one line per step the message takes */
.alerts-result { display: grid; gap: 3px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.alerts-result b { font-size: 12.5px; color: var(--text); font-weight: 700; }
.alerts-result .muted { color: var(--muted); }

/* ---------- notifications inbox ---------- */
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.in-list { display: grid; gap: 8px; }
.in-row { display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 12px; }
.in-row.unread { border-color: var(--primary); }
.in-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; }
.in-row.unread .in-dot { background: var(--primary); }
.in-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
  background: transparent; border: 0; color: inherit; font: inherit; text-align: start; padding: 0; }
.in-main b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-row.unread .in-main b { font-weight: 800; }
.in-body { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.in-del { flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 10px; }
.in-del svg { width: 16px; height: 16px; }
.in-del:active { background: var(--line-soft); }

/* ---------- the lock cover ----------
 * Shown synchronously when the app is left: the app-switcher snapshot and the
 * first frame back show this, never the documents. */
.lock-cover {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  place-items: center;
  background: var(--bg);
  color: var(--deep);
}
.lock-cover-mark { width: 44px; height: 44px; display: block; opacity: 0.85; }
.lock-cover-mark svg { width: 100%; height: 100%; }

/* a new build is ready: a slim bar above the tab bar, never over content */
.upd-bar {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  z-index: 96;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  animation: toast-in 0.2s ease;
}
/* screens without a tab bar (the editor, the camera) put it at the very
 * bottom, and the page's own bottom padding keeps it clear of the fields */
body:not(:has(.tabbar)) .upd-bar { bottom: calc(var(--safe-b) + 12px); }
.upd-bar .upd-txt { opacity: 0.85; }
.upd-bar b { color: var(--primary); font-weight: 700; white-space: nowrap; }

/* While the bar is up it must hide nothing: the screen gets room to clear it,
 * on tabbed and tab-less screens alike. The bar is 48px tall plus its gaps. */
body:has(.upd-bar) .screen { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 40px + 72px); }
body:has(.upd-bar) .screen.no-tabs { padding-bottom: calc(var(--safe-b) + 80px); }

/* Social pages: one row, three equal chips */
.social-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0 4px; }
.social-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 62px; padding: 10px 4px; border: 1px solid var(--line-soft); border-radius: 14px;
  color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600;
}
.social-chip .ic svg { width: 22px; height: 22px; color: var(--primary); }
.social-chip:active { background: var(--line-soft); }

/* ---------- subscription (plan, payment, sent) ---------- */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.plan-card {
  position: relative; text-align: start; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 16px 12px 14px; font: inherit; color: var(--text);
}
.plan-card.sel { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 119, 90, .12); }
.plan-name { font-size: 14px; font-weight: 700; color: var(--muted); }
.plan-price { font-size: 30px; font-weight: 700; color: var(--deep); line-height: 1; margin-top: 10px; letter-spacing: -.01em; }
.plan-price span { font-size: 13px; font-weight: 600; color: var(--muted); margin-inline-start: 3px; }
.plan-per { font-size: 12px; color: var(--muted); margin-top: 6px; }
.plan-save { font-size: 11.5px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.plan-badge {
  position: absolute; top: -9px; inset-inline-start: 10px;
  background: var(--primary); color: var(--on-primary);
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.step-title { font-size: 13px; font-weight: 700; color: var(--deep); margin: 20px 2px 8px; }
.copy-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.copy-row:last-child { border-bottom: 0; }
.copy-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.copy-label { font-size: 11.5px; color: var(--muted); }
.copy-value { font-size: 17px; font-weight: 600; letter-spacing: .02em; overflow-wrap: anywhere; }
.copy-value.mono { font-variant-numeric: tabular-nums; }
.copy-btn {
  flex: none; width: auto; border: 1px solid var(--line); background: var(--surface); color: var(--primary);
  border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
/* a .btn inside a row keeps its own width; .btn is 100% by default */
.copy-row .btn, .field .btn.sm { width: auto; flex: none; }
.plan-dot { position: absolute; top: 10px; inset-inline-end: 12px; color: var(--primary); font-weight: 700; }
.copy-btn .ic svg { width: 15px; height: 15px; }
.method-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.method-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text); text-align: start;
}
.method-row.sel { border-color: var(--primary); background: rgba(0, 119, 90, .07); }
.method-dot { color: var(--primary); font-weight: 700; font-size: 15px; }
.shot-preview { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line-soft); }
.shot-preview img { display: block; width: 100%; max-height: 240px; object-fit: contain; }
