@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ── Dark (default) ── */
:root,
[data-theme="dark"] {
  --bg: #0f141e;
  --bg-elevated: #151b27;
  --bg-card: #1a2130;
  --fg: #e9edf3;
  --fg-muted: rgba(233, 237, 243, 0.6);
  --fg-subtle: rgba(233, 237, 243, 0.38);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #4c8bf5;
  --accent-inv: #ffffff;
  --logo-filter: none;
  --glass: rgba(15, 20, 30, 0.92);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  --positive: rgba(233, 237, 243, 0.92);
  --negative: rgba(233, 237, 243, 0.38);
  --color-up: #2ebd6f;
  --color-down: #f6465d;
  color-scheme: dark;
}

/* ── Light ── */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #f7f8fa;
  --bg-card: #eef1f5;
  --fg: #1f2226;
  --fg-muted: rgba(31, 34, 38, 0.62);
  --fg-subtle: rgba(31, 34, 38, 0.4);
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.2);
  --accent: #1256a0;
  --accent-inv: #ffffff;
  --logo-filter: invert(1);
  --glass: rgba(255, 255, 255, 0.94);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.06);
  --positive: #1f2226;
  --negative: rgba(31, 34, 38, 0.38);
  --color-up: #0ca750;
  --color-down: #e2464a;
  color-scheme: light;
}

:root {
  --radius: 6px;
  --radius-lg: 10px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* `hidden` attribute must always win over component display rules
   (otherwise overlays like the upsell sheet get stuck on top and eat taps). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  overscroll-behavior: none;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.num, .apr, .metric, .stat .value, .fng-value {
  font-variant-numeric: tabular-nums;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}

/* ── Header (compact, logo left / actions right) ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + var(--safe-t)) 16px 8px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-word {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg);
  white-space: nowrap;
}

.brand-word em {
  font-style: normal;
  color: var(--accent);
}

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

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.brand-meta {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--fg-subtle);
}

.brand-meta-detail {
  font-size: 0.64rem;
  color: var(--fg-subtle);
}

.pro-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0 5px;
}

.pro-entry-btn {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  border-color: var(--accent);
}

.ad-slot {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.ad-slot.show {
  display: block;
}

.ad-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  margin-bottom: 8px;
}

.house-ad {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--fg);
}

.house-ad strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.house-ad span {
  font-size: 0.72rem;
  color: var(--fg-muted);
}

/* ── Daily Brief ── */
.daily-brief {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.brief-title {
  font-size: 0.78rem;
  font-weight: 700;
}

.brief-streak {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.brief-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brief-chip {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  white-space: nowrap;
}

.brief-chip small {
  font-size: 0.62rem;
}

.brief-tip {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

.brief-tip-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-subtle);
  margin-bottom: 5px;
}

/* ── PRO in-app tools ── */
.tool-note {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 4px 0 12px;
}

.tool-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.tool-field input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
}

.tool-form .btn {
  grid-column: 1 / -1;
}

.tool-locked {
  position: relative;
}

.pro-activate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.pro-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.85rem;
}

.pro-msg {
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin: 0;
  min-height: 1.2em;
}

.pro-row.unlocked .metric {
  color: var(--color-up);
}

.pro-row.locked {
  opacity: 0.72;
}

html.is-pro .ad-slot {
  display: none !important;
}

/* ── Paywall / PRO pricing ── */
.pro-pricing {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px 22px;
  text-align: center;
  margin-bottom: 8px;
  background: var(--bg-elevated);
}

.pro-pricing.is-active { opacity: 0.6; }

.pro-pitch-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pro-pitch-sub {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 10px 0 18px;
}

.pro-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pro-price-anchor {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg-subtle);
  text-decoration: line-through;
}

.pro-price {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pro-price-note {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--fg-subtle);
}

.btn-buy {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-inv);
  font-weight: 700;
}

.btn-buy:active { opacity: 0.85; }

.pro-trust {
  font-size: 0.64rem;
  color: var(--fg-subtle);
  margin: 12px 0 0;
}

