@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("./assets/fonts/atkinson-hyperlegible-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("./assets/fonts/atkinson-hyperlegible-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f4f5f6;
  --surface: #ffffff;
  --surface-soft: #ededed;
  --surface-raised: #ffffff;
  --text: #172126;
  --text-muted: #526066;
  --text-subtle: #69757a;
  --border: #cfd5d8;
  --border-strong: #9eaaaf;
  --brand-blue: #0093cf;
  --brand-orange: #f2862b;
  --primary: #006f9f;
  --primary-hover: #00587f;
  --primary-soft: #e6f8ff;
  --primary-text: #ffffff;
  --amber: #a64d08;
  --amber-soft: #ffd2ad;
  --red: #b42318;
  --red-soft: #fde8e6;
  --blue: #006f9f;
  --blue-soft: #e6f8ff;
  --green: #207a46;
  --green-soft: #e4f4e9;
  --shadow: 0 14px 42px rgba(23, 33, 31, 0.12);
  --focus: #0093cf;
  --mark: #ffd2ad;
  --mark-text: #482100;
  --header-height: 76px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111619;
  --surface: #192125;
  --surface-soft: #252d31;
  --surface-raised: #20282c;
  --text: #f3f7f5;
  --text-muted: #bcc5c9;
  --text-subtle: #9ba7ac;
  --border: #3d484d;
  --border-strong: #5a686e;
  --brand-blue: #0093cf;
  --brand-orange: #f2862b;
  --primary: #70ccef;
  --primary-hover: #96daf4;
  --primary-soft: #123a4a;
  --primary-text: #072733;
  --amber: #ffad70;
  --amber-soft: #4b2d1c;
  --red: #ff8a80;
  --red-soft: #4b2522;
  --blue: #70ccef;
  --blue-soft: #123a4a;
  --green: #87d7a3;
  --green-soft: #1c422b;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
  --focus: #70ccef;
  --mark: #87420f;
  --mark-text: #fff4ec;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 0;
  overflow-x: clip;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-150%);
  border-radius: 4px;
  background: var(--text);
  color: var(--surface);
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.content-width,
.header-inner {
  width: min(1480px, calc(100% - 48px));
  margin-inline: auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-block,
.header-actions,
.dataset-summary,
.theme-switcher,
.result-identity,
.metadata-row,
.result-actions,
.active-filter-row,
.detail-tags,
.drawer-actions,
.notice-inner {
  display: flex;
  align-items: center;
}

.brand-block {
  min-width: 0;
  gap: 14px;
}

.brand-logo {
  display: block;
  width: 112px;
  height: 44px;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.product-name {
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  justify-content: flex-end;
  gap: 20px;
}

.user-summary {
  display: flex;
  max-width: 220px;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.user-summary > span {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dataset-summary {
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.dataset-summary strong {
  font-size: 18px;
}

.dataset-summary span {
  color: var(--text-muted);
  font-size: 14px;
}

.theme-switcher {
  min-height: 42px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.theme-option {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 9px;
  font-size: 14px;
  font-weight: 700;
}

.theme-option svg {
  width: 17px;
  height: 17px;
}

.theme-option:hover {
  color: var(--text);
}

.theme-option[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(23, 33, 31, 0.12);
}

.sync-notice {
  border-bottom: 1px solid color-mix(in srgb, var(--brand-blue) 45%, var(--border));
  background: var(--primary-soft);
  color: var(--text);
}

.sync-notice .notice-inner svg {
  color: var(--brand-blue);
}

.notice-inner {
  min-height: 44px;
  gap: 10px;
  font-size: 14px;
}

.notice-inner svg {
  flex: 0 0 auto;
  width: 18px;
  color: var(--brand-orange);
}

.search-band {
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.section-heading-row,
.results-toolbar,
.result-title-row,
.detail-summary,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 19px;
}

.primary-search-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(280px, 1fr) minmax(360px, 1.5fr);
  gap: 18px;
  margin-top: 24px;
}

.direct-filter-grid {
  display: grid;
  grid-template-columns: minmax(330px, 1.15fr) minmax(210px, 0.8fr) minmax(230px, 0.9fr) auto;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
}

.field-group {
  position: relative;
  min-width: 0;
}

.field-group > label,
.field-label,
.label-with-help > label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.label-with-help {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

.label-with-help > label {
  margin-bottom: 6px;
}

input,
select,
.multi-combobox {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

input,
select {
  padding: 10px 12px;
}

select {
  padding-right: 34px;
}

input::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}

input:hover,
select:hover,
.multi-combobox:hover {
  border-color: var(--primary);
}

input[aria-invalid="true"] {
  border-color: var(--red);
}

.input-with-icon {
  position: relative;
}

.input-with-icon > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 42px;
}

.multi-combobox {
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
}

.multi-combobox:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--primary);
}

.multi-combobox input {
  width: 150px;
  min-width: 120px;
  flex: 1 1 120px;
  min-height: 34px;
  border: 0;
  outline: 0;
  padding: 4px;
  background: transparent;
}

.multi-combobox input:focus-visible {
  outline: 0;
}

.selection-chips {
  display: contents;
}

.selection-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 5px 3px 9px;
  font-size: 14px;
  font-weight: 700;
}

.selection-chip button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: currentColor;
  padding: 0;
}

.selection-chip button:hover {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.selection-chip svg {
  width: 15px;
  height: 15px;
}

.suggestion-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  list-style: none;
  padding: 5px;
}

.suggestion-list li {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 4px;
  padding: 8px 10px;
}

.suggestion-list li:hover,
.suggestion-list li.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.suggestion-list svg {
  width: 17px;
}

.date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.sub-field span {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.sub-field {
  position: relative;
}

.sub-field input {
  padding-left: 48px;
}

.search-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 9px 14px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-text);
}

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover,
.button-quiet:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--primary);
}

