/**
 * 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;
  --accent-hover: #74581a;
  --danger: #973128;
  --danger-soft: #faeceb;
  --warn: #8a5f12;
  --warn-soft: #faf0dd;
  --ok: #4a6b2f;
  --radius: 10px;
  --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;
  --accent-hover: #1a5c3d;
  --danger: #a4362b;
  --danger-soft: #fbeceb;
  --warn: #8a6116;
  --warn-soft: #fdf3e0;
  --ok: #1f6f4a;

  --sidebar: #11261d;
  --sidebar-text: #e7efe9;
  --sidebar-muted: #8ba296;
  --sidebar-hover: #1b3328;
  --sidebar-active: #1f6f4a;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #11261d;
}

:root[data-theme="forest"] {
  --bg: #eef1ec;
  --surface: #fbfcfa;
  --surface-2: #f3f6f1;
  --border: #d8e0d4;
  --text: #19211a;
  --muted: #5f6b5d;
  --accent: #3f6b2f;
  --accent-soft: #e8f0e3;
  --accent-text: #ffffff;
  --accent-hover: #345827;
  --danger: #9c3327;
  --danger-soft: #f9ebe9;
  --warn: #8a6116;
  --warn-soft: #fbf2df;
  --ok: #3f6b2f;

  --sidebar: #22291f;
  --sidebar-text: #e7ece4;
  --sidebar-muted: #929c8c;
  --sidebar-hover: #2d352a;
  --sidebar-active: #3f6b2f;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #22291f;
}

:root[data-theme="ink"] {
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --border: #d9dee4;
  --text: #16191d;
  --muted: #5d646e;
  --accent: #2f4f7a;
  --accent-soft: #e7edf5;
  --accent-text: #ffffff;
  --accent-hover: #264164;
  --danger: #9b3129;
  --danger-soft: #f9ecea;
  --warn: #8a5f12;
  --warn-soft: #fbf1df;
  --ok: #2f6b4a;

  --sidebar: #1e232a;
  --sidebar-text: #e6eaef;
  --sidebar-muted: #8d95a1;
  --sidebar-hover: #282e37;
  --sidebar-active: #2f4f7a;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #1e232a;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #16171a;
  --surface: #1e2024;
  --surface-2: #26282d;
  --border: #33363c;
  --text: #e9e9ea;
  --muted: #9b9ca1;
  --accent: #c9a24a;
  --accent-soft: #2e2a20;
  --accent-text: #16171a;
  --accent-hover: #d8b05a;
  --danger: #e0756a;
  --danger-soft: #30211f;
  --warn: #d9a44a;
  --warn-soft: #2e2719;
  --ok: #86b86a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);

  --sidebar: #121316;
  --sidebar-text: #e2e2e4;
  --sidebar-muted: #86878c;
  --sidebar-hover: #1f2024;
  --sidebar-active: #c9a24a;
  --sidebar-active-text: #16171a;
  --sidebar-border: #121316;
}

/**
 * The scales.
 *
 * Outside the theme blocks because they are not colour: a palette changes how
 * the product feels, these decide whether it feels designed at all.
 *
 * The spacing scale exists because there wasn't one. Nearly three hundred
 * inline style="margin-top:12px" attributes had accumulated in the markup --
 * every one of them somebody reaching for a number because the stylesheet
 * offered none. A scale is what stops that, and the only way to keep layout
 * answerable to this file rather than to the markup.
 *
 * The type scale replaces three sizes doing all the work. Hierarchy made out
 * of size alone needs big jumps to read at all; made out of size, weight and
 * colour together it can be quiet, which is what lets a dense screen stay
 * calm.
 */
:root {
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px;

  --t-xs: .75rem;    --t-sm: .8125rem;  --t-md: .9375rem;
  --t-lg: 1.0625rem; --t-xl: 1.375rem;  --t-2xl: 1.75rem;

  --radius-sm: 6px;

  /* Depth instead of outline. Used on surfaces that sit on the page, so a
     border is free to mean a real division rather than "this is a box". */
  --lift: 0 1px 2px rgba(28,26,22,.04), 0 1px 3px rgba(28,26,22,.06);
  --hairline: color-mix(in srgb, var(--border) 55%, transparent);
}

