/* ===========================================================
   MyLongevityPal — a fitness & longevity tracker, dressed in a
   dark, premium design language.
   Web and mobile share one phone-shell layout so they match.
   =========================================================== */

:root {
  /* Premium dark palette */
  --bg: #060708;
  --screen: #0b0c0f;
  --surface: #1c2029;
  --surface-2: #2a2f3a;
  --surface-3: #363c49;
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --text: #ffffff;
  --text-2: #a2a6b0;
  --text-3: #6c7079;

  /* Accent (electric blue → violet) */
  --accent: #2f6bff;
  --accent-2: #6f4dff;
  --accent-soft: rgba(47, 107, 255, 0.16);
  --grad: linear-gradient(135deg, #2f6bff 0%, #6f4dff 100%);
  --grad-warm: linear-gradient(135deg, #ff8a3d 0%, #ff5c8a 100%);

  /* Macro + status colors tuned for dark */
  --carbs: #25d4c4;
  --fat: #a06bff;
  --protein: #ffb23e;
  --cal: #3d7bff;
  --good: #21c97a;
  --over: #ff5d6c;

  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-pill: 999px;

  --shell-w: 430px;
  --shell-h: 924px;

  --tab-h: 86px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Ambient glow behind the device (desktop) */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 12%, rgba(111, 77, 255, 0.20), transparent 60%),
    radial-gradient(55% 45% at 18% 88%, rgba(47, 107, 255, 0.20), transparent 60%),
    linear-gradient(160deg, #0b0c10 0%, #0a0a0c 100%);
}

/* ---------- Phone shell ---------- */
.device {
  position: relative;
  z-index: 1;
  width: var(--shell-w);
  height: min(var(--shell-h), 96vh);
  max-height: 96vh;
  border-radius: 54px;
  padding: 12px;
  background: linear-gradient(145deg, #2a2d34, #0c0d10);
  box-shadow:
    0 50px 120px -30px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 2px 10px rgba(255, 255, 255, 0.08) inset;
}

.device-screen {
  position: relative;
  width: 100%; height: 100%;
  background: var(--screen);
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* On real phones / narrow screens, go full-bleed (web == app) */
@media (max-width: 600px) {
  body { display: block; overflow: hidden; }
  .ambient { display: none; }
  .device {
    width: 100vw; height: 100vh; height: 100dvh;
    max-height: none; border-radius: 0; padding: 0;
    background: var(--screen); box-shadow: none;
  }
  .device-screen { border-radius: 0; }
}

/* ---------- Top safe-area spacer (replaces simulated status bar) ---------- */
.topspace { flex: none; height: env(safe-area-inset-top, 0px); min-height: 14px; }

/* ---------- View / scroll area ---------- */
.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px calc(var(--tab-h) + 24px);
  scrollbar-width: none;
}
.view::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- App header ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 14px;
  position: sticky; top: 0; z-index: 4;
  background: linear-gradient(180deg, var(--screen) 65%, rgba(14,15,18,0));
}
.appbar h1 {
  margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.appbar h1 .chev { color: var(--text-2); display: inline-flex; }
.appbar .right { display: inline-flex; align-items: center; gap: 12px; }

.streak {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 7px 12px; border-radius: var(--r-pill);
  font-weight: 800; font-size: 15px;
}
.streak svg { color: #ffd23e; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline);
  color: var(--text); cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

/* ---------- Week strip ---------- */
.weekstrip {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin: 2px 2px 18px;
}
.daycol { display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: pointer; }
.daycol .dl { font-size: 13px; font-weight: 700; color: var(--text-3); position: relative; }
.daycol.today .dl { color: var(--text); }
.daycol.today .dl::after {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.daydot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--hairline-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--screen); transition: transform .12s ease;
}
.daydot.done { background: var(--text); border-color: var(--text); }
.daycol.sel .daydot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.daycol:active .daydot { transform: scale(0.9); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 24px -16px rgba(0, 0, 0, 0.7);
}
.card.tap { cursor: pointer; }
.card.tap:active { transform: scale(0.992); }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 4px 12px;
}
.section-title h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.link { color: var(--accent); font-weight: 700; font-size: 15px; cursor: pointer; background: none; border: 0; }

/* ---------- Calorie card ---------- */
.cal-card .cal-top { display: flex; align-items: baseline; justify-content: space-between; }
.cal-label { color: var(--text-2); font-weight: 600; font-size: 15px; }
.cal-big { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.cal-big span { font-size: 17px; color: var(--text-3); font-weight: 600; }
.cal-side { text-align: right; }
.cal-side .num { font-size: 20px; font-weight: 800; }
.cal-side .num.over { color: var(--over); }
.cal-side .num.left { color: var(--good); }
.cal-side .lbl { font-size: 13px; color: var(--text-3); font-weight: 600; }

.track {
  position: relative; height: 12px; border-radius: var(--r-pill);
  background: var(--surface-2); overflow: hidden; margin-top: 16px;
}
.track .fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill); }
.track .fill.cal { background: var(--grad); }
.stripes {
  position: absolute; top: 0; bottom: 0; border-radius: var(--r-pill);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.28) 0 6px, transparent 6px 12px);
}

