/* MangoNews Design System v3.0 - Emerald Luxe */

/* -- Color Tokens ---------------------------------------------- */
:root {
  /* Backgrounds - cool charcoal hierarchy */
  --bg-0: #0A0E11;
  --bg-1: #121820;
  --bg-2: #1A212B;
  --bg-3: #242D38;
  --bg-glass: rgba(10,14,17,0.82);

  /* Borders */
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-active: rgba(255,255,255,0.20);

  /* Text - AAA contrast ratios */
  --text-1: #F9FAFB;
  --text-2: #D1D5DB;
  --text-3: #9CA3AF;
  --text-4: #4B5563;

  /* Emerald - primary accent (luxe) */
  --emerald: #10B981;
  --emerald-bright: #34D399;
  --emerald-dark: #047857;
  --emerald-soft: rgba(16,185,129,0.08);
  --emerald-glow: rgba(16,185,129,0.20);

  /* Mango - warm secondary (brand heritage) */
  --mango: #ff9f1c;
  --mango-soft: rgba(255,159,28,0.08);
  --mango-glow: rgba(255,159,28,0.15);

  /* Semantic */
  --green: #34d399;
  --green-soft: rgba(52,211,153,0.08);
  --blue: #60a5fa;
  --blue-soft: rgba(96,165,250,0.08);
  --purple: #a78bfa;
  --purple-soft: rgba(167,139,250,0.08);
  --red: #f87171;
  --red-soft: rgba(248,113,113,0.08);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34,211,238,0.08);
  --pink: #f472b6;
  --pink-soft: rgba(244,114,182,0.08);
  --amber: #fbbf24;
  --amber-soft: rgba(251,191,36,0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.625rem;
  --text-3xl: 2rem;
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* Spacing */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 2.5rem; --sp-8: 3rem; --sp-9: 4rem;

  /* Radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --radius-xl: 20px; --radius-full: 100px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.4);
  --shadow-emerald: 0 4px 16px var(--emerald-glow);

  /* Motion */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms; --dur-normal: 250ms; --dur-slow: 400ms;

  /* Accent alias - emerald is the primary action color */
  --accent: var(--emerald);
  --accent-bright: var(--emerald-bright);
  --accent-soft: var(--emerald-soft);
  --accent-glow: var(--emerald-glow);
}

/* -- Light Theme ----------------------------------------------- */
[data-theme="light"] {
  --bg-0: #FFFFFF; --bg-1: #F9FAFB; --bg-2: #F3F4F6; --bg-3: #E5E7EB;
  --bg-glass: rgba(255,255,255,0.85);
  --border: rgba(0,0,0,0.06); --border-hover: rgba(0,0,0,0.12); --border-active: rgba(0,0,0,0.20);
  --text-1: #111827; --text-2: #6B7280; --text-3: #9CA3AF; --text-4: #D1D5DB;
  --emerald: #047857; --emerald-bright: #10B981; --emerald-dark: #064E3B;
  --emerald-soft: rgba(4,120,87,0.06); --emerald-glow: rgba(4,120,87,0.12);
  --mango: #D97706; --mango-soft: rgba(217,119,6,0.06);
  --green: #059669; --blue: #2563EB; --purple: #7C3AED; --red: #DC2626;
  --cyan: #0891B2; --pink: #DB2777; --amber: #D97706;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1); --shadow-xl: 0 16px 48px rgba(0,0,0,0.15);
  --shadow-emerald: 0 4px 16px var(--emerald-glow);
}

/* -- Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--bg-0); color: var(--text-1); line-height: var(--leading-normal); -webkit-font-smoothing: antialiased; min-height: 100vh; transition: background-color 0.3s ease, color 0.3s ease; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: var(--font-sans); }
button { cursor: pointer; }

/* -- Typography ------------------------------------------------ */
.font-serif { font-family: var(--font-serif); }
.font-mono { font-family: var(--font-mono); }
.h1 { font-family: var(--font-serif); font-size: var(--text-3xl); font-weight: 700; line-height: var(--leading-tight); letter-spacing: -0.02em; }
.h2 { font-family: var(--font-serif); font-size: var(--text-2xl); font-weight: 700; line-height: var(--leading-tight); letter-spacing: -0.01em; }
.h3 { font-family: var(--font-serif); font-size: var(--text-xl); font-weight: 600; line-height: var(--leading-tight); }
.h4 { font-size: var(--text-lg); font-weight: 600; }
.text-sm { font-size: var(--text-sm); } .text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text-2); } .text-dim { color: var(--text-3); }
.text-accent { color: var(--accent); } .text-emerald { color: var(--emerald); }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }

