/* Prepstack. The direction and the reason behind each choice are in DESIGN.md. */

:root {
  color-scheme: light;
  --paper: #F7F2E8;
  --paper-2: #EFE8D9;
  --paper-3: #E6DDCA;
  --rule: #D8CDB8;
  --ghost: #CDC1AB;
  --edge: #7D7362;
  --ink: #1D1A15;
  --ink-2: #4B4539;
  --pencil: #625B4D;
  --blue: #1D4079;
  --blue-deep: #142E58;
  --on-blue: #F7F2E8;
  --red: #B4281F;
  --margin: #E2B6AA;
  --shade: rgb(29 26 21 / 0.5);

  --serif: "Iowan Old Style", "Sitka Text", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --display: "Iowan Old Style", "Sitka Display", "Sitka Heading", "Sitka Text", "Palatino Linotype", Palatino, "Noto Serif", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans", Arial, sans-serif;

  --page: 82rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --fs-display: clamp(2.125rem, 1.3rem + 3.6vw, 4rem);
  --fs-h1: clamp(1.875rem, 1.35rem + 2.4vw, 3rem);
  --fs-h2: clamp(1.3125rem, 1.15rem + 0.7vw, 1.625rem);
  --fs-title: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --small: 0.8125rem;
  --tap: 2.75rem;
  --masthead: 3.5rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1A1714;
  --paper-2: #231F1B;
  --paper-3: #2D2823;
  --rule: #3A332C;
  --ghost: #4D453B;
  --edge: #8A8070;
  --ink: #EDE6D8;
  --ink-2: #CBC2B0;
  --pencil: #A69C8A;
  --blue: #A8C3EC;
  --blue-deep: #C6D8F5;
  --on-blue: #14110E;
  --red: #F08A76;
  --margin: #5E3D36;
  --shade: rgb(0 0 0 / 0.6);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--masthead) + 1rem);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

main { flex: 1; outline: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--blue-deep); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
h1:focus-visible { outline: none; }