/* ---------- Macros card ---------- */
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; position: relative; }
.macro .mtop { display: flex; align-items: baseline; gap: 6px; }
.macro .mname { font-size: 15px; font-weight: 700; color: var(--text-2); }
.macro .mval { font-size: 19px; font-weight: 800; margin: 6px 0 10px; }
.macro .mval small { color: var(--text-3); font-weight: 600; font-size: 14px; }
.mbar { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; position: relative; }
.mbar .mfill { position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill); }
.macros .swap {
  position: absolute; top: -6px; right: -4px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer;
}

/* ---------- Diary meal cards ---------- */
.meal { padding: 16px 18px; }
.meal-head { display: flex; align-items: center; gap: 13px; }
.tile {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.tile svg { width: 22px; height: 22px; }
.meal-title { flex: 1 1 auto; min-width: 0; }
.meal-title .mt { font-size: 18px; font-weight: 800; }
.meal-title .ms { font-size: 14px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-title .mm { font-size: 13px; color: var(--text-3); margin-top: 3px; font-weight: 600; }
.meal-title .mm b { color: var(--text-2); font-weight: 700; }
.dots { color: var(--text-3); cursor: pointer; padding: 4px; }
.btn-log {
  background: var(--accent-soft); color: #7ea6ff; border: 0;
  font-weight: 800; font-size: 15px; padding: 9px 18px; border-radius: var(--r-pill);
  cursor: pointer;
}
.btn-log:active { transform: scale(0.95); }

.meal-sub {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--hairline); margin-top: 14px; padding-top: 13px;
  cursor: pointer;
}
.meal-sub .ms-txt { flex: 1 1 auto; }
.meal-sub .ms-txt .a { font-size: 14px; font-weight: 700; }
.meal-sub .ms-txt .b { font-size: 13px; color: var(--text-3); margin-top: 1px; }
.meal-sub .plus, .row-add {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text); border: 0; cursor: pointer;
}

.logged-item {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--hairline); margin-top: 12px; padding-top: 12px;
}
.logged-item .li-main { flex: 1 1 auto; min-width: 0; }
.logged-item .li-main .n { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logged-item .li-main .s { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.logged-item .li-cal { font-size: 14px; font-weight: 700; color: var(--text-2); }
.logged-item .li-del { color: var(--text-3); cursor: pointer; padding: 4px; }

.complete-link { text-align: center; margin: 6px 0 4px; }
.complete-link button {
  background: none; border: 0; color: var(--accent); font-weight: 800; font-size: 16px; cursor: pointer; padding: 8px 20px;
}

/* ---------- Habit rows ---------- */
.list-card { padding: 4px 18px; }
.hrow {
  display: flex; align-items: center; gap: 14px; padding: 16px 0; cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}
.hrow:last-child { border-bottom: 0; }
.hrow .h-main { flex: 1 1 auto; min-width: 0; }
.hrow .h-main .a { font-size: 16px; font-weight: 700; }
.hrow .h-main .b { font-size: 13px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .h-val { font-size: 16px; font-weight: 800; white-space: nowrap; flex: none; }
.hrow .chev { color: var(--text-3); flex: none; }
.hrow .dots, .hrow .btn-log { flex: none; }
.hrow .dots { margin-left: 2px; }

/* ---------- Notes ---------- */
.note-card { display: flex; align-items: center; gap: 12px; }
.note-card .nt { flex: 1 1 auto; color: var(--text-3); font-size: 15px; }
.note-card.has .nt { color: var(--text); }

/* ---------- Generic ---------- */
.spacer { height: 8px; }
.muted { color: var(--text-3); }
.center { text-align: center; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tab-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start;
  padding: 12px 14px env(safe-area-inset-bottom);
  background: linear-gradient(180deg, rgba(14,15,18,0) 0%, var(--screen) 32%);
  z-index: 6;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text-3); cursor: pointer; padding-top: 8px; font-weight: 700; font-size: 11px;
}
.tab.active { color: var(--text); }
.tab svg { width: 24px; height: 24px; }
.tab.fab { gap: 0; padding-top: 0; }
.fab-btn {
  width: 58px; height: 58px; border-radius: 50%; margin-top: -8px;
  background: var(--grad); color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(47,107,255,0.65);
}
.fab-btn:active { transform: scale(0.92); }

/* ---------- Sheets / modals ---------- */
.sheet-host { position: absolute; inset: 0; z-index: 20; display: none; }
.sheet-host.open { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); opacity: 0; transition: opacity .22s ease; }
.sheet-host.open .scrim { opacity: 1; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--screen); border-top-left-radius: 28px; border-top-right-radius: 28px;
  max-height: 92%; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.22,.61,.36,1);
  border-top: 1px solid var(--hairline-strong);
}
.sheet-host.open .sheet { transform: translateY(0); }
.sheet.full { top: 0; bottom: 0; max-height: none; border-radius: 0; transform: translateY(100%); }
.sheet-host.open .sheet.full { transform: translateY(0); }

