/* ============================================================================
   BuildQC — theme
   ----------------------------------------------------------------------------
   CHANGE THE LOOK OF THE WHOLE APP HERE. Every rule below this block only
   references these variables — swap a hex value or a font name and you're done.
   (Keep the iOS Theme enum in BuildQCApp.swift in sync if you want both
   platforms to match.)
   ============================================================================ */
:root {
  /* -- Colors ------------------------------------------------------------ */
  --bg: #f7f3ee;             /* app background (warm off-white)              */
  --surface: #ffffff;        /* cards, top bar                               */
  --surface-tint: #fcebdb;   /* soft peach fill (icon chips, selected states)*/
  --line: #f0e5db;           /* hairline borders                             */
  --accent: #ed7d2b;         /* primary orange                               */
  --accent-deep: #d46612;    /* hover / emphasis orange                      */
  --text: #2e2a26;           /* primary text                                 */
  --muted: #9e948c;          /* secondary text                               */
  --green: #3db85e;          /* approved / yes                               */
  --red: #e0423d;            /* no / errors                                  */
  --shadow: 0 6px 24px rgba(46, 42, 38, 0.06);

  /* -- Typography ---------------------------------------------------------
     Both stacks fall back to system fonts. To change the app's font,
     update the Google Fonts <link> in index.html and these two lines.     */
  --font-display: "Poppins", -apple-system, sans-serif;  /* headings, buttons */
  --font-body: "Poppins", -apple-system, sans-serif;     /* everything else   */

  /* -- Shape & spacing ----------------------------------------------------*/
  --radius: 16px;            /* cards */
  --radius-sm: 12px;         /* inputs, buttons, badges */
  --pad-card: 18px;
  --page-width: 1080px;
}
/* ========================== end of theme block ============================ */

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px; max-width: var(--page-width); margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; cursor: pointer; color: var(--text);
}
.brand span { color: var(--accent); }
#nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
#nav a {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--muted); text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
}
#nav a.active { color: var(--accent-deep); background: var(--surface-tint); }
#nav a:hover { color: var(--accent-deep); }
.userchip { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }

/* ---------- layout ---------- */
main { max-width: var(--page-width); margin: 0 auto; padding: 28px 20px 80px; }
.loading { color: var(--muted); padding: 60px; text-align: center; }

h1.page {
  font-family: var(--font-display); font-weight: 600;
  font-size: 26px; line-height: 1.15; letter-spacing: -.01em;
  margin-bottom: 6px;
}
.subtitle { color: var(--muted); margin-bottom: 20px; font-size: 15px; line-height: 1.5; }
/* The action row (buttons) that follows a page title/subtitle needs
   separation from the heading above and the content below it. */
h1.page + p:not(.subtitle),
.subtitle + p { margin-top: 4px; margin-bottom: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad-card);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.clickable:hover { border-color: var(--accent); transform: translateY(-1px); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); border-color: var(--accent);
}

.btn {
  display: inline-block; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 12px 22px; background: var(--accent); color: #fff;
  text-decoration: none;          /* <a class="btn"> must never underline */
  line-height: 1.2; text-align: center;
}
a.btn, a.btn:hover, a.btn:visited { text-decoration: none; }
.btn:hover { background: var(--accent-deep); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn.yellow { background: var(--accent); }             /* legacy alias */
.btn.green { background: var(--green); }
.btn.ghost {
  background: var(--surface-tint); color: var(--accent-deep);
}
.btn.ghost:hover { background: var(--line); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }

.error { color: var(--red); margin: 10px 0; font-weight: 600; }
.ok { color: var(--green); margin: 10px 0; font-weight: 600; }

/* ---------- auth screen ---------- */
.auth-wrap { max-width: 420px; margin: 8vh auto 0; }
.auth-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 34px;
  text-align: center; color: var(--text); line-height: 1.1;
}
.auth-logo span { color: var(--accent); }
.auth-logo small {
  display: block; font-size: 14px; font-weight: 400;
  color: var(--muted); margin-top: 6px;
}
.auth-mark {
  width: 48px; height: 48px; margin: 0 auto 14px;
  border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.auth-mark img { width: 48px; height: 48px; object-fit: contain; display: block; }
.auth-wrap .card { margin-top: 20px; }
.role-toggle { display: flex; gap: 8px; }
.role-toggle button {
  flex: 1; padding: 12px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--bg); border: 2px solid var(--line); color: var(--muted);
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}
.role-toggle button.sel {
  border-color: var(--accent); color: var(--accent-deep);
  background: var(--surface-tint);
}
.linklike {
  background: none; border: none; color: var(--accent-deep);
  cursor: pointer; font: inherit; font-weight: 600;
}