.pro-tag {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Locked content ── */
.locked-stack { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.locked-rows {
  filter: blur(6px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
}

.lock-overlay .paywall-cta { width: auto; padding: 12px 28px; border-radius: var(--radius); }

.lock-icon svg,
.lock-mini svg {
  width: 20px;
  height: 20px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 1.5;
}

.locked-more {
  width: 100%;
  border: none;
  border-top: 1px solid var(--line);
  cursor: pointer;
  background: var(--bg-elevated);
  font-family: inherit;
}

.locked-more .body strong { color: var(--fg); }
.lock-mini svg { width: 16px; height: 16px; opacity: 0.7; }

/* ── Upsell sheet ── */
.upsell-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.upsell-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  border-top: 1px solid var(--line-strong);
  border-radius: 14px 14px 0 0;
  padding: 26px 22px calc(24px + var(--safe-b));
  text-align: center;
  animation: sheet-up 0.35s var(--ease);
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.upsell-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.upsell-body {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 10px 0 18px;
}

.upsell-later {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--fg-subtle);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
}

/* ── Favorites ── */
.fav-btn {
  background: none;
  border: none;
  color: var(--fg-subtle);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 2px;
  line-height: 1;
  flex-shrink: 0;
}

.fav-btn.faved { color: #f5a623; }

/* ── Sparkline ── */
.sparkline {
  display: block;
  width: 60%;
  height: 28px;
  margin: 14px auto 0;
}

.sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Pull to refresh ── */
.ptr-indicator {
  position: fixed;
  top: calc(-44px + var(--safe-t));
  left: 50%;
  margin-left: -18px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease);
}

.ptr-indicator span {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--fg-muted);
  border-bottom: 1.5px solid var(--fg-muted);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.25s var(--ease);
}

.ptr-indicator.ready span { transform: rotate(225deg) translateY(-1px); }

.ptr-indicator.loading span {
  border: 1.5px solid var(--fg-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  transform: none;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.lang-switch {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px;
}

.lang-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-subtle);
  font-size: 0.58rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.lang-btn.active {
  background: var(--accent);
  color: var(--accent-inv);
}

.guide-disclaimer {
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--fg-subtle);
  margin: 28px 0 8px;
}

.theme-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.theme-btn:hover { border-color: var(--line-strong); }
.theme-btn:active { background: var(--bg-card); }

.theme-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
[data-theme="light"] .theme-btn .icon-sun { display: block; }
[data-theme="light"] .theme-btn .icon-moon { display: none; }

.account-btn.signed-in {
  color: var(--accent);
  border-color: var(--accent);
}

.account-btn .avatar-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ── Screens ── */
.screen {
  display: none;
  padding: 20px 16px 12px;
  animation: rise 0.35s var(--ease);
}
.screen.active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-title {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0 0 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--fg);
  margin: 26px 0 10px;
  border-bottom: 2px solid var(--line);
}

.section-title:first-child { margin-top: 0; }

.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  cursor: pointer;
  padding-bottom: 8px;
  text-align: left;
  color: var(--fg);
  transition: color 0.2s var(--ease);
  font-family: inherit;
}

.section-link::after {
  content: "?";
  font-size: 0.66rem;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-left: 12px;
  color: var(--fg-subtle);
}

.section-link:active { color: var(--accent); }

/* ── Fear & Greed ── */
.fng-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  text-align: center;
  background: var(--bg-elevated);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.fng-card.zone-fear,
.fng-card.zone-extreme-fear {
  border-color: color-mix(in srgb, var(--color-down) 35%, var(--line));
}

.fng-card.zone-greed,
.fng-card.zone-extreme-greed {
  border-color: color-mix(in srgb, var(--color-up) 35%, var(--line));
}

.fng-value {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.zone-fear .fng-value,
.zone-extreme-fear .fng-value {
  color: var(--color-down);
}

.zone-greed .fng-value,
.zone-extreme-greed .fng-value {
  color: var(--color-up);
}

.fng-label {
  color: var(--fg-muted);
  margin-top: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fng-meter {
  position: relative;
  height: 4px;
  border-radius: 2px;
  margin: 20px 4px 0;
  background: linear-gradient(
    90deg,
    var(--color-down) 0%,
    #f5a623 50%,
    var(--color-up) 100%
  );
  opacity: 0.9;
}

.fng-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--fg);
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px var(--bg);
}

