/* Reset, type, layout skeleton. Text size is a person's setting: html[data-font] = standard 16 / large 18 / xlarge 20 px. */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-font="large"] { font-size: 18px; }
html[data-font="xlarge"] { font-size: 20px; }
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/var(--lh) var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.4; font-weight: 650; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .75em; }
a { color: var(--primary); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img, canvas, audio { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
small, .muted { color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--gap); }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input:not([type]), select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: .55em .8em;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
  line-height: 1.5;
}
textarea { resize: vertical; min-height: 6.5em; }
input[type="checkbox"], input[type="radio"] { width: 1.25em; height: 1.25em; accent-color: var(--primary); }
::placeholder { color: var(--text-2); opacity: .75; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--primary); }
::selection { background: var(--primary-soft); }

/* page skeleton */
.wrap { max-width: 1120px; margin: 0 auto; padding: 16px 20px 96px; }
.wrap.narrow { max-width: 720px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--topbar-h); padding: 6px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; letter-spacing: .02em; }

@media (max-width: 900px) {
  .wrap { padding: 12px 14px 96px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
