:root {
  --bg: #edf6ff;
  --surface: rgba(255, 255, 255, .88);
  --surface-strong: #fff;
  --ink: #17324d;
  --muted: #6f88a2;
  --line: rgba(91, 139, 190, .18);
  --accent: #5a9fe6;
  --accent-strong: #3f86d1;
  --accent-soft: #d9edff;
  --green: #6fb9d7;
  --yellow: #94bdf3;
  --blue: #78a8e6;
  --purple: #9bb8ea;
  --shadow: 0 18px 48px rgba(70, 115, 161, .14);
  --shadow-soft: 0 10px 28px rgba(70, 115, 161, .10);
  --radius: 30px;
}

:root[data-theme="dark"] {
  --bg: #091624;
  --surface: rgba(18, 34, 52, .9);
  --surface-strong: #102033;
  --ink: #f1f8ff;
  --muted: #9eb6cd;
  --line: rgba(148, 190, 232, .18);
  --accent: #76b5f1;
  --accent-strong: #98c8ff;
  --accent-soft: rgba(83, 136, 196, .22);
  --green: #79bfe0;
  --yellow: #8fb8f2;
  --blue: #63a5ee;
  --purple: #8eaee3;
  --shadow: 0 18px 48px rgba(0, 0, 0, .35);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, .24);
}

html {
  background:
    radial-gradient(circle at top right, rgba(145, 195, 255, .5), transparent 30%),
    linear-gradient(180deg, #f6fbff 0%, var(--bg) 42%, #edf6ff 100%);
}
body { background: transparent; }
.app-shell { padding: 22px 18px calc(138px + var(--safe-bottom)); }
.paper-card {
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--shadow-soft);
}
.text-button { color: var(--accent-strong); }
.theme-button { padding: 0; }
.theme-button-track {
  width: 24px;
  height: 24px;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 86%, var(--accent-soft)));
}
.theme-button-knob {
  width: 10px;
  height: 20px;
  margin-left: auto;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 70%, white));
}
:root[data-theme="dark"] .theme-button-knob { margin-left: 0; }

.hero-card {
  min-height: 214px;
  padding: 28px;
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 20%),
    linear-gradient(145deg, rgba(234, 245, 255, .94), rgba(209, 231, 255, .92));
}
:root[data-theme="dark"] .hero-card {
  background: linear-gradient(145deg, rgba(24, 48, 73, .96), rgba(20, 58, 92, .92));
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -48px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(131, 183, 241, .14);
}
.hero-copy { color: color-mix(in srgb, var(--ink) 72%, var(--muted)); line-height: 1.58; }
.orbit { border-color: rgba(99, 151, 208, .22); }
.orbit-a { background: rgba(255, 255, 255, .34); }
.orbit-b { background: linear-gradient(180deg, rgba(147, 193, 243, .24), rgba(255, 255, 255, .72)); }

.tiny-pill {
  padding: 8px 12px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--surface-strong) 84%, var(--accent-soft));
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  font-weight: 800;
}
.quick-grid { gap: 12px; }
.quick-card {
  padding: 16px 10px 14px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--shadow-soft);
}
.quick-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.quick-card .sticker,
.record-sticker {
  background: linear-gradient(180deg, rgba(222, 239, 255, .95), rgba(201, 228, 255, .95));
}
.quick-card:nth-child(2n) .sticker,
.quick-card:nth-child(3n) .sticker {
  background: linear-gradient(180deg, rgba(206, 232, 255, .95), rgba(228, 242, 255, .95));
}
.record-list { gap: 12px; }
.record-card {
  padding: 15px;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--shadow-soft);
}
.record-sticker { width: 56px; height: 56px; }
.empty-state, .quick-empty { background: rgba(255, 255, 255, .46); }

.calendar-day.selected {
  color: var(--accent-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, white), color-mix(in srgb, var(--accent) 16%, white));
}
.calendar-day.today .day-number { color: var(--accent-strong); }
.select-compact { background: color-mix(in srgb, var(--surface-strong) 92%, transparent); }
.metric-grid { gap: 12px; }
.metric-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 95%, transparent), color-mix(in srgb, var(--accent-soft) 35%, var(--surface-strong)));
}
.donut::after { background: color-mix(in srgb, var(--surface-strong) 94%, transparent); }

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 28px rgba(84, 153, 228, .24);
}
.field input, .field select, .field textarea,
.emoji-picker button {
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}
.emoji-picker button.selected {
  background: linear-gradient(180deg, rgba(222, 239, 255, .9), rgba(206, 232, 255, .92));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}
.sheet::backdrop, .login-dialog::backdrop { background: rgba(16, 30, 46, .42); backdrop-filter: blur(6px); }
.sheet-panel, .login-card { background: color-mix(in srgb, var(--surface-strong) 94%, transparent); }

.fab {
  z-index: 40;
  bottom: calc(17px + var(--safe-bottom));
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .75);
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 16px 30px rgba(72, 137, 210, .28);
  font-size: inherit;
}
.fab-icon, .nav-icon { display: grid; place-items: center; }
.fab-icon, .fab-icon svg { width: 22px; height: 22px; }
.nav-icon, .nav-icon svg { width: 22px; height: 22px; }
.fab-icon svg, .nav-icon svg { display: block; }

.bottom-nav {
  z-index: 30;
  height: calc(94px + var(--safe-bottom));
  padding: 12px 18px calc(12px + var(--safe-bottom));
  border-inline: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 30px 30px 0 0;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  box-shadow: 0 -14px 34px rgba(72, 115, 162, .10);
  backdrop-filter: blur(22px);
}
.bottom-nav::before { display: none; }
.nav-item { position: relative; z-index: 2; color: var(--muted); gap: 4px; }
.nav-item small { font-size: .60rem; font-weight: 700; }
.nav-item.active { color: var(--accent-strong); font-weight: 850; }

.toast { bottom: calc(118px + var(--safe-bottom)); }

@media (max-width: 520px) {
  .hero-card { min-height: 194px; }
  .quick-grid { grid-template-columns: repeat(4, 88px); }
  .bottom-nav { padding-inline: 12px; }
}
