:root {
  color-scheme: light;
  --bg: #fff; --side: #f6f6f8; --tint: #efeff2; --tint-strong: #e5e5ea; --raised: #fff;
  --text: #1d1d1f; --body: #3a3a3c; --muted: #6e6e73; --faint: #a1a1a6;
  --ink: #1d1d1f; --on-ink: #fff; --ink-hover: #3a3a3c;
  --accent: #006f99; --accent-soft: #e6f8ff; --accent-hover: #d4f2ff; --glow: #00beff;
  --danger: #b3261e; --danger-soft: #fdf0ef; --star: #d9a21b;
  --notice: #fff8e6; --on-notice: #5e4a12;
  --shadow: 0 1px 2px #0000000f; --pop: 0 12px 40px #0000001f, 0 0 0 1px #0000000d;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, sans-serif;
  color: var(--text); background: var(--bg); font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e; --side: #242428; --tint: #2f2f35; --tint-strong: #3d3d44; --raised: #2f2f35;
  --text: #f2f2f7; --body: #e2e2e8; --muted: #b4b4bc; --faint: #8e8e96;
  --ink: #ededf2; --on-ink: #1d1d1f; --ink-hover: #d5d5df;
  --accent: #7edcff; --accent-soft: #223c47; --accent-hover: #2b4a57;
  --danger: #ffb4ab; --danger-soft: #492524; --star: #ffca59;
  --notice: #3a3220; --on-notice: #f3e2b5;
  --shadow: 0 1px 2px #00000040; --pop: 0 12px 40px #00000080, 0 0 0 1px #ffffff14;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #1c1c1e; --side: #242428; --tint: #2f2f35; --tint-strong: #3d3d44; --raised: #2f2f35;
    --text: #f2f2f7; --body: #e2e2e8; --muted: #b4b4bc; --faint: #8e8e96;
    --ink: #ededf2; --on-ink: #1d1d1f; --ink-hover: #d5d5df;
    --accent: #7edcff; --accent-soft: #223c47; --accent-hover: #2b4a57;
    --danger: #ffb4ab; --danger-soft: #492524; --star: #ffca59;
    --notice: #3a3220; --on-notice: #f3e2b5;
    --shadow: 0 1px 2px #00000040; --pop: 0 12px 40px #00000080, 0 0 0 1px #ffffff14;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; }
button, input, textarea, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 550; transition: background 140ms ease, color 140ms ease, opacity 140ms ease; }
button:disabled { cursor: default; opacity: .35; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.primary { background: var(--ink); color: var(--on-ink); }
.primary:hover:not(:disabled) { background: var(--ink-hover); }
.primary-lg { padding: 13px 28px; font-size: 16px; }
.secondary { background: var(--tint); }
.secondary:hover:not(:disabled) { background: var(--tint-strong); }
.ghost { background: none; padding: 7px 13px; color: var(--muted); }
.ghost:hover { background: var(--tint); color: var(--text); }
.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.with-icon svg { flex-shrink: 0; }
.small { padding: 6px 13px; font-size: 13px; }
.link { background: none; padding: 0; border-radius: 0; color: var(--accent); font-weight: 550; }
.link:hover { text-decoration: underline; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; background: none; color: var(--faint); font-size: 17px; line-height: 1; }
.icon-button:hover:not(:disabled) { background: var(--tint-strong); color: var(--text); }

.load-error { flex: none; margin: 12px 12px 0; padding: 11px 16px; border-radius: 12px; font-size: 14px; color: var(--danger); background: var(--danger-soft); }

/* Layout */
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); }

/* Welcome */
.welcome { grid-column: 1 / -1; overflow: auto; display: flex; justify-content: center; text-align: center; padding: 16vh 24px 40px; }
.welcome-content { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; }
.welcome-content h2 { font-size: 30px; font-weight: 650; letter-spacing: -.035em; margin-bottom: 28px; }
.other-folder { margin-top: 14px; font-size: 14px; }
.welcome-privacy { color: var(--faint); font-size: 13px; margin: 36px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.welcome-help { margin-top: 10px; }
.shield-icon { flex-shrink: 0; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border-radius: 10px; padding: 10px 12px; }
.menu-item > span:last-child { display: grid; gap: 1px; }
.menu-item strong { font-weight: 550; }
.menu-item span span { font-size: 13px; font-weight: 400; color: var(--muted); }
.option-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--raised); color: var(--muted); box-shadow: var(--shadow); }

