/* ═══════════════════════════════════════════════════════════
   style.css — Study Stars global stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:      rgba(8, 4, 24, 0.88);
  --card:    rgba(18, 10, 46, 0.82);
  --accent:  #FF6B35;
  --accent2: #FFB300;
  --blue:    #5BA3E8;
  --green:   #5DD68A;
  --purple:  #A97FFF;
  --red:     #FF6B6B;
  --text:    #EDE8FF;
  --text2:   rgba(190,175,235,0.82);
  --border:  rgba(130,100,220,0.28);
  --shadow:  0 2px 20px rgba(0,0,0,0.45);
  --radius:  20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: #06021A url('../images_vid/') center/cover fixed;
  color: var(--text);
  min-height: 100vh;
}

/* ── AUTH GATE ─────────────────────────────────────────── */
.auth-gate {
  position: fixed; inset: 0;
  background: linear-gradient(145deg, #FF6B35 0%, #FFB300 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
}
.auth-box {
  background: #FEFBF7; border-radius: 28px;
  padding: 36px 28px; width: 92%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
  color: #1A1A1A;
}
.auth-logo { font-size: 48px; margin-bottom: 8px; }
.auth-title { font-size: 22px; font-weight: 900; color: var(--accent); margin-bottom: 20px; }
.auth-tabs {
  display: flex; background: #F5F0E8; border-radius: 30px;
  padding: 4px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px; border-radius: 20px; border: none;
  background: transparent; font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700; color: #888888; cursor: pointer;
  transition: all .2s;
}
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-input {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid #EDE8E0; background: #F5F0E8;
  font-family: 'Nunito', sans-serif; font-size: 14px; color: #1A1A1A;
  margin-bottom: 10px; display: block;
}
.auth-input:focus { outline: none; border-color: var(--accent); }
.auth-btn {
  width: 100%; padding: 13px; border-radius: 14px;
  background: var(--accent); border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800;
  cursor: pointer; margin-bottom: 10px; transition: opacity .15s;
}
.auth-btn:hover { opacity: .88; }
.auth-google {
  width: 100%; padding: 12px; border-radius: 14px;
  border: 1.5px solid var(--border); background: #fff; color: var(--text);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-local-btn {
  width: 100%; padding: 10px; border-radius: 14px; margin-top: 8px;
  border: 1.5px dashed var(--border); background: transparent; color: var(--text2);
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.auth-local-btn:hover { border-color: var(--accent); color: var(--accent); }
.auth-err { font-size: 12px; color: var(--red); min-height: 18px; margin-top: 4px; }
.auth-divider {
  font-size: 12px; color: var(--text2); margin: 10px 0;
  display: flex; align-items: center; gap: 8px;
}
.auth-divider::before,.auth-divider::after {
  content:''; flex:1; height:1px; background:var(--border);
}

/* ── TOPBAR — pixel-art style, colours driven by CSS vars from ThemeManager ── */
:root {
  --topbar-bg:     rgba(10, 18, 58, 0.90);
  --topbar-border: rgba(60, 120, 240, 0.40);
  --topbar-accent: #5B9BFF;
  --topbar-glow:   rgba(60, 120, 240, 0.50);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 56px; position: sticky; top: 0; z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--topbar-border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.35), 0 0 0 1px rgba(120,88,248,0.08);
  transition: background .3s, border-color .3s;
}

/* ── Pixel project name (left) ── */
.pixel-logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; flex-shrink: 0; cursor: default;
}
.pixel-logo-icon {
  font-size: 20px; line-height: 1;
  filter: drop-shadow(0 0 8px var(--topbar-glow));
  image-rendering: pixelated;
}
.pixel-logo-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; line-height: 1.4;
  color: var(--topbar-accent);
  text-shadow: 0 0 10px var(--topbar-glow), 0 0 20px var(--topbar-glow);
  white-space: nowrap; letter-spacing: 0.5px;
  transition: color .3s, text-shadow .3s;
}

/* ── Language switcher ── */
.lang-sw {
  display: flex; gap: 2px;
  background: rgba(16, 8, 46, 0.75);
  border: 1.5px solid var(--topbar-border);
  border-radius: 30px; padding: 3px;
}
.lb {
  padding: 4px 9px; border-radius: 20px; border: none;
  background: transparent; color: rgba(200,180,255,0.7);
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 800; cursor: pointer;
  transition: all .2s;
}
.lb.active { background: var(--topbar-accent); color: #fff; box-shadow: 0 0 8px var(--topbar-glow); }
.lb:hover:not(.active) { color: #fff; background: rgba(120,88,248,0.25); }

/* ── Topbar right group ── */
.topbar-right { display: flex; align-items: center; gap: 6px; }

/* ── Topbar icon buttons (theme, home) ── */
.tb-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(16, 8, 50, 0.70);
  border: 1.5px solid var(--topbar-border);
  border-radius: 8px; /* pixel-boxy corners */
  color: var(--topbar-accent); cursor: pointer; text-decoration: none;
  transition: all .15s;
  box-shadow: 0 0 6px rgba(120,88,248,0.2), inset 0 0 4px rgba(120,88,248,0.06);
  image-rendering: pixelated;
}
.tb-icon-btn:hover {
  border-color: var(--topbar-accent);
  box-shadow: 0 0 12px var(--topbar-glow), inset 0 0 8px rgba(120,88,248,0.15);
  transform: translateY(-1px);
}
.tb-icon-btn svg { display: block; }

/* ── Compact streak pill ── */
.streak-pill-sm {
  display: flex; align-items: center; gap: 3px;
  background: rgba(255,107,53,0.18); border: 1.5px solid rgba(255,107,53,0.4);
  color: #FFA07A; border-radius: 20px; padding: 4px 9px;
  font-size: 11px; font-weight: 800; font-family: 'Nunito', sans-serif;
}

/* ── Legacy .streak-pill kept for compatibility ── */
.streak-pill {
  display: flex; align-items: center; gap: 4px;
  background: var(--accent2); color: #fff;
  border-radius: 20px; padding: 4px 11px;
  font-size: 13px; font-weight: 800;
}

/* ── User menu dropdown ──────────────────────────────── */
.user-wrap { position: relative; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--card); border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14); border: 1px solid var(--border);
  min-width: 200px; z-index: 300; overflow: hidden;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.user-menu.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.um-info { padding: 14px 16px 10px; }
