:root {
  --bg: #f7f6f2;
  --bg-soft: #fdfcfa;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(89, 134, 183, 0.16);
  --border-strong: rgba(89, 134, 183, 0.26);
  --text: #24344a;
  --muted: #607089;
  --blue-50: #eef6ff;
  --blue-100: #ddefff;
  --blue-200: #c7e4ff;
  --blue-300: #a6d3fb;
  --blue-500: #679fd1;
  --blue-700: #3f6d97;
  --apricot-100: #ffe8d3;
  --apricot-200: #ffd4b3;
  --apricot-400: #efb178;
  --apricot-500: #e1924d;
  --success: #57956c;
  --danger: #c36b5d;
  --shadow: 0 22px 60px rgba(104, 134, 172, 0.14);
  --shadow-soft: 0 16px 40px rgba(104, 134, 172, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.js .view-page {
  display: none;
}

html.js .view-page.is-active {
  display: block;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(620px 420px at 0% 0%, rgba(166, 211, 251, 0.44), transparent 72%),
    radial-gradient(640px 400px at 100% 0%, rgba(255, 212, 179, 0.46), transparent 70%),
    linear-gradient(180deg, #fffefc 0%, #f8fafc 46%, #f5f1eb 100%);
}

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

button {
  cursor: pointer;
}

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

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.page-main {
  padding-bottom: 40px;
}

.ambient {
  position: fixed;
  inset: auto;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.48;
}

.ambient-left {
  top: -10rem;
  left: -10rem;
  background: rgba(168, 213, 252, 0.7);
}

.ambient-right {
  top: 8rem;
  right: -12rem;
  background: rgba(255, 206, 164, 0.68);
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(251, 250, 246, 0.72);
  border-bottom: 1px solid rgba(96, 112, 137, 0.08);
}

.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 86px;
}

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

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

.brand img {
  height: 42px;
  width: auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.menu-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(89, 134, 183, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.menu-group {
  position: relative;
}

.menu-trigger,
.menu-item-link,
.ghost-button,
.secondary-button,
.text-button {
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.menu-trigger {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.menu-trigger:hover,
.menu-trigger:focus-visible,
.menu-trigger.is-route-active,
.menu-group.is-route-active .menu-trigger,
.menu-group.is-open .menu-trigger {
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  outline: none;
}

.menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 228px;
  padding: 8px;
  display: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(89, 134, 183, 0.14);
  box-shadow: 0 22px 48px rgba(90, 112, 142, 0.18);
  backdrop-filter: blur(20px);
}

.menu-group.is-open .menu-popover,
.menu-group:hover .menu-popover,
.menu-group:focus-within .menu-popover {
  display: block;
}

.menu-group.is-open .menu-trigger {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.menu-item-link {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.menu-item-link:hover,
.menu-item-link:focus-visible,
.menu-item-link.is-active {
  background: linear-gradient(135deg, rgba(221, 239, 255, 0.92), rgba(255, 232, 211, 0.86));
  outline: none;
}

.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(89, 134, 183, 0.14);
}

.device-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--apricot-500);
  box-shadow: 0 0 0 6px rgba(225, 146, 77, 0.12);
}

.device-chip-dot.is-ok {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(87, 149, 108, 0.12);
}

.device-chip-dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(195, 107, 93, 0.12);
}

.device-chip-copy {
  display: flex;
  flex-direction: column;
}

.device-chip-copy strong {
  font-size: 0.92rem;
}

.device-chip-copy small {
  color: var(--muted);
}

.hero {
  padding: 52px 0 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.glass-card,
.soft-card,
.accent-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.72)),
    linear-gradient(140deg, rgba(166, 211, 251, 0.2), rgba(255, 212, 179, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.eyebrow,
.panel-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--blue-700);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

.hero h1,
.section-heading h2,
.workflow-card h2 {
  margin: 0;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero h1 {
  font-size: clamp(2.7rem, 4vw, 4.8rem);
  max-width: 12ch;
}

.hero-text {
  max-width: 54ch;
  margin: 22px 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions,
.inline-actions,
.form-actions,
.offers-toolbar,
.editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 26px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
}

.primary-button {
  color: #fffaf4;
  background: linear-gradient(135deg, var(--blue-500), var(--apricot-500));
  box-shadow: 0 18px 30px rgba(186, 140, 92, 0.26);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(89, 134, 183, 0.16);
}

.primary-button.narrow,
.secondary-button.narrow,
.ghost-button {
  min-height: 44px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font-weight: 700;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-badges span,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.88rem;
}

.hero-badges span {
  color: var(--blue-700);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(89, 134, 183, 0.14);
}

.glass-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
}

.soft-card {
  padding: 28px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.86), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(137, 173, 212, 0.16);
  box-shadow: var(--shadow-soft);
}

.accent-card {
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 237, 220, 0.92), rgba(255, 250, 244, 0.84));
  border: 1px solid rgba(225, 146, 77, 0.18);
}

