:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f4ff;
  --navy: #061b31;
  --navy-soft: #273951;
  --text: #51627a;
  --muted: #66788f;
  --purple: #0a84ff;
  --purple-dark: #0066cc;
  --purple-soft: rgba(10, 132, 255, 0.09);
  --border: #dde7f1;
  --shadow: 0 30px 45px -30px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 15px 35px rgba(23, 23, 23, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--navy);
  background:
    radial-gradient(circle at top left, rgba(10, 132, 255, 0.14), transparent 35%),
    radial-gradient(circle at top right, rgba(234, 34, 97, 0.08), transparent 30%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  position: sticky;
  top: 14px;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(245, 247, 251, 0.82);
  border: 1px solid rgba(221, 231, 241, 0.7);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0a84ff, #53a8ff);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 18px 34px -18px rgba(10, 132, 255, 0.7);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow--dark {
  color: rgba(255, 255, 255, 0.72);
}

.topbar h1,
.section h2,
.hero h2,
.card h3,
.mini-card strong {
  margin: 0;
  color: var(--navy);
}

.topbar h1 {
  font-size: 1.2rem;
}

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

.status-pill,
.badge,
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  white-space: nowrap;
}

.status-pill--warning {
  color: #8e5d00;
  background: rgba(255, 206, 84, 0.18);
  border-color: rgba(255, 206, 84, 0.42);
}

.ghost-link {
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--navy-soft);
}

.ghost-link:hover {
  background: rgba(10, 132, 255, 0.06);
  color: var(--purple-dark);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card--hero {
  display: grid;
  grid-template-columns: 1.5fr 0.95fr;
  gap: 24px;
  padding: 32px;
  margin-top: 26px;
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 64ch;
  color: var(--text);
  font-size: 1.03rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.button--primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 18px 32px -18px rgba(10, 132, 255, 0.65);
}

.button--primary:hover {
  background: var(--purple-dark);
}

.button--ghost {
  color: var(--purple-dark);
  border-color: rgba(10, 132, 255, 0.2);
  background: rgba(10, 132, 255, 0.04);
}

.hero-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfcff, #eef3ff);
  border: 1px solid #dbe3fb;
}

.hero-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(219, 227, 251, 0.9);
}

.hero-stat span,
.hero-note,
.mini-card p,
.section-lead,
.step p,
.trust-grid p,
.chat-bubble,
.compact-list,
.empty-state p {
  color: var(--text);
}

.hero-stat strong {
  font-size: 1.6rem;
  color: var(--navy);
}

.hero-note {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
}

.section {
  margin-top: 24px;
}

.summary-grid,
.report-grid,
.steps-grid,
.trust-grid {
  display: grid;
  gap: 16px;
}

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

.mini-card {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.mini-label {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.section-heading--dark h2,
.card--dark h3,
.card--dark p,
.card--dark .eyebrow,
.card--dark li,
.card--dark summary {
  color: #f7f9ff;
}

.section-lead {
  max-width: 44ch;
  margin: 0;
  line-height: 1.6;
}

.controls {
  padding: 16px;
  margin-bottom: 16px;
  display: grid;
  gap: 16px;
}

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

.searchbox span {
  font-size: 0.88rem;
  color: var(--navy-soft);
  font-weight: 600;
}

.searchbox input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #d8e1ef;
  background: #fff;
  color: var(--navy);
  outline: none;
}

.searchbox input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d8e1ef;
  background: #fff;
  color: var(--navy-soft);
  cursor: pointer;
}

.filter-btn.is-active {
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
}

.catalog-meta {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.draft-card {
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.draft-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.platform-chip {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.draft-title {
  font-size: 1.1rem;
  line-height: 1.22;
}

.draft-id,
.draft-provenance,
.draft-meta {
  font-size: 0.92rem;
  color: var(--muted);
}

.draft-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge--draft {
  background: rgba(234, 34, 97, 0.08);
  color: #b81d50;
  border-color: rgba(234, 34, 97, 0.18);
}

.badge--safe {
  background: rgba(21, 190, 83, 0.14);
  color: #0e7b31;
  border-color: rgba(21, 190, 83, 0.25);
}

.draft-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text);
}

.draft-list li::marker {
  color: var(--purple);
}

.draft-footer {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid #edf2f8;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  padding: 24px;
}

.is-hidden {
  display: none !important;
}

.report-section .card,
.step,
.chat,
.faq-list details {
  padding: 20px;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

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

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(10, 132, 255, 0.1);
  color: var(--purple-dark);
  font-weight: 700;
  margin-bottom: 12px;
}

.card--dark {
  background: linear-gradient(180deg, #16244a, #0f1936);
  border-color: rgba(255, 255, 255, 0.12);
}

.trust-section {
  padding: 24px;
}

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

.trust-grid article {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.chat-bubble {
  max-width: 80%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.55;
}

.chat-bubble--owner {
  margin-left: auto;
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.12);
  color: var(--navy);
}

.chat-bubble--bot {
  background: #fff;
  border: 1px solid var(--border);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border-radius: 18px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}

.faq-list p {
  margin: 12px 0 0;
  line-height: 1.65;
}

.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border-2, var(--border));
  background: var(--surface);
  color: var(--navy);
  transition: transform .2s ease, box-shadow .2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .28);
}

.product-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2 / 3;
  min-height: 0;
  margin-bottom: 4px;
  border-radius: 10px;
  background: linear-gradient(135deg, #172850, #0a84ff);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-media img { transform: scale(1.035); }
.product-media--fallback::after {
  content: "KeeperStore";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.9);
  font-weight: 800;
  letter-spacing: .08em;
}

