/* Prompt Library: product layer on top of family.css.

   Identity: a type specimen book. The prompt itself is the hero object, set
   in mono on a raised sheet with its placeholders marked like proofreader's
   insertions. Everything around it (fit, adaptation, checks) is ruled
   editorial apparatus in the family neutrals. One accent: moss ink, used
   for action, focus, the current filter, catalogue codes and placeholder
   marks only. State is text plus shape (dashed = unfilled or workable,
   solid = filled or good fit), never colour alone.

   Breakpoints (media queries cannot read custom properties):
     600px   rows gain a side column; two-column fit lists
     769px   navigation expands (family); 769 to 1099px hides the brand
             subtitle so the header stays on one row
     834px   two-column task grid and how-to steps
     1024px  intro beside the anatomy; workbench form beside the sheet;
             entry aside column; guide contents rail
   Review widths: 390, 834 and 1440 CSS pixels; 200% zoom on 1440 behaves
   as 720 and uses the single-column layout.

   Motion: this layer animates only transform and opacity, 120 to 200ms;
   reduced motion removes it (family.css).                                   */

:root {
  --accent: #46581a;
  --accent-hover: #34420f;
  --accent-soft: #e6e9d7;
  --on-accent: #fbf9f5;
  --focus: #46581a;
  --caution: #8a4a00;
  --sheet-bg: #fbf9f5;
  --sheet-edge: #1c1b19;
}

[data-theme="dark"] {
  --accent: #b9cc7e;
  --accent-hover: #d3e1a8;
  --accent-soft: #262c18;
  --on-accent: #151a08;
  --focus: #b9cc7e;
  --caution: #f0b66a;
  --sheet-bg: #1f1d1a;
  --sheet-edge: #ece7de;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #b9cc7e;
    --accent-hover: #d3e1a8;
    --accent-soft: #262c18;
    --on-accent: #151a08;
    --focus: #b9cc7e;
    --caution: #f0b66a;
    --sheet-bg: #1f1d1a;
    --sheet-edge: #ece7de;
  }
}

/* ---- Progressive enhancement ---------------------------------------------
   family.css shows .js-only with display: revert, which loses to component
   rules that set display later in the cascade. State it per component.     */

html:not(.js) .js-only {
  display: none;
}

.js .finder.js-only {
  display: grid;
}

.js .save-btn.js-only,
.js .copy-btn.js-only {
  display: inline-flex;
}

.js .fill.js-only {
  display: grid;
}

.js .prompt-list.js-only {
  display: block;
}

/* Between 769 and 1099px the brand subtitle would push the five nav links
   and the theme button onto a second header row. */
@media (min-width: 769px) and (max-width: 1099px) {
  .brand-sub {
    display: none;
  }
}

/* ---- Shared small parts --------------------------------------------------- */

.arrow {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-out);
}

a:hover .arrow {
  transform: translateX(2px);
}

.prompt-code {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.crumbs li {
  margin: 0;
  color: var(--text-muted);
}

.crumbs li + li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--border-strong);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--text-muted);
}

.crumbs a:hover {
  color: var(--text);
}

.badge-sample {
  border-style: dashed;
}

.badge-sample::before {
  background: transparent;
  border: 1px solid currentColor;
}

.level {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.meter {
  display: inline-flex;
  gap: 2px;
}

.meter span {
  width: 6px;
  height: 12px;
  border: 1px solid var(--text-muted);
  border-radius: 1px;
}

.meter-1 span:nth-child(-n + 1),
.meter-2 span:nth-child(-n + 2),
.meter-3 span:nth-child(-n + 3) {
  background: var(--text);
  border-color: var(--text);
}

.mark-list {
  padding: 0;
  list-style: none;
}

.mark-list li {
  position: relative;
  padding-left: var(--space-5);
}

.mark-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-weight: 700;
}

.mark-yes li::before {
  content: "+";
  color: var(--success);
}

.mark-no li::before {
  content: "\2212";
  color: var(--danger);
}

/* ---- Home: intro beside the anatomy specimen ----------------------------- */

