@font-face {
  font-family: Inter;
  src: url('/assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #12154e;
  --muted: #494e76;
  --accent: #5435df;
  --accent-deep: #3422ac;
  --line: #c7d3fb;
  --surface: #f3f5ff;
  --shadow: 0 8px 18px rgba(60, 76, 169, .13);
  --gradient: linear-gradient(145deg, #925dff 0%, #6546f5 52%, #4931d9 100%);
  --motion-fast: 140ms;
  --motion-standard: 220ms;
  --motion-emphasis: 340ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  font-family: Inter, sans-serif;
  color: var(--ink);
  background: #ecf0ff;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 10%, #f7faff, #edf0ff 68%); }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
svg.icon { width: 18px; height: 18px; vertical-align: middle; flex: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip {
  position: fixed;
  z-index: 5;
  inset: 10px auto auto 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  transform: translateY(-150%);
}
.skip:focus { transform: none; }
.wrap { width: min(1280px, calc(100% - 112px)); margin-inline: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 27px;
  letter-spacing: -.075em;
  font-weight: 890;
  white-space: nowrap;
}
.brand img { object-fit: contain; }

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding-inline: 17px;
  white-space: nowrap;
  font-weight: 760;
  font-size: 13px;
  transition: transform var(--motion-standard) var(--ease-out),
    box-shadow var(--motion-fast), border-color var(--motion-fast);
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .56; cursor: wait; transform: none; }
.primary {
  color: white;
  background: var(--gradient);
  border-color: #245d9a;
  box-shadow: 0 3px 9px #204f7d33, inset 0 1px 0 #ffffff33;
}
.primary:hover { background: linear-gradient(#3a83c7, #20518b); }
.secondary {
  border-color: #b7cfe9;
  background: linear-gradient(#fff, #e9f3ff);
  color: var(--ink);
  box-shadow: 0 4px 10px #3b52941a;
}
.secondary:hover { background: #fff; }

.card-open { display: block; width: 100%; padding: 0; text-align: left; border: 0; background: none; }

.favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  color: white;
  background: #21244f7d;
  border: 1px solid #ffffff85;
  border-radius: 50%;
}
.favorite:hover { background: var(--accent-deep); }
.favorite[aria-pressed="true"] { color: #f779aa; }
.favorite[aria-pressed="true"] .icon { fill: #f779aa; }
.favorite .icon { width: 16px; height: 16px; }
.empty {
  padding: 29px 18px;
  text-align: center;
  color: var(--muted);
  background: #f7f8ffb0;
  border: 1px dashed #adb9ec;
  border-radius: 13px;
}

.text-button { border: 0; background: none; color: var(--accent-deep); padding: 0; font-weight: 760; }
.text-button:hover { text-decoration: underline; }

dialog {
  width: min(550px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 0;
  color: var(--ink);
  border: 1px solid #fff;
  border-radius: 23px;
  background: linear-gradient(145deg, #f7f8ff, #e8edff);
  box-shadow: 0 20px 80px #211d6670, inset 0 0 0 1px #d1daf9;
}
dialog::backdrop { background: #24274e75; backdrop-filter: blur(5px); }
.panel-body { position: relative; padding: 25px; }
.close {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid white;
  border-radius: 50%;
  color: var(--ink);
  background: #f6f7ffed;
  box-shadow: 0 3px 9px #2b316228;
}
.close:hover { background: white; }
.panel-body h2 { font-size: clamp(24px, 3.4vw, 31px); font-weight: 860; letter-spacing: -.058em; padding-right: 25px; }
.panel-body p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 8px 0 15px; }
.panel-body form { display: grid; gap: 10px; }
.panel-body label { font-size: 13px; font-weight: 750; }
.panel-body input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #bbc7f8;
  border-radius: 12px;
  background: #f7f8ff;
  color: var(--ink);
}
.panel-body .error { color: #a52256; margin: 0; }
.panel-body .panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.panel-body .muted-note { margin: 13px 0 0; font-size: 12px; }
.panel-cover { margin: -25px -25px 18px; width: calc(100% + 50px); max-width: none; height: 220px; object-fit: cover; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--accent-deep);
  background: #e8e0ff;
  border: 1px solid #d9cbff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.eyebrow .icon { width: 13px; height: 13px; }
.search-results { display: grid; gap: 8px; margin-top: 13px; }
.search-row {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  color: inherit;
  background: #f9faff;
  border: 1px solid #d0d9fa;
  border-radius: 10px;
  font-weight: 720;
}
.search-row:hover { background: #ece8ff; border-color: #beb0f3; }
.search-row img { width: 56px; height: 43px; object-fit: cover; border-radius: 6px; }
.search-row .icon { margin-left: auto; color: var(--accent); }
.toast {
  position: fixed;
  z-index: 5;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  padding: 12px 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 650;
}
.admin-panel { min-height: 320px; }
dialog:has(.admin-panel) { width: min(900px, calc(100% - 28px)); }
.admin-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 16px 0; }
.admin-metric { min-width: 0; padding: 12px; border: 1px solid #d3dcff; border-radius: 11px; background: #f9faff; color: var(--muted); font-size: 12px; }
.admin-metric strong { display: block; color: var(--ink); font-size: clamp(17px, 4vw, 25px); margin-bottom: 3px; }
.admin-table-wrap { overflow: auto; border: 1px solid #ccd6f8; border-radius: 9px; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.admin-table th { background: #e2e9ff; color: #282753; font-weight: 710; }
.admin-table :is(th, td) { padding: 9px 12px; border-bottom: 1px solid #dbe1fb; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table caption { text-align: left; padding: 10px 12px; font-weight: 760; background: #f5f6ff; }
.admin-table .button { min-height: 32px; padding-inline: 9px; font-size: 12px; }
.admin-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.admin-tools form { display: flex; align-items: center; gap: 8px; }
.admin-tools input { min-width: 0; }
.admin-pagination { display: flex; justify-content: end; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.admin-save { margin-top: 15px; padding: 12px; border: 1px solid #ccd6fa; border-radius: 9px; background: #f6f8ff; }
.admin-save pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; margin-bottom: 0; color: #3a347c; }

@media (max-width: 440px) {
  .admin-metric { padding: 8px; font-size: 11px; }
  .admin-panel { padding: 18px; }
  .admin-table :is(th, td) { padding: 8px 9px; }
}

@keyframes arrive {
  from { opacity: .35; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes save-confirmation {
  45% { scale: 1.24; }
}

@media (prefers-reduced-motion: no-preference) {
  .just-saved .icon { animation: save-confirmation var(--motion-emphasis) var(--ease-out); }
  .toast:not([hidden]) { animation: arrive var(--motion-standard) var(--ease-out) both; }

  #panel[open] { animation: arrive var(--motion-standard) var(--ease-out) both; }
  #panel[open]::backdrop { animation: fade-in var(--motion-standard) ease-out both; }

  @supports (transition-behavior: allow-discrete) and (overlay: auto) {
    #panel {
      opacity: 0;
      translate: 0 8px;
      scale: .99;
      pointer-events: none;
      transition: opacity var(--motion-fast) var(--ease-in),
        translate var(--motion-fast) var(--ease-in), scale var(--motion-fast) var(--ease-in),
        display var(--motion-fast) allow-discrete, overlay var(--motion-fast) allow-discrete;
    }

    #panel[open] {
      opacity: 1;
      translate: 0 0;
      scale: 1;
      pointer-events: auto;
      transition-duration: var(--motion-standard);
      transition-timing-function: var(--ease-out);
      animation: none;
    }

    #panel::backdrop {
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--motion-fast) ease-out,
        display var(--motion-fast) allow-discrete, overlay var(--motion-fast) allow-discrete;
    }

    #panel[open]::backdrop {
      opacity: 1;
      pointer-events: auto;
      transition-duration: var(--motion-standard);
      animation: none;
    }

    @starting-style {
      #panel[open] { opacity: 0; translate: 0 8px; scale: .99; }
      #panel[open]::backdrop { opacity: 0; }
    }
  }

  .button:active:not(:disabled), .favorite:active { transform: scale(.97); }
  .favorite { transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .button:hover { transform: none; }
}