.product-platform { position: absolute; left: 8px; top: 8px; padding: 4px 9px; background: rgba(0,0,0,.72); color: #fff; border: 0; font-size: .72rem; font-weight: 700; }
.product-draft-badge { position: absolute; right: 8px; top: 8px; padding: 4px 8px; background: var(--purple); color: #fff; border: 0; font-size: .68rem; }
.product-body { display: flex; flex: 1; flex-direction: column; gap: 7px; padding: 6px 2px 2px; }
.product-heading { display: block; }
.product-heading h3 { margin: 0; min-height: 2.3em; overflow: hidden; font-size: .92rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-kind { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.product-status { display: flex; flex-direction: column; gap: 1px; margin-top: auto; padding: 0; background: transparent; }
.product-status strong { color: var(--navy); font-size: .9rem; }
.product-status small { color: var(--muted); font-size: .72rem; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 3px; }
.card-action { min-height: 34px; padding: 0 7px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--navy); cursor: pointer; font-size: .74rem; font-weight: 700; }
.card-action:first-child { grid-column: 1 / -1; }
.card-action:hover { border-color: var(--purple); color: var(--purple-dark); }
.card-action--primary { color: #fff; background: var(--purple); border-color: var(--purple); }
.owner-details { color: var(--muted); font-size: .68rem; }
.owner-details summary { cursor: pointer; }
.owner-details p { margin: 6px 0 0; word-break: break-word; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 20px; }
.draft-toast { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: min(390px, calc(100vw - 32px)); padding: 18px 44px 18px 18px; border-radius: 16px; color: #fff; background: #101b38; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.draft-toast p { margin: 8px 0 0; color: rgba(255,255,255,.8); line-height: 1.45; }
.toast-close { position: absolute; right: 10px; top: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }

.cart-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(10, 132, 255, .25);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
.cart-button span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: var(--surface-soft); color: var(--purple-dark); }
.cart-button.has-items { color: #fff; background: var(--purple); border-color: var(--purple); }
.cart-button.has-items span { background: #fff; color: var(--purple-dark); }
.sortbox { display: grid; gap: 8px; }
.sortbox span { color: var(--navy-soft); font-size: .88rem; font-weight: 600; }
.sortbox select, .assistant-compose input { min-height: 46px; padding: 0 13px; border: 1px solid #d8e1ef; border-radius: 12px; background: #fff; color: var(--navy); font: inherit; }
.assistant-compose { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 760px; margin-top: 10px; padding: 12px; }
.store-dialog { width: min(720px, calc(100vw - 28px)); max-height: min(86vh, 820px); padding: 28px; overflow: auto; border: 0; border-radius: 22px; color: var(--navy); background: #fff; box-shadow: 0 32px 90px rgba(6,27,49,.28); }
.store-dialog--wide { width: min(820px, calc(100vw - 28px)); }
.store-dialog::backdrop { background: rgba(6,27,49,.58); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; float: right; top: 0; width: 36px; height: 36px; z-index: 3; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--navy); font-size: 1.35rem; cursor: pointer; }
.dialog-note, .checkout-status { color: var(--muted); }
.product-dialog-grid { display: grid; grid-template-columns: minmax(180px, .72fr) 1.28fr; gap: 24px; align-items: start; }
.product-dialog-media { overflow: hidden; aspect-ratio: 2 / 3; border-radius: 16px; background: linear-gradient(135deg,#172850,#0a84ff); }
.product-dialog-media img { width: 100%; height: 100%; object-fit: cover; }
.dialog-image-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: #fff; font-weight: 800; }
.dialog-price { display: flex; flex-direction: column; gap: 2px; margin: 18px 0; }
.dialog-price strong { font-size: 1.65rem; }
.dialog-price span { color: var(--muted); font-size: .82rem; }
.dialog-facts { padding-left: 18px; color: var(--text); line-height: 1.7; }
.cart-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-row-copy { display: flex; flex-direction: column; gap: 3px; }
.cart-row-copy small { color: var(--muted); }
.quantity { display: inline-grid; grid-template-columns: 32px 30px 32px; align-items: center; text-align: center; }
.quantity button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.cart-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.cart-total { display: flex; justify-content: space-between; margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--surface-soft); }
.cart-total strong { font-size: 1.25rem; }
.checkout-status { margin: 18px 0; padding: 14px; border: 1px solid rgba(255,174,0,.25); border-radius: 12px; background: rgba(255,206,84,.16); }

@media (max-width: 1024px) {
  .card--hero,
  .summary-grid,
  .steps-grid,
  .trust-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: start;
    border-radius: 20px;
  }

  .hero-copy h2 {
    font-size: 2rem;
  }

  .hero-text,
  .section-lead,
  .trust-grid p,
  .step p,
  .chat-bubble,
  .compact-list {
    font-size: 0.96rem;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card { padding: 9px; }
  .product-heading h3 { font-size: .82rem; }
  .card-action { min-height: 32px; font-size: .68rem; padding: 0 4px; }
  .assistant-compose { grid-template-columns: 1fr; }
  .product-dialog-grid { grid-template-columns: 1fr; }
  .product-dialog-media { width: min(230px, 100%); margin: 0 auto; }
  .store-dialog { padding: 20px; }
  .cart-row { grid-template-columns: 1fr auto; }
  .cart-row > strong { grid-column: 1 / -1; }
}