.more-filters-button {
  white-space: nowrap;
}

.chevron {
  transition: transform 160ms ease;
}

#moreFiltersButton[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 0;
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.help-button {
  width: 28px;
  height: 28px;
  margin-top: -6px;
  color: var(--text-muted);
}

.help-button svg {
  width: 17px;
  height: 17px;
}

.help-popover {
  position: absolute;
  top: 26px;
  left: 0;
  z-index: 35;
  width: min(380px, calc(100vw - 40px));
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.help-popover code {
  color: var(--primary);
  font-family: inherit;
  font-weight: 700;
}

.field-error {
  margin: 6px 0 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.advanced-filters {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 18px;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 16px;
}

.active-filter-row {
  min-height: 44px;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.active-filter-label {
  margin-right: 4px;
  font-size: 14px;
  font-weight: 700;
}

.active-filter-chips {
  display: contents;
}

.no-active-filters {
  color: var(--text-muted);
  font-size: 14px;
}

.filter-chip {
  min-height: 34px;
  max-width: 330px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 5px 8px 5px 10px;
  font-size: 14px;
  font-weight: 700;
}

.filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--primary);
}

.filter-chip svg,
.text-button svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.text-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 700;
}

.text-button:hover {
  background: var(--primary-soft);
}

.results-band {
  padding: 30px 0 64px;
}

.results-toolbar {
  align-items: center;
  margin-bottom: 18px;
}

.result-summary {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--text-muted);
  line-height: 1.2;
}

.result-summary strong {
  color: var(--text);
  font-size: 22px;
}

.result-summary span {
  font-size: 14px;
}

.results-list {
  display: grid;
  gap: 12px;
}

.loading-state,
.drawer-loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loading-spin 700ms linear infinite;
}

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

.request-error {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border));
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--text);
  padding: 16px;
}

.request-error > svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--red);
}

.request-error > div {
  min-width: 0;
  flex: 1;
}

