/* The small pieces every part of the site is built from: type, links,
   buttons, form fields, choices, tags and cards. Colours and shapes come from
   css/tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* --- type ------------------------------------------------------------------ */
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.022em; }
h2 { font-size: 15px; line-height: 1.3; }
h3 { font-size: 15px; line-height: 1.3; }
h4 { font-size: 14px; font-weight: 600; }
h1:focus, h2:focus { outline: none; }
b, strong { font-weight: 600; }
small { font-size: .88em; }
q { quotes: "“" "”"; }

.eyebrow, .sub { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.field > label, .field > legend, .indexhead { font-size: 13px; line-height: 1.3; font-weight: 500; color: var(--ink-2); }
.lede { color: var(--ink-2); max-width: 62ch; }
.hint { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.warn { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.formmsg { font-size: 13px; font-weight: 500; color: var(--far-above); }
.formmsg:empty { display: none; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- buttons ---------------------------------------------------------------- */
.btn, .primary, .iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 6px 14px;
  font: 500 14px/1.2 var(--font); text-decoration: none; text-align: center;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  transition: background .12s, border-color .12s;
}
.btn:hover, .iconbtn:hover { background: var(--soft); }
.btn.strong, .primary { font-weight: 600; color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.btn.strong:hover, .primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: transparent; }
.btn:disabled, .primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { display: flex; width: 100%; min-height: 40px; }
/* "show more" under a list: words, not a box */
.btn.more { display: flex; width: 100%; margin-top: 6px; color: var(--ink-2); border-color: transparent; }
.btn.more:hover { color: var(--ink); }
.iconbtn { width: 36px; padding: 0; flex: none; color: var(--ink-2); border-color: transparent; }
.iconbtn:hover { color: var(--ink); }

/* --- form fields -------------------------------------------------------------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field small { font-weight: 400; color: var(--ink-3); }
input[type="text"], input[type="search"], textarea, select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  font: 400 15px/1.3 var(--font);
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: -1px; border-color: var(--focus); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }

/* one of a few, as a row of segments */
.segrow { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; background: var(--soft); border-radius: var(--radius-s); }
.segrow input { position: absolute; opacity: 0; pointer-events: none; }
.segrow label { padding: 7px 8px; text-align: center; font: 500 14px/1.2 var(--font); color: var(--ink-2); cursor: pointer; border-radius: 6px; }
.segrow input:checked + label { color: var(--ink); background: var(--raise); box-shadow: 0 0 0 1px var(--line-2); }
.segrow input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 1px; }

/* --- one of a few, as words in a row: the one that is on is underlined --------- */
.chips { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.chip { padding: 4px 0; font: 500 14px/1.3 var(--font); text-align: left; color: var(--ink-2); background: none; border: 0; border-bottom: 2px solid transparent; }
.chip:hover { color: var(--ink); }
.chip[aria-checked="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.chips.small { gap: 2px 16px; }
.chips.small .chip { font-size: 13px; }

.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--pill); font: 500 12px/1.5 var(--font); vertical-align: 1px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.tag.free { color: var(--below); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--below) 40%, transparent); }

/* --- cards ---------------------------------------------------------------------- */
.card { padding: 20px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); }
.card > * + * { margin-top: 12px; }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cardlede { font-size: 14px; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status { font-size: 13px; color: var(--ink-2); }
.status:empty { display: none; }

/* what the assistant writes */
.prose > * + * { margin-top: .7em; }
.prose h4 { margin-top: 1.2em; font-size: 15px; }
.prose ul { padding-left: 1.2em; list-style: disc; }
.prose li + li { margin-top: .3em; }

/* --- scroll bars, and less movement for those who ask for it ----------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
