/* SignEnvoy brand design system — see docs/frontend-design.md */

@font-face {
  font-family: "Great Vibes";
  src: url("/static/fonts/GreatVibes-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink:       #081833;  /* sampled from wordmark (source of truth) */
  --ink-raise: #1B2A41;
  --ink-soft:  #3D4F66;
  --paper:     #FAF7F0;
  --surface:   #FFFFFF;
  --amber:     #D9A441;
  --line:      #E4DED2;
  --success:   #2E6B4F;
  --danger:    #A63D2F;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(27, 42, 65, 0.08);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --control-line: #87909B;
  --space-page: clamp(1rem, 3vw, 2rem);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark { height: 28px; width: auto; }
.brand-wordmark { height: 26px; width: auto; }

main { max-width: 1120px; margin: var(--space-page) auto; padding: 0 var(--space-page); }
main > *, form, fieldset { min-width: 0; }
body { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }

.site-footer {
  max-width: 1120px;
  margin: 2rem auto 1.5rem;
  padding: 0.75rem var(--space-page) 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--ink-soft); font-size: 0.85rem; }

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.settings-nav a { color: var(--ink-soft); font-size: 0.9rem; padding: 0.6rem 0.25rem; min-height: 44px; text-decoration: none; }
.settings-nav a.current { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px var(--ink); }
.settings-nav a:hover { background: var(--surface); }
.settings-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.settings-groups .card { margin: 0; }
.settings-links a { display: flex; align-items: center; min-height: 44px; text-underline-offset: 0.2em; }
.settings-groups .card h2 { margin-top: 0; font-size: 1.05rem; }
.settings-links { list-style: none; margin: 0; padding: 0; }
.settings-links li { margin: 0.25rem 0; }

.danger-form { border-top: 1px solid var(--line); padding-top: 0.75rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.5vw, 2rem);
  margin-bottom: 1.5rem;
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.wide { max-width: none; }
.canvas-host { margin: 0.5rem 0 1rem; }

h1 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.75rem;
  line-height: 1.25;
}
h2 { font-size: 1.2rem; line-height: 1.35; margin: 1.75rem 0 0.75rem; }
h3 { font-size: 1.05rem; line-height: 1.4; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
p { margin: 0.75rem 0 1rem; }
.page-title { margin-bottom: 1.25rem; }

label {
  display: block;
  margin: 0.9rem 0 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
}
select:not([multiple]):not([size]) {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%233D4F66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
textarea { min-height: 7rem; resize: vertical; }
label > :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { display: block; margin-top: 0.4rem; font-weight: 400; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--ink); vertical-align: middle; }
input[type="file"] { padding: 0.4rem; }
input[type="file"]::file-selector-button { min-height: 36px; margin-right: 0.75rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.4);
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
input:disabled, select:disabled, textarea:disabled { background-color: var(--paper); color: var(--ink-soft); cursor: not-allowed; }
input[readonly], textarea[readonly] { background-color: var(--paper); }
[aria-invalid="true"] { border-color: var(--danger); }

button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  min-height: 44px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
button:hover, a.button:hover {
  background: var(--ink-raise);
  box-shadow: inset 0 -2px 0 var(--amber);
}
button:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: default;
  box-shadow: none;
}
button.link {
  background: none;
  color: var(--ink);
  margin: 0;
  padding: 0.4rem 0.25rem;
  min-height: 44px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: underline;
}
button.link:hover {
  background: none;
  box-shadow: none;
  text-decoration-color: var(--amber);
}
.nav-form { margin: 0; }

a { color: var(--ink); }
a:hover { text-decoration-color: var(--amber); }
a { text-underline-offset: 0.2em; }
button.secondary, a.button.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--control-line); }
button.secondary:hover, a.button.secondary:hover { background: var(--paper); }

