:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #eef1f4;
  --surface-deep: #f3f4f6;
  --text: #16181d;
  --muted: #59626f;
  --line: #d8dde4;
  --primary: #c8102e;
  --primary-2: #e21b3c;
  --accent-dark: #111111;
  --accent-blue: #0f4c81;
  --shadow: 0 14px 40px rgba(17, 17, 17, 0.10);
  --shadow-soft: 0 10px 24px rgba(17, 17, 17, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fafbfc 0%, #f3f5f8 100%);
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero,
.subhero {
  background:
    linear-gradient(135deg, rgba(17,17,17,0.96), rgba(78,12,21,0.96) 45%, rgba(200,16,46,0.94)),
    radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 42%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -8px;
  width: min(34vw, 340px);
  height: min(34vw, 340px);
  background: url("../media/images/Icon_EXPERIMINTA_stylish.png") no-repeat center;
  background-size: contain;
  opacity: 0.08;
  pointer-events: none;
}

.hero { padding: 72px 0 46px; }
.hero-inner { position: relative; padding-right: min(28vw, 260px); }
.hero-logo { position: absolute; right: 0; top: -10px; }
.hero-logo img {
  width: clamp(88px, 12vw, 140px);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.stat-card {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
}
.stat-card strong { display: block; font-size: 1.45rem; }
.stat-card span { font-size: .93rem; opacity: .9; }

.subhero { padding: 18px 0; }
.subhero-inner { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.subhero-brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .06em; }
.subhero-brand img { width: 44px; height: 44px; display: block; }
.subhero-links { display: flex; gap: 16px; flex-wrap: wrap; }
.back-link { color: #fff; font-weight: 700; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .86rem;
  opacity: .88;
  margin: 0 0 10px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.1rem; max-width: 760px; }

.hero-actions, .section-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.section-head { justify-content: space-between; margin-bottom: 22px; }
.section-head p { margin: 0; color: var(--muted); max-width: 760px; }

.section { padding: 56px 0; }
.section-alt { background: linear-gradient(180deg, #eef1f4 0%, #e9edf1 100%); }
.two-col {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: start;
}
.summary-layout,
.admin-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.full-span { grid-column: 1 / -1; }
.admin-sidebar { grid-column: span 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.compact-card { margin-top: 18px; }
.emphasis-card {
  background: linear-gradient(135deg, #fff4f6, #ffffff 60%);
  border-color: #ffd6de;
}
.info-card { background: linear-gradient(135deg, #fdfdff, #f7faff); }
.form-card label, .form-card fieldset { display: block; margin-bottom: 16px; }
.form-card select, .search-input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 4px;
}
legend { padding: 0 8px; font-weight: 700; }
.checkbox { display: block; margin-bottom: 10px; }
.tight-list li { margin-bottom: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-secondary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
}
.btn-secondary:hover { background: rgba(255,255,255,.18); }
.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-outline:hover { background: var(--surface-alt); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.exhibit-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.exhibit-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.exhibit-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(17,17,17,.14); }
.exhibit-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #111111);
  border-radius: 22px 22px 0 0;
}
.exhibit-cover {
  aspect-ratio: 16/9;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7dade 0%, #fff 45%, #ebf2f7 100%);
  display: grid;
  place-items: center;
  border: 1px solid #f0d5db;
  overflow: hidden;
}
.exhibit-cover span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17,17,17,.82);
  color: #fff;
  font-size: .9rem;
  letter-spacing: .04em;
}
.exhibit-card .meta,
.exhibit-detail .meta,
.muted { color: var(--muted); }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: .85rem;
  color: #8b0f24;
  background: #ffe8ec;
  padding: 6px 10px;
  border-radius: 999px;
}
.pill.dark { background: #151515; color: #fff; }

.feature-list { padding-left: 18px; }
.status { color: var(--primary); font-weight: 700; margin-top: 14px; }
.footer { padding: 22px 0 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }

.exhibit-detail { display: grid; gap: 20px; }
.exhibit-hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}
.visual-stage {
  min-height: 280px;
  border-radius: 22px;
  border: 1px solid #ecd2d8;
  background: linear-gradient(135deg, #fff7f8, #ffffff 55%, #edf4f8);
  position: relative;
  overflow: hidden;
}
.visual-stage::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(200,16,46,.16), transparent 70%);
}
.visual-badge {
  position: absolute;
  left: 18px;
  top: 18px;
  background: rgba(17,17,17,.88);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .86rem;
}
.visual-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.visual-center strong { font-size: 1.2rem; }
.visual-center p { color: var(--muted); max-width: 420px; }

.w-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.w-box {
  background: linear-gradient(180deg, #fff5f7 0%, #fff 100%);
  border: 1px solid #ffd9e0;
  border-radius: 18px;
  padding: 18px;
}
.audio-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.audio-player {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.audio-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--text);
  font-weight: 700;
}
.progress-demo {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 38%, #ebeef2 38%, #ebeef2 100%);
}
.metric { font-size: 3rem; font-weight: 800; margin: 0; }
.list-grid, .quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.list-item, .quiz-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-deep);
  padding: 16px;
}

