/* ══════════════════════════════════════════════════════════════
   AI STUDY DOST — THE CHAIRMAN SHOW
   Dashboard, Timeline, SVG Progress Ring, Floating Chat, Badges
   ══════════════════════════════════════════════════════════════ */

.study-body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(212, 175, 55, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
}

/* ═══ TOP NAVBAR ═══ */
.study-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
  height: 68px;
  display: flex;
  align-items: center;
}

.snav-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.snav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.snav-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.snav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.snav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.snav-btn:hover {
  background: var(--bg-surface-2);
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.snav-badge-count {
  background: var(--gold-primary);
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
}

.snav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  color: var(--gold-primary);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.snav-back-link:hover {
  background: var(--gold-primary);
  color: #000;
  transform: translateY(-1px);
}

/* ═══ MAIN LAYOUT ═══ */
.study-main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 100px;
  flex: 1;
}

.study-view {
  display: none;
  animation: studyFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.study-view.active {
  display: block;
}

@keyframes studyFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ SCREEN 1: SETUP FORM ═══ */
.setup-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 36px;
}

.setup-crown-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.setup-title {
  font-family: var(--font-royal);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 14px;
}

.setup-subtitle {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 0 0 24px;
}

.setup-presets-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 9999px;
  width: fit-content;
  margin: 0 auto;
}

.presets-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.preset-chip {
  padding: 5px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-mid);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: var(--gold-primary);
  transform: translateY(-1px);
}

.setup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 38px 42px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.setup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.form-sections-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.custom-goal-wrap {
  margin-top: 8px;
}

.custom-goal-wrap input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
}

/* Level Cards Grid */
.level-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.level-card {
  position: relative;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
}

.level-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lc-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lc-icon {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.lc-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.lc-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.level-card:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-mid);
  transform: translateY(-2px);
}

.level-card.selected {
  background: var(--gold-soft);
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px var(--gold-glow);
}

.level-card.selected .lc-icon {
  color: var(--gold-primary);
  transform: scale(1.1);
}

.level-card.selected .lc-title {
  color: var(--gold-primary);
}

/* Time Slider */
.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-primary);
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-wrap input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-surface-3);
  outline: none;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Deadline Toggle Grid */
.deadline-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

.date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.or-separator {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.date-picker-wrap input[type="date"] {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
}

/* Learning Style Chips */
.style-chips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.style-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
}

.style-chip i:first-child {
  font-size: 1rem;
  color: var(--text-muted);
}

.style-chip span {
  flex: 1;
  text-align: left;
}

.style-chip .check-mark {
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.style-chip:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-mid);
  color: var(--text-primary);
}

.style-chip.selected {
  background: var(--gold-soft);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  font-weight: 700;
  box-shadow: 0 0 16px var(--gold-glow);
}

.style-chip.selected i:first-child {
  color: var(--gold-primary);
}

.style-chip.selected .check-mark {
  opacity: 1;
  transform: scale(1);
  color: var(--gold-primary);
}

/* Setup CTA button */
.setup-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
}

.study-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 36px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
  color: #000;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 30px var(--gold-glow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.study-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--gold-glow);
}

.study-primary-btn:hover .arrow-icon {
  transform: translateX(4px);
}

/* ═══ SCREEN 2: GENERATING PROCESSING VIEW ═══ */
.generating-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-xl);
  padding: 60px 32px;
  text-align: center;
  max-width: 680px;
  margin: 20px auto;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.generating-orbit-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-circle-dashed {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px dashed rgba(212, 175, 55, 0.4);
  animation: orbitSpin 14s linear infinite;
}

.orbit-center-icon {
  color: var(--gold-primary);
  font-size: 2.8rem;
  z-index: 2;
  filter: drop-shadow(0 0 16px var(--gold-glow));
  animation: pulseCrown 2s ease-in-out infinite;
}

.orbit-sat {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.sat-top { top: -6px; left: calc(50% - 16px); }
.sat-right { bottom: 12px; right: -4px; }
.sat-left { bottom: 12px; left: -4px; }

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gen-headline {
  font-family: var(--font-royal);
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.gen-sub {
  color: var(--text-secondary);
  font-size: 0.96rem;
  margin: 0 0 30px;
}

.gen-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto 28px;
}

.gen-progress-track {
  flex: 1;
  height: 10px;
  background: var(--bg-surface-3);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary), var(--gold-light));
  border-radius: 9999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 12px var(--gold-glow);
}

