/* ==========================================================================
   Smarther Preview — Components
   --------------------------------------------------------------------------
   Read design-tokens.css first. Two rules govern this file:

   1. EVERY CONTAINER WHOSE CHILDREN STACK DECLARES ITS OWN GAP. The reset
      zeroes margins, so a block-display parent puts its children flush
      against each other and nothing errors.
   2. EVERY LEAF THAT TAKES A SIZE DECLARES ITS DISPLAY. width and height do
      not apply to inline boxes, so a <span> drawn as a bar paints nothing
      until it says display:block.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
/* The browser hides [hidden] with display:none, but that is a USER-AGENT rule
   and any author rule beats it. .scrim and .menu both set display:flex, so a
   hidden dialog or menu stayed fully visible — the New user dialog opened over
   the Users page the moment it loaded. Anything that can be hidden needs this
   line, and !important is what makes it survive the next display rule someone
   adds. */
[hidden] { display: none !important; }
html, body, div, span, h1, h2, h3, h4, p, a, img, ul, ol, li, table, thead,
tbody, tr, th, td, form, label, input, button, section, nav, header, main,
aside, figure { margin: 0; padding: 0; border: 0; font: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button { background: none; cursor: pointer; }

/* Anything that ACTS like a control gets the cursor of one.
   `button` above covers most of it; these three do not inherit it.

   A <label for> is part of the control it names — clicking it focuses the
   input, so a default arrow over it is a lie about what will happen. The
   upload drop zone is a label too, and its whole job is to be clicked.
   `.drop` on the empty board is a <div> and passive, which is why this is
   scoped to the label. */
label[for], label.drop { cursor: pointer; }

/* Click-to-EDIT, not click-to-act. A section name and a screen name both swap
   for an input on double-click; a pointer would promise something a single
   click does not do, and the text caret is what "you can type here" looks
   like.

   A screen name sits inside the card's <a>, so a single click still opens the
   screen — the same double-click-to-rename, single-click-to-open split that
   every file manager has. */
[data-rename] { cursor: text; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6;
      stroke-linecap: round; stroke-linejoin: round; }

html, body {
  width: 100%;
  background: var(--bg-canvas);
  font-family: var(--font-ui);
  font-size: var(--t-13);
  line-height: var(--lh-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   THE ARTBOARD
   --------------------------------------------------------------------------
   Width is fluid between --canvas-min and --canvas-max, because the Figma
   capture engine sizes the pasted frame from the VIEWPORT and CSS cannot
   shrink documentElement below it. Set the width in DevTools, capture, done.

   Height is a MINIMUM. Content longer than 900px grows the artboard downward.
   Nothing inside a screen scrolls, is fixed, or is sticky.
   ========================================================================== */

.screen {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-width: var(--canvas-min);
  max-width: var(--canvas-max);
  min-height: var(--canvas-height);
  margin-inline: auto;
  background: var(--bg-canvas);
  overflow: hidden;
}

/* One column, no sidebar — auth screens and the client share view. */
.screen--plain { flex-direction: column; }

/* THE ONE SCREEN THAT IS NOT DESKTOP-ONLY.
   .screen carries min-width: 1024px, which is right for a tool nobody opens on
   a phone — but the client share view is opened on whatever device is to hand,
   and min-width would force a horizontal scroll instead of a reflow. This
   releases the floor for that screen and nothing else.
   Breakpoints for it live at the bottom of this file. */
.screen--fluid { min-width: 0; }

/* A screen whose SUBJECT is a dialog is exactly one viewport tall and clips
   what is behind it. A modal centred in a 2000px artboard lands 1000px down.

   min-height: 0 is load-bearing — .screen carries min-height:900px and
   min-height beats height, so without the reset a fitted screen on a short
   window stays 900px, gets clipped, and looks like a layout refusing to
   centre. It is a box taller than the window. */
.screen--fit,
.screen--overlay { height: 100vh; min-height: 0; overflow: hidden; }
html:has(.screen--fit), html:has(.screen--fit) body,
html:has(.screen--overlay), html:has(.screen--overlay) body { overflow: hidden; }

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s-20);
  flex: none;
  width: var(--sidebar-w);
  padding: var(--s-16) var(--s-12) var(--s-16);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
}

.side-brand {
  display: flex; align-items: center; gap: var(--s-8);
  padding-inline: var(--s-8);
  min-height: var(--control-h);
  border-radius: var(--r-6);
}
/* An <a> to the dashboard — the mark and the name are one target, as a logo
   is everywhere else on the web. The radius is for the focus ring, which
   otherwise draws a hard rectangle round a row of rounded controls. */
a.side-brand:hover .brand-name { color: var(--accent-text); }
.brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  flex: none;
  border-radius: var(--r-4);
  background: var(--accent-fill);
  color: var(--text-on-fill);
}
.brand-mark svg { width: 14px; height: 14px; }
/* The real mark, replacing the two-block glyph. The file carries its own blue
   ground, so it fills the box edge to edge and the box's radius clips it —
   the box's own fill never shows. Same 22px as before, so nothing beside it
   moves. alt="" in the markup: the name is always written next to it, and a
   screen reader reading "Smarther Preview" twice is noise. */
.brand-img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.brand-name {
  font-size: var(--t-13);
  font-weight: var(--w-semibold);
  letter-spacing: .01em;
  color: var(--text-primary);
}

.side-group { display: flex; flex-direction: column; gap: var(--s-2); }
.side-label {
  padding: var(--s-6) var(--s-8) var(--s-4);
  font-size: var(--t-12);
  font-weight: var(--w-semibold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Dark and a size up from the body text. The rail was drawn in --text-muted
   at 13px so the page would lead, but on a real dashboard it read as greyed
   out — "dull", in the words of the person using it every day. The names
   are what the rail is for; they are now the darkest text on the page and
   the section labels and counts stay muted, which is the hierarchy. */
.side-item {
  display: flex; align-items: center; gap: var(--s-10);
  min-height: 36px;
  padding-inline: var(--s-8);
  border-radius: var(--r-6);
  font-size: var(--t-14);
  font-weight: var(--w-medium);
  color: var(--text-primary);
}
.side-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.side-item svg { width: 17px; height: 17px; flex: none; }
.side-item.is-on { background: var(--accent-wash); color: var(--accent-text); }
.side-count {
  margin-left: auto;
  font-size: var(--t-12);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* A recent project reads as a name, not as navigation — a dot instead of an
   icon, so the eye separates the two lists without a rule between them. */
.side-dot {
  display: block;
  width: 6px; height: 6px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--text-dim);
}
.side-item.is-on .side-dot { background: var(--accent); }

/* ==========================================================================
   MAIN COLUMN AND TOP BAR
   ========================================================================== */

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar {
  display: flex; align-items: center; gap: var(--s-16);
  flex: none;
  min-height: var(--topbar-h);
  padding-inline: var(--s-24);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

/* The search trigger is a control, not a field — it opens the palette. It is
   drawn as an input because that is what people aim at, and it carries the
   shortcut so the keyboard route is discoverable without a tooltip. */
.search-trigger {
  display: flex; align-items: center; gap: var(--s-8);
  width: 100%;
  max-width: 420px;
  min-height: var(--control-h);
  padding-inline: var(--s-10);
  border: 1px solid var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: var(--t-13);
  text-align: start;
}
.search-trigger:hover { border-color: var(--text-dim); }
.search-trigger svg { width: 15px; height: 15px; flex: none; }
.search-trigger .kbd { margin-left: auto; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px;
  padding: 1px var(--s-4);
  border: 1px solid var(--border-control);
  border-radius: var(--r-4);
  background: var(--bg-panel);
  font-family: var(--font-ui);
  font-size: var(--t-11);
  color: var(--text-muted);
}

.topbar-end { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; }

.avatar {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--accent-fill);
  color: var(--text-on-fill);
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  letter-spacing: .02em;
}
.avatar--sm { width: 20px; height: 20px; font-size: var(--t-11); }
.avatar--lg { width: 34px; height: 34px; font-size: var(--t-13); }
.avatar--b { background: #5A4BB8; }
.avatar--c { background: #1F7A6B; }
.avatar--d { background: #A4602A; }
.avatar--off { background: var(--bg-hover); color: var(--text-muted); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-right: -6px; box-shadow: 0 0 0 2px var(--bg-elevated); }
.avatar-stack .avatar:last-child { margin-right: 0; }

/* ==========================================================================
   PAGE
   ========================================================================== */

.page {
  display: flex;
  flex-direction: column;
  gap: var(--s-20);
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--s-24);
}
.page--flush { padding: var(--s-0); gap: var(--s-0); }

.page-head { display: flex; align-items: flex-start; gap: var(--s-16); }
.page-head-main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.page-title {
  font-size: var(--t-18);
  font-weight: var(--w-semibold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}
.page-sub { font-size: var(--t-12); color: var(--text-muted); }
.page-actions { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; flex: none; }

.section-label {
  display: flex; align-items: baseline; gap: var(--s-8);
  font-size: var(--t-12);
  font-weight: var(--w-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-6);
  min-height: var(--control-h);
  padding-inline: var(--s-12);
  border: 1px solid var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--t-13);
  font-weight: var(--w-medium);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { background: var(--bg-press); }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn--primary {
  border-color: var(--transparent);
  background: var(--accent-fill);
  color: var(--text-on-fill);
}
.btn--primary:hover { background: var(--accent-press); }
.btn--danger {
  border-color: var(--transparent);
  background: var(--danger-fill);
  color: var(--text-on-fill);
}
.btn--ghost { border-color: var(--transparent); background: var(--transparent); color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn--lg { min-height: var(--control-lg); padding-inline: var(--s-16); }
.btn--block { width: 100%; }
.btn[aria-disabled="true"] { background: var(--bg-elevated); color: var(--text-dim);
                             border-color: var(--border); }

.btn--sm { min-height: 26px; padding-inline: var(--s-8); font-size: var(--t-12); }
.btn--sm svg { width: 13px; height: 13px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-h); height: var(--control-h);
  flex: none;
  border: 1px solid var(--transparent);
  border-radius: var(--r-6);
  background: var(--transparent);
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon--bordered { border-color: var(--border-control); background: var(--bg-elevated); }
/* A destructive icon in a row of ordinary ones. Muted like its neighbours at
   rest — a red bin on every row of a table shouts, and the eye goes to it
   before the names — and red only under the pointer, which is the moment it
   needs to say what it does. It opens a confirm screen, never acts. */
.btn-icon--danger:hover { background: var(--danger-wash); color: var(--danger-text); }
/* An icon that has nothing to act on stays in place and stops answering — the
   first section cannot move up, the last cannot move down. Hiding them instead
   would move the row of controls under the pointer between sections. */
.btn-icon:disabled { opacity: .3; }
.btn-icon:disabled:hover { background: var(--transparent); color: var(--text-muted); }

.link { color: var(--accent-text); }
.link:hover { text-decoration: underline; }

/* ==========================================================================
   FORMS
   ========================================================================== */

.form { display: flex; flex-direction: column; gap: var(--s-16); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-16); }

.field { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
.label {
  display: flex; align-items: baseline; gap: var(--s-6);
  font-size: var(--t-12);
  font-weight: var(--w-medium);
  color: var(--text-muted);
}
.label-opt { font-weight: var(--w-regular); color: var(--text-dim); }

.input {
  display: block;
  width: 100%;
  min-height: var(--control-h);
  padding: var(--s-6) var(--s-10);
  border: 1px solid var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--t-13);
}
.input::placeholder { color: var(--text-dim); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input--lg { min-height: var(--control-lg); }
.input--area { min-height: 76px; padding-block: var(--s-8); resize: none; }
.input--mono { font-family: var(--font-mono); font-size: var(--t-12); }

.hint { font-size: var(--t-11); color: var(--text-muted); }
.error-text { display: flex; align-items: center; gap: var(--s-6);
              font-size: var(--t-12); color: var(--danger-text); }
.error-text svg { width: 14px; height: 14px; flex: none; }

/* Both of these are a <button>, and a button centres its text. .check-body and
   .switch-body are flex columns, so every line inside them — label and hint
   alike — came out centred under a left-aligned box. It reads as a layout bug
   rather than as a choice, and it is the one thing in a dialog that must line
   up with the fields above it. */
.check, .switch-row { text-align: left; }

.check { display: flex; align-items: flex-start; gap: var(--s-8); }
.check-box {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  flex: none;
  margin-top: 2px;
  border: 1px solid var(--border-control);
  border-radius: var(--r-4);
  background: var(--bg-elevated);
  color: var(--transparent);
}
.check-box svg { width: 11px; height: 11px; stroke-width: 2.4; }
.check-box.is-on { border-color: var(--transparent); background: var(--accent-fill); color: var(--text-on-fill); }
.check-body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.check-label { font-size: var(--t-13); color: var(--text-primary); }

.switch {
  display: block;
  position: relative;
  width: 34px; height: 20px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--bg-hover);
  border: 1px solid var(--border-control);
}
.switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  display: block;
  width: 14px; height: 14px;
  border-radius: var(--r-full);
  background: var(--text-muted);
}
.switch.is-on { background: var(--accent-fill); border-color: var(--transparent); }
.switch.is-on::after { left: 16px; background: var(--text-on-fill); }

.switch-row { display: flex; align-items: center; gap: var(--s-12); }
.switch-body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }

/* ==========================================================================
   PROJECT CARDS (dashboard)
   ========================================================================== */

.grid-projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-16);
}

/* ==========================================================================
   PAGER
   --------------------------------------------------------------------------
   The dashboard draws 21 cards — seven rows of the three-column grid — and
   then stops. A list that only grows turns a scroll into the way you find
   anything, and the four figures above it scroll out of sight on the way.

   Previous / Next with the count between them, rather than numbered pages.
   At 21 a page there is no count of projects where jumping to page six is
   the thing somebody wants, and every numbered pager needs an ellipsis rule
   nobody ever gets right.

   The ends are <span>, not <a>: a link with nothing to link to is a link
   that lies. .btn[aria-disabled="true"] already draws that state.
   ========================================================================== */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-12);
  padding-top: var(--s-8);
}
.pager-count { font-size: var(--t-12); color: var(--text-muted); }

.pcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.pcard:hover { border-color: var(--border-control); }

/* The cover strip is a row of thumbnails, not one big hero. A project is a
   set of screens and the card should look like a set. */
.pcard-cover {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-10);
  background: var(--bg-shot);
  border-bottom: 1px solid var(--border);
}
.pcard-tile {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-4);
  background: var(--bg-hover);
  overflow: hidden;
}

.pcard-body { display: flex; flex-direction: column; gap: var(--s-8); padding: var(--s-12); }
.pcard-top { display: flex; align-items: flex-start; gap: var(--s-8); }
.pcard-name {
  font-size: var(--t-15);
  font-weight: var(--w-semibold);
  line-height: var(--lh-snug);
  color: var(--text-primary);
  min-width: 0;
}
.pcard-meta {
  display: flex; align-items: center; gap: var(--s-8);
  font-size: var(--t-12);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pcard-foot {
  display: flex; align-items: center; gap: var(--s-8);
  padding-top: var(--s-8);
  border-top: 1px solid var(--border);
}

.dot-sep { display: block; width: 3px; height: 3px; border-radius: var(--r-full);
           background: var(--text-dim); flex: none; }

.tag {
  display: inline-flex; align-items: center;
  padding: 1px var(--s-6);
  border-radius: var(--r-4);
  background: var(--bg-hover);
  font-size: var(--t-11);
  font-weight: var(--w-medium);
  color: var(--text-muted);
  white-space: nowrap;
}
.tag--shared { background: var(--accent-wash); color: var(--accent-text); }
.tag--archived { background: var(--bg-hover); color: var(--text-muted); }

/* Dashboard totals. Numbers a Super Admin checks, not a hero statistic. */
.stats { display: flex; align-items: center; gap: var(--s-24); }
.stat { display: flex; align-items: baseline; gap: var(--s-6); }
.stat-num {
  font-size: var(--t-15);
  font-weight: var(--w-semibold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: var(--t-12); color: var(--text-muted); }

/* ==========================================================================
   THE BOARD
   ========================================================================== */

.board {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-canvas);
}

.board-bar {
  display: flex; align-items: center; gap: var(--s-12);
  flex: none;
  min-height: 46px;
  padding-inline: var(--s-24);
  border-bottom: 1px solid var(--border);
  background: var(--bg-canvas);
}
.board-title { display: flex; align-items: baseline; gap: var(--s-8); min-width: 0; }
.board-name { font-size: var(--t-15); font-weight: var(--w-semibold); color: var(--text-primary); }
.board-count { font-size: var(--t-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.board-end { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; }

.zoom {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
}
.zoom-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--r-4);
  color: var(--text-muted);
}
.zoom-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
/* Either end of the ladder. A real disabled button rather than the sheet's
   usual aria-disabled, because these two ARE buttons — aria-disabled is for
   the links and spans that cannot carry the real attribute. The hover has to
   be turned off with it, or a dead control still lights up under the
   pointer and reads as clickable. */
.zoom-btn:disabled,
.zoom-btn:disabled:hover { background: var(--transparent); color: var(--text-dim); }
.zoom-btn svg { width: 14px; height: 14px; }
.zoom-value {
  min-width: 42px;
  text-align: center;
  font-size: var(--t-12);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* The grid/canvas switch (OQ-1). Grid is the default and is listed first,
   because the mode a board opens in is the mode most people never leave. */
.mode {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
}
.mode-btn {
  display: flex; align-items: center; gap: var(--s-6);
  height: 24px;
  padding-inline: var(--s-8);
  border-radius: var(--r-4);
  color: var(--text-muted);
  font-size: var(--t-12);
}
.mode-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.mode-btn svg { width: 14px; height: 14px; }

/* The current mode reads as pressed, not merely tinted — a segmented control
   whose only difference is a wash is unreadable to anyone who cannot see the
   wash, and the accent alone would compete with a selected screen's ring. */
.mode-btn.is-on {
  background: var(--accent-wash);
  color: var(--text-primary);
  font-weight: var(--w-semibold);
}

.board-body { display: flex; flex-direction: column; gap: var(--s-24); padding: var(--s-24); }

/* A choice of two or three in a form, drawn as one control (New project's
   Platform). Radio inputs inside labels, not buttons: it posts with the form
   and works without script, and :has(:checked) draws the pressed one. Sized
   like an input so it lines up with the fields around it. */
.segment {
  display: flex; gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
}
.segment-opt {
  display: flex; flex: 1 1 0; align-items: center; justify-content: center; gap: var(--s-6);
  min-height: var(--control-h);
  border-radius: var(--r-4);
  font-size: var(--t-13);
  color: var(--text-muted);
  cursor: pointer;
}
.segment-opt:hover { background: var(--bg-hover); color: var(--text-primary); }
.segment-opt svg { width: 16px; height: 16px; flex: none; }
.segment-opt:has(input:checked) {
  background: var(--accent-wash);
  color: var(--text-primary);
  font-weight: var(--w-semibold);
}
.segment-opt:has(input:focus-visible) { box-shadow: var(--ring); }

/* CARD SIZE (FR-3, Phase 4) AND PLATFORM (Sprint 50)
   A card's width is its platform's unit times the stepper's zoom. Mobile
   screens are 9:16 portraits on a 168px card; web screens are 16:9 on a
   300px one, because a 16:9 frame at 168px is 94px tall and shows nothing.
   The stepper writes --card-zoom and nothing else, so the same five steps
   mean the same thing on either kind of board. Frames keep their ratio
   through aspect-ratio (see .shot-frame .shot-img), so no height is set. */
.board-body,
.canvas-field {
  --card-unit: 168px;
  --card-zoom: 1;
  --shot-w: calc(var(--card-unit) * var(--card-zoom));
}
.board--web { --card-unit: 300px; }
.board--web .shot-frame .shot-img,
.board--web .shot-frame .shot-art { aspect-ratio: 16 / 9; }

.board--z75  { --card-zoom: .75; }
.board--z100 { --card-zoom: 1; }
.board--z125 { --card-zoom: 1.25; }
.board--z150 { --card-zoom: 1.5; }
.board--z200 { --card-zoom: 2; }

/* ==========================================================================
   FREE CANVAS (FR-5, Phase 6)
   --------------------------------------------------------------------------
   The board's second layout mode. Grid auto-flows and cannot overlap; canvas
   puts every screen exactly where the designer dropped it, which is how a
   flow gets laid out as a flow.

   Both modes write the same tables — grid keeps `sort_order`, canvas keeps
   `pos_x`/`pos_y` — so switching is non-destructive and switching back finds
   the grid exactly as it was left.

   THREE THINGS DECIDE HOW THIS IS BUILT.

   1. Positions snap to --free-unit. They have to: this file may not carry an
      inline style, a position is a value that varies, and the house answer to
      a value that varies is a step class. Snapping is not a workaround the
      rule forced on us — it is the thing that makes a hand-placed canvas line
      up at all, and Figma, Sketch and Zeplin all do it.

   2. Sections stay sections. plan.md §6.4 calls them "resizable frames" in
      free mode; a frame here is sized in whole screen cards (.frame--c4 is
      four cards wide) rather than by a free drag handle. Same reason as
      above, and it keeps a frame aligned to the screens it contains instead
      of ending three pixels past one.

   3. Nothing here is load-bearing for the resting state. Every screen is
      placed in the markup by its step classes, so a capture with scripts
      stripped shows the same canvas.
   ========================================================================== */

/* The canvas scrolls, the page does not. Without min-height:0 the board is a
   column flex item whose implicit min-height is its content — a 1920px field
   pushes the artboard to 1920px and the whole window scrolls instead, which
   is the same trap .screen--fit exists for. The canvas screen carries
   .screen--fit for the other half of it. */
.board--canvas { min-height: 0; }

.canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--s-24);

  /* The snap grid, drawn. A canvas that snaps invisibly feels broken — the
     screen lands somewhere the designer did not release it and there is
     nothing on screen to explain why. */
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: var(--free-unit) var(--free-unit);
  background-position: var(--s-24) var(--s-24);
}

/* The placed area. Sized generously so the canvas scrolls in both axes from
   the start; a canvas that is exactly as big as its content cannot be
   dragged into. */
.canvas-field {
  position: relative;
  width: calc(var(--free-unit) * 80);
  height: calc(var(--free-unit) * 80);
}

/* A loose screen — one in no section. These are the only things on the canvas
   placed screen by screen. */
