/**
 * The palette.
 *
 * Every colour in the system comes from here, so a theme is this block and
 * nothing else. The sidebar has its own variables rather than borrowing
 * --surface: it is the largest single area of colour on the screen, and a
 * theme that cannot change it cannot change how the product feels.
 */
/**
 * Brass: the product's palette.
 *
 * Here in :root rather than behind a data-theme attribute, because an
 * attribute has to be set by script -- and the sign-in page would then show
 * the old colours for as long as it takes the page to boot. The first thing
 * anybody sees should not be a flash of a palette we do not use.
 */
:root {
  color-scheme: light dark;
  --bg: #f1efea;
  --surface: #fffdf9;
  --surface-2: #f7f4ee;
  --border: #ddd6c9;
  --text: #1c1a16;
  --muted: #6b6456;
  --accent: #8a6a1f;
  --accent-soft: #f3ebd8;
  --accent-text: #ffffff;
  --danger: #973128;
  --danger-soft: #faeceb;
  --warn: #8a5f12;
  --warn-soft: #faf0dd;
  --ok: #4a6b2f;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(28,26,22,.06), 0 8px 24px rgba(28,26,22,.08);

  --sidebar: #2b2a26;
  --sidebar-text: #e8e3d8;
  --sidebar-muted: #9a9387;
  --sidebar-hover: #373530;
  --sidebar-active: #8a6a1f;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #2b2a26;
}

/* The pale green this started as, kept so it can be compared against. */
:root[data-theme="classic"] {
  --accent-text: #ffffff;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #dde3e0;
  --text: #17201c;
  --muted: #61706a;
  --accent: #1f6f4a;
  --accent-soft: #e6f2ec;
  --danger: #a4362b;
  --danger-soft: #fbeceb;
  --warn: #8a6116;
  --warn-soft: #fdf3e0;
  --ok: #1f6f4a;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  --sidebar: var(--surface);
  --sidebar-text: var(--text);
  --sidebar-muted: var(--muted);
  --sidebar-hover: var(--surface-2);
  --sidebar-active: var(--accent-soft);
  --sidebar-active-text: var(--accent);
  --sidebar-border: var(--border);
}

/* --------------------------------------------------------------- themes */

/**
 * Alternatives, chosen with data-theme on <html>.
 *
 * Each one is only this block: no component knows which theme is on. They
 * exist to be compared on the real screens rather than described, because
 * nobody can judge "a bit less pale" from a sentence.
 */

/* Ink — a dark chrome around light content. The contrast a firm's own staff
   look at all day, and the one that stops the page reading as a blank sheet. */
:root[data-theme="ink"] {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --border: #d2dae2;
  --text: #0f1821;
  --muted: #5a6b7c;
  --accent: #15507d;
  --accent-soft: #e4edf6;
  --accent-text: #ffffff;
  --danger: #9c2f27;
  --danger-soft: #f8eceb;
  --warn: #8a5f12;
  --warn-soft: #fbf1df;
  --ok: #1a6b4a;
  --sidebar: #16202b;
  --sidebar-text: #dbe4ee;
  --sidebar-muted: #8294a8;
  --sidebar-hover: #202d3b;
  --sidebar-active: #15507d;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #16202b;
  --shadow: 0 1px 2px rgba(15,24,33,.06), 0 8px 24px rgba(15,24,33,.08);
}

/* Forest — the current green, given weight. Same brand, far less pale. */
:root[data-theme="forest"] {
  --bg: #eef2ef;
  --surface: #ffffff;
  --surface-2: #f4f8f5;
  --border: #ccd8d0;
  --text: #10201a;
  --muted: #55675e;
  --accent: #14523a;
  --accent-soft: #e2efe8;
  --accent-text: #ffffff;
  --danger: #a4362b;
  --danger-soft: #fbeceb;
  --warn: #8a6116;
  --warn-soft: #fdf3e0;
  --ok: #14523a;
  --sidebar: #11372a;
  --sidebar-text: #dceae2;
  --sidebar-muted: #86a496;
  --sidebar-hover: #1a4536;
  --sidebar-active: #2f7f5c;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #11372a;
  --shadow: 0 1px 2px rgba(16,32,26,.06), 0 8px 24px rgba(16,32,26,.08);
}


