/* ============================================================================
   NFC.cool business console — one style system.

   Every value here comes from the approved canvas mockup (design-v2: Main /
   Tablet / Phone / Sidebar / Setup / Buttons artboards), which lifted them from
   nfc.cool itself. The rule is: a page composes these classes and adds nothing.
   No template carries a <style> block and no element carries a style attribute
   except for data (a brand colour, a progress width) — if a screen needs
   something this file lacks, the class is added HERE, once, for every screen.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  --bg: #F5F6F8; --card: #FFFFFF; --text: #212529; --text-2: #495057; --text-3: #686F76;
  --border: #E6E8EB; --border-light: #F0F1F3; --brand: #137BD9; --brand-2: #00A2F3;
  --brand-light: rgba(19,123,217,0.12); --accent: #FFC709; --success: #059669;
  --success-light: rgba(5,150,105,0.12); --danger: #B91C1C; --shadow: 0 1px 2px rgba(33,37,41,0.06);
  --radius: 10px; --radius-lg: 14px; --radius-sm: 8px;
  /* The console's gutter: the floating sidebar and the page share it. */
  --gutter: 16px;
  /* Card padding is a token so anything that bleeds to a card's edge (the
     checklist's highlighted row) stays aligned when the padding changes. */
  --card-pad-x: 20px; --card-pad-y: 20px;
  /* The sidebar follows the theme: a white panel in light mode, #1C2128 in dark
     — the same surface as a card, so it can never stay dark on a light page. */
  --nav-fg: var(--text-2); --nav-active-bg: var(--brand-light); --nav-active-fg: var(--brand);
  /* nfc.cool's one button: blue family in light, yellow family in dark. */
  --btn: var(--brand); --btn-hover: var(--brand-2); --btn-tint: var(--brand-light);
  --btn-on: #FFFFFF; --danger-btn: #DC2626;
  /* The faintest brand wash: the checklist's "do this next" band. */
  --tint-soft: rgba(19,123,217,0.05);
}
:root[data-theme="dark"] {
  --bg: #161B22; --card: #1C2128; --text: #F0F2F5; --text-2: #C2C8D0; --text-3: #8B949E;
  --border: #30363D; --border-light: #21262D; --brand-light: rgba(19,123,217,0.24);
  --shadow: 0 1px 2px rgba(0,0,0,0.3);
  --nav-active-bg: rgba(255,199,9,0.16); --nav-active-fg: #FFC709;
  --btn: #FFC709; --btn-hover: #FFD93D; --btn-tint: rgba(255,199,9,0.18);
  --btn-on: #212529; --danger-btn: #F87171; --tint-soft: rgba(255,199,9,0.07);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161B22; --card: #1C2128; --text: #F0F2F5; --text-2: #C2C8D0; --text-3: #8B949E;
    --border: #30363D; --border-light: #21262D; --brand-light: rgba(19,123,217,0.24);
    --shadow: 0 1px 2px rgba(0,0,0,0.3);
    --nav-active-bg: rgba(255,199,9,0.16); --nav-active-fg: #FFC709;
    --btn: #FFC709; --btn-hover: #FFD93D; --btn-tint: rgba(255,199,9,0.18);
    --btn-on: #212529; --danger-btn: #F87171; --tint-soft: rgba(255,199,9,0.07);
  }
}

/* --- Base ----------------------------------------------------------------- */
/* Titillium Web loads with font-display: swap (titillium.css). Until it arrives the page renders in a
   local face; without these overrides that face is 6-10% wider and its line box 1.15em instead of
   Titillium's 1.52em, so every line re-wraps and the whole page shifts when the swap happens ("the
   view jumps on load"). size-adjust is Titillium's width over Helvetica Neue's, measured per weight;
   ascent/descent are Titillium's own metrics. Same rule for widths that would otherwise wrap. */