.error, .form-error {
  background: rgba(166, 61, 47, 0.07);
  border: 1px solid rgba(166, 61, 47, 0.35);
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.mono { font-family: var(--mono); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-scroll { position: relative; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; }
.table-scroll table { min-width: 720px; }
.table-scroll table.facts { min-width: 0; }
thead th { white-space: nowrap; }
td .row-actions { min-width: 9rem; }
.bulk-move td.mono { white-space: nowrap; }
.table-scroll td:last-child { min-width: 5rem; }
.table-scroll td:last-child > a { white-space: nowrap; }
.bulk-move td:nth-child(3) { min-width: 10rem; }
.table-scroll:focus-visible { outline-offset: 2px; }
th, td { text-align: left; vertical-align: top; padding: 0.8rem 0.75rem; border-bottom: 1px solid var(--line); }
thead { background: var(--paper); }
tbody tr:last-child > * { border-bottom: 0; }
td .mono, td.mono { overflow-wrap: anywhere; }
td > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }
table.facts th { width: 30%; }
dl.facts { display: grid; grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr); gap: 0.75rem 1rem; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; }
pre { max-width: 100%; overflow-x: auto; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.5; }
pre.mail-body { overflow-wrap: anywhere; }
th {
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Status badges: stamp of record, not pill */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.status-icon {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  image-rendering: pixelated;
}
.status-sent   { color: var(--ink-soft); }
.status-viewed { color: var(--ink); }
.status-signed { color: var(--success); }
.status-signed::after { content: "\2713"; }
.status-completed, .status-delivered { color: var(--success); }
.status-failed, .status-dead, .status-expired, .status-rejected, .status-voided { color: var(--danger); }
.tag { margin-left: 0.4rem; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); }

/* Empty states / loading moments: slot for the pixel pigeon sprite */
.envoy-sprite {
  width: 64px;
  height: 64px;
  margin: 0.5rem auto;
  background: var(--line);
  border-radius: var(--radius);
  image-rendering: pixelated;
}
.empty-state { text-align: center; padding: 1rem 0; }
.empty { text-align: center; padding: 1rem 0; }

/* Confirmation page checkmark motif */
.done-check {
  width: 56px;
  height: 56px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--success);
  border-radius: 50%;
  color: var(--success);
  font-size: 1.8rem;
  font-weight: 700;
}