.pl-intro {
  padding: var(--space-7) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
}

.pl-intro-grid {
  display: grid;
  gap: var(--space-6);
}

.pl-intro h1 {
  max-width: 14em;
}

.pl-intro .lead {
  margin-bottom: var(--space-5);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
}

.anatomy {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-top: 3px solid var(--sheet-edge);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--sheet-bg);
  box-shadow: var(--shadow-2);
}

.anatomy-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 500;
}

.anatomy-specimen {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: pre-wrap;
}

.anatomy-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: anatomy;
}

.anatomy-list li {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 9rem) minmax(0, 1fr);
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
  counter-increment: anatomy;
  font-size: var(--text-sm);
}

.anatomy-list li::before {
  content: counter(anatomy, decimal-leading-zero);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.9;
}

.anatomy-label {
  font-weight: 600;
}

.anatomy-text {
  color: var(--text-muted);
}

@media (max-width: 599px) {
  .anatomy-list li {
    grid-template-columns: 1.75rem minmax(0, 1fr);
  }

  .anatomy-text {
    grid-column: 2;
  }
}

@media (min-width: 1024px) {
  .pl-intro-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-8);
    align-items: center;
  }
}

/* Placeholder marks: dashed while unfilled, an ink underline once filled. */
mark.var {
  padding: 0 0.15em;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

mark.var.is-filled {
  border-color: transparent;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: transparent;
  font-weight: 500;
}

/* ---- Home: tasks, picks, how ------------------------------------------- */

.task-grid {
  display: grid;
  gap: 0 var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-grid li {
  margin: 0;
}

.task-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-4);
  min-height: var(--target);
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.task-link:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.task-link-label {
  font-weight: 650;
}

.task-link:hover .task-link-label {
  text-decoration: underline;
}

.task-link-desc {
  grid-column: 1;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.task-link-count {
  grid-column: 2;
  grid-row: 1;
  color: var(--accent);
  font-weight: 600;
}

@media (min-width: 834px) {
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .task-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pick-list {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pick {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding-top: var(--space-4);
  border-top: 2px solid var(--rule);
}

.pick-num {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1;
}

.pick-meta {
  margin: 0 0 var(--space-1);
  color: var(--text-muted);
}

.pick-title {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}

.pick-title a {
  display: inline-flex;
  min-height: var(--target);
  align-items: center;
  color: var(--text);
}

.pick-title a:hover {
  color: var(--accent);
}

.pick-summary {
  margin: 0;
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .pick-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }

  .pick {
    grid-template-columns: minmax(0, 1fr);
  }
}

.more-link {
  margin: var(--space-5) 0 0;
}

.more-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  font-weight: 600;
}

.how-list {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how-list li {
  margin: 0;
  padding-left: var(--space-7);
  position: relative;
  counter-increment: how;
}

.how-list li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
}

.how-title {
  margin-bottom: var(--space-1);
}

.how-list p {
  margin: 0;
  color: var(--text-muted);
}

@media (min-width: 834px) {
  .how-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.family-hint {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---- Library: finder and rows ------------------------------------------- */

.finder {
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.search-wrap {
  position: relative;
}

.search-wrap .input {
  padding-right: 2.75rem;
  font-size: var(--text-md);
}

.search-wrap kbd {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-xs);
  pointer-events: none;
}

.field-tasks .chip-row {
  margin-top: var(--space-2);
}

.field-row {
  display: grid;
  gap: var(--space-3);
  align-items: end;
}

@media (min-width: 600px) {
  .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .field-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
}

.finder-nojs {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border-left: 3px solid var(--border-strong);
  background: var(--surface);
}

.finder-nojs p {
  margin-bottom: var(--space-3);
}

.result-count {
  color: var(--text-muted);
}

.prompt-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.prompt-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
}

.prompt-row:hover {
  background: var(--surface-raised);
}

.prompt-row-title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-md);
}

.prompt-row-title a {
  color: var(--text);
  text-decoration: none;
}

/* The title link covers the row; the Save button sits above it. */
.prompt-row-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.prompt-row-title a:hover {
  text-decoration: underline;
}

.prompt-row-title a:focus-visible {
  outline-color: transparent;
}

.prompt-row-title a:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.prompt-row-summary {
  margin: 0 0 var(--space-1);
  color: var(--text-muted);
}

.prompt-row-facets {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.prompt-row-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.save-btn {
  position: relative;
  z-index: 1;
  border-color: var(--border-strong);
  font-size: var(--text-sm);
}

.save-btn:hover {
  border-color: var(--text);
  background: var(--surface-raised);
}

.icon-save {
  fill: transparent;
}

.save-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.save-btn[aria-pressed="true"] .icon-save {
  fill: currentColor;
}

@media (min-width: 600px) {
  .prompt-row {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }

  .prompt-code {
    padding-top: 0.2rem;
  }

  .prompt-row-side {
    grid-column: 2;
  }
}

@media (min-width: 1024px) {
  .prompt-row {
    grid-template-columns: 4.5rem minmax(0, 1fr) 15rem;
  }

  .prompt-row-side {
    grid-column: 3;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
  }
}

.kind-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.kind-list li + li {
  margin-top: 0;
}

.kind {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 var(--space-2);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.kind-workable {
  border-style: dashed;
  color: var(--text-muted);
}

.empty[data-saved-empty] p,
.empty[data-empty] p {
  margin-bottom: var(--space-4);
}

.storage-note {
  margin-top: var(--space-5);
  font-size: var(--text-sm);
}

/* ---- Tasks ---------------------------------------------------------------- */

.task-blocks {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-6);
}

@media (min-width: 834px) {
  .task-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.task-block {
  padding-top: var(--space-3);
  border-top: 2px solid var(--rule);
}

.task-block h2 {
  font-size: var(--text-lg);
}

.task-block h2 a {
  color: var(--text);
}

.task-prompt-list {
  padding: 0;
  list-style: none;
}

.task-prompt-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.task-prompt-list a {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-height: var(--target);
  padding: var(--space-2) 0;
  color: var(--text);
  text-decoration: none;
}

.task-prompt-list a:hover {
  text-decoration: underline;
}

.other-title {
  margin-top: var(--space-7);
  font-size: var(--text-lg);
}

/* ---- Entry page ----------------------------------------------------------- */

.entry-head {
  padding: var(--space-5) 0 var(--space-5);
}

.entry-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.entry-head h1 {
  max-width: 22em;
  margin-bottom: var(--space-3);
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.625rem);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
  margin: var(--space-5) 0 var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.facts dt {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
}

.facts a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
}

@media (min-width: 834px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: start;
  }
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
}

/* The workbench: the prompt sheet, and the form that fills it in. */
.workbench {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.workbench-grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

.sheet {
  border: 1px solid var(--border);
  border-top: 3px solid var(--sheet-edge);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--sheet-bg);
  box-shadow: var(--shadow-2);
}

.sheet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.sheet-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}