.hero-panel,
.workflow-card {
  padding: 30px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.panel-header h2,
.spotlight-card h3,
.settings-form h3,
.offers-toolbar h3,
.workflow-card h3,
.insight-card h3,
.offer-editor h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.status-pill {
  background: rgba(255, 237, 220, 0.85);
  color: #8f5727;
  border: 1px solid rgba(225, 146, 77, 0.24);
}

.status-pill.is-ok {
  background: rgba(226, 244, 232, 0.92);
  color: #33684a;
  border-color: rgba(87, 149, 108, 0.22);
}

.status-pill.is-warning {
  background: rgba(255, 237, 220, 0.92);
  color: #8f5727;
}

.status-pill.is-error {
  background: rgba(252, 228, 225, 0.92);
  color: #984b41;
  border-color: rgba(195, 107, 93, 0.2);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.metric-tile {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(89, 134, 183, 0.12);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.metric-tile small,
.micro-note,
.feedback {
  color: var(--muted);
}

.section {
  padding: 28px 0 34px;
}

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

.section-heading p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
}

.spotlight-grid,
.settings-layout,
.device-layout,
.offers-layout,
.workflow-columns {
  display: grid;
  gap: 20px;
}

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

.orders-grid {
  margin-top: 8px;
}

.spotlight-card {
  padding: 28px;
}

.quick-nav-card {
  display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.quick-nav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 56px rgba(104, 134, 172, 0.16);
}

.feature-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.feature-list li + li {
  margin-top: 10px;
}

.compact-stack {
  gap: 8px;
}

.compact-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-left: 0;
  color: var(--muted);
}

.compact-list strong {
  color: var(--text);
}

.primary-link {
  color: var(--blue-700);
  font-weight: 700;
}

.settings-layout {
  grid-template-columns: minmax(0, 1.1fr) 320px;
  align-items: start;
}

.device-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
}

.settings-form,
.offer-editor {
  padding: 28px;
}

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

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

.field,
.toggle,
.inline-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-weight: 700;
  font-size: 0.92rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(103, 159, 209, 0.14);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.toggle,
.inline-toggle {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(89, 134, 183, 0.12);
  color: var(--text);
  font-weight: 600;
}

.toggle input,
.inline-toggle input {
  margin-right: 8px;
}

.stack {
  display: grid;
  gap: 20px;
}

.insight-card {
  padding: 26px;
}

.current-device-card h3 {
  font-size: 1.35rem;
}

.device-id-copy {
  margin: 10px 0 0;
  color: var(--muted);
  word-break: break-all;
}

.devices-panel {
  padding: 24px;
}

.devices-table-wrap {
  margin-top: 14px;
}

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

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(89, 134, 183, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 700;
}

.mini-button.danger {
  border-color: rgba(195, 107, 93, 0.22);
  color: var(--danger);
}

.device-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(244, 240, 234, 0.72);
  backdrop-filter: blur(18px);
}

.device-gate[hidden] {
  display: none;
}

.device-gate-card {
  width: min(620px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(89, 134, 183, 0.14);
  box-shadow: 0 30px 70px rgba(56, 76, 102, 0.18);
}

.device-gate-card h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.device-gate-card p {
  color: var(--muted);
}

.offers-layout {
  grid-template-columns: minmax(330px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.offers-layout.single-focus {
  grid-template-columns: minmax(0, 1.1fr) 320px;
}

.offers-panel {
  display: grid;
  gap: 16px;
}

.offers-toolbar {
  justify-content: space-between;
}

.offers-table-wrap {
  overflow: hidden;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
}

.offers-table th,
.offers-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(89, 134, 183, 0.1);
  vertical-align: top;
}

.offers-table th {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.offers-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.46);
}

.offer-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.offer-title strong {
  font-size: 1rem;
}

.offer-meta,
.sync-badges,
.inline-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.sync-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.tag {
  background: rgba(221, 239, 255, 0.74);
  color: var(--blue-700);
}

.sync-chip {
  background: rgba(255, 212, 179, 0.48);
  color: #8f5727;
}

.sync-chip.ok {
  background: rgba(226, 244, 232, 0.78);
  color: #2d6a41;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 34px 18px;
}

.workflow-panel {
  padding-bottom: 54px;
}

.workflow-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.feedback {
  min-height: 24px;
  font-size: 0.92rem;
}

.feedback.is-success {
  color: var(--success);
}

.feedback.is-error {
  color: var(--danger);
}

@media (max-width: 1080px) {
  .hero-grid,
  .spotlight-grid,
  .settings-layout,
  .device-layout,
  .offers-layout,
  .workflow-columns {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 14px;
    padding: 14px 0;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .device-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .menu-bar {
    width: 100%;
    justify-content: flex-start;
    border-radius: 24px;
  }

  .menu-group {
    width: 100%;
  }

  .menu-trigger {
    width: 100%;
    justify-content: space-between;
    display: flex;
    align-items: center;
    border-radius: 16px;
  }

  .menu-popover {
    position: static;
    min-width: 100%;
    margin-top: 8px;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-copy,
  .hero-panel,
  .settings-form,
  .offer-editor,
  .spotlight-card,
  .workflow-card {
    padding: 22px;
  }

  .field-grid,
  .field-grid.three-columns,
  .toggle-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .offers-table thead {
    display: none;
  }

  .offers-table,
  .offers-table tbody,
  .offers-table tr,
  .offers-table td {
    display: block;
    width: 100%;
  }

  .offers-table tr {
    padding: 10px 0;
  }

  .offers-table td {
    border-bottom: 0;
    padding: 10px 18px;
  }
}