/* Library */
.library { min-height: 0; background: var(--side); margin: 12px 0 12px 12px; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 18px; }
.section-heading { display: flex; align-items: baseline; gap: 8px; }
.count { color: var(--faint); font-size: 14px; font-weight: 500; }
.count:empty { display: none; }
#add-exercise { background: var(--raised); box-shadow: var(--shadow); }
#add-exercise:hover { background: var(--tint-strong); }
.find { padding: 0 14px 18px; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; }
input:not([type="checkbox"]):not([type="file"]):not([type="radio"]), textarea { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: var(--tint); }
#search { padding-left: 34px; background: var(--raised); box-shadow: var(--shadow); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.sort-chip { display: inline-flex; align-items: center; font-size: 13px; cursor: pointer; }
.view-toggle { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--tint-strong); }
.view-toggle button { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); background: none; transition: background 140ms ease, color 140ms ease; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.view-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sort-chip { position: relative; gap: 5px; padding: 5px 8px 5px 10px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.sort-chip:hover { background: var(--tint-strong); color: var(--text); }
.sort-chip select { appearance: none; border: 0; background: none; padding: 0; font-weight: 500; cursor: pointer; color: inherit; }
.sort-chip select:focus-visible { outline: none; }
.sort-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort-chip option { color: var(--text); background: var(--bg); }

.results { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px 12px; }
.group-label { display: flex; align-items: center; gap: 6px; margin: 26px 10px 8px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.group-label::after { content: ""; flex: 1; height: 1px; margin-left: 4px; background: var(--line, var(--tint-strong)); }
.results > .group-label:first-child, .add-all + .group-label { margin-top: 8px; }
.group-count { padding: 0 6px; border-radius: 999px; font-size: 11px; letter-spacing: 0; line-height: 17px; background: var(--tint-strong); color: var(--muted); }
.group-toggle { display: inline-flex; align-items: center; gap: 6px; margin: -3px -6px; padding: 3px 6px; border-radius: 6px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.group-toggle:hover { background: var(--tint-strong); color: var(--text); }
.group-toggle .chevron { transition: transform 140ms ease; }
.group-toggle[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.add-all { display: flex; width: calc(100% - 12px); margin: 6px 6px 6px; padding: 8px 14px; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.add-all:hover:not(:disabled) { background: var(--accent-hover); }
.result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 12px; transition: background 140ms ease; }
.result:hover { background: var(--tint); }
.result-text { min-width: 0; }
.result h3 { font-size: 15px; font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.result-other { margin: 1px 0 0; font-size: 12.5px; font-style: italic; color: var(--muted); overflow-wrap: anywhere; }
.result-tags { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 1px; }
.result-tags .tag { padding: 0 7px; border-radius: 999px; font-size: 11.5px; line-height: 18px; color: var(--muted); background: var(--tint-strong); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.result-tags .more { background: none; padding: 0 3px; }
/* With a mouse, pin, star, and tag buttons appear on hover or keyboard focus. Set pins and stars stay visible. Touch screens always show them. */
@media (hover: hover) and (pointer: fine) {
  .result-actions .icon-button:not([aria-pressed="true"]) { opacity: 0; transition: opacity 120ms ease; }
  .result:hover .result-actions .icon-button, .result:has(:focus-visible) .result-actions .icon-button { opacity: 1; }
  .result-actions .pin[aria-pressed="true"] { opacity: 0; }
}
.result-actions { display: flex; align-items: center; flex-shrink: 0; }
.result-actions .icon-button { width: 29px; }
.result-actions .terms svg { width: 15px; height: 15px; }
.favorite[aria-pressed="true"] { color: var(--star); }
.pin[aria-pressed="true"] { color: var(--accent); }
.pin[aria-pressed="true"] svg { fill: currentColor; }
/* Fixed width keeps the star and pin columns aligned whether the row says Add or Added. */
.result .add { width: 78px; margin-left: 4px; padding: 6px 0; font-size: 13px; background: var(--raised); box-shadow: var(--shadow); }
.result .add:hover:not(:disabled) { background: var(--ink); color: var(--on-ink); }
.result .add:disabled { opacity: 1; background: none; box-shadow: none; color: var(--accent); }
.library-empty { font-size: 14px; line-height: 1.6; color: var(--muted); padding: 16px 10px; }

.pane-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; }
.folder-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; color: var(--muted); }
.folder-name svg { flex: none; color: var(--faint); }
#library-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: relative; }
.menu > summary { list-style: none; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.settings { color: var(--muted); }
.menu[open] > .settings { background: var(--tint-strong); color: var(--text); }
.menu-panel { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 10; width: 300px; padding: 6px; background: var(--bg); border-radius: 14px; box-shadow: var(--pop); }
.menu-item:hover { background: var(--tint); }
.menu-item.compact { padding-block: 8px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0; padding: 8px 12px; border-radius: 10px; font-weight: 550; }
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--tint); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 4px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--raised); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Draft */
.composer { min-width: 0; min-height: 0; overflow: auto; }
.draft-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; max-width: 800px; margin: 0 auto; padding: 22px 40px 12px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); }
.draft-actions { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.status-msg { max-width: 720px; font-size: 14px; margin: 4px auto 0; padding: 11px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.status-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.status-msg[hidden] { display: none; }
.status-action { background: var(--raised); color: var(--text); box-shadow: var(--shadow); }
.draft-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-msg.status-error { background: var(--danger-soft); color: var(--danger); }
.draft { max-width: 800px; margin: 0 auto; padding: 10px 40px 56px; display: grid; gap: 12px; }
.draft-exercise { position: relative; background: var(--side); border-radius: 18px; padding: 16px 18px 20px; transition: background 140ms ease, box-shadow 140ms ease, opacity 140ms ease; }
.draft-exercise.editing { background: var(--bg); box-shadow: 0 0 0 1.5px var(--glow), 0 8px 24px #00beff1f; }
.draft-exercise.dragging { opacity: .4; }
.drop-before::before, .drop-after::after { content: ""; position: absolute; left: 12px; right: 12px; height: 3px; border-radius: 3px; background: var(--glow); }
.drop-before::before { top: -8px; }
.drop-after::after { bottom: -8px; }
.exercise-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.exercise-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exercise-title > :not(h3) { flex: none; }
.exercise-title h3 { min-width: 0; overflow-wrap: anywhere; }
.grip { width: 26px; height: 32px; margin-left: -6px; color: var(--faint); cursor: grab; touch-action: none; }
.grip:active { cursor: grabbing; }
.draft-num { color: var(--faint); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.draft-exercise h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.edited { font-size: 12px; font-weight: 550; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; cursor: help; }
.exercise-tools { display: flex; gap: 2px; flex-shrink: 0; }
.exercise-tools .icon-button { color: var(--muted); }
.exercise-tools .remove:hover { color: var(--danger); background: var(--danger-soft); }
.draft-text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--body); }
.draft-text:empty { display: none; }
.draft-text a { text-underline-offset: 2px; }
.draft-instructions { display: block; width: calc(100% + 28px) !important; margin: 0 -14px; line-height: 1.6; resize: none; background: var(--tint); padding: 12px 14px; }
.draft-instructions:focus { outline: none; }
.done { display: block; margin: 10px 0 0 auto; }
.draft-exercise img { display: block; max-width: min(100%, 400px); height: auto; border-radius: 12px; margin: 16px 0 0; }
.empty { text-align: center; padding: 16vh 22px; }
.empty .symbol { display: block; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.empty p { font-size: 14.5px; line-height: 1.6; color: var(--muted); max-width: 320px; margin: 0 auto 16px; }
.icon-check, .copy-success .icon-copy { display: none; }
.copy-success .icon-check { display: block; }
.print-only { display: none; }
.move-menu { position: fixed; z-index: 20; display: grid; min-width: 170px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; padding: 5px; background: var(--bg); border-radius: 12px; box-shadow: var(--pop); }
.move-item { text-align: left; border-radius: 8px; padding: 8px 12px; background: none; font-weight: 500; font-size: 14px; }
.move-item:hover:not(:disabled), .move-item:focus-visible { background: var(--tint); outline: none; }

/* Sending: what Copy carries and what must be attached by hand */
.files-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; font-size: 13px; font-weight: 550; color: var(--on-notice); background: var(--notice); }
.files-chip:hover { text-decoration: underline; }
.exercise-tools .edit { color: var(--muted); }
.exercise-tools .edit:hover, .draft-exercise:hover .exercise-tools .edit { color: var(--accent); }
.exercise-tools .edit:hover { background: var(--accent-soft); }
.attach-box { margin: 16px 0 0; padding: 10px 12px 12px; border-radius: 12px; border: 1.5px dashed var(--tint-strong); }
.attach-box.flash { animation: attach-flash 1.4s ease-out; }
@keyframes attach-flash { 0%, 35% { border-color: var(--on-notice); background: var(--notice); } 100% { border-color: var(--tint-strong); background: transparent; } }
@media (prefers-reduced-motion: reduce) { .attach-box.flash { animation-timing-function: steps(1, end); } }
.attach-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin: 0 0 6px; font-size: 13px; color: var(--on-notice); }
.attach-head svg { flex: none; }
.attach-head strong { font-weight: 600; }
.attach-sub { color: var(--muted); }
.attach-sub::before { content: "· "; }
.attachment { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 0 0; font-size: 13.5px; }
.attachment + .attachment { border-top: 1px solid var(--tint); margin-top: 6px; }
.attachment-name { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.kind { flex: none; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 650; letter-spacing: .02em; color: var(--muted); background: var(--tint); }
.pages { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.attachment .pages input[type="text"] { width: 92px; padding: 5px 9px; border-radius: 8px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--tint-strong); }
.attachment .pages input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger); }
.download { flex: none; gap: 6px; }
.is-downloaded .download { background: none; color: var(--accent); }
.attachment-msg { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--accent); }
.attachment-msg.error { color: var(--danger); }