/* -- Buttons --------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); border: none; font-size: var(--text-sm); font-weight: 600; transition: all var(--dur-fast) var(--ease); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--emerald), var(--emerald-bright)); color: #0A0E11; box-shadow: var(--shadow-emerald); }
.btn-primary:hover { box-shadow: 0 6px 24px var(--emerald-glow); transform: translateY(-1px); }
[data-theme="light"] .btn-primary { color: #FFFFFF; background: linear-gradient(135deg, var(--emerald-dark), var(--emerald)); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--border-hover); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: var(--text-xs); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-3); display: flex; align-items: center; justify-content: center; transition: all var(--dur-fast) var(--ease); font-size: 16px; }
.btn-icon:hover { background: var(--bg-2); color: var(--text-1); }

/* -- Cards ----------------------------------------------------- */
.card { display: grid; grid-template-columns: 1fr 140px; gap: var(--sp-4); background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4) var(--sp-5); transition: all var(--dur-normal) var(--ease); cursor: pointer; }
.card:hover { background: var(--bg-2); border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card:active { transform: scale(0.99) translateY(0); transition-duration: 80ms; }
.card-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 600; font-size: var(--text-lg); line-height: var(--leading-tight); color: var(--text-1); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: 2px; }
.card-source { font-size: var(--text-xs); font-weight: 600; color: var(--emerald); }
.card-summary { font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-relaxed); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.card-original { font-size: var(--text-xs); color: var(--text-4); font-style: italic; margin-top: 2px; }
.card-thumb { width: 140px; height: 94px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; align-self: center; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: rgba(255,255,255,0.03); }
.gradient-1 { background: linear-gradient(135deg, var(--blue-soft), var(--purple-soft)); }
.gradient-2 { background: linear-gradient(135deg, var(--emerald-soft), var(--cyan-soft)); }
.gradient-3 { background: linear-gradient(135deg, var(--green-soft), var(--emerald-soft)); }
.gradient-4 { background: linear-gradient(135deg, var(--amber-soft), var(--pink-soft)); }
.card-actions { display: flex; gap: var(--sp-2); margin-top: 4px; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.card:hover .card-actions { opacity: 1; }
@media (max-width:600px) { .card-actions { opacity: 1; } }

/* -- Badges ---------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-accent { background: var(--emerald-soft); color: var(--emerald); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-dim { background: var(--bg-3); color: var(--text-3); }
.badge-mango { background: var(--mango-soft); color: var(--mango); }

/* -- Chips ----------------------------------------------------- */
.chip { padding: 6px 14px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--bg-1); color: var(--text-2); font-size: var(--text-sm); cursor: pointer; transition: all var(--dur-fast) var(--ease); user-select: none; }
.chip:hover { border-color: var(--border-hover); color: var(--text-1); }
.chip.selected { background: var(--emerald-soft); border-color: var(--emerald); color: var(--emerald); }

/* -- Inputs ---------------------------------------------------- */
.input { width: 100%; padding: 10px 14px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-1); font-size: var(--text-base); outline: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.input:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-glow); }
.input::placeholder { color: var(--text-4); }

/* -- Topbar ---------------------------------------------------- */
/* -- Topbar - 3 zones: brand | search | controls ------------ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  height: 56px; padding: 0 var(--sp-5);
  display: flex; flex-direction: row; flex-wrap: nowrap;
  align-items: center; gap: var(--sp-4);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-logo { width: 30px; height: 30px; border-radius: 7px; overflow: hidden; }
.topbar-logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar-name { font-family: var(--font-serif); font-weight: 700; font-size: var(--text-lg); letter-spacing: -0.02em; }
.topbar-center { flex: 1; display: flex; flex-direction: row; justify-content: center; min-width: 0; }
.topbar-right { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

@media (max-width: 600px) {
  .topbar { gap: var(--sp-2); padding: 0 var(--sp-3); }
  .topbar-name { display: none; }
  .streak-badge { display: none; }
}

/* -- Command Palette / Search ---------------------------------- */
.cmd-trigger { display: flex; align-items: center; gap: 8px; padding: 7px 16px; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-3); font-size: var(--text-sm); cursor: pointer; transition: all var(--dur-fast) var(--ease); min-width: 200px; max-width: 400px; width: 100%; }
@media (max-width: 600px) { .cmd-trigger { min-width: 0; padding: 7px 12px; } .cmd-trigger span:not(.cmd-icon) { display: none; } .cmd-trigger .cmd-icon { margin: 0; } }
.cmd-trigger:hover { border-color: var(--border-hover); background: var(--bg-2); color: var(--text-2); }
.cmd-trigger:active { transform: scale(0.98); background: var(--bg-3); }
.cmd-trigger .cmd-icon { font-size: 14px; }
.cmd-trigger .cmd-shortcut { margin-left: auto; font-size: var(--text-xs); color: var(--text-4); background: var(--bg-2); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); }