:root[data-theme="night"] {
  --lift: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

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

h1, h2, h3 { line-height: 1.22; margin: 0 0 .4em; letter-spacing: -.011em; }
h1 { font-size: var(--t-2xl); font-weight: 640; letter-spacing: -.02em; }
h2 { font-size: var(--t-xl); font-weight: 620; }
h3 { font-size: var(--t-lg); font-weight: 600; }
a { color: var(--accent); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .875em;
       background: var(--surface-2); padding: .1em .4em; border-radius: 4px; }

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

.app { display: grid; grid-template-columns: 236px 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 var(--s4); font-size: var(--t-sm); line-height: 1.4;
  display: flex; gap: var(--s2); flex-wrap: wrap; align-items: baseline;
}
.env-banner strong { letter-spacing: .04em; text-transform: uppercase; font-size: var(--t-xs); }

.sidebar {
  background: var(--sidebar); color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  padding: var(--s5) var(--s3); display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s3) var(--s5);
         font-weight: 620; letter-spacing: -.01em; font-size: var(--t-md); }
.brand svg { flex: none; }
.brand small { display: block; font-weight: 450; font-size: var(--t-xs);
               color: var(--sidebar-muted); letter-spacing: 0; }

.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 7px var(--s3); border-radius: var(--radius-sm); cursor: pointer;
  color: var(--sidebar-muted);
  text-decoration: none; font-size: var(--t-sm); font-weight: 500;
  border: 0; background: none; width: 100%; text-align: left; font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 560; }
.nav-spacer { flex: 1; }
.nav-foot { padding: var(--s3); border-top: 1px solid var(--sidebar-hover);
            font-size: var(--t-xs); color: var(--sidebar-muted); }

.main { padding: var(--s6) var(--s7) var(--s7); max-width: 1140px; }

/*
 * The title leads; the explanation follows it rather than sharing its line.
 * Measured to 58 characters, because a paragraph that runs the width of the
 * screen is one nobody reads -- and every screen in this product opens with
 * one.
 */
.page-head { display: flex; align-items: flex-start; justify-content: space-between;
             gap: var(--s5); margin-bottom: var(--s5); }
.page-head p { margin: var(--s2) 0 0; color: var(--muted); max-width: 58ch;
               font-size: var(--t-sm); line-height: 1.5; }

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

/*
 * A card is a surface, not a box.
 *
 * It had a 1px border, and so did the table inside it, and the notice inside
 * that. Hierarchy made entirely out of outlines gives every region the same
 * weight, which is most of what made this look like a form from 2012. A
 * background and one hairline of shadow separate it from the page, and leave
 * borders free to mean a real division.
 */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--lift); padding: var(--s5); margin-bottom: var(--s4);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-note { color: var(--muted); font-size: var(--t-sm); margin: var(--s1) 0 var(--s4);
             max-width: 64ch; line-height: 1.5; }

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

label { display: block; font-size: var(--t-sm); font-weight: 560; margin-bottom: 5px; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: var(--t-sm); width: 100%; padding: 9px 11px;
  border-radius: var(--radius-sm);
  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: var(--t-sm); }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 7px; }
.field { margin-bottom: var(--s4); }
.field .hint { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s1); line-height: 1.45; }

button, .btn {
  font: inherit; font-size: var(--t-sm); font-weight: 560;
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  box-shadow: 0 1px 1px rgba(28,26,22,.05);
  transition: background .12s ease, border-color .12s ease;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); }
