:root {
  color-scheme: light;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --surface-strong: #eef2ee;
  --ink: #202522;
  --muted: #66716a;
  --line: #d9ded8;
  --deep-green: #244e46;
  --leaf: #52785f;
  --red-clay: #a6563f;
  --ochre: #b4873a;
  --blue-gray: #526f82;
  --violet: #725a83;
  --shadow: 0 18px 44px rgba(34, 41, 38, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Tahoma", "Arial", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 86px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 25%, transparent 25%) 0 0 / 14px 14px,
    var(--deep-green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0;
}

.brand-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-link,
.secondary-button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-button {
  color: #fff;
  background: var(--deep-green);
  border-color: var(--deep-green);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(310px, 380px);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.filter-panel,
.detail-panel {
  position: sticky;
  top: 104px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.filter-panel {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 124px);
  overflow: auto;
}

.field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.search-box input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

.search-box input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(180, 135, 58, 0.32);
  outline-offset: 2px;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.segmented {
  display: grid;
  gap: 8px;
}

.segmented button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.segmented button.is-active {
  background: var(--deep-green);
  border-color: var(--deep-green);
  color: #fff;
}

.data-note {
  margin-top: 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--muted);
  display: grid;
  gap: 2px;
}

.data-note strong {
  color: var(--deep-green);
  font-size: 26px;
  line-height: 1;
}

.results-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-strip > div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-strip strong {
  color: var(--deep-green);
  font-size: 28px;
  line-height: 1.05;
}

.active-filters {
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.motif-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  min-height: 442px;
  display: grid;
  grid-template-rows: 174px 1fr;
  box-shadow: 0 10px 26px rgba(34, 41, 38, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.motif-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 78, 70, 0.4);
  box-shadow: var(--shadow);
}

.motif-card.is-selected {
  border-color: var(--ochre);
  box-shadow: 0 0 0 2px rgba(180, 135, 58, 0.2), var(--shadow);
}

.motif-media {
  position: relative;
  background: #eef2ee;
  overflow: hidden;
}

.motif-media img,
.detail-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  position: relative;
  z-index: 2;
}

.motif-media img.is-missing,
.detail-visual img.is-missing {
  display: none;
}

.motif-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  isolation: isolate;
}

.motif-visual::before,
.motif-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.motif-visual::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(255, 255, 255, 0.38) 35px 36px, transparent 37px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 16px);
}

.motif-visual::after {
  border: 1px solid rgba(255, 255, 255, 0.34);
  inset: 18px;
}

.category-nat .motif-visual {
  background: var(--leaf);
}

.category-fau .motif-visual {
  background: var(--red-clay);
}

.category-geo .motif-visual {
  background: var(--blue-gray);
}

.category-sac .motif-visual {
  background: var(--violet);
}

.motif-code {
  width: min(74%, 190px);
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  background: rgba(32, 37, 34, 0.2);
  font-weight: 800;
  letter-spacing: 0;
}

.image-badge,
.status-badge {
  position: absolute;
  z-index: 3;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.status-badge {
  left: auto;
  right: 10px;
}

.motif-body {
  padding: 13px 14px 14px;
  display: grid;
  gap: 9px;
}

.motif-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.motif-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.motif-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.motif-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.motif-excerpt {
  margin: 0;
  color: #38413d;
  font-size: 13px;
  line-height: 1.55;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  max-width: 100%;
  border-radius: 999px;
  background: var(--surface-strong);
  color: #4f5d56;
  padding: 3px 8px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.detail-panel {
  min-height: calc(100vh - 124px);
  max-height: calc(100vh - 124px);
  overflow: auto;
}

.close-detail {
  display: none;
  margin-left: auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
}

.detail-content {
  display: grid;
  gap: 15px;
}

.detail-header {
  display: grid;
  gap: 6px;
}

.detail-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.28;
  letter-spacing: 0;
}

.detail-header p {
  margin: 0;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.detail-link,
.copy-link-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  text-decoration: none;
  font-size: 13px;
}

.copy-link-button {
  background: var(--deep-green);
  border-color: var(--deep-green);
  color: #fff;
}

.detail-visual {
  aspect-ratio: 4 / 3;
  min-height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--surface-strong);
}

.image-zoom-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 700;
}