.gen-progress-pct {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-primary);
  width: 44px;
}

.gen-tickers-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 18px 22px;
  text-align: left;
  max-width: 520px;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gen-tick-item {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.gen-tick-item.active {
  color: var(--gold-primary);
  font-weight: 600;
}

.gen-tick-item.completed {
  color: var(--accent-green);
}

.gen-badge-footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-family: var(--font-mono);
}

/* ═══ SCREEN 3: PLAN DASHBOARD ═══ */
.plan-dashboard-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-xl);
  padding: 30px 34px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(212, 175, 55, 0.1);
  position: relative;
  overflow: hidden;
}

.plan-dashboard-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
}

.pdh-left {
  flex: 1;
  min-width: 280px;
}

.pdh-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dot-sep { opacity: 0.5; }

.pdh-title {
  font-family: var(--font-royal);
  font-size: 1.85rem;
  font-weight: 900;
  margin: 0 0 10px;
  letter-spacing: 0.5px;
}

.pdh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.pdh-meta strong {
  color: var(--text-primary);
}

.pdh-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Streak Badge Card */
.streak-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.streak-flame {
  font-size: 1.8rem;
  color: #ff6b4a;
  filter: drop-shadow(0 0 10px rgba(255, 107, 74, 0.6));
  animation: flameBounce 1.5s ease-in-out infinite;
}

@keyframes flameBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(4deg); }
}

.streak-num {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.streak-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* SVG Circular Progress Ring */
.progress-ring-card {
  position: relative;
  width: 94px;
  height: 94px;
}

.progress-ring-svg {
  transform: rotate(-90deg);
}

.ring-fill {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.ring-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.ring-pct {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-primary);
}

.ring-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Plan Controls Bar */
.plan-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.pc-left,
.pc-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pctrl-btn:hover {
  background: var(--bg-surface-2);
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.pctrl-gold {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.pctrl-gold:hover {
  background: var(--gold-primary);
  color: #000;
}

.pctrl-danger:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Motivational Quote Card */
.motivation-quote-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(124, 58, 237, 0.04) 100%);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--gold-primary);
  border-radius: var(--r-md);
  margin-bottom: 24px;
}

.mqc-icon {
  color: var(--gold-primary);
  font-size: 1.4rem;
  opacity: 0.8;
}

.mqc-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.45;
}

.mqc-author {
  font-size: 0.76rem;
  color: var(--gold-primary);
  font-weight: 700;
  margin-top: 4px;
}

/* ═══ TODAY'S FOCUS CARD (HERO ELEMENT) ═══ */
.today-focus-card {
  background: var(--bg-surface);
  border: 2px solid var(--gold-primary);
  border-radius: var(--r-xl);
  padding: 34px 38px;
  margin-bottom: 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--gold-glow);
  position: relative;
  transition: all 0.3s ease;
}

.tfc-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tfc-day-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 9999px;
  background: var(--gold-primary);
  color: #000;
  text-transform: uppercase;
}

.tfc-time-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tfc-title {
  font-family: var(--font-royal);
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: 0.5px;
}

.tfc-section {
  margin-bottom: 20px;
}

.tfc-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tfc-section-title i {
  color: var(--gold-primary);
}

.tfc-topics-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tfc-topics-list li {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tfc-topics-list li::before {
  content: '▸';
  color: var(--gold-primary);
  font-weight: 800;
}

/* Resources Grid */
.tfc-resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.tfc-resource-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.tfc-resource-item:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-gold);
  transform: translateY(-2px);
}