button.danger { background: var(--danger); border-color: transparent; color: #fff; }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 85%, #000); }
button.small { padding: 5px 10px; font-size: var(--t-xs); }

/*
 * Rows, not a grid of cells.
 *
 * The header was an uppercase band competing with the data under it; it is a
 * quiet label now. Dividers are faint enough to be felt rather than read, and
 * a row answers the cursor so a list of four hundred clients stays navigable.
 */
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th { text-align: left; font-weight: 560; color: var(--muted); font-size: var(--t-xs);
     letter-spacing: 0; padding: 0 var(--s3) var(--s2); white-space: nowrap; }
td { padding: 11px var(--s3); border-top: 1px solid var(--hairline); vertical-align: middle; }
tbody tr:hover td { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
/* Figures line up only if the digits are the same width. */
td.num, th.num, .num { text-align: right; font-variant-numeric: tabular-nums; }

/*
 * A dot carries the state; the word explains it.
 *
 * Colour alone is a poor signal -- it is the first thing lost to a colour
 * deficiency or a bad screen -- and on several of these pages the pill holds
 * the most important word on it.
 */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 560; letter-spacing: -.003em;
  background: var(--surface-2); color: var(--muted);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
                background: currentColor; flex: none; }
.pill.draft { background: var(--surface-2); color: var(--muted); }
.pill.sending { background: var(--accent-soft); color: var(--accent); }
.pill.done, .pill.sent { background: color-mix(in srgb, var(--ok) 12%, transparent); 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(--warn-soft); color: var(--warn); }
.pill.pending_approval { background: var(--warn-soft); color: var(--warn); }
.pill.suppressed { background: var(--warn-soft); color: var(--warn); }

/* A rule of colour on the leading edge, rather than a wash across the whole
   block: the text stays as readable as body text, which is the point of a
   notice somebody has to act on. */
.notice { padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
          margin-bottom: var(--s3); font-size: var(--t-sm); line-height: 1.5;
          background: var(--surface-2); border-left: 3px solid var(--border); }
.notice.error { background: var(--danger-soft); border-left-color: var(--danger); color: var(--danger); }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); color: var(--warn); }
.notice.ok { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent); }
.notice ul { margin: var(--s1) 0 0; padding-left: 20px; }

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

/*
 * Space above a block, on the scale.
 *
 * There are still close to three hundred inline style="margin-top:12px"
 * attributes in the markup, and these are what they should have been. Left as
 * a thing to reach for rather than swept through in one pass: the screens
 * render correctly as they are, and three hundred blind edits to fix a rhythm
 * nobody can see is a poor trade for the chance of breaking a layout nobody
 * is looking at. New markup uses these; old markup loses an inline style each
 * time somebody is in there for another reason.
 */
.mt-1 { margin-top: var(--s1); }
.mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); }
.mb-0 { margin-bottom: 0; }
.flush { margin: 0; }

.bar { height: 6px; 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); }

/* Figures are the thing being read here, so they get the size and the label
   gets out of the way. */
.stat { display: flex; gap: var(--s6); flex-wrap: wrap; }
.stat div { min-width: 76px; }
.stat b { display: block; font-size: var(--t-xl); font-weight: 620; letter-spacing: -.02em;
          font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat span { font-size: var(--t-xs); color: var(--muted); }

.steps { display: flex; gap: var(--s1); margin-bottom: var(--s5); flex-wrap: wrap; }
.steps button {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  font-weight: 500; font-size: var(--t-sm); box-shadow: none;
}
.steps button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.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: var(--radius-sm); overflow: hidden; background: var(--surface);
}
.preview-head { padding: var(--s3) var(--s4); background: var(--surface-2);
                border-bottom: 1px solid var(--border); font-size: var(--t-sm); }
.preview-head div { margin: 2px 0; }
.preview-body { padding: var(--s4); }
.preview-body iframe { width: 100%; min-height: 320px; border: 0; background: #fff; }

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

.email-designer {
  margin: var(--s1) 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden;
}
.designer-heading {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); background: var(--surface);
}
.designer-heading label { margin: 0; color: var(--text); font-size: var(--t-md); }
.designer-heading .hint { font-size: var(--t-xs); color: var(--muted); }
.segmented { display: inline-flex; flex: none; border: 1px solid var(--border);
             border-radius: var(--radius-sm); overflow: hidden; }
.segmented button {
  width: auto; min-height: 34px; padding: 6px var(--s3); border: 0; border-right: 1px solid var(--border);
  border-radius: 0; background: var(--surface); color: var(--muted); font-size: var(--t-sm);
  box-shadow: none;
}
.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 var(--s2); font-size: var(--t-xs); }

.design-library { padding: 0 var(--s4); border-bottom: 1px solid var(--border); background: var(--surface); }
.design-library summary { padding: 11px 0; color: var(--accent); font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.design-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: var(--s2);
               padding: 2px 0 var(--s4); overflow-x: auto; }
