/* =========================================================
   PQC UFPel — Consulta de Produtos Controlados
   Static stylesheet. No CDN, no framework. Mobile-first.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Sober, institutional palette: deep slate ink + muted lab-glass teal */
  --c-bg:           #f4f5f3;
  --c-surface:      #ffffff;
  --c-surface-2:    #f8f9f7;
  --c-border:       #d9dcd7;
  --c-border-strong:#b9bfb7;
  --c-ink:          #14201f;
  --c-ink-2:        #2b3a39;
  --c-muted:        #5b6967;
  --c-muted-2:      #7a8784;

  /* Single accent — calm chemistry teal */
  --c-accent:       #1f3b3a;
  --c-accent-2:     #2c5350;
  --c-accent-soft:  #e3ece9;
  --c-accent-line:  #c4d3cf;

  /* Semantic */
  --c-ok:           #1f6042;
  --c-ok-soft:      #e2efe6;
  --c-warn:         #7a5a16;
  --c-warn-soft:    #f4ecd5;
  --c-pf:           #3b4f78;
  --c-pf-soft:      #e3e8f1;
  --c-eb:           #6b5430;
  --c-eb-soft:      #efe9da;

  /* Type */
  --ff-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
             "Helvetica Neue", Arial, sans-serif;
  --ff-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
             "Liberation Mono", monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.375rem;
  --fs-2xl:  1.75rem;
  --fs-3xl:  2.125rem;

  --lh-tight:  1.2;
  --lh-snug:   1.35;
  --lh-base:   1.55;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 0 rgba(20,32,31,0.04), 0 1px 2px rgba(20,32,31,0.04);
  --shadow-md: 0 1px 0 rgba(20,32,31,0.04), 0 6px 16px -8px rgba(20,32,31,0.18);
  --shadow-lg: 0 24px 48px -16px rgba(20,32,31,0.28);

  --container-max: 1240px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

p { margin: 0; }

button { font: inherit; color: inherit; }

a {
  color: var(--c-accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--c-accent); }

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-accent);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 1000;
}
.skip-link:focus { left: var(--sp-4); }

/* Focus ring (visible, AA) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

main.container { padding-top: var(--sp-8); padding-bottom: var(--sp-12); }

/* ---------- Header ---------- */
.site-header {
  background: #06395b;
  color: #fff;
  overflow: hidden;
}
.hero-band {
  position: relative;
  background:
    radial-gradient(circle at 12% 18%, rgba(168, 212, 90, 0.32), transparent 26%),
    linear-gradient(115deg, #5a9736 0%, #2d7b54 38%, #0b6371 72%, #06395b 100%);
}
.hero-band::before,
.hero-band::after {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
  opacity: 0.2;
  border: 1px solid rgba(214, 239, 203, 0.48);
  border-radius: 999px;
}
.hero-band::before {
  width: 320px;
  height: 320px;
  left: -120px;
  top: -150px;
}
.hero-band::after {
  width: 520px;
  height: 520px;
  right: -220px;
  bottom: -360px;
}
.hero-inner {
  min-height: 270px;
  display: flex;
  align-items: center;
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-10);
  position: relative;
  z-index: 1;
}
.hero-copy {
  max-width: 980px;
}
.hero-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}
.hero-title {
  color: #fff;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-wrap: balance;
}
.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.45;
  max-width: 720px;
  margin-top: var(--sp-5);
}
.hero-pills {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}
.authority-band {
  background:
    linear-gradient(90deg, rgba(2, 45, 75, 0.96), rgba(3, 61, 94, 0.98)),
    repeating-radial-gradient(circle at 8% 40%, rgba(255,255,255,0.18) 0 1px, transparent 1px 12px);
  border-top: 1px solid rgba(255,255,255,0.14);
}
.authority-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
}
.authority-copy {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: #fff;
}
.authority-icon {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.9);
}
.authority-title {
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  line-height: 1.1;
}
.authority-text {
  color: rgba(255,255,255,0.86);
  font-size: var(--fs-md);
  max-width: 650px;
  line-height: 1.45;
  margin-top: var(--sp-1);
}
.authority-agencies {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  white-space: nowrap;
}
.authority-agencies span {
  border-left: 1px solid rgba(255,255,255,0.32);
  padding-left: var(--sp-5);
}
.meta-pill {
  font-size: var(--fs-xs);
  color: #123330;
  background: rgba(222, 241, 220, 0.92);
  border: 1px solid rgba(255,255,255,0.36);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.meta-pill.subtle {
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}

@media (max-width: 900px) {
  .hero-inner {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
  }
  .authority-inner,
  .authority-copy {
    align-items: flex-start;
  }
  .authority-inner {
    flex-direction: column;
  }
  .authority-agencies {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: var(--sp-3);
  }
  .authority-agencies span {
    border-left: 0;
    padding-left: 0;
    padding-right: var(--sp-4);
  }
}

@media (max-width: 560px) {
  .hero-title {
    font-size: clamp(2rem, 12vw, 3rem);
  }
  .authority-copy {
    gap: var(--sp-3);
  }
  .authority-icon {
    width: 52px;
    height: 52px;
  }
}

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.kpi-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c-border-strong);
}
.kpi-card[data-kpi="pf"]::before    { background: var(--c-pf); }
.kpi-card[data-kpi="eb"]::before    { background: var(--c-eb); }
.kpi-card[data-kpi="ufpel"]::before { background: var(--c-accent); }
.kpi-card.accent {
  background: var(--c-surface);
  border-color: var(--c-accent-line);
}
.kpi-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  font-weight: 600;
}
.kpi-value {
  font-family: var(--ff-mono);
  font-size: var(--fs-3xl);
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 2px;
}
.kpi-foot {
  font-size: var(--fs-xs);
  color: var(--c-muted-2);
  margin-top: var(--sp-1);
}