/* Scope labels separate library changes from this-email changes */
.scope { display: inline-block; margin-right: 7px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; vertical-align: 1px; }
.scope-library { background: var(--tint); color: var(--text); }
.scope-email { background: var(--accent-soft); color: var(--accent); }

/* Dialogs */
dialog { width: min(480px, 92vw); border: 0; border-radius: 20px; padding: 28px; background: var(--bg); box-shadow: 0 30px 80px #00000033; color: var(--text); }
dialog::backdrop { background: #0000002e; backdrop-filter: blur(3px); }
dialog h2 { font-size: 20px; }
.dialog-eyebrow { margin: 0 0 4px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dialog-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.form-dialog { padding: 0; max-height: calc(100dvh - 32px); }
.form-dialog[open] { display: flex; }
.form-dialog form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dialog-head { padding: 24px 26px 4px; }
.dialog-body { flex: 1; min-height: 0; overflow: auto; display: grid; align-content: start; gap: 16px; padding: 14px 26px 18px; }
.dialog-foot { display: grid; gap: 12px; padding: 14px 26px 22px; border-top: 1px solid var(--tint); }
.dialog-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--body); }
.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 550; }
.field > :not(.field-label):not(.hint) { font-weight: 400; }
.field-label { display: block; }
.field .hint, .field-label .hint, legend .hint, summary .hint { display: block; margin-top: 1px; font-weight: 400; }
.field-group { display: grid; gap: 14px; margin: 0; padding: 14px; border: 0; border-radius: 14px; background: var(--side); }
.field-group legend { float: left; width: 100%; padding: 0; font-size: 14px; font-weight: 600; }
.field-group legend + * { clear: both; }
.form-dialog .field-group input[name], .form-dialog .field-group textarea, .form-dialog .more-fields textarea { background: var(--bg); }
.file-button { justify-self: start; padding: 7px 14px; font-size: 13.5px; font-weight: 550; background: var(--bg); box-shadow: var(--shadow), 0 0 0 1px var(--tint-strong); }
.file-button:hover { background: var(--tint); }
.picked-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.picked { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 6px 6px 8px; border-radius: 10px; background: var(--bg); font-weight: 400; }
.picked img { flex: none; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--tint); }
.picked img:not([src]) { visibility: hidden; }
.picked-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.picked-size { flex: none; font-size: 12.5px; color: var(--muted); }
.picked .icon-button { flex: none; width: 28px; height: 28px; color: var(--muted); }
.more-fields { border-radius: 14px; background: var(--side); }
.more-fields > summary { list-style: none; position: relative; padding: 12px 14px 12px 36px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::before { content: ""; position: absolute; left: 16px; top: 18px; width: 6px; height: 6px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); rotate: -45deg; transition: rotate 140ms ease; }
.more-fields[open] > summary::before { rotate: 45deg; }
.more-fields > summary:hover { background: var(--tint); }
.more-fields .term-fields { padding: 2px 14px 14px; }
.term-fields { display: grid; gap: 14px; }
.term-fields textarea { resize: vertical; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; margin: 0; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--muted); }
.help-head { position: sticky; top: -28px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -28px -28px 0; padding: 20px 18px 8px 28px; background: var(--bg); }
.help-head h2 { margin: 0; }
.help-head .icon-button { color: var(--muted); }
.help-head .icon-button:hover { background: var(--tint-strong); color: var(--text); }
.help h3 { margin: 22px 0 6px; font-size: 14px; font-weight: 600; }
.help .scope { margin-right: 6px; }
.help p, .help ol, .help ul { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--body); }
.help ol, .help ul { padding-left: 20px; }
.help li + li { margin-top: 3px; }
.help-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.help .help-foot p { margin: 0; font-size: 12.5px; color: var(--faint); }