.sheet-meta {
  margin: 0 auto 0 0;
  color: var(--text-muted);
}

.prompt-text {
  margin: 0;
  padding: var(--space-5) var(--space-4);
  font-size: 0.9375rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.sheet-note {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.copy-btn[data-state="done"] {
  background: var(--accent-hover);
}

@media (min-width: 1024px) {
  .workbench-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-7);
  }

  /* The sheet stays in view while the form beside it is filled in. */
  .sheet {
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height) - var(--space-6));
  }

  /* min-height: 0 lets the flex item shrink, so a long prompt scrolls
     inside the sheet instead of overflowing it. */
  .prompt-text {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

.fill {
  gap: var(--space-4);
}

.fill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--rule);
}

.fill-title {
  margin: 0;
  font-size: var(--text-lg);
}

.fill-progress {
  margin: 0;
  color: var(--text-muted);
}

.fill-privacy {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.var-field label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.var-name {
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 500;
}

.var-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.var-example {
  display: block;
  font-style: italic;
}

textarea.input {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.5;
}

.fill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

/* The form's own copy button is for narrow screens, where the sheet has
   scrolled away. Beside the sticky sheet it would be a second primary. */
@media (min-width: 1024px) {
  .fill-copy {
    display: none;
  }
}

.var-table .fill-title {
  margin-bottom: var(--space-3);
}

.entry-grid {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-6);
}