.design-choice {
  min-height: 112px; padding: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-align: left; font-weight: 500; box-shadow: none;
}
.design-choice:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); }
.design-choice strong, .design-choice small { display: block; }
.design-choice strong { margin: var(--s2) 0 3px; font-size: var(--t-sm); }
.design-choice small { color: var(--muted); font-size: var(--t-xs); 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: var(--s2); border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.designer-toolbar button, .designer-toolbar select {
  width: auto; min-height: 32px; padding: 5px var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-size: var(--t-xs); box-shadow: none;
}
.designer-toolbar select { max-width: 112px; }
.designer-toolbar input[type=color] {
  width: 32px; height: 32px; padding: 3px; border-radius: var(--radius-sm); cursor: pointer;
}
.designer-stylebar {
  display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px var(--s2);
  border-bottom: 1px solid var(--border); color: var(--muted); font-size: var(--t-xs);
}
.color-swatch {
  width: 23px; height: 23px; padding: 0; border: 2px solid var(--surface);
  border-radius: 50%; outline: 1px solid var(--border); background: var(--swatch); box-shadow: none;
}
.color-swatch:hover:not(:disabled) { outline-color: var(--text); }
.editor-panel { min-height: 520px; padding: var(--s3); background: var(--surface-2); }
.visual-editor-frame { display: block; width: 100%; min-height: 520px; border: 1px solid var(--border);
                       background: #fff; box-shadow: var(--lift); }
.source-editor { display: block; min-height: 520px; margin: 0; border-radius: 4px; background: #fff; color: #17201c; }

.designer-preview { min-width: 0; padding: var(--s3); background: var(--surface-2); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
                   margin-bottom: var(--s2); font-size: var(--t-sm); }
.preview-subject {
  min-height: 36px; margin-bottom: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: var(--t-xs); 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 var(--s3); border-top: 1px solid var(--border); background: var(--surface); }

.compatibility-report { padding: var(--s3); border-top: 1px solid var(--border); background: var(--surface); }
.compatibility-report.compact { padding: 0; border: 0; }
.compatibility-loading { padding: var(--s3); margin: 0; }
.compatibility-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.compatibility-client { min-width: 0; padding: var(--s3); background: var(--surface-2); border-radius: var(--radius-sm); }
.compatibility-client .spread { align-items: flex-start; }
.compatibility-client ul { margin: var(--s2) 0 0; padding-left: 18px; font-size: var(--t-sm); }
.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: var(--s5); align-items: start; }
.brand-colours { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.brand-colour { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 9px;
                padding: 7px; background: var(--surface-2); border-radius: var(--radius-sm); }
.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: var(--t-xs); font-family: ui-monospace, Consolas, monospace; }
.brand-preview { min-height: 162px; padding: var(--s4); display: flex; flex-direction: column;
                 align-items: flex-start; gap: var(--s2); background: var(--brand-bg); color: var(--brand-text);
                 border: 1px solid var(--border); border-top: 5px solid var(--brand-primary); border-radius: var(--radius-sm); }
.brand-preview img { display: block; max-width: 150px; max-height: 52px; width: auto; height: auto; margin-bottom: 6px; }
.brand-preview strong { font-size: var(--t-lg); }
.brand-preview span { font-size: var(--t-sm); }
.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: var(--s3);
                align-items: end; margin-bottom: var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid var(--hairline); }
.asset-upload .field { margin: 0; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s3); }
.asset-tile { min-width: 0; padding: var(--s2); background: var(--surface-2); border-radius: var(--radius-sm); }
.asset-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; margin-bottom: 9px; overflow: hidden;
               background: var(--surface); border: 1px solid var(--hairline); border-radius: 4px; }
.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: var(--t-xs); }
.archive-section { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--hairline); }
.archive-section summary { margin-bottom: var(--s3); 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: var(--s4);
                            padding: var(--s3) 0; border-top: 1px solid var(--hairline); }
.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: var(--s5); }
.login { width: 100%; max-width: 380px; }
.login-divider { display: flex; align-items: center; gap: var(--s2); margin: var(--s4) 0; color: var(--muted); font-size: var(--t-sm); }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.signup-wrap { min-height: 100vh; padding: var(--s6); }
.signup { width: min(940px, 100%); margin: 0 auto; }
.signup-brand { justify-content: center; padding: var(--s1) 0 var(--s5); }
.signup-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s5); }
.signup-heading p { margin: var(--s2) 0 0; color: var(--muted); font-size: var(--t-sm); max-width: 58ch; }
.signup-form { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); gap: var(--s5); align-items: start; }
.signup-details, .signup-plans { background: var(--surface); border-radius: var(--radius);
                                 box-shadow: var(--lift); padding: var(--s5); }