@media (max-width: 800px) {
  html, body { height: auto; }
  .workspace { display: block; }
  .library, .composer, .results { overflow: visible; }
  .library { margin: 12px; }
  .draft-toolbar { padding: 14px 18px; flex-wrap: wrap; }
  .draft { padding: 8px 12px 40px; }
  .exercise-heading { align-items: flex-start; }
  .draft-exercise h3 { font-size: 16px; padding-top: 5px; }
  .exercise-title { align-items: flex-start; }
  .exercise-title .draft-num, .exercise-title .edited { margin-top: 6px; }
  .status-msg { margin: 4px 16px 0; }
  .empty { padding: 50px 12px; }
  .welcome { padding: 56px 20px; }
}
@media (prefers-reduced-motion: reduce) { button, .result, .draft-exercise, .group-toggle .chevron { transition: none; } }
@media print {
  @page { margin: 15mm; }
  :root { --bg: #fff; --text: #000; background: #fff; color: #000; font-size: 11pt; }
  html, body { height: auto; display: block; }
  .library, .welcome, .load-error, .draft-toolbar, .status-msg, .move-menu,
  .draft-instructions, .done, .draft-num, .edited, .exercise-tools, .grip, .empty, dialog { display: none !important; }
  .workspace { display: block; min-height: 0; margin: 0; }
  .composer { padding: 0; overflow: visible; color: #000; }
  .composer:not([hidden]) .print-only { display: block; }
  .draft { display: block; max-width: none; padding: 4px 0 0; }
  .draft-exercise { padding: 12pt 0; background: none; border-radius: 0; border-bottom: 1px solid #ccc; box-shadow: none; }
  .exercise-heading { display: block; break-after: avoid; }
  .draft-exercise h3 { font-size: 18px; }
  .draft-text { display: block !important; margin: 14px 0; padding: 0; color: #000; line-height: 1.4; }
  .draft-text a { color: #000; }
  .attach-box { border: 0; padding: 0; margin: 10pt 0 0; }
  .attach-head, .attachment .pages, .attachment button, .attachment-msg, .kind { display: none !important; }
  .attachment { padding: 0; border: 0 !important; margin: 0 !important; font-weight: 400; }
  .attachment-name::before { content: "Attachment: "; font-weight: 400; }
  .draft-text:empty { display: none !important; }
  .draft-exercise img { margin: 16px 0 0; max-width: 100%; max-height: 100mm; width: auto; height: auto; border-radius: 0; break-inside: avoid; }
}