.um-info-clickable { cursor: pointer; border-radius: 10px; transition: background .15s; }
.um-info-clickable:hover { background: rgba(var(--accent-rgb,99,102,241),.07); }
.um-info-hint { font-size: 10px; color: var(--accent); margin-top: 4px; opacity: 0; transition: opacity .15s; }
.um-info-clickable:hover .um-info-hint { opacity: 1; }
.um-name { font-weight: 800; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-sub  { font-size: 12px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-divider { height: 1px; background: var(--border); }
.um-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 10px 16px; border: none;
  background: transparent; font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--text);
  cursor: pointer; text-align: left; transition: background .1s;
}
.um-item:hover { background: rgba(130,100,220,0.15); }
.um-item + .um-item { border-top: 1px solid var(--border); }
.um-danger { color: var(--red); }

/* ── User avatar button ── */
.user-btn {
  width: 36px; height: 36px; border-radius: 8px; /* pixel-boxy */
  border: 1.5px solid var(--topbar-border);
  background: rgba(16, 8, 50, 0.85);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px rgba(120,88,248,0.3);
  transition: box-shadow .15s, border-color .15s;
  overflow: hidden;
}
.user-btn:hover {
  border-color: var(--topbar-accent);
  box-shadow: 0 0 14px var(--topbar-glow);
}
.user-btn-lg { width: 38px; height: 38px; font-size: 18px; }
/* When avatar is an img (AI-generated), fill button and hide default SVG */
.user-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.user-btn img ~ .px-avatar-default,
.user-btn:has(img) .px-avatar-default { display: none; }

/* Pixel-art home button — cosmic neon */
.home-pixel-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: rgba(16, 8, 50, 0.85);
  border: 2px solid rgba(120,88,248,0.75);
  border-radius: 6px; /* intentionally boxy / pixel feel */
  font-size: 17px; text-decoration: none; color: #A78BFA;
  cursor: pointer;
  transition: border-color .15s, color .15s, box-shadow .15s;
  box-shadow: 0 0 8px rgba(120,88,248,0.4), inset 0 0 6px rgba(120,88,248,0.1);
  image-rendering: pixelated;
}
.home-pixel-btn:hover {
  border-color: #C4B5FD;
  color: #DDD6FE;
  box-shadow: 0 0 14px rgba(167,139,250,0.65);
}