@media (min-width: 1024px) {
  .entry-grid {
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: var(--space-8);
  }

  .entry-aside {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
  }
}

.entry-block {
  margin-bottom: var(--space-7);
}

.entry-block h2 {
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--rule);
  font-size: var(--text-lg);
}

.fit-cols {
  display: grid;
  gap: var(--space-4) var(--space-6);
}

@media (min-width: 600px) {
  .fit-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fit-cols h3 {
  font-size: var(--text-base);
}

.adapt-list {
  margin: 0;
}

.adapt-list div {
  display: grid;
  gap: var(--space-1) var(--space-5);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.adapt-list dt {
  font-weight: 600;
}

.adapt-list dd {
  margin: 0;
  color: var(--text-muted);
}

@media (min-width: 834px) {
  .adapt-list div {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
}

.check-list,
.caution-list,
.related-list,
.needs-list {
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.check-list .icon-check {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  padding: 2px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.caution-list li {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--caution);
  background: var(--surface);
}

.risk {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--caution);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.related-list a {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-height: var(--target);
  padding: var(--space-2) 0;
}

.aside-title {
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--rule);
  font-size: var(--text-lg);
}

.aside-sub {
  margin-top: var(--space-5);
  font-size: var(--text-base);
}

.aside-foot {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

table.works td,
table.works th {
  font-size: var(--text-sm);
}

.fit {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.fit-workable {
  border-style: dashed;
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.needs-list li strong {
  display: block;
}

/* ---- Guide ---------------------------------------------------------------- */

.guide-layout {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-6);
}

.guide-contents {
  padding-left: var(--space-4);
  border-left: 2px solid var(--border);
}

.contents-title {
  margin: 0 0 var(--space-1);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.guide-contents ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-contents li + li {
  margin-top: 0;
}

.guide-contents a {
  display: flex;
  align-items: center;
  min-height: var(--target);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}

.guide-contents a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .guide-layout {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: var(--space-8);
    align-items: start;
  }

  .guide-contents {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
  }
}

.guide-block {
  margin-bottom: var(--space-7);
}

.guide-block h2 {
  font-size: var(--text-lg);
}

/* Blocks (family/blockkit.py) */
.block-steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.block-step {
  position: relative;
  padding-left: var(--space-7);
  counter-increment: step;
}

.block-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}

.block-step p {
  margin-bottom: var(--space-1);
}

.block-step-title {
  margin-bottom: 0;
}

.callout {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-raised);
}

.callout p {
  margin-bottom: var(--space-2);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-caution {
  border-left-color: var(--caution);
}

.callout-legal {
  border-left-style: double;
  border-left-width: 6px;
  border-left-color: var(--text);
}

.callout-tone {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare {
  display: grid;
  gap: var(--space-4) var(--space-6);
}

@media (min-width: 600px) {
  .compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compare-col {
  padding-top: var(--space-3);
  border-top: 2px solid var(--rule);
}

.prose {
  max-width: 70ch;
}

/* ---- Preferences --------------------------------------------------------- */

@media (forced-colors: active) {
  mark.var {
    forced-color-adjust: none;
    border: 1px dashed CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  mark.var.is-filled {
    border-style: solid;
  }

  .save-btn[aria-pressed="true"] {
    border-width: 3px;
  }

  .meter-1 span:nth-child(-n + 1),
  .meter-2 span:nth-child(-n + 2),
  .meter-3 span:nth-child(-n + 3) {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

@media print {
  .finder,
  .fill,
  .save-btn,
  .copy-btn,
  .guide-contents,
  .entry-actions {
    display: none !important;
  }

  .sheet {
    position: static;
    max-height: none;
    box-shadow: none;
  }
}
