:root {
  color-scheme: dark;
  --site-bg: #060711;
  --site-bg-soft: #0b1020;
  --site-surface: rgba(10, 15, 28, 0.84);
  --site-surface-strong: rgba(13, 19, 34, 0.96);
  --site-surface-muted: rgba(255, 255, 255, 0.04);
  --site-line: rgba(255, 255, 255, 0.08);
  --site-line-strong: rgba(120, 156, 255, 0.22);
  --site-text: #f7f8fe;
  --site-muted: #9da8c5;
  --site-muted-strong: #c8d1ea;
  --site-accent: #86a6ff;
  --site-accent-strong: #5f7bf7;
  --site-accent-warm: #ff9c6c;
  --site-accent-green: #58e8ad;
  --site-danger: #ff6c6c;
  --site-shadow: 0 28px 72px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--site-text);
  background:
    radial-gradient(circle at top left, rgba(95, 123, 247, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 156, 108, 0.14), transparent 22%),
    linear-gradient(180deg, #03050c 0%, #060915 42%, #09111f 100%);
  font-family: "Space Grotesk", "Manrope", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
}

.page-shell,
.shell,
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 20px 18px 80px;
}

.topbar,
.navbar,
.app-topbar {
  position: sticky;
  top: 12px;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding: 14px 18px;
  border: 1px solid var(--site-line);
  border-radius: 24px;
  background: rgba(7, 11, 23, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.brand,
.nav-brand,
.topbar-brand,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark,
.nav-brand-mark,
.topbar-mark {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(135deg, #8fb0ff, #5f7bf7 48%, #ff9c6c);
  color: #09101d;
  box-shadow: 0 14px 28px rgba(95, 123, 247, 0.28);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-copy,
.nav-brand-text,
.topbar-brand span:not(.topbar-mark),
.brand-copy,
.brand-lockup .brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong,
.nav-brand-text strong,
.topbar-brand strong,
.brand-lockup strong {
  font-size: 1rem;
  line-height: 1.05;
}

.brand-copy small,
.nav-brand-text small,
.topbar-brand small,
.brand-lockup small {
  color: var(--site-muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-links,
.nav-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-links a,
.nav-links a,
.footer-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--site-muted);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.topbar-links a:hover,
.nav-links a:hover,
.footer-links a:hover,
.topbar-links a[aria-current="page"],
.nav-links a[aria-current="page"] {
  transform: translateY(-1px);
  color: var(--site-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--site-line);
}

.topbar-account,
.nav-account-slot,
.app-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.site-overflow {
  position: relative;
  display: flex;
  align-items: center;
}

.site-overflow-btn,
.site-overflow-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--site-muted);
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.site-overflow-btn:hover,
.site-overflow-link:hover,
.site-overflow-link[aria-current="page"] {
  transform: translateY(-1px);
  color: var(--site-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--site-line);
}

.site-overflow-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--site-line);
  border-radius: 20px;
  background: rgba(9, 14, 25, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 8px;
  z-index: 48;
}

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

.site-overflow-link {
  width: 100%;
  justify-content: space-between;
}

.site-menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--site-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--site-text);
  font: inherit;
  cursor: pointer;
}

.site-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  border: 0;
  background: rgba(3, 6, 12, 0.64);
  backdrop-filter: blur(6px);
}

body.site-drawer-open {
  overflow: hidden;
}

.hero-block,
.hero-card,
.hero-copy,
.panel-card,
.surface,
.login-card,
.identity-card,
.summary-card,
.platform-section,
.controls-copy,
.controls-panel,
.feature-card,
.stat-card,
.info-card,
.notification-card,
.incident-card,
.summary-card,
.metric-card,
.timer-card,
.result-card,
.stock-section,
.fruit-card,
.editor-block-body,
.surface--editor,
.surface--preview,
.surface--sidebar {
  border: 1px solid var(--site-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--site-surface);
  box-shadow: var(--site-shadow);
}

.panel-card,
.login-card,
.identity-card,
.surface,
.controls-copy,
.controls-panel,
.info-card,
.notification-card,
.incident-card,
.stock-section,
.result-card,
.feature-card,
.metric-card,
.timer-card {
  border-radius: 28px;
}

.hero-block,
.hero-card,
.hero-copy,
.panel-card,
.login-card,
.surface,
.controls-copy,
.controls-panel,
.info-card,
.stock-section,
.result-card {
  padding: 24px;
}