.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table thead th {
  background: #111111;
  color: #fff;
  font-weight: 700;
  position: sticky;
  top: 0;
}
.badge-ok,
.badge-work {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.badge-ok { background: #e4f8e8; color: #166534; }
.badge-work { background: #fff0d7; color: #9a5a00; }

@media (max-width: 900px) {
  .two-col,
  .exhibit-hero,
  .summary-layout,
  .admin-layout,
  .w-grid,
  .audio-panel {
    grid-template-columns: 1fr;
  }
  .hero-inner { padding-right: 0; }
  .hero-logo {
    position: static;
    margin-bottom: 18px;
  }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero { padding-top: 48px; }
  .container { width: min(1120px, calc(100% - 24px)); }
  .subhero-inner,
  .footer-inner,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-strip { grid-template-columns: 1fr; }
  .metric { font-size: 2.3rem; }
}

.route-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.route-card {
  border-top: 4px solid #c8102e;
}

.filter-panel {
  margin-bottom: 1rem;
}

.filter-row {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(150px, 1fr)) auto;
  gap: 0.75rem;
  align-items: center;
}

.compact-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
}

.search-input,
.filter-row select,
.compact-filters select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(17,17,17,0.12);
  background: #fff;
  font: inherit;
}

.admin-stats {
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .filter-row,
  .compact-filters {
    grid-template-columns: 1fr;
  }
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}
.filter-bar label {
  display: block;
}
.filter-bar .search-input,
.filter-bar select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.badge-draft {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  background: #ecebff;
  color: #4736b8;
}


.btn-accent {
  background: rgba(255,255,255,.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(8px);
}

.btn-accent:hover {
  background: rgba(255,255,255,.2);
  text-decoration: none;
}

.btn-small {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .92rem;
}

.scanner-layout {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 20px;
}

.scanner-card {
  min-height: 520px;
}

.scanner-stage {
  position: relative;
  margin-top: 18px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f1114, #1a1d22);
  min-height: 360px;
  border: 1px solid rgba(255,255,255,.08);
}

.scanner-video {
  width: 100%;
  min-height: 360px;
  object-fit: cover;
  background: #0f1114;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background:
    linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.12));
}

.scanner-frame {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 28px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.18);
  position: relative;
}

.scanner-frame::before,
.scanner-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(255,255,255,.18);
  border-radius: 20px;
}

.scanner-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.mini-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.mini-meta {
  color: var(--muted);
  font-size: .9rem;
}

.status-error {
  color: var(--primary);
  font-weight: 700;
}

.scan-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow: 0 18px 36px rgba(200,16,46,.28);
  z-index: 50;
}

.scan-fab:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

@media (max-width: 640px) {
  .scan-fab {
    width: 58px;
    height: 58px;
    right: 14px;
    bottom: 14px;
  }

  .scanner-stage,
  .scanner-video {
    min-height: 300px;
  }

  .scanner-frame {
    width: min(78vw, 240px);
    height: min(78vw, 240px);
  }
}


.smart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.smart-side-panel {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.codebox {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f7f8fa;
  color: #111;
  resize: vertical;
}

.ki-chat {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.chat-bubble {
  border-radius: 18px;
  padding: 12px 14px;
  max-width: 85%;
  box-shadow: var(--shadow-soft);
}

.chat-system {
  background: #f3f4f6;
  color: var(--muted);
}

.chat-ai {
  background: rgba(200,16,46,.08);
  border: 1px solid rgba(200,16,46,.12);
}

.chat-user {
  background: rgba(15,76,129,.08);
  border: 1px solid rgba(15,76,129,.12);
  justify-self: end;
}

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


.quick-actions {
  margin-bottom: 16px;
}

.structured-answer {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.structured-answer .section-head {
  margin-bottom: 0;
}

.structured-answer .w-grid {
  margin-top: 0;
}

.quick-prompt {
  white-space: nowrap;
}


.ki-audio-player {
  width: 100%;
  margin: 8px 0 16px;
  display: none;
}


.exhibit-detail + .smart-side-panel .mini-card strong {
  display: block;
  margin-bottom: 4px;
}


.privacy-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  background: rgba(15, 76, 129, 0.96);
  color: #fff;
  box-shadow: 0 -10px 24px rgba(0,0,0,.18);
}

.privacy-content {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.privacy-content p {
  margin: 0;
  font-size: .95rem;
}

.privacy-content a {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .privacy-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0 18px;
  }
}


.privacy-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  background: rgba(15, 76, 129, 0.96);
  color: #fff;
  box-shadow: 0 -10px 24px rgba(0,0,0,.18);
}

.privacy-content {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.privacy-content p {
  margin: 0;
  font-size: .95rem;
}

.privacy-content a {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .privacy-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0 18px;
  }
}


.scanner-reader {
  width: 100%;
  min-height: 360px;
  background: #0f1114;
  display: block;
}

.scanner-reader video,
.scanner-reader canvas {
  width: 100% !important;
  height: auto !important;
  border-radius: 0;
}


.flow-card {
  border: 1px solid rgba(200,16,46,.12);
  background: linear-gradient(180deg, rgba(200,16,46,.03), rgba(15,76,129,.03));
}


.resume-scan-link {
  white-space: nowrap;
}
