:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--paper); font-size: 15px; letter-spacing: 0;
  --ink: #111519; --paper: #ffffff; --muted: #626970; --line: #dfe3e5;
  --surface: #f4f6f6; --border: #b9c0c5; --strong-border: #858e95;
  --accent: #d0f341; --accent-ink: #526600; --primary-hover: #2b3034;
  --evidence: #f4f6f6; --evidence-border: #b9c0c5;
  --positive-ink: #286044; --positive-surface: #e8f3ec;
  --warning-ink: #875010; --warning-surface: #fff7e8; --warning-border: #c08b2e;
  --negative-surface: #fff0db;
  --error-ink: #963221; --error-surface: #fff0ed; --error-border: #b85237;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, summary { font: inherit; }
button, input, select { min-height: 44px; border-radius: 5px; padding: 10px 14px; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--accent); font-weight: 600; cursor: pointer; }
button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:disabled { opacity: .6; cursor: wait; }
.sign-in-button { min-width: 90px; }
.sign-in-button:disabled { opacity: 1; cursor: default; }
input, select { border: 1px solid var(--border); width: 100%; background: var(--paper); color: var(--ink); }
input:focus, select:focus { border-color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 23px; font-weight: 700; }
h3, h4 { font-size: 17px; }
h5 { font-size: 15px; }
p { line-height: 1.55; overflow-wrap: anywhere; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 8px 3.5%; border-bottom: 1px solid var(--line); gap: 16px; }
.site-header > strong, .site-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-right: auto; }
.site-brand { text-decoration: none; font-weight: 700; }
.report-navigation { margin: 0 0 24px; font-size: 13px; }
.report-navigation a { display: inline-flex; gap: 8px; align-items: center; min-height: 32px; text-decoration: none; color: var(--muted); }
.report-navigation .icon { width: 15px; height: 15px; flex-basis: 15px; transform: rotate(180deg); }
.report-loading { display: none; padding: 44px 0; max-width: 640px; }
html[data-report-route] #collection-panel { display: none !important; }
html[data-report-route] .report-loading { display: block; }
.report-loading p { color: var(--muted); }
.report-loading progress { width: 100%; height: 4px; margin-top: 16px; accent-color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-account { display: flex; align-items: center; gap: 14px; }
[hidden] { display: none !important; }
.account-identity { position: relative; }
.account-trigger { height: 44px; padding: 4px 8px; border: 1px solid transparent; background: transparent; color: var(--ink); gap: 9px; }
.account-trigger:hover { background: var(--surface); border-color: var(--line); }
.account-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: 14px; }
.account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.account-trigger .icon { width: 14px; height: 14px; flex-basis: 14px; }
.account-dropdown { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: min(288px, calc(100vw - 32px)); padding: 16px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 12px 36px #11151918; }
.menu-caption { margin: 0 8px 4px; color: var(--muted); font-size: 12px; }
.menu-email { margin: 0 8px 12px; font-size: 14px; overflow-wrap: anywhere; }
.account-dropdown nav { display: grid; border-top: 1px solid var(--line); padding-top: 6px; }
.account-dropdown nav a, .account-dropdown nav button { display: flex; justify-content: flex-start; align-items: center; padding: 10px 12px; min-height: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 400; }
.account-dropdown nav a:hover, .account-dropdown nav button:hover { background: var(--surface); }
#menu-error { margin: 8px; font-size: 13px; color: var(--error-ink); }
.entry-billing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 12px 24px; margin-top: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.entry-billing:has(.entry-allowance[hidden]) { grid-template-columns: minmax(0, 1fr); }
.entry-allowance { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0; padding: 0; }
.entry-allowance strong { font-size: 15px; }
.entry-allowance span { font-size: 13px; color: var(--muted); }
.entry-allowance progress { width: 88px; height: 5px; accent-color: var(--ink); }
@media (max-width: 640px) { .entry-billing { grid-template-columns: minmax(0, 1fr); } .entry-allowance progress { width: 72px; } }
@media (max-width: 540px) { .account-name { display: none; } .header-account { gap: 8px; } .account-trigger { padding: 4px; } }
.secondary-button { color: var(--ink); border-color: var(--border); background: var(--paper); }
.secondary-button:hover { background: var(--surface); border-color: var(--strong-border); }
.icon { width: 18px; height: 18px; flex: 0 0 18px; display: inline-block; background: currentColor; mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.icon-plus { mask-image: url('/icons/plus.svg'); }
.icon-download { mask-image: url('/icons/file-down.svg'); }
.icon-chevron { mask-image: url('/icons/chevron-down.svg'); }
.icon-arrow-right { mask-image: url('/icons/arrow-right.svg'); }
.icon-external { mask-image: url('/icons/external-link.svg'); width: 14px; height: 14px; }
.brand-mark { display: block; width: 24px; height: 24px; flex: 0 0 24px; }
main { max-width: 1440px; margin: 0 auto; padding: 26px 3.5% 64px; }
.collection-panel { margin: 0; padding: 60px 0 0; }
.entry-content { position: relative; z-index: 1; width: min(1000px, calc(100% - 64px)); margin: 0 auto; }
.entry-lede { max-width: 620px; margin: -18px auto 34px; text-align: center; text-wrap: balance; color: var(--muted); font-size: 17px; line-height: 1.5; }
.collection-panel h1 { margin: 0 0 36px; font-size: 60px; line-height: 1.1; letter-spacing: -2px; color: var(--ink); text-align: center; }
html:not([data-report-route]) body:has(#collection-panel:not([hidden])) .site-header { min-height: 78px; padding: 12px 6.5%; border-bottom-color: transparent; }
html:not([data-report-route]) body:has(#collection-panel:not([hidden])) .brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
html:not([data-report-route]) body:has(#collection-panel:not([hidden])) main { max-width: none; padding: 0 0 24px; }
html:not([data-report-route]) body:has(#collection-panel:not([hidden])) #error { width: min(1000px, calc(100% - 64px)); margin: 20px auto 0; }
html:not([data-report-route]) body:has(#collection-panel:not([hidden])) #status { display: none; }
.collection-panel .analysis-input { gap: 10px; }
.collection-panel label { font-size: 14px; }
.collection-panel .analysis-input input { min-height: 56px; font-size: 16px; font-weight: 400; padding: 14px 18px; border-color: var(--border); border-radius: 10px; box-shadow: 0 2px 8px #11151904; }
.collection-panel .analysis-input input::placeholder { color: var(--muted); opacity: 1; }
.collection-panel .analysis-input input:focus { border-color: var(--ink); }
.collection-panel .analysis-input input[aria-invalid='true'] { border-color: var(--error-border); }
.url-error { color: var(--error-ink); font-size: 13px; line-height: 1.5; margin: -14px 0 -8px; }
.collection-panel .analysis-input > button { min-width: 190px; min-height: 56px; padding: 14px 22px; border-radius: 10px; font-size: 15px; gap: 14px; }
.collection-panel .analysis-input > button::after { content: ''; width: 20px; height: 20px; flex: 0 0 20px; background: currentColor; mask: url('/icons/arrow-right.svg') center / contain no-repeat; }
.collection-panel .sample-options { width: 100%; margin: 0; padding: 0; border: 0; gap: 20px; }
.sample-settings { display: grid; gap: 8px; }
.sample-settings .field-note { margin: 0; }
.collection-panel .sample-options > label { gap: 9px; color: var(--muted); font-size: 12px; font-weight: 500; }
.collection-panel .sample-options select { min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background-color: #fafbfa; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.collection-panel .sample-options select:hover { border-color: var(--border); background-color: var(--paper); }
.collection-panel .sample-options select:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.collection-panel .sample-options select:disabled { cursor: wait; opacity: .6; }
@supports (appearance: base-select) {
  .collection-panel .sample-options select, .collection-panel .sample-options select::picker(select) { appearance: base-select; }
  .collection-panel .sample-options select { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .collection-panel .sample-options select::picker-icon { content: ''; width: 16px; height: 16px; background: var(--muted); mask: url('/icons/chevron-down.svg') center / contain no-repeat; transition: rotate .15s ease; }
  .collection-panel .sample-options select:open { border-color: var(--strong-border); background-color: var(--paper); }
  .collection-panel .sample-options select:open::picker-icon { rotate: 180deg; }
  .collection-panel .sample-options select::picker(select) { min-width: anchor-size(width); margin-top: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 36px #1115191a, 0 2px 8px #11151908; }
  .collection-panel .sample-options option { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 7px; color: var(--ink); background: var(--paper); font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; cursor: pointer; }
  .collection-panel .sample-options option:hover, .collection-panel .sample-options option:focus { background: var(--surface); }
  .collection-panel .sample-options option:checked { background: #eef6d7; color: #31420c; font-weight: 600; }
  .collection-panel .sample-options option::checkmark { order: 1; margin-left: auto; color: var(--accent-ink); }
}
@media (prefers-reduced-motion: reduce) { .collection-panel .sample-options select::picker-icon { transition: none; } }

/* Every other select uses the same custom picker as the home page where the
   browser supports it (Chromium); elsewhere the native menu stays. Low
   specificity so page-specific select styles still win. */
:where(select) { border-radius: 8px; background-color: var(--paper); cursor: pointer; transition: border-color .15s, background-color .15s; }
:where(select):hover:not(:disabled) { border-color: var(--strong-border); }
:where(select):disabled { cursor: not-allowed; }
@supports (appearance: base-select) {
  :where(select), :where(select)::picker(select) { appearance: base-select; }
  :where(select) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  :where(select)::picker-icon { content: ''; width: 16px; height: 16px; flex: 0 0 16px; background: var(--muted); mask: url('/icons/chevron-down.svg') center / contain no-repeat; transition: rotate .15s ease; }
  :where(select):open { border-color: var(--strong-border); }
  :where(select):open::picker-icon { rotate: 180deg; }
  :where(select)::picker(select) { min-width: anchor-size(width); margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
    box-shadow: 0 12px 36px #1115191a, 0 2px 8px #11151908; opacity: 0; translate: 0 -4px;
    transition: opacity .14s ease, translate .14s ease, overlay .14s allow-discrete, display .14s allow-discrete; }
  :where(select):open::picker(select) { opacity: 1; translate: 0 0; }
  @starting-style { :where(select):open::picker(select) { opacity: 0; translate: 0 -4px; } }
  :where(select) option { display: flex; align-items: center; gap: 16px; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 7px; color: var(--ink); background: var(--paper); font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; cursor: pointer; }
  :where(select) option:hover, :where(select) option:focus-visible { background: var(--surface); outline: none; }
  :where(select) option:checked { background: #eef6d7; color: #31420c; font-weight: 600; }
  :where(select) option::checkmark { order: 1; margin-left: auto; color: var(--accent-ink); }
}
@media (prefers-reduced-motion: reduce) { :where(select)::picker-icon, :where(select)::picker(select) { transition: none; } }
.home-art { width: 100%; max-width: 1440px; aspect-ratio: 8 / 3; overflow: hidden; margin: -64px auto 0; pointer-events: none;
  /* Blend the illustration's white studio floor into the page, not a cropped banner. */
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent),
    linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
  mask-composite: intersect;
}
.home-art img { display: block; width: 100%; height: auto; }
.home-end { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 20px 0; margin: 18px 3.5% 0; color: var(--muted); font-size: 12px; }
.home-end::before, .home-end::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.home-end-brand { font-weight: 600; color: var(--ink); }
.home-end nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
.home-end nav a { padding: 6px 8px; border-radius: 4px; color: var(--muted); text-decoration: none; transition: color .15s, background-color .15s; }
.home-end nav a:hover { color: var(--ink); background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .home-end nav a { transition: none; } }
form { display: grid; gap: 24px; }
.analysis-input { display: flex; gap: 12px; align-items: end; }
.analysis-input > button { min-width: 160px; }
.sample-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border-top: 1px solid var(--line); padding-top: 22px; }
.filters { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }
.url-field, .search-field { flex: 1; min-width: 0; }
.field-note, #status { color: var(--muted); font-size: 13px; line-height: 1.5; }
.field-note { margin: 12px 0 0; }
.field-note:empty, #status:empty { display: none; }
#status { padding: 0 0 14px; }
body:has(#sample:not([hidden])) #status { display: none; }
#error { background: var(--error-surface); color: var(--error-ink); padding: 16px; border-left: 3px solid var(--error-border); margin-bottom: 18px; overflow-wrap: anywhere; }
.app-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 330px) auto; align-items: center; gap: 24px; margin-bottom: 18px; }
.app-identity { display: flex; align-items: center; gap: 22px; min-width: 0; }
.app-icon { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.app-identity p { color: var(--muted); margin: 5px 0 4px; }
.app-identity a { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.sample-period { display: grid; gap: 6px; color: var(--muted); font-size: 13px; max-width: 390px; border-left: 1px solid var(--line); padding-left: 26px; flex-shrink: 0; }
.sample-period strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.sample-details { margin: 0; }
.sample-details[open] { grid-column: 1 / -1; }
.sample-details > summary { font-size: 13px; color: var(--muted); }
dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 18px 0; }
dt { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
dd { margin: 0; font-size: 22px; font-variant-numeric: tabular-nums; }
dt, dd { overflow-wrap: anywhere; }
.sample-ratings { padding: 12px 0; border-top: 1px solid var(--line); }
.sample-ratings-heading { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sample-ratings h3 { font-size: 15px; }
#sample-dates { color: var(--muted); font-size: 13px; }
#rating-distribution { display: grid; gap: 8px; max-width: 640px; }
.rating-distribution-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: 13px; }
.rating-distribution-row span:last-child { text-align: right; }
progress { accent-color: var(--ink); }
.rating-distribution-row progress { width: 100%; height: 8px; }
.scope, .report-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
#analysis-status { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
#analysis-status:empty { display: none; }
#analysis-status.partial-notice { background: var(--warning-surface); color: var(--warning-ink); border-left: 3px solid var(--warning-border); padding: 12px 16px; margin-bottom: 8px; }
.view-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 16px; scroll-margin-top: 8px; }
.view-tab { min-height: 46px; padding: 8px 10px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); background: transparent; }
.view-tab:hover { color: var(--ink); background: transparent; }
.view-tab[aria-selected='true'] { border-bottom-color: var(--accent-ink); color: var(--ink); }
.sample-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0 18px; }
.report-heading:has(#report-heading-title[hidden]):has(#analyze[hidden]) { display: none; }
.report-actions { display: flex; gap: 10px; }
.analysis-progress { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 340px); column-gap: 72px; align-items: start; padding: 48px 0 72px; }
.analysis-progress > * { grid-column: 1; }
.analysis-progress > .analysis-leave { grid-column: 2; grid-row: 1 / span 5; margin-top: 0; flex-direction: column; align-items: flex-start; padding: 20px 22px; }
.analysis-progress > .analysis-leave p { flex: 0 0 auto; }
@media (max-width: 1000px) { .analysis-progress { grid-template-columns: minmax(0, 1fr); } .analysis-progress > .analysis-leave { grid-column: 1; grid-row: auto; margin-top: 28px; } }
.processing-app { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; min-height: 56px; }
.processing-app .app-icon { width: 56px; height: 56px; flex: 0 0 56px; }
.processing-caption { margin: 0 0 6px; color: var(--muted); font-size: 11px; letter-spacing: 0; }
#processing-app-name { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.analysis-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.analysis-progress-head h2 { font-size: 28px; margin: 0; }
#analysis-elapsed { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#analysis-progress-bar { width: 100%; height: 4px; margin: 28px 0 20px; accent-color: var(--ink); }
.processing-stages { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 34px 0 26px; padding: 0; list-style: none; }
.processing-stages li { position: relative; display: grid; justify-items: start; gap: 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
/* Connector from each node to the next; it fills in as steps finish. */
.processing-stages li:not(:last-child)::after { content: ''; position: absolute; top: 11px; left: 30px; right: -6px; height: 2px; border-radius: 1px;
  background: linear-gradient(to right, var(--accent-ink) 50%, var(--line) 50%) right / 200% 100% no-repeat; transition: background-position .6s cubic-bezier(.3, .7, .2, 1); }
.processing-stages li[data-state='done']::after { background-position: left; }
.step-node { position: relative; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); transition: background-color .3s, border-color .3s; }
.processing-stages li[data-state='done'] .step-node { border-color: var(--accent); background: var(--accent); }
.processing-stages li[data-state='done'] .step-node::before { content: ''; position: absolute; inset: 4px; background: var(--ink); mask: url('/icons/check.svg') center / contain no-repeat;
  animation: step-check .35s cubic-bezier(.3, .7, .2, 1); }
.processing-stages li[data-state='current'] .step-node { border-color: var(--line); }
.processing-stages li[data-state='current'] .step-node::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--ink); border-right-color: var(--ink); animation: billing-spin 1s linear infinite; }
.processing-stages li[data-state='current'] .step-node::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--accent); }
.processing-stages li[data-state='current'] { color: var(--ink); font-weight: 600; }
.processing-stages li[data-state='done'] { color: var(--ink); }
@keyframes step-check { from { transform: scale(.3); opacity: 0; } }
.analysis-progress #analysis-progress-bar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.analysis-leave { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 28px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); animation: leave-in .4s ease-out; }
.analysis-leave p { margin: 0; flex: 1 1 280px; font-size: 14px; }
.analysis-leave .button-link, .analysis-leave button { min-height: 40px; padding: 8px 14px; font-size: 14px; }
@keyframes leave-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .processing-stages li::after, .step-node { transition: none; }
  .processing-stages li .step-node::before, .analysis-leave { animation: none !important; }
}
#analysis-progress-bar[value] { appearance: none; border: 0; border-radius: 4px; background: var(--line); }
#analysis-progress-bar[value]::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
#analysis-progress-bar[value]::-webkit-progress-value { background: var(--accent-ink); border-radius: 4px; }
#analysis-progress-bar[value]::-moz-progress-bar { background: var(--accent-ink); border-radius: 4px; }
#analysis-progress-detail { font-size: 14px; color: var(--muted); }
.full-report-gate { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.full-report-gate button:disabled { cursor: default; }
#export-status { color: var(--muted); font-size: 13px; }
#export-status:empty { display: none; }
.report-overview h2 { font-size: 25px; }
.report-intro { font-size: 14px; color: var(--muted); margin: 7px 0 16px; max-width: 90ch; line-height: 1.5; }
.key-signals > h3 { display: none; }
.signal { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.signal-number { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; font-weight: 600; color: var(--warning-ink); background: var(--negative-surface); }
.signal-number.positive { color: var(--positive-ink); background: var(--positive-surface); }
.signal-copy, .signal-proof { min-width: 0; }
.signal h4 { font-size: 18px; margin-bottom: 6px; }
.signal-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.signal p { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.signal .signal-facts { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.signal .signal-dates, .signal .signal-group-note { color: var(--muted); font-size: 12px; }
.signal .signal-action { border-left: 2px solid var(--border); padding: 0 0 0 12px; margin-top: 10px; color: var(--ink); }
.signal-evidence { border-radius: 5px; background: var(--evidence); padding: 16px 18px; margin-bottom: 8px; }
.signal-evidence-label { display: block; color: var(--muted); font-size: 12px; }
.signal-evidence p { margin: 10px 0; white-space: pre-wrap; }
.signal-evidence a { font-size: 12px; }
.signal-subtopic { margin-top: 14px; }
.text-button, .theme-link { border: 0; color: var(--ink); background: transparent; min-height: 32px; padding: 4px 0; text-align: left; justify-content: flex-start; font-size: 13px; }
.text-button:hover, .theme-link:hover { color: var(--accent-ink); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.theme-breakdown { padding: 22px 0 18px; }
.theme-breakdown h2 { font-size: 22px; }
.theme-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; text-align: left; }
.theme-table th { color: var(--muted); font-size: 12px; font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.theme-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.theme-table th:first-child, .theme-table td:first-child { padding-left: 0; width: 42%; }
.theme-link { font-size: 14px; font-weight: 500; min-height: 28px; }
.theme-table th:nth-child(2) { width: 8%; }
.theme-table th:nth-child(3) { width: 27%; }
.theme-table td:nth-child(3) { white-space: nowrap; }
.theme-table td:nth-child(3) span { display: inline-block; min-width: 48px; }
.theme-table progress { appearance: none; -webkit-appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); color: var(--ink); width: 140px; max-width: 55%; height: 9px; vertical-align: middle; }
.theme-table progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.theme-table progress::-webkit-progress-value { background: var(--ink); border-radius: 4px; }
.theme-table progress::-moz-progress-bar { background: var(--ink); border-radius: 4px; }
.theme-table td:last-child { color: var(--muted); font-size: 12px; }
.breakdown-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 8px; }
.breakdown-footer p { margin: 0; }
.breakdown-footer button { flex-shrink: 0; }
.theme-details { padding-top: 16px; }
.theme-details h2 { font-size: 20px; margin-bottom: 12px; }
.theme-detail { border-top: 1px solid var(--line); margin: 0; scroll-margin-top: 20px; }
.theme-detail > summary { padding: 16px 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.theme-detail article { padding-top: 4px; border: 0; }
.theme-facts, .theme-dates { font-size: 13px; color: var(--muted); }
.report-method { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 10px; }
.report-method > summary { font-size: 14px; }
.report-coverage dd { font-size: 22px; }
.print-only { display: none; }
.filters { margin: 18px 0; }
#shown { font-size: 13px; color: var(--muted); padding-bottom: 12px; }
article { padding: 20px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
article h3 { margin: 12px 0 8px; }
article p { margin: 0 0 12px; white-space: pre-wrap; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.rating { color: var(--warning-ink); font-weight: 600; }
.source { font-size: 13px; }
details { margin: 12px 0; }
summary { cursor: pointer; padding: 6px 0; min-height: 32px; color: var(--ink); }
summary::-webkit-details-marker { color: var(--muted); }
blockquote { margin: 14px 0; padding: 14px 18px; background: var(--evidence); border-left: 3px solid var(--evidence-border); }
blockquote a, .review-evidence-context { font-size: 12px; overflow-wrap: anywhere; }
.review-evidence-context { display: block; color: var(--muted); margin: 6px 0; }
.related-topic { border-top: 1px solid var(--line); padding: 14px 0; }
.related-topic p { margin: 8px 0; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .collection-panel h1 { font-size: 48px; letter-spacing: -1.5px; }
  .collection-panel { padding-top: 48px; }
  .home-art { margin-top: 8px; }
  .app-header { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .sample-details { grid-column: 1 / -1; }
  .sample-period { max-width: 260px; }
  .signal { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .signal-number { width: 30px; height: 30px; }
  .theme-table progress { width: 70px; }
}
@media (max-width: 620px) {
  .site-header { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
  .site-header > strong, .site-brand { font-size: 18px; }
  /* One row on phones: actions become 44px icon buttons; their text stays
     available to assistive tech, so the accessible name is unchanged. */
  .site-header:has(#header-actions:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto auto; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .header-actions button { width: 44px; padding: 0; }
  .site-header:has(#header-actions:not([hidden])) .header-link { display: none; }
  .header-actions .action-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header .header-account { grid-column: -2; grid-row: 1; }
  .site-header #sign-in { font-size: 13px; padding: 8px; }
  .header-actions button { font-size: 13px; padding: 10px; }
  main { padding: 22px 16px 44px; }
  h1 { font-size: 23px; }
  .app-header { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .app-identity { gap: 14px; }
  .app-icon { width: 56px; height: 56px; }
  .sample-period { border: 0; padding: 0; max-width: none; }
  .sample-details { margin: 12px 0; }
  html:not([data-report-route]) body:has(#collection-panel:not([hidden])) .site-header { min-height: 68px; padding: 12px 20px; display: flex; }
  html:not([data-report-route]) body:has(#collection-panel:not([hidden])) .icon-brand { width: 24px; height: 24px; flex-basis: 24px; }
  html:not([data-report-route]) body:has(#collection-panel:not([hidden])) #error { width: calc(100% - 40px); }
  .collection-panel { padding-top: 34px; }
  .entry-content { width: calc(100% - 40px); }
  .collection-panel h1 { font-size: 34px; letter-spacing: -1px; line-height: 1.12; margin-bottom: 30px; max-width: 420px; margin-left: auto; margin-right: auto; }
  .collection-panel form { gap: 22px; }
  .collection-panel .analysis-input { gap: 12px; }
  .collection-panel .analysis-input input, .collection-panel .analysis-input > button { min-height: 52px; }
  .collection-panel .sample-options { gap: 18px 12px; }
  .home-art { height: auto; min-height: 203px; aspect-ratio: 8 / 3; margin-top: 8px;
    mask-image: linear-gradient(to right, transparent, #000 8%, #000 94%, transparent),
      linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
  }
  .home-art img { width: max(540px, 100%); max-width: none; margin-left: min(0px, calc(100% - 540px)); }
  .home-end { margin: 4px 20px 0; flex-direction: column; gap: 6px; }
  .home-end::before, .home-end::after { display: none; }
  .entry-lede { margin: -16px auto 26px; font-size: 15px; max-width: 420px; }
  .analysis-input { display: grid; grid-template-columns: minmax(0, 1fr); }
  .sample-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 12px; }
  .sample-options > label:first-child { grid-column: 1 / -1; }
  dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-overview h2 { font-size: 22px; }
  .signal { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 20px 0; }
  .signal h4 { font-size: 17px; }
  .signal-proof { grid-column: 2; }
  .signal-evidence { padding: 14px; }
  .theme-table th:first-child, .theme-table td:first-child { width: 53%; }
  .theme-table th:nth-child(2) { width: 14%; }
  .theme-table th:nth-child(3) { width: 33%; }
  .theme-table th, .theme-table td { padding: 10px 6px; }
  .theme-table th:last-child, .theme-table td:last-child { display: none; }
  .theme-table progress { display: none; }
  .theme-link { font-size: 13px; }
  .breakdown-footer { flex-direction: column; gap: 8px; }
  .search-field { flex-basis: 100%; }
  .sample-heading { flex-wrap: wrap; }
  .analysis-progress-head { flex-direction: column; gap: 8px; }
  .analysis-progress { padding-top: 40px; }
  .analysis-progress-head h2 { font-size: 24px; }
  .processing-stages { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .processing-stages li { grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 12px; }
  .processing-stages li:not(:last-child)::after { top: 26px; left: 11px; right: auto; bottom: -12px; width: 2px; height: auto;
    background: linear-gradient(to bottom, var(--accent-ink) 50%, var(--line) 50%) bottom / 100% 200% no-repeat; }
  .processing-stages li[data-state='done']::after { background-position: top; }
}
@media (max-width: 360px) {
  .collection-panel h1 { font-size: 32px; }
  html:not([data-report-route]) body:has(#collection-panel:not([hidden])) .site-header > strong,
  html:not([data-report-route]) body:has(#collection-panel:not([hidden])) .site-brand { font-size: 16px; gap: 8px; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  :root { color: #111; background: #fff; font-size: 11pt; }
  header, .collection-panel, .report-navigation, .report-loading, #status, #error, #sample > :not(#analysis), .report-actions,
  #analysis-version-label, #analysis-status, #export-status, #analysis-progress, .text-button, .all-matching { display: none !important; }
  main { max-width: none; padding: 0; }
  #sample, #analysis { display: block !important; }
  .print-only { display: block; font-size: 10pt; }
  #report article, .signal, .related-topic, blockquote { break-inside: avoid; }
}

/* Core destinations for signed-in people: always in the header, never only
   inside the account menu. A thin rule separates them from the brand. */
.app-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; padding-left: 14px; border-left: 1px solid var(--line); }
.site-header:has(> .app-nav:not([hidden])) > :first-child { margin-right: 4px; }
.app-nav a { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 8px; color: var(--muted);
  font-size: 14px; font-weight: 500; text-decoration: none; transition: color .15s, background-color .15s; }

.app-nav a:hover { color: var(--ink); background: var(--surface); }
.app-nav a[aria-current='page'] { color: var(--ink); font-weight: 600; }
.app-nav a[aria-current='page']::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 2px; background: var(--accent); }
.plans-header:has(#app-nav:not([hidden])) .plans-nav > a[href='/#new'] { display: none; }
@media (max-width: 620px) {
  .site-header:has(> .app-nav:not([hidden])) { flex-wrap: wrap; row-gap: 10px; }
  .site-header:has(> .app-nav:not([hidden])) > :first-child { margin-right: auto; }
  .app-nav { order: 10; flex: 1 1 100%; grid-column: 1 / -1; grid-row: 2; margin: 0; padding: 3px; gap: 0; border: 0; border-radius: 10px; background: var(--surface); }
  .app-nav a { flex: 1; justify-content: center; min-height: 38px; padding: 6px 8px; font-size: 13px; }
  .app-nav a:hover { background: transparent; }
  .app-nav a[aria-current='page'] { background: var(--paper); box-shadow: 0 1px 2px #1115191f, 0 0 0 1px var(--line); }
  .app-nav a[aria-current='page']::after { left: 50%; right: auto; width: 16px; margin-left: -8px; bottom: 3px; height: 2px; }
}
@media (prefers-reduced-motion: reduce) { .app-nav a:not([hidden]) { animation: none; } .app-nav a { transition: none; } }

/* Recent work loads without stacked entrance animations. */
.home-work { position: relative; z-index: 1; width: min(1000px, calc(100% - 64px)); margin: 46px auto 0; display: grid; gap: 14px; }
.home-work-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.home-work-head h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.home-work-head a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.home-work-head a:hover { color: var(--ink); }
.home-work-head .icon { width: 14px; height: 14px; flex-basis: 14px; }
.home-work-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.work-card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; align-items: center; gap: 14px; min-height: 84px; padding: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 2px #11151908; transition: border-color .18s, box-shadow .18s, transform .18s; }
.work-card:hover { color: var(--ink); border-color: var(--border); box-shadow: 0 10px 28px -14px #1115193d; transform: translateY(-2px); }

.work-icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.work-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-letter { color: var(--muted); font-size: 18px; font-weight: 700; }
.work-copy { display: grid; gap: 1px; min-width: 0; }
.work-kicker { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-meta { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work-arrow { width: 16px; height: 16px; flex-basis: 16px; color: var(--muted); transition: transform .18s, color .18s; }
.work-card:hover .work-arrow { transform: translateX(3px); color: var(--ink); }
.work-full .work-kicker { color: var(--positive-ink); font-weight: 600; }
/* The tracked app leads, in the brand's ink with a lime edge. */
.work-track { border-color: var(--ink); background: var(--ink); color: #f4f6f6; }
.work-track:hover { color: #fff; border-color: var(--ink); }
.work-track::before { content: ''; position: absolute; left: 16px; right: 16px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.work-track .work-kicker { color: var(--accent); font-weight: 600; }
.work-track .work-meta, .work-track .work-arrow { color: #b9c0c5; }
.work-track:hover .work-arrow { color: var(--accent); }
.work-track .work-icon { border-color: #ffffff26; background: #ffffff14; }
.work-track .work-letter { color: #d6dbde; }
.work-track.tone-warning .work-kicker { color: #f2b860; }
.work-start { border-style: dashed; border-color: var(--border); background: transparent; box-shadow: none; }
.work-start .work-icon { background: var(--lime-wash, #f5fbe0); border-color: transparent; }
.work-start .work-letter { color: var(--accent-ink); }
.home-work-note { margin: 0; color: var(--muted); font-size: 13px; }
.home-work-note a { color: var(--ink); }
@media (max-width: 620px) {
  .home-work { width: calc(100% - 40px); margin-top: 34px; }
  .home-work-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .work-card { min-height: 72px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-work, .home-work-list > * { animation: none; }
  .work-card, .work-arrow { transition: none; }
  .work-card:hover { transform: none; }
}

/* The signed-in allowance can arrive after the form. Keep its space stable. */
html[data-signed-in] .entry-billing { min-height: 96px; }
@media (max-width: 640px) { html[data-signed-in] .entry-billing { min-height: 144px; } }

/* ---- Loading. One quiet language on every page:
   - placeholders have the real layout's shape, so nothing moves when data lands;
   - they appear only if a read takes longer than ~0.2s (fast loads show nothing);
   - one soft highlight sweeps across all of them in sync (fixed background);
   - placeholders and content share a spot and cross-fade, never a blank frame. */
.sk { display: block; border-radius: 6px; background: linear-gradient(100deg, #edf0f1 0 42%, #f8f9fa 50%, #edf0f1 58% 100%) 0 0 / 200vw 100% fixed;
  animation: sk-sweep 1.5s linear infinite; }
.sk-line { height: 12px; width: 100%; }
.sk-title { height: 18px; width: 42%; }
.sk-tile { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 11px; }
.sk-wrap { animation: sk-appear .24s ease-out .18s both; }
@keyframes sk-sweep { from { background-position: 100vw 0; } to { background-position: -100vw 0; } }
@keyframes sk-appear { from { opacity: 0; } }
/* Placeholders on their way out sit over the arriving content and fade. */
.sk-wrap[data-leaving] { animation: sk-leave .22s ease-in both; pointer-events: none; }
@keyframes sk-leave { from { opacity: var(--sk-from, 1); } to { opacity: 0; } }
@keyframes content-arrive { from { opacity: 0; } }
.arrive { animation: content-arrive .26s ease-out both; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Home: recent work keeps its place from the first paint for signed-in people. */
.home-work[data-state='loading'] { display: none; }
html[data-signed-in] .home-work[data-state='loading'] { display: grid; }
.home-work-stage { display: grid; }
.home-work-stage > * { grid-area: 1 / 1; }
.home-work-skeleton { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-content: start; }
.home-work-skeleton > div { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 84px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.home-work-skeleton .sk-tile { width: 44px; height: 44px; border-radius: 10px; }
.home-work-skeleton > div > span:last-child { display: grid; gap: 8px; }
.home-work-skeleton .sk-line:last-child { width: 70%; }
.home-work-head .sk-title { width: 180px; height: 15px; }
.home-work[data-state='empty'] { animation: sk-leave .2s ease-in both; }
@media (max-width: 620px) {
  .home-work-skeleton { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .home-work-skeleton > div { min-height: 72px; padding: 14px; }
  .home-work-skeleton > div:nth-child(n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; background: #eef1f2; }
  .sk-wrap, .sk-wrap[data-leaving], .arrive, .home-work[data-state='empty'] { animation: none; }
  .sk-wrap[data-leaving] { opacity: 0; }
}