.pdf-view {
  width: 100%;
  height: 32rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.signature-input { font-size: 1rem; }
.signature-preview {
  min-height: 4.2rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.signature-preview span {
  font-family: "Great Vibes", cursive;
  font-size: 2.4rem;
  color: var(--ink);
}

.consent {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 1rem;
}
.consent input {
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
  accent-color: var(--ink);
}

/* ---- M2 dashboard additions (B7) ------------------------------------- */
.main-nav {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.main-nav a:hover { box-shadow: inset 0 -2px 0 var(--amber); }

.banner {
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
}
.banner a { color: inherit; font-weight: 600; }
.banner-info { background: var(--surface); color: var(--ink-soft); }
.banner-warn {
  background: rgba(217, 164, 65, 0.14);
  color: var(--ink);
  border-left: 4px solid var(--amber);
}
.banner-danger {
  background: rgba(166, 61, 47, 0.10);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.notice { color: var(--success); font-weight: 500; }

.secret-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  word-break: break-all;
  user-select: all;
}

.check-inline {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0.25rem 1rem 0.25rem 0;
  min-height: 44px;
  font-weight: 400;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0.8rem 0;
}
legend { font-weight: 600; padding: 0 0.4rem; }

.row-actions, .editor-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin-top: 1.25rem; }
.row-actions > :is(button, .button), .editor-actions button { margin-top: 0; }
.row-actions > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }
td .row-actions { margin: 0; gap: 0.25rem 0.75rem; }
.link.danger { color: var(--danger); }
tr.revoked td { color: var(--ink-soft); opacity: 0.7; }

/* ---- UX-M2: signup fork + usage meter ---- */
.fork-cards { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.fork-card {
  flex: 1 1 240px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; background: var(--surface);
}
.fork-card h2 { margin-top: 0; font-size: 18px; }
.usage-meter { margin: 8px 0 16px; }
.usage-meter .banner { margin-top: 8px; }
.checklist { padding-left: 20px; }
.checklist li { margin-bottom: 10px; }
.checklist .done-check { color: var(--success); font-size: inherit; display: inline-flex; width: 1.4rem; height: 1.4rem; margin: 0 0.25rem 0 0; border-width: 1px; vertical-align: middle; }
pre.quickstart {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; font-size: 13px; line-height: 1.5;
}
.tag-danger { color: var(--danger); border-color: var(--danger); }
/* TM-1: test-mode data is visually distinct wherever it sits beside live data */
.tag-test {
  color: var(--ink); background: rgba(217, 164, 65, 0.14); border: 1px solid var(--amber); border-radius: 2px;
  padding: 0.1rem 0.35rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chip-test { border-style: dashed; }
/* TM-2: captured test mail, shown as the recipient would see it */
pre.mail-body {
  white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; font-size: 13px; line-height: 1.5;
}
tr.captured-body td { border-top: 0; padding-top: 0; }

/* ---- UX-M3: document detail, timeline (LC-1..LC-4) ---- */
.timeline { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.timeline li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.timeline-what { color: var(--ink); }
.timeline-when { white-space: nowrap; }
.raw-events { margin-top: 1rem; }
.raw-events summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0.4rem 0;
}
.raw-events summary:focus-visible { outline: 2px solid var(--ink); }
summary { cursor: pointer; min-height: 44px; padding: 0.6rem 0; font-weight: 600; }
.more-options { border-block: 1px solid var(--line); margin-top: 1.25rem; padding-bottom: 0.5rem; }
.more-options[open] { padding-bottom: 1rem; }
.downloads { list-style: none; margin: 0; padding: 0; }
.downloads li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.downloads li:last-child { border-bottom: 0; }
.downloads .muted { display: block; }
.void-form { margin-top: 0.75rem; }
/* the solid treatment is for the primary destructive action only; a
   `.link.danger` stays a link, or its label disappears into the fill */
button.danger:not(.link) { background: var(--danger); color: var(--paper); }
button.link.danger { color: var(--danger); }

@media (max-width: 34rem) {
  .timeline li { flex-direction: column; gap: 0.15rem; }
}
.downloads .unavailable { color: var(--ink-soft); }

/* ---- UX-M3: list filters and sort (LC-5) ---- */
.list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}
.list-controls .list-sort { margin-left: 0.75rem; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.chip:focus-visible { outline: 2px solid var(--ink); }
.chip-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---- UX-M3: four-step send flow (SD-1..SD-5) ---- */
.steps { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none;
         margin: 0 0 1.25rem; padding: 0; font-size: 0.85rem; }
.step { color: var(--ink-soft); display: flex; align-items: center; gap: 0.35rem; }
.step + .step::before { content: "›"; margin-right: 0.35rem; color: var(--line); }
.step-n { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem;
          border: 1px solid currentColor; border-radius: 50%; font-size: 0.75rem; }
.step-on { color: var(--ink); font-weight: 600; }
.step-done { color: var(--success); }
.recipient-lanes { list-style: none; margin: 1rem 0; padding: 0; }
/* The badge sits in the gutter column; every label and control stacks in
   column 2 so a label is always directly above the box it names. Without
   the explicit `grid-column`, auto-placement wraps the pairs across both
   columns and each label ends up beside the PREVIOUS row's input. */
.lane { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr);
        gap: 0.3rem 0.75rem;
        align-items: start; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.lane > * { grid-column: 2; }
.lane-n { grid-column: 1; grid-row: 1; display: inline-grid; place-items: center;
          width: 2rem; height: 2rem; border: 1px solid var(--line);
          border-radius: 50%; color: var(--ink-soft); font-size: 0.85rem; }
.lane > * { min-width: 0; }
.lanes { border: 0; padding: 0; margin: 0 0 1rem; }
.lanes legend { font-size: 0.75rem; text-transform: uppercase;
                letter-spacing: 0.06em; color: var(--ink-soft); }
.radio { display: block; min-height: 44px; padding: 0.5rem 0; }
.radio .muted { display: block; margin-left: 1.6rem; font-weight: 400; }
.radio { font-weight: 600; }
.field-list :is(select, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])) { width: 100%; min-width: 7rem; }
.field-list input.page-input { width: 5rem; min-width: 5rem; }
.email-preview { background: var(--paper); border: 1px solid var(--line);
                 border-radius: var(--radius); padding: 0.9rem;
                 white-space: pre-wrap; font-family: var(--mono);
                 font-size: 0.82rem; color: var(--ink); overflow-x: auto; }
.preview h2 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0;
           margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0; max-width: 100%; }