.cmd-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); z-index: 300; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.cmd-overlay.open { display: flex; animation: fadeIn 0.15s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cmd-modal { width: 90%; max-width: 560px; background: var(--bg-1); border: 1px solid var(--border-hover); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl), 0 0 60px var(--emerald-glow); overflow: hidden; animation: cmdSlideUp 0.2s var(--ease); }
@keyframes cmdSlideUp { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.cmd-input-wrap { display: flex; align-items: center; padding: 0 var(--sp-5); border-bottom: 1px solid var(--border); }
.cmd-input-icon { font-size: 18px; color: var(--emerald); margin-right: var(--sp-3); }
.cmd-input { flex: 1; padding: 16px 0; background: none; border: none; color: var(--text-1); font-size: var(--text-lg); outline: none; }
.cmd-input::placeholder { color: var(--text-4); }

.cmd-body { max-height: 50vh; overflow-y: auto; }
.cmd-group { padding: var(--sp-2) 0; }
.cmd-group-label { padding: var(--sp-2) var(--sp-5); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); }
.cmd-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-5); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.cmd-item:hover, .cmd-item.selected { background: var(--emerald-soft); }
.cmd-item-icon { font-size: 16px; width: 24px; text-align: center; color: var(--text-3); }
.cmd-item:hover .cmd-item-icon { color: var(--emerald); }
.cmd-item-text { flex: 1; min-width: 0; }
.cmd-item-title { font-size: var(--text-sm); font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item-sub { font-size: var(--text-xs); color: var(--text-3); }
.cmd-item-meta { font-size: var(--text-xs); color: var(--text-4); font-family: var(--font-mono); white-space: nowrap; }
.cmd-item mark { background: none; color: var(--emerald-bright); font-weight: 700; }
.cmd-footer { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-2) var(--sp-5); border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-4); }
.cmd-footer kbd { background: var(--bg-2); padding: 2px 5px; border-radius: 3px; font-family: var(--font-mono); font-size: 10px; }

/* -- Theme Toggle ---------------------------------------------- */
.theme-toggle { position: relative; }
.theme-toggle-btn { font-size: 18px; }

/* -- Streak Badge ---------------------------------------------- */
.streak-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-full); background: var(--mango-soft); color: var(--mango); font-size: var(--text-xs); font-weight: 700; font-family: var(--font-mono); }

/* -- User Menu ------------------------------------------------- */
.user-menu { position: relative; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--emerald-soft); border: 2px solid var(--emerald); display: flex; align-items: center; justify-content: center; font-size: var(--text-sm); font-weight: 700; color: var(--emerald); cursor: pointer; transition: all var(--dur-fast) var(--ease); }
.user-avatar:hover { box-shadow: 0 0 0 3px var(--emerald-glow); }
.user-avatar:active { transform: scale(0.92); }
.user-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-1); border: 1px solid var(--border-hover); border-radius: var(--radius-md); box-shadow: var(--shadow-xl); min-width: 200px; z-index: 150; overflow: hidden; }
.user-dropdown.open { display: block; animation: fadeIn 0.15s var(--ease); }
.user-dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.user-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: var(--text-sm); color: var(--text-2); transition: background var(--dur-fast); cursor: pointer; }
.user-dropdown-item:hover { background: var(--bg-2); color: var(--text-1); }