/* Night — dark throughout, for whoever is still reconciling at eleven. */
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #0e1316;
  --surface: #161d21;
  --surface-2: #1d262b;
  --border: #2a353b;
  --text: #e4ebee;
  --muted: #90a2ab;
  --accent: #35a277;
  --accent-soft: #15302a;
  --accent-text: #05120d;
  --danger: #d9685c;
  --danger-soft: #2d1a19;
  --warn: #d2a048;
  --warn-soft: #2d2518;
  --ok: #35a277;
  --sidebar: #0a0e11;
  --sidebar-text: #d4dee3;
  --sidebar-muted: #7a8c96;
  --sidebar-hover: #161d21;
  --sidebar-active: #1d3b32;
  --sidebar-active-text: #4fc294;
  --sidebar-border: #1b242a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1a201d;
    --surface-2: #212925;
    --border: #2e3833;
    --text: #e6ebe8;
    --muted: #93a29b;
    --accent: #4bbd88;
    --accent-soft: #16302479;
    --danger: #e58176;
    --danger-soft: #3a201d;
    --warn: #dcae5c;
    --warn-soft: #33280f;
    --ok: #4bbd88;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em;
       background: var(--surface-2); padding: .1em .4em; border-radius: 4px; }

/* ---------------------------------------------------------------- layout */

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* The staging band spans both columns, above the sidebar and the page. Loud on
   purpose: its whole job is to be impossible to miss on a screen that
   otherwise looks exactly like production. */
.app.has-env-banner { grid-template-rows: auto 1fr; }
.env-banner {
  grid-column: 1 / -1;
  background: #8a4b00; color: #fff;
  padding: 7px 16px; font-size: .88rem; line-height: 1.4;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.env-banner strong { letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }

.sidebar {
  background: var(--sidebar); color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 18px; font-weight: 650; letter-spacing: -.01em; }
.brand svg { flex: none; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--sidebar-muted); letter-spacing: 0; }

.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--sidebar-text);
  text-decoration: none; font-size: .93rem; border: 0; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 550; }
.nav-spacer { flex: 1; }
.nav-foot { padding: 10px; border-top: 1px solid var(--sidebar-hover); font-size: .82rem; color: var(--sidebar-muted); }

.main { padding: 26px 32px 60px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head p { margin: 0; color: var(--muted); max-width: 62ch; }

/* ----------------------------------------------------------- components */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-note { color: var(--muted); font-size: .88rem; margin: -4px 0 16px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

label { display: block; font-size: .84rem; font-weight: 550; margin-bottom: 5px; color: var(--muted); }
input, select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 7px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

button, .btn {
  font: inherit; font-weight: 550; padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); filter: none; }
button.danger { background: var(--danger); border-color: var(--danger); }
button.small { padding: 5px 11px; font-size: .85rem; }

table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem;
     text-transform: uppercase; letter-spacing: .03em; padding: 0 10px 8px; }
td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: top; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .77rem; font-weight: 600; }
.pill.draft { background: var(--surface-2); color: var(--muted); }
.pill.sending { background: var(--accent-soft); color: var(--accent); }
.pill.done, .pill.sent { background: var(--accent-soft); color: var(--ok); }
.pill.paused { background: var(--warn-soft); color: var(--warn); }
.pill.scheduled { background: var(--accent-soft); color: var(--accent); }
.pill.failed, .pill.cancelled { background: var(--danger-soft); color: var(--danger); }
.pill.pending { background: var(--surface-2); color: var(--muted); }
.pill.pending_approval { background: var(--warn-soft); color: var(--warn); }
.pill.suppressed { background: var(--warn-soft); color: var(--warn); }

.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .91rem; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.ok { background: var(--accent-soft); color: var(--accent); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }

.bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.bar .s { background: var(--ok); }
.bar .f { background: var(--danger); }
.bar .u { background: var(--warn); }

.stat { display: flex; gap: 26px; flex-wrap: wrap; }
.stat div { min-width: 76px; }
.stat b { display: block; font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--muted); }

.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps button {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  font-weight: 500; font-size: .88rem;
}
.steps button.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.steps button.done::before { content: "✓ "; color: var(--ok); }

