/* ================================================================
   PODLOG · styles.css
   Dark + Light theme · Mobile-first · Responsive desktop
================================================================ */

/* ── CSS VARIABLES (dark mode default) ── */
:root {
  --bg:           #080a14;
  --surface:      #0f1220;
  --surface2:     #171a2c;
  --surface3:     #1f2338;
  --border:       #272b3e;
  --border2:      #323654;
  --accent:       #22c55e;
  --accent2:      #16a34a;
  --accent-glow:  rgba(34,197,94,0.18);
  --accent-light: rgba(34,197,94,0.07);
  --text:         #f0f0f0;
  --text2:        #e0e0e0;
  --text3:        #9090a8;
  --green:        #22c55e;
  --green-bg:     rgba(34,197,94,0.08);
  --amber:        #f59e0b;
  --amber-bg:     rgba(245,158,11,0.08);
  --red:          #ef4444;
  --red-bg:       rgba(239,68,68,0.08);
  --blue:         #60a5fa;
  --blue-bg:      rgba(96,165,250,0.08);
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 4px 24px rgba(0,0,0,0.40);
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.25);
  --shadow-accent:0 4px 20px rgba(34,197,94,0.18);
  --player-h:     80px;
  --nav-h:        62px;
  --top-h:        60px;
}

/* ── LIGHT MODE overrides ── */
body.light {
  --bg:           #f2f5fb;
  --surface:      #ffffff;
  --surface2:     #edf0f8;
  --surface3:     #e2e7f2;
  --border:       #d4daea;
  --border2:      #c0cade;
  --accent:       #16a34a;
  --accent2:      #15803d;
  --accent-glow:  rgba(22,163,74,0.15);
  --accent-light: rgba(22,163,74,0.09);
  --text:         #111827;
  --text2:        #374151;
  --text3:        #6b7280;
  --green:        #16a34a;
  --green-bg:     rgba(22,163,74,0.07);
  --amber:        #d97706;
  --amber-bg:     rgba(217,119,6,0.07);
  --red:          #dc2626;
  --red-bg:       rgba(220,38,38,0.06);
  --blue:         #2563eb;
  --blue-bg:      rgba(37,99,235,0.07);
  --shadow:       0 4px 24px rgba(0,0,0,0.09);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.07);
  --shadow-accent:0 4px 20px rgba(22,163,74,0.15);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── UTILITY ── */
.hidden { display: none !important; }
a { color: inherit; }