/* ---------- Filter panel ---------- */
.filter-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.filter-row {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
.filter-row:not(.search-row) {
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .filter-row:not(.search-row) {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1080px) {
  .filter-row:not(.search-row) {
    grid-template-columns: auto auto 1fr minmax(160px, 0.35fr);
    align-items: end;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.field-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--c-muted);
}
.field-help {
  font-size: var(--fs-xs);
  color: var(--c-muted-2);
}

input[type="search"],
input[type="text"],
select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  width: 100%;
  background: var(--c-surface);
  color: var(--c-ink);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.2;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input[type="search"]:hover,
select:hover { border-color: var(--c-muted); }
input[type="search"]:focus-visible,
select:focus-visible {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(31,59,58,0.18);
  outline: none;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--c-muted) 50%),
    linear-gradient(135deg, var(--c-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.field-search input { font-size: var(--fs-md); padding: 12px 14px; }

/* Segmented control */
.field-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.field-group legend { padding: 0; }

.segmented {
  display: inline-flex;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 3px;
  width: 100%;
  flex-wrap: wrap;
}
.seg-option {
  flex: 1 1 auto;
  position: relative;
  cursor: pointer;
}
.seg-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%; height: 100%;
  cursor: pointer;
  margin: 0;
}
.seg-option span {
  display: block;
  text-align: center;
  padding: 7px 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-ink-2);
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.seg-option input:checked + span {
  background: var(--c-accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20,32,31,0.18);
}
.seg-option input:focus-visible + span {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
.seg-option:hover input:not(:checked) + span { color: var(--c-ink); background: rgba(20,32,31,0.04); }

/* Filter actions */
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
}
.result-count {
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.result-count strong { color: var(--c-ink); font-weight: 600; }
.action-buttons { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.05s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.btn-primary:hover { background: var(--c-accent-2); border-color: var(--c-accent-2); }
.btn-ghost {
  background: var(--c-surface);
  color: var(--c-ink-2);
  border-color: var(--c-border-strong);
}
.btn-ghost:hover { background: var(--c-surface-2); border-color: var(--c-muted); color: var(--c-ink); }

/* ---------- Download panel ---------- */
.download-panel {
  margin: 0 0 var(--sp-6);
  background: var(--c-surface);
  border: 1px solid var(--c-accent-line);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.download-eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--c-accent);
  margin-bottom: var(--sp-1);
}
.download-title {
  font-size: var(--fs-md);
  color: var(--c-ink);
  margin-bottom: var(--sp-1);
}
.download-text {
  color: var(--c-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.download-link {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}
@media (max-width: 720px) {
  .download-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .download-link {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Table ---------- */
.table-wrap {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.results-table thead th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  background: var(--c-surface-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.results-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
  color: var(--c-ink-2);
}
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr:hover { background: var(--c-surface-2); }
.results-table tbody tr:focus-within { background: var(--c-accent-soft); }

.col-produto    { min-width: 220px; }
.col-ncm        { width: 1%; white-space: nowrap; }
.col-orgao      { width: 1%; white-space: nowrap; }
.col-categoria  { width: 1%; white-space: nowrap; }
.col-legislacao { min-width: 180px; }
.col-status     { width: 1%; white-space: nowrap; }
.col-action     { width: 1%; white-space: nowrap; text-align: right; }

.cell-produto-name {
  font-weight: 600;
  color: var(--c-ink);
  display: block;
}
.cell-produto-sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  margin-top: 2px;
  font-family: var(--ff-mono);
  letter-spacing: 0.02em;
}
.cell-ncm {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-detail {
  background: transparent;
  border: 1px solid var(--c-border-strong);
  color: var(--c-ink-2);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-detail:hover { background: var(--c-accent-soft); border-color: var(--c-accent); color: var(--c-accent); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-pf {
  background: var(--c-pf-soft);
  color: var(--c-pf);
  border-color: rgba(59,79,120,0.25);
}
.badge-eb {
  background: var(--c-eb-soft);
  color: var(--c-eb);
  border-color: rgba(107,84,48,0.25);
}
.badge-status {
  background: var(--c-surface-2);
  color: var(--c-muted);
  border-color: var(--c-border);
}
.badge-status.ok {
  background: var(--c-ok-soft);
  color: var(--c-ok);
  border-color: rgba(31,96,66,0.25);
}
.badge-status.ok::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-ok);
}
.badge-status.info {
  background: #f3efe6;
  color: #6f4f16;
  border-color: rgba(143, 105, 42, 0.28);
}
.badge-status.info::before {
  content: "";
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8f692a;
}
.badge-status.off::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-muted-2);
}
.badge-cat {
  font-family: var(--ff-mono);
  background: var(--c-surface-2);
  color: var(--c-ink-2);
  border-color: var(--c-border);
  font-weight: 600;
}
.legislacao-text {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: 1.4;
}

/* Mobile cards (hidden on desktop) */
.results-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

@media (max-width: 820px) {
  .results-table { display: none; }
  .results-cards { display: block; }
  .table-wrap { background: transparent; border: 0; }

  .card-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }
  .card-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-3);
  }
  .card-item-title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--c-ink);
  }
  .card-item-sub {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    font-family: var(--ff-mono);
    margin-top: 2px;
  }
  .card-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .card-item-leg {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    line-height: 1.45;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--c-border);
  }
  .card-item .btn-detail {
    align-self: flex-start;
  }
}

