:root {
  --paper: #f7f4ed;
  --paper-strong: #fffdf8;
  --ink: #17211f;
  --blue: #163f69;
  --blue-soft: #58728d;
  --green: #4f6f66;
  --green-dark: #3f5f57;
  --mist: #e7eeeb;
  --mist-2: #f0f4f1;
  --gold: #b89257;
  --line: #d8ddd8;
  --danger: #a34d3d;
  --danger-soft: #fbefeb;
  --ok-soft: #edf4ec;
  --shadow: 0 18px 44px rgba(42, 50, 46, .08);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #e8e5de; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(34, 100, 158, .28);
  outline-offset: 2px;
}

#app { width: min(100%, 1366px); min-height: 100vh; margin: 0 auto; background: var(--paper); overflow: hidden; }
.approved-art { position: relative; width: 100%; overflow: hidden; background: #faf8f2; }
.approved-art picture, .approved-art img { display: block; width: 100%; }
.approved-art img { height: auto; }
.approved-art--entry { height: 236px; }
.approved-art--header { height: 61px; border-bottom: 1px solid rgba(69, 78, 74, .14); }
.page-shell { width: min(calc(100% - 48px), 1180px); margin: 0 auto; padding: 28px 0 64px; }
.page-shell--entry { padding-top: 30px; }

.site-footer { position: relative; min-height: 96px; padding: 0; color: var(--blue-soft); background: #faf8f2 url('./art/entry-desktop.png') center bottom / 100% auto no-repeat; }
.site-footer .prototype-notice { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%); display: block; width: 58%; padding: 12px 8px; background: #faf8f2; text-align: center; text-wrap: balance; font-size: 12px; line-height: 1.5; }

.entry-panel { padding: 0; }
.entry-intro { margin-bottom: 22px; text-align: left; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: 14px; letter-spacing: .28em; }
h1, h2, p { margin-top: 0; }
.entry-intro h1 { margin-bottom: 8px; font-size: clamp(28px, 3vw, 36px); font-weight: 650; }
.entry-intro p { margin-bottom: 0; color: var(--blue-soft); font-size: 18px; }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.task-card { min-height: 190px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 16px 22px; align-items: start; padding: 30px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, .95); box-shadow: var(--shadow); transition: transform .16s ease, border-color .16s ease; }
.task-card:hover { transform: translateY(-2px); border-color: #8aa49b; }
.task-no { width: 52px; height: 52px; grid-row: 1 / span 2; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: white; font-size: 26px; line-height: 1; }
.task-copy strong { display: block; margin-bottom: 11px; font-size: 30px; font-weight: 650; }
.task-copy small { display: block; color: var(--blue-soft); font-size: 17px; line-height: 1.65; }
.task-go { align-self: end; color: var(--blue); font-size: 18px; }
.continue-row { width: min(760px, 100%); margin: 22px auto 0; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; border: 1px solid #cad6d1; border-radius: 8px; background: var(--mist-2); }
.continue-row small { display: block; margin-bottom: 5px; color: var(--blue-soft); }
.continue-row b { color: var(--blue); white-space: nowrap; }

.work-topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; margin: 0 0 22px; color: var(--blue-soft); }
.work-topbar strong { color: var(--ink); font-size: 34px; font-weight: 650; }
.link-button, .text-button, .text-danger { padding: 0; border: 0; background: none; color: var(--blue); text-decoration: none; }
.text-button:hover, .link-button:hover { text-decoration: underline; }
.text-danger { color: var(--danger); font-size: 14px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 20px; align-items: start; }
.card, .action-panel { border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, .96); box-shadow: 0 10px 28px rgba(42, 50, 46, .045); }
.card { padding: 26px; }
.condition-card { position: sticky; top: 18px; }
.section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.step { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: white; font-size: 25px; }
.section-heading h1, .section-heading h2 { margin: 2px 0 5px; font-size: 25px; font-weight: 650; }
.section-heading p { margin: 0; color: var(--blue-soft); line-height: 1.55; }
label { display: block; margin: 18px 0 8px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 46px; border: 1px solid #b9c9d7; border-radius: 6px; background: #fff; padding: 10px 12px; font-size: 16px; }
textarea { min-height: 108px; resize: vertical; line-height: 1.65; }
textarea.short { min-height: 88px; }
.primary, .secondary { min-height: 48px; padding: 10px 18px; border-radius: 6px; font-size: 17px; }
.primary { border: 1px solid var(--green); background: var(--green); color: white; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { border: 1px solid #7898a9; background: rgba(255,255,255,.75); color: #174f68; }
.full { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; margin: 17px 0 4px; color: #85928e; }
.or::before, .or::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.source-buttons { display: flex; align-items: flex-start; gap: 12px; }
.source-buttons > .secondary, .source-buttons > .inline-editor { flex: 0 1 190px; }
.inline-editor { position: relative; }
.inline-editor > summary { min-height: 48px; display: grid; place-items: center; padding: 10px 18px; border: 1px solid #7898a9; border-radius: 6px; background: rgba(255,255,255,.75); color: #174f68; cursor: pointer; list-style: none; }
.inline-editor > summary::-webkit-details-marker { display: none; }
.inline-editor[open] { flex: 1 1 100%; }
.inline-editor[open] > summary { margin-bottom: 12px; }
.inline-editor > div { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--mist-2); }
.inline-editor label { margin-top: 0; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.list-heading span { color: var(--blue-soft); font-size: 14px; }
.empty-list { padding: 22px; border-radius: 6px; background: var(--mist-2); color: var(--blue-soft); line-height: 1.65; }
.material-list { border-top: 1px solid var(--line); }
.material-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line); }
.material-row span { font-size: 18px; }
.material-row .private-material-note { display: block; margin-top: 4px; color: var(--blue-soft); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.material-row:has(.private-material-note) { padding: 10px 0; gap: 12px; }
.manual-task-notice { margin-bottom: 16px; }
.manual-task-notice p { margin-bottom: 10px; }
.manual-task-notice .link-button { margin-right: 14px; }
.source-version { margin-top: 16px; padding: 12px 14px; border-radius: 5px; background: var(--mist); color: var(--blue-soft); line-height: 1.55; }
.formula-table { border-top: 1px solid var(--line); }
.formula-head, .formula-row { display: grid; grid-template-columns: minmax(110px, 1.3fr) minmax(76px, .7fr) 88px 48px; gap: 8px; align-items: start; }
.formula-head { padding: 10px 4px; color: var(--blue-soft); }
.formula-row { padding: 8px 0; border-top: 1px solid var(--line); }
.formula-row:first-of-type { border-top: 0; }
.formula-row input, .formula-row select { min-height: 42px; padding: 7px 9px; }
.formula-row button { align-self: center; }
.formula-row small { grid-column: 1 / -1; color: var(--danger); }
.formula-row--error { margin: 0 -8px; padding: 8px; background: var(--danger-soft); }
.check-line { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-weight: 400; }
.check-line input { width: 20px; height: 20px; min-height: 0; }
.optional-block { margin: 8px 0 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.optional-block summary { color: var(--blue); cursor: pointer; }
.optional-block input { margin-bottom: 8px; }
.actual-field { margin: 20px 0 0; padding: 0; border: 0; }
.actual-field legend { margin-bottom: 10px; font-weight: 600; }
.compact-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.compact-choice { min-height: 44px; padding: 8px 10px; border: 1px solid #b8c9d6; border-radius: 6px; background: white; color: var(--blue); text-align: center; }
.compact-choice--active { border-color: var(--green); background: var(--mist); box-shadow: inset 3px 0 var(--green); }
.actual-field label { margin-top: 14px; }
.validation-note { margin: 18px 0 10px; color: var(--danger); }
.button-note { margin: 10px 0 0; text-align: center; color: var(--blue-soft); font-size: 13px; }
.status-box { display: grid; gap: 5px; margin: 20px 0 12px; padding: 16px; border: 1px solid #c6d6d1; border-radius: 7px; background: var(--mist); }
.status-box strong { font-size: 18px; }
.status-box span { color: var(--blue-soft); line-height: 1.5; }
.status-box button { margin-top: 8px; }
.status-box--error { border-color: #e4beb5; background: var(--danger-soft); }
.ai-followup-box { margin-top: 20px; padding: 18px; border: 1px solid #c6d6d1; border-radius: 7px; background: var(--mist); }
.ai-followup-box > small { color: var(--blue-soft); }
.ai-followup-box h3 { margin: 6px 0 14px; font-size: 20px; line-height: 1.5; }
.ai-followup-box > p, .ai-followup-box > span { display: block; color: var(--blue-soft); line-height: 1.6; }
.ai-followup-box > p { margin: 12px 0; }
.ai-followup-box > span { margin-top: 9px; text-align: center; font-size: 13px; }
.ai-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-choice { min-height: 46px; padding: 9px 11px; border: 1px solid #b8c9d6; border-radius: 6px; background: white; color: var(--blue); }
.ai-choice--active { border-color: var(--green); background: #f4f7f4; box-shadow: inset 3px 0 var(--green); }

.demo-controls { width: min(620px, 100%); margin: 24px auto 0; padding: 12px 16px; border: 1px dashed #afbab5; border-radius: 7px; color: var(--blue-soft); }
.demo-controls summary { cursor: pointer; }
.demo-controls > div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; margin-top: 10px; }
.demo-controls label { margin: 0; }

.material-review-card { width: min(860px, 100%); margin: 0 auto; }
.material-review-item { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; }
.review-item-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.review-item-head > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: white; }
.review-item-head small { color: var(--blue-soft); }
.review-item-head h2 { margin: 2px 0 0; font-size: 22px; }
.material-review-item fieldset { padding: 0; border: 0; }
.material-review-item legend { margin-bottom: 9px; font-weight: 600; }
.review-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.review-choice-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.review-choice { position: relative; display: block; margin: 0; }
.review-choice input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.review-choice span { min-height: 46px; display: grid; place-items: center; padding: 8px 10px; border: 1px solid #b8c9d6; border-radius: 6px; background: white; color: var(--blue); text-align: center; cursor: pointer; }
.review-choice--active span { border-color: var(--green); background: var(--mist); box-shadow: inset 3px 0 var(--green); }
.followup-field { margin-top: 16px; padding-top: 16px !important; border-top: 1px solid var(--line) !important; }
.evidence-note, .evidence-warning { margin: 14px 0 0; padding: 13px 14px; border-radius: 6px; color: var(--blue-soft); background: var(--mist-2); line-height: 1.65; }
.evidence-warning { color: #76543f; background: #fff3e7; }
.evidence-warning p { margin-bottom: 10px; }

.stale-banner { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; align-items: center; margin-bottom: 18px; padding: 17px 20px; border: 1px solid #dfbd87; border-radius: 8px; background: #fff6e8; }
.stale-banner strong { font-size: 19px; }
.stale-banner span { color: #7f6847; }
.stale-banner button { grid-column: 2; grid-row: 1 / span 2; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 22px; align-items: start; }
.result-card { padding: 0; overflow: hidden; }
.result-reading { padding: 28px; }
.result-title-row { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.result-title-row small { color: var(--blue-soft); }
.result-title-row h1 { margin: 0 0 7px; font-size: 34px; }
.result-lead { padding: 14px 16px; border-radius: 5px; background: var(--mist); color: var(--blue); line-height: 1.7; }
.result-lead--compact { margin: 18px 0 0; padding: 12px 14px; background: var(--mist-2); }
.result-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 17px; }
.result-table th, .result-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.result-table th { background: var(--mist); color: #455b55; font-weight: 500; }
.result-table th:last-child, .result-table td:last-child { text-align: right; }
.result-table .total td { background: #eef3f0; }
.composition-card, .change-card, .comparison-card { margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; }
.composition-card h2, .change-card h2, .comparison-card h2 { margin: 0 0 10px; font-size: 22px; }
.result-table--plain { margin: 0; }
.result-table--plain td { background: transparent; }
.forming-title { margin-top: 16px !important; padding-top: 18px; border-top: 1px solid var(--line); }
.result-total { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 13px 14px; background: var(--mist); font-size: 18px; }
.result-details { margin-top: 22px; border-bottom: 1px solid var(--line); }
.result-details summary { display: flex; justify-content: space-between; gap: 16px; padding: 15px 4px; color: var(--blue); cursor: pointer; list-style: none; }
.result-details summary::-webkit-details-marker { display: none; }
.result-details summary b { font-weight: 400; }
.result-details p { padding: 0 4px 18px; color: var(--blue-soft); line-height: 1.75; }
.reason-block, .try-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.reason-block h2, .try-block h2, .action-panel h2, .result-reading > section h2 { margin-bottom: 10px; font-size: 21px; }
.reason-block p, .try-block p { margin: 0; color: #496278; line-height: 1.8; }
.judgment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.judgment-grid article { min-height: 116px; padding: 16px; border-right: 1px solid #ced9d4; background: var(--mist); }
.judgment-grid article:last-child { border-right: 0; }
.judgment-grid small, .judgment-grid strong, .judgment-grid span { display: block; }
.judgment-grid small { margin-bottom: 7px; color: var(--blue-soft); }
.judgment-grid strong { margin-bottom: 9px; color: var(--green-dark); font-size: 18px; }
.judgment-grid span { color: var(--blue-soft); line-height: 1.55; }
.change-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.change-grid article { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; }
.change-grid i { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: white; font-style: normal; }
.change-grid strong, .change-grid span, .change-grid small { display: block; }
.change-grid strong { margin-bottom: 8px; font-size: 18px; }
.change-grid span { margin-bottom: 7px; color: var(--blue); }
.change-grid small { color: var(--blue-soft); line-height: 1.5; }
.comparison-card > small { display: block; margin-top: -4px; color: var(--blue-soft); }
.primary-formula-card { margin-top: 0; border-color: #b9cbc4; background: #fbfcfa; box-shadow: inset 4px 0 var(--green); }
.primary-formula-card h2 { color: var(--green-dark); font-size: 24px; }
.primary-formula-card .result-table { margin-top: 6px; }
.primary-formula-card .result-table td:first-child { font-size: 18px; }
.primary-formula-card .result-table td:last-child strong { color: var(--green-dark); font-size: 19px; }
.sample-note, .sample-pending p { margin: 12px 0 0; color: var(--blue-soft); line-height: 1.7; }
.sample-note-details { margin-top: 8px; }
.sample-note-details summary { padding-block: 11px; }
.quick-adjust-card { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 7px; background: #fffdfa; }
.quick-adjust-card h2 { margin: 0 0 12px; font-size: 21px; }
.quick-adjust-card ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.quick-adjust-card li { display: grid; grid-template-columns: 27px 1fr; gap: 11px; align-items: start; }
.quick-adjust-card i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: white; font-style: normal; }
.quick-adjust-card strong { padding-top: 2px; font-size: 17px; line-height: 1.6; }
.analysis-details { margin-top: 10px; }
.analysis-details-body { padding: 2px 4px 20px; }
.analysis-full-summary { margin: 0; padding: 14px 16px; border-radius: 5px; background: var(--mist-2); color: var(--blue-soft); line-height: 1.75; }
.analysis-details .judgment-grid { margin-bottom: 12px; }
.analysis-details .change-card { margin-top: 12px; }
.structure-note { margin-top: 14px; padding: 18px; border-top: 1px solid var(--line); }
.structure-note h2 { margin: 0 0 8px; font-size: 20px; }
.structure-note p { margin: 0; color: var(--blue-soft); line-height: 1.75; }
.verify-card { margin-top: 22px; padding: 18px 20px; border-radius: 7px; background: var(--mist-2); }
.verify-card h2 { margin: 0 0 10px; font-size: 21px; }
.verify-card ol { margin: 0; padding-left: 24px; color: #496278; line-height: 1.8; }
.source-protect { margin: 20px 0 0; padding: 13px 15px; background: var(--mist-2); color: var(--blue-soft); }
.action-panel { position: sticky; top: 18px; padding: 24px; }
.action-panel p { color: var(--blue-soft); line-height: 1.75; }
.action-panel > button, .action-panel > .save-status { margin-top: 11px; }
.action-divider { height: 1px; margin: 18px 0; background: var(--line); }
.save-status { display: grid; gap: 7px; padding: 15px; border-radius: 6px; background: var(--mist); }
.save-status span { color: var(--blue-soft); line-height: 1.5; }
.save-status--ok { background: var(--ok-soft); }
.save-status--error { background: var(--danger-soft); }
.mobile-result-actions, .mobile-feedback-callout { margin-top: 20px; }
.mobile-result-actions > * + * { margin-top: 10px; }
.mobile-feedback-callout { padding: 18px; border: 1px solid var(--line); border-radius: 8px; }
.mobile-feedback-callout p { color: var(--blue-soft); line-height: 1.7; }

.feedback-card { width: min(760px, 100%); margin: 0 auto; }
.feedback-card > .link-button { margin-bottom: 24px; }
.current-version-details { margin: 0 0 20px; border-block: 1px solid var(--line); }
.current-version-details summary { display: flex; justify-content: space-between; gap: 16px; padding: 14px 2px; color: var(--blue); cursor: pointer; list-style: none; }
.current-version-details summary::-webkit-details-marker { display: none; }
.current-version-details summary b { color: var(--blue-soft); font-weight: 400; }
.current-version-details .result-table { margin: 0 0 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice { min-height: 52px; padding: 10px 14px; text-align: left; border: 1px solid #b8c9d6; border-radius: 6px; background: white; }
.choice--active { border-color: var(--green); background: var(--mist); box-shadow: inset 4px 0 var(--green); }
.process-boundary { margin-top: 24px; padding: 18px; border-radius: 7px; background: var(--mist-2); }
.process-boundary p { color: var(--blue-soft); line-height: 1.7; }
.refinement-result-card { width: min(860px, 100%); }
.refinement-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 14px; }
.refinement-actions button { min-height: 50px; }
.refinement-text-action { display: block; margin: 16px auto 0; }
.version-changes { margin-top: 14px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 7px; background: #fffdfa; }
.version-changes h2 { margin: 0 0 10px; font-size: 20px; }
.version-changes > div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-top: 1px solid var(--line); }
.version-changes > div:first-of-type { border-top: 0; }
.version-changes b { color: var(--green-dark); font-weight: 600; }
.refinement-secondary-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.previous-version-details .result-table { margin: 0 0 14px; }
.formula-comparison-details { margin-top: 10px; }
.formula-comparison-details .comparison-note { margin: 0; padding: 0 4px 10px; }
.formula-comparison-details .result-table { margin: 0 0 16px; }
.formula-comparison-table th:nth-child(2), .formula-comparison-table td:nth-child(2),
.formula-comparison-table th:nth-child(3), .formula-comparison-table td:nth-child(3) { text-align: right; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17, 27, 24, .48); }
.modal { width: min(640px, 100%); max-height: min(780px, calc(100vh - 40px)); overflow: auto; padding: 24px; border: 1px solid #c9d2ce; border-radius: 11px; background: var(--paper-strong); box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.modal--notice { width: min(490px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-head small { color: var(--blue-soft); }
.modal-head h2 { margin: 5px 0 0; font-size: 25px; }
.modal-head > button { min-width: 38px; min-height: 38px; border: 0; background: transparent; color: var(--blue); font-size: 28px; }
.modal > p { color: var(--blue-soft); line-height: 1.7; }
.library-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
.library-item { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.library-item input { width: 20px; height: 20px; min-height: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.saved-formula { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; margin-top: 20px; padding: 18px; text-align: left; border: 1px solid #aac0c8; border-radius: 7px; background: white; }
.saved-formula strong { font-size: 19px; }
.saved-formula span { grid-column: 1; color: var(--blue-soft); }
.saved-formula b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--blue); }
.modal-note { font-size: 14px; }

@media (max-width: 820px) {
  .page-shell { width: min(calc(100% - 28px), 720px); padding-top: 20px; }
  .approved-art--entry { height: min(52vw, 230px); }
  .approved-art--header { height: min(11.2vw, 50px); }
  .task-grid, .work-grid, .result-grid { grid-template-columns: 1fr; }
  .condition-card, .action-panel { position: static; }
  .judgment-grid { grid-template-columns: 1fr; }
  .judgment-grid article { min-height: auto; border-right: 0; border-bottom: 1px solid #ced9d4; }
  .judgment-grid article:last-child { border-bottom: 0; }
  .change-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .approved-art--entry { height: min(52vw, 230px); }
  .approved-art--header { height: min(11.2vw, 50px); }
  .page-shell { width: calc(100% - 24px); padding-bottom: 42px; }
  .page-shell--entry { padding-top: 22px; }
  .entry-panel { padding: 22px 16px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,253,248,.96); }
  .entry-intro { text-align: left; }
  .entry-intro h1 { font-size: 31px; }
  .entry-intro p { font-size: 16px; }
  .task-grid { gap: 12px; }
  .task-card { min-height: 142px; grid-template-columns: 1fr auto; padding: 20px; gap: 11px 14px; box-shadow: none; }
  .task-no { display: none; }
  .task-copy strong { font-size: 24px; }
  .task-copy small { font-size: 15px; }
  .task-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 16px; }
  .source-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .inline-editor[open] { grid-column: 1 / -1; }
  .continue-row { align-items: flex-end; padding: 15px; }
  .site-footer { min-height: 135px; padding: 0; background-image: url('./art/entry-mobile.png'); background-position: center 95%; }
  .site-footer .prototype-notice { top: 45%; width: 60%; font-size: 11px; padding-block: 14px; }
  .work-topbar { margin-bottom: 18px; }
  .work-topbar strong { font-size: 24px; }
  .card { padding: 19px 17px; }
  .section-heading { gap: 11px; }
  .step { width: 38px; height: 38px; flex-basis: 38px; font-size: 22px; }
  .section-heading h1, .section-heading h2 { font-size: 22px; }
  .formula-head, .formula-row { grid-template-columns: minmax(90px, 1.2fr) 70px 78px 42px; gap: 6px; }
  .formula-head { font-size: 14px; }
  .formula-row input, .formula-row select { font-size: 15px; padding: 6px; }
  .result-reading { padding: 20px 17px; }
  .result-title-row { display: grid; }
  .result-title-row h1 { font-size: 27px; }
  .composition-card, .change-card, .comparison-card { padding: 18px 14px; }
  .primary-formula-card { padding-block: 15px; }
  .primary-formula-card h2 { font-size: 21px; }
  .primary-formula-card .result-table th, .primary-formula-card .result-table td { padding-block: 9px; }
  .result-table { font-size: 15px; }
  .result-table th, .result-table td { padding: 11px 8px; }
  .mobile-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
  .mobile-result-actions > * + * { margin-top: 0; }
  .result-lead--compact { margin-top: 12px; line-height: 1.6; }
  .quick-adjust-card { margin-top: 12px; padding: 15px 14px; }
  .quick-adjust-card h2 { margin-bottom: 9px; font-size: 19px; }
  .quick-adjust-card strong { font-size: 16px; line-height: 1.5; }
  .verify-card { margin-top: 12px; padding: 15px 14px; }
  .verify-card h2 { font-size: 19px; }
  .stale-banner { grid-template-columns: 1fr; }
  .stale-banner button { grid-column: 1; grid-row: auto; width: 100%; margin-top: 8px; }
  .choice-grid { grid-template-columns: 1fr; }
  .refinement-actions { grid-template-columns: 1fr 1fr; }
  .version-changes { padding: 15px 14px; }
  .compact-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-choice-grid, .review-choice-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-grid { grid-template-columns: 1fr; }
  .modal { padding: 19px; }
}

@media (max-width: 390px) {
  .approved-art--entry { height: 52vw; }
  .approved-art--header { height: 11.2vw; }
  .page-shell { width: calc(100% - 18px); }
  .task-card { padding: 17px 15px; }
  .task-copy strong { font-size: 22px; }
  .formula-head, .formula-row { grid-template-columns: minmax(80px, 1fr) 62px 72px 38px; gap: 4px; }
  .formula-row input, .formula-row select { padding: 5px; font-size: 14px; }
  .card { padding-inline: 14px; }
}