.image-set-section {
  border-top: 0;
  padding-top: 0;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gallery-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.gallery-item img,
.gallery-missing {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
}

.gallery-item img.is-missing {
  display: none;
}

.gallery-item span {
  display: block;
  padding: 7px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 6px;
}

.detail-section h3 {
  margin: 0;
  color: var(--deep-green);
  font-size: 14px;
  letter-spacing: 0;
}

.detail-section p {
  margin: 0;
  color: #38413d;
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-field {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: #fff;
}

.detail-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
}

.detail-field strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  color: var(--ink);
}

.modal-open {
  overflow: hidden;
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 14, 36, 0.82);
  backdrop-filter: blur(10px);
}

.image-modal__dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: #061a3a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.image-modal__bar {
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f6fdff;
  background: linear-gradient(90deg, #05366f 0%, #0776ad 62%, #09aac4 100%);
}

.image-modal__bar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-modal__close {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: #08234b;
  padding: 6px 12px;
  font-weight: 700;
}

.image-modal img {
  width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
  display: block;
  background:
    linear-gradient(rgba(4, 18, 42, 0.84), rgba(4, 18, 42, 0.84)),
    repeating-linear-gradient(135deg, rgba(111, 221, 236, 0.16) 0 1px, transparent 1px 18px);
}

.image-modal img.is-missing {
  min-height: 360px;
  background: #061a3a;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .detail-panel {
    position: fixed;
    z-index: 50;
    top: 88px;
    right: 14px;
    bottom: 14px;
    width: min(420px, calc(100vw - 28px));
    min-height: auto;
    max-height: none;
    transform: translateX(calc(100% + 24px));
    transition: transform 180ms ease;
  }

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

  .close-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
  }
}