/* Empty / loading states */
.empty-state, .loading-state {
  padding: var(--sp-10) var(--sp-5);
  text-align: center;
}
.empty-title { font-weight: 600; color: var(--c-ink); margin-bottom: var(--sp-2); }
.empty-desc { color: var(--c-muted); font-size: var(--fs-sm); }
.loading-state { color: var(--c-muted); font-size: var(--fs-sm); }

/* ---------- Modal ---------- */
[hidden] { display: none !important; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,32,31,0.45);
  z-index: 90;
  animation: fade 0.15s ease;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 720px) {
  .modal { align-items: center; padding: var(--sp-6); }
}
.modal-inner {
  background: var(--c-surface);
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: rise 0.18s ease;
  outline: none;
}
@media (min-width: 720px) {
  .modal-inner { border-radius: var(--radius-lg); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}
.modal-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.modal-title {
  font-size: var(--fs-xl);
  color: var(--c-ink);
}
.btn-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-muted);
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.btn-close:hover { background: var(--c-surface-2); color: var(--c-ink); border-color: var(--c-border); }

.modal-body {
  padding: var(--sp-5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.modal-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  border-radius: 0;
}
@media (min-width: 720px) {
  .modal-footer { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
}
.modal-disclaimer {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  flex: 1 1 320px;
  line-height: 1.5;
}
.modal-disclaimer strong { color: var(--c-warn); font-weight: 700; }

/* Detail grid */
.detail-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}
@media (min-width: 540px) {
  .detail-summary { grid-template-columns: 1fr 1fr; }
}
.detail-cell {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
}
.detail-cell-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.detail-cell-value {
  font-size: var(--fs-sm);
  color: var(--c-ink);
  line-height: 1.45;
  word-break: break-word;
}
.detail-cell-value.mono { font-family: var(--ff-mono); }
.detail-cell-value.empty { color: var(--c-muted-2); font-style: italic; }

.detail-section h3 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--c-muted);
  margin-bottom: var(--sp-2);
}
.detail-section p { font-size: var(--fs-sm); line-height: 1.55; color: var(--c-ink-2); }
.detail-alert {
  background: #fbf6ea;
  border: 1px solid rgba(143, 105, 42, 0.24);
  border-left: 4px solid #8f692a;
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.detail-alert h3 { color: #6f4f16; }
.detail-alert p { color: #4f3a14; }
.detail-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.detail-section li a {
  font-size: var(--fs-sm);
  color: var(--c-accent-2);
}
.sin-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.sin-chip {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0.7; } to { transform: none; opacity: 1; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  margin-top: var(--sp-8);
}
.footer-inner {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.footer-note {
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
  max-width: 70ch;
  line-height: 1.55;
}
.footer-meta {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.footer-contacts {
  margin-top: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
  display: grid;
  gap: var(--sp-2);
  font-style: normal;
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
}
.footer-contacts a {
  font-weight: 600;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
