/* Marque — the service-standards platform.
   The shell wears Marque's identity (Academy Engraved LET, Cannoli
   Cream + ink). Each organisation's own font and colours take over the
   moment their branding loads (see applyBranding in app.js).
   Colours adapt for dark mode so text and accents stay legible. */

@font-face {
  font-family: "Ivar Headline";
  src: url("fonts/IvarHeadline-Regular.otf") format("opentype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Ivar Text";
  src: url("fonts/IvarText-Regular.otf") format("opentype");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  /* Typography: the org's font arrives via --font-head/--font-body
     (set from branding); the defaults are a neutral serif. The Marque
     face dresses the platform's own screens. */
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: Georgia, "Times New Roman", serif;
  --font-marque: "Academy Engraved LET", "AcademyEngravedLetPlain", Georgia, serif;
  --stone: #E4DCCE;
  --stone-light: #F2EEE6;   /* app background */
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: rgba(26, 26, 26, 0.6);
  --ochre: #DFA150;
  --olive: #75743D;
  --brick: #D14B14;
  --burgundy: #4D0A05;
  --navy: #0E1445;
  --shadow: rgba(60, 50, 40, 0.12);
  --hairline: rgba(60, 50, 40, 0.12);
  color-scheme: light;
}

:root[data-theme="dark"], :root.dark {
  --stone: #3A352D;
  --stone-light: #1E1B17;
  --card: #2B2721;
  --ink: #F2EEE6;
  --ink-soft: rgba(242, 238, 230, 0.6);
  --ochre: #DFA150;
  --olive: #D9D771;
  --brick: #E86A3A;
  --burgundy: #D96057;
  --navy: #5764D9;
  --shadow: rgba(0, 0, 0, 0.4);
  --hairline: rgba(242, 238, 230, 0.12);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone: #3A352D;
    --stone-light: #1E1B17;
    --card: #2B2721;
    --ink: #F2EEE6;
    --ink-soft: rgba(242, 238, 230, 0.6);
    --ochre: #DFA150;
    --olive: #D9D771;
    --brick: #E86A3A;
    --burgundy: #D96057;
    --navy: #5764D9;
    --shadow: rgba(0, 0, 0, 0.4);
    --hairline: rgba(242, 238, 230, 0.12);
    color-scheme: dark;
  }
}

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

html, body {
  background: var(--stone-light);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

h1, h2, h3, .headline {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.caps {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-head);
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Layout ---------- */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.appbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 20;
}
.appbar .title { font-size: 19px; font-weight: 700; font-family: var(--font-head); }
.appbar .back {
  border: none; background: transparent; color: var(--ink);
  font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.appbar .back:hover { background: var(--stone); }
.appbar .spacer { flex: 1; }
.appbar .accountbtn {
  border: none; background: var(--burgundy); color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-weight: 700; font-size: 14px;
}

.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 20px; flex: 1; }
.wrap.narrow { max-width: 460px; }

/* ---------- Tab bar ---------- */

.tabbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; background: var(--card);
  border-top: 1px solid var(--hairline);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; border: none; background: transparent; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; font-size: 11px; border-radius: 10px;
}
.tabbar button .ic { font-size: 20px; line-height: 1; }
.tabbar button.active { color: var(--burgundy); }
.tabbar button.active .ic { transform: translateY(-1px); }

/* ---------- Cards & lists ---------- */

.card {
  background: var(--card); border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 1px 3px var(--shadow); margin-bottom: 14px;
  border: 1px solid var(--hairline);
}
.card.tappable { cursor: pointer; transition: transform .08s ease; }
.card.tappable:active { transform: scale(0.99); }

.row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}
.row:last-child { border-bottom: none; }
.row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .sub { font-size: 14px; color: var(--ink-soft); }
.row .chev { color: var(--ink-soft); font-size: 20px; }
.row .badge { font-size: 13px; color: var(--ink-soft); }

.section-title {
  font-size: 13px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: 0.1em; margin: 22px 4px 8px;
}

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 13px 18px;
  font-size: 16px; font-weight: 600; width: 100%;
}
.btn.primary { background: var(--burgundy); color: #fff; }
.btn.secondary { background: var(--stone); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink-soft); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; border-radius: 10px; }

.field {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--stone); border-radius: 12px; margin-bottom: 12px;
}
.field:focus { outline: 2px solid var(--burgundy); outline-offset: -1px; }