h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.012em; }
h2 { font-size: var(--fs-h2); line-height: 1.2; margin-bottom: 0.75rem; }
h3 { font-family: var(--display); font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
strong { font-weight: 650; }

.lede { color: var(--ink-2); font-size: 1.0625rem; max-width: 62ch; margin-top: 0.75rem; }
.muted { color: var(--ink-2); }
.note { color: var(--ink-2); font-size: 0.9375rem; margin-top: 1rem; max-width: 62ch; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.625rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
}
.skip:focus { top: 0.5rem; color: var(--paper); }

.icon { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* Masthead: the active section is a divider tab joined to the page below it. */

.masthead {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.masthead__in {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: var(--masthead);
  display: flex;
  align-items: flex-end;
  gap: 0.5rem 0.625rem;
}
.wordmark {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark__tld { color: var(--ink-2); }
.wordmark:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
/* The logo is a stack of sheets with the same red tick the lists use for a solved question. */
.logo { width: 1.875rem; height: 1.875rem; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo__sheet { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.logo__sheet--top { stroke-width: 2.2; }
.logo__pen { stroke: var(--red); stroke-width: 2.8; }
.tabs { display: flex; gap: 0.125rem; margin-bottom: -1px; margin-left: 1.375rem; margin-right: auto; }
.tabs a {
  display: block;
  padding: 0.5625rem 0.9375rem;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: 6px 6px 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-decoration: none;
}
.tabs a:hover { color: var(--ink); background: var(--paper-3); }
.tabs a[aria-current="page"] {
  background: var(--paper);
  border-color: var(--rule) var(--rule) var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.tabs a, .mast-btn { white-space: nowrap; }
.tab-short { display: none; }
/* Six section tabs fit beside the account buttons only with the shorter label and tighter padding. */
@media (max-width: 63.98rem) {
  .tabs { margin-left: 0.75rem; }
  .tabs a { padding-inline: 0.625rem; }
  .tab-long { display: none; }
  .tab-short { display: inline; }
}

/* Masthead tools: the theme switch, then the Google sign-in button or the account button at the far right. */
.mast-tools { align-self: center; display: flex; align-items: center; margin-left: auto; }
.account { margin-left: 0.375rem; }
/* The start page has its own Google button in the progress panel, so the masthead one is left out there. */
body[data-view="start"] .account.is-out { display: none; }

/* Sign in with Google. The colours, sizes and the "G" are Google's, taken from its sign-in branding
   guidelines, which is why this button sits outside the site's own palette. */
.gbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #747775;
  border-radius: 4px;
  background-color: #fff;
  color: #1f1f1f;
  font-family: "Google Sans", Roboto, var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  letter-spacing: 0.25px;
  white-space: nowrap;
  cursor: pointer;
}
/* Google's button is 40px tall; this widens the area a thumb can hit to 44px without changing its look. */
.gbtn::after { content: ""; position: absolute; inset: -0.1875rem; }
.gbtn:focus-visible { border-radius: 4px; }
.gbtn__g { width: 1.25rem; height: 1.25rem; flex: none; }
.gbtn:hover { box-shadow: inset 0 0 0 10rem rgb(48 48 48 / 0.08); }
.gbtn:disabled { border-color: rgb(31 31 31 / 0.12); background-color: rgb(255 255 255 / 0.38); box-shadow: none; cursor: default; }
.gbtn:disabled > * { opacity: 0.38; }
:root[data-theme="dark"] .gbtn { border-color: #8e918f; background-color: #131314; color: #e3e3e3; }
:root[data-theme="dark"] .gbtn:hover { box-shadow: inset 0 0 0 10rem rgb(255 255 255 / 0.08); }
:root[data-theme="dark"] .gbtn:disabled { border-color: rgb(142 145 143 / 0.12); background-color: rgb(19 19 20 / 0.38); box-shadow: none; }
/* Below this width the six section tabs leave room for Google's icon-only button, not the full label. */
@media (max-width: 63.98rem) {
  .gbtn--mast { width: 2.5rem; padding: 0; }
  .gbtn--mast .gbtn__t { display: none; }
}
.mast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  min-height: 2.5rem;
  min-width: 2.75rem;
  padding: 0.25rem 0.875rem;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.mast-btn:hover { background: var(--paper-3); }
.mast-btn[aria-expanded="true"] { background: var(--paper); }
.mast-btn--icon { width: 2.5rem; min-width: 0; padding: 0; border-color: transparent; color: var(--ink-2); }
.mast-btn--icon:hover { color: var(--ink); }
.mast-btn .icon { width: 1.25rem; height: 1.25rem; stroke-width: 1.7; }
/* The round mark holds the first letter of the signed-in name. */
.avatar {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

/* The account panel is raised because it overlaps the page below the masthead. */
.account { position: relative; }
.account:empty { display: none; }
.account:not(:empty) { display: flex; }
.account__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 40;
  width: min(21rem, calc(100vw - 2 * var(--gutter)));
  padding: 1.125rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 0.75rem 2rem var(--shade);
  font-size: 0.9375rem;
}
.account__panel p { margin-bottom: 0.625rem; overflow-wrap: anywhere; }
.account__title { font-family: var(--display); font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.account__panel .account__title { margin-bottom: 0.375rem; }
.account__who { color: var(--ink-2); }
.account__state { color: var(--ink-2); }
.account__panel .btn { width: 100%; margin-top: 0.25rem; }
.account-block .account__state { margin-top: 0.375rem; font-size: 0.9375rem; }

.bottom-nav { display: none; }

.banner {
  margin: 0;
  padding: 0.625rem var(--gutter);
  background: var(--paper-3);
  border-bottom: 1px solid var(--edge);
  font-size: 0.9375rem;
}

.page {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 3rem) var(--gutter) 4rem;
}
.boot, .noscript { color: var(--ink-2); padding: 2rem var(--gutter); }

.crumbs { font-size: 0.875rem; color: var(--pencil); margin-bottom: 0.75rem; }

/* Buttons and fields */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.5rem 1rem;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn:active { background: var(--paper-3); }
.btn--ink { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn--ink:hover, .btn--ink:active { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--on-blue); }
.btn:disabled, .btn:disabled:hover { border-color: var(--ghost); background: transparent; color: var(--pencil); cursor: default; }
.btn--ink:disabled, .btn--ink:disabled:hover { border-color: var(--ghost); background: var(--paper-3); color: var(--ink-2); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--blue); padding-inline: 0.5rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.btn--quiet:hover { background: var(--paper-2); color: var(--blue-deep); }
.btn .icon { width: 1.125rem; height: 1.125rem; stroke-width: 1.7; }
.btn .ext { width: 0.75rem; height: 0.75rem; stroke-width: 1.3; }

.field { display: grid; gap: 0.25rem; min-width: 0; }
.field > span { font-size: var(--small); font-weight: 600; color: var(--ink-2); }
input[type="search"], input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
textarea { resize: vertical; line-height: 1.5; font-family: var(--serif); }
input::placeholder, textarea::placeholder { color: var(--pencil); opacity: 1; }
input[type="checkbox"] { width: 1.125rem; height: 1.125rem; margin: 0; flex: none; accent-color: var(--blue); }

.check { display: flex; align-items: center; gap: 0.5rem; min-height: 2rem; font-size: 0.9375rem; cursor: pointer; }
.check__n { margin-left: auto; padding-left: 0.5rem; color: var(--pencil); font-size: var(--small); font-variant-numeric: tabular-nums; }
.check.is-empty .check__t, .check.is-empty .check__n { color: var(--pencil); }
.check--inline { min-height: var(--tap); align-self: end; }

.empty {
  max-width: 40rem;
  margin: 1.5rem 0;
  padding: 1.75rem 1.5rem;
  border: 1px dashed var(--edge);
  border-radius: 8px;
}
.empty h1 { font-size: var(--fs-h2); margin-bottom: 0.5rem; }
.empty__title { font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.375rem; }
.empty p + p { color: var(--ink-2); }
.empty .btn { margin-top: 1rem; }

/* Start */

.start-top {
  display: grid;
  gap: 2.5rem 4rem;
  padding-block: clamp(0.25rem, 2.5vw, 2.5rem) clamp(2.5rem, 6vw, 4.5rem);
}
.start-ask h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.02em; }
.finder { display: flex; gap: 0.5rem; max-width: 38rem; margin-top: 1.75rem; }
.finder__field { position: relative; flex: 1; min-width: 0; }
.finder input { min-height: 3.5rem; padding-inline: 1rem; border: 1.5px solid var(--ink); font-size: 1.125rem; }
.finder .btn { min-height: 3.5rem; padding-inline: 1.25rem; white-space: nowrap; }
.finder__status { min-height: 1.5rem; margin-top: 0.5rem; color: var(--ink-2); font-size: 0.9375rem; max-width: 38rem; }
/* The matches open over the page instead of pushing it down, so they are raised like the account panel. */
.finder__results {
  position: absolute;
  inset: calc(100% + 0.25rem) 0 auto 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  max-height: min(24.5rem, 60dvh);
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 0.75rem 2rem var(--shade);
}
.finder__opt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  min-height: var(--tap);
  padding: 0.625rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}
.finder__opt[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.finder__name { font-family: var(--serif); font-size: 1.0625rem; }
.finder__n { color: var(--pencil); font-size: var(--small); white-space: nowrap; font-variant-numeric: tabular-nums; }
.finder__opt[aria-selected="true"] .finder__n { color: var(--paper); }
.start-longest { margin-top: 0.75rem; color: var(--ink-2); }
.start-count { margin-top: 0.5rem; color: var(--pencil); font-size: 0.9375rem; }

.notebook { border-top: 3px double var(--ink); padding-top: 1rem; }
.notebook h2 { font-size: 1.3125rem; margin-bottom: 0.5rem; }
.notebook h3 { margin-top: 1.25rem; font-family: var(--sans); font-size: var(--small); color: var(--ink-2); }
.notebook p { margin-top: 0.5rem; }
.notebook__lead { font-family: var(--serif); font-size: 1.125rem; }
.notebook__signin { display: grid; gap: 0.75rem; justify-items: start; margin-top: 1rem; }
.notebook__signin p { margin: 0; }
.notebook__counts { font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; }
.notebook__counts strong { color: var(--red); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.notebook__list { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.notebook__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.125rem 1rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.notebook__list .bar { grid-column: 1 / -1; }
.notebook__n { color: var(--pencil); font-size: var(--small); font-variant-numeric: tabular-nums; }

.start-section { padding-block: clamp(1.75rem, 4vw, 3rem); border-top: 1px solid var(--rule); }
.start-section > .lede { margin: 0 0 1.75rem; }
.start-all { margin-top: 1rem; }
.start-key { margin: 2.5rem 0 1rem; }
/* The two short lists sit behind the same tabs as a company page. The tabs are the section's titles, so they start at its top. */
.start { --parts: 3.25rem; }
.start-section > .parts { margin-top: 0; }
.start-panel { padding-top: 1.5rem; scroll-margin-top: var(--parts); }
.start-panel > .lede { margin: 0 0 1.75rem; }

/* Contents: leader dots tie each category to its count, the way a printed contents page does. */

.toc { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 3rem; }
.toc__group { padding-bottom: 1.75rem; }
@media (min-width: 40rem) { .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 80rem) { .toc { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 2rem; } }
.toc__group ul { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.toc a { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.5625rem 0; color: var(--ink); text-decoration: none; }
.toc a:hover .t { color: var(--blue); text-decoration: underline; }
.toc .leader { flex: 1; min-width: 1.5rem; border-bottom: 2px dotted var(--edge); transform: translateY(-0.25em); }
.toc .n { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem 2.5rem; margin: 0; }
.legend > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.legend dt { display: flex; align-items: center; min-height: 1.5rem; color: var(--ink-2); }
.legend dd { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }
.legend__word { font-size: var(--small); font-weight: 600; }
.legend .ext { width: 0.875rem; height: 0.875rem; stroke-width: 1.3; }
.legend-toggle { margin: 0.75rem 0 0.25rem; }
.legend-toggle summary { display: inline-flex; align-items: center; min-height: 2.25rem; color: var(--blue); cursor: pointer; font-size: 0.9375rem; }
.legend-toggle summary:hover { color: var(--blue-deep); }
.legend-toggle[open] { padding-bottom: 1rem; }
.legend-toggle .legend, .legend-toggle p { margin-top: 0.75rem; }
.legend-toggle p { color: var(--ink-2); font-size: 0.9375rem; max-width: 62ch; }

/* Pen marks */

.tick {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  cursor: pointer;
}
.tick__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tick__box {
  position: relative;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--edge);
  border-radius: 3px;
  background: var(--paper);
}
.tick:hover .tick__box { border-color: var(--ink); }
.tick__input:focus-visible + .tick__box { outline: 2px solid var(--blue); outline-offset: 3px; }
.tick__mark { position: absolute; left: -0.3rem; top: -0.7rem; width: 1.875rem; height: 1.875rem; overflow: visible; pointer-events: none; }
.tick__mark path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* The gap is longer than the stroke so the round cap of the next dash stays off the path. */
  stroke-dasharray: 1 1.2;
  stroke-dashoffset: 1.1;
  transition: stroke-dashoffset 0.22s ease-out;
}
.tick__input:checked + .tick__box .tick__mark path,
.tick--sample .tick__mark path { stroke-dashoffset: 0; }
.tick--sample { display: inline-grid; width: 1.5rem; height: 1.5rem; cursor: default; }

.ring { position: absolute; inset: -0.2rem -0.35rem; width: calc(100% + 0.7rem); height: calc(100% + 0.4rem); overflow: visible; pointer-events: none; opacity: 0; transition: opacity 0.18s ease-out; }
.ring path { fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.is-todo .ring, .is-sample .ring { opacity: 1; }

.tally { height: 1rem; width: auto; flex: none; overflow: visible; }
.tally line { stroke-width: 1.5; stroke-linecap: round; }
.tally .on { stroke: var(--ink-2); }
.tally .off { stroke: var(--ghost); }
.dots { width: 1.625rem; height: 0.5rem; flex: none; }
.dots .on { fill: var(--ink-2); stroke: var(--ink-2); }
.dots .off { fill: none; stroke: var(--edge); }

.bar { display: block; height: 0.3125rem; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); transition: width 0.3s ease; }

/* Explorer: time tabs, filters, list */

.explorer { margin-top: 1.75rem; }
.windows { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; border-bottom: 1px solid var(--rule); }
.windows button {
  min-height: var(--tap);
  margin-bottom: -1px;
  padding: 0.5rem 0.125rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}
.windows button:hover { color: var(--ink); border-bottom-color: var(--rule); }
.windows button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.windows .n { color: var(--pencil); font-size: var(--small); font-weight: 400; font-variant-numeric: tabular-nums; }
.w-short { display: none; }
.windows__none { padding: 0.5rem 0; color: var(--pencil); font-size: var(--small); }

.explorer__body { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2rem; margin-top: 1.25rem; }
.explorer__main { min-width: 0; }

.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 14rem) minmax(0, 12rem) auto; gap: 0.75rem; align-items: end; }
.toolbar--companies { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 12rem)) auto; margin-top: 1.75rem; }

.facets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1.25rem 2rem; align-content: start; margin-top: 1rem; padding: 1rem 0; border-block: 1px solid var(--rule); }
.facets:not([data-open="true"]) { display: none; }
.facet--words { grid-column: 1 / -1; }
.facet { min-width: 0; margin: 0; padding: 0; border: 0; }
.facet legend, .facet__title { padding: 0; margin-bottom: 0.25rem; font-size: var(--small); font-weight: 600; color: var(--ink-2); }
.facet__hint { margin-top: 0.5rem; color: var(--pencil); font-size: var(--small); }
.words { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.word {
  min-height: 2rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.word:hover { background: var(--paper-2); }
.word[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.word .n { color: var(--pencil); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.word[aria-pressed="true"] .n { color: var(--paper); }

.statusline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.75rem; min-height: var(--tap); margin-top: 0.75rem; }
.status { color: var(--ink); font-weight: 600; }
.tallyline { display: flex; flex-wrap: wrap; gap: 0.125rem 1.5rem; color: var(--ink-2); font-size: 0.9375rem; }
.tallyline strong { color: var(--red); font-variant-numeric: tabular-nums; }
.next-link .ext { width: 0.6875rem; height: 0.6875rem; margin-left: 0.0625rem; stroke-width: 1.3; }

/* Question lines. The first column is the margin: your marks go there. */

.q-lists {
  --cols: var(--tap) 3.25rem minmax(0, 1fr) 5.5rem 4.75rem 6.5rem var(--tap);
  --areas: "tick num main diff acc reach todo";
  margin-top: 0.5rem;
}
.q-lists[data-kind="company"] {
  --cols: var(--tap) 3.25rem minmax(0, 1fr) 5.5rem 6.75rem 4.75rem 6.5rem var(--tap);
  --areas: "tick num main diff freq acc reach todo";
}
.q-lists[data-kind="plan"] {
  --cols: var(--tap) 3.25rem minmax(0, 1fr) 5.5rem 4.75rem minmax(9rem, 17rem) var(--tap);
  --areas: "tick num main diff acc source todo";
}
.q-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  background: linear-gradient(var(--margin), var(--margin)) no-repeat calc(var(--tap) + 0.375rem) 0 / 1px 100%;
}
.q-head, .q-row {
  display: grid;
  grid-template-columns: var(--cols);
  grid-template-areas: var(--areas);
  column-gap: 0.75rem;
  align-items: center;
}
.q-head { padding: 0.375rem 0; color: var(--pencil); font-size: var(--small); font-weight: 600; }
.q-head__tick { grid-area: tick; text-align: center; }
.q-head__todo { grid-area: todo; text-align: center; white-space: nowrap; }
.q-row { min-height: 3rem; border-bottom: 1px solid var(--rule); }
.q-row > .tick { grid-area: tick; }
.q-num { grid-area: num; position: relative; justify-self: start; padding: 0.125rem 0.25rem; color: var(--pencil); font-size: var(--small); font-variant-numeric: tabular-nums; }
.q-head .q-num { padding-left: 0.25rem; }
.q-num.is-sample { color: var(--ink-2); }
.is-todo .q-num { color: var(--ink); }
.q-main { grid-area: main; min-width: 0; padding: 0.5rem 0; }
/* The vertical padding enlarges the tap area without changing the line height. */
.q-title { padding-block: 0.5rem; font-family: var(--serif); font-size: var(--fs-title); line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.q-title:hover { color: var(--blue); text-decoration: underline; }
.q-title .ext { display: inline-block; width: 0.6875rem; height: 0.6875rem; margin-left: 0.125rem; stroke-width: 1.3; color: var(--pencil); }
.q-note { margin-left: 0.75rem; font-size: var(--small); white-space: nowrap; }
.is-solved .q-title { color: var(--pencil); }
.q-meta { display: contents; color: var(--ink-2); font-size: var(--small); font-variant-numeric: tabular-nums; }
.q-diff { grid-area: diff; display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.q-freq { grid-area: freq; display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.q-acc { grid-area: acc; text-align: right; white-space: nowrap; }
.q-reach { grid-area: reach; text-align: right; white-space: nowrap; color: var(--ink-2); text-decoration-color: var(--edge); }
.q-reach:hover { color: var(--blue); text-decoration-color: currentColor; }
.q-source { grid-area: source; }
.q-unit { display: none; }
.todo {
  grid-area: todo;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--pencil);
  cursor: pointer;
}
.todo .icon { width: 1.25rem; height: 1.25rem; stroke-width: 1.7; }
.todo:hover { background: var(--paper-2); color: var(--ink); }
.todo[aria-pressed="true"] { color: var(--red); }

.q-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.75rem; margin-top: 1.75rem; padding-bottom: 0.375rem; }
.q-head + .q-group { margin-top: 0.5rem; }
.q-group__n { font-family: var(--sans); font-size: var(--small); font-weight: 400; color: var(--pencil); }
.cutline { margin-top: 2.25rem; padding-top: 0.75rem; border-top: 2px solid var(--red); }

/* Pager. The current page carries the same ink underline as the current time period. */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.pager__pages { display: flex; align-items: center; gap: 0.5rem; }
.pager__nums { display: flex; align-items: center; gap: 0.125rem; list-style: none; margin: 0; padding: 0; }
.pager__num {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 0.5rem;
  border: 0;
  border-block: 3px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pager__num:hover { background: var(--paper-2); color: var(--ink); }
.pager__num[aria-current="page"] { border-radius: 0; border-bottom-color: var(--ink); color: var(--ink); font-weight: 650; }
.pager__gap { min-width: 1.5rem; text-align: center; color: var(--pencil); }
.pager__step { padding-inline: 0.875rem; }
.pager__jump { display: none; align-items: center; gap: 0.5rem; white-space: nowrap; }
.pager__size { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.pager select { width: auto; padding-right: 0.5rem; }
.paged:focus, .status:focus, .plan-summary:focus, .q-lists:focus, .progress-block:focus { outline: none; }
/* These two lists are narrower than the page, so their pager is too. */
.design-question .paged { max-width: 52rem; }
.progress .paged:has(.notes) { max-width: 46rem; }

/* Hovering a line tints it, which helps the eye stay on one line across its columns. */
@media (hover: hover) {
  .q-row:hover, .c-row:hover, .d-row:hover { background-color: color-mix(in srgb, var(--ink) 4%, transparent); }
}

/* Companies */

.c-lists { margin-top: 0.5rem; }
.c-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.c-head, .c-row {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr) 4rem 3.5rem 4.25rem 3.5rem 4rem 9rem 9.5rem;
  column-gap: 0.75rem;
  align-items: center;
}
.c-head { padding: 0.375rem 0; color: var(--pencil); font-size: var(--small); font-weight: 600; }
.c-head > span:first-child { text-align: center; }
.c-row { min-height: 3rem; border-bottom: 1px solid var(--rule); }
.c-name { min-width: 0; }
a.c-name { font-family: var(--serif); font-size: var(--fs-title); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; padding: 0.5rem 0; }
a.c-name:hover { color: var(--blue); text-decoration: underline; }
.c-meta { display: contents; color: var(--ink-2); font-size: var(--small); font-variant-numeric: tabular-nums; }
.c-size, .c-mix { text-align: right; white-space: nowrap; }
.c-done { display: grid; gap: 0.25rem; }
.c-unit { display: none; }

.bookmark {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--pencil);
  cursor: pointer;
}
.bookmark:hover { background: var(--paper-2); color: var(--ink); }
.bookmark .icon { width: 1.25rem; height: 1.25rem; stroke-width: 1.6; }
.bookmark[aria-pressed="true"], .bookmark-btn[aria-pressed="true"] .icon { color: var(--red); }
.bookmark[aria-pressed="true"] .icon, .bookmark-btn[aria-pressed="true"] .icon { fill: var(--red); }

/* Company page head: what the company's lists hold on the left, your own marks in the notebook panel on the right. */
.company-head { display: grid; gap: 1.75rem 3rem; align-items: start; }
.facts { display: flex; flex-wrap: wrap; gap: 1rem 2.25rem; margin: 1.25rem 0 0; }
.facts__item { display: grid; gap: 0.125rem; align-content: start; }
.facts dt { display: flex; align-items: center; gap: 0.4rem; min-height: 1.25rem; color: var(--ink-2); font-size: var(--small); font-weight: 600; white-space: nowrap; }
.facts dd { margin: 0; font-family: var(--serif); font-size: 1.375rem; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.facts .is-none dd { color: var(--pencil); }
.company-side { display: grid; gap: 0.875rem; justify-items: start; }
.company-side h2 { margin-bottom: 0; }
.company-progress { display: grid; gap: 0.75rem; width: 100%; }
.notebook .company-progress__row { display: grid; gap: 0.375rem; margin: 0; color: var(--ink-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.company-progress strong { color: var(--red); font-size: 1.125rem; }

/* System design. The rows have no tick column because marks are kept for LeetCode questions only. */

.c-design.is-none { color: var(--pencil); }

/* A company page has two tabs, DSA and System design, and the start page's two lists reuse them. They are set in the
   heading serif because each tab is the title of its list, and they stick below the masthead so the other list is one press away. */
.company { --parts: 3.25rem; }
.parts {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  gap: 0 2rem;
  margin-top: 2rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.parts__tab {
  min-height: var(--parts);
  min-width: var(--tap);
  margin-bottom: -1px;
  padding: 0.5rem 0.125rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--ink-2);
  font-family: var(--display);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.parts__tab:hover { color: var(--ink); border-bottom-color: var(--rule); }
.parts__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.parts__tab .n { font-family: var(--sans); font-size: 0.9375rem; font-weight: 400; color: var(--pencil); font-variant-numeric: tabular-nums; }
.company-panel { padding-top: 1.5rem; scroll-margin-top: var(--parts); }
.company-panel .explorer { margin-top: 0; }
.company-panel .toolbar--design.is-fixed { margin-top: 1.25rem; }
.company .status { scroll-margin-top: calc(var(--parts) + 0.75rem); }
.company-solo { margin-top: 2rem; }
.company-design__lede { max-width: 62ch; }
.d-key--folded { margin-top: 1.5rem; max-width: 46rem; }
.d-key--folded summary { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--blue); font-weight: 600; cursor: pointer; }

.toolbar--design { grid-template-columns: minmax(0, 1fr) repeat(5, minmax(0, 10rem)); margin-top: 1.75rem; }
.toolbar--design.is-fixed { grid-template-columns: minmax(0, 1fr) repeat(4, minmax(0, 10rem)); margin-top: 1rem; }
.d-lists { margin-top: 0.5rem; }
.d-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  background: linear-gradient(var(--margin), var(--margin)) no-repeat calc(var(--tap) + 0.375rem) 0 / 1px 100%;
}
.d-head, .d-row {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr) 5.5rem 11.5rem 7rem 9.5rem 4rem var(--tap);
  grid-template-areas: "tick title kind topic reach levels year todo";
  column-gap: 0.75rem;
  align-items: center;
}
.d-head { padding: 0.375rem 0; color: var(--pencil); font-size: var(--small); font-weight: 600; }
.d-head__tick { grid-area: tick; text-align: center; }
.d-head__title { grid-area: title; }
.d-head__todo { grid-area: todo; text-align: center; white-space: nowrap; }
.d-row { min-height: 3rem; border-bottom: 1px solid var(--rule); }
.d-row > .tick { grid-area: tick; }
a.d-title { grid-area: title; display: flex; align-items: center; min-height: var(--tap); padding: 0.375rem 0; font-family: var(--serif); font-size: var(--fs-title); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.d-title:hover { color: var(--blue); text-decoration: underline; }
.is-solved a.d-title { color: var(--pencil); }
.d-meta { display: contents; color: var(--ink-2); font-size: var(--small); font-variant-numeric: tabular-nums; }
.d-kind { grid-area: kind; }
.d-topic { grid-area: topic; }
.d-reach { grid-area: reach; white-space: nowrap; }
.d-levels { grid-area: levels; }
.d-year { grid-area: year; text-align: right; white-space: nowrap; }
.progress-design { display: grid; gap: 0.375rem; max-width: 22rem; margin-top: 0.5rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.d-levels.is-none, .d-co__levels.is-none { color: var(--pencil); }
.d-unit { display: none; }

.d-key { max-width: 46rem; }
.d-key h2 { font-size: var(--fs-h2); }
.d-key .muted { margin-top: 0.5rem; }
.d-levels-key { margin: 0.75rem 0 1rem; border-top: 1px solid var(--rule); }
.d-levels-key > div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.d-levels-key dt { font-weight: 600; }
.d-levels-key dd { margin: 0; color: var(--ink-2); }

.d-aliases { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin: 0.75rem 0 0; padding: 0; font-family: var(--serif); color: var(--ink-2); }
.d-cos { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--rule); max-width: 52rem; }
.d-co { padding: 0.25rem 0 0.75rem; border-bottom: 1px solid var(--rule); }
.d-co__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; }
.d-co__name { display: inline-flex; align-items: center; min-height: var(--tap); font-family: var(--serif); font-size: 1.0625rem; color: var(--ink); }
a.d-co__name { text-decoration: none; }
a.d-co__name:hover { color: var(--blue); text-decoration: underline; }
.d-co__levels { color: var(--ink-2); font-size: 0.9375rem; }
.d-src { list-style: none; display: grid; gap: 0.125rem; margin: 0; padding: 0; font-size: 0.9375rem; }
.d-src li { color: var(--ink-2); overflow-wrap: anywhere; }
.d-src a { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2rem; }
.d-src .ext { width: 0.6875rem; height: 0.6875rem; stroke-width: 1.3; }

/* Below this width six fields in one row squeeze the search box, so it takes its own row. */
@media (max-width: 79.98rem) {
  .toolbar--design { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .toolbar--design.is-fixed { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar--design .toolbar__search { grid-column: 1 / -1; }
}

/* One question */

.q-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 0.75rem; color: var(--ink-2); }
.q-facts .q-diff { gap: 0.5rem; }
.q-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.5rem; }
.mark-btn[aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.mark-btn--todo[aria-pressed="true"] .icon { color: var(--red); }
.mark-btn--solved[aria-pressed="false"] .tick__mark path { stroke-dashoffset: 1.1; }
.mark-btn .tick--sample { cursor: pointer; }
.q-section { margin-top: 2.5rem; }
.q-note-box { max-width: 46rem; }
.note-status { min-height: 1.5rem; margin-top: 0.375rem; color: var(--ink-2); font-size: var(--small); }
.a-list { list-style: none; margin: 0; padding: 0; columns: 3 18rem; column-gap: 3rem; }
.a-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: var(--tap); border-bottom: 1px solid var(--rule); break-inside: avoid; font-size: 0.9375rem; }
.a-row a { font-family: var(--serif); font-size: 1rem; color: var(--ink); text-decoration: none; padding: 0.5rem 0; overflow-wrap: anywhere; }
.a-row a:hover { color: var(--blue); text-decoration: underline; }
.a-row .q-freq { color: var(--ink-2); font-size: var(--small); font-variant-numeric: tabular-nums; }
.asks { margin-top: 0.75rem; }

/* Plan */

.plan-setup { margin-top: 2rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; }
.chips:empty { display: none; }
.chip { display: flex; align-items: center; border: 1px solid var(--edge); border-radius: 6px; background: var(--paper); }
.chip__body { display: grid; padding: 0.375rem 0 0.375rem 0.75rem; }
.chip__body a { font-family: var(--serif); font-size: 1rem; }
.chip__n { color: var(--pencil); font-size: var(--small); }
.chip__x { display: grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.chip__x:hover { background: var(--paper-2); color: var(--ink); }
.chip__x .icon { width: 1rem; height: 1rem; stroke-width: 1.8; }
.add-company { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; max-width: 34rem; }
.add-company .field { flex: 1 1 14rem; }
.plan-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 15rem)); gap: 0.75rem 1.5rem; margin-top: 0.75rem; }
.plan-summary { margin-top: 2rem; }
.plan-summary:empty { display: none; }
.plan-summary__lead { font-family: var(--serif); font-size: 1.25rem; }
.plan-summary__lead strong { color: var(--red); font-variant-numeric: tabular-nums; }
.plan-summary p + p { margin-top: 0.25rem; color: var(--ink-2); max-width: 62ch; }

/* Progress */

.progress-block { margin-top: 2.5rem; }
.progress-total { font-family: var(--serif); font-size: 1.25rem; }
.progress-total strong { color: var(--red); font-size: 1.625rem; font-variant-numeric: tabular-nums; }
.progress-diff, .coverage { list-style: none; margin: 0.75rem 0 0; padding: 0; max-width: 34rem; }
.progress-diff li, .coverage li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.progress-diff .bar, .coverage .bar { grid-column: 1 / -1; }
.progress-diff .q-diff { grid-area: auto; color: var(--ink-2); font-size: 0.9375rem; }
.progress-diff__n, .coverage__n { color: var(--ink-2); font-size: var(--small); font-variant-numeric: tabular-nums; }
.coverage a { font-family: var(--serif); font-size: 1.0625rem; }
.coverage + p { margin-top: 0.75rem; }
.days { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0 1.5rem; margin: 0.75rem 0 0; padding: 0; }
.days li { display: grid; gap: 0.25rem; align-content: start; min-height: 4.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.days__d { color: var(--ink-2); font-size: var(--small); font-weight: 600; }
.days__n { color: var(--pencil); font-size: var(--small); font-variant-numeric: tabular-nums; }
.days .tally { height: 1rem; max-width: 100%; }
.days .tally .on { stroke: var(--red); }
.notes { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.notes li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.notes p { margin-top: 0.25rem; font-family: var(--serif); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.backup__actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1rem; }
.backup .muted { max-width: 62ch; }

.lost__links { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.5rem; }

/* The dialog is the one raised surface: it sits above a dimmed page while it asks its question. */

.dialog { width: min(30rem, calc(100vw - 2rem)); padding: 1.5rem; border: 1px solid var(--edge); border-radius: 8px; background: var(--paper); color: var(--ink); box-shadow: 0 1rem 3rem var(--shade); }
.dialog::backdrop { background: var(--shade); }
.dialog h2 { margin-bottom: 0.5rem; }
.dialog p { color: var(--ink-2); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.625rem; margin-top: 1.5rem; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  max-width: calc(100vw - 2rem);
  padding: 0.625rem 1rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
}
#toast:empty { display: none; }

/* About */

.about-block p { max-width: 62ch; }
.about-block p + p { margin-top: 0.75rem; }

/* Footer. It carries the same paper band as the masthead. */

.site-foot { margin-top: 1rem; background: var(--paper-2); border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.9375rem; }
.site-foot__in { max-width: var(--page); margin: 0 auto; padding: 2.5rem var(--gutter); display: grid; gap: 2rem 4rem; }
.site-foot__brand p { margin-top: 0.375rem; max-width: 34ch; }
.site-foot__nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.5rem 2rem; }
.site-foot h2 { margin-bottom: 0.25rem; font-family: var(--sans); font-size: var(--small); font-weight: 600; line-height: 1.5; color: var(--ink); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot__nav a { display: inline-flex; align-items: center; min-height: 2.25rem; color: var(--ink-2); text-decoration: none; }
.site-foot__nav a:hover { color: var(--blue); text-decoration: underline; }
@media (min-width: 56rem) { .site-foot__in { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); } }

/* Wide enough for the question line to sit on one row */

@media (min-width: 64rem) {
  .days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .start-top { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; }
  .company-head { grid-template-columns: minmax(0, 1fr) 19rem; }
}

/* Wide enough to keep the filters beside the list */

@media (min-width: 80rem) {
  .explorer__body {
    grid-template-columns: 14rem minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "facets tools" "facets list";
    align-items: start;
  }
  .explorer__body > .toolbar { grid-area: tools; }
  .explorer__main { grid-area: list; }
  .facets, .facets:not([data-open="true"]) {
    grid-area: facets;
    display: block;
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
    margin-top: 0;
    padding: 0 0.75rem 1rem 0;
    border: 0;
  }
  .facet { margin-bottom: 1.25rem; }
  .filters-toggle { display: none; }
  .explorer__body > .toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 14rem) minmax(0, 12rem); }
}

/* Too narrow for columns: each question becomes a title line and a detail line */

@media (max-width: 63.98rem) {
  .q-head, .c-head { display: none; }
  .q-row, .q-lists[data-kind] .q-row {
    grid-template-columns: var(--tap) 2.5rem minmax(0, 1fr) var(--tap);
    grid-template-areas: "tick num main todo" "tick meta meta todo";
    column-gap: 0.375rem;
    align-items: start;
    padding-bottom: 0.625rem;
  }
  .q-list { background-position: calc(var(--tap) + 0.1875rem) 0; }
  .q-num { margin-top: 0.625rem; }
  .q-main { padding: 0.6875rem 0 0.25rem; }
  .q-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
  .q-diff, .q-freq, .q-acc, .q-reach, .q-source { grid-area: auto; text-align: left; }
  .q-reach { display: inline-flex; align-items: center; min-height: 1.75rem; }
  .q-source { flex-basis: 100%; white-space: normal; }
  .q-unit { display: inline; }

  .c-row { grid-template-columns: var(--tap) minmax(0, 1fr); column-gap: 0.375rem; align-items: start; padding-bottom: 0.75rem; }
  a.c-name { padding: 0.6875rem 0 0.25rem; }
  .c-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
  .c-size, .c-mix { text-align: left; }
  .c-done { flex-basis: 100%; max-width: 22rem; }
  .c-unit { display: inline; }

  .toolbar, .toolbar--companies, .toolbar--design, .toolbar--design.is-fixed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar__search { grid-column: 1 / -1; }

  .d-head { display: none; }
  .d-list { background-position: calc(var(--tap) + 0.1875rem) 0; }
  .d-row {
    grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap);
    grid-template-areas: "tick title todo" "tick meta todo";
    column-gap: 0.375rem;
    align-items: start;
    padding-bottom: 0.75rem;
  }
  a.d-title { padding: 0.5rem 0 0.125rem; }
  .d-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
  .d-year { text-align: left; }
  .d-unit { display: inline; }
  .d-src a { min-height: var(--tap); }
  .filters-toggle { justify-self: start; }
  .check { min-height: var(--tap); }
  .word { min-height: var(--tap); padding-inline: 0.875rem; }
}

/* Phone widths: the section tabs move to the bottom edge, within thumb reach */

@media (max-width: 47.98rem) {
  :root { --masthead: 3.25rem; }
  .tabs { display: none; }
  .masthead__in { align-items: center; }
  .mast-btn { min-height: var(--tap); }
  .mast-btn--icon { width: var(--tap); }
  .site-foot__nav a { min-height: var(--tap); }
  .parts { gap: 0 1.5rem; }
  .pager__nums { display: none; }
  .pager__jump { display: inline-flex; }
  .pager__pages { flex: 1 1 100%; justify-content: space-between; }
  .facts { gap: 0.875rem 1.75rem; }
  .facts dd { font-size: 1.25rem; }
  .bottom-nav {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--paper-2);
    border-top: 1px solid var(--rule);
  }
  .bottom-nav ul { display: flex; margin: 0; padding: 0 0.25rem; list-style: none; }
  .bottom-nav li { flex: 1 1 auto; }
  .bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0 0.25rem;
    border-top: 3px solid transparent;
    margin-top: -1px;
    color: var(--ink-2);
    font-size: var(--small);
    text-decoration: none;
  }
  .bottom-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-top-color: var(--ink); }
  .bottom-nav a { min-width: var(--tap); }
  body { padding-bottom: calc(3.25rem + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(4.25rem + env(safe-area-inset-bottom)); }
  .page { padding-bottom: 2.5rem; }
  .finder { flex-direction: column; }
  .toolbar, .toolbar--companies { grid-template-columns: minmax(0, 1fr); }
  .toolbar--design, .toolbar--design.is-fixed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar--design .toolbar__wide { grid-column: 1 / -1; }
  .windows { gap: 0 1rem; }
  .d-levels-key > div { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .w-long { display: none; }
  .w-short { display: inline; }
  .crumbs a { display: inline-block; padding-block: 0.625rem; }
  .q-actions .btn, .backup__actions .btn { flex: 1 1 100%; }
  .legend > div { grid-template-columns: 4.5rem minmax(0, 1fr); }
}

/* Six section labels only fit the narrowest phones at a slightly smaller size. */
@media (max-width: 22.49rem) {
  .bottom-nav ul { padding: 0; }
  .bottom-nav a { padding: 0 0.125rem; font-size: 0.75rem; }
  .toolbar--design, .toolbar--design.is-fixed { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 48rem) {
  .masthead { position: sticky; top: 0; z-index: 30; }
  .facets { top: calc(var(--masthead) + 1rem); max-height: calc(100dvh - var(--masthead) - 2rem); }
  /* On a company page the filters also have to clear the tabs stuck under the masthead. */
  .parts { top: calc(var(--masthead) + 1px); }
  .company .facets { top: calc(var(--masthead) + var(--parts) + 1.25rem); max-height: calc(100dvh - var(--masthead) - var(--parts) - 2.25rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .masthead, .bottom-nav, .toolbar, .facets, .pager, .parts, .site-foot__nav, .legend-toggle, .mast-btn, .gbtn, .skip, .windows, #toast { display: none !important; }
  body { padding-bottom: 0; }
}
