:root {
  color-scheme: dark;
  --ink: #f7f3df;
  --muted: #aaa993;
  --forest: #07150f;
  --panel: rgba(16, 38, 29, .88);
  --line: rgba(230, 196, 86, .2);
  --gold: #e6c456;
  --green: #5bd38c;
  --red: #ff7b72;
  --orange: #f2ad57;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--forest); }
body {
  min-height: 100vh; margin: 0; overflow-x: hidden;
  background: radial-gradient(circle at 10% 0%, rgba(48, 115, 78, .32), transparent 38rem), linear-gradient(155deg, #081a12 0%, #050c08 72%);
  color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .22; }
.ambient-one { width: 24rem; height: 24rem; background: #c69d27; right: -10rem; top: 18rem; }
.ambient-two { width: 18rem; height: 18rem; background: #176a45; left: -9rem; bottom: 1rem; }
.shell { position: relative; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 calc(48px + env(safe-area-inset-bottom)); }
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; margin-bottom: 32px; }
.brand-mark { display: grid; place-items: center; width: 68px; height: 68px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(230, 196, 86, .17), rgba(7, 21, 15, .35)); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.brand-mark img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 12px rgba(230, 196, 86, .32)); }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h1 { font-size: clamp(2.25rem, 6vw, 4.5rem); line-height: .96; letter-spacing: -.045em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.025em; }
.subtitle { max-width: 620px; margin: 10px 0 0; color: var(--muted); font-size: 1rem; }
.live-pill { display: flex; gap: 9px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 14, 9, .65); color: var(--muted); font-size: .85rem; }
.live-pill span { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(242, 173, 87, .12); }
.live-pill.online { color: var(--ink); }
.live-pill.online span { background: var(--green); box-shadow: 0 0 0 5px rgba(91, 211, 140, .12); }
.action-panel, .results { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(18, 44, 33, .94), rgba(8, 22, 15, .94)); box-shadow: var(--shadow); }
.action-panel { display: flex; justify-content: space-between; gap: 32px; align-items: center; padding: 28px 30px; border-radius: 26px; }
.action-panel p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.primary-button, .ghost-button { min-height: 46px; border-radius: 14px; padding: 0 18px; cursor: pointer; font-weight: 800; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.primary-button { border: 1px solid #f4d876; background: var(--gold); color: #142015; box-shadow: 0 8px 26px rgba(230, 196, 86, .18); }
.ghost-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--ink); }
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .55; transform: none; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.summary article { padding: 20px 22px; border: 1px solid rgba(255,255,255,.07); border-radius: 20px; background: rgba(10, 27, 19, .72); }
.summary span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .82rem; }
.summary strong { font-size: 1.3rem; }
.results { overflow: hidden; border-radius: 26px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 28px 20px; }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; border-block: 1px solid var(--line); background: rgba(0,0,0,.13); color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 17px 18px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
.store-name { min-width: 155px; font-weight: 800; }
.product-link { display: block; min-height: 24px; margin-bottom: 7px; color: var(--ink); font-weight: 700; text-decoration-color: rgba(230,196,86,.5); text-underline-offset: 4px; }
.product-link:last-child { margin-bottom: 0; }
.price-list > span { display: block; min-height: 24px; margin-bottom: 7px; }
.price-list > span:last-child, .state-list > .availability:last-child { margin-bottom: 0; }
.availability { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.state-list > .availability { display: flex; margin-bottom: 7px; }
.availability.available { background: rgba(91,211,140,.14); color: #8bf0b3; }
.availability.unavailable { background: rgba(255,123,114,.13); color: #ffaaa4; }
.availability.pending { background: rgba(242,173,87,.14); color: #f7c783; }
.review { color: var(--muted); white-space: nowrap; }
.empty { padding: 44px 20px; color: var(--muted); text-align: center; }
.privacy-note { margin: 18px 4px 0; color: #858878; font-size: .8rem; text-align: center; }
dialog { width: min(430px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: #0d2419; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 6, 3, .78); backdrop-filter: blur(8px); }
dialog form { display: grid; gap: 12px; padding: 30px; }
.dialog-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(230,196,86,.12); color: var(--gold); }
dialog p:not(.eyebrow) { margin: 0 0 6px; color: var(--muted); line-height: 1.5; }
dialog label { color: var(--muted); font-size: .82rem; font-weight: 700; }
dialog input { min-height: 50px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: rgba(0,0,0,.2); color: var(--ink); padding: 0 14px; font-size: 1.1rem; letter-spacing: .15em; }
dialog input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230,196,86,.1); }
.form-error { min-height: 18px; color: var(--red) !important; font-size: .82rem; }
.admin-dialog { width: min(760px, calc(100% - 28px)); max-width: 760px; max-height: min(820px, calc(100dvh - 28px)); overflow: auto; }
.admin-shell { padding: 26px; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.admin-help { color: var(--muted); }
.stack-form { display: grid; gap: 10px; max-width: 420px; }
.stack-form label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.stack-form input, .store-form input, .store-form select { min-height: 48px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: rgba(0,0,0,.2); color: var(--ink); padding: 0 14px; }
.stack-form input:focus, .store-form input:focus, .store-form select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230,196,86,.1); }
.store-form { display: grid; grid-template-columns: 1fr 1.5fr 150px auto; gap: 10px; }
.managed-stores { display: grid; gap: 9px; margin-top: 12px; }
.managed-store { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: rgba(0,0,0,.12); }
.managed-store strong, .managed-store small { display: block; }
.managed-store small { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.managed-store.disabled { opacity: .58; }
.danger-button { min-height: 38px; padding: 0 13px; border: 1px solid rgba(255,123,114,.35); border-radius: 11px; background: rgba(255,123,114,.1); color: #ffaaa4; cursor: pointer; font-weight: 800; }
.restore-button { min-height: 38px; padding: 0 13px; border: 1px solid rgba(91,211,140,.35); border-radius: 11px; background: rgba(91,211,140,.1); color: #8bf0b3; cursor: pointer; font-weight: 800; }
.text-button { margin-top: 20px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); max-width: min(420px, calc(100% - 28px)); transform: translate(-50%, 24px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #19372a; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 680px); padding-top: calc(20px + env(safe-area-inset-top)); }
  .hero { grid-template-columns: auto 1fr; gap: 14px; }
  .brand-mark { width: 54px; height: 54px; border-radius: 17px; }
  .brand-mark img { width: 42px; height: 42px; }
  .live-pill { grid-column: 1 / -1; width: fit-content; }
  .subtitle { font-size: .92rem; }
  .action-panel { align-items: stretch; flex-direction: column; padding: 23px 20px; border-radius: 22px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary article:last-child { grid-column: 1 / -1; }
  .results { border-radius: 22px; }
  .section-heading { padding: 22px 18px 17px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-actions { width: 100%; justify-content: stretch; }
  .section-actions button { flex: 1; }
  .admin-shell { padding: 20px; }
  .admin-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .admin-heading { align-items: center; }
  .store-form { grid-template-columns: 1fr; }
  .managed-store { grid-template-columns: 1fr; }
  .managed-store button { width: 100%; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody { padding: 0 12px 12px; }
  tr { margin-bottom: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.07); border-radius: 16px; background: rgba(0,0,0,.11); }
  td { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 7px 2px; border: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  td.empty { display: block; padding: 34px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