/* ================================================================
   LOGIN PAGE
================================================================ */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  position: relative;
  overflow: hidden;
}
#login-page::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%,   rgba(34,197,94,0.10)  0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 0%   100%, rgba(96,165,250,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 100% 80%,  rgba(34,197,94,0.04)  0%, transparent 60%);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 900;
  color: var(--accent);
  text-align: center; margin-bottom: 6px;
}
.login-tagline {
  text-align: center;
  color: var(--text3); font-size: 13px; font-weight: 500;
  margin-bottom: 32px;
}
.login-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 12px; padding: 4px; margin-bottom: 24px; gap: 4px;
}
.login-tab {
  flex: 1; padding: 9px; border: none; border-radius: 9px;
  background: transparent; color: var(--text3);
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.login-tab.active { background: var(--accent); color: #fff; }
.auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px; padding: 10px 14px;
  font-size: 12px; color: var(--red); font-weight: 600; margin-bottom: 16px;
}
.login-field { margin-bottom: 16px; }
.login-label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 8px;
}
.login-input {
  width: 100%;
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: 12px; padding: 12px 16px; color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 600;
  outline: none; transition: border-color .2s;
}
.login-input:focus { border-color: var(--accent); }
.login-input::placeholder { color: var(--text3); font-weight: 400; }
.login-btn {
  width: 100%; padding: 13px;
  background: var(--accent); border: none; border-radius: 12px;
  color: #fff; font-family: 'Manrope', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  margin-top: 4px;
}
.login-btn:hover:not(:disabled) { background: var(--accent2); transform: translateY(-1px); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-forgot {
  text-align: center; margin-top: 10px;
}
.login-forgot button {
  background: none; border: none; color: var(--accent);
  font-size: 12px; cursor: pointer;
  font-family: 'Manrope', sans-serif; font-weight: 600;
}
.login-forgot button:hover { text-decoration: underline; }
.login-divider {
  display: flex; align-items: center; gap: 10px; margin: 18px 0;
}
.login-divider-line { flex: 1; height: 1px; background: var(--border); }
.login-divider-text { font-size: 11px; color: var(--text3); font-weight: 600; }
.login-google {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 12px;
  background: transparent; border: 1.5px solid var(--border2);
  border-radius: 12px; color: var(--text2);
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.login-google:hover { border-color: var(--accent); background: var(--accent-light); }
.login-note { font-size: 11px; color: var(--text3); text-align: center; margin-top: 14px; }

@media (max-width: 440px) {
  .login-box { padding: 28px 20px; border-radius: 20px; }
  .login-logo { font-size: 26px; }
}

/* ================================================================
   APP SHELL
================================================================ */

/* ── Top Bar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 20px; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 900; color: var(--accent);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px; color: var(--text2);
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.topbar-avatar {
  width: 34px; height: 34px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; flex-shrink: 0;
  transition: transform .15s;
}
.topbar-avatar:hover { transform: scale(1.08); }

/* ── Desktop Side Nav ── */
.desktop-nav {
  display: none; /* shown via @media */
  position: fixed; top: var(--top-h); left: 0; bottom: 0; width: 220px;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; flex-direction: column; gap: 4px; z-index: 50;
  overflow-y: auto;
}
.dnav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm); border: none;
  background: transparent; color: var(--text3);
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; width: 100%; text-align: left;
}
.dnav-btn:hover  { background: var(--surface2); color: var(--text); }
.dnav-btn.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.dnav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── Content Area ── */
.app-content {
  padding-top: var(--top-h);
  padding-bottom: calc(var(--nav-h) + var(--player-h) + 8px);
  min-height: 100vh;
}
.section-page {
  display: none; padding: 24px 16px;
  max-width: 760px; margin: 0 auto;
  animation: fadeUp .25s ease;
}
.section-page.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 900; color: var(--text); margin-bottom: 4px;
}
.section-sub {
  font-size: 13px; color: var(--text3); font-weight: 500; margin-bottom: 24px;
}

/* ── Bottom Nav (mobile) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; height: var(--nav-h);
}
.bnav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  background: transparent; border: none; cursor: pointer; color: var(--text3);
  transition: color .2s; position: relative; font-family: 'Manrope', sans-serif;
}
.bnav-btn.active { color: var(--accent); }
.bnav-btn.active::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px; background: var(--accent); border-radius: 0 0 4px 4px;
}
.bnav-icon  { font-size: 20px; line-height: 1; }
.bnav-label { font-size: 9px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }

/* ================================================================
   SHARED COMPONENTS
================================================================ */
.toolbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-count { font-size: 13px; color: var(--text3); font-weight: 600; }

.btn-primary {
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; color: #fff;
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .2s, transform .1s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 9px 14px; color: var(--text2);
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border2); background: transparent;
  color: var(--text3); font-family: 'Manrope', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all .2s;
}
.filter-btn.active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-light);
}

/* ── Inline form ── */
.inline-form {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  animation: fadeUp .2s ease;
}
.form-heading {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}
.form-label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}
.form-input {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  outline: none; transition: border-color .2s; margin-bottom: 10px;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); font-weight: 400; }
.form-textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 500;
  outline: none; resize: vertical; min-height: 130px; line-height: 1.7;
  margin-bottom: 12px; transition: border-color .2s;
}
.form-textarea:focus { border-color: var(--accent); }
.form-textarea::placeholder { color: var(--text3); }
.form-select {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 11px 36px 11px 14px; color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239090a8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  transition: border-color .2s;
}
.form-select:focus { border-color: var(--accent); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text3); }
.empty-icon  { font-size: 52px; margin-bottom: 14px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; font-weight: 500; line-height: 1.6; }