.preview {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface);
}
.preview-head { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .88rem; }
.preview-head div { margin: 2px 0; }
.preview-body { padding: 16px; }
.preview-body iframe { width: 100%; min-height: 320px; border: 0; background: #fff; }

/* ------------------------------------------------------ email designer */

.email-designer {
  margin: 4px 0 18px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); overflow: hidden;
}
.designer-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.designer-heading label { margin: 0; color: var(--text); font-size: .92rem; }
.designer-heading .hint { font-size: .78rem; color: var(--muted); }
.segmented { display: inline-flex; flex: none; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.segmented button {
  width: auto; min-height: 34px; padding: 6px 12px; border: 0; border-right: 1px solid var(--border);
  border-radius: 0; background: var(--surface); color: var(--muted); font-size: .82rem;
}
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--accent-soft); color: var(--accent); }
.segmented.compact button { min-height: 28px; padding: 4px 8px; font-size: .76rem; }

.design-library { padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.design-library summary { padding: 11px 0; color: var(--accent); font-size: .84rem; font-weight: 600; cursor: pointer; }
.design-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; padding: 2px 0 16px; overflow-x: auto; }
.design-choice {
  min-height: 112px; padding: 11px; border-color: var(--border); background: var(--surface);
  color: var(--text); text-align: left; font-weight: 500;
}
.design-choice:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); filter: none; }
.design-choice strong, .design-choice small { display: block; }
.design-choice strong { margin: 8px 0 3px; font-size: .84rem; }
.design-choice small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.design-swatch { display: block; height: 22px; border-radius: 4px; background: var(--design-color); }

