:root {
  color-scheme: light;
  --ink: #292927;
  --muted: #73736d;
  --paper: #f7f7f5;
  --panel: #ffffff;
  --soft: #f1f1ee;
  --line: #e4e4df;
  --line-strong: #d2d2cc;
  --accent: #5d4863;
  --accent-soft: #f1edf2;
  --good: #4f6b3b;
  --warn: #8a632c;
  --danger: #9b453d;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

button, select, textarea { font: inherit; }

:where(button, select, textarea, summary, .file-button):focus-visible {
  outline: 3px solid #4d8feb;
  outline-offset: 3px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: auto;
  padding: 52px 0 76px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin: -28px 0 18px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(210, 210, 204, .82);
  background: rgba(247, 247, 244, .94);
  backdrop-filter: blur(12px);
}
.app-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 58px; overflow: visible; animation: brand-wake .65s cubic-bezier(.2,.75,.25,1) both; }
.brand-key, .brand-eye-outline, .brand-pupil { fill: #050505; }
.brand-arc, .brand-signal { fill: none; stroke-linecap: round; }
.brand-arc { stroke: #050505; stroke-width: 3; }
.brand-arc-inner { stroke-width: 2.2; }
.brand-eye-white { fill: #fff; }
.brand-eye-outline { fill: none; stroke: #050505; stroke-width: 3; }
.brand-iris { fill: #4797f7; transform-box: fill-box; transform-origin: center; }
.brand-pupil, .brand-glint { transform-box: fill-box; transform-origin: center; }
.brand-glint { fill: #fff; opacity: .9; }
.brand-signal { stroke: #4797f7; stroke-width: 3; opacity: 0; }
.brand-signal-inner { stroke-width: 2.2; }
.app-brand:hover .brand-pupil,
.app-brand:hover .brand-glint { animation: brand-scan .9s ease-in-out 1; }
.app-brand.is-analyzing .brand-pupil,
.app-brand.is-analyzing .brand-glint { animation: brand-scan 1.35s ease-in-out infinite; }
.app-brand.is-analyzing .brand-iris { animation: brand-pulse 1.35s ease-in-out infinite; }
.app-brand.is-analyzing .brand-signal-outer { animation: brand-wave 1.35s ease-out infinite; }
.app-brand.is-analyzing .brand-signal-inner { animation: brand-wave 1.35s .18s ease-out infinite; }
@keyframes brand-wake { from { opacity: 0; transform: translateY(4px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes brand-scan { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
@keyframes brand-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes brand-wave { 0% { opacity: 0; stroke-dasharray: 0 80; } 25% { opacity: .9; } 65%, 100% { opacity: 0; stroke-dasharray: 60 20; } }
.app-brand div { display: grid; gap: 1px; }
.app-brand strong { color: var(--ink); font-size: 1rem; letter-spacing: -.015em; }
.app-brand span { color: var(--muted); font-size: .7rem; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}

.file-heading h2,
.section-heading h2 {
  margin: 0;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.16;
}

.inline-action {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.inline-action:hover { border: 0; background: transparent; color: var(--ink); }

.intake-layout {
  width: 100%;
}

.about {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.about > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
}

.about > summary h2 {
  display: inline;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.about > summary span { color: var(--accent); font-size: .8rem; font-style: italic; }
.about > summary:hover { background: var(--soft); }
.about[open] > summary { border-bottom: 1px solid var(--line); }

.about-body {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 28px 26px;
}

.about-body > :first-child { margin-top: 0; }
.about-body p { margin: 0 0 11px; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.about-body .about-lead { color: var(--ink); font-size: .96rem; }
.about-body h3 { margin: 25px 0 8px; color: var(--ink); font-size: .9rem; font-weight: 600; }
.about-body ul { margin: 0 0 13px; padding-left: 21px; color: var(--muted); font-size: .9rem; line-height: 1.58; }
.about-body li { margin-bottom: 3px; }
.about-body strong { color: var(--ink); }
.about-body .about-close { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--ink); }

.site-identity {
  width: 105px;
  height: auto;
  object-fit: contain;
}

.identity-stack {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.viewer-shell {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(20, 20, 18, .04);
}

.input-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.input-panel > .drop-paste-zone { grid-column: 1; grid-row: 1; align-self: stretch; }

.drop-paste-zone {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.drop-paste-zone > .file-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.input-panel.dragging .drop-paste-zone {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--accent-soft);
}

.drop-copy {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.drop-copy h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.drop-copy p { margin: 0; color: var(--muted); font-size: .9rem; }

.drop-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--muted);
  font-size: 1.25rem;
}

.paste-row,
.actions,
.viewer-toolbar,
.file-heading,
.section-heading,
.result-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paste-row {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.paste-row span { color: var(--muted); font-size: .84rem; }

.file-button,
button,
select {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.file-button,
.primary { font-weight: 600; }

.file-button:hover,
button:hover,
select:hover { border-color: #aaa9a2; background: #fafaf8; }

.input-panel textarea {
  display: block;
  width: 100%;
  min-height: 198px;
  padding: 22px 145px 22px 22px;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font: 14px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  outline: 0;
}

.input-panel textarea:focus { background: #fbfbfa; }

.drop-paste-zone:focus-within { border-color: #aaa9a2; }

.actions {
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.primary:hover { border-color: #111; background: #111; }
.drop-paste-zone > .file-button:hover { border-color: #4d8feb; background: #4d8feb; color: #111; }
.secondary:hover, .file-button:hover, .icon-button:hover { color: var(--ink); }
button:disabled { opacity: .45; cursor: wait; }

.progress {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  width: min(620px, calc(100% - 32px));
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
  display: flex;
  align-items: center;
  gap: 13px;
  transform: translateX(-50%);
}

.progress[hidden] { display: none; }
.progress > div { flex: 1; }
.progress strong { font-size: .9rem; font-weight: 600; }
.progress small { color: var(--muted); }
.progress progress { display: block; width: 100%; height: 4px; margin-top: 8px; accent-color: var(--accent); }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.file-heading {
  justify-content: space-between;
  align-items: end;
  margin: 24px 0 14px;
}

.file-heading h2 { font-size: clamp(1.55rem, 4vw, 2rem); overflow-wrap: anywhere; }
.file-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }

.viewer-toolbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
}

.viewer-toolbar > span { margin-right: auto; color: var(--muted); font-size: .78rem; }

.segmented { display: flex; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; }
.segmented button { padding: 6px 10px; border: 0; border-right: 1px solid var(--line); border-radius: 0; font-size: .82rem; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--ink); color: #fff; }
.icon-button { padding: 6px 9px; }
.clean-actions { display: flex; gap: 7px; }

.viewer-body { display: flex; min-height: 390px; max-height: 70vh; }

.navigator {
  width: 230px;
  flex: 0 0 230px;
  overflow: auto;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #fafaf8;
}

.navigator button { display: block; width: 100%; padding: 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.navigator button:hover { background: var(--soft); }
.navigator button.level-2 { padding-left: 23px; }
.navigator strong, .navigator small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.navigator strong { font-size: .84rem; }
.navigator small { margin-top: 2px; color: var(--muted); font-size: .72rem; }

.viewer-content { min-width: 0; flex: 1; overflow: auto; background: var(--panel); }

.source-view,
.plain-view {
  width: 100%;
  min-height: 390px;
  margin: 0;
  padding: 22px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font: 14px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.source-view {
  overflow: auto;
  resize: vertical;
  /* Allows even the final heading to be positioned at the top by the navigator. */
  padding-bottom: min(55vh, 520px);
}

.document-view {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 22px min(55vh, 520px);
  color: #343431;
  font: 16px/1.72 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.document-view h1, .document-view h2, .document-view h3 { margin-top: 1.55em; line-height: 1.25; letter-spacing: -.015em; }
.document-view table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.document-view th, .document-view td { padding: 8px 10px; border: 1px solid var(--line); }
.document-view pre, .document-view code { background: var(--soft); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.document-view pre { padding: 14px; overflow: auto; border-radius: 8px; line-height: 1.55; tab-size: 2; }
.document-view img { max-width: 100%; }

.media-view { display: block; max-width: 100%; max-height: 70vh; margin: auto; object-fit: contain; }
.audio-view { display: block; width: min(700px, 90%); margin: 80px auto; }
.unsupported-view { padding: 64px 24px; text-align: center; color: var(--muted); }
.clean-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

.metadata-section, .image-tools { margin-top: 56px; }
.text-tools { margin-top: 30px; }

.section-heading { justify-content: space-between; align-items: end; margin-bottom: 15px; }
.section-heading h2 { font-size: clamp(1.4rem, 4vw, 1.7rem); }
.section-heading > span { color: var(--muted); font-size: .84rem; }

.metadata-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }

.metadata-summary article,
.credentials-card,
.summary-grid article,
.detail-grid article {
  padding: 16px;
  border: 0;
  background: var(--panel);
}

.metadata-summary article { min-width: 0; border-right: 1px solid var(--line); }
.metadata-summary article:last-child { border-right: 0; }
.metadata-summary span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .74rem; }
.metadata-summary strong { font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }

.credentials-card { margin-top: 10px; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 10px; }
.credentials-card.provenance-result { margin-top: 18px; padding: 18px 20px; }
.credentials-card.provenance-result h3 { font-size: 1rem; }
.credentials-card.good { border-left-color: var(--good); }
.credentials-card.warn { border-left-color: var(--warn); }
.credentials-card.ai-generated {
  border-color: #e3b3ad;
  border-left-color: #bd5a51;
  background: #faecea;
}
.credentials-card.ai-generated h3 { color: #792f29; }
.credentials-card.ai-generated p { color: #68423e; }
.credentials-card h3 { margin: 0 0 4px; color: var(--ink); font-size: .88rem; letter-spacing: 0; text-transform: none; }
.credentials-card p { margin: 0; color: var(--muted); font-size: .84rem; }

.metadata-details { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.metadata-details > summary { padding: 14px 16px; cursor: pointer; font-size: .88rem; font-weight: 600; }
.metadata-details > div { padding: 16px; border-top: 1px solid var(--line); }
.metadata-group { margin: 0 0 18px; }
.metadata-group h3 { color: var(--ink); }
.metadata-entry { margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.metadata-entry > summary { padding: 10px 12px; cursor: pointer; color: var(--ink); font: 600 .82rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.metadata-entry > summary:hover { background: var(--soft); }
.metadata-entry > div { padding: 0 10px 10px; border-top: 1px solid var(--line); }
.metadata-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.metadata-table th, .metadata-table td { padding: 7px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.metadata-table th { width: 30%; color: var(--muted); font-weight: 500; }

.results { margin-top: 0; }
.primary-result { margin: 4px 0 20px; }
.primary-result h2 { margin: 0 0 3px; color: var(--ink); font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.2; }
.primary-result .evidence-current-value { margin: 0; color: var(--muted); }
.primary-result .evidence-scale { margin-top: 29px; }
.predictor-disagreement-note { margin: 12px 0 0; padding: 9px 12px; border-left: 3px solid #c79b43; border-radius: 0 7px 7px 0; background: #fff8e8; color: #5c481f; font-size: .78rem; line-height: 1.45; }
.provider-resemblance { margin: 11px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.provider-resemblance strong { color: var(--ink); }
.text-tools { margin-top: 18px; }
.text-tools > .result-actions { justify-content: flex-end; margin-bottom: 10px; }
.result-heading { justify-content: space-between; padding: 0 0 13px; }
.result-heading h2 { margin: 0; color: var(--ink); font-size: clamp(1.4rem, 4vw, 1.7rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.16; }
.result-actions { display: flex; gap: 7px; }
.summary-grid, .detail-grid { display: grid; gap: 10px; }
.summary-grid { grid-template-columns: 1fr 1fr; }
.detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-top: 10px; }
.summary-grid article, .detail-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 10px; }

article h3 { margin: 0 0 11px; color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.verdict { grid-column: 1 / -1; border-color: var(--line-strong) !important; background: #f7f7f5 !important; color: var(--ink); }
.verdict p { margin-bottom: 0; color: var(--muted); }
.ai-scale { margin-top: 37px; }
.ai-scale-labels { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px; margin-top: 12px; font-size: .79rem; color: var(--muted); }
.ai-scale-labels span { display: flex; align-items: center; gap: 6px; }
.ai-scale-labels span:last-child { justify-content: flex-end; }
.ai-scale-labels b { font-size: 1.15rem; font-weight: 400; }
.ai-scale-track { position: relative; height: 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: linear-gradient(90deg, #68a76c 0%, #eef3eb 42%, #fff 50%, #f5ecea 58%, #c8655d 100%); }
.ai-scale-track strong { position: absolute; left: 0; top: -32px; min-width: 42px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink); text-align: center; font-size: .92rem; transform: translateX(-50%); }
.ai-scale-track i { position: absolute; left: 0; top: 50%; width: 4px; height: 25px; border-radius: 3px; background: #292927; box-shadow: 0 0 0 2px #fff; transform: translate(-50%, -50%); }
.meters, .section-list { margin: 0; padding: 0; list-style: none; }
.meters li, .section-list li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(90px, 1.4fr) 48px; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); }
.meters li:first-child, .section-list li:first-child { border-top: 0; }
.meters meter { width: 100%; accent-color: var(--accent); }
.meters .signal-contribution { box-sizing: border-box; margin-top: 5px; padding: 10px 11px; border: 0; border-radius: 8px; grid-template-columns: minmax(0, 1fr) minmax(72px, auto) minmax(56px, auto); column-gap: 12px; }
.image-meters .image-measure small { text-transform: capitalize; }
.profile-legend { margin: -3px 0 10px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.signal-contribution > span { min-width: 0; overflow-wrap: anywhere; }
.signal-contribution small { color: var(--muted); font-size: .72rem; }
.signal-contribution small, .signal-contribution strong { white-space: nowrap; text-align: right; }
.signal-contribution strong, .section-score strong { min-width: 0; font-variant-numeric: tabular-nums; text-align: right; }
.statistics { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); gap: 1px; }
.statistics div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 3px 10px; min-width: 0; padding: 11px; background: var(--panel); }
.statistics div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.statistics span { color: var(--muted); font-size: .74rem; }
.statistics small { grid-column: 1; color: var(--muted); font-size: .68rem; }
.statistics strong { grid-column: 2; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; }
.statistics-note { margin: 10px 2px 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.section-list { max-height: 270px; overflow: auto; }
.section-list li { grid-template-columns: minmax(0, 1fr) auto; }
.section-list strong { color: var(--accent); }
.section-list .section-score { margin-top: 4px; padding: 8px 10px; border: 0; border-radius: 7px; }
.disclaimer { padding: 16px 18px; border-left: 3px solid var(--line-strong); background: var(--soft); color: var(--muted); }
.comparison-result { margin: 12px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.comparison-result h3 { margin-top: 0; }
.revision-prompt { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.workspace-prompt { margin: 0 0 20px; }
#judge-prompt { display: none !important; }
.revision-prompt > summary { padding: 14px 16px; cursor: pointer; color: var(--ink); font-size: .88rem; font-weight: 600; }
.revision-prompt > summary:hover { background: var(--soft); }
.revision-prompt-body { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.revision-prompt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.revision-prompt-toolbar span { color: var(--muted); font-size: .76rem; }
.revision-prompt pre { max-height: 460px; margin: 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); font: .78rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: normal; word-break: normal; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 10; transform: translateX(-50%); padding: 10px 15px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .16); font-size: .84rem; }
[hidden] { display: none !important; }

@media (max-width: 800px) {
  main { width: min(100% - 22px, 900px); padding: 32px 0 52px; }
  .app-header { margin-top: -20px; }
  .app-brand span { display: none; }
  .input-panel { grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
  .drop-paste-zone > .file-button { top: 11px; right: 11px; padding: 6px 8px; font-size: .72rem; white-space: nowrap; }
  .input-panel > .drop-paste-zone { min-height: 150px; }
  .input-panel textarea { min-height: 150px; padding-right: 112px; }
  .drop-copy { padding: 18px; }
  .drop-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .file-heading, .section-heading, .result-heading { display: block; }
  .file-actions, .result-actions { margin-top: 10px; }
  .viewer-toolbar { flex-wrap: wrap; }
  .clean-actions { width: 100%; }
  .clean-actions button { flex: 1; }
  .viewer-body { max-height: 65vh; }
  .navigator { position: absolute; z-index: 3; height: 390px; box-shadow: 10px 10px 24px rgba(0, 0, 0, .08); }
  .metadata-summary, .summary-grid, .detail-grid { grid-template-columns: 1fr; }
  .verdict { grid-column: auto; }
  .metadata-summary article { border-right: 0; border-bottom: 1px solid var(--line); }
  .metadata-summary article:last-child { border-bottom: 0; }
  .document-view { padding: 26px 21px; }
  .section-heading label { display: block; margin-top: 10px; }
  .metadata-table th { width: 38%; }
  .about-body { padding: 18px; }
}

@media (max-width: 480px) {
  .drop-copy { align-items: flex-start; }
  .paste-row { align-items: flex-start; flex-wrap: wrap; }
  .paste-row span { width: 100%; }
  .file-button { flex: 1; text-align: center; }
  .actions button { flex: 1; }
  .viewer-toolbar > span { width: 100%; }
  .revision-prompt-toolbar { align-items: stretch; flex-direction: column; }
  .revision-prompt-toolbar button { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .brand-mark, .brand-pupil, .brand-glint, .brand-iris, .brand-signal { animation: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #efefec;
    --muted: #aaa9a2;
    --paper: #111216;
    --panel: #18191e;
    --soft: #22242a;
    --line: #303239;
    --line-strong: #44464f;
    --accent: #b786bd;
    --accent-soft: #2b2230;
    --good: #91b17c;
    --warn: #d6a45f;
    --danger: #df8077;
  }

  .file-button:hover,
  button:hover,
  select:hover,
  .viewer-toolbar,
  .navigator { background: #202127; }

  .input-panel textarea:focus { background: #1b1c21; }
  .primary,
  .segmented button.active,
  .toast { border-color: #efefec; background: #efefec; color: #15161a; }
  .primary:hover { border-color: #fff; background: #fff; }
  .drop-paste-zone > .file-button:hover { border-color: #4d8feb; background: #4d8feb; color: #111; }
  .document-view { color: #deded9; }
  .verdict { background: #202127 !important; }
  .credentials-card.ai-generated {
    border-color: #70433f;
    border-left-color: #df8077;
    background: #352523;
  }
  .credentials-card.ai-generated h3 { color: #ffb8b1; }
  .credentials-card.ai-generated p { color: #e6c2be; }
  .ai-scale-track strong { background: #202127; }
  .ai-scale-track { background: linear-gradient(90deg, #527b54 0%, #273027 42%, #ddd 50%, #382725 58%, #9c4e48 100%); }
  .ai-scale-track i { background: #f3f3ef; box-shadow: 0 0 0 2px #15161a; }
  .signal-contribution[style*="rgb(238, 247, 239)"],
  .section-score[style*="rgb(238, 247, 239)"] { color: #172018; }
  .signal-contribution[style*="rgb(250, 236, 234)"],
  .section-score[style*="rgb(250, 236, 234)"] { color: #271817; }
}

.advanced-diagnostics { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.advanced-diagnostics > summary { padding: 14px 16px; cursor: pointer; color: var(--ink); font-size: .88rem; font-weight: 600; }
.advanced-diagnostics > summary:hover { background: var(--soft); }
.advanced-diagnostics-intro { padding: 14px 16px 0; border-top: 1px solid var(--line); }
.advanced-diagnostics-intro p { margin: 0 0 12px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
#advanced-metrics { padding: 0 16px 16px; }
#advanced-diagnostics { grid-column: 1 / -1; }
.advanced-group { margin-top: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.advanced-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; font-size: .79rem; font-weight: 600; }
.advanced-group > summary small { color: var(--muted); font-size: .67rem; font-weight: 400; }
.advanced-group-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.advanced-group-body > .advanced-metric-row:last-child:nth-child(odd) { grid-column: 1 / -1; }
.advanced-metric-row { display: grid; grid-template-columns: minmax(150px,1fr) auto auto minmax(72px,auto); align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; background: var(--panel); }
.advanced-metric-row > span { min-width: 0; }
.advanced-metric-row > span b { display: block; overflow-wrap: anywhere; font-size: .72rem; font-weight: 600; }
.advanced-metric-row > span small { display: block; margin-top: 2px; color: var(--muted); font-size: .61rem; line-height: 1.25; }
.advanced-metric-row > small { color: var(--muted); font-size: .62rem; text-align: right; }
.advanced-metric-row > strong { font: 600 .73rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; text-align: right; }
.metric-status { padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .59rem; font-style: normal; white-space: nowrap; }
.metric-status.model { border-color: #a9bea6; background: #edf5eb; color: #48684b; }
.metric-status.diagnostic { background: #f6f6f3; }
.metric-sequence { grid-column: 1 / -1; display: grid; gap: 5px; padding: 10px 12px; background: var(--panel); }
.metric-sequence b { font-size: .7rem; }
.metric-sequence code { color: var(--muted); font: .67rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .advanced-group-body { grid-template-columns: 1fr; }
  .advanced-metric-row { grid-template-columns: minmax(120px,1fr) auto; }
  .advanced-metric-row > em { grid-column: 2; grid-row: 1; }
  .advanced-metric-row > small { grid-column: 1; grid-row: 2; text-align: left; }
  .advanced-metric-row > strong { grid-column: 2; grid-row: 2; }
}

/* V10 beta2.2 calibrated-result hierarchy */
.evidence-card { padding: 4px 0 1px; }
.evidence-kicker { margin: 0 0 7px !important; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .055em; }
.evidence-card h3 { margin: 0 0 8px; color: var(--ink); font-size: clamp(1.18rem, 3vw, 1.5rem); font-weight: 650; line-height: 1.2; }
.evidence-card > p { max-width: 760px; }
.evidence-scale { margin-top: 30px; }
.evidence-scale-track { position: relative; height: 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: linear-gradient(90deg, #68a76c 0%, #eef3eb 42%, #fff 50%, #f5ecea 58%, #c8655d 100%); overflow: visible; }
.evidence-scale-track::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--line-strong); opacity: .65; }
.rebased-ai-scale .evidence-scale-track { height: 18px; background: linear-gradient(90deg, #78a96f 0%, #f4f2ec 50%, #c7766e 100%); }
.rebased-scale-note { margin: 8px 2px 0 !important; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.evidence-scale-track .evidence-band { position: absolute; top: 2px; height: 10px; min-width: 5px; border-radius: 999px; background: rgba(41,41,39,.20); transform: translateX(-1px); }
.evidence-scale-track i { position: absolute; top: 50%; width: 4px; height: 27px; border-radius: 3px; background: #292927; box-shadow: 0 0 0 2px #fff; transform: translate(-50%, -50%); z-index: 2; }
.evidence-meta { margin-top: 13px !important; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.evidence-meta code { font: .72rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.evidence-foot { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; line-height: 1.45; }
.evidence-card-uncalibrated h3 { color: var(--muted); }
.why-list { margin: 12px 0; padding: 0; list-style: none; }
.why-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .78rem; }
.why-list li:first-child { border-top: 0; }
.why-list strong { text-align: right; font-weight: 600; }
.evidence-strength { margin: 8px 0 10px !important; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink) !important; font-size: .76rem; line-height: 1.5; }
.prevalence-control { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; margin: 14px 0; color: var(--ink); font-size: .78rem; }
.prevalence-control input { grid-column: 1 / -1; width: 100%; }


/* Beta2.2 current calibration: CSP-safe dynamic evidence positioning. */
.evidence-scale-track .evidence-marker { position:absolute; top:50%; width:4px; height:27px; border-radius:3px; background:#292927; box-shadow:0 0 0 2px #fff; transform:translate(-50%,-50%); z-index:3; }
.evidence-scale-track .evidence-marker > span { position:absolute; left:50%; bottom:31px; transform:translateX(-50%); min-width:34px; height:34px; padding:0 7px; box-sizing:border-box; border:1px solid var(--line-strong); border-radius:999px; background:#fff; color:#292927; display:flex; align-items:center; justify-content:center; font-style:normal; font-weight:700; line-height:1; box-shadow:0 1px 2px rgba(0,0,0,.08); }
.evidence-scale-track .evidence-predictor-marker { position:absolute; top:50%; display:flex; align-items:center; justify-content:center; width:24px; height:24px; border:2px solid var(--accent); border-radius:999px; background:#fff; color:var(--accent); font:700 .72rem/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow:0 1px 3px rgba(0,0,0,.16); transform:translate(-50%,-50%); z-index:2; }
.evidence-scale-track .evidence-pos-0 { left:0%; }
.evidence-scale-track .evidence-pos-1 { left:1%; }
.evidence-scale-track .evidence-pos-2 { left:2%; }
.evidence-scale-track .evidence-pos-3 { left:3%; }
.evidence-scale-track .evidence-pos-4 { left:4%; }
.evidence-scale-track .evidence-pos-5 { left:5%; }
.evidence-scale-track .evidence-pos-6 { left:6%; }
.evidence-scale-track .evidence-pos-7 { left:7%; }
.evidence-scale-track .evidence-pos-8 { left:8%; }
.evidence-scale-track .evidence-pos-9 { left:9%; }
.evidence-scale-track .evidence-pos-10 { left:10%; }
.evidence-scale-track .evidence-pos-11 { left:11%; }
.evidence-scale-track .evidence-pos-12 { left:12%; }
.evidence-scale-track .evidence-pos-13 { left:13%; }
.evidence-scale-track .evidence-pos-14 { left:14%; }
.evidence-scale-track .evidence-pos-15 { left:15%; }
.evidence-scale-track .evidence-pos-16 { left:16%; }
.evidence-scale-track .evidence-pos-17 { left:17%; }
.evidence-scale-track .evidence-pos-18 { left:18%; }
.evidence-scale-track .evidence-pos-19 { left:19%; }
.evidence-scale-track .evidence-pos-20 { left:20%; }
.evidence-scale-track .evidence-pos-21 { left:21%; }
.evidence-scale-track .evidence-pos-22 { left:22%; }
.evidence-scale-track .evidence-pos-23 { left:23%; }
.evidence-scale-track .evidence-pos-24 { left:24%; }
.evidence-scale-track .evidence-pos-25 { left:25%; }
.evidence-scale-track .evidence-pos-26 { left:26%; }
.evidence-scale-track .evidence-pos-27 { left:27%; }
.evidence-scale-track .evidence-pos-28 { left:28%; }
.evidence-scale-track .evidence-pos-29 { left:29%; }
.evidence-scale-track .evidence-pos-30 { left:30%; }
.evidence-scale-track .evidence-pos-31 { left:31%; }
.evidence-scale-track .evidence-pos-32 { left:32%; }
.evidence-scale-track .evidence-pos-33 { left:33%; }
.evidence-scale-track .evidence-pos-34 { left:34%; }
.evidence-scale-track .evidence-pos-35 { left:35%; }
.evidence-scale-track .evidence-pos-36 { left:36%; }
.evidence-scale-track .evidence-pos-37 { left:37%; }
.evidence-scale-track .evidence-pos-38 { left:38%; }
.evidence-scale-track .evidence-pos-39 { left:39%; }
.evidence-scale-track .evidence-pos-40 { left:40%; }
.evidence-scale-track .evidence-pos-41 { left:41%; }
.evidence-scale-track .evidence-pos-42 { left:42%; }
.evidence-scale-track .evidence-pos-43 { left:43%; }
.evidence-scale-track .evidence-pos-44 { left:44%; }
.evidence-scale-track .evidence-pos-45 { left:45%; }
.evidence-scale-track .evidence-pos-46 { left:46%; }
.evidence-scale-track .evidence-pos-47 { left:47%; }
.evidence-scale-track .evidence-pos-48 { left:48%; }
.evidence-scale-track .evidence-pos-49 { left:49%; }
.evidence-scale-track .evidence-pos-50 { left:50%; }
.evidence-scale-track .evidence-pos-51 { left:51%; }
.evidence-scale-track .evidence-pos-52 { left:52%; }
.evidence-scale-track .evidence-pos-53 { left:53%; }
.evidence-scale-track .evidence-pos-54 { left:54%; }
.evidence-scale-track .evidence-pos-55 { left:55%; }
.evidence-scale-track .evidence-pos-56 { left:56%; }
.evidence-scale-track .evidence-pos-57 { left:57%; }
.evidence-scale-track .evidence-pos-58 { left:58%; }
.evidence-scale-track .evidence-pos-59 { left:59%; }
.evidence-scale-track .evidence-pos-60 { left:60%; }
.evidence-scale-track .evidence-pos-61 { left:61%; }
.evidence-scale-track .evidence-pos-62 { left:62%; }
.evidence-scale-track .evidence-pos-63 { left:63%; }
.evidence-scale-track .evidence-pos-64 { left:64%; }
.evidence-scale-track .evidence-pos-65 { left:65%; }
.evidence-scale-track .evidence-pos-66 { left:66%; }
.evidence-scale-track .evidence-pos-67 { left:67%; }
.evidence-scale-track .evidence-pos-68 { left:68%; }
.evidence-scale-track .evidence-pos-69 { left:69%; }
.evidence-scale-track .evidence-pos-70 { left:70%; }
.evidence-scale-track .evidence-pos-71 { left:71%; }
.evidence-scale-track .evidence-pos-72 { left:72%; }
.evidence-scale-track .evidence-pos-73 { left:73%; }
.evidence-scale-track .evidence-pos-74 { left:74%; }
.evidence-scale-track .evidence-pos-75 { left:75%; }
.evidence-scale-track .evidence-pos-76 { left:76%; }
.evidence-scale-track .evidence-pos-77 { left:77%; }
.evidence-scale-track .evidence-pos-78 { left:78%; }
.evidence-scale-track .evidence-pos-79 { left:79%; }
.evidence-scale-track .evidence-pos-80 { left:80%; }
.evidence-scale-track .evidence-pos-81 { left:81%; }
.evidence-scale-track .evidence-pos-82 { left:82%; }
.evidence-scale-track .evidence-pos-83 { left:83%; }
.evidence-scale-track .evidence-pos-84 { left:84%; }
.evidence-scale-track .evidence-pos-85 { left:85%; }
.evidence-scale-track .evidence-pos-86 { left:86%; }
.evidence-scale-track .evidence-pos-87 { left:87%; }
.evidence-scale-track .evidence-pos-88 { left:88%; }
.evidence-scale-track .evidence-pos-89 { left:89%; }
.evidence-scale-track .evidence-pos-90 { left:90%; }
.evidence-scale-track .evidence-pos-91 { left:91%; }
.evidence-scale-track .evidence-pos-92 { left:92%; }
.evidence-scale-track .evidence-pos-93 { left:93%; }
.evidence-scale-track .evidence-pos-94 { left:94%; }
.evidence-scale-track .evidence-pos-95 { left:95%; }
.evidence-scale-track .evidence-pos-96 { left:96%; }
.evidence-scale-track .evidence-pos-97 { left:97%; }
.evidence-scale-track .evidence-pos-98 { left:98%; }
.evidence-scale-track .evidence-pos-99 { left:99%; }
.evidence-scale-track .evidence-pos-100 { left:100%; }
.evidence-scale-track .evidence-width-1 { width:1%; }
.evidence-scale-track .evidence-width-2 { width:2%; }
.evidence-scale-track .evidence-width-3 { width:3%; }
.evidence-scale-track .evidence-width-4 { width:4%; }
.evidence-scale-track .evidence-width-5 { width:5%; }
.evidence-scale-track .evidence-width-6 { width:6%; }
.evidence-scale-track .evidence-width-7 { width:7%; }
.evidence-scale-track .evidence-width-8 { width:8%; }
.evidence-scale-track .evidence-width-9 { width:9%; }
.evidence-scale-track .evidence-width-10 { width:10%; }
.evidence-scale-track .evidence-width-11 { width:11%; }
.evidence-scale-track .evidence-width-12 { width:12%; }
.evidence-scale-track .evidence-width-13 { width:13%; }
.evidence-scale-track .evidence-width-14 { width:14%; }
.evidence-scale-track .evidence-width-15 { width:15%; }
.evidence-scale-track .evidence-width-16 { width:16%; }
.evidence-scale-track .evidence-width-17 { width:17%; }
.evidence-scale-track .evidence-width-18 { width:18%; }
.evidence-scale-track .evidence-width-19 { width:19%; }
.evidence-scale-track .evidence-width-20 { width:20%; }
.evidence-scale-track .evidence-width-21 { width:21%; }
.evidence-scale-track .evidence-width-22 { width:22%; }
.evidence-scale-track .evidence-width-23 { width:23%; }
.evidence-scale-track .evidence-width-24 { width:24%; }
.evidence-scale-track .evidence-width-25 { width:25%; }
.evidence-scale-track .evidence-width-26 { width:26%; }
.evidence-scale-track .evidence-width-27 { width:27%; }
.evidence-scale-track .evidence-width-28 { width:28%; }
.evidence-scale-track .evidence-width-29 { width:29%; }
.evidence-scale-track .evidence-width-30 { width:30%; }
.evidence-scale-track .evidence-width-31 { width:31%; }
.evidence-scale-track .evidence-width-32 { width:32%; }
.evidence-scale-track .evidence-width-33 { width:33%; }
.evidence-scale-track .evidence-width-34 { width:34%; }
.evidence-scale-track .evidence-width-35 { width:35%; }
.evidence-scale-track .evidence-width-36 { width:36%; }
.evidence-scale-track .evidence-width-37 { width:37%; }
.evidence-scale-track .evidence-width-38 { width:38%; }
.evidence-scale-track .evidence-width-39 { width:39%; }
.evidence-scale-track .evidence-width-40 { width:40%; }
.evidence-scale-track .evidence-width-41 { width:41%; }
.evidence-scale-track .evidence-width-42 { width:42%; }
.evidence-scale-track .evidence-width-43 { width:43%; }
.evidence-scale-track .evidence-width-44 { width:44%; }
.evidence-scale-track .evidence-width-45 { width:45%; }
.evidence-scale-track .evidence-width-46 { width:46%; }
.evidence-scale-track .evidence-width-47 { width:47%; }
.evidence-scale-track .evidence-width-48 { width:48%; }
.evidence-scale-track .evidence-width-49 { width:49%; }
.evidence-scale-track .evidence-width-50 { width:50%; }
.evidence-scale-track .evidence-width-51 { width:51%; }
.evidence-scale-track .evidence-width-52 { width:52%; }
.evidence-scale-track .evidence-width-53 { width:53%; }
.evidence-scale-track .evidence-width-54 { width:54%; }
.evidence-scale-track .evidence-width-55 { width:55%; }
.evidence-scale-track .evidence-width-56 { width:56%; }
.evidence-scale-track .evidence-width-57 { width:57%; }
.evidence-scale-track .evidence-width-58 { width:58%; }
.evidence-scale-track .evidence-width-59 { width:59%; }
.evidence-scale-track .evidence-width-60 { width:60%; }
.evidence-scale-track .evidence-width-61 { width:61%; }
.evidence-scale-track .evidence-width-62 { width:62%; }
.evidence-scale-track .evidence-width-63 { width:63%; }
.evidence-scale-track .evidence-width-64 { width:64%; }
.evidence-scale-track .evidence-width-65 { width:65%; }
.evidence-scale-track .evidence-width-66 { width:66%; }
.evidence-scale-track .evidence-width-67 { width:67%; }
.evidence-scale-track .evidence-width-68 { width:68%; }
.evidence-scale-track .evidence-width-69 { width:69%; }
.evidence-scale-track .evidence-width-70 { width:70%; }
.evidence-scale-track .evidence-width-71 { width:71%; }
.evidence-scale-track .evidence-width-72 { width:72%; }
.evidence-scale-track .evidence-width-73 { width:73%; }
.evidence-scale-track .evidence-width-74 { width:74%; }
.evidence-scale-track .evidence-width-75 { width:75%; }
.evidence-scale-track .evidence-width-76 { width:76%; }
.evidence-scale-track .evidence-width-77 { width:77%; }
.evidence-scale-track .evidence-width-78 { width:78%; }
.evidence-scale-track .evidence-width-79 { width:79%; }
.evidence-scale-track .evidence-width-80 { width:80%; }
.evidence-scale-track .evidence-width-81 { width:81%; }
.evidence-scale-track .evidence-width-82 { width:82%; }
.evidence-scale-track .evidence-width-83 { width:83%; }
.evidence-scale-track .evidence-width-84 { width:84%; }
.evidence-scale-track .evidence-width-85 { width:85%; }
.evidence-scale-track .evidence-width-86 { width:86%; }
.evidence-scale-track .evidence-width-87 { width:87%; }
.evidence-scale-track .evidence-width-88 { width:88%; }
.evidence-scale-track .evidence-width-89 { width:89%; }
.evidence-scale-track .evidence-width-90 { width:90%; }
.evidence-scale-track .evidence-width-91 { width:91%; }
.evidence-scale-track .evidence-width-92 { width:92%; }
.evidence-scale-track .evidence-width-93 { width:93%; }
.evidence-scale-track .evidence-width-94 { width:94%; }
.evidence-scale-track .evidence-width-95 { width:95%; }
.evidence-scale-track .evidence-width-96 { width:96%; }
.evidence-scale-track .evidence-width-97 { width:97%; }
.evidence-scale-track .evidence-width-98 { width:98%; }
.evidence-scale-track .evidence-width-99 { width:99%; }
.evidence-scale-track .evidence-width-100 { width:100%; }


/* Methodology balloons: registry-backed, viewport-safe, no icon required. */
.metric-label-help { position: relative; display: inline-flex; align-items: center; max-width: 100%; outline: none; cursor: help; }
.metric-label-help > b { text-decoration: underline dotted rgba(64,64,60,.48); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.metric-label-help:focus > b, .metric-label-help:hover > b { text-decoration-color: currentColor; }
.metric-balloon { display: none; position: absolute; left: 0; right: auto; top: calc(100% + 9px); bottom: auto; z-index: 120; width: min(410px, calc(100vw - 24px)); max-height: min(360px, 42vh); overflow: auto; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: #292927; box-shadow: 0 10px 28px rgba(0,0,0,.14); opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; text-align: left; font: 12px/1.42 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; white-space: normal; overscroll-behavior: contain; }
.metric-balloon.balloon-align-left { left: 0; right: auto; }
.metric-balloon.balloon-align-right { left: auto; right: 0; }
.metric-balloon.balloon-above { top: auto; bottom: calc(100% + 9px); }
.metric-balloon.balloon-viewport { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: min(440px, calc(100vh - 24px)); transform: translateY(4px); }
.metric-balloon::before { content: ""; position: absolute; left: 18px; top: -6px; width: 10px; height: 10px; border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); background: #fff; transform: rotate(45deg); }
.metric-balloon.balloon-align-right::before { left: auto; right: 18px; }
.metric-balloon.balloon-above::before { top: auto; bottom: -6px; border-left: 0; border-top: 0; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.metric-balloon.balloon-viewport::before { display: none; }
.metric-balloon strong, .metric-balloon span { display: block; }
.metric-balloon strong { margin-bottom: 5px; font-size: 13px; }
.metric-balloon span + span { margin-top: 5px; }
.metric-label-help:hover .metric-balloon, .metric-label-help:focus .metric-balloon, .metric-label-help:focus-within .metric-balloon { display: block; opacity: 1; visibility: visible; transform: translateY(0); }
.metric-label-help:hover .metric-balloon.balloon-viewport, .metric-label-help:focus .metric-balloon.balloon-viewport, .metric-label-help:focus-within .metric-balloon.balloon-viewport { transform: translateY(0); }
.statistics, .advanced-group-body, .advanced-metric-row, .information-contribution, .advanced-diagnostics, .advanced-group, .detail-grid article { overflow: visible; }
@media (max-width: 700px) { .metric-balloon { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: min(440px, calc(100vh - 24px)); } .metric-balloon::before { display: none; } }

/* Deterministic signatures dev.3 */
.deterministic-signature-list { margin: 12px 0; padding: 0; list-style: none; }
.deterministic-signature-list li { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid var(--line); }
.deterministic-signature-list li:first-child { border-top: 0; }
.deterministic-signature-list li strong { font-size: .82rem; }
.deterministic-signature-list li span { color: var(--muted); font-size: .74rem; line-height: 1.45; }
.deterministic-fallback-note { margin-bottom: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); font-size: .75rem; line-height: 1.45; }
.input-quality-warning { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #d6a94e; border-radius: 8px; background: #fff7df; color: #5e4514; font-size: .78rem; line-height: 1.5; }
.meters .deterministic-active { outline: 1px solid var(--line-strong); background: var(--panel); }