/* ================================================================
   DISCOVER
================================================================ */
.search-wrap { position: relative; margin-bottom: 20px; }
.search-icon-pos {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 16px; pointer-events: none;
}
.search-input-big {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: 14px; padding: 14px 120px 14px 46px; color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 600;
  outline: none; transition: border-color .2s;
}
.search-input-big:focus { border-color: var(--accent); }
.search-input-big::placeholder { color: var(--text3); font-weight: 400; }
.search-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--accent); border: none; border-radius: 10px;
  padding: 9px 20px; color: #fff;
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.search-btn:hover { background: var(--accent2); }
.discover-status {
  text-align: center; padding: 20px; color: var(--text3); font-size: 14px; font-weight: 600;
}
.curated-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.podcast-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.podcast-card:hover { border-color: var(--accent); background: var(--accent-light); }
.podcast-art {
  width: 64px; height: 64px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; background: var(--surface3);
}
.podcast-info { flex: 1; min-width: 0; }
.podcast-name {
  font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.podcast-author { font-size: 12px; color: var(--text3); font-weight: 600; margin-bottom: 6px; }
.podcast-genre {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  background: var(--green-bg); color: var(--green); padding: 3px 10px; border-radius: 20px;
}
.podcast-arrow { color: var(--text3); font-size: 18px; flex-shrink: 0; }

/* ── Episode Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 200; backdrop-filter: blur(2px);
}
.episode-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 201; width: min(96vw, 640px); max-height: 85vh;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  animation: fadeUp .25s ease;
}
.episode-modal-header {
  display: flex; gap: 14px; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.episode-modal-art {
  width: 56px; height: 56px; border-radius: 10px;
  object-fit: cover; background: var(--surface3); flex-shrink: 0;
}
.episode-modal-info { flex: 1; min-width: 0; }
.episode-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.episode-modal-author { font-size: 12px; color: var(--text3); font-weight: 600; }
.episode-modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text3); flex-shrink: 0;
  font-size: 14px; transition: all .2s;
}
.episode-modal-close:hover { background: var(--surface3); color: var(--text); }
.episode-modal-status { padding: 20px; text-align: center; color: var(--text3); font-size: 14px; }
.episode-list { overflow-y: auto; flex: 1; padding: 12px; }
.episode-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: var(--radius-sm); margin-bottom: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  transition: border-color .2s, background .2s;
}
.episode-item:hover { border-color: var(--accent); background: var(--accent-light); }
.episode-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: transform .15s, background .2s;
}
.episode-play-btn:hover { transform: scale(1.12); background: var(--accent2); }
.episode-info { flex: 1; min-width: 0; }
.episode-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; line-height: 1.4;
}
.episode-meta { font-size: 11px; color: var(--text3); font-weight: 600; }
.episode-note-btn {
  background: transparent; border: 1px solid var(--border2);
  border-radius: 8px; padding: 5px 10px; color: var(--text3);
  font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.episode-note-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ================================================================
   AUDIO PLAYER
================================================================ */
.audio-player {
  position: fixed; bottom: var(--nav-h); left: 0; right: 0; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--border2);
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  height: var(--player-h);
}
.player-art {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; background: var(--surface3); flex-shrink: 0;
}
.player-info { flex: 1; min-width: 0; }
.player-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.player-show { font-size: 11px; color: var(--text3); font-weight: 600; margin-bottom: 5px; }
.player-progress-wrap { display: flex; align-items: center; gap: 8px; }
.player-time { font-size: 10px; color: var(--text3); font-weight: 600; flex-shrink: 0; width: 32px; }
.player-progress {
  flex: 1; height: 4px; border-radius: 2px;
  -webkit-appearance: none; appearance: none;
  background: var(--border2); cursor: pointer; outline: none;
}
.player-progress::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
}
.player-progress::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}
.player-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.player-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: 12px; transition: all .2s;
}
.player-btn:hover { border-color: var(--accent); color: var(--accent); }
.player-play {
  width: 38px; height: 38px; background: var(--accent);
  border-color: var(--accent); color: #fff; border-radius: 50%; font-size: 14px;
}
.player-play:hover { background: var(--accent2); border-color: var(--accent2); color: #fff; }

/* ================================================================
   NOTES
================================================================ */

/* 3-column podcast metadata grid */
.note-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; margin-bottom: 10px;
}
.note-meta-field { display: flex; flex-direction: column; }
.note-meta-field .form-input { margin-bottom: 0; }