.inline-form > :is(input:not([type="hidden"]), select) { flex: 1 1 12rem; width: auto; }
.inline-form > button { margin: 0; flex: 0 1 auto; }
.inline-form > .muted { flex-basis: 100%; }
.folder-create { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.4rem 1rem; align-items: end; width: 100%; }
.folder-create label { margin: 0; }
.folder-create button { margin: 0; }
.pref-list { list-style: none; margin: 0.75rem 0; padding: 0; }
.pref-list li { padding: 0.3rem 0; }

/* ---- M4 / D57: folders sidebar + search (FS-1/FS-2) ---- */
.search-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0 0.75rem; }
.search-form input[type="search"] { flex: 1 1 240px; }
.search-form button { margin: 0; }
.list-with-sidebar { display: flex; gap: 1.25rem; align-items: flex-start; }
.list-main { flex: 1 1 auto; min-width: 0; width: 100%; }
.folder-tree { flex: 0 0 200px; font-size: 0.9rem; }
.folder-tree ul { list-style: none; padding-left: 0.9rem; margin: 0.25rem 0; border-left: 1px solid var(--line); }
.folder-tree > ul { padding-left: 0; border-left: none; }
.folder-tree a[aria-current="true"] { font-weight: 700; color: var(--ink); }
.folder-tree a { display: flex; align-items: center; min-height: 44px; padding: 0.35rem 0.5rem; border-radius: 3px; }
.folder-tree a[aria-current="true"] { background: var(--paper); box-shadow: inset 2px 0 var(--ink); }
.folder-hint { margin: 0.25rem 0; }
.matched { display: block; font-size: 0.8rem; }
.bulk-move .inline-form { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.bulk-move .inline-form label { margin: 0; }
@media (max-width: 720px) { .list-with-sidebar { flex-direction: column; } .folder-tree { flex-basis: auto; width: 100%; } }

/* ---- M4 P2 (D52, SG-2): branding preview on /settings/workspace ---- */
.branding-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.branding-preview-email { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; margin: 0.5rem 0; background: var(--paper); }
.branding-preview-ceremony { margin-top: 0.75rem; }
.branding-preview-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-top: 4px solid var(--accent, transparent); background: var(--surface); }
.branding-preview-header img { height: 28px; width: auto; max-width: 160px; }
.branding-preview-brand { font-weight: 700; letter-spacing: 0.02em; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
label.check input { width: auto; }
label.check, .check-inline, .check-row { min-height: 44px; }
.check-row { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.5rem 0; }
.check-row input { margin-top: 0.2rem; }
.check-inline { align-items: flex-start; padding-block: 0.5rem; }
.check-inline input { margin-top: 0.15rem; }
.fork-card { display: flex; flex-direction: column; }
.fork-card > p:last-child { margin-top: auto; }
.skip-link { position: absolute; top: 0.5rem; left: 1rem; transform: translateY(-200%); padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); z-index: 100; }
.skip-link:focus { transform: none; }
@media (max-width: 720px) {
  header { padding: 0.75rem 1rem; }
  .main-nav { width: 100%; justify-content: space-between; gap: 0.25rem 0.75rem; }
  .settings-nav { gap: 0.25rem 0.75rem; }
  .folder-create { grid-template-columns: minmax(0, 1fr); }
  .list-controls .list-sort { margin-left: 0; }
  .folder-tree { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
  .banner { padding: 0.75rem 1rem; }
  .fork-card { flex-basis: 100%; }
  .branding-preview { padding: 0.75rem; }
}
@media (max-width: 400px) {
  .lane { grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.3rem 0.5rem; }
  .lane-n { width: 1.5rem; height: 1.5rem; }
  .row-actions > :is(button:not(.link), .button) { width: 100%; }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  dl.facts dd { margin-bottom: 0.75rem; }
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]) { appearance: auto; background-image: none; }
  :focus-visible { outline-color: Highlight; }
}

@media (max-width: 360px) {
  .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
}

main.form-page { max-width: 800px; }
.status { white-space: nowrap; }
.compact-table table { min-width: 0; }
.bulk-rows td:last-child { min-width: 18rem; }
.table-scroll .row-actions :is(a, button) { white-space: nowrap; }
.order label { min-height: 44px; padding-block: 0.5rem; margin: 0; }
