:root {
  color-scheme: light;
  --ink: #171817;
  --ink-2: #232522;
  --ink-3: #30332f;
  --paper: #f4f5f2;
  --panel: #ffffff;
  --line: #dfe1dc;
  --line-dark: #3a3d38;
  --muted: #777c75;
  --accent: #b8f34a;
  --accent-dark: #597e12;
  --danger: #df6a54;
  --blue: #5f95ad;
  --radius: 6px;
  --header: 62px;
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; height: 100%; background: var(--paper); color: var(--ink); }

body { overflow: hidden; }

button, input { font: inherit; }
button { color: inherit; }

.topbar {
  height: var(--header);
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  background: var(--ink);
  color: white;
  border-bottom: 1px solid #2f312f;
}

.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 720; }
.brand small { color: #8e938c; font-size: 11px; font-weight: 500; padding-left: 9px; border-left: 1px solid #3b3e3a; }
.brand-mark { width: 22px; height: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.brand-mark i { display: block; background: var(--accent); }
.brand-mark i:nth-child(2) { background: #f0a050; }
.brand-mark i:nth-child(3) { background: #6a97a8; }
.brand-mark i:nth-child(4) { background: #e8e9e6; }

.engine-status { color: #aeb2ac; font-size: 11px; letter-spacing: 0; display: flex; align-items: center; gap: 7px; }
.engine-status span { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px rgba(184,243,74,.12); }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.button, .icon-button, .text-button, .segmented button, .tabs button {
  border: 0;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease;
}
.button { min-height: 36px; padding: 0 14px; border-radius: 5px; font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button:disabled, .icon-button:disabled { cursor: not-allowed; opacity: .4; }
.button-primary { background: var(--accent); color: #141512; }
.button-primary:hover { background: #c7ff5a; }
.button-ghost { background: transparent; color: #d8dbd5; border: 1px solid #454842; }
.button-ghost:hover { border-color: #6c7168; background: #262825; }
.button-light { background: white; color: var(--ink); }
.button-dark { width: 100%; background: var(--ink); color: white; }
.button-dark:hover { background: #2a2c29; }
.button-dark span { color: var(--accent); font-size: 17px; }
.button-secondary { width: 100%; background: #f0f2ed; color: #30332f; border: 1px solid #daddd6; }
.button-secondary:hover { background: #e7eae4; }
.icon-button { width: 34px; height: 34px; border-radius: 5px; display: inline-grid; place-items: center; background: #282a28; color: #dddeda; border: 1px solid #3b3e3a; font-size: 16px; }
.icon-button:hover { background: #333632; }
.icon-button.dark { background: transparent; border-color: #3c403a; }
.text-button { background: transparent; padding: 4px 0; color: #6c7169; font-size: 11px; }
.text-button:hover { color: var(--ink); }
.text-button.light { color: #aeb3ac; }
.text-button.light:hover { color: white; }

.app-shell {
  height: calc(100dvh - var(--header));
  display: grid;
  grid-template-columns: 278px minmax(420px, 1fr) 312px;
  grid-template-rows: minmax(0, 1fr) 126px;
}

.reference-panel, .controls-panel { background: var(--panel); min-height: 0; }
.reference-panel { grid-row: 1 / 3; padding: 20px 18px 14px; border-right: 1px solid var(--line); overflow-y: auto; }
.controls-panel { grid-column: 3; grid-row: 1 / 3; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.panel-heading > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-heading h1, .panel-heading h2 { margin: 0; font-size: 14px; line-height: 1; letter-spacing: 0; }
.step-index { font-family: "SFMono-Regular", Consolas, monospace; color: #9a9f97; font-size: 10px; }

.reference-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid #cfd2cc;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eaede7;
  cursor: pointer;
}
.reference-stage.dragover { border-color: var(--accent-dark); outline: 3px solid rgba(184,243,74,.22); }
.reference-stage img { width: 100%; height: 100%; object-fit: cover; display: none; }
.reference-stage.has-image img { display: block; }
.reference-stage.has-image .upload-empty { display: none; }
.upload-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #60655e; }
.upload-empty strong { font-size: 24px; font-weight: 300; }
.upload-empty b { font-size: 12px; }
.upload-empty small { font-size: 9px; color: #9b9f98; }
.image-badge { position: absolute; left: 8px; top: 8px; padding: 4px 6px; background: rgba(20,21,19,.76); color: white; font-size: 8px; font-weight: 700; letter-spacing: .08em; border-radius: 3px; opacity: 0; }
.has-image .image-badge { opacity: 1; }

.analysis-section { margin-top: 19px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-size: 11px; text-transform: uppercase; }
.section-title span { font-size: 9px; color: var(--muted); }
.section-title span.ready { color: var(--accent-dark); }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); height: 23px; overflow: hidden; border-radius: 4px; border: 1px solid #d6d8d3; background: #e8e9e6; }
.palette span { min-width: 0; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 12px 0 8px; border-top: 1px solid var(--line); }
.metrics-grid div { min-height: 42px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.metrics-grid div:nth-child(odd) { padding-right: 10px; border-right: 1px solid var(--line); }
.metrics-grid div:nth-child(even) { padding-left: 10px; }
.metrics-grid dt { font-size: 10px; color: var(--muted); }
.metrics-grid dd { margin: 0; font-size: 10px; font-family: "SFMono-Regular", Consolas, monospace; color: #31342f; }
.histogram-wrap { padding-top: 6px; }
.mini-label { display: flex; justify-content: space-between; font-size: 9px; color: #747a72; margin-bottom: 6px; }
.histogram-wrap canvas { width: 100%; height: 58px; background: #f5f6f3; border: 1px solid var(--line); border-radius: 4px; display: block; }
.privacy-note { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: #80857e; font-size: 9px; display: flex; align-items: center; gap: 7px; }
.privacy-note span { color: var(--accent-dark); }

.viewer-panel { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; background: var(--ink-2); display: flex; flex-direction: column; }
.viewer-toolbar { height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 17px; color: white; border-bottom: 1px solid var(--line-dark); }
.file-title { min-width: 0; display: flex; gap: 9px; align-items: baseline; }
.file-title span { font: 9px "SFMono-Regular", Consolas, monospace; color: #80857e; }
.file-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32vw; font-size: 11px; font-weight: 600; }
.viewer-actions { display: flex; gap: 6px; align-items: center; }
.segmented { display: flex; padding: 2px; background: #30332f; border: 1px solid #40433e; border-radius: 5px; margin-left: 4px; }
.segmented button { height: 27px; padding: 0 9px; border-radius: 3px; color: #92978f; background: transparent; font-size: 9px; }
.segmented button.active { color: #171817; background: #f1f2ef; }

.image-viewer { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #20221f; user-select: none; }
.image-viewer::before { content: ""; position: absolute; inset: 0; background-size: 24px 24px; background-image: linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px); }
.preview-image, .after-clip { position: absolute; inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); }
.preview-image { object-fit: contain; display: none; }
.after-clip { pointer-events: none; overflow: hidden; display: none; }
.after-clip .preview-image { inset: 0; width: 100%; height: 100%; }
.image-viewer.has-images .preview-image, .image-viewer.has-images .after-clip { display: block; }
.viewer-empty { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; color: #aeb2ac; }
.viewer-empty strong { font-size: 12px; font-weight: 600; }
.empty-frame { width: 48px; height: 48px; display: grid; place-items: center; border: 1px dashed #656a62; border-radius: 6px; color: var(--accent); font-size: 24px; font-weight: 200; }
.image-viewer.has-images .viewer-empty { display: none; }
.compare-label { position: absolute; z-index: 4; top: 31px; padding: 4px 6px; background: rgba(17,18,17,.72); border-radius: 3px; color: #dadcd8; font-size: 8px; display: none; }
.image-viewer.has-images .compare-label { display: block; }
.before-label { left: 31px; }
.after-label { right: 31px; }
.compare-divider { position: absolute; z-index: 5; left: 50%; top: 22px; bottom: 22px; width: 1px; background: rgba(255,255,255,.85); display: none; cursor: ew-resize; }
.image-viewer.has-images.compare .compare-divider { display: block; }
.compare-divider span { position: absolute; width: 36px; height: 36px; left: -18px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; border-radius: 50%; background: #f5f6f3; color: #2a2d29; border: 1px solid white; box-shadow: 0 2px 10px rgba(0,0,0,.22); font-size: 11px; }
.render-state { position: absolute; z-index: 7; left: 50%; bottom: 34px; transform: translateX(-50%); padding: 8px 10px; background: rgba(18,19,18,.86); color: white; border: 1px solid #41443f; border-radius: 4px; font-size: 9px; display: none; align-items: center; gap: 7px; }
.render-state.show { display: flex; }
.render-state span { width: 9px; height: 9px; border: 1px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.target-drop-overlay { position: absolute; z-index: 12; inset: 14px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: white; background: rgba(22,24,21,.92); border: 1px dashed var(--accent); border-radius: 6px; pointer-events: none; }
.target-drop-overlay span { font-size: 25px; color: var(--accent); font-weight: 300; }
.target-drop-overlay strong { font-size: 12px; }
.target-drop-overlay small { color: #aeb3ac; font-size: 9px; }
.viewer-panel.dragover .target-drop-overlay { display: flex; }
.filmstrip-panel.dragover { box-shadow: inset 0 0 0 1px var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.filmstrip-panel { grid-column: 2; grid-row: 2; min-width: 0; background: #292b28; border-top: 1px solid var(--line-dark); display: grid; grid-template-columns: 134px minmax(0, 1fr); padding: 12px 14px; gap: 12px; color: white; }
.filmstrip-heading { border-right: 1px solid #41443e; padding-right: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.filmstrip-heading > div { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.filmstrip-heading strong { font-size: 10px; }
.filmstrip-heading small { grid-column: 2; color: #858a82; font-size: 9px; }
.filmstrip { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; min-width: 0; padding-bottom: 3px; scrollbar-color: #51554e transparent; scrollbar-width: thin; }
.thumb { position: relative; flex: 0 0 108px; height: 86px; padding: 0; border: 2px solid transparent; border-radius: 5px; overflow: hidden; background: #171817; cursor: pointer; color: white; }
.thumb.active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: .88; }
.thumb:hover img { opacity: 1; }
.thumb .thumb-index { position: absolute; left: 5px; bottom: 4px; background: rgba(16,17,16,.72); padding: 2px 4px; border-radius: 2px; font: 8px "SFMono-Regular", Consolas, monospace; }
.thumb .thumb-remove { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; display: none; place-items: center; border: 0; border-radius: 3px; background: rgba(17,18,17,.76); color: white; cursor: pointer; }
.thumb:hover .thumb-remove { display: grid; }
.thumb .thumb-state { position: absolute; right: 5px; bottom: 5px; width: 6px; height: 6px; border-radius: 50%; background: #8b9088; box-shadow: 0 0 0 2px rgba(17,18,17,.55); }
.thumb.done .thumb-state { background: var(--accent); }
.thumb .thumb-custom { position: absolute; left: 5px; top: 5px; padding: 2px 4px; border-radius: 2px; background: rgba(17,18,17,.76); color: #dfe4d9; font-size: 7px; }

.control-heading { height: 57px; margin: 0; padding: 0 18px; border-bottom: 1px solid var(--line); flex: 0 0 57px; }
.match-status { font-size: 9px; color: #6e746b; display: flex; align-items: center; gap: 5px; }
.match-status i { width: 5px; height: 5px; background: var(--accent-dark); border-radius: 50%; }
.match-status.pending i { background: #d4974b; }
.tabs { height: 41px; flex: 0 0 41px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 18px; border-bottom: 1px solid var(--line); }
.tabs.tabs-four { grid-template-columns: repeat(4, 1fr); }
.tabs button { background: transparent; color: #8a8f87; font-size: 10px; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 650; }
.control-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }
.range-control { margin-bottom: 21px; }
.hero-control { padding: 11px 12px 13px; margin: -4px -2px 18px; background: #f1f3ee; border: 1px solid #e0e3dc; border-radius: 6px; }
.control-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.control-label label { font-size: 10px; font-weight: 590; }
.control-label output, .control-label .range-number { width: 43px; height: 24px; padding: 2px 3px; text-align: center; background: #eceee9; border: 1px solid #d9dcd5; border-radius: 3px; font: 9px "SFMono-Regular", Consolas, monospace; color: #4c514a; }
.control-label .range-number { outline: none; }
.control-label .range-number:hover { border-color: #aeb2ab; }
.control-label .range-number:focus { border-color: var(--ink); background: white; box-shadow: 0 0 0 2px rgba(23,24,23,.08); }
.hero-control .control-label output, .hero-control .control-label .range-number { background: white; }
.control-label label small { margin-left: 5px; color: var(--accent-dark); font-size: 7px; font-weight: 600; }
input[type="range"] { --value: 50%; display: block; appearance: none; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, var(--ink) 0 var(--value), #d7dad4 var(--value) 100%); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -5px; background: white; border: 2px solid var(--ink); border-radius: 50%; }
input[type="range"]::-moz-range-track { height: 3px; background: #d7dad4; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; background: white; border: 2px solid var(--ink); border-radius: 50%; }
.control-divider { height: 1px; background: var(--line); margin-bottom: 19px; }
.warm-track input::-webkit-slider-runnable-track { background: linear-gradient(to right, #7599ae, #dedfda 50%, #e1955f); }
.tint-track input::-webkit-slider-runnable-track { background: linear-gradient(to right, #7aa678, #dedfda 50%, #b9789b); }
.hue-track input::-webkit-slider-runnable-track { background: linear-gradient(to right, #cb5b59, #d5b64f, #63a66d, #4d9fad, #5978b4, #a25d9a, #cb5b59); }
.switch-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; gap: 3px; }
.switch-row b { font-size: 10px; font-weight: 600; }
.switch-row small { color: #8a8f87; font-size: 8px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 30px; height: 17px; border-radius: 9px; background: #c9ccc6; transition: background .18s ease; }
.switch-row i::after { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; border-radius: 50%; background: white; transition: transform .18s ease; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.switch-row input:checked + i { background: var(--ink); }
.switch-row input:checked + i::after { transform: translateX(13px); background: var(--accent); }
.curve-card { padding: 10px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 6px; background: #f5f6f3; }
.curve-card canvas { display: block; width: 100%; aspect-ratio: 1.55 / 1; background: #fafbf8; border: 1px solid #e1e3de; }
.hsl-channel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 2px 0 14px; }
.hsl-channel-grid button { height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 5px; background: #f5f6f3; border: 1px solid #dfe1dc; border-radius: 4px; color: #6f746d; cursor: pointer; font-size: 8px; }
.hsl-channel-grid button:hover { border-color: #aeb2ab; }
.hsl-channel-grid button.active { color: var(--ink); border-color: var(--ink); background: white; box-shadow: inset 0 -2px 0 var(--channel, var(--accent)); }
.hsl-channel-grid i { width: 9px; height: 9px; display: block; border-radius: 50%; background: var(--channel); }
.hsl-current { min-height: 34px; margin-bottom: 15px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; }
.hsl-current span { font-size: 10px; font-weight: 650; }
.hsl-current small { font-size: 8px; color: var(--muted); }
.hsl-analysis { display: grid; grid-template-columns: repeat(3, 1fr); margin: -5px 0 18px; border: 1px solid var(--line); border-radius: 4px; }
.hsl-analysis div { min-width: 0; padding: 7px 4px; text-align: center; }
.hsl-analysis div + div { border-left: 1px solid var(--line); }
.hsl-analysis dt { margin-bottom: 3px; color: var(--muted); font-size: 7px; }
.hsl-analysis dd { margin: 0; color: #3f443d; font: 8px "SFMono-Regular", Consolas, monospace; }
.controls-footer { flex: 0 0 auto; padding: 12px 18px 14px; border-top: 1px solid var(--line); background: white; }
.batch-progress { height: 2px; background: #e5e7e2; margin: -12px -18px 11px; overflow: hidden; }
.batch-progress span { display: block; height: 100%; width: 0; background: var(--accent-dark); transition: width .2s ease; }
.output-meta { margin-top: 7px; display: flex; justify-content: space-between; color: #92978f; font: 8px "SFMono-Regular", Consolas, monospace; }
.sync-wrap { position: relative; margin-bottom: 7px; }
.sync-menu { position: absolute; z-index: 20; left: 0; right: 0; bottom: calc(100% + 5px); display: none; padding: 4px; background: white; border: 1px solid #cfd2cc; border-radius: 5px; box-shadow: 0 8px 24px rgba(20,22,19,.16); }
.sync-menu.open { display: block; }
.sync-menu button { width: 100%; padding: 9px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 0; border-radius: 3px; background: transparent; cursor: pointer; color: var(--ink); }
.sync-menu button:hover { background: #f0f2ed; }
.sync-menu b { font-size: 9px; }
.sync-menu small { font-size: 8px; color: var(--muted); }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 10px 13px; border-radius: 5px; color: white; background: #171817; border: 1px solid #3c3f3a; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 10px; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 244px minmax(360px, 1fr) 278px; }
  .reference-panel { padding-left: 14px; padding-right: 14px; }
  .controls-footer, .tab-panel { padding-left: 14px; padding-right: 14px; }
  .controls-footer .batch-progress { margin-left: -14px; margin-right: -14px; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .topbar { position: sticky; top: 0; z-index: 20; grid-template-columns: 1fr auto; padding: 0 12px; }
  .engine-status, .button-ghost, .top-actions .icon-button { display: none; }
  .button-primary { padding: 0 10px; }
  .app-shell { height: auto; min-height: calc(100dvh - var(--header)); display: flex; flex-direction: column; }
  .reference-panel { order: 1; display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; overflow: visible; }
  .reference-panel .panel-heading { grid-column: 1 / 3; margin-bottom: 0; }
  .reference-stage { grid-column: 1; aspect-ratio: 1; }
  .analysis-section { grid-column: 2; margin: 0; min-width: 0; }
  .analysis-section .section-title, .analysis-section .histogram-wrap, .privacy-note { display: none; }
  .palette { height: 18px; }
  .metrics-grid { margin-top: 8px; }
  .metrics-grid div { min-height: 31px; }
  .viewer-panel { order: 2; min-height: 440px; height: 58dvh; }
  .viewer-toolbar { padding-left: 12px; }
  .viewer-actions .viewer-nav-button { display: none; }
  .file-title strong { max-width: 34vw; }
  .preview-image, .after-clip { inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
  .compare-divider { top: 12px; bottom: 12px; }
  .before-label { left: 18px; top: 18px; }
  .after-label { right: 18px; top: 18px; }
  .filmstrip-panel { order: 3; display: block; height: 124px; padding: 10px 12px; }
  .filmstrip-heading { height: 25px; border: 0; padding: 0; flex-direction: row; }
  .filmstrip-heading > div { display: flex; }
  .filmstrip-heading small { grid-column: auto; }
  .filmstrip { height: 80px; }
  .thumb { flex-basis: 96px; height: 73px; }
  .controls-panel { order: 4; border-left: 0; min-height: 480px; }
  .control-scroll { overflow: visible; }
  .controls-footer { position: sticky; bottom: 0; z-index: 10; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .reference-panel { grid-template-columns: 112px minmax(0, 1fr); }
  .metrics-grid dd, .metrics-grid dt { font-size: 8px; }
  .segmented button { padding: 0 7px; }
  .viewer-panel { min-height: 360px; height: 52dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
