:root {
  --ink: #18212f;
  --muted: #5d6877;
  --line: #dfe5ec;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --sky: #dff4ff;
  --mint: #dff8ec;
  --sun: #ffe5a8;
  --coral: #ff8f78;
  --blue: #2563eb;
  --blue-dark: #1749b8;
  --green: #16845d;
  --red: #bf2d2d;
  --shadow: 0 14px 35px rgba(31, 45, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: white;
  background: var(--blue);
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.nav-link,
.secondary,
.primary,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
}

.nav-link {
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
}

.nav-link.active,
.nav-link:hover {
  color: var(--blue);
  background: #edf4ff;
}

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

.icon-button {
  position: relative;
  min-width: 48px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border-color: var(--line);
}

.icon {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: white;
  background: var(--coral);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.primary,
.secondary {
  padding: 10px 16px;
  font-weight: 700;
}

.primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

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

.secondary {
  color: var(--ink);
  background: white;
  border-color: var(--line);
}

.small {
  min-height: 36px;
  padding: 8px 12px;
}

.full {
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.05fr);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 48px 6vw 26px;
  background:
    linear-gradient(135deg, rgba(223, 244, 255, 0.92), rgba(255, 229, 168, 0.76)),
    linear-gradient(90deg, #f7fbff, #fff8e6);
}

.hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero p {
  max-width: 670px;
  color: #334155;
  font-size: 18px;
  line-height: 1.55;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
}

.robot {
  position: relative;
  width: min(76vw, 430px);
  aspect-ratio: 1 / 1;
}

.robot-face,
.robot-body,
.antenna {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.robot-face {
  top: 16%;
  display: flex;
  justify-content: center;
  gap: 70px;
  width: 82%;
  height: 54%;
  padding-top: 88px;
  background: #ffffff;
  border: 5px solid #1e293b;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.robot-face::after {
  position: absolute;
  left: 50%;
  bottom: 80px;
  width: 110px;
  height: 26px;
  content: "";
  border: 5px solid #1e293b;
  border-top: 0;
  border-radius: 0 0 60px 60px;
  transform: translateX(-50%);
}

.robot-face i {
  width: 42px;
  height: 42px;
  background: var(--blue);
  border: 4px solid #1e293b;
  border-radius: 50%;
}

.robot-body {
  bottom: 8%;
  width: 62%;
  height: 30%;
  background: var(--mint);
  border: 5px solid #1e293b;
  border-radius: 24px 24px 32px 32px;
}

.antenna {
  top: 2%;
  width: 8px;
  height: 64px;
  background: #1e293b;
}

.antenna::before {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 26px;
  height: 26px;
  content: "";
  background: var(--coral);
  border: 4px solid #1e293b;
  border-radius: 50%;
  transform: translateX(-50%);
}

.toy-chip {
  position: absolute;
  z-index: 2;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.chip-a {
  top: 18%;
  left: 4%;
}

.chip-b {
  right: 2%;
  bottom: 31%;
}

.chip-c {
  bottom: 13%;
  left: 14%;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0 6vw 30px;
  background: #fff8e6;
}

.trust-strip article {
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel,
.product-card,
.form-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
}

h2,
h3,
p {
  overflow-wrap: anywhere;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span,
.toggle span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
}

.toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 1px;
}

.cart-items,
.timeline {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: var(--soft);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.cart-row,
.timeline-item {
  padding: 12px;
  background: var(--soft);
  border: 1px solid #e5eaf0;
  border-radius: 8px;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.cart-row strong,
.cart-row span {
  display: block;
}

.cart-row span,
.timeline-item p {
  color: var(--muted);
  font-size: 13px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 30px;
  height: 30px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.totals {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.totals dt {
  color: var(--muted);
}

.totals dd {
  margin: 0;
  font-weight: 800;
}

.totals .grand {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.workspace {
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--blue);
  background: #edf4ff;
  border: 1px solid #c7dbff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-rows: 190px 1fr;
  min-height: 500px;
  overflow: hidden;
}

.product-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--sky);
}

.product-art::before {
  width: 118px;
  height: 118px;
  content: "";
  background: var(--toy-color);
  border: 5px solid #1e293b;
  border-radius: var(--toy-radius, 24px);
  box-shadow: 36px 32px 0 rgba(255, 255, 255, 0.58);
}

.product-art::after {
  position: absolute;
  bottom: 28px;
  width: 180px;
  height: 18px;
  content: "";
  background: rgba(30, 41, 59, 0.14);
  border-radius: 50%;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

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

.tag {
  padding: 5px 8px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.price {
  font-size: 24px;
  font-weight: 900;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.form-grid,
.account-grid,
.support-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-section {
  padding: 18px;
}

.full-span {
  grid-column: 1 / -1;
}

.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.payment-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.payment-options input {
  width: 18px;
  min-height: 18px;
}

.service-box {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 14px;
  color: #334155;
  background: #f8fbff;
  border: 1px solid #d8e7ff;
  border-radius: 8px;
  line-height: 1.45;
}

code {
  padding: 2px 5px;
  color: #0f3f91;
  background: #e7f0ff;
  border-radius: 6px;
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.adapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.adapter-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid #e5eaf0;
  border-radius: 8px;
}

.adapter-grid span {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 360px;
  padding: 14px 16px;
  color: white;
  background: #1f2937;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

dialog {
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.detail .product-art {
  min-height: 100%;
}

.detail-body {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.detail-body ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.risk-high {
  color: var(--red);
}

.risk-ok {
  color: var(--green);
}

@media (max-width: 1100px) {
  .topbar,
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: flex-start;
  }

  .top-actions {
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
  }

  .layout {
    padding: 18px;
  }

  .sidebar {
    order: 2;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

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

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  .brand {
    align-items: flex-start;
  }

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

  .nav-link {
    width: 100%;
  }

  .hero {
    padding: 34px 18px 18px;
  }

  .hero-art {
    min-height: 330px;
  }

  .chip-a,
  .chip-b,
  .chip-c {
    display: none;
  }

  .trust-strip,
  .product-grid,
  .form-grid,
  .account-grid,
  .support-grid,
  .admin-grid,
  .metrics,
  .adapter-grid,
  .detail {
    grid-template-columns: 1fr;
  }

  .full-span {
    grid-column: auto;
  }

  .product-card {
    min-height: auto;
  }

  .section-head,
  .price-row {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions,
  .hero-actions {
    display: grid;
  }
}