label.lbl { font-size: 14px; color: var(--ink-soft); display: block; margin: 6px 4px; }

/* ---------- Assessment ---------- */

.answers { display: grid; gap: 10px; margin-top: 16px; }
.answer {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; border-radius: 14px; border: 2px solid var(--hairline);
  background: var(--card); font-size: 16px; font-weight: 600; text-align: left; width: 100%;
  color: var(--ink);
}
.answer .em { font-size: 20px; }
.answer.sel-exceeds { border-color: var(--ochre); background: color-mix(in srgb, var(--ochre) 15%, var(--card)); }
.answer.sel-meets   { border-color: var(--olive); background: color-mix(in srgb, var(--olive) 15%, var(--card)); }
.answer.sel-below   { border-color: var(--brick); background: color-mix(in srgb, var(--brick) 15%, var(--card)); }
.answer.sel-na      { border-color: var(--ink-soft); background: color-mix(in srgb, var(--ink-soft) 12%, var(--card)); }

.progress { height: 6px; background: var(--stone); border-radius: 3px; overflow: hidden; margin: 4px 0 18px; }
.progress > div { height: 100%; background: var(--burgundy); transition: width .25s ease; }

.qmeta { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.qtext { font-size: 20px; margin: 10px 0 4px; line-height: 1.35; }
.qsection { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ochre); font-weight: 700; }

/* ---------- Score ring ---------- */

.ring-wrap { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { transform: rotate(-90deg); }
.ring .pct {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring .pct b { font-size: 30px; font-family: var(--font-head); }
.ring .pct span { font-size: 12px; color: var(--ink-soft); }

.tally { display: flex; gap: 16px; flex-wrap: wrap; }
.tally .t { text-align: center; }
.tally .t b { font-size: 22px; display: block; font-family: var(--font-head); }
.tally .t span { font-size: 12px; color: var(--ink-soft); }

/* ---------- Misc ---------- */

.pill {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: color-mix(in srgb, var(--ochre) 20%, transparent);
  color: var(--ink); letter-spacing: .04em;
}
.empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; }
.empty .em { font-size: 40px; display: block; margin-bottom: 12px; }
.error { color: var(--brick); font-size: 14px; margin: 6px 4px; }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--ink); color: var(--stone-light); padding: 12px 20px;
  border-radius: 999px; font-size: 14px; z-index: 100; box-shadow: 0 4px 16px var(--shadow);
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%;
}
.toast.show { opacity: 1; }

.seg { display: flex; background: var(--stone); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 16px; }
.seg button {
  flex: 1; border: none; background: transparent; color: var(--ink-soft);
  padding: 8px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px var(--shadow); }

.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.bar-row .lab { width: 130px; font-size: 14px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { flex: 1; height: 22px; background: var(--stone); border-radius: 6px; overflow: hidden; }
.bar-row .track > div { height: 100%; border-radius: 6px; }
.bar-row .val { width: 46px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }

.splash {
  position: fixed; inset: 0; background: var(--stone-light); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  transition: opacity .4s;
}
.splash img { width: 150px; }
.splash .cap { color: var(--ink-soft); }

.center-page { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.logo-top { display: block; width: 120px; margin: 0 auto 8px; }

.note-toggle { font-size: 14px; color: var(--burgundy); background: none; border: none; padding: 6px 0; }
.doc-para { margin: 10px 0; }
.doc-para.quote { border-left: 3px solid var(--ochre); padding-left: 14px; font-style: italic; color: var(--ink-soft); }
.doc-para.subheading { font-weight: 700; font-family: var(--font-head); margin-top: 16px; }
.doc-heading { font-size: 18px; margin-top: 20px; }

.muted { color: var(--ink-soft); font-size: 14px; }
.mt { margin-top: 16px; }
.center { text-align: center; }

/* ---------- Parity additions ---------- */

:root { --accent: #1A1A1A; }

/* accent-driven elements */
.btn.primary { background: var(--accent); }
.tabbar button.active { color: var(--accent); }
.progress > div { background: var(--accent); }
.seg button.active { color: var(--ink); }
.note-toggle, .link { color: var(--accent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 12px;
  cursor: pointer; font-size: 14px; overflow: hidden;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.continue {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--card); border-radius: 16px; border: 1px solid var(--hairline);
  cursor: pointer; box-shadow: 0 1px 3px var(--shadow); margin-bottom: 14px;
}
.continue .play { font-size: 30px; line-height: 1; }
.continue .lab { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }

.accent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.swatch-btn { border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--ink); }
.swatch { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }

.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; }

.modal-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 460px;
  border-radius: 20px 20px 0 0; padding: 26px 24px calc(26px + env(safe-area-inset-bottom));
  animation: sheetup .22s ease;
}
@keyframes sheetup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet h3 { text-align: center; margin-bottom: 6px; }
.sheet p { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }
.sheet .btn { margin-bottom: 10px; }

.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--hairline); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .grow { flex: 1; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--stone); border-radius: 999px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(20px); }

