/* ============================================================================
   Design system — warm-paper "editorial" aesthetic.
   Light theme only. Solid colors. Sharp corners (no rounded). No cursive.
   Three fonts: Bricolage Grotesque (headings), Instrument Sans (body),
   IBM Plex Mono (small uppercase labels/eyebrows/tags).
   WCAG AA contrast. Consistent 4/8/12/16/24 spacing rhythm.
   ============================================================================ */

:root {
  /* Surfaces — warm paper */
  --surface: #fffdf9;         /* cards sit slightly brighter than the page */
  --surface-muted: #f3f1ea;   /* sunken panels */
  --surface-sunken: #eceae1;
  --paper: #faf9f5;           /* app background */

  /* Ink / text */
  --ink: #1c1b19;
  --ink-muted: #6b6862;
  --ink-subtle: #9c988e;

  /* Amber accent (used for small marks, pills, highlights) */
  --brand: #e0a63a;
  --brand-hover: #c98f22;
  --brand-ink: #1c1b19;        /* text that sits ON amber (dark for contrast) */
  --brand-soft: #f7ecd4;       /* soft amber wash */
  --brand-line: #e6c983;

  /* Primary action = solid black (matches the reference design) */
  --accent: #1c1b19;
  --accent-hover: #000000;
  --accent-ink: #faf9f5;       /* text on black */

  /* A muted blue used only for the small "what gets accessed" link */
  --link-blue: #3a5ba0;

  /* Semantic (solid, warm-leaning) */
  --success: #3f7d4f;
  --success-soft: #e6efe4;
  --danger: #b23b2e;
  --danger-soft: #f6e4e0;
  --warning: #b7791f;
  --warning-soft: #f7ecd4;

  /* Lines — hairline dividers */
  --line: #e4e1d6;
  --line-strong: #d3cfc1;

  /* Spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  /* Radius — SHARP everywhere (kept as vars so intent is explicit) */
  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;

  /* Elevation — subtle, warm shadow */
  --shadow-sm: 0 1px 0 rgba(28, 27, 25, 0.04);
  --shadow-md: 0 2px 10px rgba(28, 27, 25, 0.06);
  --shadow-lg: 0 16px 40px rgba(28, 27, 25, 0.18);

  /* Fonts */
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Instrument Sans', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must always win.
 *
 * The browser's own rule for it is `[hidden] { display: none }`, and ANY rule
 * we write here outranks the browser's — so a plain `.signin-overlay { display:
 * flex }` silently made `hidden` do nothing, and the sign-in screen stayed
 * painted on top of the app after signing in. This reset closes that hole for
 * every element, not just the one that broke. Covered by
 * test/hiddenAttribute.test.js. */
[hidden] {
  display: none !important;
}

/* Before the server has said whether this person is signed in, show neither the
   app nor the sign-in screen. A glimpse of the dashboard by somebody who is not
   signed in reads as being let in and then turned back out, and the sign-in
   wall should never give that impression. Released by app.js the moment the
   answer arrives — see test/noFlash.test.js. */
html[data-auth="checking"] .layout,
html[data-auth="checking"] .signin-overlay {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings use the display face. */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Mono eyebrow label — the small uppercase tag above headings. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 var(--s3);
}

/* ---- Sidebar layout ---- */
.layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static !important;
    height: auto !important;
  }
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: var(--s5) var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
.sidebar > :not(.nav) { flex-shrink: 0; }

/* Brand: solid black square mark with an amber square inside. Clickable to edit. */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s1);
  margin: calc(var(--s1) * -1);
  border: none;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: calc(100% + var(--s2));
  transition: background 0.12s;
}
.sidebar-brand:hover {
  background: var(--surface-muted);
}
.brand-logo {
  width: 30px;
  height: 30px;
  object-fit: cover;
  display: block;
}
.brand-mark {
  width: 30px;
  height: 30px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-square {
  width: 11px;
  height: 11px;
  background: var(--brand);
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

/* Sidebar search box */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: var(--s2);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  padding: 8px var(--s3);
}
.sidebar-search .search-ico {
  color: var(--ink-subtle);
  font-size: 15px;
  line-height: 1;
}
.nav-search-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
  outline: none;
}
.nav-search-input::placeholder {
  color: var(--ink-subtle);
}
.search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-subtle);
  border: 1px solid var(--line-strong);
  padding: 1px 5px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.nav {
  flex: 1 1 auto;
  min-height: 80px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 var(--s2);
  padding: 0 var(--s3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 9px var(--s3);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: var(--surface-muted);
  color: var(--ink);
}
.nav-item.active {
  background: var(--ink);
  color: var(--accent-ink);
  font-weight: 600;
}
.nav-ico {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-label {
  flex: 1;
  min-width: 0;
}
/* amber square bullet on the right of the active item */
/* Current-section marker. Drawn by the active item itself so it always sits on
   the section you are actually looking at — it used to be a hardcoded span
   inside Dashboard, which meant it never moved. */
.nav-item.active::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--brand);
  flex-shrink: 0;
  margin-left: auto;
}
/* amber "Due" pill (e.g. on Invoicing) */
.nav-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-ink);
  background: var(--brand);
  padding: 1px 6px;
  flex-shrink: 0;
}

/* User card at the bottom */
.sidebar-foot {
  margin-top: auto;
}
.user-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--surface-sunken);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.content {
  min-width: 0;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
}
@media (max-width: 980px) {
  .container {
    grid-template-columns: 1fr;
  }
}

/* ---- Fieldset (branding block) ---- */
.fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s4);
  margin: 0 0 var(--s5);
}
.fieldset legend {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  padding: 0 var(--s2);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}
@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s2);
}
.logo-preview img {
  max-height: 48px;
  max-width: 160px;
  border: 1px solid var(--line);
  padding: 4px;
  background: #fff;
}
.btn-link {
  background: none;
  border: none;
  color: var(--danger);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
}
.card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.card-header p {
  margin: var(--s1) 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.card-body {
  padding: var(--s5);
}

.full-width {
  grid-column: 1 / -1;
}

/* ---- Forms ---- */
.field {
  margin-bottom: var(--s4);
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--s2);
  color: var(--ink);
}
.input,
.select,
.textarea {
  width: 100%;
  padding: 10px var(--s3);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea {
  resize: vertical;
  min-height: 72px;
}
.input-prefix {
  position: relative;
}
.input-prefix span {
  position: absolute;
  left: var(--s3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 14px;
}
.input-prefix .input {
  padding-left: 28px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px var(--s4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand-hover);
}
.btn-primary:hover {
  background: var(--brand-hover);
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  background: var(--surface-muted);
}
/* Solid black primary action (matches the reference design) */
.btn-dark {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-dark:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-dark:focus-visible {
  box-shadow: 0 0 0 3px var(--brand-soft);
}
/* Underlined amber text button ("Skip for now") */
.btn-underline {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.btn-underline:hover {
  color: var(--brand-hover);
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Contact list ---- */
.search-wrap {
  margin-bottom: var(--s4);
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-height: 380px;
  overflow-y: auto;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.contact-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.contact-item.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.avatar {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.contact-meta {
  min-width: 0;
}
.contact-meta .name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-meta .sub {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- States ---- */
.state {
  text-align: center;
  padding: var(--s6) var(--s4);
  color: var(--ink-muted);
}
.state .icon {
  font-size: 28px;
  margin-bottom: var(--s2);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface-sunken);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
  margin: 0 auto var(--s2);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Selected client summary ---- */
.selected-client {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px dashed var(--line-strong);
  background: var(--surface-muted);
  margin-bottom: var(--s4);
}
.selected-client.empty {
  color: var(--ink-subtle);
  justify-content: center;
  font-size: 13px;
}

/* ---- Modal (pre-flight confirmation) ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 25, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  z-index: 50;
}
.modal {
  position: relative;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-strong);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
}
.modal-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.modal-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 26px; cursor: pointer; }
.modal .modal-header { padding-right: 60px; }
.modal .modal-actions { position: sticky; bottom: 0; background: var(--surface); }
.modal.contact-modal { max-width: 680px; }
.contact-section { padding: 12px 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.contact-section legend { font-weight: 600; padding-top: 12px; }
.contact-value-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) 36px; gap: 8px; margin: 8px 0; }
.contact-value-row button { border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.contact-page-info { color: var(--ink-muted); font-size: 12px; padding: 12px 0; }
@media (max-width: 760px) { .sidebar .nav { max-height: 60vh; flex: 0 1 auto; } }
.modal-header {
  padding: var(--s5) var(--s5) var(--s3);
}
.modal-header h3 {
  margin: 0;
  font-size: 20px;
}
.modal-warning {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
  background: var(--warning-soft);
  color: var(--warning);
  padding: var(--s3);
  margin: 0 var(--s5) var(--s4);
  font-size: 13px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--line);
}
.summary-row .label {
  color: var(--ink-muted);
  font-size: 13px;
}
.summary-row .value {
  font-weight: 600;
  text-align: right;
}
.summary-row.total .value {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
}
.modal-actions {
  display: flex;
  gap: var(--s3);
  padding: var(--s5);
  border-top: 1px solid var(--line);
}
.modal-actions .btn {
  flex: 1;
}

/* ---- Toast ---- */
.toast-wrap {
  position: fixed;
  bottom: var(--s5);
  right: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  z-index: 60;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow-md);
  padding: var(--s3) var(--s4);
  max-width: 360px;
  font-size: 14px;
  animation: slidein 0.2s ease;
}
.toast.success {
  border-left-color: var(--success);
}
.toast.error {
  border-left-color: var(--danger);
}
.toast .title {
  font-weight: 700;
  margin-bottom: 2px;
}
.toast a {
  color: var(--brand-hover);
}
@keyframes slidein {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ---- Invoice log table ---- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.table td {
  padding: var(--s3);
  border-bottom: 1px solid var(--line);
}
.badge {
  display: inline-block;
  padding: 2px var(--s2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--success-soft);
  color: var(--success);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ============================================================================
   Multi-view shell: views, board, deal cards, forms, extras.
   ============================================================================ */

/* Views */
.view {
  display: none;
}
.view.active {
  display: grid;
}
.container-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s6);
}
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
}
.view-head h2 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
  font-weight: 800;
}
.view-head .subhead {
  margin: var(--s3) 0 0;
  color: var(--ink-muted);
  font-size: 15px;
  max-width: 52ch;
}
.view-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
}
.eyebrow-dash {
  color: var(--ink-subtle);
  margin-right: 4px;
}
/* A page header that sits above a 2-column card grid spans the full width. */
.container > .view-head.full-width {
  grid-column: 1 / -1;
}
/* Secondary header (e.g. the task board under a project) — smaller heading. */
.view-head-sub {
  margin-top: var(--s6);
}
.view-head-sub h2 {
  font-size: 26px;
  font-weight: 700;
}
/* legacy: any bare <p> in a view-head keeps muted styling */
.view-head p:not(.eyebrow):not(.subhead) {
  margin: var(--s1) 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Kanban board */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: var(--s4);
  overflow-x: auto;
  padding-bottom: var(--s3);
}
.board-col {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.board-col-meta {
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-muted);
}
.board-col-body {
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  flex: 1;
  transition: background 0.12s;
}
.board-col-body.drop-active {
  background: var(--brand-soft);
}
.board-empty {
  color: var(--ink-subtle);
  font-size: 13px;
  text-align: center;
  padding: var(--s5) var(--s2);
  border: 1px dashed var(--line-strong);
}
.deal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s3);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.deal-card:active {
  cursor: grabbing;
}
.deal-card.dragging {
  opacity: 0.5;
}
.deal-title {
  font-weight: 600;
  font-size: 14px;
}
.deal-client {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.deal-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-top: var(--s2);
}

/* Checkbox row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 14px;
  margin-bottom: var(--s4);
  cursor: pointer;
}
.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

/* Paid badge variant */
.badge-paid {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

/* Forms view */
.form-preview {
  max-width: 520px;
  margin: 0 auto;
}
.form-hero {
  text-align: center;
  margin-bottom: var(--s5);
}
.form-hero h3 {
  margin: 0 0 var(--s1);
  font-size: 24px;
}
.form-hero p {
  margin: 0;
  color: var(--ink-muted);
}
.progress {
  height: 6px;
  background: var(--surface-sunken);
  overflow: hidden;
  margin-bottom: var(--s5);
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 0.2s;
}

/* ---- Automations / presets ---- */
.preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
}
.preset-row:last-child {
  border-bottom: none;
}

/* ---- Domain connect ---- */
.dns-box {
  margin-top: var(--s3);
  border: 1px solid var(--line);
  padding: var(--s3);
  background: var(--surface-muted);
}
.dns-step {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: var(--s2);
}
.dns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: var(--s2);
}
.dns-table td {
  padding: 4px var(--s2);
  border-bottom: 1px solid var(--line);
}
.dns-table td:first-child {
  color: var(--ink-muted);
  width: 90px;
}
.dns-table code {
  font-family: var(--font-mono);
  background: var(--surface-sunken);
  padding: 2px 6px;
}
.status-line {
  font-size: 13px;
  color: var(--ink);
  margin-top: var(--s2);
}

/* ---- Plain-language helpers ---- */
.help {
  margin: var(--s2) 0 0;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.addr-line {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.addr-line .addr-prefix,
.addr-line .addr-suffix {
  padding: 10px var(--s3);
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.addr-line .input {
  border: none;
  border-radius: 0;
}
.addr-line .input:focus {
  box-shadow: none;
}

/* ---- NDA preview ---- */
.nda-preview {
  max-height: 620px;
  overflow-y: auto;
}
.nda-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s5);
  font-size: 13px;
  line-height: 1.55;
}
.nda-doc h3 {
  margin: 0 0 var(--s1);
  font-size: 18px;
  text-align: center;
}
.nda-meta {
  text-align: center;
  color: var(--ink-muted);
  margin: 0 0 var(--s4);
  font-size: 12px;
}
.nda-section {
  margin-bottom: var(--s3);
}
.nda-section strong {
  color: var(--ink);
}
.nda-section p {
  margin: var(--s1) 0 0;
}
.nda-sigs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-top: var(--s5);
}
.sig-line {
  border-bottom: 1px solid var(--ink);
  height: 28px;
  margin-bottom: var(--s1);
}
.nda-disclaimer {
  margin-top: var(--s4);
  font-style: italic;
  color: var(--ink-subtle);
  font-size: 11px;
}

/* ---- Dashboard ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s5);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s4);
  box-shadow: var(--shadow-sm);
}
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
/* DASH-SEC-20260910: dashboard tile drilldowns. */
.stat-card-button { text-align: left; color: inherit; font: inherit; cursor: pointer; }
.stat-card-button:hover { border-color: var(--ink-muted); background: var(--surface-sunken); }
.stat-card-button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.stat-detail-hint { display: block; margin-top: 12px; font-size: 12px; color: var(--ink-muted); }
.modal.dashboard-detail-modal { max-width: 1050px; width: min(1050px, calc(100vw - 32px)); }
.dashboard-detail-body { padding: 0 24px 20px; }
.dashboard-detail-table { overflow-x: auto; margin-top: 14px; }
.dashboard-detail-table td { overflow-wrap: anywhere; min-width: 100px; }
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: var(--s1);
}
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 860px) { .dash-cols { grid-template-columns: 1fr; } }
.mini-bars { display: flex; flex-direction: column; gap: var(--s3); }
.mini-bar-row { display: flex; align-items: center; gap: var(--s3); font-size: 13px; }
.mini-bar-label { width: 90px; color: var(--ink-muted); }
.mini-bar-track { flex: 1; height: 8px; background: var(--surface-sunken); overflow: hidden; }
.mini-bar-fill { display: block; height: 100%; background: var(--brand); }
.mini-bar-num { width: 28px; text-align: right; font-weight: 600; }

/* ---- Projects ---- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.project-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  padding: var(--s4); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, background 0.12s;
}
.project-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.project-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.project-client { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.project-open { font-size: 12px; color: var(--brand-hover); font-weight: 600; margin-top: var(--s3); }

/* ---- Calendar ---- */
.event-list { display: flex; flex-direction: column; gap: var(--s2); }
.event-row { display: flex; gap: var(--s4); padding: var(--s3); border: 1px solid var(--line); }
.event-date { width: 96px; flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; }
.event-title { font-weight: 600; }
.event-notes { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

/* ---- "Not connected yet" editorial panel (dashboard empty state) ---- */
.connect-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.connect-panel-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}
.connect-flag {
  width: 9px;
  height: 9px;
  background: var(--brand);
  flex-shrink: 0;
}
.connect-flag-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.connect-panel-body {
  padding: var(--s6) var(--s5);
}
.connect-lead {
  display: flex;
  gap: var(--s4);
  align-items: flex-start;
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}
.connect-ico {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  filter: grayscale(1);
}
.connect-title {
  margin: 0 0 var(--s2);
  font-size: 24px;
  font-weight: 800;
}
.connect-msg {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  max-width: 60ch;
}
.connect-sync {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  margin: var(--s5) 0;
}
@media (max-width: 640px) {
  .connect-sync { grid-template-columns: 1fr; }
}
.sync-card {
  padding: var(--s4);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.sync-card:last-child { border-right: none; }
@media (max-width: 640px) {
  .sync-card { border-right: none; border-bottom: 1px solid var(--line); }
  .sync-card:last-child { border-bottom: none; }
}
.sync-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.sync-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.connect-actions {
  display: flex;
  align-items: center;
  gap: var(--s4);
}
.connect-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--line);
}
.connect-foot-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.connect-foot-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--link-blue);
}
.connect-foot-link:hover { text-decoration: underline; }

/* ---- Payments settings ---- */
.pay-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.pay-status-line {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.pay-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  flex-shrink: 0;
}
.pay-badge-on {
  background: var(--success-soft);
  color: var(--success);
}
.pay-status-title { font-weight: 700; font-size: 15px; }
.pay-status-sub { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

.pay-provider-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-bottom: var(--s2);
}
@media (max-width: 640px) { .pay-provider-pick { grid-template-columns: 1fr; } }
.pay-provider {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: var(--s4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  transition: border-color 0.12s, background 0.12s;
}
.pay-provider:hover { border-color: var(--brand); background: var(--brand-soft); }
.pay-provider-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.pay-provider-desc { font-size: 13px; color: var(--ink-muted); }
.pay-form { margin-top: var(--s2); }

/* ---- Dashboard date range ---- */
.dash-range, .dash-date {
  width: auto;
  padding: 8px var(--s3);
  font-size: 13px;
}
.dash-range-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 var(--s4);
}

/* ---- Contact row with edit affordance ---- */
.contact-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line);
  transition: border-color 0.12s, background 0.12s;
}
.contact-row.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.contact-row .contact-item {
  border: none;
  flex: 1;
}
.contact-row:hover {
  border-color: var(--brand);
}
.contact-edit {
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  padding: 0 var(--s3);
  cursor: pointer;
  flex-shrink: 0;
}
.contact-edit:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

/* ---- Sign-in overlay ---- */
.signin-overlay {
  position: fixed;
  inset: 0;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--s4);
}
.signin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: var(--s7) var(--s6);
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.signin-mark {
  width: 40px;
  height: 40px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--s4);
}
.signin-mark .brand-square { width: 15px; height: 15px; background: var(--brand); }
.signin-title { margin: 0 0 var(--s2); font-size: 30px; font-weight: 800; }
.signin-sub { margin: 0 0 var(--s5); color: var(--ink-muted); font-size: 14px; }
.signin-google { display: flex; justify-content: center; }
.signin-google:not(:empty) { margin-bottom: var(--s4); }
.signin-pw { text-align: left; }
.signin-pw .field { margin-bottom: var(--s3); }
.signin-hint { margin: var(--s4) 0 0; color: var(--ink-subtle); font-size: 12px; }
.signin-note { margin: var(--s3) 0 0; color: var(--danger); font-size: 13px; min-height: 18px; }

/* Sign-out button in the user card */
.user-signout {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 15px;
  cursor: pointer;
  padding: var(--s1) var(--s2);
  flex-shrink: 0;
}
.user-signout:hover { color: var(--ink); background: var(--surface-muted); }

/* ---- "Show me around" help button ---- */
.nav-help {
  display: flex;
  align-items: center;
  gap: var(--s2);
  border: 1px dashed var(--line-strong);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px var(--s3);
  cursor: pointer;
}
.nav-help:hover { background: var(--surface-muted); color: var(--ink); }

/* ---- Onboarding tour ---- */
.tour-backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 27, 25, 0.55);
  z-index: 200;
}
.tour-highlight {
  position: fixed;
  z-index: 201;
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 4px rgba(224, 166, 58, 0.35);
  pointer-events: none;
  transition: all 0.2s ease;
}
.tour-card {
  position: fixed;
  z-index: 202;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  padding: var(--s4);
}
.tour-step {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 var(--s2);
}
.tour-title { margin: 0 0 var(--s1); font-size: 17px; }
.tour-body { margin: 0 0 var(--s4); font-size: 13px; color: var(--ink-muted); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.tour-off { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tour-buttons { display: flex; gap: var(--s2); }
.tour-buttons .btn { padding: 6px var(--s3); font-size: 13px; }

/* ---- Legal & docs ---- */
.legal-tabs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.legal-tab {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 6px var(--s3);
  cursor: pointer;
}
.legal-tab.active { background: var(--ink); color: var(--accent-ink); border-color: var(--ink); }
.legal-doc { max-width: 720px; font-size: 14px; line-height: 1.6; }
.legal-doc h1 { font-size: 28px; margin: 0 0 var(--s4); }
.legal-doc h2 { font-size: 20px; margin: var(--s5) 0 var(--s2); }
.legal-doc h3 { font-size: 16px; margin: var(--s4) 0 var(--s2); }
.legal-doc h4 { font-size: 14px; margin: var(--s3) 0 var(--s1); }
.legal-doc p { margin: 0 0 var(--s3); color: var(--ink); }
.legal-doc ul { margin: 0 0 var(--s3) var(--s4); }
.legal-doc li { margin-bottom: var(--s1); }
.legal-doc blockquote {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  margin: 0 0 var(--s3);
  padding: var(--s3);
  font-size: 13px;
}
.legal-doc hr { border: none; border-top: 1px solid var(--line); margin: var(--s4) 0; }
.legal-doc code { font-family: var(--font-mono); background: var(--surface-sunken); padding: 1px 5px; font-size: 12px; }

.pay-locked {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  border: 1px solid var(--line);
  padding: 4px 8px;
}

/* Invite: what-can-they-see checkboxes */
.invite-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  border: 1px solid var(--line);
  padding: var(--s3);
  max-height: 220px;
  overflow-y: auto;
}
.invite-sections .checkbox-row { margin-bottom: 0; font-size: 13px; }

/* ---- Conversations nav dot (unread indicator) ---- */
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  margin-left: auto;
  flex-shrink: 0;
}

/* ---- Conversations view ---- */
.conv-privacy {
  margin: 0 0 var(--s4);
  padding: var(--s3);
  border: 1px dashed var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink-muted);
}
.conv-list { display: flex; flex-direction: column; gap: var(--s2); }
.conv-row {
  display: flex;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  background: var(--surface);
}
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.conv-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.conv-time { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-subtle); }
.conv-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.conv-hint { font-size: 13px; color: var(--ink); margin-top: var(--s1); }
.conv-review {
  display: inline-block;
  margin-top: var(--s2);
  font-size: 13px;
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.conv-chip { border: 1px solid var(--line-strong); }
.conv-in { background: var(--brand-soft); border-color: var(--brand-line); }
.conv-out { background: var(--surface-muted); }

/* ---- Settings view ---- */
.settings-ws-name { margin: 0 0 var(--s3); font-size: 16px; font-weight: 600; color: var(--ink); }

/* ---- Glossary view ---- */
.glossary-group { margin-bottom: var(--s4); }
.glossary { margin: 0; display: flex; flex-direction: column; gap: var(--s4); }
.glossary-item { border-left: 3px solid var(--brand); padding-left: var(--s3); }
.glossary-item dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 var(--s1);
}
.glossary-item dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ---- Sites HTML editor + live preview ---- */
.site-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-bottom: var(--s4);
}
@media (max-width: 900px) { .site-editor { grid-template-columns: 1fr; } }
.site-editor-pane { display: flex; flex-direction: column; }
.site-editor-pane > label { font-size: 13px; font-weight: 600; margin-bottom: var(--s2); }
.textarea.code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 340px;
  white-space: pre;
  overflow: auto;
}
.site-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; margin-bottom: var(--s2);
}
.site-preview-flag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--warning);
  background: var(--warning-soft); padding: 2px 8px;
}
.site-preview-frame {
  width: 100%;
  min-height: 340px;
  border: 1px solid var(--line-strong);
  background: #fff;
}

/* ---- Sites: fullscreen preview ----
   The preview must be able to leave its box entirely: a fixed overlay above
   every other layer (tour cards sit at 202), with the frame free to take the
   whole viewport or a chosen device width. */
.site-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: var(--surface-sunken);
}
.site-fullscreen[hidden] { display: none; }
.site-fullscreen-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: 1px solid var(--accent);
}
.site-fullscreen-bar .fs-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-fullscreen-bar .fs-tools { display: flex; align-items: center; gap: var(--s2); }
.fs-device {
  background: transparent;
  border: 1px solid rgba(250, 249, 245, 0.28);
  color: var(--accent-ink);
  font: inherit; font-size: 12px;
  padding: 5px 11px;
  cursor: pointer;
}
.fs-device:hover { background: rgba(250, 249, 245, 0.12); }
.fs-device[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600;
}
.site-fullscreen-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 0;
  overflow: auto;
}
.site-fullscreen-stage[data-device="desktop"] { padding: 0; }
.site-fullscreen-stage[data-device="tablet"],
.site-fullscreen-stage[data-device="phone"] { padding: var(--s5) var(--s4); }
.site-fullscreen-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
}
.site-fullscreen-stage[data-device="tablet"] .site-fullscreen-frame {
  width: 820px; max-width: 100%; height: 100%;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.site-fullscreen-stage[data-device="phone"] .site-fullscreen-frame {
  width: 414px; max-width: 100%; height: 100%;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
body.fs-open { overflow: hidden; }

/* ---- Sites: deploy a whole site folder ---- */
.deploy-drop {
  border: 2px dashed var(--line-strong);
  background: var(--surface-muted);
  padding: var(--s6) var(--s4);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.deploy-drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.deploy-drop .drop-icon { font-size: 28px; line-height: 1; display: block; margin-bottom: var(--s3); }
.deploy-drop .drop-title { font-size: 15px; font-weight: 600; margin: 0 0 var(--s1); }
.deploy-drop .drop-sub { font-size: 13px; color: var(--ink-muted); margin: 0 0 var(--s4); }
.deploy-drop .drop-actions { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }
.deploy-drop input[type="file"] { display: none; }

.deploy-report { margin-top: var(--s4); border: 1px solid var(--line); }
.deploy-report-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); background: var(--surface-muted);
  font-size: 13px; font-weight: 600;
}
.deploy-report ul { list-style: none; margin: 0; padding: var(--s3) var(--s4); font-size: 13px; }
.deploy-report li { display: flex; gap: var(--s3); padding: 3px 0; color: var(--ink-muted); }
.deploy-report li code { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.deploy-badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px;
}
.deploy-badge.ok { color: var(--success); background: var(--success-soft); }
.deploy-badge.warn { color: var(--warning); background: var(--warning-soft); }

.deploy-progress {
  height: 3px; background: var(--surface-sunken); overflow: hidden; margin-top: var(--s3);
}
.deploy-progress span {
  display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.2s ease;
}
.version-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.version-live {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--success); background: var(--success-soft); padding: 2px 8px;
}

/* ---- Payments: an integration that is wired at deploy, not in the UI ---- */
.pay-integration {
  display: flex;
  align-items: center;
  gap: var(--s3);
  background: var(--surface-muted);
  padding: var(--s4);
  margin-bottom: var(--s4);
}
.pay-provider-state { align-self: flex-start; margin-top: var(--s2); }

/* ---- Company switcher (only rendered when more than one company) ---- */
.company-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 12px;
}
.company-switch-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.company-switch .select {
  width: 100%;
}

/* ---- Load more, under a paged list ---- */
.load-more-note {
  margin: 12px 0 8px;
  color: var(--ink-muted);
}
.load-more-btn {
  width: 100%;
}