@media (max-width: 580px) {
  .note-meta-grid { grid-template-columns: 1fr; }
}

/* Note card */
.note-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px;
  transition: border-color .2s;
}
.note-card:hover { border-color: var(--border2); }
.note-card-meta {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.note-tag {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; font-weight: 700;
}
.note-tag-podcast   { background: var(--green-bg); color: var(--green); }
.note-tag-podcaster { background: var(--amber-bg); color: var(--amber); }
.note-tag-episode   { background: var(--blue-bg);  color: var(--blue);  }
.note-body {
  font-size: 14px; color: var(--text2); line-height: 1.7;
  white-space: pre-wrap; margin-bottom: 10px;
}
.note-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text3); font-weight: 600;
}
.note-delete {
  background: transparent; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; padding: 4px 6px;
  border-radius: 6px; transition: color .2s, background .2s;
}
.note-delete:hover { color: var(--red); background: var(--red-bg); }

/* ================================================================
   ACTIONS
================================================================ */
.stats-row { display: flex; gap: 12px; margin-bottom: 20px; }
.stat-card {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; text-align: center;
}
.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 4px;
}
.stat-label { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: 0.5px; }

.action-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
  transition: border-color .2s, opacity .2s;
}
.action-card.done { opacity: .55; }
.action-card.done .action-text { text-decoration: line-through; color: var(--text3); }
.action-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border2);
  flex-shrink: 0; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px; background: transparent; color: transparent; font-size: 11px;
  font-family: 'Manrope', sans-serif;
}
.action-check.checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.action-body { flex: 1; min-width: 0; }
.action-text {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; margin-bottom: 6px;
}
.action-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.priority-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.priority-high { background: var(--red-bg);   color: var(--red);   }
.priority-med  { background: var(--amber-bg); color: var(--amber); }
.priority-low  { background: var(--green-bg); color: var(--green); }
.action-due { font-size: 11px; color: var(--text3); font-weight: 600; }
.action-del {
  background: transparent; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; padding: 4px; border-radius: 6px;
  transition: color .2s; flex-shrink: 0;
}
.action-del:hover { color: var(--red); }

/* ================================================================
   COMMUNITY
================================================================ */
.streak-card {
  background: linear-gradient(135deg, #0f2a0f 0%, #1a3d1a 50%, #0a2a0a 100%);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.streak-card::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(34,197,94,0.15), transparent);
  pointer-events: none;
}
.streak-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.streak-left { display: flex; align-items: center; gap: 12px; }
.streak-flame { font-size: 32px; }
.streak-count {
  font-family: 'Playfair Display', serif;
  font-size: 36px; font-weight: 900; color: #fff; line-height: 1;
}
.streak-label { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.5); }
.streak-right { text-align: right; }
.streak-week-label {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4); margin-bottom: 6px;
}
.streak-days { display: flex; gap: 6px; }
.streak-day {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: rgba(255,255,255,0.3); letter-spacing: 0.3px;
}
.streak-day.done {
  background: rgba(34,197,94,0.25); border-color: rgba(34,197,94,0.5); color: #22c55e;
}
.streak-note { font-size: 11px; color: rgba(255,255,255,0.4); font-weight: 500; }

.challenge-card {
  background: linear-gradient(135deg, rgba(245,200,66,0.06), rgba(245,158,11,0.04));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.challenge-badge {
  display: inline-block; background: var(--amber-bg); color: var(--amber);
  font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px; margin-bottom: 10px;
}
.challenge-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 900; color: var(--text); margin-bottom: 8px;
}
.challenge-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

