/* OpenLines brand — the ONE copy of the palette, type and components.
 * Used by the admin (desk/), the public site (landing/), /get-started, the client
 * portal and /privacy. Before 2026-09-23 the palette lived in three files that
 * drifted; add a token here, never a second palette somewhere else.
 * Spec: docs/design/redesign_spec.md. */

:root {
  --paper: #f4ede1;          /* page */
  --card: #f9f4ea;           /* raised surface */
  --hover: #efe6d6;
  --ink: #241c12;            /* headings, deep coffee */
  --fg: #3a3024;             /* body */
  --muted: rgba(36, 28, 18, 0.60);
  --faint: rgba(36, 28, 18, 0.40);
  --line: rgba(36, 28, 18, 0.18);
  --line-soft: rgba(36, 28, 18, 0.08);
  --accent: #a04936;         /* oxblood */
  --accent-soft: rgba(160, 73, 54, 0.12);
  --accent-line: rgba(160, 73, 54, 0.45);
  --ok: #3d6b42;   --ok-soft: rgba(61, 107, 66, 0.12);
  --warn: #8a6a12; --warn-soft: rgba(138, 106, 18, 0.13);
  --bad: #8b3a2e;  --bad-soft: rgba(139, 58, 46, 0.12);

  --serif: "Iowan Old Style", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;

  --r: 4px;
  --gap: 16px;
  --tap: 44px;               /* minimum touch target */
  --focus: 0 0 0 3px var(--accent-line);
  --ease: 0.18s ease;
  --shadow: 0 4px 16px rgba(36, 28, 18, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--fg);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.8px; }
h2 { font-size: clamp(22px, 3.2vw, 28px); letter-spacing: -0.4px; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
small, .muted { color: var(--muted); }
.mono, code, kbd { font-family: var(--mono); font-size: 0.92em; }
.italic { font-style: italic; }
.label {                      /* small caps section label: "EST. 2026 · CANBY, OREGON" */
  font: 600 11.5px/1 var(--sans); letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted);
}
.label.accent { color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }

/* ---- buttons: the signature offset-shadow press ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border: 1px solid var(--ink); border-radius: 0;
  font: 600 14px/1 var(--sans); letter-spacing: .2px; text-decoration: none; cursor: pointer;
  background: var(--card); color: var(--ink); transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 0 var(--accent); }
.btn.primary:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--accent); background: var(--ink); }
.btn.primary:active { transform: translate(4px, 4px); box-shadow: none; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 8px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- surfaces ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card + .card { margin-top: var(--gap); }
/* In a row or grid the gap does the spacing: the stacking margin above made every card
   after the first sit 16px lower, so the first looked taller (operator report 2026-09-23). */
:is(.grid, .strip, .row, .btn-row, .split, .chips) > .card { margin-top: 0; }
:is(.grid, .strip) > .card { height: 100%; }
.card h3 { margin-bottom: 12px; }
.card.flat { background: transparent; }
.card.attention { border-left: 3px solid var(--accent); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---- stats ---- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font: 500 26px/1.1 var(--serif); color: var(--ink); }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font: 600 11.5px/1.4 var(--sans); letter-spacing: .3px; background: var(--line-soft); color: var(--fg); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font: 600 13px/1.3 var(--sans); color: var(--ink); }
.field > small { margin-top: -2px; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number],
input[type=search], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font: 15px/1.4 var(--sans);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font: 13px/1.5 var(--mono); min-height: 360px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card); cursor: pointer; font: 500 14px var(--sans); color: var(--ink);
}
.chip[aria-pressed=true], .chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.form-2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---- fold: a collapsed row that opens to edit (long lists stay one line each) ---- */
details.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); margin-bottom: 8px; }
details.fold > summary { cursor: pointer; padding: 12px 14px; list-style: none; display: flex; align-items: center; gap: 4px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; margin-left: auto; color: var(--accent); font-weight: 600; }
details.fold[open] > summary::after { content: "–"; }
details.fold[open] { padding-bottom: 12px; }
details.fold > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.fold .row + .row { margin-top: 8px; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 11.5px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* ---- tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 20px; scrollbar-width: none; }
.tabs a, .tabs button {
  padding: 12px 14px; border: 0; background: none; font: 600 14px var(--sans); color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.tabs a.on, .tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- step list (wizards, onboarding) ---- */
.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.steps .s { display: inline-flex; align-items: center; gap: 6px; }
.steps .s b { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: inline-grid; place-items: center; font: 600 11.5px var(--sans); }
.steps .s.on { color: var(--ink); } .steps .s.on b { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.steps .s.done b { background: var(--ok); color: var(--paper); border-color: var(--ok); }
.progress { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }

/* ---- run checklist (wizard execution) ---- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.checklist li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line); }
.checklist li.run::before { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.checklist li.ok::before { background: var(--ok); border-color: var(--ok); }
.checklist li.fail::before { background: var(--bad); border-color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- modal + toast ---- */
dialog.modal { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--fg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(36, 28, 18, 0.35); }
dialog.modal .body { padding: 22px; }
dialog.modal .foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.readback { background: var(--paper); border: 1px dashed var(--accent-line); padding: 14px; border-radius: var(--r); font-size: 14px; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 14px; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ---- empty + loading ---- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; font: 500 20px var(--serif); color: var(--ink); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, var(--line-soft), var(--hover), var(--line-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r); min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- wordmark ---- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 500 20px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.3px; }
.wordmark img { width: 26px; height: 26px; }

@media (max-width: 700px) {
  body { font-size: 15px; }
  .card { padding: 16px; }
  th, td { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