@media (max-width: 840px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1 1 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .filter-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

  .segmented button {
    text-align: center;
  }

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

  .detail-panel {
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 20px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-block p {
    font-size: 12px;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-strip > div {
    min-height: 68px;
    padding: 10px;
  }

  .summary-strip strong {
    font-size: 23px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .motif-card {
    min-height: 418px;
  }

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

  .image-gallery {
    grid-template-columns: 1fr;
  }

  .image-modal {
    padding: 12px;
  }

  .image-modal__dialog {
    max-height: calc(100vh - 24px);
  }
}

/* Theme: deep textile ceiling palette */
:root {
  --paper: #071c26;
  --surface: #fff8ea;
  --surface-strong: #f2e5c9;
  --ink: #201b16;
  --muted: #6c6253;
  --line: #d6ad55;
  --deep-green: #062936;
  --leaf: #0b4555;
  --red-clay: #9f1116;
  --ochre: #e8a32d;
  --blue-gray: #0d394a;
  --violet: #6b1e24;
  --gold: #d9ab51;
  --cream: #fff2d2;
  --shadow: 0 18px 44px rgba(3, 13, 18, 0.24);
}

body {
  background:
    linear-gradient(rgba(7, 28, 38, 0.82), rgba(7, 28, 38, 0.82)),
    repeating-linear-gradient(135deg, rgba(217, 171, 81, 0.12) 0 1px, transparent 1px 18px),
    linear-gradient(145deg, #041721 0%, #07374a 48%, #340c12 100%);
}

.topbar {
  background: linear-gradient(90deg, #031923 0%, #082f3f 58%, #5f1118 100%);
  border-bottom: 3px solid var(--gold);
  color: var(--cream);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.brand-mark {
  background:
    linear-gradient(135deg, rgba(232, 163, 45, 0.22) 25%, transparent 25%) 0 0 / 14px 14px,
    #063344;
  border: 1px solid rgba(232, 163, 45, 0.72);
  color: var(--cream);
}

.brand-block p {
  color: #dbcaa7;
}

.ghost-link,
.secondary-button {
  border-color: rgba(232, 163, 45, 0.72);
}

.secondary-button,
.copy-link-button,
.segmented button.is-active {
  background: #6f0d12;
  border-color: var(--gold);
  color: var(--cream);
}

.filter-panel,
.detail-panel,
.summary-strip > div,
.motif-card,
.filter-chip,
.empty-state,
.detail-field,
.gallery-item {
  background: var(--surface);
  border-color: rgba(214, 173, 85, 0.62);
}

.filter-panel {
  background:
    linear-gradient(rgba(255, 248, 234, 0.94), rgba(255, 248, 234, 0.94)),
    repeating-linear-gradient(135deg, rgba(8, 47, 63, 0.12) 0 1px, transparent 1px 16px);
}

.summary-strip > div {
  background: linear-gradient(180deg, #fff8ea 0%, #efe0bf 100%);
}

.summary-strip strong,
.data-note strong,
.detail-section h3 {
  color: #083443;
}

.metric-label,
.motif-kicker,
.motif-subtitle,
.motif-meta,
.detail-header p,
.detail-field span,
.gallery-item figcaption {
  color: #6b5c45;
}

.motif-card {
  box-shadow: 0 14px 30px rgba(3, 13, 18, 0.18);
}

.motif-card:hover,
.motif-card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 163, 45, 0.32), var(--shadow);
}

.motif-media,
.detail-visual {
  background: #082a38;
}

.motif-visual::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(232, 163, 45, 0.52) 35px 36px, transparent 37px),
    repeating-linear-gradient(45deg, rgba(232, 163, 45, 0.22) 0 2px, transparent 2px 16px);
}

.motif-visual::after {
  border-color: rgba(255, 242, 210, 0.5);
}

.category-nat .motif-visual {
  background: #0a3b4b;
}

.category-fau .motif-visual {
  background: #8d1017;
}

.category-geo .motif-visual {
  background: #082a38;
}

.category-sac .motif-visual {
  background: #6a1b21;
}

.motif-code {
  border-color: rgba(232, 163, 45, 0.68);
  background: rgba(5, 24, 32, 0.32);
  color: var(--cream);
}

.image-badge,
.status-badge {
  background: rgba(255, 242, 210, 0.94);
  color: #3a2214;
  border: 1px solid rgba(232, 163, 45, 0.45);
}

.tag,
.data-note {
  background: #eee1c5;
  color: #51442f;
}

.search-box input,
select,
.segmented button,
.detail-link,
.copy-link-button {
  border-color: rgba(214, 173, 85, 0.58);
}

.search-box input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline-color: rgba(232, 163, 45, 0.46);
}

/* Theme: warm red, outer space, perfect white */
:root {
  --paper: #11162c;
  --surface: #ffffff;
  --surface-strong: #f4f6fb;
  --ink: #151829;
  --muted: #657084;
  --line: #dfe4ee;
  --deep-green: #171f42;
  --leaf: #21315f;
  --red-clay: #ff4e45;
  --ochre: #ff4e45;
  --blue-gray: #243061;
  --violet: #7b2d5a;
  --gold: #ff4e45;
  --cream: #ffffff;
  --shadow: 0 18px 48px rgba(8, 12, 30, 0.18);
}

body {
  background:
    linear-gradient(rgba(17, 22, 44, 0.88), rgba(17, 22, 44, 0.88)),
    repeating-linear-gradient(150deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 18px),
    linear-gradient(145deg, #11162c 0%, #1d2757 58%, #ff4e45 140%);
}

.topbar {
  background: rgba(17, 22, 44, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 18px 48px rgba(8, 12, 30, 0.22);
}

.brand-mark {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.13) 0 2px, transparent 2px 9px),
    #ff4e45;
  border: 0;
  color: #fff;
}

.brand-block p {
  color: rgba(255, 255, 255, 0.74);
}

.secondary-button,
.copy-link-button,
.segmented button.is-active {
  background: #ff4e45;
  border-color: #ff4e45;
  color: #fff;
}

.ghost-link,
.secondary-button,
.copy-link-button,
.detail-link {
  border-color: rgba(255, 78, 69, 0.42);
}

.filter-panel,
.detail-panel,
.summary-strip > div,
.motif-card,
.filter-chip,
.empty-state,
.detail-field,
.gallery-item {
  background: #fff;
  border-color: rgba(223, 228, 238, 0.96);
}

.filter-panel {
  background:
    linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(150deg, rgba(255, 78, 69, 0.07) 0 1px, transparent 1px 16px);
}

.summary-strip > div {
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
}

.summary-strip strong,
.data-note strong,
.detail-section h3 {
  color: #171f42;
}

.metric-label,
.motif-kicker,
.motif-subtitle,
.motif-meta,
.detail-header p,
.detail-field span,
.gallery-item figcaption {
  color: #657084;
}

.motif-card {
  box-shadow: 0 16px 34px rgba(8, 12, 30, 0.13);
}

.motif-card:hover,
.motif-card.is-selected {
  border-color: #ff4e45;
  box-shadow: 0 0 0 2px rgba(255, 78, 69, 0.2), var(--shadow);
}

.motif-media,
.detail-visual {
  background: #171f42;
}

.motif-visual::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(255, 255, 255, 0.42) 35px 36px, transparent 37px),
    repeating-linear-gradient(150deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 16px);
}