.shot--free { position: absolute; width: var(--shot-w); }

/* A section in canvas mode.
 *
 * The frame is placed freely and then FLOWS its screens, rather than every
 * screen inside it being placed one at a time. That is the honest reading of
 * the plan's own compromise — sections auto-flow, screens flow inside them —
 * carried onto a canvas: what a designer wants to arrange is the flow, not the
 * eleven cards that make it up.
 *
 * It also means the frame is exactly as big as what it holds. Sizing it by
 * hand meant a frame that ended three pixels past its last card, or a size
 * scale as long as the position scale.
 *
 * Dashed, because a solid rule at this size reads as a window frame around
 * somebody's artwork.
 */
.frame {
  position: absolute;
  display: grid;
  align-items: start;
  gap: var(--s-16);
  padding: var(--s-24);
  border: 1px dashed var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-shot);
}

/* How many screens across before the flow wraps. The one thing about a frame
   that is a choice rather than a consequence. */
.frame--c1 { grid-template-columns: repeat(1, var(--shot-w)); }
.frame--c2 { grid-template-columns: repeat(2, var(--shot-w)); }
.frame--c3 { grid-template-columns: repeat(3, var(--shot-w)); }
.frame--c4 { grid-template-columns: repeat(4, var(--shot-w)); }
.frame--c5 { grid-template-columns: repeat(5, var(--shot-w)); }
.frame--c6 { grid-template-columns: repeat(6, var(--shot-w)); }
.frame-label {
  position: absolute;
  top: calc(var(--s-24) * -1);
  left: 0;
  display: flex; align-items: baseline; gap: var(--s-8);
  font-size: var(--t-12);
  color: var(--text-muted);
}
.frame-name { font-weight: var(--w-semibold); color: var(--text-primary); }
.frame-count { font-variant-numeric: tabular-nums; }

/* The screen being dragged. Lifted, not tinted — the pixels underneath are
   somebody's design and a wash over them is a lie about their colour. */
.canvas .shot.is-dragging {
  z-index: 2;
  cursor: grabbing;
  box-shadow: var(--shadow-menu);
}
.canvas .shot.is-dragging .shot-frame { border-color: var(--transparent); box-shadow: var(--ring); }

/* --------------------------------------------------------------------------
   The step scale.

   GENERATED, and the only block in this file that is. Every other varying
   value in the system has a handful of steps (.bar-fill--63 and its
   neighbours); a canvas position has as many steps as the canvas is wide, and
   the alternative is an inline style on every screen on the board.

   x and y run 0–79 at --free-unit, which is a 1920 × 1920 canvas. There is no
   width or height scale: a frame is sized by what it holds and a card is one
   card wide. Widen the range by extending the block — it is mechanical, and it
   stays mechanical.
   -------------------------------------------------------------------------- */

.at-x0{left:0}.at-x1{left:calc(var(--free-unit)*1)}.at-x2{left:calc(var(--free-unit)*2)}.at-x3{left:calc(var(--free-unit)*3)}
.at-x4{left:calc(var(--free-unit)*4)}.at-x5{left:calc(var(--free-unit)*5)}.at-x6{left:calc(var(--free-unit)*6)}.at-x7{left:calc(var(--free-unit)*7)}
.at-x8{left:calc(var(--free-unit)*8)}.at-x9{left:calc(var(--free-unit)*9)}.at-x10{left:calc(var(--free-unit)*10)}.at-x11{left:calc(var(--free-unit)*11)}
.at-x12{left:calc(var(--free-unit)*12)}.at-x13{left:calc(var(--free-unit)*13)}.at-x14{left:calc(var(--free-unit)*14)}.at-x15{left:calc(var(--free-unit)*15)}
.at-x16{left:calc(var(--free-unit)*16)}.at-x17{left:calc(var(--free-unit)*17)}.at-x18{left:calc(var(--free-unit)*18)}.at-x19{left:calc(var(--free-unit)*19)}
.at-x20{left:calc(var(--free-unit)*20)}.at-x21{left:calc(var(--free-unit)*21)}.at-x22{left:calc(var(--free-unit)*22)}.at-x23{left:calc(var(--free-unit)*23)}
.at-x24{left:calc(var(--free-unit)*24)}.at-x25{left:calc(var(--free-unit)*25)}.at-x26{left:calc(var(--free-unit)*26)}.at-x27{left:calc(var(--free-unit)*27)}
.at-x28{left:calc(var(--free-unit)*28)}.at-x29{left:calc(var(--free-unit)*29)}.at-x30{left:calc(var(--free-unit)*30)}.at-x31{left:calc(var(--free-unit)*31)}
.at-x32{left:calc(var(--free-unit)*32)}.at-x33{left:calc(var(--free-unit)*33)}.at-x34{left:calc(var(--free-unit)*34)}.at-x35{left:calc(var(--free-unit)*35)}
.at-x36{left:calc(var(--free-unit)*36)}.at-x37{left:calc(var(--free-unit)*37)}.at-x38{left:calc(var(--free-unit)*38)}.at-x39{left:calc(var(--free-unit)*39)}
.at-x40{left:calc(var(--free-unit)*40)}.at-x41{left:calc(var(--free-unit)*41)}.at-x42{left:calc(var(--free-unit)*42)}.at-x43{left:calc(var(--free-unit)*43)}
.at-x44{left:calc(var(--free-unit)*44)}.at-x45{left:calc(var(--free-unit)*45)}.at-x46{left:calc(var(--free-unit)*46)}.at-x47{left:calc(var(--free-unit)*47)}
.at-x48{left:calc(var(--free-unit)*48)}.at-x49{left:calc(var(--free-unit)*49)}.at-x50{left:calc(var(--free-unit)*50)}.at-x51{left:calc(var(--free-unit)*51)}
.at-x52{left:calc(var(--free-unit)*52)}.at-x53{left:calc(var(--free-unit)*53)}.at-x54{left:calc(var(--free-unit)*54)}.at-x55{left:calc(var(--free-unit)*55)}
.at-x56{left:calc(var(--free-unit)*56)}.at-x57{left:calc(var(--free-unit)*57)}.at-x58{left:calc(var(--free-unit)*58)}.at-x59{left:calc(var(--free-unit)*59)}
.at-x60{left:calc(var(--free-unit)*60)}.at-x61{left:calc(var(--free-unit)*61)}.at-x62{left:calc(var(--free-unit)*62)}.at-x63{left:calc(var(--free-unit)*63)}
.at-x64{left:calc(var(--free-unit)*64)}.at-x65{left:calc(var(--free-unit)*65)}.at-x66{left:calc(var(--free-unit)*66)}.at-x67{left:calc(var(--free-unit)*67)}
.at-x68{left:calc(var(--free-unit)*68)}.at-x69{left:calc(var(--free-unit)*69)}.at-x70{left:calc(var(--free-unit)*70)}.at-x71{left:calc(var(--free-unit)*71)}
.at-x72{left:calc(var(--free-unit)*72)}.at-x73{left:calc(var(--free-unit)*73)}.at-x74{left:calc(var(--free-unit)*74)}.at-x75{left:calc(var(--free-unit)*75)}
.at-x76{left:calc(var(--free-unit)*76)}.at-x77{left:calc(var(--free-unit)*77)}.at-x78{left:calc(var(--free-unit)*78)}.at-x79{left:calc(var(--free-unit)*79)}

.at-y0{top:0}.at-y1{top:calc(var(--free-unit)*1)}.at-y2{top:calc(var(--free-unit)*2)}.at-y3{top:calc(var(--free-unit)*3)}
.at-y4{top:calc(var(--free-unit)*4)}.at-y5{top:calc(var(--free-unit)*5)}.at-y6{top:calc(var(--free-unit)*6)}.at-y7{top:calc(var(--free-unit)*7)}
.at-y8{top:calc(var(--free-unit)*8)}.at-y9{top:calc(var(--free-unit)*9)}.at-y10{top:calc(var(--free-unit)*10)}.at-y11{top:calc(var(--free-unit)*11)}
.at-y12{top:calc(var(--free-unit)*12)}.at-y13{top:calc(var(--free-unit)*13)}.at-y14{top:calc(var(--free-unit)*14)}.at-y15{top:calc(var(--free-unit)*15)}
.at-y16{top:calc(var(--free-unit)*16)}.at-y17{top:calc(var(--free-unit)*17)}.at-y18{top:calc(var(--free-unit)*18)}.at-y19{top:calc(var(--free-unit)*19)}
.at-y20{top:calc(var(--free-unit)*20)}.at-y21{top:calc(var(--free-unit)*21)}.at-y22{top:calc(var(--free-unit)*22)}.at-y23{top:calc(var(--free-unit)*23)}
.at-y24{top:calc(var(--free-unit)*24)}.at-y25{top:calc(var(--free-unit)*25)}.at-y26{top:calc(var(--free-unit)*26)}.at-y27{top:calc(var(--free-unit)*27)}
.at-y28{top:calc(var(--free-unit)*28)}.at-y29{top:calc(var(--free-unit)*29)}.at-y30{top:calc(var(--free-unit)*30)}.at-y31{top:calc(var(--free-unit)*31)}
.at-y32{top:calc(var(--free-unit)*32)}.at-y33{top:calc(var(--free-unit)*33)}.at-y34{top:calc(var(--free-unit)*34)}.at-y35{top:calc(var(--free-unit)*35)}
.at-y36{top:calc(var(--free-unit)*36)}.at-y37{top:calc(var(--free-unit)*37)}.at-y38{top:calc(var(--free-unit)*38)}.at-y39{top:calc(var(--free-unit)*39)}
.at-y40{top:calc(var(--free-unit)*40)}.at-y41{top:calc(var(--free-unit)*41)}.at-y42{top:calc(var(--free-unit)*42)}.at-y43{top:calc(var(--free-unit)*43)}
.at-y44{top:calc(var(--free-unit)*44)}.at-y45{top:calc(var(--free-unit)*45)}.at-y46{top:calc(var(--free-unit)*46)}.at-y47{top:calc(var(--free-unit)*47)}
.at-y48{top:calc(var(--free-unit)*48)}.at-y49{top:calc(var(--free-unit)*49)}.at-y50{top:calc(var(--free-unit)*50)}.at-y51{top:calc(var(--free-unit)*51)}
.at-y52{top:calc(var(--free-unit)*52)}.at-y53{top:calc(var(--free-unit)*53)}.at-y54{top:calc(var(--free-unit)*54)}.at-y55{top:calc(var(--free-unit)*55)}
.at-y56{top:calc(var(--free-unit)*56)}.at-y57{top:calc(var(--free-unit)*57)}.at-y58{top:calc(var(--free-unit)*58)}.at-y59{top:calc(var(--free-unit)*59)}
.at-y60{top:calc(var(--free-unit)*60)}.at-y61{top:calc(var(--free-unit)*61)}.at-y62{top:calc(var(--free-unit)*62)}.at-y63{top:calc(var(--free-unit)*63)}
.at-y64{top:calc(var(--free-unit)*64)}.at-y65{top:calc(var(--free-unit)*65)}.at-y66{top:calc(var(--free-unit)*66)}.at-y67{top:calc(var(--free-unit)*67)}
.at-y68{top:calc(var(--free-unit)*68)}.at-y69{top:calc(var(--free-unit)*69)}.at-y70{top:calc(var(--free-unit)*70)}.at-y71{top:calc(var(--free-unit)*71)}
.at-y72{top:calc(var(--free-unit)*72)}.at-y73{top:calc(var(--free-unit)*73)}.at-y74{top:calc(var(--free-unit)*74)}.at-y75{top:calc(var(--free-unit)*75)}
.at-y76{top:calc(var(--free-unit)*76)}.at-y77{top:calc(var(--free-unit)*77)}.at-y78{top:calc(var(--free-unit)*78)}.at-y79{top:calc(var(--free-unit)*79)}