/* -- Layout ---------------------------------------------------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }

/* -- Sidebar --------------------------------------------------- */
.sidebar { background: var(--bg-1); border-right: 1px solid var(--border); padding: var(--sp-4) var(--sp-3); overflow-y: auto; transition: width var(--dur-normal) var(--ease); }
.sb-profile { text-align: center; padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-3); }
.sb-name { font-weight: 600; font-size: var(--text-base); }
.sb-pulls { font-size: var(--text-xs); color: var(--text-4); margin-top: 3px; }
.sb-tier { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: var(--radius-full); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tier-pro { background: var(--emerald-soft); color: var(--emerald); }
.tier-premium { background: var(--mango-soft); color: var(--mango); }
.tier-free { background: var(--bg-3); color: var(--text-4); border: 1px solid var(--border); }
.sb-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); padding: 0 10px; margin: var(--sp-4) 0 var(--sp-2); }
.sb-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-3); font-size: var(--text-sm); cursor: pointer; transition: all var(--dur-fast) var(--ease); border-left: 2px solid transparent; user-select: none; -webkit-tap-highlight-color: transparent; }
.sb-link:hover { background: var(--bg-2); color: var(--text-2); }
.sb-link:active { background: var(--bg-3); transform: scale(0.98); }
.sb-link.active { background: var(--emerald-soft); color: var(--emerald); border-left-color: var(--emerald); font-weight: 500; }
.sb-link .ico { font-size: var(--text-base); width: 20px; text-align: center; }
.topic-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); padding: 0 var(--sp-1); }
.sb-stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); text-align: center; }
.sb-stat-val { font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 600; }
.sb-stat-lbl { font-size: 10px; color: var(--text-4); text-transform: uppercase; }
.sidebar-toggle { display: flex; align-items: center; justify-content: center; width: 100%; padding: 8px; margin-top: var(--sp-3); border: none; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--radius-sm); transition: all var(--dur-fast); font-size: 14px; }
.sidebar-toggle:hover { background: var(--bg-2); color: var(--text-2); }
.sidebar.collapsed { width: 56px; padding: var(--sp-4) 6px; }
.sidebar.collapsed .sb-label, .sidebar.collapsed .sb-profile, .sidebar.collapsed .sb-stats, .sidebar.collapsed .topic-dot-text { display: none; }
.sidebar.collapsed .sb-link { justify-content: center; padding: 8px; font-size: 0; border-left: none; }
.sidebar.collapsed .sb-link .ico { font-size: 1.1rem; margin: 0; }

/* -- Main ------------------------------------------------------ */
.main { padding: var(--sp-6) var(--sp-7); max-width: 860px; overflow-y: auto; }

/* -- Tab Bar --------------------------------------------------- */
.tab-bar { display: flex; gap: 3px; margin-bottom: var(--sp-6); padding: 3px; background: var(--bg-1); border-radius: var(--radius-sm); border: 1px solid var(--border); width: fit-content; }
.tab { padding: 7px 16px; border-radius: 5px; border: none; background: transparent; color: var(--text-3); font-size: var(--text-sm); font-weight: 500; transition: all var(--dur-fast) var(--ease); }
.tab.active { background: var(--bg-2); color: var(--text-1); box-shadow: var(--shadow-sm); }

/* -- Section --------------------------------------------------- */
.section { margin-bottom: var(--sp-7); }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.section-bar { width: 3px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.section-icon { font-size: var(--text-xl); }
.section-name { font-family: var(--font-serif); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.01em; }
.section-count { font-size: var(--text-xs); color: var(--text-4); background: var(--bg-3); padding: 2px 8px; border-radius: var(--radius-full); }
.bar-ai { background: var(--blue); } .bar-cyber { background: var(--red); } .bar-finance { background: var(--green); }
.bar-geo { background: var(--amber); } .bar-eu { background: var(--purple); } .bar-science { background: var(--cyan); }
.bar-latam { background: var(--pink); } .bar-nl { background: var(--mango); } .bar-sports { background: var(--emerald); }
.bar-ent { background: var(--pink); } .bar-other { background: var(--text-4); }

/* -- Like/Dislike ---------------------------------------------- */
.like-btn { background: none; border: none; font-size: 1rem; padding: 4px 6px; border-radius: 4px; color: var(--text-4); transition: all var(--dur-fast) var(--ease); }
.like-btn:hover { color: var(--red); transform: scale(1.15); }
.like-btn.liked { color: var(--red); }
@keyframes heartPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.like-btn.liked .heart { animation: heartPop 0.3s var(--ease-spring); }

/* -- Toast ----------------------------------------------------- */
.toast-box { position: fixed; bottom: var(--sp-5); right: var(--sp-5); z-index: 400; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; font-size: var(--text-sm); box-shadow: var(--shadow-xl); animation: toastIn 0.3s var(--ease); display: flex; align-items: center; gap: 8px; }
.toast-ok { border-left: 3px solid var(--emerald); } .toast-info { border-left: 3px solid var(--blue); } .toast-err { border-left: 3px solid var(--red); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* -- Modal ----------------------------------------------------- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-1); border: 1px solid var(--border-active); border-radius: var(--radius-lg); padding: var(--sp-6); width: 90%; max-width: 460px; box-shadow: var(--shadow-xl); }
.modal h3 { font-family: var(--font-serif); font-size: var(--text-xl); margin-bottom: var(--sp-2); }
.modal p { color: var(--text-2); font-size: var(--text-sm); margin-bottom: var(--sp-4); }
.modal-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }

/* -- Empty / Paywall ------------------------------------------- */
.empty { text-align: center; padding: var(--sp-9) var(--sp-6); }
.empty img { width: 160px; margin: 0 auto var(--sp-5); opacity: 0.7; }
.empty h2 { font-family: var(--font-serif); font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
.empty p { color: var(--text-2); max-width: 380px; margin: 0 auto var(--sp-5); font-size: var(--text-sm); }
.paywall { position: relative; margin-top: var(--sp-6); }
.paywall-blur { filter: blur(7px); pointer-events: none; user-select: none; opacity: 0.5; }
.paywall-cta { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: var(--bg-1); border: 1px solid var(--border-active); border-radius: var(--radius-lg); padding: var(--sp-6) var(--sp-7); text-align: center; box-shadow: var(--shadow-xl); z-index: 2; }

/* -- Skeleton -------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, var(--bg-1) 25%, var(--bg-2) 50%, var(--bg-1) 75%); background-size: 200% 100%; border-radius: var(--radius-sm); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* -- Pulse / Fade ---------------------------------------------- */
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeUp 0.3s var(--ease) both; }

/* -- Scrollbar ------------------------------------------------- */
::-webkit-scrollbar { width: 5px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.1); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }

/* -- Mobile Nav ------------------------------------------------ */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
.mobile-nav-items { display: flex; justify-content: space-around; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 4px 8px; }
.mn-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-4); font-size: 10px; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: all var(--dur-fast) var(--ease); text-decoration: none; }
.mn-item:hover { color: var(--text-2); }
.mn-item.active { color: var(--emerald); }
.mn-item:active { color: var(--emerald); transform: scale(0.95); }
.mn-ico { font-size: 1.2rem; }

/* -- Responsive ------------------------------------------------ */
@media (max-width:960px) {
  .layout { grid-template-columns: 1fr; } .sidebar { display: none; }
  .main { padding: var(--sp-4); } .mobile-nav { display: block; }
  .main { padding-bottom: 5rem; } .toast-box { bottom: 5rem; }
  .cmd-trigger { min-width: 120px; } .cmd-trigger .cmd-shortcut { display: none; }
}
@media (max-width:600px) {
  .main { padding: var(--sp-3); } .tab-bar { width: 100%; } .tab { flex: 1; text-align: center; }
  .section { margin-bottom: var(--sp-5); }
  .card { grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; }
  .card-thumb { width: 100%; height: 180px; border-radius: var(--radius-md) var(--radius-md) 0 0; order: -1; }
  .card-thumb-placeholder { height: 100%; } .card-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .card-title { font-size: var(--text-base); -webkit-line-clamp: 3; }
  .card:active { transform: scale(0.98); }
}
@media (max-width:380px) { .card-thumb { height: 140px; } }

/* -- Auth Pages ------------------------------------------------ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-6); position: relative; overflow: hidden; }
.auth-page::before { content: ''; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(ellipse at 30% 20%, var(--emerald-glow) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(16,185,129,0.04) 0%, transparent 50%); animation: drift 25s ease-in-out infinite; z-index: 0; }
@keyframes drift { 0%,100% { transform: translate(0,0); } 33% { transform: translate(20px,-20px); } 66% { transform: translate(-15px,15px); } }
.auth-container { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: var(--sp-7); }
.auth-brand-img { width: 260px; margin: 0 auto var(--sp-4); }
.auth-brand-img img { width: 100%; filter: drop-shadow(0 8px 24px var(--emerald-glow)); }
.auth-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-6); }
.auth-footer { text-align: center; margin-top: var(--sp-5); font-size: var(--text-sm); color: var(--text-3); }
.auth-footer a { color: var(--emerald); }
.form-group { margin-bottom: var(--sp-4); }
.form-label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--sp-2); }
.error-box { background: var(--red-soft); border: 1px solid rgba(248,113,113,0.2); color: var(--red); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); font-size: var(--text-sm); margin-bottom: var(--sp-4); }

/* -- Reader ---------------------------------------------------- */
.reader { max-width: 720px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-9); }
.reader-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--text-sm); margin-bottom: var(--sp-6); transition: color var(--dur-fast); }
.reader-back:hover { color: var(--emerald); }
.reader-hero { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: var(--sp-5); }
.reader-hero-placeholder { width: 100%; height: 200px; border-radius: var(--radius-lg); margin-bottom: var(--sp-5); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800; color: rgba(255,255,255,0.04); }
.reader-content { font-size: var(--text-base); line-height: var(--leading-relaxed); color: var(--text-2); max-width: 65ch; }
.reader-content p { margin-bottom: var(--sp-4); }
.reader-content a { color: var(--emerald); }
.reader-divider { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }
.reader-source-box { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-5); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
@media (max-width:600px) { .reader { padding: 0 0 var(--sp-8); } .reader-back { margin: var(--sp-4) var(--sp-4) var(--sp-3); } .reader-hero { max-height: 240px; border-radius: 0; } .reader-content, .reader-divider, .reader-source-box { margin-left: var(--sp-4); margin-right: var(--sp-4); } .reader-source-box { flex-direction: column; align-items: stretch; } }