.assessor-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 3px 7px;
  background: color-mix(in srgb, var(--stone) 60%, transparent); border-radius: 999px; color: var(--ink);
}
.pw-badge { font-size: 11px; color: var(--ochre); }

/* ---------- Home headline styling (matches native BrandHeadline) ---------- */
.bhead {
  font-family: var(--font-head); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink); line-height: 1.2;
}
.bhead.lg { font-size: 22px; }
.bhead.sm { font-size: 14px; margin: 24px 2px 10px; }
.home-date { color: var(--ink-soft); font-size: 15px; margin: 4px 2px 0; }
.doc-row .ic { font-size: 18px; width: 28px; text-align: center; flex: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-head .ic { font-size: 18px; }
.card-head .bhead { flex: 1; }

/* ---------- Marque platform shell ---------- */
.splash .marque-mark { width: 130px; }
/* The Marque monogram is black artwork; invert it on dark backgrounds. */
:root[data-theme="dark"] .marque-mark, :root[data-theme="dark"] .mono-mark { filter: invert(1) brightness(1.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .marque-mark,
  :root:not([data-theme="light"]) .mono-mark { filter: invert(1) brightness(1.6); }
}
.marque-landing { text-align: center; }
.marque-landing .marque-mark { width: 120px; margin: 0 auto 6px; display: block; }
.marque-wordmark { font-family: var(--font-marque); text-transform: uppercase; letter-spacing: 0.28em; font-size: 26px; font-weight: 400; }
.marque-tag { color: var(--ink-soft); margin-top: 6px; font-size: 15px; }
.org-badge { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; }
.org-badge img { width: 84px; height: 84px; object-fit: contain; }
.org-badge .org-name { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.back-link { background: none; border: none; color: var(--ink-soft); font-size: 14px; margin-top: 20px; text-decoration: underline; }

/* ---------- Marque platform chrome ----------
   The landing, platform sign-in and Admin Centre wear Marque's own
   identity: Cannoli Cream, ink, and Academy Engraved LET for headings.
   Client organisations' colours and fonts never appear here. */

body.platform { --stone-light: #EDE6D6; --stone: #E0D5BE; }
:root[data-theme="dark"] body.platform, :root.dark body.platform { --stone-light: #1E1B17; --stone: #3A352D; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.platform { --stone-light: #1E1B17; --stone: #3A352D; }
}

body.platform .appbar .title,
body.platform .section-title,
body.platform h1, body.platform h2, body.platform h3,
body.platform .org-name {
  font-family: var(--font-marque);
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------
   Admin Centre v2 — the platform owner's workspace. A professional
   sidebar-and-content layout (dashboard, organisations, enquiries)
   in Marque platform chrome: deep ink sidebar, cream content. */

body.admin-mode #app { max-width: none; padding: 0; }
.admin-layout { display: flex; min-height: 100vh; width: 100%; }

.admin-side {
  width: 232px; flex: 0 0 232px;
  background: #171512; color: #EDE6D6;
  padding: 26px 14px 18px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; box-sizing: border-box;
}
.admin-side .brand {
  font-family: var(--font-marque); text-transform: uppercase;
  letter-spacing: 0.24em; font-size: 21px; padding: 0 12px;
}
.admin-side .brand-sub {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.5; padding: 4px 12px 20px;
}
.admin-side button.nav {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; box-sizing: border-box;
  background: none; border: none; color: inherit; cursor: pointer;
  font-family: var(--font-body); font-size: 14.5px;
  padding: 11px 12px; border-radius: 10px; opacity: 0.72;
}
.admin-side button.nav:hover { opacity: 1; background: rgba(237, 230, 214, 0.07); }
.admin-side button.nav.active { opacity: 1; background: rgba(237, 230, 214, 0.14); }
.admin-side button.nav .ic { display: inline-flex; }
.admin-side .side-spacer { flex: 1; }

.admin-main { flex: 1; min-width: 0; background: var(--stone-light); }
.admin-top {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 30px; background: var(--card);
  border-bottom: 1px solid var(--stone);
  position: sticky; top: 0; z-index: 5;
}
.admin-top h1 {
  font-family: var(--font-head); font-size: 20px; font-weight: 700;
  margin: 0; flex: 1; color: var(--ink);
}
.admin-top .back {
  background: none; border: none; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--ink); padding: 2px 10px; border-radius: 8px;
}
.admin-top .back:hover { background: var(--stone-light); }
.admin-user {
  display: flex; align-items: center; gap: 9px;
  background: var(--stone-light); border: 1px solid var(--stone);
  border-radius: 999px; padding: 5px 15px 5px 6px;
  font-size: 14px; color: var(--ink);
}
.admin-content {
  padding: 28px 30px 60px; max-width: 1180px;
  margin: 0 auto; box-sizing: border-box;
}

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.stat-card {
  background: var(--card); border-radius: 14px; padding: 18px 20px 16px;
  box-shadow: 0 1px 4px rgba(26, 26, 26, 0.05);
}
.stat-card .num {
  font-family: var(--font-head); font-size: 28px; font-weight: 700;
  color: var(--ink); line-height: 1.1;
}
.stat-card .lab {
  font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 5px;
}
.stat-card .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }

.card.table-card { padding: 0; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 13px 16px; border-bottom: 1px solid var(--stone);
  font-weight: 600; white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px; font-size: 14.5px; color: var(--ink);
  border-bottom: 1px solid var(--stone-light); white-space: nowrap;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tr.click { cursor: pointer; }
.admin-table tr.click:hover td { background: var(--stone-light); }
.admin-table .org-cell { display: flex; align-items: center; gap: 11px; }
.admin-table .org-cell .name { font-weight: 600; }
.admin-table .org-cell .sub { font-size: 12px; color: var(--ink-soft); }

@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-side {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 4px; padding: 12px 14px;
  }
  .admin-side .brand { font-size: 17px; padding: 0 8px; }
  .admin-side .brand-sub { display: none; }
  .admin-side button.nav { width: auto; padding: 8px 12px; }
  .admin-side .side-spacer { display: none; }
  .admin-top { padding: 14px 18px; }
  .admin-content { padding: 18px 16px 48px; }
}

/* ------------------------------------------------------------ Organisation Builder */

.builder { max-width: 1080px; }
.builder-steps {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 26px;
}
button.bstep {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; padding: 6px 8px; cursor: pointer;
  font: inherit; color: var(--ink-soft); border-radius: 10px;
}
button.bstep:disabled { cursor: default; opacity: 0.55; }
button.bstep .n {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--stone); font-size: 12.5px; font-weight: 700;
  background: var(--card); color: var(--ink-soft);
}
button.bstep .t { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; }
button.bstep.active .n { background: var(--accent); border-color: var(--accent); color: #fff; }
button.bstep.active { color: var(--ink); }
button.bstep.done .n { border-color: var(--accent); color: var(--accent); }
button.bstep.done { color: var(--ink); }
.bstep-line { flex: 1 1 18px; min-width: 14px; height: 1.5px; background: var(--stone); }
.bstep-line.done { background: var(--accent); }

.builder-cols { display: flex; gap: 28px; align-items: flex-start; }
.builder-panel { flex: 1 1 auto; min-width: 0; }
.btitle { font-size: 24px; margin: 0 0 6px; }
.builder-panel > .muted { margin: 0 0 18px; }
.bfield { margin-bottom: 14px; }
.bfield .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.bcard { margin-bottom: 16px; }
.bcard > .name { font-weight: 700; margin-bottom: 4px; }
.bcard > .sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.builder-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px; gap: 12px;
}
.builder-nav .btn { width: auto; min-width: 170px; }
.bdone-btns .btn { width: auto; min-width: 170px; }

.blogo-row { display: flex; gap: 16px; align-items: center; margin-top: 10px; }
.blogo-preview {
  width: 86px; height: 86px; border-radius: 16px; flex: none;
  border: 1.5px dashed var(--stone); background: var(--stone-light);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.blogo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.blogo-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.blogo-btns .btn { width: auto; padding: 9px 16px; font-size: 13.5px; }
.blogo-btns .sub { font-size: 12px; color: var(--ink-soft); }

.bswatch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-top: 6px;
}
label.bswatch {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border: 1px solid var(--stone-light); border-radius: 12px;
  background: var(--card); font-size: 13.5px;
}
label.bswatch input[type="color"] {
  width: 34px; height: 34px; border: none; padding: 0; background: none;
  border-radius: 8px; cursor: pointer; flex: none;
}

.bfont-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
button.bchip {
  border: 1.5px solid var(--stone); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; cursor: pointer;
}
button.bchip.active { border-color: var(--accent); background: var(--accent); color: #fff; }

button.bchoice {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  text-align: left; background: var(--card); border: 1.5px solid var(--stone-light);
  border-radius: 14px; padding: 15px 16px; margin-bottom: 10px;
  cursor: pointer; font: inherit; color: var(--ink);
}
button.bchoice.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
button.bchoice .name { display: block; font-weight: 700; }
button.bchoice .sub { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.bradio {
  width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 1.5px solid var(--stone);
}
.bradio.on { border: 5.5px solid var(--accent); }

.bdept-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bdept-head .name { font-weight: 700; }
.bdept-head .sub { flex: 1 1 auto; font-size: 12.5px; color: var(--ink-soft); }
.bdept-tools { display: flex; gap: 8px; }
.bdept-tools .btn { width: auto; padding: 7px 12px; font-size: 12.5px; white-space: nowrap; }
.bdept-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 8px; max-height: 430px; overflow-y: auto; padding: 2px;
}
button.bdept {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1.5px solid var(--stone-light);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink);
}
button.bdept.on { border-color: var(--accent); }
button.bdept .name { display: block; font-size: 13.5px; font-weight: 600; }
button.bdept .sub { display: block; font-size: 11.5px; color: var(--ink-soft); }
.bcheck {
  width: 19px; height: 19px; border-radius: 6px; flex: none;
  border: 1.5px solid var(--stone); display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; color: #fff;
}
.bcheck.on { background: var(--accent); border-color: var(--accent); }

.bsum { display: flex; gap: 14px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--stone-light); }
.bsum:last-child { border-bottom: none; }
.bsum .k { flex: 0 0 130px; color: var(--ink-soft); }
.bsum .v { font-weight: 600; }

.bp-host { flex: 0 0 300px; position: sticky; top: 24px; }
.bp-frame {
  border: 1.5px solid var(--stone); border-radius: 34px; padding: 10px;
  background: var(--card); box-shadow: 0 18px 40px rgba(0,0,0,0.10);
}
.bp-phone {
  border-radius: 26px; min-height: 480px; padding: 30px 18px 22px;
  display: flex; flex-direction: column; gap: 14px; overflow: hidden;
}
.bp-brand { text-align: center; margin-bottom: 4px; }
.bp-logo { max-height: 54px; max-width: 70%; object-fit: contain; margin: 0 auto 8px; display: block; }
.bp-mono {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 19px; letter-spacing: 0.04em;
}
.bp-name { font-size: 19px; font-weight: 700; color: #1A1A1A; }
.bp-tag { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(0,0,0,0.45); margin-top: 3px; }
.bp-card { border-radius: 16px; padding: 14px; box-shadow: 0 4px 14px rgba(0,0,0,0.05); }
.bp-line { height: 9px; border-radius: 5px; background: rgba(0,0,0,0.12); margin-bottom: 10px; }
.bp-line.w60 { width: 60%; }
.bp-line.w40 { width: 40%; }
.bp-field { height: 30px; border-radius: 9px; background: rgba(0,0,0,0.06); margin-bottom: 8px; }
.bp-btn {
  height: 34px; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.bp-dept { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #333; padding: 5px 0; }
.bp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.bp-caption { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: 10px; }

.bdone { text-align: center; padding: 30px 0 10px; }
.bdone-badge {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--accent); color: #fff; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.bdone-code {
  font-size: 44px; font-weight: 700; letter-spacing: 10px;
  margin: 22px 0 4px; color: var(--ink);
}
.bdone-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

@media (max-width: 980px) {
  .builder-cols { flex-direction: column; }
  .bp-host { position: static; flex: none; width: 100%; max-width: 340px; margin: 0 auto; }
}