.sect { display: flex; flex-direction: column; gap: var(--s-12); }
.sect-head { display: flex; align-items: center; gap: var(--s-8); }
.sect-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  flex: none;
  color: var(--text-muted);
}
.sect-toggle svg { width: 12px; height: 12px; stroke-width: 2; }
.sect-name { font-size: var(--t-15); font-weight: var(--w-semibold); color: var(--text-primary); }
.sect-count {
  font-size: var(--t-12);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.sect-rule { display: block; flex: 1 1 auto; height: 1px; background: var(--border); }

/* The inline rename state (FR-8 double-click). A real input, not a styled
   div — the caret has to be where the designer expects it. */
/* Renaming a screen, in the viewer's title bar (FR-13).
 *
 * Sized to the name rather than to its container: the bar is a flex row and a
 * full-width field would shove the zoom and share controls off the end of it.
 * field-sizing does the work where it is supported and the min/max keep it
 * sane everywhere else. */
.viewer-rename {
  display: block;
  min-width: 220px;
  max-width: 460px;
  field-sizing: content;
  padding: var(--s-2) var(--s-6);
  border: 1px solid var(--accent);
  border-radius: var(--r-4);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--t-13);
  font-weight: var(--w-semibold);
  box-shadow: var(--ring);
}

/* Renaming a screen, in the card. Same control as .sect-rename and
   deliberately not the same size: a card name is 13px in a 168px column, and
   the section heading's 15px semibold at 200px would burst the grid. */
.shot-rename {
  display: block;
  width: 100%;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--accent);
  border-radius: var(--r-4);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--t-13);
  box-shadow: var(--ring);
}

.sect-rename {
  display: block;
  min-width: 200px;
  padding: var(--s-2) var(--s-6);
  border: 1px solid var(--accent);
  border-radius: var(--r-4);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--t-15);
  font-weight: var(--w-semibold);
  box-shadow: var(--ring);
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--shot-w), 1fr));
  gap: var(--s-16);
}

/* The card being dragged to another section. Lifted and faded, so what is
   under the pointer reads as a copy in flight rather than as the screen
   having already moved — it has not, until it is dropped. */
.shot.is-moving { opacity: .5; cursor: grabbing; }

/* Where a dragged screen will land, when the drag is a REORDER rather than a
   move between sections.

   A line in the gutter, not a highlight on a card. The question a reorder asks
   is "before or after this one", and a highlighted card cannot answer it —
   it says "this one" and leaves the side ambiguous. The line sits in the 16px
   gap, so it never covers artwork.

   .shot is a flex column, so it needs the positioning context declared. */
.shot.is-drop-before,
.shot.is-drop-after { position: relative; }

.shot.is-drop-before::before,
.shot.is-drop-after::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: var(--s-20);
  width: 2px;
  border-radius: var(--r-full);
  background: var(--accent);
}

/* Centred in the gutter: half the gap, less half the line. */
.shot.is-drop-before::before { left: calc((var(--s-16) / -2) - 1px); }
.shot.is-drop-after::after   { right: calc((var(--s-16) / -2) - 1px); }

/* A section that is a live drop target. A dashed edge, because a filled one
   would tint the artwork sitting inside it. */
.sect--drop .shots {
  padding: var(--s-12);
  margin: calc(var(--s-12) * -1);
  border: 1px dashed var(--accent);
  border-radius: var(--r-6);
  background: var(--accent-wash);
}

/* ==========================================================================
   SCREEN CARD
   --------------------------------------------------------------------------
   Thumbnail, name, pixel size. Nothing else fits at 168px and nothing else
   is needed to FIND a screen, which is the card's only job.

   Selection is a ring plus a check — never a colour wash over the image. A
   wash tints the design underneath and the designer reads it as their own.
   ========================================================================== */

.shot { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
.shot-frame {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-shot);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.shot:hover .shot-frame { border-color: var(--border-control); }
.shot.is-selected .shot-frame { border-color: var(--transparent); box-shadow: var(--ring); }

.shot-check {
  position: absolute; top: var(--s-6); left: var(--s-6);
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--text-on-fill);
}
.shot-check svg { width: 11px; height: 11px; stroke-width: 2.6; }

/* A real uploaded thumbnail, replacing the whole .shot-art stand-in. Same box,
   so a board of real screens sits on the same grid as the artboard.

   object-position: top, not centre. A phone screen is far taller than this
   frame, and a design is read from the top down — cropping away the middle of
   a screen would hide the very thing someone is scanning for. */
.shot-img {
  display: block;
  width: 100%;
  height: var(--shot-h, 268px);
  object-fit: cover;
  object-position: top;
  background: var(--art-ground);
}
/* Every card in a board is the same 9:16 portrait frame, whatever the screen
   inside it measures. A fixed 268px height held only while the card was
   168px wide: the grid stretches cards to fill the row, so on a wide window
   the frame turned squat and each board looked different from the last. The
   ratio holds at every width and every zoom step, the row stays one height,
   and object-fit: cover with object-position: top shows the top of a long
   screen — which is where a screen is read from. The true pixel size is
   still written under the card.

   Scoped to .shot-frame, so the viewer's full-height stand-in and the search
   palette's small thumbnails keep their own shapes. */
.shot-frame .shot-img,
.shot-frame .shot-art { height: auto; aspect-ratio: 9 / 16; }