/* ── Pixel art icon base ──────────────────────────────── */
.px-icon { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.px-avatar-default { opacity: .9; }

/* ── Language dropdown ────────────────────────────────── */
.lang-dd { position: relative; flex-shrink: 0; }
.lang-dd-trigger {
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px;
}
.lang-flag-cur { font-size: 15px; line-height: 1; margin-left: 2px; }
.lang-dd-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(12, 6, 40, 0.97);
  border: 1.5px solid var(--topbar-border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  min-width: 140px; z-index: 200;
  backdrop-filter: blur(16px);
  animation: fadeDown .15s ease;
}
.lang-dd-menu.open { display: block; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:translateY(0) } }
.lang-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 16px;
  border: none; background: transparent;
  color: rgba(200,180,255,0.85); font-family:'Nunito',sans-serif;
  font-size: 13px; font-weight: 700; cursor: pointer; text-align: left;
  transition: background .12s;
}
.lang-opt:hover, .lang-opt.active { background: rgba(120,88,248,0.25); color: #fff; }
.lang-opt-flag { font-size: 18px; line-height: 1; }
/* Dividers between options */
.lang-opt + .lang-opt { border-top: 1px solid rgba(120,88,248,0.15); }

/* ── History card in Rewards ──────────────────────────── */
.history-card { padding: 12px 16px; }
.history-week { margin-bottom: 12px; }
.history-week:last-child { margin-bottom: 0; }
.history-week-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.hwl-range { font-size: 11px; color: var(--text2); font-weight: 700; }
.hwl-count {
  font-size: 11px; font-weight: 900; color: var(--text2);
  background: var(--border); border-radius: 20px; padding: 1px 8px;
}
.hwl-count.hwl-ok   { background: rgba(255,107,53,.2); color: #FF6B35; }
.hwl-count.hwl-great{ background: rgba(82,201,122,.2); color: #52C97A; }
.history-dots {
  display: flex; gap: 4px;
}
.hd {
  flex: 1; height: 28px; border-radius: 6px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: var(--text2);
  transition: background .2s;
}
.hd-future { opacity: .3; }
.hd-today  { background: rgba(120,88,248,0.25); color: var(--topbar-accent); border: 1px solid var(--topbar-accent); }
.hd-some   { background: rgba(255,107,53,.35); color: #FF8C5A; }
.hd-all    { background: rgba(82,201,122,.45); color: #3DAD6A; }

/* ── APP SIDEBAR ───────────────────────────────────────── */
.app-sidebar {
  position: fixed; left: 0; top: 56px; bottom: 0; width: 62px;
  background: rgba(6, 2, 28, 0.85);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(130,100,220,0.25);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; gap: 4px; z-index: 50;
  overflow-y: auto; scrollbar-width: none;
}
.app-sidebar::-webkit-scrollbar { display: none; }
.sidebar-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; cursor: pointer; border: none;
  background: transparent; transition: background .15s, transform .1s;
}
.sidebar-icon:hover { background: rgba(130,100,220,0.2); transform: scale(1.08); }
.sidebar-icon.active {
  background: var(--accent);
  box-shadow: 0 2px 12px rgba(255,107,53,.5);
}

/* Push main content right to avoid sidebar overlap */
#mainApp { margin-left: 62px; }

/* ── TABS ──────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 6px; padding: 14px 18px 0;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px; border-radius: 30px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text2); font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .18s; white-space: nowrap;
}

/* Colorful pill tabs — each page gets its own color (matching btn_style palette) */
.tabs .tab:nth-child(1).active  { background: #4A90D9; border-color: #4A90D9; color: #fff; }  /* 课程 – blue   */
.tabs .tab:nth-child(2).active  { background: #00BCD4; border-color: #00BCD4; color: #fff; }  /* 提醒 – cyan   */
.tabs .tab:nth-child(3).active  { background: #52C97A; border-color: #52C97A; color: #fff; }  /* 计时 – green  */
.tabs .tab:nth-child(4).active  { background: #FF6B35; border-color: #FF6B35; color: #fff; }  /* 简报 – orange */
.tabs .tab:nth-child(5).active  { background: #9B6DFF; border-color: #9B6DFF; color: #fff; }  /* 日历 – purple */
.tabs .tab:nth-child(6).active  { background: #FFB300; border-color: #FFB300; color: #1a1a1a; } /* 统计 – gold */
.tabs .tab:nth-child(7).active  { background: #00C4B4; border-color: #00C4B4; color: #fff; }  /* 奖励 – teal   */
.tabs .tab:nth-child(8).active,
.tabs .tab.notion-tab.active    { background: #52C97A; border-color: #52C97A; color: #fff; }  /* 打卡 – green  */

/* Subtle colored tint on inactive tabs so the palette is always visible */
.tabs .tab:nth-child(1):not(.active)  { border-color: #4A90D9; color: #4A90D9; }
.tabs .tab:nth-child(2):not(.active)  { border-color: #00BCD4; color: #00BCD4; }
.tabs .tab:nth-child(3):not(.active)  { border-color: #52C97A; color: #52C97A; }
.tabs .tab:nth-child(4):not(.active)  { border-color: #FF6B35; color: #FF6B35; }
.tabs .tab:nth-child(5):not(.active)  { border-color: #9B6DFF; color: #9B6DFF; }
.tabs .tab:nth-child(6):not(.active)  { border-color: #FFB300; color: #FFB300; }
.tabs .tab:nth-child(7):not(.active)  { border-color: #00C4B4; color: #00C4B4; }
.tabs .tab:nth-child(8):not(.active),
.tabs .tab.notion-tab:not(.active)    { border-color: #52C97A; color: #52C97A; }

/* ── PAGES ─────────────────────────────────────────────── */
.page { display: none; padding: 14px 18px 120px; animation: fadeUp .22s ease; }
.page.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── COMMON ────────────────────────────────────────────── */
.sec-label {
  font-size: 11px; font-weight: 800; color: var(--text2);
  letter-spacing: .08em; text-transform: uppercase; margin: 18px 0 8px;
}
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 16px 18px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.info-card {
  background: rgba(255,179,0,0.12); border: 1.5px solid rgba(255,213,79,0.4);
  border-radius: 14px; padding: 12px 14px;
  font-size: 13px; color: #FFB300; font-weight: 700;
  margin-bottom: 12px;
}

/* ── SAVE BAR ──────────────────────────────────────────── */
.save-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 18px 24px;
  background: rgba(6, 2, 28, 0.90);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(130,100,220,0.25);
}
.save-main {
  width: 100%; padding: 14px; border-radius: 16px;
  background: var(--accent); border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 900;
  cursor: pointer; box-shadow: 0 4px 16px rgba(255,107,53,.3);
  transition: opacity .15s;
}
.save-main:active { opacity: .88; }

/* ── SUBJECT ITEMS ─────────────────────────────────────── */
.subject-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1.5px solid var(--border);
  margin-bottom: 8px; box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.s-left { display: flex; align-items: center; gap: 10px; }
.s-icon {
  width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.s-name  { font-size: 14px; font-weight: 800; }
.s-detail { font-size: 11px; color: var(--text2); margin-top: 2px; }
.s-right { display: flex; align-items: center; gap: 8px; }
.tog {
  width: 44px; height: 25px; border-radius: 13px; border: none;
  cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0;
}
.tok {
  position: absolute; top: 2.5px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.del-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: rgba(255,82,82,0.15); color: var(--red); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.edit-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: var(--bg); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.edit-btn:hover { background: var(--border); }
.add-btn {
  width: 100%; padding: 13px; border-radius: 16px;
  border: 2px dashed var(--border); background: transparent;
  color: var(--text2); font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
}
.add-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,107,53,0.12); }

/* ── NOTIFY ────────────────────────────────────────────── */
.n-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.n-btn {
  padding: 14px 6px; border-radius: 16px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text2); font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 5px; transition: all .18s;
}
.n-btn .ni { font-size: 24px; }
.n-btn.on { background: rgba(255,107,53,0.15); border-color: var(--accent); color: var(--accent); }
.cfg-panel { margin-bottom: 12px; }
.cfg-label {
  font-size: 12px; font-weight: 700; color: var(--accent);
  display: block; margin-bottom: 6px;
}
.cfg-input {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 13px; color: var(--text);
  margin-bottom: 8px; display: block;
}
.cfg-input:focus { outline: none; border-color: var(--accent); }
.cfg-select {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 13px; color: var(--text);
  margin-bottom: 8px;
}
.cfg-action-btn {
  width: 100%; padding: 11px; border-radius: 12px;
  background: var(--blue); border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; margin-bottom: 6px; transition: opacity .15s;
}
.cfg-action-btn:hover { opacity: .88; }
.cfg-note { font-size: 11px; color: var(--text2); }
.line-info {
  background: rgba(74,144,217,0.12); border: 1.5px solid rgba(74,144,217,0.35);
  border-radius: 14px; padding: 14px;
}
.li-title { font-size: 13px; font-weight: 800; color: #5BA3E8; margin-bottom: 8px; }
.li-step {
  font-size: 12px; color: rgba(140,190,240,0.9); margin-bottom: 5px;
  display: flex; align-items: flex-start; gap: 6px;
}
.li-step span {
  background: rgba(74,144,217,0.7); color: #fff; font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 10px; flex-shrink: 0; margin-top: 1px;
}
.li-step b { font-weight: 800; }
.li-step code {
  background: #E3F2FD; padding: 1px 5px; border-radius: 4px; font-size: 11px;
}
.ltest-btn {
  margin-top: 8px; padding: 9px 16px; border-radius: 10px;
  background: #1565C0; border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer;
}
.time-card {
  background: var(--card); border-radius: 16px;
  border: 1.5px solid var(--border); padding: 14px; margin-bottom: 8px;
}
.trow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.trow:last-child { margin-bottom: 0; }
.trow label { font-size: 13px; font-weight: 700; color: var(--text2); min-width: 80px; }
.tinput {
  flex: 1; padding: 9px 12px; border-radius: 11px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700; color: var(--text);
}
.tinput:focus { outline: none; border-color: var(--accent); }

/* ── TIMER ─────────────────────────────────────────────── */
.timer-wrap { text-align: center; }
.timer-subject-sel {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px;
}
.timer-subj-btn {
  padding: 12px 16px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--card);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; transition: all .15s;
}
.timer-subj-btn.active { border-color: var(--accent); background: rgba(255,107,53,0.18); color: var(--accent); }
.timer-display {
  font-size: 72px; font-weight: 900; color: var(--accent);
  letter-spacing: -2px; margin: 24px 0; line-height: 1;
}
.timer-display.running { color: var(--green); }
.timer-display.done    { color: var(--accent2); }
.timer-controls { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.timer-btn {
  padding: 14px 28px; border-radius: 50px;
  border: none; font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 800; cursor: pointer; transition: all .15s;
}
.timer-btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 16px rgba(255,107,53,.3); }
.timer-btn.secondary { background: var(--card); color: var(--text2); border: 1.5px solid var(--border); }
.timer-progress {
  width: 100%; height: 10px; border-radius: 10px;
  background: var(--border); overflow: hidden; margin-bottom: 16px;
}
.timer-progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .5s linear;
}
.timer-done-msg {
  font-size: 22px; font-weight: 900; color: var(--green); margin-top: 12px;
}

/* ── REPORT ────────────────────────────────────────────── */
.rep-card {
  background: var(--card); border-radius: 18px;
  border: 1.5px solid var(--border); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.rc-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.rc-subj { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.rc-pts {
  font-size: 12px; font-weight: 800; color: var(--accent2);
  background: rgba(255,179,0,0.15); padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(255,179,0,0.5);
}
.rta {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 13px; color: var(--text);
  resize: vertical; min-height: 64px; margin-bottom: 10px;
}
.rta:focus { outline: none; border-color: var(--accent); }
.diff-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.diff-lbl { font-size: 12px; font-weight: 700; color: var(--text2); }
.sb {
  font-size: 20px; cursor: pointer; filter: grayscale(1); opacity: .4;
  transition: all .12s; border: none; background: none;
}
.sb.lit { filter: none; opacity: 1; }
.done-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--text2); cursor: pointer;
}
.done-check input { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.done-check.checked { color: var(--green); }
.report-email-row { margin-bottom: 12px; }
.submit-all-btn {
  width: 100%; padding: 15px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900;
  cursor: pointer; box-shadow: 0 4px 20px rgba(255,107,53,.3);
  margin-bottom: 14px; transition: opacity .15s;
}
.submit-all-btn:hover { opacity: .9; }
.daily-quote-card {
  background: linear-gradient(135deg, #FFB30011, #FF6B3511);
  border: 1.5px solid #FFB30044;
  border-radius: 16px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 13px; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.5;
  min-height: 20px;
}
.ai-card {
  background: linear-gradient(135deg, #667eea22, #764ba222);
  border: 1.5px solid #9B6DFF44;
  border-radius: var(--radius); padding: 18px; margin-top: 14px;
}
.ai-label { font-size: 11px; font-weight: 800; color: var(--purple); margin-bottom: 8px; letter-spacing: .06em; }
.ai-text { font-size: 14px; color: var(--text); line-height: 1.7; }
.ai-loading { display: flex; gap: 4px; justify-content: center; padding: 8px 0; }
.ai-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--purple);
  animation: bounce 1.2s infinite;
}
.ai-dot:nth-child(2) { animation-delay: .2s; }
.ai-dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,80%,100% { transform: scale(.8); opacity:.5; } 40% { transform: scale(1); opacity:1; } }

/* ── CALENDAR ──────────────────────────────────────────── */
.cal-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.cal-month { font-size: 17px; font-weight: 900; }
.cal-nav {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--card);
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.cgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cdl { font-size: 11px; font-weight: 700; color: var(--text2); text-align: center; padding: 4px 0; }
.cd {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; transition: all .12s; position: relative;
}
.cd.empty { cursor: default; }
.cd.has-data { background: rgba(255,107,53,0.22); color: var(--accent); border-color: rgba(255,107,53,0.45); }
.cd.perfect  { background: rgba(82,201,122,0.22); color: var(--green); border-color: rgba(82,201,122,0.45); }
.cd.today    { background: var(--accent); color: #fff; }
.cd.selected { box-shadow: 0 0 0 2.5px var(--blue); }
.cdot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
}

/* Day panel / todo list */
.day-panel {
  background: var(--card); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 16px;
  margin-top: 12px; box-shadow: var(--shadow);
}
.day-panel-title { font-size: 14px; font-weight: 900; margin-bottom: 12px; color: var(--text); }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); margin-bottom: 8px;
  background: var(--bg);
}
.todo-item.done-item { background: rgba(82,201,122,0.18); border-color: rgba(82,201,122,0.4); }
.todo-icon { font-size: 20px; flex-shrink: 0; }
.todo-info { flex: 1; }
.todo-name { font-size: 14px; font-weight: 700; }
.todo-meta { font-size: 11px; color: var(--text2); margin-top: 1px; }
.todo-check {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 2px solid var(--border); background: rgba(255,255,255,0.08);
  cursor: pointer; transition: all .15s;
}
.todo-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.todo-summary { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ── STATS ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border-radius: 16px;
  border: 1.5px solid var(--border); padding: 14px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 30px; font-weight: 900; color: var(--accent); }
.stat-lbl { font-size: 12px; color: var(--text2); margin-top: 2px; font-weight: 700; }
.chart-wrap {
  background: var(--card); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.chart-title { font-size: 13px; font-weight: 800; color: var(--text2); margin-bottom: 12px; }

/* ── REWARDS ───────────────────────────────────────────── */
.pts-hero {
  border-radius: var(--radius); padding: 24px 20px;
  text-align: center; color: #fff; margin-bottom: 14px;
  background: linear-gradient(135deg, #FF6B35, #FFB300);
  position: relative; overflow: hidden;
}
.pts-hero::after { content:'⭐'; position:absolute; font-size:90px; opacity:.1; right:-8px; top:-8px; }
.pts-adj-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pts-adj-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.15);
  color: #fff; font-size: 18px; font-weight: 900; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pts-adj-btn:hover { background: rgba(255,255,255,.3); }
.pts-big  { font-size: 54px; font-weight: 900; line-height: 1; }
.pts-sub  { font-size: 14px; font-weight: 700; opacity: .8; margin-top: 4px; }
.prog-w   { background: rgba(255,255,255,.3); border-radius: 10px; height: 10px; margin-top: 14px; }
.prog-f   { background: #fff; border-radius: 10px; height: 100%; transition: width .7s ease; }
.prog-h   { font-size: 12px; opacity: .8; margin-top: 6px; }
.week-row { display: flex; justify-content: center; gap: 6px; }
.wd {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  border: 1.5px solid var(--border); background: var(--card); color: var(--text2);
}
.wd.done  { background: var(--green); border-color: var(--green); color: #fff; }
.wd.today { border-color: var(--accent); color: var(--accent); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.badge-item {
  text-align: center; padding: 14px 8px; border-radius: 16px;
  border: 1.5px solid var(--border); background: var(--card);
}
.badge-item.earned { border-color: var(--accent2); background: rgba(255,179,0,0.15); }
.badge-item:not(.earned) { opacity: .45; }
.bi-icon { font-size: 28px; margin-bottom: 5px; display: block; }
.bi-name { font-size: 11px; font-weight: 700; }
.bi-desc { font-size: 10px; color: var(--text2); margin-top: 1px; }
.rew-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.rew-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--border);
}
.ri-l { display: flex; align-items: center; gap: 10px; }
.ri-icon { font-size: 22px; }
.ri-name { font-size: 14px; font-weight: 700; }
.ri-cost { font-size: 12px; color: var(--text2); }
.claim-btn {
  padding: 7px 14px; border-radius: 10px;
  background: var(--accent2); border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800; cursor: pointer;
}
.claim-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Coupon Gallery */
.coupon-gallery { display: flex; flex-direction: column; gap: 10px; }
.coupon-card {
  border-radius: 18px; padding: 18px 20px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform .15s;
}
.coupon-card:hover { transform: translateY(-2px); }
.coupon-card::before {
  content: ''; position: absolute;
  left: -8px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
}
.coupon-card::after {
  content: ''; position: absolute;
  right: -8px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
}
.coupon-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.coupon-icon { font-size: 28px; }
.coupon-name { font-size: 16px; font-weight: 900; }
.coupon-sub  { font-size: 12px; opacity: .8; }
.coupon-code { font-size: 11px; font-weight: 800; opacity: .7; }
.coupon-used { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 800; opacity: .5; }

/* ── PROFILE DRAWER ────────────────────────────────────── */
.drawer-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 800; display: flex; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-ov.open { opacity: 1; pointer-events: all; }
.drawer-box {
  background: var(--card); width: 85%; max-width: 340px;
  height: 100%; padding: 28px 20px; overflow-y: auto;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer-ov.open .drawer-box { transform: translateX(0); }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 12px; color: #fff; font-weight: 900;
}
.profile-name { font-size: 18px; font-weight: 900; text-align: center; margin-bottom: 4px; }
.profile-email { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 20px; }
.profile-stat-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-bottom: 20px;
}
.ps-card {
  text-align: center; padding: 10px 6px;
  background: var(--bg); border-radius: 12px;
}
.ps-num { font-size: 20px; font-weight: 900; color: var(--accent); }
.ps-lbl { font-size: 10px; color: var(--text2); font-weight: 700; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-badge { font-size: 28px; }

/* ── Profile panel buttons (头像 / 徽章 / 奖券) ── */
.profile-panel-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 6px; margin-bottom: 12px;
}
.profile-panel-btn {
  padding: 10px 8px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .15s, background .15s;
}
.profile-panel-btn:hover { border-color: var(--accent); }
.profile-expand-panel {
  display: none; margin-bottom: 12px; padding: 12px;
  background: var(--bg); border-radius: 14px;
  border: 1.5px solid var(--border);
}
.profile-expand-panel.open { display: block; }

/* ── Avatar grid inside expand panel ── */
.avatar-preset-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin-bottom: 10px;
}
.avatar-opt {
  font-size: 24px; text-align: center; padding: 6px; border-radius: 10px;
  cursor: pointer; border: 2px solid transparent;
  transition: border-color .15s, background .15s;
}
.avatar-opt:hover { background: var(--border); }
.avatar-opt.sel { border-color: var(--accent); background: #FFF3E0; }
.avatar-upload-btn {
  display: block; width: 100%; padding: 9px; border-radius: 12px;
  border: 1.5px dashed var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--text2); cursor: pointer; text-align: center;
  transition: border-color .15s;
}
.avatar-upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.profile-avatar-img {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; display: block; margin: 0 auto 12px;
}

/* ── Mini coupon list in profile drawer ── */
.profile-coupon-mini {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 12px; margin-bottom: 6px;
  cursor: pointer; font-weight: 700; font-size: 13px;
  transition: opacity .15s;
}
.profile-coupon-mini:last-child { margin-bottom: 0; }
.profile-coupon-mini:hover { opacity: .85; }
.pcm-icon { font-size: 20px; flex-shrink: 0; }
.pcm-name { flex: 1; }
.pcm-used { font-size: 11px; opacity: .6; }

.profile-btn {
  width: 100%; padding: 12px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); cursor: pointer; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.psa-btn {
  width: 100%; padding: 9px 12px; border-radius: 12px;
  border: 1.5px solid var(--accent); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--accent); cursor: pointer; text-align: center;
  transition: background .15s, color .15s;
}
.psa-btn:hover { background: var(--accent); color: #fff; }
.logout-btn {
  width: 100%; padding: 12px; border-radius: 14px;
  border: none; background: #FFF0EE; color: var(--red);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 8px;
}

/* ── MODAL ─────────────────────────────────────────────── */
.modal-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-ov.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 24px 20px 36px; width: 100%; max-width: 480px;
  transform: translateY(30px); transition: transform .25s ease;
}
.modal-ov.open .modal-box { transform: translateY(0); }
.modal-title { font-size: 17px; font-weight: 900; margin-bottom: 16px; }
.minput {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 14px; color: var(--text); margin-bottom: 10px;
}
.minput:focus { outline: none; border-color: var(--accent); }
.dur-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dur-row label { font-size: 13px; font-weight: 700; color: var(--text2); }
.dinput {
  width: 70px; padding: 8px 10px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); text-align: center;
}
.dinput:focus { outline: none; border-color: var(--accent); }
.pick-label { font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.eo {
  font-size: 22px; padding: 8px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; text-align: center; transition: all .12s;
}
.eo.sel { border-color: var(--accent); background: #FFF3EE; }
.color-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.co {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: all .12s;
}
.co.sel { border-color: var(--text); transform: scale(1.15); }
.bg-color-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.bgco {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--border); transition: all .12s;
}
.bgco:hover { border-color: var(--text2); transform: scale(1.1); }
.bgco.sel { border-color: var(--accent); transform: scale(1.15); box-shadow: 0 0 0 2px var(--accent); }
.modal-row { display: flex; gap: 8px; }
.mconfirm {
  flex: 1; padding: 13px; border-radius: 14px;
  background: var(--accent); border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; cursor: pointer;
}
.mcancel {
  padding: 13px 18px; border-radius: 14px;
  background: var(--border); border: none; color: var(--text2);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ── REMIND BANNER ─────────────────────────────────────── */
.remind-banner {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; border-radius: 30px;
  padding: 12px 20px; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(255,107,53,.4); z-index: 900;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { transform: translateX(-50%) translateY(-20px); opacity:0; } }
.remind-banner button {
  background: rgba(255,255,255,.3); border: none; color: #fff;
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 12px;
}

/* ── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: #1A1A1A; color: #fff; padding: 10px 20px;
  border-radius: 30px; font-size: 13px; font-weight: 700;
  opacity: 0; transition: opacity .3s; pointer-events: none;
  white-space: nowrap; z-index: 999;
}
.toast.show { opacity: 1; }

/* ── CONFETTI ──────────────────────────────────────────── */
.cp {
  position: fixed; top: -12px; width: 8px; height: 8px; border-radius: 2px;
  animation: cfall 1.4s ease-in forwards; pointer-events: none; z-index: 9999;
}
@keyframes cfall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   NEW: Notion panel, Theme selector, Auth-gate lang, misc fixes
   ══════════════════════════════════════════════════════════════ */

/* ── Auth lang switcher (inside auth gate) ─────────────────── */
.auth-lang-sw {
  display: flex; gap: 3px; justify-content: center; margin-bottom: 14px;
  background: #f5f5f5; border-radius: 30px; padding: 3px; width: fit-content; margin: 0 auto 16px;
}

/* ── Theme 🎨 button in topbar ─────────────────────────────── */
.theme-btn-top {
  background: transparent; border: none; font-size: 18px;
  cursor: pointer; padding: 2px 4px; border-radius: 8px;
  transition: transform .2s; line-height: 1; margin-right: 2px;
}
.theme-btn-top:hover { transform: rotate(20deg) scale(1.15); }

/* ── Notion tab button ─────────────────────────────────────── */
.notion-tab {
  background: #1a1a1a !important; color: #fff !important;
  border-color: #1a1a1a !important; font-weight: 800;
}
.notion-tab:hover { background: #333 !important; opacity: 1; }

/* ── Notion modal overlay ──────────────────────────────────── */
.notion-modal-ov {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 600; display: flex;
  align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.notion-modal-ov.open { opacity: 1; pointer-events: all; }

.notion-modal-box {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 540px; max-height: 92vh;
  overflow-y: auto; padding-bottom: 40px;
  transform: translateY(40px); transition: transform .28s cubic-bezier(.34,1.3,.7,1);
  box-shadow: 0 -12px 48px rgba(0,0,0,.18);
}
.notion-modal-ov.open .notion-modal-box { transform: translateY(0); }

/* ── Header ────────────────────────────────────────────────── */
.notion-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e8e8e8;
  position: sticky; top: 0; background: #fff; z-index: 10;
  border-radius: 20px 20px 0 0;
}
.notion-header-title {
  font-size: 15px; font-weight: 900; flex: 1;
  font-family: 'Nunito', sans-serif; letter-spacing: -.3px;
}
.notion-close-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #f0f0f0; color: #666;
  font-size: 15px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.notion-edit-toggle {
  padding: 5px 12px; border-radius: 8px;
  border: 1.5px solid #e0e0e0; background: #fff;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  color: #555; cursor: pointer; transition: all .15s;
}
.notion-edit-toggle.active, .notion-edit-toggle:hover {
  background: #f0f0f0; border-color: #bbb;
}

/* ── Progress bar ──────────────────────────────────────────── */
.notion-progress-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 0;
}
.notion-progress-bar {
  flex: 1; height: 6px; border-radius: 6px; background: #f0f0f0;
}
.notion-progress-fill {
  height: 100%; border-radius: 6px;
  background: #2ecc71; transition: width .4s ease;
}
.notion-progress-lbl {
  font-size: 12px; font-weight: 700; color: #888; white-space: nowrap;
}

/* ── Filter tabs ───────────────────────────────────────────── */
.notion-filter-tabs {
  display: flex; gap: 6px; padding: 12px 18px 8px;
  overflow-x: auto; scrollbar-width: none;
}
.notion-filter-tabs::-webkit-scrollbar { display: none; }
.nf-tab {
  padding: 5px 14px; border-radius: 30px;
  border: 1.5px solid #e8e8e8; background: #fff;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  color: #666; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.nf-tab.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.nf-tab:hover:not(.active) { background: #f5f5f5; }

/* ── Task list ─────────────────────────────────────────────── */
.notion-task-list { padding: 4px 18px 0; }

.notion-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  cursor: pointer; transition: background .1s; margin-bottom: 2px;
  border: 1.5px solid transparent;
}
.notion-task-row:hover { background: #f7f7f7; }
.notion-task-row.done  { opacity: .6; }
.notion-task-row.edit-mode { cursor: default; background: #fafafa; border-color: #e8e8e8; margin-bottom: 6px; }
.notion-task-row.edit-mode:hover { background: #fafafa; }

/* Checkbox */
.notion-task-check {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  border: 2px solid #d0d0d0; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.notion-task-check.checked {
  background: #2ecc71; border-color: #2ecc71;
}

.notion-task-name {
  flex: 1; font-size: 14px; font-weight: 600; color: #1a1a1a; line-height: 1.4;
}
.notion-task-name.striked { text-decoration: line-through; color: #aaa; }

/* Time badge */
.notion-time-badge {
  font-size: 11px; font-weight: 700; color: #888;
  background: #f2f2f2; padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}

/* Edit mode inputs */
.notion-time-sel {
  padding: 4px 6px; border-radius: 7px; border: 1.5px solid #e0e0e0;
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 700;
  background: #fff; color: #444; flex-shrink: 0;
}
.notion-task-edit-input {
  flex: 1; padding: 6px 10px; border-radius: 8px;
  border: 1.5px solid #e0e0e0; background: #fff;
  font-family: 'Nunito', sans-serif; font-size: 13px; color: #1a1a1a;
}
.notion-task-edit-input:focus { outline: none; border-color: #1a1a1a; }
.notion-del-btn {
  width: 24px; height: 24px; border-radius: 6px; border: none;
  background: #ffe8e8; color: #e74c3c; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Add task button */
.notion-add-task-btn {
  margin: 8px 18px 0; display: block;
  padding: 9px 14px; border-radius: 10px;
  border: 1.5px dashed #c0c0c0; background: transparent;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  color: #888; cursor: pointer; width: calc(100% - 36px);
  transition: all .15s; text-align: left;
}
.notion-add-task-btn:hover { border-color: #888; color: #444; background: #fafafa; }

/* ── Summary ───────────────────────────────────────────────── */
.notion-summary-row { padding: 12px 18px 0; }
.notion-summary {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1.5px solid #e8e8e8; background: #fafafa;
  font-family: 'Nunito', sans-serif; font-size: 13px; color: #333;
  resize: none; min-height: 60px; line-height: 1.6;
}
.notion-summary:focus { outline: none; border-color: #1a1a1a; background: #fff; }

/* ── Sync section ──────────────────────────────────────────── */
.notion-sync-section { padding: 12px 18px 0; }
.notion-sync-btn {
  width: 100%; padding: 13px; border-radius: 12px;
  background: #1a1a1a; border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
  cursor: pointer; margin-bottom: 14px; transition: opacity .15s;
}
.notion-sync-btn:hover { opacity: .85; }
.notion-sync-btn:disabled { opacity: .5; cursor: wait; }

.notion-synced-list { display: flex; flex-direction: column; gap: 0; }
.notion-synced-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid #f0f0f0;
  font-size: 13px; color: #555;
}
.notion-synced-row:last-child { border-bottom: none; }
.notion-open-link {
  color: #1a1a1a; font-weight: 700; font-size: 12px; text-decoration: none;
}
.notion-open-link:hover { text-decoration: underline; }

/* ── Config section ────────────────────────────────────────── */
.notion-config-section { padding: 16px 18px 0; }
.notion-cfg-label {
  font-size: 11px; font-weight: 800; color: #999;
  letter-spacing: .07em; text-transform: uppercase; margin-bottom: 10px;
}
.notion-input {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1.5px solid #e8e8e8; background: #fafafa;
  font-family: 'Nunito', sans-serif; font-size: 13px; color: #333;
  margin-bottom: 8px; display: block;
}
.notion-input:focus { outline: none; border-color: #1a1a1a; background: #fff; }
.notion-cfg-hint {
  font-size: 11px; color: #999; line-height: 1.6; margin-bottom: 10px;
}
.notion-save-cfg-btn {
  padding: 9px 18px; border-radius: 10px;
  background: #1a1a1a; border: none; color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.notion-save-cfg-btn:hover { opacity: .8; }

.notion-empty {
  font-size: 13px; color: #aaa; text-align: center; padding: 16px 0;
}

/* ── Notion: loading state ─────────────────────────────────── */
.notion-loading-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 40px 20px; color: #888; font-size: 14px;
}
.notion-spinner { font-size: 28px; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notion: error banner ──────────────────────────────────── */
.notion-error-banner {
  margin: 8px 18px 0; padding: 10px 14px; border-radius: 10px;
  background: #fff3f3; border: 1px solid #ffd0d0;
  color: #c00; font-size: 12px; display: flex; align-items: center;
}
.notion-error-banner button {
  border: 1px solid #c00; border-radius: 6px; background: none;
  color: #c00; padding: 2px 8px; font-size: 11px; cursor: pointer;
}

/* ── Notion: sync indicator ────────────────────────────────── */
.notion-sync-dot {
  margin-left: auto; font-size: 11px; opacity: .5; flex-shrink: 0;
}

/* ── Notion: collapsible config ────────────────────────────── */
.notion-cfg-details { margin: 12px 18px 0; }
.notion-cfg-summary {
  font-size: 12px; color: #888; cursor: pointer; user-select: none;
  padding: 6px 0; list-style: none;
}
.notion-cfg-summary::-webkit-details-marker { display: none; }
.notion-cfg-details[open] .notion-cfg-summary { color: #333; }

/* ── Notion: archive button ────────────────────────────────── */
.notion-archive-row { padding: 12px 18px 4px; }
.notion-archive-btn {
  display: block; width: 100%; padding: 13px;
  border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #FF6B35, #FFB300);
  color: #fff; font-size: 14px; font-weight: 700;
  text-align: center; text-decoration: none;
  transition: opacity .15s;
}
.notion-archive-btn:hover  { opacity: .88; }
.notion-archive-btn:disabled { opacity: .5; cursor: wait; }
.notion-archive-btn.done {
  background: linear-gradient(135deg, #52C97A, #4A90D9);
}

/* ── Theme modal ───────────────────────────────────────────── */
.theme-modal-box { max-width: 520px; max-height: 88vh; overflow-y: auto; }
.theme-section-label {
  font-size: 11px; font-weight: 800; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin: 16px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.theme-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.theme-item {
  border-radius: 14px; border: 2px solid var(--border);
  overflow: hidden; cursor: pointer; transition: all .15s; position: relative;
}
.theme-item:hover { border-color: var(--accent); transform: scale(1.03); }
.theme-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,53,.2); }
.theme-preview { width: 100%; height: 60px; overflow: hidden; }
.theme-label {
  font-size: 11px; font-weight: 700; text-align: center;
  padding: 5px 4px; color: var(--text2); background: var(--card);
}
.theme-check {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900;
}

/* ── Photo upload area ── */
.theme-upload-area { display: flex; flex-direction: column; gap: 8px; }
.theme-upload-preview {
  width: 100%; height: 120px; border-radius: 14px;
  border: 2px dashed var(--border);
  overflow: hidden; position: relative;
  transition: border-color .2s;
}
.theme-upload-preview:hover { border-color: var(--accent); }
.theme-upload-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; height: 100%; cursor: pointer;
  color: var(--text2); font-size: 12px; font-weight: 700;
  transition: color .2s;
}
.theme-upload-placeholder:hover { color: var(--accent); }
.theme-upload-preview img {
  width: 100%; height: 100%; object-fit: cover; cursor: pointer;
}
.theme-upload-actions {
  display: flex; gap: 8px;
}
.theme-upload-btn {
  flex: 1; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.theme-upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-upload-btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.theme-upload-btn-primary:hover { background: #ff8a5c; border-color: #ff8a5c; color: #fff; }

/* ── AI generation area ── */
.theme-ai-area { display: flex; flex-direction: column; gap: 4px; }
.theme-ai-row { display: flex; gap: 8px; align-items: center; }
.theme-ai-input {
  flex: 1; padding: 8px 12px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text); font-family: 'Nunito', sans-serif; font-size: 12px;
  outline: none; transition: border-color .2s;
}
.theme-ai-input:focus { border-color: var(--accent); }
.theme-ai-input::placeholder { color: var(--text2); }
.theme-ai-btn {
  flex-shrink: 0; padding: 8px 14px; border-radius: 10px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  border: none; color: #fff; font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 800; cursor: pointer;
  transition: all .15s; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,70,229,0.35);
}
.theme-ai-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.theme-ai-btn:disabled { opacity: .5; cursor: wait; transform: none; }
.theme-ai-preview {
  width: 100%; border-radius: 14px; overflow: hidden;
  border: 1.5px solid var(--border); margin-top: 8px; position: relative;
}
.theme-ai-preview img { width: 100%; height: 130px; object-fit: cover; display: block; }
.theme-ai-apply-btn {
  position: absolute; bottom: 8px; right: 8px;
  padding: 5px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
  font-family: 'Nunito', sans-serif; transition: background .15s;
}
.theme-ai-apply-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ── dur-adj buttons (subject + timer) ─────────────────────── */
.dur-adj {
  width: 32px; height: 32px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--accent); font-size: 18px; font-weight: 900; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0; padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.dur-adj:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.08); }
.dur-adj:active { transform: scale(.94); }
.s-dur-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dur-val { font-size: 14px; font-weight: 800; color: var(--accent); min-width: 28px; text-align: center; }
.dur-unit { font-size: 12px; color: var(--text2); font-weight: 700; }
.timer-dur-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 20px; background: var(--card); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 12px 18px;
}
.timer-dur-label { font-size: 13px; font-weight: 700; color: var(--text2); margin-right: 4px; }
.timer-dur-val { font-size: 22px; font-weight: 900; color: var(--accent); min-width: 36px; text-align: center; }
.timer-dur-row .dur-adj { width: 36px; height: 36px; border-radius: 12px; font-size: 20px; }