.fng-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--fg-subtle);
}

/* ── Guide ── */
.guide-intro {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 0 0 20px;
}

.guide-item {
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--bg);
}

.guide-item:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.guide-item:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

.guide-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.guide-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.guide-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--fg-muted);
  border-bottom: 1.5px solid var(--fg-muted);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
  margin-top: -4px;
}

.guide-item.open .guide-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.guide-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.guide-item.open .guide-body { display: block; }

.guide-short {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 12px 0 10px;
}

.guide-text {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--fg);
}

.guide-text p { margin: 0 0 12px; }
.guide-text p:last-child { margin-bottom: 0; }
.guide-text strong { font-weight: 600; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--bg-elevated);
  padding: 14px;
  transition: background 0.3s var(--ease);
}

.stat .label {
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-subtle);
}

.stat .value {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 5px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.stat .sub { color: var(--fg-muted); font-size: 0.72rem; margin-top: 4px; }

/* ── Lists ── */
.list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.row {
  background: var(--bg-elevated);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.3s var(--ease);
}

.row .icon {
  font-size: 1.05rem;
  font-weight: 600;
  width: 26px;
  text-align: center;
  color: var(--fg-muted);
}

.row .body { flex: 1; min-width: 0; }

.row .body strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
}

.row .body span {
  color: var(--fg-muted);
  font-size: 0.72rem;
  margin-top: 2px;
  display: block;
}

.row .body span.up { color: var(--color-up); font-weight: 500; }
.row .body span.down { color: var(--color-down); font-weight: 500; }

.row .apr,
.row .metric {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  text-align: right;
}

.row .metric small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--fg-subtle);
  margin-top: 2px;
}

.pos, .up, .val-up { color: var(--color-up) !important; }
.neg, .down, .val-down { color: var(--color-down) !important; }

/* ── Chips ── */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chip {
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-inv);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 13px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

.btn-secondary { margin-top: 10px; }
.btn:active { background: var(--accent); border-color: var(--accent); color: var(--accent-inv); }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  max-width: 430px;
  margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--fg-subtle);
  font-size: 0.58rem;
  font-weight: 600;
  padding: 5px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: color 0.2s var(--ease);
  font-family: inherit;
}

.nav-btn .dot {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s var(--ease);
}

.nav-btn.active {
  color: var(--accent);
}

.nav-btn.active .dot {
  background: var(--accent);
}

.loading, .error-msg {
  text-align: center;
  color: var(--fg-muted);
  padding: 28px 16px;
  font-size: 0.76rem;
  font-weight: 500;
}

.install-banner {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.76rem;
  color: var(--fg-muted);
  line-height: 1.6;
}
.install-banner.show { display: block; }

/* ── Account / Auth ── */
.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: 24px 20px;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.auth-sub {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  font-family: inherit;
  transition: opacity 0.2s var(--ease);
}

.btn-social:active { opacity: 0.85; }

.btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-google {
  background: #ffffff;
  color: #1f1f1f;
  border-color: #dadce0;
}

.btn-naver {
  background: #03c75a;
  color: #ffffff;
  border-color: #03c75a;
}

.btn-naver .naver-n {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--fg-subtle);
  font-size: 0.68rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-msg {
  font-size: 0.74rem;
  color: var(--color-down);
  margin: 10px 0 0;
  min-height: 1.2em;
}

.auth-toggle {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  font-family: inherit;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: 18px 16px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-inv);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info { flex: 1; min-width: 0; }

.profile-info strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.profile-info span {
  display: block;
  font-size: 0.74rem;
  color: var(--fg-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-chip {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--fg-muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.account-list .row { cursor: pointer; }

.account-list .row .chev {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--fg-subtle);
  border-top: 1.5px solid var(--fg-subtle);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.btn-danger {
  border-color: color-mix(in srgb, var(--color-down) 55%, var(--line-strong));
  color: var(--color-down);
}

.btn-danger:active {
  background: var(--color-down);
  border-color: var(--color-down);
  color: #fff;
}

@media (min-width: 431px) {
  .bottom-nav,
  .topbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