.motif-visual::after {
  border-color: rgba(255, 255, 255, 0.38);
}

.category-nat .motif-visual {
  background: #1d2757;
}

.category-fau .motif-visual {
  background: #ff4e45;
}

.category-geo .motif-visual {
  background: #11162c;
}

.category-sac .motif-visual {
  background: #2b3470;
}

.motif-code {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(17, 22, 44, 0.26);
  color: #fff;
}

.image-badge,
.status-badge {
  background: rgba(255, 255, 255, 0.94);
  color: #151829;
  border: 1px solid rgba(255, 78, 69, 0.22);
}

.tag,
.data-note {
  background: #f0f3f8;
  color: #4e596b;
}

.search-box input,
select,
.segmented button {
  background: #fff;
  border-color: #dfe4ee;
}

.search-box input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline-color: rgba(255, 78, 69, 0.34);
}

/* Theme: cobalt gold abstract palette */
:root {
  --paper: #020b34;
  --surface: #062a66;
  --surface-strong: #083e86;
  --ink: #f4fbff;
  --muted: #b9d8ec;
  --line: #1f77b8;
  --deep-green: #043b86;
  --leaf: #087dc0;
  --red-clay: #071052;
  --ochre: #e7c464;
  --blue-gray: #0a5fa7;
  --violet: #061855;
  --gold: #e7c464;
  --cream: #f4fbff;
  --shadow: 0 20px 54px rgba(0, 6, 32, 0.42);
}