.eyebrow,
.panel-kicker,
.controls-kicker,
.section-kicker {
  margin: 0;
  color: var(--site-accent-warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Manrope", system-ui, sans-serif;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-block h1,
.hero-card h1,
.hero-copy h1 {
  margin: 14px 0 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.hero-text,
.panel-subcopy,
.empty-copy,
.component-message,
.incident-message,
.section-copy,
.hero-copy p,
.controls-copy p,
.notes-list,
.owner-hint {
  color: var(--site-muted);
  line-height: 1.7;
}

.panel-head,
.detail-head,
.section-header,
.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.field-shell,
.search-box,
.upload-shell,
.field {
  display: grid;
  gap: 10px;
}

.field-shell span,
.upload-shell span,
.field span {
  color: var(--site-muted-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.field-shell input,
.field-shell textarea,
.field-shell select,
.upload-shell input,
.search-box input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--site-line);
  border-radius: 18px;
  background: var(--site-surface-strong);
  color: var(--site-text);
  font: inherit;
  padding: 14px 16px;
  outline: none;
}

.field-shell input:focus,
.field-shell textarea:focus,
.field-shell select:focus,
.upload-shell input:focus,
.search-box input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--site-line-strong);
  box-shadow: 0 0 0 4px rgba(95, 123, 247, 0.12);
}

.field-shell textarea,
.field textarea {
  resize: vertical;
  min-height: 160px;
}

.primary-btn,
.ghost-btn,
.hero-button,
.action-btn,
.action-chip,
.icon-chip,
.command-copy,
.rating-btn,
.file-download,
.community-link-btn,
.community-login-btn,
.community-logout-btn,
.community-bell-btn,
.community-owner-btn,
.community-modal-submit,
.community-modal-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--site-text);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.primary-btn,
.hero-button--primary,
.action-chip--primary,
.action-btn--primary,
.community-owner-btn,
.community-modal-submit {
  background: linear-gradient(135deg, #9ab6ff, #6480ff 46%, #ff9c6c);
  border-color: rgba(154, 182, 255, 0.46);
  color: #09101d;
  font-weight: 800;
}

.danger-btn,
.action-chip--danger {
  background: rgba(255, 108, 108, 0.12);
  color: #ffd0d0;
  border-color: rgba(255, 108, 108, 0.26);
}

.ghost-btn:hover,
.primary-btn:hover,
.hero-button:hover,
.action-btn:hover,
.action-chip:hover,
.icon-chip:hover,
.command-copy:hover,
.rating-btn:hover,
.file-download:hover,
.site-menu-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--site-line-strong);
}

.action-row,
.button-row,
.hero-actions,
.detail-actions,
.result-actions,
.section-actions,
.hero-api-links,
.hero-cta,
.feature-row,
.chip-row,
.rating-row,
.dialog-actions,
.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-pill {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--site-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--site-muted-strong);
}

.status-pill[data-tone="success"] {
  color: var(--site-accent-green);
}

.status-pill[data-tone="error"] {
  color: var(--site-danger);
}

.status-pill[data-tone="loading"] {
  color: var(--site-accent);
}

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

.page-footer,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 20px 22px;
  border: 1px solid var(--site-line);
  border-radius: 24px;
  background: rgba(10, 15, 28, 0.72);
}

.page-footer__copy,
.footer-copy {
  display: grid;
  gap: 6px;
}

.page-footer__copy span,
.footer-copy span {
  color: var(--site-muted);
}

@media (max-width: 980px) {
  .site-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .topbar,
  .navbar {
    align-items: center;
    flex-wrap: nowrap;
  }

  .topbar-links,
  .nav-links {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 42;
    max-height: calc(100svh - 24px);
    overflow: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 84px 18px 20px;
    border: 1px solid var(--site-line);
    border-radius: 28px;
    background: rgba(7, 11, 23, 0.98);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  }

  .topbar.is-open .topbar-links,
  .navbar.is-open .nav-links {
    display: flex;
  }

  .topbar-links::before,
  .nav-links::before {
    content: "Menu";
    position: absolute;
    top: 22px;
    left: 18px;
    color: var(--site-muted-strong);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .topbar-links a,
  .nav-links a,
  .site-overflow-btn,
  .site-overflow-link {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-account,
  .nav-account-slot,
  .app-actions {
    margin-left: 0;
  }

  .site-overflow {
    width: 100%;
    display: grid;
    gap: 8px;
  }

  .site-overflow-menu {
    position: static;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .shell,
  .app-shell {
    padding-inline: 12px;
    padding-bottom: 52px;
  }

  .topbar,
  .navbar,
  .app-topbar,
  .hero-block,
  .hero-card,
  .hero-copy,
  .panel-card,
  .surface,
  .login-card,
  .controls-copy,
  .controls-panel,
  .stock-section,
  .result-card,
  .page-footer,
  .footer {
    padding: 18px;
    border-radius: 22px;
  }

  .topbar-account,
  .nav-account-slot,
  .app-actions {
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .site-menu-toggle {
    width: 44px;
    height: 44px;
  }

  .topbar-links,
  .nav-links {
    inset: 10px;
    padding: 78px 14px 18px;
    border-radius: 22px;
  }

  .hero-block h1,
  .hero-card h1,
  .hero-copy h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .hero-actions > *,
  .action-row > *,
  .button-row > *,
  .detail-actions > *,
  .result-actions > *,
  .hero-cta > * {
    flex: 1 1 100%;
  }

  .page-footer,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
