:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#243247;background:#f4f7fb;--bg:#f4f7fb;--card:#fff;--input:#fff;--text:#243247;--muted:#67768a;--border:#dce4ee;--soft:#f0f4f9;--blue:#2255cb;--pink:#d00060;--accent:#315fbd;--selected:#e8f0ff;--notice:#eaf2ff;--error:#a71e3b;--error-bg:#fff0f2;--shadow:0 3px 18px #1b365608;color-scheme:light}
:root[data-theme=dark]{color-scheme:dark;--bg:#141b27;--card:#202a39;--input:#182231;--text:#e7edf6;--muted:#a8b5c9;--border:#354459;--soft:#263346;--blue:#8db8ff;--pink:#ff77aa;--accent:#8db8ff;--selected:#304869;--notice:#223a56;--error:#ffb3c4;--error-bg:#482b38;--shadow:0 3px 18px #00000010;background:var(--bg);color:var(--text)}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.5}a{color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--accent);outline-offset:3px}input,textarea{min-width:0;width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:8px;background:var(--input);color:var(--text);font-size:16px;line-height:1.3;transition:border-color .15s}input::placeholder,textarea::placeholder{color:var(--muted);opacity:.75}input:focus,textarea:focus{border-color:var(--accent)}input[aria-invalid=true]{border-color:var(--error);background:var(--error-bg)}input[type=checkbox],input[type=radio]{accent-color:var(--accent);width:19px;height:19px;flex-shrink:0}label{font-size:13px;font-weight:600;line-height:1.5;display:block}label>input{display:block;margin-top:6px}fieldset{border:0;margin:0;padding:0;min-width:0}legend{font-size:12px;color:var(--muted);margin-bottom:7px}h1,h2,h3,p{margin:0}h2{font-size:16px;letter-spacing:-.3px;font-weight:650}h3{font-size:16px;font-weight:600}.app-header{height:88px;border-bottom:1px solid var(--border);padding:0 max(24px,calc((100vw - 1300px)/2));display:flex;align-items:center;justify-content:space-between;gap:20px;background:var(--card)}.brand{display:flex;align-items:center;gap:12px;text-decoration:none}.brand-icon{width:42px;height:42px;display:grid;place-items:center;background:#315fbd;border-radius:12px}.brand-icon svg{width:29px;height:29px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.brand strong{font-size:18px;font-weight:750;letter-spacing:-.6px}.brand-second{font-weight:450}.brand small{display:block;font-size:9px;letter-spacing:2.1px;color:var(--muted);margin-top:4px}.header-actions{display:flex;align-items:center;gap:20px}.status{font-size:11px;display:flex;align-items:center;gap:7px;color:var(--muted)}.status:before{content:"";width:6px;height:6px;border-radius:50%;background:#bd8a3a;flex-shrink:0}.status.ready:before{background:#3c9e80}.theme-switch{position:relative;isolation:isolate;display:flex;align-items:center;width:118px;border:1px solid var(--border);border-radius:22px;padding:4px;background:var(--soft);color:var(--muted);font-size:12px;height:36px}.theme-switch:before{position:absolute;z-index:-1;content:"";left:4px;top:4px;bottom:4px;width:calc(50% - 4px);border-radius:18px;background:#315fbd;transition:transform .18s}.theme-switch[aria-checked=true]:before{transform:translateX(100%)}.theme-switch span{width:50%}.theme-switch[aria-checked=false] span:first-child,.theme-switch[aria-checked=true] span:last-child{color:#fff}.mobile-nav,.mobile-only{display:none}main{max-width:1300px;margin:0 auto;padding:36px 24px 24px}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px;gap:16px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px;color:var(--accent);margin-bottom:9px}h1{font-size:32px;font-weight:650;letter-spacing:-1.2px;line-height:1.2}.page-heading p:last-child{color:var(--muted);font-size:14px;margin-top:10px}.workspace{display:grid;grid-template-columns:minmax(340px,450px) minmax(0,1fr);gap:24px;align-items:start}form,.results-column{min-width:0}.panel{padding:24px;background:var(--card);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);margin-bottom:18px;scroll-margin-top:18px}.section-heading{display:flex;align-items:center;gap:10px;margin-bottom:22px}.step{font-size:10px;font-weight:750;letter-spacing:.5px;border:1px solid var(--border);background:var(--soft);color:var(--muted);border-radius:6px;min-width:26px;height:26px;display:grid;place-items:center}.push-right{margin-left:auto}.small{font-size:11px}.muted{color:var(--muted)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 14px}.wide{grid-column:1/-1}.unit{color:var(--muted);font-size:11px;font-weight:400;white-space:nowrap;margin-left:4px}.option-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:22px 0}.segmented{display:flex;padding:3px;border-radius:8px;background:var(--soft);gap:3px}.segmented label{flex:1;position:relative;font-weight:500}.segmented input{position:absolute;width:1px;height:1px;opacity:0}.segmented span{display:block;text-align:center;padding:7px 10px;font-size:12px;color:var(--muted);border-radius:6px}.segmented input:checked+span{background:var(--card);color:var(--text);box-shadow:0 1px 4px #14274712}.segmented input:focus-visible+span{outline:2px solid var(--accent);outline-offset:1px}.hint{font-size:11px;line-height:1.7;color:var(--muted);margin-top:14px}.button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:42px;padding:10px 16px;font-size:12px;font-weight:600;border-radius:8px;border:1px solid var(--border);text-decoration:none}.subtle{background:var(--card);color:var(--text)}.subtle:hover{background:var(--soft)}.primary{background:#315fbd;color:#fff;border-color:#315fbd}.primary:hover{background:#264f9f}.text-button{background:transparent;border:0;color:var(--accent);font-size:11px;font-weight:600;padding:8px 4px;min-height:34px;border-radius:4px;white-space:nowrap}.text-button:hover{background:var(--selected)}.row-labels,.group-row{display:grid;grid-template-columns:minmax(0,1fr) 95px 30px;gap:10px}.row-labels{font-size:11px;font-weight:600;color:var(--muted);margin-bottom:7px}.group-row{margin-bottom:10px}.group-row input{margin:0}.remove-group{border:0;background:transparent;color:var(--muted);font-size:21px;border-radius:6px}.remove-group:hover{color:var(--pink);background:var(--error-bg)}.design-actions{display:flex;align-items:center;gap:16px;margin-top:16px}.paste-label{margin-top:16px}.paste-label textarea{margin-top:8px;font-family:ui-monospace,monospace}.check-row{display:flex;align-items:center;gap:9px;font-weight:500;font-size:13px}.check-row input{margin:0}.approximation-panel .hint{margin:12px 0 16px}.planning{max-width:230px}.input-with-action{display:flex;margin-top:6px;gap:6px}.align-bottom{display:flex;align-items:end}.align-bottom .button{width:100%}.measured-label{margin-top:18px}.approx-preview{background:var(--notice);border-radius:9px;padding:15px;margin-top:16px;font-size:12px;line-height:1.8}.calculate-bar{display:flex;gap:10px;margin-top:20px}.calculate-bar .primary{flex:1;justify-content:space-between;min-height:48px;font-size:13px}.calculate-bar>.subtle{padding:10px 20px}.empty-results{display:flex;flex-direction:column;align-items:center;text-align:center;justify-content:center;min-height:450px;padding:50px 0}.empty-results svg{width:64px;height:64px;fill:none;stroke:var(--accent);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;margin-bottom:24px;opacity:.8}.empty-results h3{font-size:18px;letter-spacing:-.3px}.empty-results p{font-size:12px;line-height:1.8;color:var(--muted);margin-top:12px}.legend{display:flex;gap:24px;margin-top:34px;font-size:11px;color:var(--muted)}.legend span{display:flex;align-items:center;gap:7px}.legend i{width:6px;height:6px;border-radius:50%}.blue-dot{background:var(--blue)}.pink-dot{background:var(--pink)}.results-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:20px 0}.view-toggle button{border:0;background:transparent;color:var(--muted);border-radius:6px;font-size:11px;min-height:30px;padding:5px 12px}.view-toggle button[aria-pressed=true]{background:var(--card);color:var(--text);box-shadow:0 1px 4px #14274712}.result-summary{font-size:12px;color:var(--muted);line-height:1.8}.result-summary strong{color:var(--text);font-size:17px;display:block}.protocol-card{border:1px solid var(--border);border-radius:10px;margin-bottom:12px;overflow:hidden}.protocol-card-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 16px;border-bottom:1px solid var(--border);background:var(--soft)}.group-tag{font-size:11px;font-weight:700;color:var(--accent)}.target-value{font-size:12px;font-weight:600}.mix-volumes{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:18px 16px}.mix-volume small{display:block;font-size:10px;color:var(--muted);margin-bottom:6px}.mix-volume strong{font-size:27px;font-weight:650;letter-spacing:-.8px;font-variant-numeric:tabular-nums}.mix-volume .unit{font-size:12px}.suspension{color:var(--blue)}.medium{color:var(--pink)}.group-facts{padding:0 16px 15px;display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;font-size:11px}.group-facts div{display:flex;justify-content:space-between;gap:8px}.group-facts dt{color:var(--muted)}.group-facts dd{margin:0;font-weight:600;text-align:right}.card-instruction{padding:0 16px 16px;font-size:11px;color:var(--muted);line-height:1.7}.source-card{padding:16px;font-size:12px;line-height:1.8;background:var(--soft)}.source-card strong{color:var(--text)}.table-scroll{overflow:auto;max-width:100%;border:1px solid var(--border);border-radius:8px;margin-bottom:14px}table{border-collapse:collapse;min-width:100%;font-size:12px}th,td{padding:13px 14px;border-bottom:1px solid var(--border);border-right:1px solid var(--border);text-align:center;min-width:120px;white-space:nowrap;font-variant-numeric:tabular-nums}th{background:var(--soft);font-weight:600}tbody th{position:sticky;left:0;z-index:1;text-align:left;font-size:11px;min-width:148px;white-space:normal}tr:last-child>*{border-bottom:0}tr:nth-child(even) td{background:var(--soft)}.protocol-notes{background:var(--notice);border-radius:8px;padding:14px 16px;margin-top:16px;font-size:11px;line-height:1.8;color:var(--text)}.protocol-notes p+p{margin-top:10px}.export-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding-top:20px}.saved-icon{color:var(--muted);font-size:20px}.saved-empty{font-size:12px;color:var(--muted);padding:20px 0 4px}.saved-item{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--border);padding-top:14px;margin-top:14px}.saved-details{min-width:0}.saved-details strong{font-size:12px;display:block;overflow-wrap:anywhere}.saved-details small{font-size:10px;color:var(--muted);display:block;margin-top:5px}.saved-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:end}.saved-actions button{font-size:10px}.app-footer{font-size:10px;color:var(--muted);display:flex;justify-content:space-between;gap:12px;padding:0 4px 20px}.notice{background:var(--notice);border:1px solid var(--border);border-radius:9px;padding:13px 16px;margin-bottom:18px;font-size:12px;line-height:1.7}.notice.warning{background:var(--error-bg);color:var(--error)}.error-box{font-size:12px;line-height:1.6;background:var(--error-bg);color:var(--error);padding:14px;border:1px solid var(--error);border-radius:8px;margin-top:16px}.error-box:focus{outline:0}dialog{width:min(440px,calc(100% - 32px));border:1px solid var(--border);border-radius:14px;background:var(--card);color:var(--text);padding:24px;box-shadow:0 20px 80px #0005}dialog::backdrop{background:#10203488}dialog p{font-size:13px;line-height:1.8;margin:16px 0 22px}.dialog-actions{display:flex;justify-content:end;gap:10px}[hidden]{display:none!important}
@media(min-width:1100px){.protocol-panel{min-height:600px}}
@media(max-width:940px){.workspace{grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:16px}.panel{padding:19px}.section-heading{gap:8px}h2{font-size:14px}.section-heading .text-button{font-size:10px}.group-facts{grid-template-columns:1fr}.status{max-width:160px}.app-footer{flex-direction:column}.export-actions{gap:10px}.mix-volume strong{font-size:23px}}
@media(max-width:720px){.app-header{height:76px;padding:0 18px;gap:12px}.brand{gap:9px}.brand-icon{width:35px;height:35px;border-radius:10px}.brand-icon svg{width:25px;height:25px}.brand strong{font-size:16px}.brand-second{display:none}.brand small{font-size:8px;letter-spacing:1.1px}.header-actions{gap:10px}.status{position:absolute;top:85px;right:18px;font-size:10px;max-width:none}.theme-switch{width:108px;height:34px;font-size:11px}.mobile-nav{display:flex;border-bottom:1px solid var(--border);padding:0 18px;gap:26px;background:var(--card);height:40px;align-items:center}.mobile-nav a{text-decoration:none;font-size:11px;color:var(--muted)}main{padding:25px 14px 110px}.page-heading{margin-bottom:22px;align-items:start;padding:0 4px}.eyebrow{font-size:9px;letter-spacing:1.5px;margin-bottom:8px}h1{font-size:28px;letter-spacing:-1px;line-height:1.15}.mobile-only{display:block}.page-heading p:last-child{font-size:12px;max-width:230px;line-height:1.7;margin-top:9px}.page-heading>.button{font-size:10px;min-height:34px;padding:8px 10px;margin-top:19px}.workspace{display:block}.panel{padding:20px 18px;border-radius:12px;margin-bottom:14px;scroll-margin-top:12px}.section-heading{margin-bottom:20px}h2{font-size:15px}.section-heading .text-button{font-size:11px}.section-heading>.small{font-size:10px}.form-grid{gap:16px 12px}.row-labels,.group-row{grid-template-columns:minmax(0,1fr) 85px 28px;gap:9px}.calculate-bar{position:fixed;bottom:0;left:0;right:0;z-index:10;background:var(--card);border-top:1px solid var(--border);padding:12px 18px max(12px,env(safe-area-inset-bottom));margin:0;box-shadow:0 -5px 20px #152b3f08}.calculate-bar .primary{min-height:46px}.calculate-bar>.subtle{padding:10px 15px}.results-column{margin-top:26px}.empty-results{min-height:300px;padding:28px 0}.empty-results h3{font-size:16px}.empty-results p{font-size:12px}.mix-volume strong{font-size:29px}.group-facts{grid-template-columns:1fr 1fr;font-size:10px;gap:9px 12px}.export-actions{gap:12px}.app-footer{align-items:center;gap:7px;margin-top:20px;padding-bottom:0}.saved-actions{gap:4px}.saved-actions button{min-height:36px}.notice{font-size:11px}.results-toolbar .text-button{font-size:11px}}
@media print {
  /* Paper uses its own palette, without changing the selected screen theme. */
  :root, :root[data-theme=dark] {
    color-scheme:light;
    --bg:#fff; --card:#fff; --input:#fff; --text:#243247;
    --muted:#4b5563; --border:#cbd5e1; --soft:#f3f4f6;
    --blue:#2255cb; --pink:#d00060; --accent:#2255cb;
    --selected:#fff; --notice:#fff; --error:#a71e3b; --error-bg:#fff;
    --shadow:none;
    background:#fff; color:var(--text);
  }
  body { background:#fff; color:var(--text); }
  .app-header,.mobile-nav,.page-heading,#experimentForm,#saved,.app-footer,.results-toolbar,.export-actions,.notice,.calculate-bar { display:none!important; }
  main { padding:0; }
  .workspace { display:block; }
  .panel { background:#fff; border:0; box-shadow:none; padding:0; min-height:0; }
  .protocol-card { break-inside:avoid; }
  .protocol-notes { background:#fff; border:1px solid #ccc; }
  .protocol-card-header { background:#f3f3f3; }
  .table-scroll { overflow:visible; }
  .suspension { color:var(--blue); }
  .medium { color:var(--pink); }
}

.template-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.template-actions .button { min-height:34px; padding:6px 10px; }
.print-report { display:none; }
@media print {
  #resultContent > :not(.print-report), #protocolTitle, #resultCount { display:none !important; }
  .print-report { display:block; }
  .print-report h3 { margin:14px 0 6px; break-after:avoid; }
  .print-report dl { display:grid; grid-template-columns:1fr 1fr; gap:3px 14px; }
  .print-report dl div { display:flex; justify-content:space-between; gap:4px; break-inside:avoid; }
  .print-report dd { margin:0; text-align:right; }
  .print-report ol { padding-left:20px; }
}

.section-heading { margin-bottom: 17px; }
.section-heading h2 { font-size: 17px; letter-spacing: -.25px; }
.template-actions { gap: 8px; }
.template-actions .button { min-height: 42px; padding: 8px 13px; }
.template-toggle { background: var(--selected); border-color: var(--selected); color: var(--accent); }
.template-toggle:hover { border-color: var(--accent); }
.template-toggle[aria-expanded="true"] { border-color: var(--accent); }
.template-library {
  margin: -4px 0 17px;
  padding: 13px 14px 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--soft);
}
.library-header, .library-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.library-header { flex-wrap: wrap; }
.library-header h3 { font-size: 14px; margin: 0; }
.library-header label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.library-header select {
  min-height: 34px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--input); color: var(--text); padding-inline: 7px;
}
.template-list { list-style: none; margin: 7px 0 0; padding: 0; }
.template-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.template-info { display: grid; justify-items: start; gap: 1px; min-inline-size: 0; }
.template-info small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.template-name {
  border: 0; background: transparent; color: var(--accent); padding: 2px 0;
  min-height: 26px; max-width: 100%; text-align: start; font-weight: 650; overflow-wrap: anywhere;
}
.template-name:hover { text-decoration: underline; }
.template-options { position: relative; flex: none; }
.template-options summary { color: var(--muted); font-size: 11px; cursor: pointer; padding: 7px 0 7px 6px; }
.template-option-actions {
  position: absolute; z-index: 3; inset-inline-end: 0; margin-top: 4px; min-width: 122px;
  display: grid; padding: 4px; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow);
}
.template-option-actions button { text-align: start; padding-inline: 8px; }
.library-pagination { min-height: 46px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.pagination-controls, .library-tools { display: flex; gap: 6px; }
button.page-arrow { min-inline-size: 40px; min-height: 36px; padding: 0; font-size: 21px; line-height: 1; }
button.page-arrow:disabled { opacity: .42; cursor: default; }
.library-tools { flex-wrap: wrap; gap: 13px; }
.library-empty, .template-status { font-size: 12px; line-height: 1.5; color: var(--muted); }
.library-empty { margin: 12px 0; }
.template-status { margin: -5px 0 15px; }
.template-error { color: var(--error); }
.app-footer { display: flex; flex-direction: row; justify-content: end; gap: 15px; }
.release-link.text-button { min-height: 34px; white-space: normal; text-align: start; }

[data-tour-anchor] { anchor-name: --template-guide; }
[data-tour-target] { outline: 2px solid var(--accent); outline-offset: 3px; }
.template-guide {
  display: none;
  color: var(--text);
  background: var(--card);
  inline-size: min(21rem, calc(100% - 1.5rem));
  max-block-size: calc(100dvh - 1.5rem);
  padding: 14px 15px 11px;
  border: 1px solid var(--input-border); border-radius: 12px;
  box-shadow: 0 12px 28px #19294530;
  overflow: auto;
}
@supports (top: anchor(bottom)) {
  .template-guide:not([data-inline]) {
    position: fixed; inset: auto; margin: 0;
    position-anchor: --template-guide;
    bottom: calc(anchor(top) + .6rem);
    left: clamp(.75rem, anchor(left), max(.75rem, calc(100% - 21.75rem)));
    position-try-fallbacks: flip-block;
  }
}
.template-guide:popover-open { display: block; }
.template-guide[data-inline][open] { display: block; }
.template-guide[data-inline] {
  position: static; inline-size: 100%; max-block-size: none; margin: 0 0 14px;
}
.template-guide .guide-date { color: var(--accent); font-size: 11px; font-weight: 650; margin: 0 0 3px; }
.template-guide h2 { font-size: 17px; letter-spacing: -.2px; }
.template-guide h2:focus { outline: none; }
.template-guide #releaseInstructions { margin: 6px 0 10px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.guide-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.guide-actions .button { min-height: 36px; padding: 5px 12px; }
@media print { .template-guide { display: none !important; } }

.icon-button {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; border-radius: .5rem; inline-size: 2.25rem; block-size: 2.25rem;
  flex: none; padding: 0; font: 1.45rem/1 system-ui, sans-serif;
}
.icon-button:hover { color: var(--text); background: var(--soft); }
.guide-heading, .feedback-header { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.guide-heading .icon-button { margin: -.42rem -.45rem -.25rem 0; }
.guide-actions .text-button { white-space: normal; text-align: start; }
.guide-spotlight {
  display: none; position: fixed; inset: auto; margin: 0; padding: 0; pointer-events: none;
  top: calc(var(--spot-y, 0px) - 4px); left: calc(var(--spot-x, 0px) - 4px);
  inline-size: calc(var(--spot-width, 0px) + 8px); block-size: calc(var(--spot-height, 0px) + 8px);
  border: 2px solid var(--spot-ring, #94c1ff); border-radius: .75rem;
  background: transparent; box-shadow: 0 0 0 200vmax #0e193692;
  z-index: 40;
}
.guide-spotlight:popover-open { display: block; }
.guide-spotlight[data-visible] { display: block; }
.template-guide[data-inline] { position: relative; z-index: 41; float: none; }
.template-guide h2 { color: var(--text); }
.template-guide .guide-actions { margin-top: .4rem; }

.feedback-dialog {
  width: min(32rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem);
  padding: clamp(1rem, .85rem + 1vw, 1.5rem);
}
.feedback-dialog::backdrop { background: #0e1936a6; }
.feedback-dialog h2 {
  margin: 0; font-family: inherit; font-size: clamp(1.4rem, 1.1rem + .8vw, 1.85rem);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -.025em;
}
.feedback-dialog label {
  display: block; margin: .8rem 0 .4rem; font-weight: 650; color: var(--text); font-size: .85rem;
}
.feedback-dialog textarea {
  width: 100%; min-block-size: 8.25rem; margin: 0;
  resize: vertical; font: inherit; font-size: 1rem; line-height: 1.5;
}
.feedback-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: .5rem 1rem; margin-top: .7rem; }
.feedback-actions .feedback-status { color: var(--muted); font-size: .8rem; flex: 1 1 12rem; margin: 0; }
.feedback-status:empty { flex-basis: 0; }
.feedback-actions .feedback-error { color: var(--error); }
.feedback-actions button:disabled { opacity: .65; cursor: wait; }

@media screen {
  :root {
    --brand: #315fbd; --brand-hover: #264f9f; --hero: #e3edfc;
    --spot-ring: #8fbdff;
    --shadow: 0 .55rem 1.5rem #2039630a;
  }
  :root[data-theme=dark] {
    --brand: #315fbd; --brand-hover: #264f9f; --hero: #243c59;
    --spot-ring: #a7ceff;
    --shadow: 0 .55rem 1.5rem #07142332;
  }

  body { background: var(--bg); }
  .app-header { background: var(--card); color: var(--text); border-color: var(--border); }
  .brand-icon, .theme-switch::before { background: var(--brand); }
  .mobile-nav { background: var(--card); border-color: var(--border); }
  .primary { background: var(--brand); border-color: var(--brand); }
  .primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
  .button, .text-button { font-weight: 650; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  ::selection { background: var(--selected); color: var(--text); }

  .page-heading {
    position: relative; isolation: isolate;
    padding: clamp(1rem, .65rem + 2vw, 2.15rem);
    border: 1px solid var(--border); border-inline-start: .25rem solid var(--accent);
    border-radius: .65rem 1.25rem 1.25rem .65rem;
    background: linear-gradient(112deg, var(--card) 28%, var(--hero));
    overflow: hidden;
  }
  .page-heading::before {
    content: ''; position: absolute; z-index: -1; inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 20px, currentColor 20px 21px),
                repeating-linear-gradient(0deg, transparent 0 20px, currentColor 20px 21px);
    opacity: .07;
    mask-image: linear-gradient(90deg, transparent 55%, black);
    pointer-events: none;
  }
  .page-heading h1 {
    font-family: inherit;
    font-size: clamp(1.95rem, 1.42rem + 2.25vw, 3.45rem);
    line-height: 1.08; letter-spacing: -.035em; text-wrap: balance;
  }
  .page-heading p:last-child { max-inline-size: 48ch; line-height: 1.5; }
  .page-heading > .button { align-self: center; margin: 0; flex: none; }
  .panel { border-radius: .95rem; }
  .section-heading { align-items: baseline; }
  .section-heading h2 { font-size: clamp(1.06rem, 1rem + .33vw, 1.38rem); }
  .protocol-panel { container-type: inline-size; }
  .protocol-card { border-radius: .85rem; }
  .protocol-card-header { background: var(--soft); }
  .mix-volume { border-radius: .6rem; padding: .65rem .75rem; min-inline-size: 0; }
  .mix-volume:has(.medium) { background: color-mix(in oklab, var(--card) 92%, var(--pink)); }
  .mix-volume:has(.suspension) { background: color-mix(in oklab, var(--card) 92%, var(--blue)); }
  .mix-volume small { font-size: .72rem; }
  .group-facts, .card-instruction { font-size: .77rem; }
  .mix-volume strong { font-size: clamp(1.2rem, .88rem + 1.6vw, 1.85rem); overflow-wrap: anywhere; }
  .feedback-header { border-bottom: 1px solid var(--border); padding: .12rem 0 .6rem; }
  .template-guide .guide-date { font-variant-numeric: tabular-nums; }
  @container (max-width: 19rem) {
    .mix-volumes { padding-inline: .65rem; gap: .45rem; }
    .mix-volume { padding-inline: .55rem; }
    .group-facts { grid-template-columns: 1fr; }
  }
  @media (max-width: 365px) {
    .page-heading { flex-wrap: wrap; gap: .75rem; }
    .feedback-actions .button { inline-size: 100%; }
  }
  @media (prefers-reduced-motion: reduce) { .theme-switch::before { transition: none; } }
  @media (forced-colors: active) {
    .guide-spotlight { border-color: Highlight; }
    .guide-actions button, .template-toggle, .feedback-actions button { border: 1px solid ButtonText; }
  }
}
@media print { .feedback-dialog, .guide-spotlight { display: none !important; } }

:root {
  --motion-time: 440ms;
  --motion-ease: cubic-bezier(.22, .7, .22, 1);
}

.motion-expand {
  display: grid;
  grid-template-rows: 0fr;
  overflow: clip;
  opacity: 0;
  visibility: hidden;
}

.motion-expand[data-expanded="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
}

.motion-expand-body { display: flow-root; min-block-size: 0; }
.motion-expand .template-library { margin-block-start: 0; }

.motion-stage { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.motion-stage > * { grid-area: 1 / 1; min-inline-size: 0; }

@media screen and (prefers-reduced-motion: no-preference) {
  .motion-expand {
    transition: grid-template-rows var(--motion-time) var(--motion-ease),
                opacity var(--motion-time) var(--motion-ease), visibility 0s linear var(--motion-time);
  }
  .motion-expand[data-expanded="true"] { transition-delay: 0s; }
  @supports (interpolate-size: allow-keywords) {
    .motion-expand {
      display: block;
      block-size: 0;
      interpolate-size: allow-keywords;
      transition-property: block-size, opacity, visibility;
    }
    .motion-expand[data-expanded="true"] { block-size: auto; }
  }

  .motion-reveal, .motion-layer {
    transition: opacity var(--motion-time) var(--motion-ease),
                translate var(--motion-time) var(--motion-ease),
                display var(--motion-time);
    transition-behavior: allow-discrete;
  }
  .motion-layer { transition-property: opacity, translate, display, overlay; }
  .guide-spotlight {
    opacity: 0;
    transition: opacity var(--motion-time) var(--motion-ease),
                display var(--motion-time), overlay var(--motion-time);
    transition-behavior: allow-discrete;
  }

  .motion-reveal { opacity: 1; translate: 0 0; }
  .motion-reveal[hidden] { opacity: 0; translate: 0 .4rem; pointer-events: none; }
  .motion-layer { opacity: 0; translate: 0 .55rem; pointer-events: none; }
  .motion-layer:is([open], :popover-open):not([data-closing]) {
    opacity: 1;
    translate: 0 0;
    pointer-events: auto;
  }
  .guide-spotlight:is([data-visible], :popover-open):not([data-closing]) { opacity: 1; }

  dialog.motion-layer::backdrop {
    background-color: transparent;
    transition: background-color var(--motion-time) var(--motion-ease),
                display var(--motion-time), overlay var(--motion-time);
    transition-behavior: allow-discrete;
  }
  dialog.motion-layer[open]:not([data-closing])::backdrop { background-color: #0e1936a6; }

  @starting-style {
    .motion-reveal:not([hidden]) { opacity: 0; translate: 0 .4rem; }
    .motion-layer:is([open], :popover-open):not([data-closing]) { opacity: 0; translate: 0 .55rem; }
    .guide-spotlight:is([data-visible], :popover-open):not([data-closing]) { opacity: 0; }
    dialog.motion-layer[open]:not([data-closing])::backdrop { background-color: transparent; }
  }

  .template-option-actions { animation: show-template-options var(--motion-time) var(--motion-ease) both; }
  @keyframes show-template-options {
    from { opacity: 0; translate: 0 -.25rem; }
    to { opacity: 1; translate: 0 0; }
  }
  @supports selector(details::details-content) {
    .template-options::details-content {
      content-visibility: hidden;
      transition: content-visibility var(--motion-time);
      transition-behavior: allow-discrete;
    }
    .template-options[open]::details-content { content-visibility: visible; }
    .template-options .template-option-actions {
      opacity: 0; translate: 0 -.25rem; animation: none;
      transition: opacity var(--motion-time) var(--motion-ease),
                  translate var(--motion-time) var(--motion-ease);
    }
    .template-options[open] .template-option-actions { opacity: 1; translate: 0 0; }
  }

  .theme-switch::before { transition-duration: var(--motion-time); transition-timing-function: var(--motion-ease); }
  body, .app-header, .panel, .page-heading, .protocol-card {
    transition: background-color var(--motion-time) var(--motion-ease),
                border-color var(--motion-time) var(--motion-ease),
                color var(--motion-time) var(--motion-ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, *::backdrop { animation: none !important; transition: none !important; }
}

.setup-heading { justify-content: space-between; flex-wrap: wrap; gap: .25rem .65rem; }
.example-loader { padding-inline: .3rem; }
.mobile-nav { gap: .5rem; }
.mobile-nav a { padding: .43rem .65rem; border-radius: .5rem; }
.mobile-nav a:hover, .mobile-nav a[aria-current="location"] { background: var(--selected); color: var(--accent); }
.segmented label:has(input:not(:checked)):hover > span,
.view-toggle button[aria-pressed="false"]:hover { background: var(--selected); color: var(--text); }

@media screen and (prefers-reduced-motion: no-preference) {
  :root { scroll-behavior: smooth; }
  :is(button, a[href], summary, .segmented label > span) {
    transition: background-color var(--motion-time) var(--motion-ease),
                border-color var(--motion-time) var(--motion-ease),
                color var(--motion-time) var(--motion-ease),
                box-shadow var(--motion-time) var(--motion-ease);
  }
}
.minimum-notice {
  margin: 0; color: var(--text);
  font-size: .8rem; line-height: 1.55; font-weight: 700;
}
.minimum-notice.minimum-invalid {
  padding: .7rem .8rem;
  border: 1px solid var(--error); border-inline-start-width: 3px;
  border-radius: .5rem; color: var(--error); background: var(--error-bg);
}
.safety-warning {
  margin-block: .8rem; padding: .75rem .9rem;
  border: 1px solid var(--error); border-inline-start-width: 4px;
  border-radius: .6rem; background: var(--error-bg); color: var(--error);
  font-size: .85rem; line-height: 1.5; font-weight: 650;
}
.safety-warning p { margin: 0; }
.safety-warning p + p { margin-top: .5rem; }
.economy-buffer-note {
  margin: .65rem 0 0; font-size: .78rem; line-height: 1.5;
  color: var(--error); border-inline-start: 3px solid var(--error); padding-inline-start: .65rem;
}
.warning-dialog { border-top: 4px solid var(--error); }
.warning-dialog h2 { color: var(--error); }
.warning-dialog #warningDetails { margin-block: .8rem; }
.warning-dialog #warningDetails p { font-size: .9rem; line-height: 1.55; margin-block: .6rem; }
.warning-dialog > button { float: inline-end; }
.negative-leftover, .protocol-notes.warning {
  color: var(--error); background: var(--error-bg); font-weight: 700;
}
.email-dialog { width: min(31rem,calc(100% - 1.5rem)); }
.email-formats { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-block: 1rem; }
.email-formats legend { font-size: .85rem; font-weight: 650; margin-bottom: .7rem; }
.email-formats label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.email-formats input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.email-dialog .dialog-actions { flex-wrap: wrap; margin-top: 1rem; }
.email-dialog #emailStatus { font-size: .85rem; line-height: 1.5; margin-block: 1rem; }
.email-dialog button:disabled { opacity: .5; cursor: wait; }
@media print { .email-dialog { display: none !important; } }
