:root {
  --ink: #0b1f33;
  --ink-soft: #40566c;
  --paper: #f4f7fa;
  --surface: #ffffff;
  --line: #d7e0e8;
  --teal: #0f776f;
  --teal-soft: #dff4f1;
  --blue: #275d9d;
  --orange: #c85c24;
  --orange-soft: #fff0e7;
  --shadow: 0 14px 34px rgba(15, 39, 64, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }

.masthead {
  min-height: 72px;
  padding: 14px clamp(20px, 4vw, 64px);
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%;
  display: grid; place-items: center; color: #6be0d4; font-weight: 800; letter-spacing: -.05em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: .95rem; letter-spacing: .015em; }
.brand small { color: #adbed0; font-size: .75rem; }
.edition-note { margin: 0; color: #c6d2df; font-size: .82rem; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-submit { color: white; text-decoration-color: #52d3c5; text-underline-offset: 4px; font-size: .86rem; font-weight: 750; }

main { width: min(1440px, 100%); margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 72px; }
.workspace-head {
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start;
  padding: clamp(34px, 4vw, 56px) 0 30px;
}
.eyebrow { margin: 0 0 8px; color: var(--teal); text-transform: uppercase; letter-spacing: .13em; font-size: .74rem; font-weight: 800; }
h1 { max-width: none; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 3.7vw, 3.35rem); line-height: 1; letter-spacing: -.04em; font-weight: 500; white-space: nowrap; }
.intro { max-width: 760px; margin: 24px 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.stats { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(95px, 1fr)); border: 1px solid var(--line); background: rgba(255,255,255,.65); }
.stats div { padding: 18px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats dt { font: 500 2rem/1 Georgia, serif; }
.stats dd { margin: 6px 0 0; color: var(--ink-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

.control-deck {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(280px, 1.2fr) minmax(420px, 1.5fr) minmax(160px, .5fr);
  gap: 18px; padding: 18px; background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.search-box span, .filter-label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.search-box input, select { width: 100%; min-height: 44px; padding: 9px 12px; color: var(--ink); background: #f8fafc; border: 1px solid var(--line); border-radius: 4px; }
.search-box input:focus, select:focus { outline: 3px solid rgba(15,119,111,.18); border-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 44px; padding: 8px 12px; background: #f8fafc; border: 1px solid var(--line); color: var(--ink-soft); border-radius: 999px; cursor: pointer; font-size: .86rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: white; border-color: var(--ink); }

.latest, .mentions, .library { margin-top: 50px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font: 500 clamp(1.8rem, 3vw, 2.7rem)/1.05 Georgia, serif; letter-spacing: -.025em; }
.section-heading > p { max-width: 540px; margin: 0; color: var(--ink-soft); }
.latest-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.latest-card { min-height: 350px; padding: 24px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: rgba(255,255,255,.5); }
.latest-card:last-child { border-right: 0; }
.latest-card .number { color: var(--orange); font: 500 1.5rem/1 Georgia, serif; }
.latest-card h3 { margin: 20px 0 12px; font: 500 1.35rem/1.14 Georgia, serif; }
.latest-card p { color: var(--ink-soft); font-size: .92rem; }
.latest-card button { margin-top: auto; align-self: flex-start; background: none; color: var(--teal); border: 0; border-bottom: 1px solid currentColor; padding: 5px 0; cursor: pointer; font-weight: 700; }

.mentions { padding: clamp(28px, 4vw, 46px); background: var(--ink); color: white; }
.mentions-heading { align-items: start; }
.mentions-heading .eyebrow { color: #6be0d4; }
.mentions-heading > p { color: #b8c8d8; }
.mentions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.18); }
.mention-card { min-height: 330px; padding: 24px; background: #102b45; display: flex; flex-direction: column; }
.mention-meta { display: flex; justify-content: space-between; gap: 16px; color: #aec0d1; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; }
.mention-meta span { color: #6be0d4; font-weight: 800; }
.mention-outlet { margin: 24px 0 6px !important; color: #f0a578 !important; font-size: .74rem !important; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.mention-card h3 { margin: 0 0 12px; font: 500 1.35rem/1.16 Georgia, serif; }
.mention-card > p { margin: 0; color: #c9d4df; font-size: .9rem; }
.mention-card a { margin-top: auto; padding-top: 24px; color: white; text-decoration-color: #6be0d4; text-underline-offset: 4px; font-weight: 750; font-size: .86rem; }
.mention-card a span { color: #6be0d4; }

.library { padding-top: 20px; }
.library.library-prioritized { margin-top: 24px; padding-top: 0; }
.library-heading { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
#result-count { font-size: .9rem; }
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.result-card { background: var(--surface); border: 1px solid var(--line); padding: 22px; min-height: 285px; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.result-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: .75rem; }
.type-tag { color: var(--teal); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.result-card h3 { margin: 18px 0 12px; font: 500 1.3rem/1.2 Georgia, serif; }
.result-card p { margin: 0; color: var(--ink-soft); font-size: .91rem; }
.lens-row { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.lens-pill { padding: 4px 8px; border-radius: 999px; background: var(--teal-soft); color: #095c56; font-size: .72rem; font-weight: 700; }
.result-card button { margin-top: auto; padding-top: 18px; background: none; border: 0; color: var(--ink); cursor: pointer; text-align: left; font-weight: 800; }
.result-card button span { color: var(--orange); }
.empty { padding: 70px 20px; text-align: center; background: white; border: 1px solid var(--line); }
.empty h3 { margin: 0 0 8px; font: 500 1.7rem Georgia, serif; }
.empty p { color: var(--ink-soft); }
.empty button { background: var(--ink); color: white; border: 0; border-radius: 4px; padding: 11px 16px; cursor: pointer; }

dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; box-shadow: 0 30px 90px rgba(5,21,38,.36); }
dialog::backdrop { background: rgba(4,18,32,.72); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; top: 12px; float: right; margin: 12px 12px -54px 0; width: 40px; height: 40px; border: 1px solid var(--line); background: white; border-radius: 50%; cursor: pointer; font-size: 1.5rem; z-index: 1; }
.dialog-inner { padding: clamp(28px, 6vw, 60px); }
.dialog-inner h2 { margin: 12px 50px 20px 0; font: 500 clamp(2rem, 4vw, 3rem)/1.08 Georgia, serif; letter-spacing: -.03em; }
.dialog-inner h3 { margin: 28px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); }
.dialog-inner p { color: var(--ink-soft); }
.source-list { margin: 10px 0 0; padding-left: 20px; }
.source-list a { color: var(--blue); }

.submission-section {
  margin-top: 64px; padding: clamp(30px, 5vw, 56px); background: #e7f2f3; border: 1px solid #bfd5d8;
  display: grid; grid-template-columns: minmax(260px, .72fr) minmax(480px, 1.28fr); gap: clamp(34px, 6vw, 80px); align-items: start;
}
.submission-copy h2 { margin: 0; font: 500 clamp(2rem, 3vw, 2.8rem)/1.05 Georgia, serif; letter-spacing: -.025em; }
.submission-copy > p:not(.eyebrow) { color: var(--ink-soft); font-size: 1rem; }
.submission-criteria { margin: 26px 0 0; padding: 0; list-style: none; border-top: 1px solid #bfd5d8; }
.submission-criteria li { position: relative; padding: 14px 0 14px 26px; border-bottom: 1px solid #bfd5d8; color: var(--ink-soft); font-size: .9rem; }
.submission-criteria li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 900; }
.submission-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-field { min-width: 0; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label, .submission-form > label { display: block; margin-bottom: 7px; color: var(--ink); font-size: .78rem; font-weight: 800; }
.form-field label span { color: var(--ink-soft); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); background: #f8fafc; border: 1px solid var(--line); border-radius: 4px;
}
.form-field textarea { resize: vertical; min-height: 112px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 3px solid rgba(15,119,111,.18); border-color: var(--teal); }
.field-help { margin: 6px 0 0; color: var(--ink-soft); font-size: .76rem; }
.url-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.url-control button, .primary-button { min-height: 46px; padding: 10px 16px; border: 0; border-radius: 4px; background: var(--ink); color: white; cursor: pointer; font-weight: 800; }
.url-control button:disabled, .primary-button:disabled { opacity: .58; cursor: wait; }
.metadata-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px; background: #f5f9f9; border: 1px solid #cfe0e1; }
.metadata-fields input.metadata-auto { color: var(--ink-soft); background: #edf4f4; }
.form-status { margin: 0; padding: 11px 13px; border-left: 4px solid var(--blue); background: #edf4fb; color: var(--ink-soft); font-size: .86rem; }
.form-status[data-kind="success"] { border-color: var(--teal); background: var(--teal-soft); color: #095c56; }
.form-status[data-kind="error"] { border-color: #b42318; background: #fff1f0; color: #8f1d16; }
.form-status[data-kind="notice"] { border-color: var(--orange); background: var(--orange-soft); }
.consent-row { display: grid !important; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: var(--ink-soft) !important; font-weight: 500 !important; }
.consent-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); }
.submission-actions { display: flex; align-items: center; gap: 16px; }
.submission-actions p { margin: 0; color: var(--ink-soft); font-size: .72rem; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.footer-inner { width: min(1312px, 100%); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; }
footer .footer-inner p { width: auto; margin: 0; }
footer a { color: var(--ink); }

.review-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.review-header { display: flex; justify-content: space-between; align-items: start; gap: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.review-header h1, .review-access-card h1 { margin: 0; white-space: normal; font-size: clamp(2.3rem, 5vw, 4.5rem); }
.review-header > div > p:last-child { color: var(--ink-soft); max-width: 680px; }
.review-account { display: grid; gap: 7px; justify-items: end; color: var(--ink-soft); font-size: .82rem; }
.review-account span { color: var(--ink); font-weight: 800; }
.review-account a, .review-access-actions a { color: var(--teal); }
.review-tabs { display: flex; gap: 8px; padding: 24px 0; }
.review-tabs button { min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink-soft); cursor: pointer; font-weight: 750; }
.review-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: white; }
.review-tabs span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: rgba(15,119,111,.12); color: inherit; font-size: .75rem; }
.review-list { display: grid; gap: 18px; }
.review-card { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); background: white; border: 1px solid var(--line); }
.review-card-main { padding: 28px; }
.review-card-side { padding: 26px; background: #f4f7fa; border-left: 1px solid var(--line); }
.review-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
.review-meta span { color: var(--teal); font-weight: 800; }
.review-card h2 { margin: 18px 0 24px; font: 500 1.65rem/1.16 Georgia, serif; }
.review-private-link { border: 0; background: none; padding: 0; text-align: left; color: var(--blue); text-decoration: underline; cursor: pointer; overflow-wrap: anywhere; }
.review-card h2 .review-private-link { color: var(--ink); text-decoration-color: #7fb9b4; text-underline-offset: 4px; }
.review-card h3 { margin: 0 0 6px; color: var(--teal); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; }
.review-card-main > p { margin: 0; color: var(--ink-soft); }
.review-card dl { margin: 0; display: grid; gap: 14px; }
.review-card dl div { border-bottom: 1px solid var(--line); padding-bottom: 11px; }
.review-card dt { color: var(--ink-soft); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.review-card dd { margin: 3px 0 0; font-size: .86rem; }
.review-card dd a { color: var(--blue); }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.review-actions button { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); cursor: pointer; font-weight: 750; font-size: .78rem; }
.review-actions .select-action { background: var(--teal); color: white; border-color: var(--teal); }
.review-empty, .review-error, .review-access-card { padding: 48px; background: white; border: 1px solid var(--line); }
.review-empty h2 { margin: 0 0 8px; font: 500 1.7rem Georgia, serif; }
.review-empty p, .review-access-card > p:not(.eyebrow) { color: var(--ink-soft); }
.review-error { border-left: 4px solid #b42318; color: #8f1d16; padding: 14px 18px; }
.review-access-card { max-width: 720px; margin: 8vh auto 0; }
.review-access-actions { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; }

footer { padding: 28px clamp(20px, 4vw, 64px); background: #e6edf3; color: var(--ink-soft); font-size: .78rem; }
footer p { width: min(1312px, 100%); margin: 0 auto; }

.analytics-footer { padding: 8px clamp(20px, 4vw, 64px) 16px; background: #e6edf3; text-align: right; }
.analytics-footer button { border: 0; background: none; color: var(--ink); font-size: .875rem; text-decoration: underline; cursor: pointer; }
.analytics-panel {
  position: fixed;
  z-index: 30;
  inset: auto 16px max(16px, env(safe-area-inset-bottom)) auto;
  width: min(100% - 32px, 470px);
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 42px rgba(15, 39, 64, .22);
}
.analytics-panel h2 { margin: 0; font: 700 1rem/1.4 Inter, ui-sans-serif, system-ui, sans-serif; }
.analytics-panel p { margin: 5px 0 14px; color: var(--ink-soft); font-size: .875rem; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.analytics-actions button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--teal); border-radius: 4px; background: var(--surface); color: var(--teal); font-weight: 700; font-size: .875rem; cursor: pointer; }
.analytics-actions button:hover { background: var(--teal-soft); }

@media (max-width: 1050px) {
  .workspace-head { grid-template-columns: 1fr; align-items: start; }
  h1 { white-space: normal; }
  .stats { width: min(520px, 100%); }
  .control-deck { position: static; grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .latest-grid { grid-template-columns: repeat(2, 1fr); }
  .latest-card:nth-child(2) { border-right: 0; }
  .latest-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .results { grid-template-columns: repeat(2, 1fr); }
  .mentions-grid { grid-template-columns: repeat(2, 1fr); }
  .submission-section { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .masthead { align-items: flex-start; }
  .edition-note { display: none; }
  .header-actions { gap: 10px; }
  h1 { font-size: 2.65rem; }
  .stats { grid-template-columns: 1fr; }
  .stats div { border-right: 0; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; }
  .stats div:last-child { border-bottom: 0; }
  .control-deck { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .latest-grid, .mentions-grid, .results { grid-template-columns: 1fr; }
  .mentions { padding: 26px 18px; }
  .mention-card { min-height: 0; }
  .latest-card { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .latest-card:last-child { border-bottom: 0; }
  .result-card { min-height: 250px; }
  .submission-section { padding: 26px 18px; }
  .submission-form, .metadata-fields { grid-template-columns: 1fr; padding: 20px; }
  .form-field-wide { grid-column: auto; }
  .url-control { grid-template-columns: 1fr; }
  .submission-actions, .footer-inner, .review-header { align-items: flex-start; flex-direction: column; }
  .review-account { justify-items: start; }
  .review-card { grid-template-columns: 1fr; }
  .review-card-side { border-left: 0; border-top: 1px solid var(--line); }
  .review-shell { width: min(100% - 28px, 1240px); padding-top: 28px; }
  .review-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .result-card { transition: none; }
}