.request-error p {
  margin: 2px 0 0;
  color: var(--text-muted);
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.result-card {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  min-height: 230px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 33, 31, 0.04);
}

.result-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 14px rgba(23, 33, 31, 0.07);
}

.result-date {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 20px;
}

.meta-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.result-date time,
.detail-date-block time {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.missing-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.missing-date svg {
  width: 18px;
  height: 18px;
}

.result-main {
  min-width: 0;
  padding: 18px 20px 16px;
}

.result-title-row > div:first-child {
  min-width: 0;
}

.result-main h3 {
  max-width: 950px;
  font-size: 20px;
}

.result-identity {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 15px;
}

.result-identity > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.result-identity svg {
  width: 16px;
  height: 16px;
}

.metadata-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-badge,
.metadata-item,
.detail-tags > span,
.relation-tag {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 14px;
  font-weight: 700;
}

.status-badge {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-open {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-concept {
  background: var(--surface-soft);
  color: var(--text-muted);
}

.status-afgerond {
  background: var(--green-soft);
  color: var(--green);
}

.metadata-item,
.detail-tags > span {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-weight: 400;
}

.metadata-item svg,
.detail-tags svg {
  width: 15px;
  height: 15px;
}

.followup-meta {
  color: var(--amber);
}

.result-snippet {
  max-width: 1120px;
  margin: 13px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

mark {
  border-radius: 2px;
  background: var(--mark);
  color: var(--mark-text);
  padding: 0 2px;
  font-weight: 700;
}

.result-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-actions .button {
  min-height: 40px;
  padding-block: 7px;
  font-size: 15px;
}

.score-wrap {
  position: relative;
  flex: 0 0 auto;
}

.score-button {
  min-width: 96px;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto auto 16px;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 7px 9px;
  font-size: 14px;
  font-weight: 700;
}

.score-button strong {
  font-size: 22px;
  line-height: 1;
}

.score-button svg {
  width: 16px;
  height: 16px;
}

.score-button:hover {
  border-color: var(--primary);
}

.score-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 25;
  width: 300px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  padding: 14px;
  color: var(--text);
  font-size: 14px;
}

.score-popover > strong {
  display: block;
  margin-bottom: 8px;
}

.score-popover dl {
  margin: 0;
}

.score-popover dl > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
}

.score-popover dt,
.score-popover dd {
  margin: 0;
}

.score-popover dd {
  font-weight: 700;
}

.score-popover p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.filter-result-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.empty-state {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 32px;
  text-align: center;
}

.empty-state > svg {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  color: var(--text-muted);
}

.empty-state p {
  margin: 8px 0 18px;
  color: var(--text-muted);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 14, 12, 0.48);
  opacity: 0;
  transition: opacity 180ms ease;
}

.drawer-overlay.is-open {
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(610px, 92vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 180ms ease;
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  flex: 0 0 auto;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding: 20px 22px;
}

.drawer-header > div {
  min-width: 0;
}

.drawer-header h2 {
  font-size: 23px;
}

.drawer-close {
  width: 44px;
  height: 44px;
}

.drawer-content {
  overflow-y: auto;
  padding: 22px 22px 32px;
}

.detail-summary {
  align-items: center;
}

.detail-date-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-tags {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.relation-tag {
  background: var(--primary-soft);
  color: var(--primary);
}

.detail-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.detail-section h3 {
  margin-bottom: 9px;
  font-size: 18px;
}

.detail-section > p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.full-report {
  white-space: pre-line;
}

.detail-list {
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row dt {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.detail-row dd {
  min-width: 0;
  margin: 0;
}

.followup-content {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  padding: 14px;
}

.followup-content > svg {
  width: 21px;
  color: var(--amber);
}

.followup-content p {
  margin: 3px 0 0;
  color: var(--text-muted);
}

.muted-copy {
  color: var(--text-muted);
}

.drawer-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow);
  padding: 13px 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-weight: 700;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-required {
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(8px);
  padding: 24px;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid var(--border);
  border-top: 5px solid var(--brand-orange);
  border-radius: 6px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  padding: 30px;
  text-align: center;
}

.auth-panel img {
  width: 128px;
  height: 50px;
  object-fit: contain;
}

.auth-panel h1 {
  margin-top: 18px;
  font-size: 28px;
}

.auth-panel > p {
  margin: 10px 0 22px;
  color: var(--text-muted);
}

.auth-panel .field-error {
  margin: 16px 0 0;
}

@media (max-width: 1180px) {
  .primary-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-search-grid .field-group:last-child {
    grid-column: 1 / -1;
  }

  .direct-filter-grid {
    grid-template-columns: minmax(300px, 1.2fr) minmax(200px, 0.8fr) minmax(220px, 0.9fr);
  }

  .search-actions {
    grid-column: 1 / -1;
    justify-content: end;
  }

  .advanced-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 70px;
  }

  .content-width,
  .header-inner {
    width: min(100% - 32px, 1480px);
  }

  .header-inner {
    gap: 12px;
  }

  .brand-logo {
    width: 94px;
    height: 38px;
  }

  .brand-divider {
    display: none;
  }

  .dataset-summary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .dataset-summary strong {
    min-width: 28px;
    font-size: 16px;
    text-align: center;
  }

  .product-name {
    font-size: 18px;
  }

  .user-summary {
    display: none;
  }

  .theme-option span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .theme-option {
    width: 36px;
    justify-content: center;
    padding-inline: 0;
  }

  .primary-search-grid,
  .direct-filter-grid {
    grid-template-columns: 1fr;
  }

  .primary-search-grid .field-group:last-child,
  .search-actions {
    grid-column: auto;
  }

  .search-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-card {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .result-date {
    padding: 16px;
  }

  .result-title-row {
    align-items: flex-start;
  }

  .score-button {
    min-width: 88px;
  }
}

@media (max-width: 600px) {
  .content-width,
  .header-inner {
    width: min(100% - 24px, 1480px);
  }

  .app-header,
  .header-inner {
    min-height: auto;
  }

  .header-inner {
    flex-wrap: nowrap;
    gap: 8px;
    padding-block: 10px;
  }

  .brand-block {
    gap: 6px;
  }

  .brand-logo {
    width: 78px;
    height: 32px;
  }

  .product-name {
    font-size: 16px;
  }

  .header-actions {
    margin-left: auto;
    gap: 6px;
  }

  .dataset-summary strong {
    min-width: 24px;
    font-size: 15px;
  }

  .theme-option {
    width: 34px;
  }

  .notice-inner {
    align-items: flex-start;
    padding-block: 9px;
  }

  .search-band {
    padding-top: 22px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 22px;
  }

  .primary-search-grid {
    margin-top: 20px;
  }

  .date-range,
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .search-actions {
    grid-template-columns: 1fr;
  }

  .text-button {
    margin-left: 0;
  }

  .results-toolbar {
    align-items: flex-end;
  }

  .result-card {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow: visible;
  }

  .result-date {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 15px;
  }

  .result-main {
    padding: 15px;
  }

  .result-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .result-main h3 {
    font-size: 19px;
  }

  .score-button {
    min-width: 70px;
    min-height: 48px;
    grid-template-columns: 1fr 15px;
  }

  .score-button span {
    grid-column: 1 / -1;
    line-height: 1;
  }

  .score-button strong {
    font-size: 20px;
  }

  .score-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    z-index: 110;
  }

  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .request-error {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .request-error .button {
    width: 100%;
  }

  .auth-gate {
    padding: 12px;
  }

  .auth-panel {
    padding: 24px 18px;
  }

  .detail-drawer {
    width: 100%;
    border-left: 0;
  }

  .drawer-header,
  .drawer-content {
    padding-inline: 16px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .drawer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 360px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