.pcard-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.shot-body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.shot-name {
  font-size: var(--t-12);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-dims {
  font-size: var(--t-11);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.shot-ver {
  position: absolute; top: var(--s-6); right: var(--s-6);
  padding: 1px var(--s-4);
  border-radius: var(--r-4);
  background: var(--over-art);
  font-size: var(--t-11);
  font-weight: var(--w-medium);
  color: var(--over-art-ink);
}

/* --------------------------------------------------------------------------
   THE ARTWORK STAND-IN
   These are not designs. They are the smallest honest shape that reads as
   "a mobile screen" on a board — a status band, a header, and content blocks.
   Real uploads replace the whole .shot-art node with an <img>.
   -------------------------------------------------------------------------- */
/* Every card is the SAME height, and it is not the screen's aspect ratio.
   A 1179 × 3402 export at card width would be 386px tall next to a 268px
   one, and a board of 64 screens becomes a ragged column you scan by
   scrolling. Zeplin normalises the card and shows the top of a long screen;
   the true pixel size is stated in words on the line below, which is the
   only place it is actually read. */
.shot-art {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  height: var(--shot-h, 268px);
  padding: var(--s-8);
  background: var(--art-ground);
  overflow: hidden;
}
/* The viewer shows the whole screen, so there it keeps its real proportion. */
.shot-art--tall { height: auto; aspect-ratio: 1179 / 3402; }

/* The real screen in the viewer. Never cropped — the whole design is the
   point. No width here: the <img> width and height attributes carry the
   screen's design size (Screen::shown), and a width: 100% in this rule, left
   over from the artboard's fixed 261px frame, overrode them and stretched
   every screen to the full stage. */
.viewer-img { display: block; height: auto; }
.shot-art--sm { height: auto; flex: 1 1 auto; gap: var(--s-4); padding: var(--s-4); }
.shot-art--sm .art-band { height: 3px; }
.shot-art--sm .art-head { height: 10px; }
.shot-art--sm .art-blk  { height: 12px; }
.shot-art--sm .art-hero { height: 22px; }
.shot-art--sm .art-cta  { height: 9px; }
.art-band { display: block; height: 5px; width: 42%; border-radius: var(--r-full); background: var(--art-band); }
.art-head { display: block; height: 22px; border-radius: var(--r-4); background: var(--art-head); }
.art-hero { display: block; height: 58px; border-radius: var(--r-4); background: var(--art-hero); }
.art-blk  { display: block; height: 26px; border-radius: var(--r-4); background: var(--art-blk); }
.art-blk--tall { height: 44px; }
.art-blk--short { height: 14px; }
.art-row { display: flex; gap: var(--s-6); }
.art-row > .art-blk { flex: 1 1 0; }
.art-fill { display: block; flex: 1 1 auto; border-radius: var(--r-4); background: var(--art-fill); }
.art-cta { display: block; height: 20px; border-radius: var(--r-4); background: var(--accent-fill); }
.art-foot { display: block; height: 18px; border-radius: var(--r-4); background: var(--art-head); }

/* Tints so a board does not read as one screen repeated. Hue only — these
   stand in for artwork, and artwork is the one place colour belongs.
   Each tint redefines the same six tokens, so a tint works in either theme
   without a single duplicated rule inside the components. */
.shot-art--warm  { --art-ground: #FBF0E9; --art-band: #DFC2AE; --art-head: #EBD3C2;
                   --art-hero: #F0DCCD; --art-blk: #F4E5DA; --art-fill: #FDF7F3; }
.shot-art--green { --art-ground: #E9F2ED; --art-band: #B6CFC1; --art-head: #CBE0D4;
                   --art-hero: #D5E6DB; --art-blk: #DEEBE3; --art-fill: #F3F8F5; }
.shot-art--plum  { --art-ground: #EFEAF5; --art-band: #C7BAD9; --art-head: #D8CDE6;
                   --art-hero: #E0D7EB; --art-blk: #E7E0F0; --art-fill: #F7F4FA; }
.shot-art--ink   { --art-ground: #E7E9EE; --art-band: #BCC2CE; --art-head: #CDD2DC;
                   --art-hero: #D6DAE3; --art-blk: #DFE2E9; --art-fill: #F1F2F5; }

:root[data-theme="dark"] .shot-art--warm  { --art-ground: #33292A; --art-band: #6A4F4E;
    --art-head: #4E3A3B; --art-hero: #57403F; --art-blk: #433435; --art-fill: #2C2425; }
:root[data-theme="dark"] .shot-art--green { --art-ground: #22302B; --art-band: #4A6459;
    --art-head: #35473F; --art-hero: #3C5049; --art-blk: #2D3B36; --art-fill: #1D2926; }
:root[data-theme="dark"] .shot-art--plum  { --art-ground: #2C2634; --art-band: #5C4F72;
    --art-head: #433A52; --art-hero: #4C4260; --art-blk: #3A3247; --art-fill: #26212D; }
:root[data-theme="dark"] .shot-art--ink   { --art-ground: #1B1D22; --art-band: #3E444F;
    --art-head: #2F343E; --art-hero: #353B46; --art-blk: #262A32; --art-fill: #17191D; }

/* ==========================================================================
   FLOATING SELECTION BAR (FR-4)
   --------------------------------------------------------------------------
   Absolute inside .screen, never fixed — the artboard has to contain it.
   ========================================================================== */

/* The selection bar floats above the board and STAYS there.
 *
 * position: fixed, which is the one place this system uses it. The artboards
 * are otherwise free of fixed and sticky on purpose — a Figma capture flattens
 * a 2424px board into one image and anything pinned to the viewport lands in
 * the wrong place in it — but this bar exists to act on a selection, and on a
 * real board of sixty screens an absolutely positioned one sits at the bottom
 * of the PAGE. It was 859px down a 720px window: you had to scroll away from
 * what you had selected to act on it, which is the opposite of what it is for.
 *
 * On the 900px artboard the two are indistinguishable, so the screens are
 * unaffected. DESIGN.md §10 records this as the single exception. */
.actionbar {
  position: fixed;
  left: 50%; bottom: var(--s-24);
  transform: translateX(-50%);
  z-index: 30;
  display: flex; align-items: center; gap: var(--s-8);
  padding: var(--s-8) var(--s-10);
  border: 1px solid var(--border-control);
  border-radius: var(--r-10);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-modal);
}
.actionbar-count {
  padding-inline: var(--s-6);
  font-size: var(--t-13);
  font-weight: var(--w-medium);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.actionbar-rule { display: block; width: 1px; height: 20px; background: var(--border); flex: none; }

/* The section picker, hanging off "Move to". Same anchoring idea as the
   account and project menus, but upward: the action bar sits at the foot of
   the board, and a menu opening downward from it would leave the viewport. */
.actionmenu { position: relative; }
/* --s-12, not the --s-6 the downward menus use: this one has to clear the
   action bar's own 8px padding and 1px border as well as the button, or
   it sits 2px inside the bar and clips its rounded top edge. */
.menu--up { bottom: calc(100% + var(--s-12)); left: 0; }

/* ==========================================================================
   CONTEXT MENU (FR-8)
   ========================================================================== */

.menu {
  position: absolute;
  /* Above the board under it. A menu that hangs over the cards was painted
     behind them: the cards come later in the document, and a positioned box
     with no z-index does not beat that. 20 clears the board and stays under
     the action bar (30) and any dialog (35). */
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 216px;
  padding: var(--s-4);
  border: 1px solid var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-menu);
}
.menu-item {
  display: flex; align-items: center; gap: var(--s-8);
  width: 100%;
  min-height: 28px;
  padding-inline: var(--s-8);
  border-radius: var(--r-4);
  /* A menu item is an <a> when it navigates and a <button> when it acts.
     Anchors inherit the page font; buttons do not. Name it here or the two
     render in different typefaces side by side in the same menu. */
  font-family: var(--font-ui);
  font-size: var(--t-13);
  text-align: left;
  color: var(--text-primary);
}
.menu-item:hover { background: var(--bg-hover); }
.menu-item svg { width: 15px; height: 15px; flex: none; color: var(--text-muted); }
.menu-item.is-danger { color: var(--danger-text); }
.menu-item.is-danger svg { color: var(--danger-text); }
.menu-key { margin-left: auto; font-size: var(--t-11); color: var(--text-dim); }
.menu-rule { display: block; height: 1px; margin: var(--s-4) var(--s-8); background: var(--border); }
/* Where the menu opened. A context menu appears at the pointer, so its
   position is data — but data with two values, which is a step class and not
   an inline style. Add one when a screen needs a third. */
.menu--at-card2 { top: 300px; left: 466px; }

/* The account menu. Anchored to the avatar rather than to the pointer, so it
   gets a positioning context of its own instead of a step class. */
.usermenu { position: relative; }
.menu--user { top: calc(100% + var(--s-6)); right: 0; }

/* The project menu, in the board bar. Same anchoring as the account menu and
   for the same reason — it hangs off a button, not off the pointer — but its
   own class, because "the menu under the avatar" and "the menu under the
   project's ⋯" are two things that will drift apart the first time either
   moves. */
.projectmenu { position: relative; }
.menu--project { top: calc(100% + var(--s-6)); right: 0; }

/* The screen's ⋯, in the viewer bar. Third of the same shape, third class,
   for the reason given just above — and this one has a constraint the other
   two do not: the bar is only 46px tall and the menu hangs into the stage
   below it, so it needs to sit above the artwork rather than behind it. */
.screenmenu { position: relative; }
.menu--screen { top: calc(100% + var(--s-6)); right: 0; z-index: 20; }

/* Row actions are plain submit buttons, not a popover. .tablewrap clips its
   overflow to keep the table's rounded corners, so an absolutely positioned
   menu inside a row would be cut off by its own container. */
.cell-actions form { display: inline-flex; }

/* A banner shown above the table rather than below it, for a result the user
   must read now — a temporary password is displayed once and cannot be
   recovered afterwards. */
.banner--top { margin-bottom: var(--s-16); }
.menu-head {
  display: flex; flex-direction: column; gap: 1px;
  padding: var(--s-6) var(--s-8) var(--s-4);
}
.menu-name { font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-primary); }
.menu-mail { font-size: var(--t-11); color: var(--text-muted); }
/* The sign-out control is a POST, so it is a form. Without this the form box
   sits between the menu's flex column and the item, and the item stops
   stretching. */
.menu-form { display: block; width: 100%; margin: 0; }

/* ==========================================================================
   DIALOGS
   ========================================================================== */

/* Fixed, not absolute. A board with forty screens is several viewports tall,
   and an absolute scrim centres itself in that whole height — the dialog then
   opens far below what the person is looking at. Fixed pins it to the
   viewport. On the dialog screens, which are exactly 100vh, nothing changes.
   While one is open the page behind it does not scroll. */
.scrim {
  position: fixed; inset: 0; z-index: 35;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-24);
  background: var(--scrim);
}
html:has(.scrim:not([hidden])),
html:has(.scrim:not([hidden])) body { overflow: hidden; }

.dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--dialog-w);
  border: 1px solid var(--border-control);
  border-radius: var(--r-10);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.dialog--sm { max-width: var(--dialog-w-sm); }
.dialog--lg { max-width: var(--dialog-w-lg); }

.dialog-head {
  display: flex; align-items: flex-start; gap: var(--s-12);
  padding: var(--s-20) var(--s-20) var(--s-16);
  border-bottom: 1px solid var(--border);
}
/* flex:1 pins the close button to the right edge whatever the subtitle says.
   Without it the head sizes to its text and the × lands wherever the sentence
   happens to end — 216px short of the corner on a short subtitle. The artboards
   only looked right because their subtitles were long enough to fill the width
   by accident. */
.dialog-head-main { display: flex; flex-direction: column; gap: var(--s-4); flex: 1; min-width: 0; }
.dialog-title {
  font-size: var(--t-22);
  font-weight: var(--w-semibold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}
.dialog-sub { font-size: var(--t-12); color: var(--text-muted); }
/* A dialog never grows taller than the window, and its BODY is what scrolls —
   the head and the foot stay put, so the primary action is always reachable.
   The screen behind an overlay is height:100vh; overflow:hidden, so without
   this a 60-file upload list simply gets cut off with no way to reach the rest.

   min-height:0 is the part that is easy to miss: a flex child will not shrink
   below its content unless it is told it may, and without it overflow-y never
   engages. Same trap as .screen--fit needing min-height:0. */
.dialog { max-height: calc(100vh - (2 * var(--s-24))); }
.dialog-body {
  display: flex; flex-direction: column; gap: var(--s-16); padding: var(--s-20);
  min-height: 0;
  overflow-y: auto;
}
.dialog-foot {
  display: flex; align-items: center; gap: var(--s-8);

  /* Wraps, because a note and two buttons do not always fit across a 420px
     dialog. Without this the note is squeezed to its narrowest column and
     wraps to two or three lines beside full-height buttons, which reads as
     broken rather than as tight. */
  flex-wrap: wrap;

  padding: var(--s-16) var(--s-20);
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}

/* A form wrapping the dialog's own parts.
 *
 * The port wraps head, body and foot in one <form> so a single submit carries
 * every field. As a flex child of .dialog that form is ONE item with no
 * min-height: 0, so .dialog-body's overflow-y never engages — the content
 * simply grew past max-height and pushed the footer off the bottom of the
 * window. Measured at 721px in a 720px viewport: the Create project button was
 * unreachable, on a dialog whose entire purpose is that button.
 *
 * display: contents lifts head, body and foot back out as direct flex children
 * of .dialog, which is what the max-height and the scrolling body were written
 * against. Submission is unaffected — the form is still their DOM ancestor.
 */
.dialog > form { display: contents; }

/* The form the PORT wraps a submit button in.
 *
 * An artboard footer holds anchors; a real one has to POST with a CSRF token,
 * so the button arrives inside a <form>. display: contents lifts the button
 * back out into the footer's flex row, so the two lay out identically — and
 * the hidden token input is display:none already, so it adds nothing.
 *
 * Here rather than in the port, because forking the stylesheet is how the two
 * drift apart. */
.dialog-foot form { display: contents; }
/* NEVER :first-of-type here. It matches once PER ELEMENT TYPE, so a footer
   holding a <button> and an <a> gives BOTH of them margin-left:auto and the
   row scatters — which is exactly what happened on the share dialog. What
   pushes the actions right is either .dialog-note or an explicit .u-spacer,
   both of which say so in the markup. */
.dialog-note { margin-right: auto; font-size: var(--t-12); color: var(--text-muted); }

/* In the SMALL dialog the note gets its own row.
 *
 * 420px does not hold a sentence and two buttons across, and the three ways
 * that can fail all look like a mistake: the note squeezed into a three-line
 * column, or the buttons split across two rows, or the note truncated. Giving
 * it the whole first row and right-aligning the buttons underneath is the one
 * arrangement that reads as a decision.
 *
 * Scoped to .dialog--sm because at 520px the single row is correct and is what
 * 05-project-new already shows. */
.dialog--sm .dialog-foot { justify-content: flex-end; }
.dialog--sm .dialog-note {
  flex: 1 1 100%;
  margin-right: 0;
  margin-bottom: var(--s-4);
}
.dialog-foot .u-spacer { flex: 1 1 auto; }

/* A warning strip inside a dialog. Word first, colour second — colour alone
   is not a message. */
.banner {
  display: flex; align-items: flex-start; gap: var(--s-10);
  padding: var(--s-12);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-panel);
}
.banner svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.banner-body { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.banner-title { font-size: var(--t-13); font-weight: var(--w-semibold); color: var(--text-primary); }
.banner-text { font-size: var(--t-12); line-height: var(--lh-body); color: var(--text-muted); }
.banner--warn { border-color: var(--warn-line); background: var(--warn-wash); }
.banner--warn svg { color: var(--warn); }
.banner--info svg { color: var(--accent-text); }
.banner--ok svg { color: var(--ok); }

/* The one-time token. Monospaced because 0/O and l/1 must not be guessed, and
   `user-select: all` so one click takes the whole string — a token broken by a
   half-selection fails with an error that names nothing.

   `word-break` rather than a scrollbar: the string is 52 characters with no
   space in it, and a strip that scrolls sideways hides the end of the very
   thing it exists to show. */
.banner-code {
  font-family: var(--font-mono); font-size: var(--t-12);
  margin-top: var(--s-4);
  padding: var(--s-8);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-canvas);
  color: var(--text-primary);
  word-break: break-all;
  user-select: all;
}

/* ==========================================================================
   A LIVE SHARE LINK (FR-11)
   --------------------------------------------------------------------------
   A link is five facts and two actions, and they were laid out in a .field
   with a .form-row holding the URL, Copy and Revoke. .form-row is a TWO-column
   grid: the third child wrapped to a line of its own, so Revoke sat alone
   under a URL squeezed into a 240px stub that showed "http://smarther-pre".
   The link the dialog exists to hand over was the one thing you could not read.

   So a link gets a card, and the card decides its own columns:
     row 1  name, and how many times it has been opened
     row 2  the URL at full width, then Copy, then Revoke
     row 3  its settings, as a footnote
   ========================================================================== */

.sharelink {
  display: flex; flex-direction: column; gap: var(--s-8);
  padding: var(--s-12);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
}
.sharelink-url { display: flex; align-items: center; gap: var(--s-8); min-width: 0; }

/* The revoke <form> carries a CSRF token and nothing to draw. Left as a block
   it becomes the flex item and the button sizes to the form rather than to
   itself — the same wrapper-in-a-flex-row problem the dialog form has. */
.sharelink-url form { display: contents; }

/* The URL is the point of the card: it takes what Copy and Revoke leave. */
.sharelink-url .input { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
   COMMAND PALETTE (FR-6)
   ========================================================================== */

.palette-wrap {
  position: absolute; inset: 0;
  display: flex; justify-content: center;
  padding-top: 96px;
  background: var(--scrim);
}
.palette {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  height: fit-content;
  border: 1px solid var(--border-control);
  border-radius: var(--r-10);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.palette-field {
  display: flex; align-items: center; gap: var(--s-10);
  padding: var(--s-12) var(--s-16);
  border-bottom: 1px solid var(--border);
}
.palette-field svg { width: 17px; height: 17px; flex: none; color: var(--text-muted); }
.palette-input {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: var(--transparent);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--t-15);
}
.palette-input::placeholder { color: var(--text-dim); }
.palette-input:focus { outline: none; }

.palette-body { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-8); }
.palette-group { display: flex; flex-direction: column; gap: var(--s-2); }
.palette-label {
  padding: var(--s-6) var(--s-8) var(--s-4);
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.palette-item {
  display: flex; align-items: center; gap: var(--s-10);
  min-height: 36px;
  padding-inline: var(--s-8);
  border-radius: var(--r-6);
  color: var(--text-primary);
}
.palette-item.is-on { background: var(--accent-wash); }
.palette-thumb {
  display: block;
  width: 26px; height: 34px;
  flex: none;
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  background: var(--bg-shot);
  overflow: hidden;
}
.palette-main { display: flex; flex-direction: column; gap: var(--s-0); min-width: 0; }
.palette-name { font-size: var(--t-13); color: var(--text-primary); }
.palette-where { font-size: var(--t-11); color: var(--text-muted); }
.palette-item svg { width: 15px; height: 15px; flex: none; color: var(--text-muted); }
.palette-foot {
  display: flex; align-items: center; gap: var(--s-16);
  padding: var(--s-8) var(--s-16);
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}
.palette-tip { display: flex; align-items: center; gap: var(--s-6);
               font-size: var(--t-11); color: var(--text-muted); }

/* ==========================================================================
   SCREEN VIEWER (FR-3)
   ========================================================================== */

.viewer { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }
.viewer-bar {
  display: flex; align-items: center; gap: var(--s-12);
  flex: none;
  min-height: 46px;
  padding-inline: var(--s-16);
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.viewer-id { display: flex; flex-direction: column; gap: var(--s-0); min-width: 0; }
.viewer-name { font-size: var(--t-13); font-weight: var(--w-semibold); color: var(--text-primary); }
.viewer-meta { display: flex; align-items: center; gap: var(--s-6);
               font-size: var(--t-11); color: var(--text-muted);
               font-variant-numeric: tabular-nums; }
.viewer-end { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; }

.viewer-stage {
  display: flex; align-items: flex-start; justify-content: center;
  flex: 1 1 auto;
  min-height: 0;          /* lets the stage shrink so the shot can fit it */
  overflow: auto;
  padding: var(--s-24);
  background: var(--bg-canvas);
}
/* 261px was not arbitrary — at the artboard's 1179 × 3402 it made the screen
   754px tall, exactly the stage height on a 900px canvas. It was still a
   number taken off one export, and every upload was poured into it: a phone
   screen and a 2880-wide desktop mock both drew 261px wide on a 1440 window,
   which is not a fit, it is a thumbnail. Fit is measured against the STAGE.

   display: contents, for the same reason .client-shot has it — the note there
   is the long version. A per-cent max-height needs a definite height to
   resolve against and a wrapper whose own height is auto has none. With the
   wrapper out of the layout the image is a direct flex item of the stage,
   whose height IS definite, and the cap resolves. Border and shadow move to
   the image, which is the thing with a shape worth drawing a box around. */
.viewer-shot { display: contents; }

.viewer-shot .viewer-img {
  display: block;
  height: auto;
  max-width: 100%;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-shot);
  box-shadow: var(--shadow-card);
}

/* The stand-in for a screen whose thumbnail has not arrived. It has no
   intrinsic size to fit, so it keeps the old fixed width. */
.viewer-shot .shot-art {
  width: 261px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  box-shadow: var(--shadow-card);
}

/* ZOOM (FR-3, Phase 5)
   Fit is the default and has no class: the image is capped by the stage and
   nothing scrolls. Every step above it is a class, because the value varies
   and a varying value is a step class in this system, never an inline style.

   `zoom`, not `transform: scale()`. A transform is applied after layout, so a
   scaled-up screen spills out of the stage with nothing to scroll — the one
   thing a zoom control exists to allow. `zoom` changes the layout box, so the
   stage gets real scrollbars and the drag-to-pan has something to move.

   margin: auto rather than justify-content, which is what centres a flex item
   while it fits and still lets you reach its top-left corner once it does
   not. Centring with justify-content puts the overflow on BOTH sides and the
   first of them cannot be scrolled to. */
/* 100% is the class-less state: the screen at its DESIGN size — the width and
   height attributes, which the controller sets from the project's base width
   (Screen::shown), not the export's 3x pixels — narrowed only if the window
   is narrower, and scrolling when it is taller. That is what the viewer is
   for: a screen at the size it was drawn, read top to bottom.

   It was a fit-to-height cap, and two things undid it. .viewer had no
   min-height: 0, so as a flex item it grew to its content and the stage's
   per-cent max-height never had a height to resolve against; and
   .screen--fit clips, so the overflow was cut off rather than scrollable.
   Every screen drew at its export width and ran off the bottom.

   Fit is now a step of its own: the whole screen in the window at once. */
.viewer-stage--fit .viewer-img { width: auto; max-height: 100%; }

.viewer-stage.is-zoomed { overflow: auto; cursor: grab; }
.viewer-stage.is-zoomed .viewer-img { max-width: none; max-height: none; margin: auto; }
.viewer-stage.is-panning { cursor: grabbing; }

.viewer-stage--z50  .viewer-img { zoom: .5; }
.viewer-stage--z75  .viewer-img { zoom: .75; }
.viewer-stage--z100 .viewer-img { zoom: 1; }
.viewer-stage--z150 .viewer-img { zoom: 1.5; }
.viewer-stage--z200 .viewer-img { zoom: 2; }
.viewer-stage--z400 .viewer-img { zoom: 4; }
.viewer-nav {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  flex: none;
  align-self: center;
  border: 1px solid var(--border-control);
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.viewer-nav:hover { background: var(--bg-hover); }
.viewer-nav svg { width: 16px; height: 16px; }
.viewer-gap { display: block; width: var(--s-24); flex: none; }

/* The right rail. Facts about the file — never about the design inside it. */
.railpanel {
  display: flex;
  flex-direction: column;
  gap: var(--s-20);
  flex: none;
  width: 280px;
  padding: var(--s-16);
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
}
.rail-group { display: flex; flex-direction: column; gap: var(--s-8); }
.rail-title {
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.deflist { display: flex; flex-direction: column; gap: var(--s-6); }
.def { display: flex; align-items: baseline; gap: var(--s-12); }
.def-k { flex: none; width: 92px; font-size: var(--t-12); color: var(--text-muted); }
.def-v { flex: 1 1 auto; min-width: 0; font-size: var(--t-12); color: var(--text-primary);
         font-variant-numeric: tabular-nums; }

/* ==========================================================================
   VERSION HISTORY (FR-9)
   ========================================================================== */

.versions { display: flex; flex-direction: column; gap: var(--s-8); }
.version {
  display: flex; align-items: center; gap: var(--s-12);
  padding: var(--s-10);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
}
.version.is-current { border-color: var(--accent); background: var(--accent-wash); }
.version-thumb {
  display: block;
  width: 34px; height: 44px;
  flex: none;
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  background: var(--bg-shot);
  overflow: hidden;
}
.version-body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; flex: 1 1 auto; }
.version-no { display: flex; align-items: center; gap: var(--s-6);
              font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-primary); }
.version-meta { font-size: var(--t-11); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.badge-now {
  padding: 1px var(--s-6);
  border-radius: var(--r-4);
  background: var(--accent-fill);
  font-size: var(--t-11);
  font-weight: var(--w-medium);
  color: var(--text-on-fill);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.tablewrap {
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  overflow: hidden;
}
.table { width: 100%; table-layout: fixed; }
.table th {
  padding: var(--s-8) var(--s-12);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: var(--s-8) var(--s-12);
  height: var(--row-h);
  border-bottom: 1px solid var(--border);
  font-size: var(--t-12);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.td-muted { color: var(--text-muted); }
.td-wrap { white-space: normal; line-height: var(--lh-snug); }
.cell-user { display: flex; align-items: center; gap: var(--s-8); min-width: 0; }
.cell-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { display: flex; align-items: center; gap: var(--s-4); justify-content: flex-end; }

/* Column widths. Each is sized against the longest string that really sits
   in it — the name in the comment is that string. */
.col-user     { width: 232px; }  /* "Karthik Subramanian" + 20px avatar + gap */
.col-email    { width: 234px; }  /* "aravind.rajan@smarther.com"              */
.col-role     { width: 116px; }  /* "Super Admin"                             */
.col-status   { width: 104px; }  /* "Disabled" + dot                          */
.col-when     { width: 150px; }  /* "15 Aug 2026, 11:04"                      */
.col-act      { width: 88px; }
.col-actor    { width: 200px; }  /* "Karthik Subramanian" / "Client — Acme…"  */
.col-purge    { width: 132px; }  /* "12 Sep 2026"                             */

.status {
  display: inline-flex; align-items: center; gap: var(--s-6);
  font-size: var(--t-12);
  white-space: nowrap;
}
.status-dot { display: block; width: 6px; height: 6px; border-radius: var(--r-full); flex: none; }
.status--on  { color: var(--text-primary); }
.status--on  .status-dot { background: var(--ok); }
.status--off { color: var(--text-muted); }
.status--off .status-dot { background: var(--text-dim); }

.role {
  display: inline-flex; align-items: center;
  padding: 1px var(--s-6);
  border-radius: var(--r-4);
  font-size: var(--t-11);
  font-weight: var(--w-medium);
  white-space: nowrap;
}
.role--super { background: var(--accent-wash); color: var(--accent-text); }
.role--member { background: var(--bg-hover); color: var(--text-primary); }
.role--viewer { background: var(--bg-hover); color: var(--text-muted); }

/* ==========================================================================
   UPLOAD (FR-16)
   ========================================================================== */

.drop {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-8);
  padding: var(--s-32) var(--s-20);
  border: 1px dashed var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  text-align: center;
}
.drop.is-over { border-color: var(--accent); background: var(--accent-wash); }
.drop svg { width: 26px; height: 26px; color: var(--text-muted); }
.drop-title { font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-primary); }
.drop-text { font-size: var(--t-12); color: var(--text-muted); }

.uphead { display: flex; align-items: center; gap: var(--s-12); }
.uphead-main { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.uphead-title { font-size: var(--t-13); font-weight: var(--w-medium); color: var(--text-primary); }
.uphead-sub { font-size: var(--t-11); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   WORKING — a job that owns the whole page until it finishes
   --------------------------------------------------------------------------
   Creating a project with screens is the one action that spans a page change:
   the project is made, then its images encode and upload, and only then is
   there a board to land on. Reporting that inside the dialog it came from
   read as a glitch — the same popup, apparently stuck, with a line of text
   changing in it.

   So it takes the page. A scrim over everything, one panel, one honest
   sentence about what is happening, and a bar that only moves when a screen
   has actually landed in storage.
   ========================================================================== */

.scrim--working { z-index: 40; }

.working {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-16);
  width: 100%;
  max-width: var(--dialog-w-sm);
  padding: var(--s-24);
  border: 1px solid var(--border-control);
  border-radius: var(--r-10);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-modal);
  text-align: center;
}

/* The system's ONLY animation, and the only place it is warranted: the gap
   between "create" and the first byte landing has no progress to report, and
   a bar sitting at 0% reads as stalled rather than as starting. It stops as
   soon as there is a real number to show. */
@keyframes smp-spin { to { transform: rotate(1turn); } }

.working-mark {
  display: block;
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-fill);
  border-radius: var(--r-full);
  animation: smp-spin 700ms linear infinite;
}

/* Somebody who has asked their system not to animate gets a static ring
   rather than a spinning one; the words below it carry the meaning anyway. */
@media (prefers-reduced-motion: reduce) {
  .working-mark { animation: none; }
}

.working-title { font-size: var(--t-15); font-weight: var(--w-semibold); color: var(--text-primary); }
.working-sub   { font-size: var(--t-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.working-bar   { width: 100%; }

/* When some screens did not make it. The card stays where it is rather than
   handing over to the board's upload screen: the files are still in this
   page's memory, and a browser cannot carry a chosen file across a page
   change — so this is the only place Try again can work without asking
   for them all over again. The spinner goes, because nothing is running. */
.working.is-failed .working-mark { display: none; }
.working-error   { font-size: var(--t-12); color: var(--danger-text); }
.working-actions { display: flex; justify-content: center; gap: var(--s-8); }

.bar-track { display: block; height: 4px; border-radius: var(--r-full); background: var(--bg-hover); overflow: hidden; }
.bar-fill  { display: block; height: 100%; border-radius: var(--r-full); background: var(--accent-fill); }
/* Progress is a value that varies, and a varying value gets a step class —
   never an inline style. Five per cent is fine for a bar four pixels tall:
   the eye reads movement, not arithmetic. --63 is kept because a design
   screen uses it. */
.bar-fill--0 { width: 0%; }
.bar-fill--5 { width: 5%; }
.bar-fill--10 { width: 10%; }
.bar-fill--15 { width: 15%; }
.bar-fill--20 { width: 20%; }
.bar-fill--25 { width: 25%; }
.bar-fill--30 { width: 30%; }
.bar-fill--35 { width: 35%; }
.bar-fill--40 { width: 40%; }
.bar-fill--45 { width: 45%; }
.bar-fill--50 { width: 50%; }
.bar-fill--55 { width: 55%; }
.bar-fill--60 { width: 60%; }
.bar-fill--65 { width: 65%; }
.bar-fill--70 { width: 70%; }
.bar-fill--75 { width: 75%; }
.bar-fill--80 { width: 80%; }
.bar-fill--85 { width: 85%; }
.bar-fill--90 { width: 90%; }
.bar-fill--95 { width: 95%; }
.bar-fill--100 { width: 100%; }
.bar-fill--63 { width: 63%; }

.uplist {
  display: flex; flex-direction: column;
  /* Do not shrink. It is a flex child with overflow:hidden, so shrinking makes
     it silently swallow its own rows — 80 uploads became 10 visible ones and
     the rest could not be reached at all. The dialog body does the scrolling;
     this keeps its full height and its rounded corners. */
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  overflow: hidden;
}
.uprow {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 96px 108px;
  align-items: center;
  gap: var(--s-12);
  padding: var(--s-8) var(--s-12);
  border-bottom: 1px solid var(--border);
}
.uprow:last-child { border-bottom: 0; }
.upicon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.upicon svg { width: 15px; height: 15px; }
.upicon--ok { color: var(--ok); }
.upicon--fail { color: var(--danger-text); }
.upicon--busy { color: var(--accent-text); }
.upicon--wait { color: var(--text-dim); }
.upname { font-size: var(--t-12); color: var(--text-primary);
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upsize { font-size: var(--t-11); color: var(--text-muted); text-align: right;
          font-variant-numeric: tabular-nums; }
.upstate { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-6);
           font-size: var(--t-11); color: var(--text-muted); white-space: nowrap; }
.upstate--fail { color: var(--danger-text); }
.btn-retry {
  display: inline-flex; align-items: center; gap: var(--s-4);
  padding: 1px var(--s-6);
  border: 1px solid var(--border-control);
  border-radius: var(--r-4);
  background: var(--bg-panel);
  font-size: var(--t-11);
  color: var(--text-primary);
}
.btn-retry svg { width: 11px; height: 11px; }

/* ==========================================================================
   TOAST
   --------------------------------------------------------------------------
   Absolute inside .screen. Runtime-injected chrome carries
   data-h2d-ignore="true" so a toast on screen never lands in a Figma paste.
   ========================================================================== */

.toast {
  position: absolute;
  left: 50%; bottom: var(--s-24);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s-12);
  padding: var(--s-10) var(--s-12);
  border: 1px solid var(--border-control);
  border-radius: var(--r-6);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-modal);
}
.toast-text { font-size: var(--t-13); color: var(--text-primary); white-space: nowrap; }
.toast-undo {
  font-size: var(--t-13);
  font-weight: var(--w-medium);
  color: var(--accent-text);
  white-space: nowrap;
}
.toast-count { font-size: var(--t-11); color: var(--text-muted);
               font-variant-numeric: tabular-nums; }

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */

.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-12);
  padding: var(--s-56) var(--s-24);
  text-align: center;
}
.empty-mark {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: var(--r-10);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.empty-mark svg { width: 24px; height: 24px; }
.empty-title { font-size: var(--t-22); font-weight: var(--w-semibold);
               line-height: var(--lh-tight); color: var(--text-primary); }
.empty-text { max-width: 46ch; font-size: var(--t-13); line-height: var(--lh-body);
              color: var(--text-muted); }
.empty-actions { display: flex; align-items: center; gap: var(--s-8); }

/* ==========================================================================
   AUTH
   ========================================================================== */

.auth {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-24);
  flex: 1 1 auto;
  padding: var(--s-24);
  background: var(--bg-canvas);
}
.auth-card {
  display: flex; flex-direction: column; gap: var(--s-20);
  width: 100%;
  max-width: 380px;
  padding: var(--s-32);
  border: 1px solid var(--border);
  border-radius: var(--r-10);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
}
.auth-head { display: flex; flex-direction: column; gap: var(--s-6); }
.auth-title { font-size: var(--t-28); font-weight: var(--w-semibold);
              line-height: var(--lh-tight); color: var(--text-primary); }
.auth-text { font-size: var(--t-13); line-height: var(--lh-body); color: var(--text-muted); }
.auth-brand { display: flex; align-items: center; gap: var(--s-8); justify-content: center; }
.auth-foot { font-size: var(--t-11); color: var(--text-dim); text-align: center; }

/* --------------------------------------------------------------------------
   THE SIGN-IN COVER
   A split card: a gradient panel carrying the product, a form carrying the
   task. Used by 01-login only.

   WHAT THE REFERENCE HAS THAT THIS DOES NOT, AND WHY:

     Sign up link      there is no self-registration. FR-7: the Super Admin
                       creates every account.
     Forgot password   no email reset in v1. Aravind resets it by hand, and
                       the form says so instead of linking to nothing.
     Google / Apple    no SSO in the plan. A social button that does not work
                       is worse than no social button.
     Terms checkbox    staff accounts, already agreed offline.
     Partner logos     this is an internal tool. It has no partners.

   Each of those is a control that promises a capability the product does not
   have, which is the same failure as drawing a spec panel.
   -------------------------------------------------------------------------- */

.auth-split {
  display: flex;
  /* 70% of the artboard, centred. The basis is a percentage rather than a
     pixel width so it holds across the 1024–1680 canvas range instead of
     being right at 1440 and wrong either side of it. */
  flex: 0 1 70%;
  min-width: 0;
  margin: var(--s-24) auto;
  border: 1px solid var(--border);
  border-radius: var(--r-16);
  background: var(--bg-panel);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.auth-cover {
  display: flex;
  flex-direction: column;
  gap: var(--s-32);
  flex: 0 0 46%;
  min-width: 0;
  padding: var(--s-40);
  background: var(--cover-mesh);
  color: var(--text-on-fill);
}
.cover-top { display: flex; align-items: center; gap: var(--s-8); }
.cover-mark {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  flex: none;
  border-radius: var(--r-4);
  background: rgba(255, 255, 255, .16);
  color: var(--text-on-fill);
}
.cover-mark svg { width: 14px; height: 14px; }
.cover-brand { font-size: var(--t-13); font-weight: var(--w-semibold); letter-spacing: .01em; }

.cover-body { display: flex; flex-direction: column; gap: var(--s-10); }
/* The kicker is WHITE, not a tint. Only pure white clears the mesh's
   brightest stop (5.11); one step dimmer measures 4.32 and fails. So the
   hierarchy is carried by size and weight instead of by opacity. */
.cover-kicker { font-size: var(--t-13); font-weight: var(--w-medium); }
.cover-head {
  font-size: var(--t-28);
  font-weight: var(--w-semibold);
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
}

.cover-list { display: flex; flex-direction: column; gap: var(--s-12); margin-top: auto; }
.cover-item { display: flex; align-items: flex-start; gap: var(--s-10); font-size: var(--t-13);
              line-height: var(--lh-snug); }
.cover-tick {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  flex: none;
  margin-top: 1px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .18);
  color: var(--text-on-fill);
}
.cover-tick svg { width: 11px; height: 11px; stroke-width: 2.4; }

.auth-pane {
  display: flex; align-items: center; justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--s-40);
  background: var(--bg-elevated);
}
.auth-panel { display: flex; flex-direction: column; gap: var(--s-24);
              width: 100%; max-width: 336px; }

/* A password field with a reveal. The button sits inside the box, so the box
   reserves room for it — otherwise the caret runs under the icon. */
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 38px; }
.input-eye {
  position: absolute; top: 50%; right: var(--s-4);
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--r-4);
  color: var(--text-muted);
}
.input-eye:hover { background: var(--bg-hover); color: var(--text-primary); }
.input-eye svg { width: 16px; height: 16px; }

/* The rule list on the password screen. Each rule states its own status in a
   word as well as a colour, because colour alone is not a message. */
.rules { display: flex; flex-direction: column; gap: var(--s-6); }
.rule { display: flex; align-items: center; gap: var(--s-8);
        font-size: var(--t-12); color: var(--text-muted); }
.rule svg { width: 13px; height: 13px; flex: none; }
.rule.is-met { color: var(--text-primary); }
.rule.is-met svg { color: var(--ok); }

/* ==========================================================================
   CLIENT SHARE VIEW
   --------------------------------------------------------------------------
   The one place in this product that is not dense and not desktop-only. A
   client sees it once, on whatever device is to hand, and there is no
   navigation because there is nowhere else they may go.
   ========================================================================== */

.sharebar {
  display: flex; align-items: center; gap: var(--s-16);
  flex: none;
  min-height: 60px;
  padding-inline: var(--s-32);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.sharebar-main { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.share-project { font-size: var(--t-15); font-weight: var(--w-semibold); color: var(--text-primary); }
/* A FLEX ROW, not a plain span. .dot-sep is display:block — a block child of
   an inline box starts its own line, so every separator broke the meta line
   and a three-fact strip became four stacked rows. The share board never
   showed it because its meta is plain text with a literal middle dot. */
.share-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  font-size: var(--t-12);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.share-by { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; flex: none; }
/* Off above 480. On a laptop the back chevron sits a few centimetres from the
   title it belongs to and is read as part of it; a second control saying the
   same thing at the far end of a 1440px bar is noise. The phone rule turns
   it on. */
.share-board { display: none; }
.share-by-text { font-size: var(--t-11); color: var(--text-muted); }

.sharepage { display: flex; flex-direction: column; gap: var(--s-32); padding: var(--s-32); }
.share-sect { display: flex; flex-direction: column; gap: var(--s-16); }
.share-sect-head { display: flex; align-items: baseline; gap: var(--s-8); }
.share-sect-name { font-size: var(--t-18); font-weight: var(--w-semibold); color: var(--text-primary); }
.share-sect-count { font-size: var(--t-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.share-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: var(--s-24);
}
.sharefoot {
  display: flex; align-items: center; justify-content: center; gap: var(--s-8);
  padding: var(--s-24) var(--s-32) var(--s-40);
  border-top: 1px solid var(--border);
  font-size: var(--t-12);
  color: var(--text-muted);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.u-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.stack-4  { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.stack-8  { display: flex; flex-direction: column; gap: var(--s-8); min-width: 0; }
.stack-12 { display: flex; flex-direction: column; gap: var(--s-12); min-width: 0; }
.stack-16 { display: flex; flex-direction: column; gap: var(--s-16); min-width: 0; }
.row-8    { display: flex; align-items: center; gap: var(--s-8); min-width: 0; }
.row-12   { display: flex; align-items: center; gap: var(--s-12); min-width: 0; }
.u-spacer { flex: 1 1 auto; }
.u-mono   { font-family: var(--font-mono); font-size: var(--t-12); }
.u-nowrap { white-space: nowrap; }

/* ==========================================================================
   THE CLIENT SCREEN VIEWER
   --------------------------------------------------------------------------
   Screen 11 with everything internal taken out. What a client is NOT shown,
   and why each one is a leak rather than a trim:

     file size, format   how we store it is our business, not theirs
     version number      "v3 of 3" tells a client how many times we redid it
     uploaded by / when  names a person and dates our process
     download            allow_download is OFF on this link (CONTENT.md §8).
                         A download button that 403s is worse than none.
     rename / delete     they have no write access at all

   What stays is what helps them look: the name, where it sits, how far
   through the set they are, and the picture.
   ========================================================================== */

.clientstage {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-16);
  flex: 1 1 auto;
  min-height: 0;          /* lets the stage shrink so the shot can fit it */
  padding: var(--s-24);
  background: var(--bg-canvas);
}
/* The screen shows at its own proportion, not a phone's.
 *
 * `.client-shot` carried `aspect-ratio: 1179 / 3402` with `overflow: hidden`,
 * which is the artboard's iPhone export written down as a law. Every upload
 * was poured into that shape and clipped — a tablet screen, a web page, a wide
 * banner, all cropped to a tall phone, showing a client the top third of
 * somebody's work.
 *
 * display: contents is what makes the fix hold. Capping the image with
 * `max-height: 100%` inside a wrapper whose own height is auto does nothing —
 * a percentage needs a definite height to resolve against, so the image
 * rendered at its full 844px inside a 456px frame and was cropped a second
 * time. With the wrapper out of the layout the image is a direct flex item of
 * the stage, whose height IS definite, and the cap resolves.
 *
 * The border and shadow move to the image itself, which is the thing that has
 * a shape worth drawing a box around.
 */
.client-shot { display: contents; }

.client-shot .viewer-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg-shot);
  box-shadow: var(--shadow-card);
}

/* The client viewer zooms too, and by the same rules — see .viewer-stage.
   Its stage is a different element because it holds the two big nav arrows
   and the internal one does not, but what zooming MEANS is identical, so the
   step classes are shared rather than written twice. */
.clientstage.is-zoomed { overflow: auto; cursor: grab; }
.clientstage.is-zoomed .viewer-img { max-width: none; max-height: none; margin: auto; }
.clientstage.is-panning { cursor: grabbing; }

.clientstage--z50  .viewer-img { zoom: .5; }
.clientstage--z75  .viewer-img { zoom: .75; }
.clientstage--z100 .viewer-img { zoom: 1; }
.clientstage--z150 .viewer-img { zoom: 1.5; }
.clientstage--z200 .viewer-img { zoom: 2; }
.clientstage--z400 .viewer-img { zoom: 4; }

/* No image yet: the artwork stand-in has no proportion of its own, so it is
   the one thing that still borrows the artboard's. */
.client-shot .shot-art {
  height: 100%;
  aspect-ratio: 1179 / 3402;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  box-shadow: var(--shadow-card);
}

.client-nav {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  flex: none;
  border: 1px solid var(--border-control);
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.client-nav:hover { background: var(--bg-hover); }
.client-nav svg { width: 18px; height: 18px; }
.client-nav[aria-disabled="true"] { color: var(--text-dim); border-color: var(--border);
                                    background: var(--bg-canvas); }

.client-count { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   THE CLIENT SHARE VIEW, ON A PHONE AND A TABLET
   --------------------------------------------------------------------------
   Everything else in this product is a desktop tool and stays one. This is the
   screen a client opens from a link, on whatever they happen to be holding,
   and it is the only place these rules apply.

   Measured at 360 / 390 / 412 / 600 / 768 / 834 / 1024 / 1280 / 1440.
   ========================================================================== */

/* The share card's artwork scales WITH the card instead of holding the board's
   fixed 268px. On the board a fixed height is right — every card lines up in a
   grid a designer scans all day. Here the card width changes at every device,
   and a fixed height made a 270px card carry 208px of art: wider than it is
   tall, which reads as a banner rather than a screen. An aspect ratio keeps
   the proportion honest at every width and removes two magic numbers.

   9:16, because what is inside the frame is a phone screen. Both selectors
   carry it: .shot-art is the stand-in a screen with no thumbnail yet falls
   back to, .shot-img is the real upload, and a card must be the same shape
   whichever one it is holding — two ratios in one grid reads as a broken
   image, not as a choice. object-position: top still governs the crop. */
.share-shots .shot-art,
.share-shots .shot-img { height: auto; aspect-ratio: 9 / 16; }

/* A web project's share board: 16:9 cards, and columns wide enough that a
   16:9 frame is worth looking at. */
.share-shots--web { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.share-shots--web .shot-art,
.share-shots--web .shot-img { aspect-ratio: 16 / 9; }

/* --- Tablet, and any laptop narrower than the artboard --------------------- */
@media (max-width: 1024px) {
  .sharebar  { padding-inline: var(--s-24); }
  .sharepage { gap: var(--s-24); padding: var(--s-24); }
  .share-shots {
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: var(--s-16);
  }
  .share-shots--web { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .sharefoot { padding: var(--s-24) var(--s-24) var(--s-32); }
}

/* --- Phone ----------------------------------------------------------------
   TWO COLUMNS, FIXED. auto-fill drops to a single column below about 420px,
   and one column of screens is a scroll rather than a contact sheet — the
   client loses the ability to take a flow in at a glance, which is the whole
   reason for sending a board instead of a folder.

   The breakpoint is 480, not 620. At 600 the fixed pair gave 270px cards with
   a wide gutter either side; the auto-fill rule above puts three there, which
   is what that width is for. */
@media (max-width: 480px) {
  .sharebar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--s-4) var(--s-12);
    min-height: 0;
    padding: var(--s-12) var(--s-16);
  }
  .sharebar .brand-mark { margin-top: var(--s-2); }
  .share-by { margin-left: 0; width: 100%; padding-left: 30px; }

  .sharepage { gap: var(--s-24); padding: var(--s-16) var(--s-16) var(--s-24); }
  .share-sect { gap: var(--s-12); }
  .share-sect-name { font-size: var(--t-15); }

  .share-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-12); }
  /* One column: two 16:9 cards side by side on a phone are 84px tall. */
  .share-shots--web { grid-template-columns: 1fr; }

  .sharefoot {
    flex-direction: column;
    gap: var(--s-4);
    padding: var(--s-20) var(--s-16) var(--s-32);
    text-align: center;
  }
  .sharefoot .dot-sep { display: none; }

  /* The zoom stepper goes. A phone already zooms — pinch and double-tap are
     built into the browser and act on the picture itself, where the fingers
     already are. Keeping the buttons offers a second, worse way to do the
     same thing, and on a wrapped share bar they cost a whole line directly
     above the screen the client opened the link to look at.

     Scoped to .sharebar, which is the client viewer only. The topbar zoom on
     the board and the internal viewer is a different control on a different
     surface and is left alone. */
  .sharebar .zoom { display: none; }

  /* margin-left: auto, so it takes the far right of the first line. .share-by
     drops to its own line below (width: 100%), which is what leaves the top
     right free for it. */
  /* 22px of glyph, between the sheet's 16 and the 32 that overpowered the
     bar. It keeps the standard 32px .btn-icon box, so it still lines up with
     the chevron at the other end of the row and the box still takes the tap;
     22 in 32 leaves 5px of air, which is enough that the squares are not
     touching their own edges.

     Stroke 1.0 against the sheet-wide 1.6, drawing .92px. Four squares put
     twice as much outline on screen as a single chevron, so at equal weight
     the grid reads as the heavier mark; a shade under is what makes the two
     look like one set. */
  .share-board { display: inline-flex; margin-left: auto; }
  .share-board svg { width: 22px; height: 22px; stroke-width: 1; }

  /* On a phone the two arrows would eat 112px of a 390px screen, so the
     picture gets the width and they shrink to the edges. */
  .clientstage { gap: var(--s-6); padding: var(--s-12); }
  .client-nav { width: 32px; height: 32px; }
  .client-nav svg { width: 15px; height: 15px; }
}

/* --- Small phone ---------------------------------------------------------- */
@media (max-width: 380px) {
  .sharepage { padding-inline: var(--s-12); }
  .sharebar  { padding-inline: var(--s-12); }
}