/* ---------- badges / status ---------- */
.badge {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.badge.open { background: var(--surface-tint); color: var(--accent-deep); }
.badge.submitted { background: rgba(212, 102, 18, .14); color: var(--accent-deep); }
.badge.approved { background: rgba(61, 184, 94, .14); color: var(--green); }

/* ---------- checklist fill ---------- */
.item-row { border-top: 1px solid var(--line); padding: 16px 0; }
.item-row:first-child { border-top: none; padding-top: 4px; }
.item-desc { font-weight: 600; margin-bottom: 10px; }
.yn { display: flex; gap: 10px; max-width: 320px; }
.yn button {
  flex: 1; padding: 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-display); font-weight: 600; background: var(--surface);
}
.yn .yes { border: 2px solid var(--green); color: var(--green); }
.yn .yes.sel { background: var(--green); color: #fff; }
.yn .no { border: 2px solid var(--red); color: var(--red); }
.yn .no.sel { background: var(--red); color: #fff; }
.photo-req { margin-top: 10px; font-size: 14px; }
.photo-req img {
  display: block; max-width: 180px;
  border-radius: var(--radius-sm); margin-top: 8px;
  border: 1px solid var(--line);
}

/* ---------- signature ---------- */
#sig-canvas {
  background: #fff; border-radius: var(--radius);
  border: 2px solid var(--accent); touch-action: none; width: 100%;
}

/* ---------- template / item builder ---------- */
.builder-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px;
}
.builder-item .cam { color: var(--accent-deep); font-size: 13px; font-weight: 600; }
.checkrow { display: flex; align-items: center; gap: 8px; margin: 10px 0; }

/* ---------- location multi-select (assign template) ---------- */
.loc-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer;
}
.loc-pick.sel { border-color: var(--accent); background: var(--surface-tint); }
.loc-pick input { accent-color: var(--accent); }

/* ---------- QR print picker ---------- */
.qr-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.qr-pick:first-of-type { border-top: none; }
.qr-pick input[type="number"] { width: 80px; padding: 8px; }
.qr-pick input[type="checkbox"] { accent-color: var(--accent); width: auto; }

/* ============================================================================
   30-up sticker sheet — Avery 5160-compatible (print only; unaffected by theme)
   Letter 8.5in × 11in · labels 2.625in × 1in · 3 cols × 10 rows
   ============================================================================ */
#print-area { display: none; }