@font-face { font-family: 'Titillium Fallback'; font-weight: 400; src: local('Helvetica Neue'), local('Arial'); size-adjust: 93.8%; ascent-override: 113%; descent-override: 39%; line-gap-override: 0%; }
@font-face { font-family: 'Titillium Fallback'; font-weight: 600; src: local('Helvetica Neue Bold'), local('HelveticaNeue-Bold'), local('Arial Bold'); size-adjust: 89.7%; ascent-override: 113%; descent-override: 39%; line-gap-override: 0%; }
@font-face { font-family: 'Titillium Fallback'; font-weight: 700; src: local('Helvetica Neue Bold'), local('HelveticaNeue-Bold'), local('Arial Bold'); size-adjust: 90.8%; ascent-override: 113%; descent-override: 39%; line-gap-override: 0%; }
* { box-sizing: border-box; }
/* A class rule (.fs-row is a flex box) would otherwise beat the UA's [hidden],
   so scripts can set el.hidden instead of writing a style attribute. */
[hidden] { display: none !important; }
/* An explicit line-height keeps every line box the same height before and after the
   font swap. common.css (loaded first, for the public card pages) pads the body 20px;
   the console owns its gutter, so reset it or every screen sits 36px from the edge. */
body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Titillium Web', 'Titillium Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.5; }
/* base.html wraps every page in .section and opens it with two <br>; the console
   owns its own gutter, so those spacers must not push it off the top. */
