/* Reusable components. Glass is reserved for the floating control layer;
   readable content always sits on solid surfaces. */
@layer components {
  /* ---------- Liquid Glass material ---------- */
  .glass {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 42%), var(--glass-tint), var(--glass-regular);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-edge);
    box-shadow: var(--glass-specular), 0 0 0 .5px var(--glass-outline), var(--glass-shadow);
    color: var(--text-on-glass);
  }
  .glass.thin { background: var(--glass-tint), var(--glass-thin); -webkit-backdrop-filter: blur(var(--glass-blur-thin)) saturate(var(--glass-saturate)); backdrop-filter: blur(var(--glass-blur-thin)) saturate(var(--glass-saturate)); }
  .glass.thick { background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 30%), var(--glass-thick); -webkit-backdrop-filter: blur(var(--glass-blur-thick)) saturate(var(--glass-saturate)); backdrop-filter: blur(var(--glass-blur-thick)) saturate(var(--glass-saturate)); }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass, .glass.thin, .glass.thick { background: var(--glass-thick); }
  }
  /* Solid surfaces for reduced transparency, reduced quality and recording mode. */
  @media (prefers-reduced-transparency: reduce) {
    .glass, .glass.thin, .glass.thick { background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  }
  .solid-surfaces .glass { background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

  .icon { flex: none; }
  [data-icon]:empty { display: inline-grid; place-items: center; }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: var(--hit); padding: 0 var(--s-5); border-radius: var(--r-pill);
    border: 1px solid transparent; background: none; font: var(--type-subhead); font-size: 14px; font-weight: 600;
    letter-spacing: -0.003em; white-space: nowrap; text-decoration: none;
    transition: transform var(--t-fast) var(--ease-out), background-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), color var(--t-base);
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active:not(:disabled), .icon-btn:active:not(:disabled), .segmented button:active:not(:disabled), .pill-toggle:active { transform: scale(var(--press-scale)); }
  .btn .icon { width: 18px; height: 18px; }
  .btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 1px 2px rgba(18, 60, 30, .3), 0 6px 16px rgba(38, 116, 57, .24); }
  .btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
  .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--separator-strong); box-shadow: var(--shadow-1); }
  .btn.secondary:hover:not(:disabled) { background: var(--gray-25); border-color: var(--gray-300); }
  .btn.tinted { background: var(--accent-soft); color: var(--accent-strong); }
  .btn.tinted:hover:not(:disabled) { background: #d9ebdd; }
  .btn.plain { color: var(--accent-strong); padding: 0 var(--s-3); }
  .btn.plain:hover:not(:disabled) { background: rgba(38, 116, 57, .08); }
  .btn.small { min-height: 36px; padding: 0 var(--s-3); font-size: 13px; }
  .btn.block { width: 100%; }
  .btn:disabled { opacity: .45; box-shadow: none; }
  /* Small visual buttons keep a 44 px hit area through an invisible halo. */
  .btn.small::after, .icon-btn.compact::after, .chip-btn::after { content: ""; position: absolute; inset: -6px; }
  .btn.small, .icon-btn.compact, .chip-btn { position: relative; }

  .icon-btn {
    display: inline-grid; place-items: center; width: var(--hit); height: var(--hit); flex: none;
    border-radius: var(--r-pill); border: 1px solid var(--separator); background: var(--surface); color: var(--text-secondary);
    transition: transform var(--t-fast) var(--ease-out), background-color var(--t-base), color var(--t-base);
  }
  .icon-btn .icon { width: 20px; height: 20px; }
  .icon-btn:hover:not(:disabled) { color: var(--text); background: var(--gray-25); }
  .icon-btn.plain { border-color: transparent; background: transparent; }
  .icon-btn.plain:hover:not(:disabled) { background: rgba(22, 29, 24, .06); }
  .icon-btn:focus-visible { border-radius: 50%; }
  .icon-btn.is-active, .icon-btn[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
  .icon-btn:disabled { opacity: .38; }

  .pill-toggle {
    display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--hit); padding: 0 var(--s-4);
    border-radius: var(--r-pill); font: var(--type-subhead); font-weight: 560; color: var(--text-secondary);
    transition: transform var(--t-fast) var(--ease-out), color var(--t-base);
  }
  .pill-toggle .icon { width: 18px; height: 18px; }
  .pill-toggle[aria-pressed="true"] { color: var(--accent-strong); }
  .pill-toggle.quiet { width: var(--hit); padding: 0; justify-content: center; color: var(--text-tertiary); opacity: .75; }
  .pill-toggle.quiet:hover { opacity: 1; }

  /* ---------- Segmented control with a sliding indicator ---------- */
  .segmented {
    position: relative; display: inline-flex; align-items: stretch; gap: 2px; padding: 3px;
    border-radius: var(--r-pill); isolation: isolate;
  }
  .segmented:not(.glass) { background: var(--gray-100); box-shadow: inset 0 0 0 1px var(--separator); }
  .segmented > button {
    position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 38px; padding: 0 var(--s-4); border: 0; border-radius: var(--r-pill); background: transparent;
    font: var(--type-subhead); font-weight: 560; color: var(--text-secondary); white-space: nowrap;
    transition: color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
  }
  .segmented > button .icon { width: 17px; height: 17px; }
  .segmented > button:hover:not(:disabled):not(.is-active) { color: var(--text); }
  .segmented > button.is-active { color: var(--text); }
  .segmented > button:disabled { opacity: .4; }
  .segmented-indicator {
    position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; border-radius: var(--r-pill);
    background: var(--surface); box-shadow: 0 1px 2px rgba(17, 26, 20, .1), 0 3px 8px rgba(17, 26, 20, .08), inset 0 0 0 .5px rgba(17, 26, 20, .05);
    width: var(--seg-w, 0); transform: translate(var(--seg-x, 0px), 0); opacity: var(--seg-o, 0);
    transition: transform var(--t-slow) var(--ease-spring), width var(--t-slow) var(--ease-spring), height var(--t-slow) var(--ease-spring), opacity var(--t-base);
  }
  .segmented[data-orient="v"] { flex-direction: column; }
  .segmented[data-orient="v"] > .segmented-indicator { top: 0; bottom: auto; left: 4px; right: 4px; width: auto; height: var(--seg-h, 0); transform: translate(0, var(--seg-y, 0px)); }
  .segmented.accent .segmented-indicator { background: var(--accent); }
  .segmented.accent > button.is-active { color: var(--on-accent); }
  .segmented.stretch { display: flex; }
  .segmented.stretch > button { flex: 1; padding: 0 var(--s-2); }

  /* ---------- Surfaces ---------- */
  .card { background: var(--surface); border: 1px solid var(--separator); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
  .panel { background: var(--surface); border: 1px solid var(--separator); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
  .inset-group { background: var(--surface-sunken); border-radius: var(--r-md); padding: var(--s-3); }

  .eyebrow, .field-label, .tiny-label {
    display: block; font: var(--type-caption); letter-spacing: var(--tracking-caption); color: var(--text-tertiary);
  }
  .field-label { margin: var(--s-3) 0 var(--s-1); color: var(--text-secondary); }
  .footnote, .microcopy { font: var(--type-footnote); color: var(--text-tertiary); }
  .edition-note { display: block; margin-top: var(--s-2); font: var(--type-footnote); color: var(--warn); }
  .spaced { margin-top: var(--s-3); }

  /* ---------- Fields ---------- */
  select, input[type="number"], input[type="text"], input:not([type]), textarea, .search-bar {
    width: 100%; min-height: var(--hit); padding: 0 var(--s-3); border-radius: var(--r-sm);
    border: 1px solid var(--separator-strong); background: var(--surface); color: var(--text);
    font: var(--type-callout); transition: border-color var(--t-base), box-shadow var(--t-base);
  }
  textarea { padding: var(--s-3); min-height: 120px; resize: vertical; }
  select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23485249' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
  select:disabled, input:disabled { opacity: .5; }
  select:hover:not(:disabled), input:hover:not(:disabled) { border-color: var(--gray-400); }
  input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }

  .stepper {
    display: grid; grid-template-columns: var(--hit) minmax(0, 1fr) var(--hit); align-items: stretch;
    border: 1px solid var(--separator-strong); border-radius: var(--r-md); background: var(--surface); overflow: hidden;
  }
  .stepper button { border: 0; background: var(--gray-25); color: var(--text-secondary); display: grid; place-items: center; font-size: 18px; }
  .stepper button:hover:not(:disabled) { background: var(--accent-softer); color: var(--accent-strong); }
  .stepper input { border: 0; border-radius: 0; text-align: center; min-height: var(--hit); padding: 0 var(--s-1); font: var(--type-value); font-size: 15px; }
  .stepper:focus-within { box-shadow: var(--focus-ring); }
  .stepper input:focus-visible { box-shadow: none; }
  .axis-control { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; }
  .axis-control label { font: var(--type-callout); color: var(--text); }
  .axis-control label small { display: block; font: var(--type-footnote); color: var(--text-tertiary); }

  /* ---------- Chips and status ---------- */
  .chip {
    display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 var(--s-2);
    border-radius: var(--r-pill); background: var(--gray-100); color: var(--text-secondary); font: var(--type-caption);
  }
  .chip .icon { width: 14px; height: 14px; }
  .chip.accent { background: var(--accent-soft); color: var(--accent-strong); }
  .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip-btn {
    min-height: 34px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--separator);
    background: var(--surface); color: var(--text-secondary); font: var(--type-subhead); font-weight: 520;
    transition: background-color var(--t-base), color var(--t-base), border-color var(--t-base);
  }
  .chip-btn:hover { color: var(--text); border-color: var(--gray-300); }
  .chip-btn.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
  .status {
    display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 var(--s-2) 0 6px;
    border-radius: var(--r-pill); font: var(--type-caption); font-weight: 600; white-space: nowrap; border: 1px solid transparent;
  }
  .status .icon { width: 14px; height: 14px; stroke-width: 2.2; }
  .status.pass { background: var(--pass-bg); color: var(--pass); border-color: var(--pass-line); }
  .status.fail { background: var(--fail-bg); color: var(--fail); border-color: var(--fail-line); }
  .status.warning, .status.incomplete { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
  .status.not-verifiable, .status.not-applicable { background: var(--muted-bg); color: var(--muted); border-color: var(--muted-line); }
  .preview-tag {
    display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s-3); border-radius: var(--r-pill);
    border: 1px solid var(--accent-line); color: var(--accent-strong); background: var(--accent-softer); font: var(--type-caption); white-space: nowrap;
  }

  /* ---------- Callouts ---------- */
  .callout { display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--info-bg); color: var(--info); font: var(--type-callout); }
  .callout.amber { background: var(--warn-bg); color: #5f4100; }
  .callout b { color: inherit; }

  /* ---------- Menu and popover ---------- */
  .menu-anchor { position: relative; }
  .menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 224px; padding: 6px;
    border-radius: var(--r-lg); display: grid; gap: 2px; transform-origin: top right;
    animation: pop-in var(--t-base) var(--ease-spring);
  }
  .menu [role="menuitem"] {
    display: flex; align-items: center; gap: var(--s-3); min-height: var(--hit); padding: 0 var(--s-3);
    border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; font: var(--type-callout); color: var(--text);
  }
  .menu [role="menuitem"] .icon { width: 18px; height: 18px; color: var(--text-secondary); }
  .menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus-visible { background: rgba(38, 116, 57, .1); }
  @keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } to { opacity: 1; transform: none; } }

  /* ---------- Toast ---------- */
  .toast {
    position: fixed; z-index: 120; left: 50%; bottom: calc(var(--edge, 12px) + 64px + 20px);
    max-width: min(560px, calc(100vw - 32px)); padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
    font: var(--type-callout); font-weight: 520; text-align: center; pointer-events: none;
    opacity: 0; transform: translate(-50%, 8px) scale(.98);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-spring);
  }
  .toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
  .toast:empty { display: none; }

  /* ---------- Sheets (dialogs) ---------- */
  .modal-backdrop {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s-6);
    background: var(--scrim); -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2);
    animation: fade-in var(--t-base) var(--ease-out);
  }
  @media (prefers-reduced-transparency: reduce) { .modal-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(28, 38, 31, .45); } }
  .modal {
    width: min(620px, 100%); max-height: min(860px, calc(100dvh - 48px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: var(--r-xl); overflow: hidden; animation: sheet-in var(--t-slow) var(--ease-spring);
  }
  .modal.wide { width: min(1040px, 100%); }
  .modal.narrow { width: min(520px, 100%); }
  .modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-4); }
  .modal-header h2 { font: var(--type-title); letter-spacing: var(--tracking-title); }
  .modal-header p { margin-top: var(--s-1); font: var(--type-callout); color: var(--text-secondary); }
  .modal-content { overflow: auto; padding: var(--s-5) var(--s-6) var(--s-6); background: var(--surface); border-top: 1px solid var(--separator); overscroll-behavior: contain; }
  .modal-content > * + * { margin-top: var(--s-4); }
  .modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-6) var(--s-4); border-top: 1px solid var(--separator); }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.975); } to { opacity: 1; transform: none; } }

  /* ---------- Tables and information blocks ---------- */
  .info-table { width: 100%; font: var(--type-callout); }
  .info-table td { padding: 9px 0; border-bottom: 1px solid var(--separator); vertical-align: top; }
  .info-table td:first-child { width: 42%; padding-right: var(--s-4); color: var(--text-secondary); }
  .info-table tr:last-child td { border-bottom: 0; }
  .info-block h3 { font: var(--type-headline); margin-bottom: var(--s-2); }
  .two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s-6); }

  /* ---------- Instructor avatar ---------- */
  .instructor { width: 100%; height: auto; object-fit: contain; }
  .info-avatar { width: 96px; float: right; margin: 0 0 var(--s-2) var(--s-4); }

  /* ---------- Spinner ---------- */
  .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 900ms linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---------- Tutorial target glow ---------- */
  .glow-target { position: relative; z-index: 2; box-shadow: var(--glow) !important; border-radius: var(--r-md); animation: glow-pulse 1.8s var(--ease-in-out) infinite; }
  @keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(38, 116, 57, .32), 0 0 0 8px rgba(38, 116, 57, .1), 0 0 22px 2px rgba(64, 160, 92, .3); } 50% { box-shadow: 0 0 0 3px rgba(38, 116, 57, .5), 0 0 0 12px rgba(38, 116, 57, .14), 0 0 32px 8px rgba(64, 160, 92, .42); } }
  @media (prefers-reduced-motion: reduce) { .glow-target { animation: none; } }

  /* ---------- 0.4: measuring tasks, tutorial choice, review notes ---------- */
  .foot-measure, .knee-ref-choice { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .ifu-passage .btn.plain { justify-self: start; max-width: 100%; white-space: normal; text-align: left; height: auto; }
  .link-btn { all: unset; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
  .link-btn:focus-visible { box-shadow: var(--focus-ring); border-radius: 4px; }
  .ref-options { display: grid; gap: var(--s-1); }
  .ref-options .btn { justify-content: flex-start; text-align: left; white-space: normal; }
  .ref-options .btn b { min-width: 1.4em; }
  .btn.danger-soft { background: var(--fail-bg); color: var(--fail); border-color: var(--fail-line); }
  .field-error { font: var(--type-footnote); color: var(--fail); }
  .ifu-passage { border-radius: var(--r-md); background: var(--pass-bg); padding: var(--s-2) var(--s-3); font: var(--type-callout); }
  .ifu-passage summary { display: flex; gap: var(--s-1); align-items: center; font-weight: 600; color: var(--pass); cursor: pointer; }
  .ifu-passage blockquote { margin: var(--s-2) 0; padding-left: var(--s-2); border-left: 3px solid var(--pass-line); font-style: italic; }
  .tutorial-choice { display: grid; gap: var(--s-1); margin: var(--s-2) 0; }
  .choice-option { display: grid; gap: 2px; text-align: left; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); border: 1px solid var(--separator-strong); background: var(--surface); color: var(--text); font: var(--type-callout); cursor: pointer; transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
  .choice-option small { color: var(--text-tertiary); font: var(--type-footnote); }
  .choice-option:hover { border-color: var(--accent-line); }
  .choice-option.is-active { background: var(--accent-soft); border-color: var(--accent); }
  .choice-option:focus-visible { box-shadow: var(--focus-ring); outline: none; }
  .tutorial-box { margin: var(--s-2) 0; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--info-bg); color: var(--info); font: var(--type-callout); }
  .tutorial-box ol { margin: var(--s-1) 0 0; padding-left: 1.2em; display: grid; gap: 2px; }
  .missing-list { margin: var(--s-1) 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
  .closing-note { display: grid; grid-template-columns: 88px 1fr; gap: var(--s-3); align-items: center; margin-top: var(--s-4); padding: var(--s-3); border-radius: var(--r-lg); background: var(--accent-softer); border: 1px solid var(--accent-line); }
  .closing-note .instructor { width: 88px; height: 88px; object-fit: contain; }
  .closing-note h3 { font: var(--type-headline); margin: 0 0 var(--s-1); }
  .closing-note p { margin: 0; font: var(--type-callout); color: var(--text-secondary); }
  .next-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
  .next-mode { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--separator); }
  .next-mode .mode-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
  .next-mode h3 { font: var(--type-headline); margin: 0; }
  .next-mode p { margin: 0; font: var(--type-callout); color: var(--text-secondary); }
  .next-mode .btn { justify-self: start; }
  @media (max-width: 860px) { .next-modes { grid-template-columns: 1fr; } }
  .facts-table { width: 100%; border-collapse: collapse; font: var(--type-callout); }
  .facts-table th { width: 32%; padding: var(--s-2) var(--s-3) var(--s-2) 0; text-align: left; vertical-align: top; font-weight: 600; color: var(--text-secondary); }
  .facts-table td { padding: var(--s-2) 0; vertical-align: top; }
  .facts-table tr + tr th, .facts-table tr + tr td { border-top: 1px solid var(--separator); }
  .fact-ref { display: block; margin-top: 2px; font: var(--type-footnote); }
  .facts-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font: var(--type-callout); }
  .ifu-open { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; padding: var(--s-4); border-radius: var(--r-lg); background: var(--accent-softer); color: var(--accent-strong); }
  .ifu-open p { margin: 0 0 var(--s-3); color: var(--text); font: var(--type-callout); }
  .copy-row { display: flex; gap: var(--s-2); }
  .copy-row input { flex: 1; min-width: 0; font: var(--type-footnote); }
  @media (max-width: 860px) { .facts-table th { width: 40%; } }
  /* German compounds (Aufbaubezugspunkt) break at syllables, not mid-letter. */
  :lang(de) .facts-table th, :lang(de) .facts-table td { -webkit-hyphens: auto; hyphens: auto; }

  /* ---------- 0.5.2: foot reference in three tasks ---------- */
  .foot-tasks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .foot-task { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: var(--s-2); align-items: start; }
  .foot-task > div { display: grid; gap: var(--s-2); min-width: 0; }
  .foot-task p { margin: 0; }
  .foot-task .btn.plain { justify-self: start; max-width: 100%; white-space: normal; text-align: left; height: auto; }
  .task-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--font-sans); background: var(--muted-bg); color: var(--text-secondary); }
  .task-title { font: var(--type-subhead); font-weight: 600; color: var(--text); line-height: 26px; }
  .foot-task.is-active .task-num { background: var(--accent); color: var(--on-accent); }
  .foot-task.is-done .task-num { background: var(--pass-bg); color: var(--pass); box-shadow: inset 0 0 0 1px var(--pass-line); }
  .foot-task.is-done > div > p:first-of-type { font: var(--type-callout); color: var(--text-secondary); }
  .foot-task.is-locked .task-title { color: var(--text-tertiary); }
  .foot-rule { display: grid; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); border: 1px solid var(--accent-line); background: var(--accent-softer); font: var(--type-callout); }
  .foot-rule-name { font-weight: 600; color: var(--text); }
  .foot-rule-name small { display: block; font: var(--type-footnote); color: var(--text-secondary); }
  .foot-rule-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
  .reading-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); }
  .reading-row input { min-width: 0; }
  .foot-calc { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--surface-sunken); font: var(--type-callout); font-variant-numeric: tabular-nums; color: var(--text); }
  .foot-task .num { font-variant-numeric: tabular-nums; }
}