.designer-workspace { display: grid; grid-template-columns: minmax(420px, 1.25fr) minmax(300px, .75fr); min-height: 610px; }
.designer-compose { min-width: 0; border-right: 1px solid var(--border); background: var(--surface); }
.designer-toolbar {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-height: 51px;
  padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.designer-toolbar button, .designer-toolbar select {
  width: auto; min-height: 32px; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); color: var(--text); font-size: .77rem;
}
.designer-toolbar select { max-width: 112px; }
.designer-toolbar input[type=color] {
  width: 32px; height: 32px; padding: 3px; border-radius: 6px; cursor: pointer;
}
.designer-stylebar {
  display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 10px;
  border-bottom: 1px solid var(--border); color: var(--muted); font-size: .76rem;
}
.color-swatch {
  width: 23px; height: 23px; padding: 0; border: 2px solid var(--surface);
  border-radius: 50%; outline: 1px solid var(--border); background: var(--swatch);
}
.color-swatch:hover:not(:disabled) { outline-color: var(--text); filter: none; }
.editor-panel { min-height: 520px; padding: 14px; background: #e7ebe9; }
.visual-editor-frame { display: block; width: 100%; min-height: 520px; border: 1px solid #cfd6d2; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.source-editor { display: block; min-height: 520px; margin: 0; border-radius: 4px; background: #fff; color: #17201c; }

.designer-preview { min-width: 0; padding: 12px; background: var(--surface-2); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: .82rem; }
.preview-subject {
  min-height: 36px; margin-bottom: 8px; padding: 8px 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: .75rem; overflow-wrap: anywhere;
}
.preview-canvas { display: flex; justify-content: center; width: 100%; overflow: auto; }
.preview-canvas iframe {
  width: 100%; height: 520px; border: 1px solid var(--border); background: #fff;
  transition: width .18s ease;
}
.preview-canvas.mobile iframe { width: 320px; }
.designer-footnote { padding: 9px 14px; border-top: 1px solid var(--border); background: var(--surface); }

.compatibility-report { padding: 14px; border-top: 1px solid var(--border); background: var(--surface); }
.compatibility-report.compact { padding: 0; border: 0; }
.compatibility-loading { padding: 12px 14px; margin: 0; }
.compatibility-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.compatibility-client { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.compatibility-client .spread { align-items: flex-start; }
.compatibility-client ul { margin: 10px 0 0; padding-left: 18px; font-size: .8rem; }
.compatibility-client li { margin: 7px 0; }
.compatibility-client li strong { text-transform: capitalize; }
.compatibility-blocker strong { color: var(--danger); }
.compatibility-warning strong { color: var(--warn); }
.compatibility-note strong { color: var(--muted); }

/* ------------------------------------------------ brand, assets, designs */

.brand-kit-grid { display: grid; grid-template-columns: 1fr 1fr minmax(220px, .85fr); gap: 20px; align-items: start; }
.brand-colours { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.brand-colour { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 9px; padding: 7px; background: var(--surface-2); border-radius: 6px; }
.brand-colour input { width: 42px; height: 38px; padding: 3px; }
.brand-colour label { margin: 0; color: var(--text); }
.brand-colour label span { display: block; color: var(--muted); font-size: .74rem; font-family: ui-monospace, Consolas, monospace; }
.brand-preview { min-height: 162px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: var(--brand-bg); color: var(--brand-text); border: 1px solid var(--border); border-top: 5px solid var(--brand-primary); border-radius: 6px; }
.brand-preview img { display: block; max-width: 150px; max-height: 52px; width: auto; height: auto; margin-bottom: 6px; }
.brand-preview strong { font-size: 1.05rem; }
.brand-preview span { font-size: .82rem; }
.brand-preview i { display: block; width: 72px; height: 7px; margin-top: auto; background: var(--brand-secondary); }
.asset-upload { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.asset-upload .field { margin: 0; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.asset-tile { min-width: 0; padding: 10px; background: var(--surface-2); border-radius: 6px; }
.asset-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; margin-bottom: 9px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.asset-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.asset-meta { min-width: 0; margin-bottom: 9px; }
.asset-meta strong, .asset-meta span { display: block; overflow-wrap: anywhere; }
.asset-meta span { color: var(--muted); font-size: .74rem; }
.archive-section { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.archive-section summary { margin-bottom: 12px; color: var(--accent); cursor: pointer; font-weight: 600; }
.design-list, .version-list { display: grid; gap: 0; }
.design-row, .version-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.design-row:first-child, .version-row:first-child { border-top: 0; }
.design-row > div:first-child, .version-row > div:first-child { min-width: 0; }
.version-list { max-height: 62vh; overflow: auto; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 380px; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: .8rem; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.signup-wrap { min-height: 100vh; padding: 28px; }
.signup { width: min(940px, 100%); margin: 0 auto; }
.signup-brand { justify-content: center; padding: 4px 0 24px; }
.signup-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.signup-heading p { margin: 0; color: var(--muted); }
.signup-form { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); gap: 18px; align-items: start; }
.signup-details, .signup-plans { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 22px; }
.signup-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check-line { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-weight: 400; line-height: 1.4; }
.check-line input { flex: none; margin-top: 3px; }
.plan-grid { display: grid; gap: 10px; margin: 0 0 18px; }
.provider-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; }
.provider-choice { position: relative; margin: 0; cursor: pointer; }
.provider-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.provider-choice > span { display: grid; gap: 3px; min-height: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; }
.provider-choice small { color: var(--muted); font-weight: 400; line-height: 1.35; }
.provider-choice input:checked + span { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.provider-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-choice { position: relative; margin: 0; color: var(--text); cursor: pointer; }
.plan-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.plan-choice-body { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.plan-choice input:checked + .plan-choice-body { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.plan-choice input:focus-visible + .plan-choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-price { text-align: right; font-weight: 650; }
.plan-prices { display: grid; align-items: start; }
.plan-price small { display: block; color: var(--muted); font-weight: 400; }
.plan-choice ul { margin: 2px 0 0; padding-left: 18px; color: var(--muted); font-size: .82rem; }
.legal-line { margin: 0 0 16px; font-size: .84rem; }
.payment-note { margin: 10px 0 0; text-align: center; }
.checkout-launch { width: min(460px, calc(100% - 32px)); margin: 14vh auto 0; padding: 24px; text-align: center; }
.checkout-launch .brand { justify-content: center; }
.checkout-launch h1 { margin: 22px 0 8px; font-size: 1.35rem; }
.error-text { color: var(--danger); }
.billing-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.billing-summary div { min-width: 0; }
.billing-summary span, .billing-summary strong { display: block; overflow-wrap: anywhere; }
.billing-summary span { color: var(--muted); font-size: .78rem; }
.billing-summary strong { margin-top: 3px; font-size: .9rem; }

.drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px;
  text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2);
}
.drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.toast-host { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 11px 15px; box-shadow: var(--shadow); max-width: 380px; font-size: .9rem;
  animation: slide .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
@keyframes slide { from { opacity: 0; transform: translateY(6px); } }

dialog {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--text); padding: 24px; max-width: 520px; width: calc(100% - 40px); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.4); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; align-items: center; padding: 10px; }
  .brand { padding: 0 10px 0 4px; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-foot, .nav-spacer { display: none; }
  .main { padding: 18px 16px 50px; }
  .designer-heading { align-items: flex-start; flex-direction: column; }
  .designer-workspace { grid-template-columns: 1fr; }
  .designer-compose { border-right: 0; border-bottom: 1px solid var(--border); }
  .designer-preview { padding: 10px; }
  .design-grid { grid-template-columns: repeat(5, 150px); }
  .compatibility-grid, .brand-kit-grid { grid-template-columns: 1fr; }
  .asset-upload { grid-template-columns: 1fr; align-items: stretch; }
  .design-row, .version-row { align-items: flex-start; flex-direction: column; }
  .signup-wrap { padding: 20px 14px; }
  .signup-heading { align-items: stretch; flex-direction: column; }
  .signup-heading button { width: 100%; }
  .signup-form { grid-template-columns: 1fr; }
  .signup-details, .signup-plans { padding: 18px; }
  .provider-options { grid-template-columns: 1fr; }
  .billing-summary { grid-template-columns: 1fr; gap: 10px; }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .designer-workspace { grid-template-columns: 1fr; }
  .designer-compose { border-right: 0; border-bottom: 1px solid var(--border); }
  .compatibility-grid { grid-template-columns: 1fr; }
  .brand-kit-grid { grid-template-columns: 1fr 1fr; }
}

/* The palette picker, while a look is being chosen. Lives in the sidebar foot
   so it is always reachable and never in the way of what is being judged. */
.theme-picker {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 10px 2px 0; margin-top: 6px; border-top: 1px solid var(--sidebar-hover);
}
.theme-picker span {
  width: 100%; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sidebar-muted); margin-bottom: 2px;
}
.theme-chip {
  font: inherit; font-size: .74rem; padding: 3px 8px; border-radius: 999px;
  cursor: pointer; background: transparent; color: var(--sidebar-muted);
  border: 1px solid var(--sidebar-hover);
}
.theme-chip:hover:not(:disabled) { color: var(--sidebar-text); filter: none; }
.theme-chip.on {
  background: var(--sidebar-active); color: var(--sidebar-active-text);
  border-color: var(--sidebar-active);
}

/* A setting a firm cannot change, shown as a statement rather than a disabled
   control: a greyed-out dropdown invites somebody to try to enable it. */
.readonly-note {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 11px; font-size: .88rem; color: var(--muted);
}

/* Signup, now that nothing is being chosen or paid for. The right-hand column
   is information rather than a form: what you get free, and what it costs
   later, visible before anybody commits to anything. */
.signup-narrow { max-width: 520px; }
.free-tier {
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-soft); padding: 14px 16px; margin-bottom: 20px;
}
.free-tier p { margin: 0 0 8px; }
.free-tier p:last-child { margin-bottom: 0; }
.plans-later { margin-top: 0; }
.plan-card {
  display: grid; gap: 6px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.plan-card .plan-price { white-space: nowrap; font-weight: 600; }

/* The free-period countdown. Spans both columns like the staging band, and
   gets plainer rather than louder as it runs down: a bar that shouts from a
   month out is one nobody reads on the last day. */
.trial-banner {
  grid-column: 1 / -1;
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 8px 16px; font-size: .88rem; line-height: 1.45;
  background: var(--accent-soft); color: var(--text);
  border-bottom: 1px solid var(--border);
}
.trial-banner.soon { background: var(--warn-soft); }
.trial-banner.last { background: var(--warn); color: #fff; }
.trial-banner.over { background: var(--danger); color: #fff; }
.trial-banner span { color: inherit; opacity: .9; }
.trial-banner button {
  margin-left: auto; font-size: .82rem; padding: 4px 11px;
  background: transparent; border: 1px solid currentColor; color: inherit;
}
.trial-banner.coming button, .trial-banner.soon button { border-color: var(--accent); color: var(--accent); }