.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 4px; flex: none; }

.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; flex: none;
}
.sheet-head .st { font-size: 18px; font-weight: 800; display:inline-flex; align-items:center; gap:6px; }
.sheet-head .st.accent { color: var(--accent); }
.sheet-head .back, .sheet-head .close { color: var(--text); cursor: pointer; padding: 6px; display: inline-flex; }
.sheet-body { overflow-y: auto; padding: 4px 18px 26px; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }

/* search */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill); padding: 13px 16px; margin: 4px 0 16px;
}
.search input { flex: 1; background: none; border: 0; color: var(--text); font-size: 16px; font-family: var(--font); outline: none; }
.search input::placeholder { color: var(--text-3); }
.search svg { color: var(--text-3); }

.segtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--hairline); margin-bottom: 14px; }
.segtab { padding: 10px 0; font-weight: 700; color: var(--text-3); font-size: 15px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.segtab.active { color: var(--text); border-bottom-color: var(--accent); }

.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.quick {
  background: var(--accent-soft); border: 1px solid rgba(47,107,255,0.25); border-radius: var(--r-md);
  padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; position: relative;
}
.quick svg { color: var(--accent); width: 26px; height: 26px; }
.quick .ql { color: #8db2ff; font-weight: 800; font-size: 15px; }
.quick .badge { position: absolute; top: 10px; right: 10px; background: var(--accent); color:#fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: var(--r-pill); letter-spacing: .04em; }

.food-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hairline); cursor: pointer;
}
.food-row .fr-main { flex: 1 1 auto; min-width: 0; }
.food-row .fr-main .n { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.food-row .fr-main .n .verified { color: var(--good); display: inline-flex; }
.food-row .fr-main .s { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* steppers / inputs */
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 18px 0; }
.stepper button {
  width: 56px; height: 56px; border-radius: 50%; font-size: 28px; font-weight: 600;
  background: var(--surface); color: var(--text); border: 1px solid var(--hairline-strong); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.stepper button:active { transform: scale(0.93); }
.stepper .sv { min-width: 130px; text-align: center; }
.stepper .sv .n { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.stepper .sv .u { font-size: 14px; color: var(--text-3); font-weight: 600; }

.field { margin: 14px 0; }
.field label { display: block; font-size: 13px; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  color: var(--text); font-size: 17px; font-family: var(--font); padding: 14px 16px; outline: none;
}
.field select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a2a6b0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.field select option { background: var(--surface-2); color: var(--text); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; background: var(--surface-3); outline: none; margin: 10px 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--screen); box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--screen); }
.field textarea { min-height: 110px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); padding: 9px 15px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #8db2ff; }

.btn-primary {
  width: 100%; background: var(--grad); color: #fff; border: 0; border-radius: var(--r-pill);
  font-size: 17px; font-weight: 800; padding: 16px; cursor: pointer; margin-top: 8px; font-family: var(--font);
}
.btn-primary:active { transform: scale(0.985); }
.btn-ghost {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill); font-size: 16px; font-weight: 700; padding: 15px; cursor: pointer; margin-top: 10px; font-family: var(--font);
}

/* serving qty card inside food detail */
.detail-cals { text-align: center; margin: 8px 0 18px; }
.detail-cals .n { font-size: 48px; font-weight: 800; letter-spacing: -0.02em; }
.detail-cals .u { color: var(--text-3); font-weight: 600; }
.macro-ring-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 16px 0 8px; }
.mrr { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px; text-align: center; }
.mrr .pct { font-size: 13px; color: var(--text-3); font-weight: 700; }
.mrr .g { font-size: 19px; font-weight: 800; margin-top: 3px; }
.mrr .l { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- Progress screen ---------- */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 4px; }
.ring-sub { color: var(--text-2); font-size: 14px; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 16px; }
.stat .sl { color: var(--text-3); font-size: 13px; font-weight: 700; }
.stat .sv { font-size: 24px; font-weight: 800; margin-top: 6px; }
.stat .sv small { font-size: 14px; color: var(--text-3); font-weight: 600; }