.section > br { display: none; }
a { color: var(--btn); text-decoration: none; }
a:hover { color: var(--btn-hover); }
a:focus-visible, .chip:focus-visible, .mark-clear:focus-visible, summary:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; border-radius: 4px; }
h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; }
h2, h3 { margin: 0; font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
code { font-family: 'SF Mono', Menlo, monospace; font-size: 13px; }
input, textarea, button, select { font-family: inherit; }
button { cursor: pointer; }

/* --- Accessibility utilities ------------------------------------------------ */
/* Visually hidden but present for assistive tech: the invite form's field
   labels (email/role/card) shouldn't duplicate the visible placeholder/layout. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* --- Text roles ----------------------------------------------------------- */
.section-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.muted { font-size: 14px; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.eyebrow, .stat-label { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
/* A value's unit/word, spelled out only where there's room for it: hidden on
   desktop's tight table columns, shown on the phone list layout below. */
.unit { display: none; }

/* --- Shell: the console, its floating sidebar and the page column ---------- */
.console { display: flex; align-items: flex-start; gap: var(--gutter); padding: var(--gutter); min-height: 100vh; }
/* The sidebar is a card like every other surface: same border, radius, shadow and
   theme. It floats at the gutter and sticks, so the menu, the account line and the
   theme toggle stay in view while the page scrolls. */
.sidebar {
  position: sticky; top: var(--gutter); z-index: 50;
  width: 236px; flex-shrink: 0; align-self: flex-start;
  height: calc(100vh - var(--gutter) * 2);
  display: flex; flex-direction: column; padding: 20px 14px;
  background: var(--card); color: var(--nav-fg);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.sidebar .logo-link { display: block; margin: 0 8px 22px; }
.sidebar .logo { height: 22px; width: auto; display: block; }
/* One logo per theme, switched by the same mechanism as the tokens. */
.sidebar .logo-dark { display: none; }
:root[data-theme="dark"] .sidebar .logo-light { display: none; }
:root[data-theme="dark"] .sidebar .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar .logo-light { display: none; }
  :root:not([data-theme="light"]) .sidebar .logo-dark { display: block; }
}
.sidebar-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.org-switch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.org-switch .mark { width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; }
.org-switch > span { min-width: 0; line-height: 1.15; font-size: 14px; }
.org-switch strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switch small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--nav-fg); }
.nav a:hover { background: var(--btn-tint); color: var(--nav-active-fg); }
.nav a.is-active { background: var(--nav-active-bg); color: var(--nav-active-fg); }
.nav a:focus-visible { outline: 2px solid var(--btn); outline-offset: -2px; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 12px 0; border-top: 1px solid var(--border-light); font-size: 13px; }
.sidebar .me > .me-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sidebar .me a { white-space: nowrap; font-weight: 600; }
.me-avatar { display: none; width: 32px; height: 32px; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-weight: 700; font-size: 12px; align-items: center; justify-content: center; flex-shrink: 0; }
/* Theme toggle and burger, after nfc.cool's .sk-theme-toggle / .sk-nav-toggle: quiet 36px bordered
   squares with an icon, never a labelled button competing with the page's own actions. */
.theme-toggle, .nav-toggle { width: 36px; height: 36px; padding: 0; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.theme-toggle:hover, .nav-toggle:hover { background: var(--btn-tint); border-color: var(--btn-hover); color: var(--btn-hover); }
/* Icon-only controls still need a visible focus ring: the same 2px/offset-3
   pattern every other control (.btn, .stepper) uses. */
.theme-toggle:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; }
.theme-toggle svg { width: 16px; height: 16px; }
.sidebar .theme-toggle { margin: 8px 12px 0; align-self: flex-start; }
.nav-toggle { display: none; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle-close { display: none; }
.sidebar.is-open .nav-toggle-open { display: none; }
.sidebar.is-open .nav-toggle-close { display: inline; }
/* The page column. Its padding is the mockup's; the gap is the vertical rhythm
   between a page's blocks, so nothing needs a margin of its own. */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding: 12px 24px 24px 20px; }

/* The setup wizard and the signed-out pages keep their own shell: the sidebar
   collapses to the mockup's top bar at every width and the page is a column. */
.console-plain { flex-direction: column; align-items: stretch; }
.console-plain .sidebar { position: sticky; top: var(--gutter); width: auto; align-self: stretch; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 16px; }
.console-plain .sidebar .logo-link { margin: 0; }
/* A sticky top bar leaves a strip of page above it; paint that strip so the
   content scrolling underneath never shows through the gutter. */
.console-plain .sidebar::before, .console.console-plain .sidebar::before { content: ""; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); bottom: calc(100% + 1px); height: var(--gutter); background: var(--bg); }
/* Names the flow in the bar, after the mockup's "Business setup" divider. */
.bar-label { display: flex; align-items: center; flex: 1; gap: 16px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.bar-label::before { content: ""; width: 1px; height: 24px; background: var(--border); }
.console-plain .sidebar .logo { height: 20px; }
.console-plain .sidebar .theme-toggle { margin: 0; align-self: center; order: 3; }
.console-plain .sidebar-menu { display: contents; }
.console-plain .org-switch, .console-plain .nav, .console-plain .nav-toggle { display: none; }
.console-plain .sidebar .me { margin: 0 0 0 auto; padding: 0; border: 0; order: 2; }
.console-plain .sidebar .me > .me-email { max-width: 220px; }
.console-plain .main { align-self: center; width: 100%; max-width: 780px; padding: 12px 8px 24px; }

/* --- Page header: identical on every screen ------------------------------- */
/* .page-head-text carries the fixed min-height so the actions sit at the same y
   whether or not a page's subtitle wraps — this is what stopped the buttons
   "jumping" between Overview, Members, Cards and Billing. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.page-head-text { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; }
.page-head .sub { font-size: 14px; color: var(--text-2); }
.actions { display: flex; align-items: center; gap: 10px; }
/* Pushes what follows it to the far end of a flex row. */
.spacer { margin-left: auto; }

/* --- Buttons -------------------------------------------------------------- */
/* nfc.cool has one button (.landing-cta-button): outline, 1.5px border, radius 10,
   Titillium 600, letter-spacing .04em. Secondary IS that button; primary is its
   filled twin; tertiary is the site's grey utility button (.sk-lang-btn). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; height: 42px; padding: 0 24px; border: 1.5px solid var(--btn); border-radius: var(--radius); background: var(--btn); color: var(--btn-on); font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; text-decoration: none; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-on); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; }
.btn.secondary { background: transparent; color: var(--btn); }
.btn.secondary:hover { background: var(--btn-tint); border-color: var(--btn-hover); color: var(--btn); }
.btn.tertiary { background: transparent; border: 1px solid var(--border); color: var(--text-2); padding: 0 18px; }
.btn.tertiary:hover { background: var(--btn-tint); border-color: var(--btn-hover); color: var(--btn-hover); }
.btn.danger { background: transparent; border-color: var(--danger-btn); color: var(--danger-btn); }
.btn.danger:hover { background: rgba(220,38,38,0.10); border-color: var(--danger-btn); color: var(--danger-btn); }
.btn.large { height: 48px; padding: 0 30px; font-size: 16px; }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.tertiary.small { padding: 0 12px; }
.btn.block { width: 100%; }
.btn.square, .stepper { width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-size: 18px; font-weight: 600; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn.square:hover, .stepper:hover { background: var(--btn-tint); border-color: var(--btn-hover); color: var(--btn-hover); transform: none; }
.stepper:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; transform: none; }
.btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }

/* --- Surfaces ------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--card-pad-y) var(--card-pad-x); }
/* Every card opens with the same title row: a title, optionally something on the
   right (a count, a status pill, an action). */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head:only-child, .card-head:last-child { margin-bottom: 0; }
.card-head .stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card > .card-head + .muted, .card > .card-head + .hint { margin-top: -4px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
/* A stat whose value is a word, not a number: it needs the smaller size to fit. */
.stat-value.text { font-size: 20px; line-height: 1.3; }
.stat-value small { font-size: 14px; color: var(--text-2); font-weight: 400; margin-left: 6px; }
.bar { height: 6px; border-radius: 999px; background: var(--border-light); overflow: hidden; }
.bar > i { display: block; height: 6px; background: var(--brand); }
.panel { padding: 16px 18px; background: var(--bg); border-radius: var(--radius); }
.empty { padding: 26px 20px; text-align: center; color: var(--text-2); font-size: 14px; }
/* A card that IS the empty state carries the padding once, not twice. */
.card.empty { padding: 26px 20px; }

/* --- Grids ---------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
/* The one spot a 2-column grid needs an uneven split (Settings' Brand card next
   to its narrower App Clip preview): a modifier on the same class, not a second one. */
.grid-2.wide { grid-template-columns: 1.2fr 1fr; }
/* Settings: two even columns of stacked cards, only at the desktop breakpoint --
   from the tablet rail down the page is one column, stacks one after another.
   A modifier on .grid-2.wide, scoped to Settings; .stats/.stat-row (Overview)
   must not change. */
.grid-2.wide.settings-columns { grid-template-columns: 1fr; }
@media (min-width: 1101px) {
  .grid-2.wide.settings-columns { grid-template-columns: 1.2fr 1fr; }
}
/* A column of grouped blocks (a form's cards, a status panel). */
.stack { display: flex; flex-direction: column; gap: 16px; }

/* --- Tables and the capsule / toolbar row --------------------------------- */
.table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
/* THE capsule row. One padding, one gap, one alignment — wherever filters, a
   search box or a table's title bar appear, on every page. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.toolbar:last-child { border-bottom: 0; }
.toolbar > a.spacer, .toolbar > .spacer > a { font-size: 14px; font-weight: 600; }
.table .head, .table .row { display: grid; grid-template-columns: 2.2fr 1fr 1.2fr 1fr 1.4fr; align-items: center; padding: 10px 20px; font-size: 14px; border-bottom: 1px solid var(--border-light); }
.table .head { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; border-bottom-color: var(--border); }
.table .row:last-child { border-bottom: 0; }
.table .row:hover { background: var(--bg); }
.table .cell-actions { text-align: right; }
.table .cell-actions form.inline + form.inline { margin-left: 6px; }
/* A plain <table> (cards, domains) lives in the same panel; only the rows scroll.
   min-width:0 stops the table's min-content width leaking out through the flex item. */
.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--border-light); font-size: 14px; }
th { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; border-bottom-color: var(--border); }
tr:last-child td { border-bottom: 0; }
td.cell-actions { text-align: right; white-space: nowrap; }
td.cell-actions > * + * { margin-left: 6px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .name { font-weight: 600; }
.person .email { font-size: 12px; color: var(--text-2); }
.avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
/* A list row that names a thing rather than a person (Cards' Name+Job): the
   same anatomy as .person -- a bold title, a muted line under it -- with no
   avatar. */
.entity { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entity .name { font-weight: 600; }
/* The Job value: its own grid column on desktop; folded into .entity's second
   line on phones instead of repeating on the meta line (see the phone block). */
.entity .hint { display: none; }
.cell-job { min-width: 0; }
/* The Cards cell holds one link per card, comma separated; it has to wrap
   rather than push the actions column off the row. */
.cell-cards { min-width: 0; overflow-wrap: anywhere; }

/* --- Pills and filter capsules -------------------------------------------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; background: var(--border-light); color: var(--text-2); }
.pill.live { background: var(--success-light); color: var(--success); }
.pill.joined { background: var(--brand-light); color: var(--brand); }
.pill.trial { background: var(--accent); color: #212529; }
.pill.inactive, .pill.removed { background: var(--border-light); color: var(--text-3); }
.pill.failed { background: rgba(220,38,38,0.12); color: var(--danger-btn); }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; border: 1px solid var(--border); color: var(--text-2); background: var(--card); white-space: nowrap; cursor: pointer; }
.chip:hover { border-color: var(--btn-hover); color: var(--btn-hover); }
.chip.is-active { background: var(--text); color: var(--card); border-color: var(--text); }
.chip.is-active:hover { color: var(--card); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* --- Checklist ------------------------------------------------------------ */
.checklist { display: flex; flex-direction: column; }
.checklist .item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-light); font-size: 15px; }
.checklist .item.done { color: var(--text-2); text-decoration: line-through; }
.checklist .item.next { background: var(--tint-soft); margin: 0 calc(var(--card-pad-x) * -1); padding-left: var(--card-pad-x); padding-right: var(--card-pad-x); font-weight: 600; }
.checklist .detail { margin-left: auto; font-size: 13px; color: var(--text-2); text-decoration: none; }