.label-sheet {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  width: 8.5in; height: 11in;
  padding: 0.5in 0.1875in;
  display: grid;
  grid-template-columns: repeat(3, 2.625in);
  grid-template-rows: repeat(10, 1in);
  column-gap: 0.125in;
  row-gap: 0;
  page-break-after: always;
  background: #fff;
}
.label {
  width: 2.625in; height: 1in;
  display: flex; align-items: center; gap: 0.08in;
  padding: 0.06in 0.1in;
  overflow: hidden;
}
.label .qr-box { width: 0.85in; height: 0.85in; flex-shrink: 0; }
.label .qr-box img, .label .qr-box canvas { width: 0.85in !important; height: 0.85in !important; }
.label .meta {
  color: #000; min-width: 0;
  display: flex; flex-direction: column;
  height: 0.88in;                 /* fill the label so the brand sits at the bottom */
}
.label .meta .loc-name {
  font-family: var(--font-display), Arial, sans-serif; font-weight: 700;
  font-size: 10pt; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis;
}
/* Two optional info lines under the location name */
.label .meta .loc-label {
  font-family: var(--font-display), Arial, sans-serif;
  font-size: 6.5pt; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.label .meta .loc-label.l1 { color: #444; font-weight: 500; }
.label .meta .loc-label.l2,
.label .meta .loc-label.l3,
.label .meta .loc-label.l4 { color: var(--accent-deep); font-weight: 600; }
/* Brand mark pinned to the bottom, styled like the site logo */
.label .meta .brand-mark {
  margin-top: auto;
  font-family: var(--font-display), Arial, sans-serif;
  font-weight: 700; font-size: 7pt; color: var(--text);
}
.label .meta .brand-mark span { color: var(--accent); }

@media print {
  body { background: #fff; }
  #topbar, main { display: none !important; }
  #print-area { display: block; }
  @page { size: letter; margin: 0; }
}

.field-row { display: flex; gap: 10px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}

/* ============================================================
   Mobile — the site must be fully usable on a phone (subs who
   scan a sticker without the app land here).
   ============================================================ */
@media (max-width: 700px) {
  .topbar-inner { padding: 10px 12px; gap: 10px; }
  .brand { font-size: 17px; flex-shrink: 0; }
  /* nav becomes a swipeable strip instead of wrapping */
  #nav {
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { white-space: nowrap; padding: 7px 10px; font-size: 13px; }

  main { padding: 18px 14px 70px; }
  h1.page { font-size: 22px; }
  .subtitle { font-size: 14px; }
  .card { padding: 14px; }
  .grid { grid-template-columns: 1fr; }

  /* stack side-by-side form fields */
  .field-row { flex-direction: column; gap: 0; }
  .role-toggle { flex-wrap: wrap; }
  .role-toggle button { min-width: 46%; }

  /* comfortable tap targets */
  .icon-btn { padding: 9px 12px; font-size: 16px; }
  .menu-item { padding: 14px; }
  .yn { max-width: none; }
  .yn button { padding: 13px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay .card {
    max-width: none; border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92vh; overflow-y: auto;
  }

  .qr-pick { flex-wrap: wrap; }
  .user-row { flex-wrap: wrap; }
  .auth-wrap { margin-top: 4vh; }
}

/* Inputs at 16px prevent iOS Safari from auto-zooming on focus */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea { font-size: 16px; }

/* ---------- section headings inside a checklist ---------- */
.section-heading {
  background: var(--surface-tint);
  color: var(--accent-deep);
  font-family: var(--font-display); font-weight: 600;
  font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  margin: 16px 0 4px;
}
.builder-heading { background: var(--surface-tint); border-color: var(--surface-tint); }


/* ---------- avatar + account dropdown ---------- */
.userchip { position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-tint); color: var(--accent-deep);
  border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.avatar:hover { background: var(--line); }
.menu {
  position: absolute; right: 0; top: 46px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  min-width: 200px; overflow: hidden;
}
.menu-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.menu-head #menu-name { font-weight: 600; }
.menu-head #menu-role { color: var(--muted); font-size: 13px; }
.menu-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  padding: 11px 14px; font: inherit; color: var(--text);
}
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--red); }

/* ---------- generic modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(46, 42, 38, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay .card { max-width: 460px; width: 100%; margin: 0; }

/* ---------- small icon buttons on cards ---------- */
.card-actions { display: flex; gap: 6px; }
.icon-btn {
  background: var(--bg); border: 1px solid var(--line); cursor: pointer;
  border-radius: 8px; padding: 6px 9px; font-size: 14px; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.danger:hover { border-color: var(--red); }

/* ---------- item description (smaller italic under an item) ---------- */
.item-detail {
  font-style: italic; font-size: 13px; color: var(--muted);
  margin-top: 2px; line-height: 1.45;
}

/* ---------- template editor "add" cards, visually distinct from rows ---------- */
.add-card { background: var(--surface-tint); border-color: var(--line); }
.add-card .add-card-title {
  font-family: var(--font-display); font-weight: 600; margin-bottom: 10px;
}
.add-card input[type="text"] { background: var(--surface); }
.builder-item .edit-row, .builder-item .del {
  background: none; border: none; cursor: pointer; font-size: 15px;
  padding: 4px 6px;
}
.builder-item .edit-row { color: var(--accent-deep); }
.builder-item .del { color: var(--red); }

/* ---------- scope + compact checklist rows ---------- */
.scope-chip {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 6px;
  background: var(--surface-tint, #FCEBDB); color: var(--accent-deep);
  text-transform: uppercase;
}
.scope-chip.sm { margin-bottom: 0; font-size: 10px; padding: 2px 7px; }

.scope-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; }
.scope-filter {
  flex: 0 0 auto; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.scope-filter.sel { background: var(--accent); color: #fff; border-color: var(--accent); }

.checklist-rows { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.checklist-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; background: var(--surface); cursor: pointer;
}
.checklist-row:hover { background: var(--surface-tint, #FCEBDB); }
.checklist-row .cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-title { font-weight: 600; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }
.status-dot.dot-open { background: var(--accent); }
.status-dot.dot-yellow { background: #E0A100; }
.status-dot.dot-green { background: var(--green); }
.checklist-row .icon-btn { flex: 0 0 auto; }

/* ---------- search input with icon (white, stands out from the page) ---------- */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap input {
  width: 100%; padding: 11px 14px 11px 40px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size: 15px; color: var(--text);
  margin-bottom: 0;
}
.search-wrap input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.search-wrap .search-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: .55; pointer-events: none;
}

/* section heading above a list/search block */
.section-head {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  margin: 18px 0 8px; color: var(--text);
}

/* ---------- consistent page header (eyebrow / title / subtitle) ---------- */
/* Option C header: project name as quiet supporting text, title large,
   actions pulled up onto the same row. No card, no heavy bands. */
.page-eyebrow {
  font-size: 13px; font-weight: 500; color: var(--muted);
  margin: 0 0 3px; letter-spacing: 0;
}
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13px; font-weight: 500; margin: 0 0 4px;
}
.crumbs a {
  color: var(--muted); text-decoration: none;
  padding: 1px 4px; margin: 0 -4px; border-radius: 5px;
}
.crumbs a:hover { color: var(--accent-deep); background: var(--surface-tint); }
.crumbs span:not(.crumb-sep) { color: var(--muted); }
.crumb-sep { color: #cfc4ba; font-weight: 400; }
@media (max-width: 700px) { .crumbs { display: none; } }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-head .ph-text { min-width: 0; }
.page-head h1.page { margin-bottom: 0; font-size: 26px; line-height: 1.1; }
.page-head .subtitle { margin: 5px 0 0; max-width: 60ch; font-size: 14px; }
.page-head .action-row { flex-shrink: 0; }

/* ---------- combined search + filters toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 10px; margin-bottom: 10px;
}
.toolbar .tb-ico { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.toolbar input {
  flex: 1; min-width: 0; border: none; background: transparent;
  font: inherit; font-size: 14.5px; color: var(--text);
  padding: 3px 0; margin: 0;
}
.toolbar input:focus { outline: none; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  border: none; border-left: 1px solid var(--line); background: transparent;
  padding: 4px 2px 4px 12px; margin: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
}
.filter-btn:hover { color: var(--accent-deep); }
.filter-btn .fb-count {
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; line-height: 1.5;
}
.filter-panel {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 12px 14px; margin-bottom: 10px;
}
.filter-panel .fp-label {
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.filter-panel .scope-bar { padding-bottom: 0; margin-bottom: 0; flex-wrap: wrap; overflow: visible; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 2px 12px; }

/* ---------- action row: solid primary + outlined secondary ---------- */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-ico {
  width: 17px; height: 17px; flex: 0 0 auto;
  margin-right: 7px; vertical-align: -3px;
}
.btn.btn-solid, .btn.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14.5px; font-weight: 600;
}
.btn.btn-solid {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 10px 18px;
}
.btn.btn-solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.btn-outline {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); padding: 10px 18px;
}
.btn.btn-outline:hover { background: var(--surface); border-color: var(--muted); }

/* ---------- sort toggle in the toolbar ---------- */
.sort-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  border: none; border-left: 1px solid var(--line); background: transparent;
  padding: 4px 2px 4px 12px; margin: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.sort-btn:hover { color: var(--accent-deep); }
.sort-btn .sb-ico { width: 15px; height: 15px; }

/* ---------- mobile app banner (phones only, dismissible) ----------
   NOTE: this block was accidentally dropped in an earlier styles.css
   release, which left the banner's <img> unstyled and rendering at its
   full natural size. Sizes are capped explicitly so that can't recur. */
#app-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
#app-banner .ab-logo {
  width: 40px; height: 40px; max-width: 40px; max-height: 40px;
  border-radius: 9px; object-fit: contain; flex: 0 0 auto;
  background: var(--bg);
}
#app-banner .ab-text { flex: 1; min-width: 0; }
#app-banner .ab-title {
  font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.25;
}
#app-banner .ab-sub {
  font-size: 12px; color: var(--muted); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#app-banner .ab-get {
  flex: 0 0 auto; text-decoration: none;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 7px 16px; border-radius: 999px;
}
#app-banner .ab-close {
  flex: 0 0 auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 22px; line-height: 1;
  padding: 0 2px; margin: 0; width: auto;
}

/* ---------- global image safety net ----------
   Any image in the app scales to its container and never overflows the
   viewport, so a missing size rule can't blow up the layout on a phone. */
img { max-width: 100%; height: auto; }
.auth-mark img, #app-banner .ab-logo { height: auto; }

@media (max-width: 700px) {
  .auth-wrap { max-width: 100%; margin-top: 4vh; }
  .auth-logo { font-size: 28px; }
  .auth-mark, .auth-mark img { width: 44px; height: 44px; }
  #app-banner { padding: 9px 10px; gap: 10px; }
  #app-banner .ab-logo { width: 36px; height: 36px; max-width: 36px; max-height: 36px; }
  #app-banner .ab-title { font-size: 13.5px; }
  #app-banner .ab-sub { font-size: 11.5px; }
}