.community-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px;
  text-align: center; margin-bottom: 16px;
}
.community-hero-icon  { font-size: 40px; margin-bottom: 12px; }
.community-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 900; color: var(--text); margin-bottom: 8px;
}
.community-hero-sub {
  font-size: 13px; color: var(--text3); line-height: 1.6; margin-bottom: 20px;
  max-width: 360px; margin-left: auto; margin-right: auto;
}
.community-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn-community {
  padding: 10px 20px; border-radius: 40px;
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-community.btn-sm { font-size: 11px; padding: 7px 14px; }
.btn-community-primary { background: var(--accent); color: #fff; border: none; }
.btn-community-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-community-ghost   { background: transparent; color: var(--text2); border: 1.5px solid var(--border2); }
.btn-community-ghost:hover { border-color: var(--accent); color: var(--accent); }

.community-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.comm-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px;
  display: flex; flex-direction: column;
}
.comm-card-icon  { font-size: 24px; margin-bottom: 10px; }
.comm-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.comm-card-desc  { font-size: 12px; color: var(--text3); line-height: 1.5; margin-bottom: 14px; flex: 1; }

@media (max-width: 480px) { .community-cards { grid-template-columns: 1fr; } }

/* ================================================================
   USER MENU
================================================================ */
.menu-backdrop { position: fixed; inset: 0; z-index: 199; }
.user-menu {
  position: fixed; top: 68px; right: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px;
  z-index: 200; min-width: 200px; box-shadow: var(--shadow);
  animation: fadeUp .15s ease;
}
.user-menu-name  { padding: 10px 12px 2px; font-size: 13px; font-weight: 700; color: var(--text); }
.user-menu-email { padding: 0 12px 10px; font-size: 11px; color: var(--text3); font-weight: 500; }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text2);
  transition: background .15s, color .15s; border: none; background: transparent;
  width: 100%; text-align: left; font-family: 'Manrope', sans-serif;
}
.user-menu-item:hover        { background: var(--surface2); color: var(--text); }
.user-menu-item.danger:hover { background: var(--red-bg); color: var(--red); }

/* ================================================================
   TOAST
================================================================ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--player-h) + 8px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); padding: 10px 20px; border-radius: 40px;
  font-size: 13px; font-weight: 700; z-index: 9999;
  opacity: 0; transition: all .3s; white-space: nowrap;
  box-shadow: var(--shadow); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================================================================
   DESKTOP RESPONSIVE
================================================================ */
@media (min-width: 768px) {
  .desktop-nav  { display: flex; }
  .bottom-nav   { display: none; }
  .app-content  {
    padding-left: 220px;
    padding-bottom: calc(var(--player-h) + 16px);
  }
  .topbar       { padding: 0 32px; }
  .audio-player { bottom: 0; left: 220px; }
  .section-page { padding: 32px 28px; }
  .toast        { bottom: calc(var(--player-h) + 16px); }
}

@media (max-width: 767px) {
  .form-row-2  { grid-template-columns: 1fr; }
  .stats-row   { gap: 8px; }
  .stat-val    { font-size: 26px; }
}

/* ================================================================
   PRINT (PDF export via browser)
================================================================ */
@media print {
  .topbar, .desktop-nav, .bottom-nav, .audio-player,
  .toolbar-row, .inline-form, .note-delete, .toast,
  .user-menu, .menu-backdrop, .modal-backdrop,
  .episode-modal { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .app-content { padding: 0 !important; }
  .section-page { display: block !important; padding: 20px !important; }
  .note-card { border: 1px solid #ccc !important; page-break-inside: avoid; margin-bottom: 12px; }
  .section-title { color: #16a34a !important; }
  .note-tag-podcast   { background: #dcfce7 !important; color: #15803d !important; }
  .note-tag-podcaster { background: #fef3c7 !important; color: #d97706 !important; }
  .note-tag-episode   { background: #dbeafe !important; color: #2563eb !important; }
}
