:root {
  --bg: #f7fbff;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.88);
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #1d9bf0;
  --primary-dark: #0b76d1;
  --violet: #8b5cf6;
  --pink: #ff3ea5;
  --emerald: #10b981;
  --danger: #e11d48;
  --warning: #f59e0b;
  --shadow: 0 16px 40px rgba(148, 163, 184, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(191, 219, 254, 0.45), transparent 35%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 55%, #f8fafc 100%);
}

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

img {
  max-width: 100%;
  display: block;
}

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

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

.page {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

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

.brand-favicon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #f1f5f9;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  color: var(--muted);
}

.nav-links a:hover,
.footer-links a:hover {
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s ease;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 14px 28px rgba(29, 155, 240, 0.2);
}

.button-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.button-secondary {
  color: #334155;
  background: #fff;
  border: 1px solid var(--line);
}

.button-ghost {
  color: #475569;
  background: transparent;
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #ef4444);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 42px;
  padding: 56px 0 28px;
  align-items: center;
}

.hero-ai {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: center;
  padding: 56px 0 24px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.hero-ai h1 {
  margin: 18px 0 0;
  font-size: 56px;
  line-height: 1.04;
}

.hero-ai .lead {
  max-width: 720px;
}

.ai-stage {
  position: relative;
  border-radius: 34px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(244,247,255,0.95));
  border: 1px solid rgba(255,255,255,0.86);
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.12);
}

.ai-stage::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(191,219,254,0.22), rgba(244,114,182,0.12));
  pointer-events: none;
}

.ai-stage > * {
  position: relative;
  z-index: 1;
}

.assistant-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.assistant-avatar {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(226,232,240,0.9);
}

.assistant-bubbles {
  display: grid;
  gap: 12px;
}

.bubble-preview {
  padding: 14px 16px;
  border-radius: 24px;
  line-height: 1.7;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.bubble-preview.ai {
  background: #fff;
  border: 1px solid #eef2f7;
  color: #334155;
}

.bubble-preview.user {
  justify-self: end;
  max-width: 88%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
}

.intent-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.intent-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.82);
}

.intent-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--primary), var(--pink));
}

.section-compact {
  padding: 22px 0 28px;
}

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

.soft-item {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(255,255,255,0.84);
  box-shadow: var(--shadow);
}

.profile-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.82);
}

.mini-stat-label {
  color: #64748b;
  font-size: 13px;
}

.mini-stat-value {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 800;
}

.baby-context {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.helper-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.helper-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(255,255,255,0.82);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.subtle-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 700;
}

.hero h1,
.section-title {
  margin: 16px 0 0;
  font-size: 52px;
  line-height: 1.08;
}

.lead {
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.actions,
.stack {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.pill {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 14px 16px;
  color: #475569;
  font-weight: 700;
  font-size: 14px;
}

.card {
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-dark {
  background: #0f172a;
  color: #fff;
}

.card-soft {
  background: linear-gradient(135deg, #ffffff, #f4f8ff);
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.grid-sidebar {
  grid-template-columns: 300px minmax(0, 1fr);
}

.section {
  padding: 34px 0;
}

.section-header {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.section-subtitle {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 10px;
}

.warning-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.success-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.footer {
  margin-top: 48px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-wrap {
  display: grid;
  gap: 24px;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  padding: 48px 0;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

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

.field label {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.25);
}

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

.helper {
  font-size: 12px;
  color: #94a3b8;
}

.error-text {
  color: var(--danger);
  font-size: 14px;
}

.layout-dashboard {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0 90px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  padding: 18px;
}

.sidebar-brand,
.sidebar-user,
.sidebar-note {
  border-radius: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid #eef2f7;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  padding: 14px 16px;
  border-radius: 18px;
  color: #475569;
  font-weight: 700;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff;
}

.main-panel {
  min-width: 0;
}

.hero-panel {
  border-radius: 32px;
  padding: 28px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #7c3aed, #ec4899);
  box-shadow: 0 24px 48px rgba(59, 130, 246, 0.2);
}

.hero-panel.dark {
  background: linear-gradient(135deg, #0f172a, #1e293b, #1d4ed8);
}

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

.inline-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.chat-box {
  display: flex;
  flex-direction: column;
  min-height: 72vh;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.chat-messages {
  flex: 1;
  background: rgba(248, 250, 252, 0.9);
  padding: 20px;
  overflow-y: auto;
  display: grid;
  gap: 16px;
}

.bubble {
  max-width: 80%;
  padding: 14px 16px;
  border-radius: 24px;
  line-height: 1.75;
  font-size: 14px;
}

.bubble.user {
  justify-self: end;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff;
}

.bubble.assistant {
  justify-self: start;
  background: #fff;
  border: 1px solid #eef2f7;
}

.chat-compose {
  border-top: 1px solid #eef2f7;
  background: #fff;
  padding: 16px;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions button {
  width: 100%;
}

.table-like {
  display: grid;
  gap: 12px;
}

.row-item {
  border-radius: 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid #eef2f7;
}

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

.small {
  font-size: 13px;
}

.text-center {
  text-align: center;
}

.mobile-topbar,
.bottom-nav {
  display: none;
}

.chart-card canvas {
  width: 100% !important;
  height: 280px !important;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 24px;
  padding: 22px;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.8);
}

@media (max-width: 1080px) {
  .hero,
  .hero-ai,
  .auth-wrap,
  .grid-sidebar,
  .chat-layout,
  .layout-dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 24px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
  }

  .bottom-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    border-radius: 24px;
  }

  .bottom-nav a {
    text-align: center;
    padding: 12px 8px;
    border-radius: 16px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
  }

  .bottom-nav a.active {
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
  }
}

@media (max-width: 900px) {
  .hero h1,
  .hero-ai h1,
  .section-title {
    font-size: 40px;
  }

  .grid-4,
  .grid-3,
  .hero-pills,
  .profile-strip,
  .baby-context {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-logo {
    height: 32px;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-ai {
    padding-top: 34px;
  }

  .container {
    width: min(100% - 24px, 1180px);
  }

  .actions .button {
    width: 100%;
  }

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