.chart { width: 100%; height: 160px; display: block; }
.chart-legend { display: flex; justify-content: space-between; color: var(--text-3); font-size: 12px; font-weight: 600; margin-top: 6px; }

/* ---------- Plan / More lists ---------- */
.menu-row {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-bottom: 1px solid var(--hairline); cursor: pointer;
}
.menu-row:last-child { border-bottom: 0; }
.menu-row .m-main { flex: 1; }
.menu-row .m-main .a { font-weight: 700; font-size: 16px; }
.menu-row .m-main .b { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* ---------- Toast ---------- */
.toast-host { position: absolute; left: 0; right: 0; bottom: calc(var(--tab-h) + 12px); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--hairline-strong);
  padding: 12px 18px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.7);
  transform: translateY(16px); opacity: 0; transition: all .25s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* entrance */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to {opacity:1; transform:none;} }
.view > * { animation: fadeUp .28s ease both; }

/* ------------------------------ Auth ---------------------------- */
.auth-host { position: absolute; inset: 0; z-index: 40; display: none; }
.auth-host.open { display: block; }
.auth-scrim { position: absolute; inset: 0; background: var(--screen); }
.auth-card {
  position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 26px calc(32px + env(safe-area-inset-bottom)); text-align: center;
  animation: fadeUp .3s ease both;
}
.auth-card::-webkit-scrollbar { display: none; }
.auth-logo {
  width: 66px; height: 66px; border-radius: 20px; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
  box-shadow: 0 16px 40px rgba(111, 77, 255, 0.35);
}
.auth-logo svg { width: 32px; height: 32px; }
.auth-title { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; }
.auth-sub { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.seg-row {
  display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 4px; margin: 22px 0 4px;
}
.seg {
  flex: 1; border: 0; background: transparent; color: var(--text-2); font-family: var(--font);
  font-weight: 700; font-size: 14px; padding: 11px 8px; border-radius: var(--r-pill); cursor: pointer; transition: .18s;
}
.seg.on { background: var(--surface-3); color: var(--text); }
.auth-card .field { text-align: left; }
.auth-hint { color: var(--text-2); font-size: 13px; line-height: 1.5; margin: 2px 4px 14px; text-align: left; }
.auth-hint b { color: var(--text); }
.auth-err {
  background: rgba(255, 93, 108, 0.12); border: 1px solid rgba(255, 93, 108, 0.35); color: var(--over);
  font-size: 13.5px; font-weight: 600; padding: 11px 13px; border-radius: var(--r-sm); margin: 4px 0 6px; text-align: left;
}
.auth-alt { color: var(--text-2); font-size: 14px; margin-top: 16px; }
.auth-alt .link { font-size: 14px; }
.auth-skip {
  background: none; border: 0; color: var(--text-3); font-weight: 700; font-size: 14px;
  font-family: var(--font); cursor: pointer; margin-top: 26px; padding: 8px;
}
.row-label { display: flex; align-items: center; justify-content: space-between; }
.row-label .link { font-size: 13px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; font-weight: 600; margin: 20px 2px 8px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.btn-social {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill); font-size: 15.5px; font-weight: 700; padding: 14px; cursor: pointer;
  font-family: var(--font); margin-top: 10px;
}
.btn-social:active { transform: scale(0.985); }
.btn-social svg { flex: none; }