body {
  background:
    radial-gradient(circle at 74% 36%, rgba(12, 138, 205, 0.52) 0 15%, transparent 36%),
    radial-gradient(circle at 28% 72%, rgba(3, 67, 146, 0.64) 0 18%, transparent 38%),
    linear-gradient(116deg, transparent 0 18%, rgba(231, 196, 100, 0.76) 18.2%, transparent 18.7% 41%, rgba(231, 196, 100, 0.62) 41.2%, transparent 41.8% 100%),
    repeating-linear-gradient(118deg, rgba(244, 251, 255, 0.12) 0 1px, transparent 1px 52px),
    linear-gradient(150deg, #020b34 0%, #06206a 38%, #087dc0 100%);
}

.topbar {
  background:
    linear-gradient(118deg, transparent 0 78%, rgba(231, 196, 100, 0.78) 78.2%, transparent 79%),
    linear-gradient(90deg, rgba(2, 11, 52, 0.98) 0%, rgba(4, 59, 134, 0.97) 58%, rgba(8, 125, 192, 0.96) 100%);
  border-bottom: 1px solid rgba(231, 196, 100, 0.72);
  color: #f4fbff;
  box-shadow: 0 16px 48px rgba(0, 6, 32, 0.36);
}

.brand-mark {
  background:
    linear-gradient(135deg, transparent 0 44%, rgba(231, 196, 100, 0.88) 45%, transparent 48%),
    radial-gradient(circle at 50% 42%, rgba(244, 251, 255, 0.22) 0 22%, transparent 23%),
    linear-gradient(135deg, #087dc0 0%, #043b86 72%);
  border: 1px solid rgba(231, 196, 100, 0.86);
  color: #f4fbff;
}

.brand-block p {
  color: #efd37b;
}

.brand-block h1 {
  color: #f5dc86;
  text-shadow: 0 1px 12px rgba(231, 196, 100, 0.34);
}

.ghost-link,
.secondary-button,
.copy-link-button,
.detail-link {
  border-color: rgba(231, 196, 100, 0.64);
}

.ghost-link,
.detail-link,
.close-detail {
  background: rgba(2, 11, 52, 0.52);
  color: #f4fbff;
}

.secondary-button,
.copy-link-button,
.segmented button.is-active {
  background: #043b86;
  border-color: #e7c464;
  color: #f4fbff;
}

.filter-panel,
.detail-panel,
.summary-strip > div,
.motif-card,
.filter-chip,
.empty-state,
.detail-field,
.gallery-item {
  background: rgba(6, 42, 102, 0.94);
  border-color: rgba(31, 119, 184, 0.86);
}

.filter-panel {
  background:
    linear-gradient(rgba(6, 42, 102, 0.94), rgba(6, 42, 102, 0.94)),
    repeating-linear-gradient(118deg, rgba(231, 196, 100, 0.16) 0 1px, transparent 1px 24px);
}

.summary-strip > div {
  background:
    radial-gradient(circle at 92% 8%, rgba(231, 196, 100, 0.18) 0 18%, transparent 34%),
    linear-gradient(180deg, #083e86 0%, #062a66 100%);
}

.summary-strip strong,
.data-note strong,
.detail-section h3 {
  color: #f5dc86;
}

.metric-label,
.motif-kicker,
.motif-subtitle,
.motif-meta,
.detail-header p,
.detail-field span,
.gallery-item span {
  color: #b9d8ec;
}

.motif-excerpt,
.detail-section p {
  color: #d5ecf8;
}

.motif-card {
  box-shadow: 0 16px 42px rgba(0, 6, 32, 0.34);
}

.motif-card:hover,
.motif-card.is-selected {
  border-color: #e7c464;
  box-shadow: 0 0 0 2px rgba(231, 196, 100, 0.28), var(--shadow);
}

.motif-media,
.detail-visual,
.gallery-item img,
.gallery-missing {
  background:
    linear-gradient(118deg, transparent 0 72%, rgba(231, 196, 100, 0.72) 72.4%, transparent 73%),
    radial-gradient(circle at 72% 34%, rgba(8, 125, 192, 0.72) 0 22%, transparent 44%),
    linear-gradient(145deg, #020b34 0%, #043b86 52%, #087dc0 100%);
}

.motif-media img,
.detail-visual img,
.gallery-item img {
  padding: 8px;
}

.motif-visual::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(231, 196, 100, 0.44) 35px 36px, transparent 37px),
    repeating-linear-gradient(118deg, rgba(231, 196, 100, 0.18) 0 2px, transparent 2px 18px);
}

.motif-visual::after {
  border-color: rgba(244, 251, 255, 0.42);
}

.category-nat .motif-visual {
  background: #087dc0;
}

.category-fau .motif-visual {
  background: linear-gradient(145deg, #020b34 0%, #087dc0 100%);
}

.category-geo .motif-visual {
  background: #043b86;
}

.category-sac .motif-visual {
  background: #061855;
}

.motif-code {
  border-color: rgba(231, 196, 100, 0.66);
  background: rgba(2, 11, 52, 0.38);
  color: #f4fbff;
}

.image-badge,
.status-badge,
.image-zoom-button {
  background: rgba(245, 220, 134, 0.94);
  color: #020b34;
  border: 1px solid rgba(231, 196, 100, 0.5);
}

.image-zoom-button:hover,
.gallery-item:hover {
  border-color: #f5dc86;
  box-shadow: 0 0 0 2px rgba(231, 196, 100, 0.28);
}

.tag,
.data-note {
  background: rgba(8, 62, 134, 0.78);
  color: #d5ecf8;
}

.search-box input,
select,
.segmented button {
  background: rgba(2, 11, 52, 0.48);
  border-color: rgba(31, 119, 184, 0.86);
  color: #f4fbff;
}

.search-box input::placeholder {
  color: rgba(213, 236, 248, 0.72);
}

.search-box input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline-color: rgba(231, 196, 100, 0.62);
}

.image-modal {
  background: rgba(2, 11, 52, 0.88);
}

.image-modal__dialog {
  background: #020b34;
  border-color: rgba(231, 196, 100, 0.42);
}

.image-modal__bar {
  background:
    linear-gradient(118deg, transparent 0 82%, rgba(231, 196, 100, 0.8) 82.2%, transparent 83%),
    linear-gradient(90deg, #020b34 0%, #043b86 58%, #087dc0 100%);
}
