:root {
  --bg: #f7f3ea;
  --surface: #fffdf7;
  --ink: #1c1b18;
  --muted: #5f5a50;
  --line: #d8ceb9;
  --accent: #0d5c63;
  --accent-soft: #d8ecee;
  --warning: #7b2d00;
  --warning-soft: #ffe7d1;
  --badge: #ece4d4;
  --focus: #1f6feb;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

body.pref-large-text {
  font-size: 1.15rem;
}

body.pref-line-spacing {
  line-height: 1.95;
}

body.pref-readable-font {
  font-family: Verdana, Tahoma, sans-serif;
}

body.pref-high-contrast {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #000000;
  --muted: #222222;
  --line: #000000;
  --accent: #003b49;
  --accent-soft: #e8f7fa;
  --warning: #5a1a00;
  --warning-soft: #fff1e6;
  --badge: #f0f0f0;
  --focus: #0047ff;
}

body.pref-simple-mode .source-metadata,
body.pref-simple-mode .secondary-detail,
body.pref-simple-mode .depth-nav {
  display: none;
}

.technical-detail {
  display: none !important;
}

body.pref-show-technical .technical-detail {
  display: revert !important;
}

body.pref-show-technical span.technical-detail,
body.pref-show-technical .badge.technical-detail {
  display: inline-block !important;
}

body.pref-show-technical .badges.technical-detail {
  display: flex !important;
}

body.pref-show-technical p.technical-detail,
body.pref-show-technical dl.technical-detail,
body.pref-show-technical section.technical-detail {
  display: block !important;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

a:focus,
button:focus,
input:focus,
select:focus,
summary:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header,
.layout {
  width: min(64rem, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  padding: 2rem 0 1rem;
}

.site-header h1 {
  margin: 0.25rem 0;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1.05;
}

.lead {
  max-width: 45rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.prototype-label,
.depth-label,
.review-note {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.25rem 0.55rem;
  border: 2px solid var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 700;
}

.review-note {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0 3rem;
}

.layout > * {
  min-width: 0;
}

.panel,
.preferences-panel,
.trace-card,
.answer-card,
.nested-card,
.source-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1rem;
}

.panel h2,
.trace-card h3,
.answer-card h3 {
  margin-top: 0;
}

.preferences-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.preferences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.preferences-grid label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.preferences-grid .language-choice {
  align-items: flex-start;
  flex-direction: column;
}

select {
  max-width: 16rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font: inherit;
}

.question-list {
  display: grid;
  gap: 1rem;
  padding-left: 1.25rem;
}

.question-list li {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.question-list li:last-child {
  border-bottom: 0;
}

.meta,
.note {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.warning {
  border-left: 0.35rem solid var(--warning);
  padding: 0.5rem 0.75rem;
  background: var(--warning-soft);
  color: var(--warning);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--badge);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.depth-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.depth-nav a {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 700;
}

.depth-panel {
  scroll-margin-top: 1rem;
}

.trace-card,
.answer-card {
  margin-top: 1rem;
}

.nested-card,
.source-card {
  margin-top: 0.75rem;
  background: #fffaf0;
}

.pref-high-contrast .nested-card,
.pref-high-contrast .source-card {
  background: #ffffff;
}

.chain {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 0.3rem solid var(--accent);
  background: var(--accent-soft);
}

dl {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) 1fr;
  gap: 0.35rem 1rem;
}

dt {
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

input[type="text"] {
  width: 100%;
  max-width: 40rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font: inherit;
}

input[disabled] {
  opacity: 0.85;
}

@media (max-width: 42rem) {
  html {
    font-size: 17px;
  }

  dl,
  .preferences-grid {
    grid-template-columns: 1fr;
  }
}

/* Visual Section Hierarchy */
.depth-panel {
  border-width: 2px;
  border-left-width: 0.65rem;
  box-shadow: 0 0.35rem 1rem rgba(28, 27, 24, 0.06);
}

.depth-short-answer {
  border-color: #0b5cad;
  background: linear-gradient(90deg, #eaf4ff 0, var(--surface) 28%);
}

.depth-key-points {
  border-color: #24753a;
  background: linear-gradient(90deg, #ecf8ef 0, var(--surface) 28%);
}

.depth-reasoning {
  border-color: #9a6a00;
  background: linear-gradient(90deg, #fff5cf 0, var(--surface) 28%);
}

.depth-sources {
  border-color: #1f1f1f;
  background: linear-gradient(90deg, #eeeeee 0, var(--surface) 28%);
}

.depth-short-answer .depth-label {
  border-color: #0b5cad;
  background: #eaf4ff;
  color: #063a70;
}

.depth-key-points .depth-label {
  border-color: #24753a;
  background: #ecf8ef;
  color: #154b24;
}

.depth-reasoning .depth-label {
  border-color: #9a6a00;
  background: #fff5cf;
  color: #4f3600;
}

.depth-sources .depth-label {
  border-color: #1f1f1f;
  background: #eeeeee;
  color: #111111;
}

.reasoning-card {
  border-left: 0.45rem solid #9a6a00;
}

.evidence-card {
  border-left: 0.35rem solid #0b5cad;
  background: #f3f9ff;
}

.source-chain-card {
  border-left: 0.45rem solid #1f1f1f;
}

.depth-sources .evidence-card {
  border-left-color: #5a5a5a;
  background: #f6f6f6;
}

.source-quote-card {
  border-left: 0.35rem solid #4d6380;
  background: #f9fbff;
}

.depth-panel h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.depth-panel h2,
.trace-card h3,
.nested-card h4,
.nested-card h5,
.source-card h5,
.source-card h6 {
  letter-spacing: -0.01em;
}

.pref-high-contrast .depth-panel,
.pref-high-contrast .reasoning-card,
.pref-high-contrast .evidence-card,
.pref-high-contrast .source-chain-card,
.pref-high-contrast .source-quote-card {
  border-color: #000000;
  background: #ffffff;
  box-shadow: none;
}

.pref-high-contrast .depth-label {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}
.balanced-pattern {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.pattern-chip {
  display: inline-block;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-weight: 700;
}

.pattern-chip.opportunity {
  border-color: #0b5cad;
  background: #eaf4ff;
  color: #063a70;
}

.pattern-chip.challenge {
  border-color: #b45f00;
  background: #fff0df;
  color: #6a3300;
}

.pattern-chip.uncertainty {
  border-color: #6b6b6b;
  background: #ffffff;
  color: #222222;
}

.pref-high-contrast .pattern-chip {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}
/* Visual Hierarchy Round 3 */
.depth-panel {
  border-left-width: 5px;
  border-top-width: 2px;
  border-bottom-width: 1px;
}

.reasoning-card,
.source-chain-card {
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
  border-left-width: 5px;
  border-top: 2px solid #9a6a00;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid rgba(154, 106, 0, 0.45);
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}

.source-chain-card {
  border-top-color: #1f1f1f;
  border-bottom-color: rgba(31, 31, 31, 0.35);
}

.reasoning-card + .reasoning-card,
.source-chain-card + .source-chain-card {
  margin-top: 2rem;
}

.reasoning-card h3,
.source-chain-card h3 {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(28, 27, 24, 0.16);
}

.evidence-card,
.source-quote-card {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-left-width: 5px;
  border-top: 2px solid currentColor;
  border-bottom: 1px solid rgba(28, 27, 24, 0.15);
}

.source-quote-card {
  border-top-color: #4d6380;
}

.pref-high-contrast .depth-panel,
.pref-high-contrast .reasoning-card,
.pref-high-contrast .source-chain-card,
.pref-high-contrast .evidence-card,
.pref-high-contrast .source-quote-card {
  border-left-width: 5px;
  border-top: 2px solid #000000;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
}
/* Canonical depth headings */
h2.depth-label {
  display: inline-block;
  margin: 0 0 0.85rem;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  line-height: 1.2;
}

.section-subtitle {
  margin-top: -0.25rem;
  color: var(--muted);
  font-weight: 700;
}
/* Collapsible depth sections */
.depth-heading {
  margin: 0 0 0.85rem;
}

.depth-toggle.depth-label {
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.depth-toggle.depth-label:hover {
  filter: brightness(0.98);
}

.toggle-icon {
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 160ms ease;
}

.depth-toggle[aria-expanded="false"] .toggle-icon {
  transform: rotate(-90deg);
}

.collapsible-content[hidden] {
  display: none;
}
.depth-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: -0.25rem 0 0.75rem;
}

.depth-controls button {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.depth-controls button:hover {
  background: var(--accent-soft);
}

.pref-high-contrast .depth-controls button {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}
/* User Interest Taxonomy prototype */
.interest-nav-panel {
  border-left: 5px solid var(--accent);
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.interest-card {
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 0.75rem;
  background: #fffaf0;
  padding: 0.85rem;
}

.interest-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
}

.interest-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.interest-card li + li {
  margin-top: 0.25rem;
}

.pref-high-contrast .interest-nav-panel,
.pref-high-contrast .interest-card {
  border-color: #000000;
  background: #ffffff;
}

/* Expanded User Interest Taxonomy prototype */
.interest-section {
  --section-accent: #2f747a;
  --section-soft: #e6f2f1;
  --section-card: #fbfdfb;
  margin-top: 1.25rem;
}

.interest-section h3 {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--section-accent);
  border-left-width: 5px;
  border-radius: 0.7rem;
  background: var(--section-soft);
  font-size: clamp(1.2rem, 3vw, 1.45rem);
}

.interest-section--tone-1 {
  --section-accent: #397a72;
  --section-soft: #e4f2ed;
  --section-card: #f8fcf9;
}

.interest-section--tone-2 {
  --section-accent: #9a6a22;
  --section-soft: #f8edcf;
  --section-card: #fffaf0;
}

.interest-section--tone-3 {
  --section-accent: #39708e;
  --section-soft: #e5f0f6;
  --section-card: #f8fbfd;
}

.interest-section--tone-4 {
  --section-accent: #6f5d8b;
  --section-soft: #eee9f5;
  --section-card: #fbf9fd;
}

.interest-section--tone-5 {
  --section-accent: #965b6c;
  --section-soft: #f6e8ed;
  --section-card: #fdf9fa;
}

.interest-section .interest-card {
  border-top-color: var(--section-accent);
  background: var(--section-card);
}

.interest-card h4 {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 0.65rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--section-accent);
  border-radius: 999px;
  background: var(--section-soft);
  font-size: 1.05rem;
  line-height: 1.25;
}

.interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.interest-chips span {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.92rem;
}

.pref-high-contrast .interest-chips span {
  border-color: #000000;
}

/* Front page IA cleanup */
.top-preferences {
  width: min(64rem, calc(100% - 2rem));
  margin: 0 auto;
  padding-top: 1rem;
}

.top-preferences .preferences-panel {
  margin-bottom: 0;
}

.full-width {
  grid-column: 1 / -1;
}

.process-panel {
  border-left: 5px solid #b07a3b;
  border-top: 2px solid #b07a3b;
  background: #f7f0df;
}

.process-panel h2 {
  margin-top: 0;
}

.process-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.process-chips span {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border: 1px solid #b07a3b;
  border-radius: 999px;
  background: #fff9ec;
  font-weight: 700;
}

.search-panel input[type="text"] {
  max-width: none;
}

.about-panel summary {
  cursor: pointer;
  color: var(--accent);
}

.about-panel summary h2 {
  display: inline;
  margin: 0;
}

.about-content {
  margin-top: 1rem;
}

.pref-high-contrast .process-panel,
.pref-high-contrast .process-chips span {
  border-color: #000000;
  background: #ffffff;
}
/* Front page supporting card polish */
.top-preferences .preferences-panel,
.search-panel,
.about-panel {
  border-left-width: 5px;
  border-top-width: 2px;
  box-shadow: 0 0.3rem 0.9rem rgba(28, 27, 24, 0.055);
}

.top-preferences .preferences-panel {
  border-left-color: #0d6b78;
  border-top-color: #0d6b78;
  background: linear-gradient(90deg, #e9f6f7 0, var(--surface) 22%);
}

.search-panel {
  border-left-color: #1f6feb;
  border-top-color: #1f6feb;
  background: linear-gradient(90deg, #edf5ff 0, var(--surface) 22%);
}

.about-panel {
  border-left-color: #4d6380;
  border-top-color: #4d6380;
  background: linear-gradient(90deg, #f0f4f8 0, var(--surface) 22%);
}

.pref-high-contrast .top-preferences .preferences-panel,
.pref-high-contrast .search-panel,
.pref-high-contrast .about-panel {
  border-color: #000000;
  background: #ffffff;
  box-shadow: none;
}
/* Search-gap proof-of-concept */
.search-form {
  margin-top: 0.75rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.search-row input[type="search"] {
  flex: 1 1 18rem;
  min-width: 0;
}

.search-results {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.search-result-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.search-result-list li + li {
  margin-top: 0.45rem;
}

.result-context {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
}

.search-gap-box {
  margin-top: 0.9rem;
  padding: 1rem;
  border-left: 5px solid #b07a3b;
  border-top: 2px solid #b07a3b;
  border-radius: 0.75rem;
  background: #fff9ec;
}

.search-gap-form {
  margin: 0.85rem 0;
}

.success-message {
  padding: 0.85rem 1rem;
  border-left: 5px solid #2d7a42;
  border-radius: 0.65rem;
  background: #edf8ef;
  font-weight: 700;
}

.pref-high-contrast .search-results,
.pref-high-contrast .search-gap-box,
.pref-high-contrast .success-message {
  border-color: #000000;
  background: #ffffff;
}
/* Minimal owner-only search gap review */
.admin-layout {
  display: block;
}

.admin-panel {
  max-width: 100%;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: end;
  margin: 1rem 0;
}

.admin-login-form,
.status-filter-form,
.gap-action-form {
  display: grid;
  gap: 0.5rem;
}

.search-gap-table-wrap {
  overflow-x: auto;
}

.search-gap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.search-gap-table th,
.search-gap-table td {
  padding: 0.55rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.search-gap-table th {
  background: #eef4fb;
}

.gap-action-form textarea {
  width: min(28rem, 100%);
}

.gap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pref-high-contrast .search-gap-table th,
.pref-high-contrast .search-gap-table td {
  border-color: #000000;
}

.pref-high-contrast .search-gap-table th {
  background: #ffffff;
}
.status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.status-counts span,
.status-counts a {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f0df;
  font-weight: 700;
}

.pref-high-contrast .status-counts span,
.pref-high-contrast .status-counts a {
  border-color: #000000;
  background: #ffffff;
}
.admin-diagnostics {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 5px solid #4d6380;
  border-top: 2px solid #4d6380;
  border-radius: 0.75rem;
  background: #f0f4f8;
}

.admin-diagnostics dl {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.4rem 0.8rem;
}

.admin-diagnostics dt {
  font-weight: 700;
}

.admin-diagnostics dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pref-high-contrast .admin-diagnostics {
  border-color: #000000;
  background: #ffffff;
}
/* Editorial workbench */
.editor-workbench {
    display: grid;
    grid-template-columns: minmax(16rem, 0.9fr) minmax(20rem, 1.4fr);
    gap: 1.25rem;
    align-items: start;
}

.search-gap-list,
.gap-detail-panel {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(32, 64, 96, 0.16);
    border-left: 5px solid #467aa0;
    border-top: 2px solid #467aa0;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 10px 28px rgba(31, 49, 72, 0.08);
}

.gap-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.gap-card a {
    display: grid;
    gap: 0.3rem;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(32, 64, 96, 0.16);
    background: #fffdf8;
    text-decoration: none;
    color: inherit;
}

.gap-card.is-selected a,
.gap-card a:focus,
.gap-card a:hover {
    border-color: #2f75d6;
    box-shadow: 0 0 0 3px rgba(47, 117, 214, 0.18);
}

.gap-card-query {
    font-weight: 700;
}

.gap-card-meta {
    color: #5a6572;
    font-size: 0.9rem;
}

.gap-detail-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 0.8rem;
    margin-bottom: 1rem;
}

.gap-detail-meta dt {
    font-weight: 700;
}

.gap-detail-form {
    display: grid;
    gap: 0.65rem;
}

.gap-detail-form input,
.gap-detail-form select,
.gap-detail-form textarea,
.status-filter-form input {
    width: 100%;
    max-width: 100%;
    font: inherit;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(32, 64, 96, 0.28);
    border-radius: 8px;
    background: #fff;
}

.detail-actions,
.secondary-actions {
    margin-top: 0.5rem;
}

.status-counts a {
    color: inherit;
    text-decoration: none;
}

.status-counts a:focus,
.status-counts a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .editor-workbench {
        grid-template-columns: 1fr;
    }

    .gap-detail-meta {
        grid-template-columns: 1fr;
    }
}

body.high-contrast .search-gap-list,
body.high-contrast .gap-detail-panel,
body.high-contrast .gap-card a {
    border-color: currentColor;
    box-shadow: none;
}
/* Editor preview panel */
.editor-preview {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 5px solid #b07a3b;
  border-top: 2px solid #b07a3b;
  border-radius: 0.75rem;
  background: #fff9ec;
  box-shadow: 0 8px 24px rgba(31, 49, 72, 0.06);
}

.editor-preview h4 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.editor-preview dl {
  margin: 0;
}

.pref-high-contrast .editor-preview {
  border-color: #000000;
  background: #ffffff;
  box-shadow: none;
}
/* Draft package review workflow */
.draft-workflow-panel,
.draft-preview-panel,
.review-prompt-panel {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 5px solid #467aa0;
  border-top: 2px solid #467aa0;
  border-radius: 0.75rem;
  background: #f5f9fd;
  box-shadow: 0 8px 24px rgba(31, 49, 72, 0.06);
}

.draft-preview-panel {
  border-left-color: #2d7a42;
  border-top-color: #2d7a42;
  background: #f2fbf4;
}

.review-prompt-panel {
  border-left-color: #b07a3b;
  border-top-color: #b07a3b;
  background: #fff9ec;
}

.button-link {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.button-link:focus,
.button-link:hover {
  background: var(--accent-soft);
}

.draft-preview-section {
  margin: 0.8rem 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}

.draft-preview-section h5,
.review-prompt-panel h5 {
  margin: 0 0 0.5rem;
}

.draft-preview-section pre,
.review-prompt-panel textarea {
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.95rem/1.55 Consolas, "Courier New", monospace;
}

.draft-preview-section pre {
  margin: 0;
}

.review-prompt-panel textarea {
  min-height: 16rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #ffffff;
  color: var(--ink);
}

.pref-high-contrast .draft-workflow-panel,
.pref-high-contrast .draft-preview-panel,
.pref-high-contrast .review-prompt-panel,
.pref-high-contrast .draft-preview-section,
.pref-high-contrast .button-link,
.pref-high-contrast .review-prompt-panel textarea {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}
/* Workbench UX correction */
.review-prompt-source {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.review-prompt-source.is-visible-fallback {
  position: static;
  width: 100%;
  height: auto;
  min-height: 14rem;
  opacity: 1;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #ffffff;
  color: var(--ink);
  font: 0.95rem/1.55 Consolas, "Courier New", monospace;
}

.copy-confirmation {
  margin: 0.75rem 0;
  padding: 0.65rem 0.8rem;
  border-left: 5px solid #2d7a42;
  border-radius: 0.65rem;
  background: #edf8ef;
  font-weight: 700;
}

.copy-fallback {
  margin-top: 0.75rem;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.workflow-actions form,
.workflow-actions div {
  margin: 0;
}

.editor-details {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.58);
}

.editor-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.editor-details .gap-detail-form {
  margin-top: 1rem;
}

.pref-high-contrast .review-prompt-source.is-visible-fallback,
.pref-high-contrast .copy-confirmation,
.pref-high-contrast .workflow-actions,
.pref-high-contrast .editor-details {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

/* Reader feedback */
.feedback-panel {
  border-left: 5px solid #456a8f;
  border-top: 2px solid #456a8f;
  background: #f7fafc;
}

.feedback-dialog {
  max-width: min(42rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.25rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1.2rem 3rem rgba(28, 36, 46, 0.24);
}

.feedback-dialog::backdrop {
  background: rgba(28, 36, 46, 0.38);
}

.feedback-form {
  display: grid;
  gap: 0.75rem;
}

.feedback-form label {
  font-weight: 700;
}

.feedback-form select,
.feedback-form textarea {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font: inherit;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.feedback-table {
  width: 100%;
  border-collapse: collapse;
}

.feedback-table th,
.feedback-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.feedback-text-cell {
  max-width: 34rem;
}

.pref-high-contrast .feedback-panel,
.pref-high-contrast .feedback-dialog,
.pref-high-contrast .feedback-form select,
.pref-high-contrast .feedback-form textarea,
.pref-high-contrast .feedback-table th,
.pref-high-contrast .feedback-table td {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}
/* Front-page navigation overflow */
.interest-card {
  display: flex;
  flex-direction: column;
  min-height: 12.5rem;
}

.nav-chip-list {
  align-content: start;
}

.interest-card .nav-chip-list {
  flex-direction: column;
  flex-wrap: nowrap;
  width: 100%;
}

.interest-card a.nav-pill--published,
.process-panel a.nav-pill--published {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interest-card a.nav-pill--published {
  display: block;
  width: 100%;
  margin: 0;
}

.interest-chips .nav-pill,
.process-chips .nav-pill,
.nav-pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  margin: 0.2rem 0;
  border-radius: 999px;
  line-height: 1.2;
  text-decoration: none;
}

.category-overflow-link {
  margin: auto 0 0;
  padding-top: 0.75rem;
  text-align: right;
  font-size: 0.94rem;
  font-weight: 700;
}

.category-overflow-link a {
  color: var(--accent);
}

.category-view-panel .nav-chip-list {
  margin-top: 1rem;
}

.category-view-panel .nav-pill {
  margin-bottom: 0.35rem;
}

.pref-high-contrast .nav-pill,
.pref-high-contrast .category-overflow-link a {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}
/* Navigation pills: published = clickable teal pill; inactive = neutral non-clickable pill; overflow = navigation pill. */
a.nav-pill--published {
  border: 1px solid #006d6f;
  color: #006d6f;
  background: #f3fffb;
  font-weight: 700;
  text-decoration: none;
}

a.nav-pill--published:hover,
a.nav-pill--published:focus {
  border-color: #004f51;
  background: #e5f7f0;
  color: #004f51;
  text-decoration: underline;
}

.process-panel a.nav-pill--featured {
  border: 2px solid #0d6b78;
  background: #cfeaec;
  color: #073f46;
  box-shadow: 0 0.18rem 0.45rem rgba(13, 92, 99, 0.14);
  font-weight: 800;
}

.process-panel a.nav-pill--featured:hover,
.process-panel a.nav-pill--featured:focus {
  border-color: #074d57;
  background: #bde0e3;
  color: #052f35;
}

.nav-pill--inactive {
  border: 1px solid #d8c7a8;
  color: #111111;
  background: #fffaf0;
  cursor: default;
  text-decoration: none;
}

.nav-pill--inactive:hover,
.nav-pill--inactive:focus {
  border-color: #d8c7a8;
  background: #fffaf0;
  color: #111111;
  text-decoration: none;
}

a.nav-pill--overflow {
  border: 1px solid #7c8ea0;
  color: #36556f;
  background: #edf3f7;
  font-weight: 700;
  text-decoration: none;
}

a.nav-pill--overflow:hover,
a.nav-pill--overflow:focus {
  border-color: #536d84;
  color: #203f58;
  background: #dde9f0;
  text-decoration: underline;
}

.pref-high-contrast .nav-pill--published,
.pref-high-contrast .nav-pill--inactive,
.pref-high-contrast .nav-pill--overflow {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

.pref-high-contrast .interest-section h3,
.pref-high-contrast .interest-card h4,
.pref-high-contrast .process-panel a.nav-pill--featured {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}

@media (max-width: 56rem) {
  .interest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 42rem) {
  .interest-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
#vantar-svar {
    scroll-margin-top: 1rem;
}

/* PR06 Human Review Mode */
.human-review-form {
  display: contents;
}

.human-review-editable,
.inline-edit-shell {
  position: relative;
}

.inline-edit-shell {
  border: 1px dashed rgba(13, 92, 99, 0.38);
  border-radius: 0.65rem;
  background: rgba(216, 236, 238, 0.2);
  padding: 0.85rem;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.inline-edit-shell:hover,
.inline-edit-shell:focus-within {
  border-color: var(--accent);
  background: rgba(216, 236, 238, 0.42);
  box-shadow: 0 0 0 3px rgba(13, 92, 99, 0.1);
}

.inline-edit-content {
  min-height: 2.25rem;
  padding-right: 2.4rem;
  outline: 0;
}

.inline-edit-content p:first-child,
.inline-edit-content ul:first-child,
.inline-edit-content h4:first-child {
  margin-top: 0;
}

.inline-edit-content p:last-child,
.inline-edit-content ul:last-child {
  margin-bottom: 0;
}

.inline-edit-content:focus {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 0.2rem;
}

.inline-edit-indicator {
  position: absolute;
  z-index: 2;
  top: 0.45rem;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.inline-edit-indicator:hover,
.inline-edit-indicator:focus {
  background: var(--accent-soft);
}

.immutable-block-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 0.78rem/1.4 Consolas, "Courier New", monospace;
}

.last-edit-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.workflow-complete-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}

.workflow-complete-list li {
  padding: 0.25rem 0.55rem;
  border: 1px solid #2d7a42;
  border-radius: 999px;
  background: #edf8ef;
  color: #1d5c30;
  font-weight: 700;
}

.workflow-pending {
  padding: 0.55rem 0.75rem;
  border-left: 5px solid #b07a3b;
  background: #fff9ec;
}

.locked-structure {
  position: relative;
}

.locked-structure::after {
  content: "🔒 Læst";
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}

.sticky-review-actions {
  position: sticky;
  z-index: 5;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border: 2px solid var(--accent);
  box-shadow: 0 0.75rem 2rem rgba(28, 27, 24, 0.16);
}

.sticky-review-actions button {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.sticky-review-actions button[disabled] {
  border-color: var(--line);
  background: var(--badge);
  color: var(--muted);
  cursor: not-allowed;
}

.pref-high-contrast .inline-edit-shell,
.pref-high-contrast .inline-edit-indicator,
.pref-high-contrast .workflow-complete-list li,
.pref-high-contrast .workflow-pending,
.pref-high-contrast .sticky-review-actions {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}


/* Human Review AI Toolbox */
.source-excerpt-toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}

.source-excerpt-toolbox-note,
.source-excerpt-prompt-details,
.ai-verification-fallback,
.ai-verification-pending {
  flex-basis: 100%;
}

.source-excerpt-prompt-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.source-excerpt-verification-prompt,
.ai-verification-paste,
.ai-verification-pending textarea,
.ai-verification-pending input,
.ai-verification-pending select {
  width: 100%;
  box-sizing: border-box;
}

.ai-verification-fallback,
.ai-verification-pending {
  margin-top: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f5f9fd;
}

.ai-verification-pending {
  border-left: 5px solid #2d7a42;
  background: #f2fbf4;
}

.ai-verification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.7rem;
}

.ai-verification-grid label {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
}

.ai-verification-grid input,
.ai-verification-grid textarea,
.ai-verification-grid select {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.45rem;
}

.ai-verification-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.copy-confirmation {
  color: #1d5c30;
  font-weight: 700;
}

/* Editorial Tasks admin UI */
.editorial-task-filters {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.editorial-tasks-panel {
  border-left: 5px solid #5d6f85;
}

.editorial-task-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.editorial-task-create-grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.editorial-task-create-grid input,
.editorial-task-create-grid select,
.editorial-task-create-grid textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-weight: 400;
}

.editorial-task-description {
  grid-column: 1 / -1;
}