/* -- Pricing --------------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.price-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-6); display: flex; flex-direction: column; transition: all var(--dur-normal) var(--ease); }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.price-card.featured { border-color: var(--emerald); box-shadow: 0 0 40px var(--emerald-glow); position: relative; }
.price-card.featured::before { content: attr(data-badge); position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--emerald); color: #0A0E11; padding: 3px 14px; border-radius: var(--radius-full); font-size: 10px; font-weight: 700; text-transform: uppercase; }
[data-theme="light"] .price-card.featured::before { color: #FFFFFF; }
.price-name { font-family: var(--font-serif); font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--sp-2); }
.price-amount { font-size: var(--text-3xl); font-weight: 700; }
.price-period { font-size: var(--text-sm); color: var(--text-2); }
.price-desc { color: var(--text-2); font-size: var(--text-sm); margin-bottom: var(--sp-5); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--border); }
.price-features { list-style: none; flex: 1; margin-bottom: var(--sp-5); }
.price-features li { font-size: var(--text-sm); color: var(--text-2); padding: 5px 0; display: flex; align-items: center; gap: 8px; }
.price-features li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); flex-shrink: 0; }
.price-features li.off { color: var(--text-4); } .price-features li.off::before { background: var(--text-4); }
@media (max-width:768px) { .pricing-grid { grid-template-columns: 1fr; } }

/* -- Digest Body ----------------------------------------------- */
.digest-body { font-size: var(--text-base); line-height: var(--leading-relaxed); color: var(--text-2); max-width: 65ch; }
.digest-body h1 { font-family: var(--font-serif); font-size: var(--text-2xl); font-weight: 700; color: var(--text-1); margin: var(--sp-7) 0 var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.digest-body h2 { font-family: var(--font-serif); font-size: var(--text-xl); font-weight: 600; color: var(--text-1); margin: var(--sp-5) 0 var(--sp-3); display: flex; align-items: center; gap: 8px; }
.digest-body h2::before { content: ''; width: 3px; height: 1.1em; background: var(--emerald); border-radius: 2px; flex-shrink: 0; }
.digest-body h3 { font-size: var(--text-lg); font-weight: 600; color: var(--text-1); margin: var(--sp-4) 0 var(--sp-2); }
.digest-body p { margin-bottom: var(--sp-3); }
.digest-body a { color: var(--emerald); border-bottom: 1px solid transparent; transition: border-color var(--dur-fast); }
.digest-body a:hover { border-bottom-color: var(--emerald); }
.digest-body ul, .digest-body ol { margin: var(--sp-2) 0 var(--sp-4) var(--sp-5); }
.digest-body li { margin-bottom: var(--sp-1); } .digest-body li::marker { color: var(--text-4); }
.digest-body blockquote { border-left: 3px solid var(--emerald); background: var(--emerald-soft); padding: var(--sp-3) var(--sp-4); margin: var(--sp-3) 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2); font-style: italic; }
.digest-body strong { color: var(--text-1); font-weight: 600; }
.digest-body hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
.digest-body code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-2); padding: 2px 6px; border-radius: 3px; }

/* -- Ad Card --------------------------------------------------- */
.ad-card { background: var(--bg-1); border: 1px solid rgba(16,185,129,0.06); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-5); margin: var(--sp-5) 0; }
.ad-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); margin-bottom: var(--sp-1); }
