/* authored. archive base styles. Sans only; the only italic is the wordmark full stop (.dot). */
*, *::before, *::after { box-sizing: border-box; }
em, i, cite, dfn, address, var { font-style: normal; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.01em; margin: 0 0 0.5em; line-height: 1.2; }
h1 { font-size: clamp(26px, 3.2vw, 36px); }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
.mono, code, kbd { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Wordmark: typed in Geist; the full stop is the brand mark and the one italic. */
.wordmark { font: 500 18px/1 var(--sans); letter-spacing: -0.02em; text-decoration: none; color: inherit; white-space: nowrap; }
.wordmark .dot { font-style: italic; }
.wordmark .product { font-weight: 400; color: var(--muted); margin-left: 6px; }

/* Layout */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: var(--bar); color: var(--bar-ink);
}
.topbar[hidden] { display: none; }
.topbar .wordmark .product { color: inherit; opacity: 0.65; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; padding: 6px 10px; font-size: 14px; opacity: 0.75; border-radius: var(--radius); }
/* currentColor, not white: in dark mode the accent bar is light and white tints vanish. */
.topbar nav a:hover, .topbar nav a[aria-current="page"] { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.topbar .who { font-size: 13px; display: flex; gap: 10px; align-items: center; }
.topbar .who button { color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); background: transparent; }
.collection-pick { font-size: 13px; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,0.3); padding: 4px 8px; border-radius: var(--radius); }
.collection-pick option { color: #2A2620; }
main#view { padding: 28px var(--gutter) 64px; min-height: calc(100vh - 120px); }
.footer { padding: 20px var(--gutter); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }

/* Controls */
button, .btn {
  font: 500 14px/1 var(--sans);
  padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
button:hover, .btn:hover { border-color: var(--ink-40); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover, button.primary:hover { opacity: 0.92; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--accent-soft); }
button.danger { color: var(--danger); border-color: var(--danger-soft); }
button.big { padding: 16px 22px; font-size: 16px; width: 100%; justify-content: center; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

input, select, textarea {
  font: 400 15px/1.4 var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); outline: none; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }

/* Chips and badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; line-height: 1; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
}
.chip.suggested { border-style: dashed; border-color: var(--accent-line); background: var(--accent-soft); }
.chip.accepted { border-color: var(--accent-line); }
.chip button { padding: 0 2px; border: 0; background: none; font-size: 13px; color: var(--muted); }
.badge { font: 500 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 6px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-60); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--ink); }

/* Surfaces */
.card { border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* Toasts and modal */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
.toast { background: var(--encre); color: var(--white); padding: 12px 16px; border-radius: var(--radius); font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,0.18); }
.toast.error { background: var(--danger); }
.toast { display: flex; align-items: center; gap: 12px; }
.toast > span { flex: 1; }
.toast-action { flex: none; padding: 7px 12px; font-size: 13px; background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 50%, transparent); }
body.is-phone .toasts { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.modal-back { position: fixed; inset: 0; background: rgba(20, 24, 43, 0.55); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg); color: var(--ink); max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; border-radius: var(--radius); padding: 24px; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .topbar { gap: 8px 12px; padding: 10px 16px; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); flex-wrap: wrap; }
  .topbar .wordmark { flex: 1; }
  .topbar nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; gap: 2px; margin: 0 -6px; }
  .topbar nav a { flex: none; padding: 8px 10px; }
  .topbar .who .email { display: none; }
  main#view { padding: 20px 16px 96px; }
}