.res-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.res-icon.video { color: #ef4444; }
.res-icon.practice { color: #10b981; }
.res-icon.reading { color: #00d4ff; }
.res-icon.project { color: #f59e0b; }

.tfc-resource-item span {
  flex: 1;
  font-weight: 600;
}

/* Notes Textarea */
.today-notes-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.today-notes-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.tfc-notes-saved {
  font-size: 0.74rem;
  color: var(--accent-green);
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tfc-notes-saved.show {
  opacity: 1;
}

/* Big Actions */
.tfc-actions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.tfc-complete-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
  color: #000;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--gold-glow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tfc-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--gold-glow);
}

.tfc-complete-btn.completed {
  background: #10b981;
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.tfc-skip-btn {
  padding: 16px 22px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tfc-skip-btn:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}

/* ═══ TOMORROW'S PREVIEW CARD ═══ */
.tomorrow-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: 18px 24px;
  margin-bottom: 28px;
  transition: all 0.2s ease;
}

.tpc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.tpc-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: inline-block;
}

.tpc-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.tpc-expand-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.tpc-body {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.tomorrow-preview-card.open .tpc-body {
  display: block;
}

.tomorrow-preview-card.open #tomorrowExpandIcon {
  transform: rotate(180deg);
}

.tpc-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

/* ═══ FULL PLAN TIMELINE ═══ */
.full-plan-timeline-wrap {
  margin-top: 32px;
}

.timeline-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.th-left h3 {
  font-family: var(--font-royal);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.th-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.th-filters {
  display: flex;
  gap: 8px;
}

.tl-filter-btn {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tl-filter-btn.active {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: var(--gold-primary);
  font-weight: 700;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 36px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 20px;
  left: 14px;
  width: 2px;
  background: var(--border-mid);
}

/* Timeline Day Card */
.timeline-day-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 14px;
  transition: all 0.22s ease;
}

.timeline-day-card:hover {
  border-color: var(--border-mid);
  transform: translateX(4px);
}

.timeline-node {
  position: absolute;
  left: -32px;
  top: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  border: 2px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
  transition: all 0.25s ease;
}

.timeline-day-card.active-day {
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px var(--gold-glow);
}

.timeline-day-card.active-day .timeline-node {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
  color: #000;
}

.timeline-day-card.completed-day {
  background: var(--bg-surface-2);
  opacity: 0.75;
}

.timeline-day-card.completed-day .timeline-node {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.td-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.td-day-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-primary);
}

.td-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.td-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.td-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.td-topics-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ═══ FLOATING CHAT WITH STUDY DOST ═══ */
.floating-dost-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: #000;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-dost-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.5);
}

.fdb-pulse {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid var(--gold-primary);
  animation: pulseOut 2s infinite;
}

@keyframes pulseOut {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Chat Drawer */
.study-chat-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-xl);
  z-index: 995;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.2);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.study-chat-drawer.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.sc-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.sc-title {
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.sc-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot-online {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.sc-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.sc-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sc-msg {
  display: flex;
}

.sc-msg.dost {
  justify-content: flex-start;
}

.sc-msg.user {
  justify-content: flex-end;
}

.sc-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.sc-msg.dost .sc-bubble {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  border-bottom-left-radius: 3px;
}

.sc-msg.user .sc-bubble {
  background: var(--gold-primary);
  color: #000;
  font-weight: 600;
  border-bottom-right-radius: 3px;
}

.sc-quick-chips {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-surface-2);
}

.sc-chip {
  padding: 4px 10px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-soft);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  white-space: nowrap;
  cursor: pointer;
}

.sc-chip:hover {
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.sc-composer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 8px;
}

.sc-composer input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
}

.sc-composer input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.sc-composer button {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--gold-primary);
  border: none;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══ ACHIEVEMENTS BADGES GRID ═══ */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.badge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: all 0.2s ease;
}

.badge-card.unlocked {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--bg-surface-2) 100%);
}

.badge-card.locked {
  opacity: 0.55;
  filter: grayscale(80%);
}

.badge-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-surface-3);
  flex-shrink: 0;
}

.badge-card.unlocked .badge-icon-box {
  background: var(--gold-primary);
  color: #000;
  box-shadow: 0 0 16px var(--gold-glow);
}

.badge-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.badge-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .setup-card {
    padding: 28px 22px;
  }

  .level-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .style-chips-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .deadline-toggle-grid {
    grid-template-columns: 1fr;
  }

  .plan-dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .pdh-right {
    justify-content: space-between;
  }

  .badges-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .study-main {
    padding: 20px 14px 90px;
  }

  .setup-title {
    font-size: 1.8rem;
  }

  .level-cards-grid {
    grid-template-columns: 1fr;
  }

  .today-focus-card {
    padding: 22px 18px;
  }

  .tfc-actions-row {
    flex-direction: column;
  }

  .tfc-complete-btn,
  .tfc-skip-btn {
    width: 100%;
  }

  .study-chat-drawer {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: 80vh;
  }

  .floating-dost-btn .fdb-label {
    display: none;
  }

  .floating-dost-btn {
    padding: 14px;
    border-radius: 50%;
  }
}