.signup-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check-line { display: flex; align-items: flex-start; gap: var(--s2); color: var(--text); font-weight: 400; line-height: 1.45; }
.check-line input { flex: none; margin-top: 3px; }
.plan-grid { display: grid; gap: var(--s2); margin: 0 0 var(--s5); }
.provider-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin: 0 0 var(--s5); }
.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 var(--s3);
                          border: 1px solid var(--border); border-radius: var(--radius-sm); }
.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: var(--s3); border: 1px solid var(--border);
                    border-radius: var(--radius-sm); 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; font-variant-numeric: tabular-nums; }
.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: var(--t-sm); }
.legal-line { margin: 0 0 var(--s4); font-size: var(--t-sm); }
.payment-note { margin: var(--s2) 0 0; text-align: center; }
.checkout-launch { width: min(460px, calc(100% - 32px)); margin: 14vh auto 0; padding: var(--s5); text-align: center; }
.checkout-launch .brand { justify-content: center; }
.checkout-launch h1 { margin: var(--s5) 0 var(--s2); font-size: var(--t-xl); }
.error-text { color: var(--danger); }
.billing-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin: var(--s5) 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: var(--t-xs); }
.billing-summary strong { margin-top: 3px; font-size: var(--t-md); font-variant-numeric: tabular-nums; }

.drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: var(--s6);
  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: var(--s5); bottom: var(--s5); display: flex; flex-direction: column;
              gap: var(--s2); z-index: 50; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 11px 15px; box-shadow: var(--shadow); max-width: 380px;
  font-size: var(--t-sm);
  animation: slide .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
@keyframes slide { from { opacity: 0; transform: translateY(6px); } }

dialog {
  border: 0; border-radius: var(--radius); background: var(--surface);
  color: var(--text); padding: var(--s5); 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: var(--s2); }
  .brand { padding: 0 var(--s2) 0 var(--s1); }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-foot, .nav-spacer { display: none; }
  .main { padding: var(--s5) var(--s4) var(--s7); }
  .page-head { flex-direction: column; }
  .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: var(--s2); }
  .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: var(--s5) var(--s3); }
  .signup-heading { align-items: stretch; flex-direction: column; }
  .signup-heading button { width: 100%; }
  .signup-form { grid-template-columns: 1fr; }
  .signup-details, .signup-plans { padding: var(--s4); }
  .provider-options { grid-template-columns: 1fr; }
  .billing-summary { grid-template-columns: 1fr; gap: var(--s2); }
  .card { padding: var(--s4); }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .main { padding: var(--s5) var(--s5) var(--s7); }
  .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: var(--s1); align-items: center;
  padding: var(--s2) 2px 0; margin-top: 6px; border-top: 1px solid var(--sidebar-hover);
}
.theme-picker span {
  width: 100%; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--sidebar-muted); margin-bottom: 2px;
}
.theme-chip {
  font: inherit; font-size: var(--t-xs); padding: 3px var(--s2); border-radius: 999px;
  cursor: pointer; background: transparent; color: var(--sidebar-muted);
  border: 1px solid var(--sidebar-hover); box-shadow: none;
}
.theme-chip:hover:not(:disabled) { color: var(--sidebar-text); background: var(--sidebar-hover); }
.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-radius: var(--radius-sm);
  padding: 9px 11px; font-size: var(--t-sm); 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-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent-soft); padding: var(--s3) var(--s4); margin-bottom: var(--s5);
}
.free-tier p { margin: 0 0 var(--s2); }
.free-tier p:last-child { margin-bottom: 0; }
.plans-later { margin-top: 0; }
.plan-card {
  display: grid; gap: 6px; padding: var(--s3) var(--s4);
  border-radius: var(--radius-sm); 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: var(--s2); align-items: baseline; flex-wrap: wrap;
  padding: var(--s2) var(--s4); font-size: var(--t-sm); 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: var(--t-sm); padding: 4px 11px;
  background: transparent; border: 1px solid currentColor; color: inherit; box-shadow: none;
}
.trial-banner.coming button, .trial-banner.soon button { border-color: var(--accent); color: var(--accent); }