/* --- Messages, banners, errors -------------------------------------------- */
.banner { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.banner.success { background: var(--success-light); color: var(--success); }
.banner.error { background: rgba(185,28,28,0.1); color: var(--danger); }
.messages { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.messages li.success { background: var(--success-light); color: var(--success); }
.messages li.error { background: rgba(185,28,28,0.1); color: var(--danger); }
.errorlist { color: var(--danger); font-size: 13px; margin: 0; padding-left: 18px; }
.text-danger { color: var(--danger); }
form.inline { display: inline; margin: 0; }

/* --- Forms ---------------------------------------------------------------- */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=search], input:not([type]), textarea, select {
  font: inherit; font-size: 15px; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  height: 42px; width: 100%;
}
textarea { height: auto; line-height: 1.5; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
input[type=file] { max-width: 100%; height: auto; padding: 8px 10px; }
/* Only in a one-line control row does the file input take the free width. */
.form-row input[type=file] { flex: 1 1 200px; min-width: 0; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-light); }
label { display: block; margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
/* A stack of labelled fields inside a card: the label sits on the field, 14px apart. */
.field-stack { display: flex; flex-direction: column; gap: 14px; }
.field-stack > label, .field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; font-weight: 400; color: var(--text); }
.field-stack .muted, .field-stack .hint { font-weight: 400; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px; }
/* One-of-several choice (New Card's Holder): a radio, its label, and the input
   or helper that belongs to that option. Rows are spaced like .field-stack, the
   option's own control keeps the standard 42px height, and the body lines up
   under the label rather than under the radio. */
.choice-list { display: flex; flex-direction: column; gap: 14px; }
.choice { display: flex; flex-direction: column; gap: 6px; }
.choice > .choice-head { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.choice input[type=radio] { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--btn); }
.choice input[type=radio]:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; }
.choice-body { display: flex; flex-direction: column; gap: 4px; margin-left: 28px; }
/* A select that acts as a control inside a table row, not a form field. */
.select-inline { width: auto; height: 32px; padding: 0 8px; font-size: 13px; }
/* A form laid out as one line of controls (invite, add-domain, import). */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { margin-top: 0; }
.form-row input, .form-row select, .form-row textarea { flex: 1 1 200px; width: auto; min-width: 0; }
.form-row .btn { flex: 0 0 auto; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
/* A repeatable contact row: its fields grow, the remove button sits on their baseline. */
.fs-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.fs-rows > .fs-row:last-child { margin-bottom: 0; }
.fs-fields { flex: 1; min-width: 0; display: grid; gap: 10px; grid-template-columns: 2fr 1fr; }
.fs-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; font-weight: 400; color: var(--text); }
.add-row { align-self: flex-start; margin-top: 14px; }
.row-remove { margin-bottom: 3px; }
.seat-stepper { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seat-stepper input { width: 96px; text-align: center; font-size: 32px; font-weight: 700; height: 56px; padding: 4px; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; }
.color-row input[type=text] { width: 120px; height: 40px; font-family: 'SF Mono', Menlo, monospace; text-transform: uppercase; }
/* Logo row: mark + button on ONE line, the hint on its own line below (never let the button wrap). */
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; }
.logo-row .btn { flex-shrink: 0; white-space: nowrap; }
.logo-row input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.logo-mark { position: relative; width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; color: #fff; font-weight: 700; font-size: 24px; display: flex; align-items: center; justify-content: center; }
/* Two slots side by side, each previewing its logo on the background it has to
   survive -- a mark drawn for white paper vanishes on a dark card, which is the
   whole reason the two are uploaded separately. The backgrounds are fixed, not
   theme tokens: the point is to show both extremes whatever theme the admin is
   in. */
.logo-pair { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.logo-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.logo-slot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.logo-slot .btn { flex-shrink: 0; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.logo-slot .hint { font-size: 12px; }
.logo-mark.on-light { background: #fff; color: #161B22; box-shadow: inset 0 0 0 1px var(--border); }
.logo-mark.on-dark { background: #161B22; color: #fff; }
/* The x lives on the thumbnail it removes. It is a submit button (it names the
   side to clear), so it has to be visibly a control and not part of the image. */
.mark-clear { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text-2); font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mark-clear:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
/* An uploaded brand logo fills any mark that would otherwise show the initial
   (the brand card, the App Clip badge, the sidebar's org mark) -- contained, so
   a wide wordmark and a square glyph both sit inside the same box. */
.mark-img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.avatar-preview { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block; }
/* A form column that reads at a comfortable measure and stays centred. */
.form-narrow { max-width: 620px; margin-left: auto; margin-right: auto; width: 100%; }

/* --- App Clip preview ----------------------------------------------------- */
.appclip-preview { display: flex; flex-direction: column; gap: 12px; }
.appclip-card { background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 10px 10px 14px; box-shadow: 0 18px 40px rgba(33,37,41,0.18); display: flex; flex-direction: column; gap: 10px; color: #212529; }
.appclip-header { height: 120px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 28px; letter-spacing: .02em; text-align: center; padding: 0 12px; overflow: hidden; }
.appclip-row { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.appclip-badge { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.appclip-texts { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.appclip-texts strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appclip-texts .hint { color: #495057; }
.pill-open { padding: 7px 14px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; }

/* --- Setup wizard --------------------------------------------------------- */
.setup-shell { max-width: 720px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 22px; }
.setup-progress { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.setup-progress li { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.setup-progress li.is-current, .setup-progress li.is-done { color: var(--text); }
.setup-progress .bar { height: 4px; background: var(--border); }
.setup-progress .bar-on { background: var(--brand); }
.setup-progress .bar-done { background: var(--success); }
.setup-card { padding: 32px 36px; }
.setup-card > h1 { margin-bottom: 6px; }
.setup-grid { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.setup-fields { display: flex; flex-direction: column; }
.setup-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--border-light); }
.setup-actions .btn:only-child { margin-left: auto; }
.price-box { padding: 16px 18px; background: var(--bg); border-radius: var(--radius); margin: 18px 0; }
.price-box strong { font-size: 26px; }
.price-box .hint { display: block; margin-top: 6px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; margin: 18px 0; }
.stat-row .stat { padding: 16px; background: var(--bg); border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; }
.stat-row strong { font-size: 18px; }
.setup-done { text-align: center; align-items: center; display: flex; flex-direction: column; }
.auth-card { max-width: 440px; width: 100%; margin: 24px auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px 36px; display: flex; flex-direction: column; gap: 14px; }
.auth-card > * { margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card form > p { margin: 0; }
.auth-card form label { margin: 4px 0 0; }
.auth-card form .btn { margin-top: 8px; }
.store-buttons { display: flex; gap: 10px; margin: 18px 0; }

/* --- Tablet: the sidebar collapses to an icon rail, still sticky -----------
   768px up to the desktop breakpoint (1100px) — the mockup's tablet artboard
   (834px) must land here, not in the phone layout below it. */
@media (min-width: 768px) and (max-width: 1100px) {
  .sidebar { width: 76px; padding: 16px 8px; align-items: center; }
  .sidebar .logo-link { display: none; }
  .sidebar-menu { width: 100%; align-items: center; }
  .org-switch { padding: 0; margin-bottom: 14px; background: none; border: 0; }
  .org-switch > span, .org-switch small { display: none; }
  .org-switch .mark { width: 36px; height: 36px; border-radius: var(--radius); font-size: 15px; }
  .nav { width: 100%; align-items: center; gap: 4px; }
  .nav a { width: 60px; flex-direction: column; gap: 4px; padding: 8px 0; border-radius: var(--radius); font-size: 11px; font-weight: 600; text-align: center; }
  .nav a.is-active { font-weight: 700; }
  .nav svg { width: 20px; height: 20px; }
  .sidebar .me { flex-direction: column; gap: 6px; padding: 12px 0 0; width: 100%; }
  .sidebar .me > .me-email { display: none; }
  .sidebar .me a { font-size: 11px; }
  .me-avatar { display: flex; }
  .sidebar .theme-toggle { align-self: center; margin: 8px 0 0; }
  .main { padding: 8px 4px 24px; gap: 18px; }
  .console-plain .sidebar { width: auto; padding: 10px 16px; }
  .console-plain .main { padding: 12px 8px 24px; }
}

/* --- Phone: the sidebar becomes a floating top bar with the burger ---------
   Below the tablet rail's 768px floor. */
@media (max-width: 767px) {
  :root { --gutter: 12px; --card-pad-x: 16px; --card-pad-y: 18px; }
  .console { flex-direction: column; align-items: stretch; gap: 14px; }
  .sidebar { position: sticky; top: var(--gutter); width: auto; align-self: stretch; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; }
  .sidebar .logo-link { flex: 1; margin: 0; }
  .sidebar::before { content: ""; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); bottom: calc(100% + 1px); height: var(--gutter); background: var(--bg); }
  .sidebar .logo { height: 20px; }
  .sidebar .theme-toggle { order: 1; margin: 0; align-self: center; }
  .nav-toggle { display: inline-flex; order: 2; }
  /* The burger drops the menu panel down under the bar, as its own floating card. */
  .sidebar-menu { display: none; position: absolute; top: calc(100% + 10px); left: 0; right: 0; flex: none; padding: 12px 14px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 14px 30px rgba(33,37,41,0.18); max-height: calc(100vh - 96px); overflow-y: auto; animation: menu-slide-down .18s ease both; }
  .sidebar.is-open .sidebar-menu { display: flex; }
  .sidebar-menu .org-switch { margin: 0 0 10px; }
  .sidebar-menu .nav { font-size: 15px; }
  .sidebar-menu .nav a { padding: 11px 12px; }
  .sidebar-menu .me { margin-top: 12px; }
  .sidebar-menu .me:first-child { margin-top: 0; border-top: 0; padding-top: 4px; }
  body.menu-open { overflow: hidden; }
  .main { padding: 2px 2px 8px; gap: 14px; }
  .console-plain .sidebar { padding: 10px 14px; }
  /* Keep Sign out reachable in the wizard on a phone; only the address goes. */
  .console-plain .sidebar .me > .me-email { display: none; }
  .console-plain .bar-label { font-size: 13px; }
  .console-plain .main { padding: 2px 2px 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px 14px; }
  .stat-card .stat-value { font-size: 26px; }
  .stat-label, .eyebrow { font-size: 11px; }
  .grid-2, .grid-2.wide, .setup-grid, .stat-row { grid-template-columns: 1fr; }
  .page-head { flex-wrap: wrap; min-height: 0; }
  .page-head-text { min-height: 0; }
  .page-head .actions { flex: 1 1 100%; flex-wrap: wrap; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .setup-card { padding: 24px 20px; }
  .setup-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-actions { flex-direction: column-reverse; gap: 10px; }
  .setup-actions .btn { width: 100%; }
  .setup-actions .btn:only-child { margin-left: 0; }
  .auth-card { margin: 8px auto; padding: 24px 20px; }
  .toolbar { padding: 12px 16px; }
  th, td { padding: 10px 16px; }
  /* Every list table (people, cards, domains) on phones: no header row, each
     row reads as one list item -- the person/entity block full width, then
     the remaining data cells inline in one muted meta line separated by "·"
     (no attr(data-label) blocks), actions on the meta line when there's one
     or wrapped onto their own right-aligned line when there's more. */
  .table .head { display: none; }
  .table .row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 12px 16px; }
  .table .row > .person, .table .row > .entity { flex: 1 1 100%; min-width: 0; }
  .entity .hint { display: block; }
  .cell-job { display: none; }
  .table .row > .cell:not(.cell-actions) { display: inline; min-width: 0; font-size: 14px; color: var(--text-2); }
  .table .row > .cell:not(.cell-actions) + .cell:not(.cell-actions)::before { content: "·"; margin: 0 6px; color: var(--text-3); }
  .table .row > .cell-actions { margin-left: auto; min-width: 0; text-align: right; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
  .table .row > .cell-actions:empty, .table .row > .cell-actions > .muted:only-child { display: none; }
  .table .cell-actions form.inline + form.inline { margin-left: 0; }
  .unit { display: inline; }
  /* Checklist: the detail sits under its label instead of fighting it for width. */
  .checklist .item { flex-wrap: wrap; gap: 2px 14px; }
  .checklist .detail { flex-basis: 100%; margin-left: 0; }
  .person .email { overflow-wrap: anywhere; }
  .table-scroll th, .table-scroll td { white-space: nowrap; }
  .fs-fields { grid-template-columns: 1fr; }
  .setup-card { padding: 20px 16px; }
}
@keyframes menu-slide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sidebar-menu { animation: none; }
  .btn, .btn:hover, .chip, .nav a { transition: none; transform: none; }
}

/* DNS record rows on the Domains page: a label/value grid rather than a table,
   so the value can wrap on a phone without the label leaving its side. */
.dns-record { display: grid; grid-template-columns: 72px 1fr; gap: 6px 12px; margin: 8px 0 4px; }
.dns-record dt { color: var(--text-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; align-self: center; }
.dns-record dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dns-record dd code { font-size: 13px; }

/* One input per invitee on the setup wizard: a stack of full-width fields, with
   Add another sitting under them rather than in the row. */
.email-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.email-rows input { width: 100%; }
