/* ─── Taskoo Mobile — Design System ──────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

/* ─── CSS Custom Properties ────────────────────────────────────────────────── */

:root {
  --red: #DF3E3A;
  --red-dark: #c73530;
  --red-soft: rgba(223,62,58,0.13);
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.24), 0 4px 8px rgba(0,0,0,0.14);
  --shadow-red: 0 4px 16px rgba(223,62,58,0.35);
}

[data-theme="dark"] {
  --bg: #0E0808;
  --bg-2: #1a1212;
  --surface: #1f1717;
  --surface-2: #2a1e1e;
  --surface-3: #362828;
  --border: rgba(255,255,255,0.08);
  --text: #F5F0EF;
  --text-soft: rgba(245,240,239,0.5);
  --text-muted: rgba(245,240,239,0.3);
  --overlay: rgba(0,0,0,0.6);
}

[data-theme="light"] {
  --bg: #F9F9F6;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F2EF;
  --surface-3: #E8E8E4;
  --border: rgba(0,0,0,0.08);
  --text: #1A1212;
  --text-soft: rgba(26,18,18,0.5);
  --text-muted: rgba(26,18,18,0.3);
  --overlay: rgba(0,0,0,0.3);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
}

#root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  padding: 0;
  margin: 0;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

/* ─── App Shell ─────────────────────────────────────────────────────────────── */

.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.phone {
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.phone-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  /* Allow elevated FAB to render above the nav bar */
  isolation: isolate;
}

/* ─── Offline Banner ────────────────────────────────────────────────────────── */

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(245,158,11,0.12);
  border-bottom: 1px solid rgba(245,158,11,0.25);
  color: #F59E0B;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
  text-align: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

/* ─── Install Banner ────────────────────────────────────────────────────────── */

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--overlay);
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}

.install-sheet {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 40px;
  position: relative;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  animation: slide-up 0.3s cubic-bezier(0.16,1,0.3,1);
}

.install-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: opacity 0.15s;
}
.install-close:hover { opacity: 0.7; }

.install-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.install-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
}

.install-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.install-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.5;
}

.install-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  box-shadow: var(--shadow-red);
  transition: opacity 0.15s, transform 0.12s;
}
.install-btn:active { opacity: 0.88; transform: scale(0.98); }

.install-skip {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}
.install-skip:hover { color: var(--text); }

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.install-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-step-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  padding-top: 3px;
}
.install-step-text strong { color: var(--text); font-weight: 700; }

/* ─── Loading Screen ────────────────────────────────────────────────────────── */

.loading-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--bg);
}

.loading-logo {
  animation: pulse 1.8s ease-in-out infinite;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ─── Auth Screen ───────────────────────────────────────────────────────────── */

.auth-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 48px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.auth-brand-icon {
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.auth-brand-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.auth-brand-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.auth-info {
  background: rgba(61,184,122,0.12);
  border: 1px solid rgba(61,184,122,0.25);
  color: #3db87a;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.auth-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 50px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.auth-field:focus-within {
  border-color: var(--red);
}

.auth-input {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  height: 100%;
  line-height: 1;
}
.auth-input::placeholder { color: var(--text-muted); }

.auth-eye {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: color 0.15s;
}
.auth-eye:hover { color: var(--text); }

.pw-strength {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 2px;
}

.pw-strength-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: background 0.25s ease;
}

.auth-forgot {
  text-align: right;
  margin-bottom: 10px;
}

.auth-forgot button {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  opacity: 0.85;
  transition: opacity 0.15s;
}
.auth-forgot button:hover { opacity: 1; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-google-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.auth-google-btn:hover {
  background: var(--surface-3);
  border-color: rgba(255,255,255,0.15);
}
.auth-google-btn:active { opacity: 0.85; }

/* ─── Status Bar ────────────────────────────────────────────────────────────── */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 4px;
  flex-shrink: 0;
}

.status-time {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

/* ─── Screens ───────────────────────────────────────────────────────────────── */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  overscroll-behavior: contain;
}

.screen-in {
  animation: fade-in 0.18s ease;
}

.slide-in {
  animation: slide-from-right 0.22s cubic-bezier(0.16,1,0.3,1);
}

/* ─── Page Headers ──────────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 6px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
  flex: 1;
}

/* ─── Utility Buttons ───────────────────────────────────────────────────────── */

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.back-btn {
  background: var(--surface-2);
  color: var(--text);
}
.back-btn:hover { background: var(--surface-3); }

.icon-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.icon-btn-sm:hover { background: var(--surface-3); color: var(--text); }

/* ─── Segment Selector ──────────────────────────────────────────────────────── */

.segment {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  flex: 1;
  height: 34px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  letter-spacing: 0.01em;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ─── Bottom Navigation ─────────────────────────────────────────────────────── */

.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 48px;
  height: 56px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s, transform 0.12s;
  position: relative;
  overflow: visible;
}
.nav-btn:active { transform: scale(0.92); }

.nav-btn.active {
  color: var(--red);
}
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--red);
}

.nav-fab-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 56px;
  position: relative;
  z-index: 2;
}

.nav-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-red);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
  transform: translateY(-6px);
  flex-shrink: 0;
}
.nav-fab:hover { opacity: 0.92; box-shadow: 0 6px 20px rgba(223,62,58,0.45); }
.nav-fab:active { transform: translateY(-4px) scale(0.94); }
.nav-fab.active {
  box-shadow: 0 0 0 3px rgba(223,62,58,0.3), var(--shadow-red);
}

/* ─── Dashboard ─────────────────────────────────────────────────────────────── */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
}

.dash-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.1;
}

.dash-sub {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

.dash-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── Stat Cards ────────────────────────────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-card.accent {
  background: var(--red-soft);
  border-color: rgba(223,62,58,0.2);
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Section Headers ───────────────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  opacity: 0.85;
}
.see-all:hover { opacity: 1; }

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

/* ─── Countdown Card ────────────────────────────────────────────────────────── */

.countdown-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.countdown-left { flex: 1; }

.countdown-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.countdown-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.3;
}

.countdown-date {
  font-size: 12px;
  color: var(--text-soft);
}

.countdown-ring {
  position: relative;
  flex-shrink: 0;
}

.countdown-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* ─── Courses ───────────────────────────────────────────────────────────────── */

.courses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.course-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.course-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.course-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

.course-grade {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Task List ─────────────────────────────────────────────────────────────── */

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.task-row:active { opacity: 0.8; }
.task-row.done { opacity: 0.5; }

.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  color: #fff;
}
.task-check.checked {
  background: var(--red);
  border-color: var(--red);
}

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

.task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row.done .task-title { text-decoration: line-through; }

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-course {
  font-size: 11px;
  font-weight: 700;
}

.task-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-tag.urgent {
  background: rgba(245,158,11,0.14);
  color: #F59E0B;
}

/* ─── AI Tip Banner ─────────────────────────────────────────────────────────── */

.ai-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.ai-tip:hover { background: var(--surface-3); }

.ai-tip-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.ai-tip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.ai-tip-text {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  line-height: 1.4;
}

/* ─── Empty State ───────────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  gap: 0;
}

/* ─── Calendar ──────────────────────────────────────────────────────────────── */

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 12px;
}

.cal-month {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}

.cal-dow-cell {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
  letter-spacing: 0.04em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.cal-cell:hover { background: var(--surface-2); color: var(--text); }

.cal-cell.today {
  color: var(--red);
  font-weight: 800;
}

.cal-cell.selected {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-red);
}
.cal-cell.today.selected {
  background: var(--red);
  color: #fff;
}

.cal-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}
.cal-cell.selected .cal-dot { background: #fff; }

/* ─── Timeline ──────────────────────────────────────────────────────────────── */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.timeline-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  width: 42px;
  flex-shrink: 0;
  padding-top: 13px;
  text-align: right;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 16px;
}

.timeline-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left-width: 3px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.timeline-loc {
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ─── Deadlines ─────────────────────────────────────────────────────────────── */

.urgent-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #F59E0B;
}

.deadlines-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.deadline-card {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: opacity 0.15s;
}
.deadline-card.urgent {
  border-color: rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.04);
}

.deadline-bar {
  width: 4px;
  align-self: stretch;
  flex-shrink: 0;
}

.deadline-body {
  flex: 1;
  padding: 13px 12px;
  min-width: 0;
}

.deadline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deadline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deadline-course {
  font-size: 11px;
  font-weight: 700;
}

.deadline-due {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.deadline-due.red { color: var(--red); }

.deadline-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  margin-right: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.ai-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: background 0.15s;
  cursor: pointer;
  margin-bottom: 12px;
}
.ai-cta:hover { background: var(--surface-2); }

/* ─── Focus Timer ───────────────────────────────────────────────────────────── */

.focus-ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 24px;
}

.focus-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.focus-time {
  font-size: 52px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.focus-mode-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.focus-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.focus-ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.focus-ctrl-btn:hover { background: var(--surface-3); color: var(--text); }

.focus-play-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-red);
  transition: transform 0.12s, box-shadow 0.12s;
}
.focus-play-btn:active { transform: scale(0.94); }

/* ─── Pomodoro Dots ─────────────────────────────────────────────────────────── */

.pomo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pomo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.pomo-dot.done { background: var(--red); }

.pomo-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.03em;
}

/* ─── Ambient Toggle ────────────────────────────────────────────────────────── */

.ambient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0 0 10px;
}

.ambient-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.ambient-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ambient-chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ambient-chip:hover {
  background: var(--red-soft);
  border-color: rgba(223,62,58,0.3);
  color: var(--red);
}

/* ─── Toggle Pill ───────────────────────────────────────────────────────────── */

.toggle-pill {
  width: 44px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  padding: 3px;
  display: flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-pill.on {
  background: var(--red);
  border-color: var(--red);
}

.toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1);
}
.toggle-pill.on .toggle-knob {
  transform: translateX(18px);
}

/* ─── Tracking Screen ───────────────────────────────────────────────────────── */

.tracking-hero {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 12px auto 16px;
}

.tracking-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tracking-pct {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.tracking-sublbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.tracking-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tracking-stat {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.ts-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.ts-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Bar Chart ─────────────────────────────────────────────────────────────── */

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  height: 120px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 4px;
}

.bar-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
}

.bar-fill {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
}

.bar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ─── Courses Breakdown ─────────────────────────────────────────────────────── */

.courses-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breakdown-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  width: 64px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: var(--radius-pill);
}

.breakdown-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Chat Screen ───────────────────────────────────────────────────────────── */

.chat-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-bubble-wrap.user {
  justify-content: flex-end;
}

.chat-ai-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.chat-bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
}
.chat-bubble.ai {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.chat-bubble.user {
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  height: 44px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-size: 14px;
  color: var(--text);
  border: 1.5px solid var(--border);
  transition: border-color 0.15s;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:focus { border-color: var(--red); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
  transition: opacity 0.15s, transform 0.12s;
}
.chat-send-btn:active { opacity: 0.85; transform: scale(0.92); }

/* ─── Study Plan Screen ─────────────────────────────────────────────────────── */

.plan-hero {
  background: var(--red-soft);
  border: 1px solid rgba(223,62,58,0.2);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}

.plan-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.plan-progress-lbl {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.plan-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}
.plan-step:active { opacity: 0.8; }
.plan-step.done { opacity: 0.5; }

.plan-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.plan-check.checked {
  background: var(--red);
  border-color: var(--red);
}

.plan-step-body { flex: 1; }

.plan-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.plan-step.done .plan-step-title { text-decoration: line-through; }

.plan-step-dur {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
}

/* ─── Settings Screen ───────────────────────────────────────────────────────── */

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

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.profile-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-plan {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.settings-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { background: var(--surface-2); }
.settings-row.accent:hover { background: rgba(239,68,68,0.04); }

.settings-row-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  flex-shrink: 0;
}
.settings-row-icon.accent {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

.settings-row-body { flex: 1; }

.settings-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.settings-row.accent .settings-row-label { color: #ef4444; }

.settings-row-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.app-version {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px 0;
}

/* ─── Add Task Sheet ────────────────────────────────────────────────────────── */

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fade-in 0.18s ease;
}

.sheet {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 20px 36px;
  animation: slide-up 0.28s cubic-bezier(0.16,1,0.3,1);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border);
  margin: 8px auto 18px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.sheet-input {
  width: 100%;
  height: 50px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.sheet-input::placeholder { color: var(--text-muted); font-weight: 400; }
.sheet-input:focus { border-color: var(--red); }

.sheet-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.course-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.course-chip {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.course-chip:hover { background: var(--surface-3); }
.course-chip.selected { font-weight: 800; }

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 16px;
}

.sheet-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.sheet-submit {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-red);
  transition: opacity 0.15s, transform 0.12s;
}
.sheet-submit:hover { opacity: 0.92; }
.sheet-submit:active { opacity: 0.85; transform: scale(0.98); }
.sheet-submit:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ─── Animations ────────────────────────────────────────────────────────────── */

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slide-from-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.96); }
}

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */

.screen-scroll::-webkit-scrollbar { display: none; }
.auth-screen::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ─── Auth v2 (Login/Signup redesign) ─────────────────────────────────────── */

.auth-v2 {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.auth-v2-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 52px 24px 0;
  margin-bottom: 32px;
}

.auth-v2-wordmark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.auth-v2-body {
  padding: 0 24px 40px;
  flex: 1;
}

.auth-v2-heading {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
  margin: 0 0 8px;
}

.auth-v2-heading .accent { color: var(--red); }

.auth-v2-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 24px;
  line-height: 1.55;
  font-weight: 500;
}

.auth-v2-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-v2-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.auth-v2-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-top: 14px;
}

.auth-v2-field {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  height: 52px;
  padding: 0 14px;
  gap: 10px;
  transition: border-color 0.15s;
  margin-bottom: 4px;
}
.auth-v2-field:focus-within { border-color: var(--red); }
.auth-v2-field.error { border-color: #ef4444; }

.auth-v2-input {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  height: 100%;
}
.auth-v2-input::placeholder { color: var(--text-muted); }

.auth-v2-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 20px;
}

.auth-v2-remember-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
}

.auth-v2-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.auth-v2-checkbox.checked {
  background: var(--red);
  border-color: var(--red);
}

.auth-v2-forgot {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
}

.auth-v2-btn {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-pill);
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: 8px;
  margin-bottom: 4px;
  box-shadow: var(--shadow-red);
  transition: opacity 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-v2-btn:active { opacity: 0.88; transform: scale(0.98); }
.auth-v2-btn:disabled { opacity: 0.6; }

.auth-v2-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.auth-v2-divider::before, .auth-v2-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-v2-divider span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-v2-social {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-v2-social-btn {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s;
}
.auth-v2-social-btn:hover { background: var(--surface-2); }
.auth-v2-social-btn:active { opacity: 0.85; }

.auth-v2-terms {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 16px;
}
.auth-v2-terms a { color: var(--text-soft); text-decoration: underline; }

.auth-v2-switch {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  margin-top: 4px;
  padding-bottom: 16px;
}
.auth-v2-switch button {
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
}

.auth-v2-strength {
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 6px;
  margin-bottom: 2px;
}
.auth-v2-strength-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: background 0.25s ease;
}
.auth-v2-strength-label {
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  margin-bottom: 10px;
}

.auth-v2-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}

.auth-v2-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.auth-v2-info {
  background: rgba(61,184,122,0.12);
  border: 1px solid rgba(61,184,122,0.25);
  color: #3db87a;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ─── Home Screen v2 ───────────────────────────────────── */

.dash-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 0 10px;
}

.dash-v2-greeting {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0 0 3px;
  line-height: 1.1;
}

.dash-v2-date {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

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

.dash-v2-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.dash-v2-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.dash-v2-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-v2-chip-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(245,158,11,0.15);
  color: #F59E0B;
  margin-left: 2px;
}

.dash-v2-deadline-card {
  background: #1C0A0A;
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.dash-v2-deadline-count {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.dash-v2-deadline-title {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-bottom: 4px;
}

.dash-v2-deadline-date {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.dash-v2-deadline-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-v2-task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  margin-bottom: 7px;
  transition: opacity 0.15s;
}
.dash-v2-task-row:active { opacity: 0.75; }
.dash-v2-task-row.done { opacity: 0.45; }

.dash-v2-task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.dash-v2-task-check.checked {
  background: var(--red);
  border-color: var(--red);
}

.dash-v2-task-body { flex: 1; min-width: 0; }

.dash-v2-task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-v2-task-row.done .dash-v2-task-title { text-decoration: line-through; }

.dash-v2-task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-v2-task-course {
  font-size: 11px;
  font-weight: 700;
}

.dash-v2-task-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.dash-v2-task-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
  flex-shrink: 0;
}
.dash-v2-task-badge.today {
  background: rgba(223,62,58,0.14);
  color: var(--red);
}
.dash-v2-task-badge.day {
  background: var(--surface-2);
  color: var(--text-muted);
}

.dash-v2-courses-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.dash-v2-courses-scroll::-webkit-scrollbar { display: none; }

.dash-v2-course-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  min-width: 80px;
  flex-shrink: 0;
}

.dash-v2-course-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
}

.dash-v2-course-tasks {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.dash-v2-course-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.dash-v2-course-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

.dash-v2-ai-banner {
  background: var(--red);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.dash-v2-ai-banner:active { opacity: 0.88; }

.dash-v2-ai-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dash-v2-ai-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  margin-bottom: 12px;
}

.dash-v2-ai-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  transition: background 0.15s;
}
.dash-v2-ai-cta:hover { background: rgba(255,255,255,0.28); }

.dash-v2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* ─── Focus Screen v2 ──────────────────────────────────── */

.focus-v2-header-wrap {
  background: #1C0A0A;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
}

.focus-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 16px;
}

.focus-v2-header-left {}

.focus-v2-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 3px;
}

.focus-v2-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

.focus-v2-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  overflow-y: auto;
}

.focus-v2-tabs {
  width: 100%;
  margin: 20px 0;
}

.focus-v2-timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding-bottom: 8px;
  gap: 6px;
}

.focus-v2-time {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.focus-v2-task-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

.focus-v2-session-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.focus-v2-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 28px 0 24px;
}

.focus-v2-ctrl-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.focus-v2-ctrl-btn:active { transform: scale(0.92); }
.focus-v2-ctrl-btn:hover { background: var(--surface-3); color: var(--text); }

.focus-v2-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-red);
  transition: transform 0.12s, box-shadow 0.12s;
}
.focus-v2-play-btn:active { transform: scale(0.93); }

.focus-v2-pomo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.focus-v2-pomo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.focus-v2-pomo-dot.done { background: var(--red); }

/* ─── Calendar Screen v2 ──────────────────────────────── */

.cal-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 0 2px;
}

.cal-v2-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0;
}

.cal-v2-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-v2-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 16px;
  margin-top: 2px;
}

.cal-v2-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-v2-month-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.cal-v2-week-strip {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 20px;
}

.cal-v2-day-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.cal-v2-day-letter {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-v2-day-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.12s, color 0.12s;
}
.cal-v2-day-num:hover { background: var(--surface-2); color: var(--text); }
.cal-v2-day-num.today { color: var(--red); font-weight: 800; }
.cal-v2-day-num.selected { background: var(--red); color: #fff; box-shadow: var(--shadow-red); }

.cal-v2-day-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cal-v2-today-badge {
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.cal-v2-day-full {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.cal-v2-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-v2-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cal-v2-event-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  width: 42px;
  flex-shrink: 0;
  padding-top: 13px;
  text-align: right;
  font-family: var(--font-mono);
}

.cal-v2-event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 17px;
}

.cal-v2-event-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left-width: 3px;
}

.cal-v2-event-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.cal-v2-event-loc {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Chat Screen v2 ───────────────────────────────────── */

.chat-v2-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-v2-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.chat-v2-header-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.chat-v2-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
  margin-top: 1px;
}

.chat-v2-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3DB87A;
  flex-shrink: 0;
}

.chat-v2-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-v2-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 8px;
}
.chat-v2-divider span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg);
  padding: 0 10px;
}
.chat-v2-divider::before, .chat-v2-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.chat-v2-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-v2-row.user {
  justify-content: flex-end;
}
.chat-v2-row.ai {
  justify-content: flex-start;
}

.chat-v2-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
}

.chat-v2-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.chat-v2-bubble.user {
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-v2-bubble.ai {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-v2-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
}
.chat-v2-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.chat-v2-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-v2-typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-v2-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-v2-input {
  flex: 1;
  height: 44px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s;
}
.chat-v2-input::placeholder { color: var(--text-muted); }
.chat-v2-input:focus { border-color: var(--red); outline: none; }

.chat-v2-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
  transition: opacity 0.15s, transform 0.12s;
}
.chat-v2-send:disabled { opacity: 0.45; box-shadow: none; }
.chat-v2-send:active:not(:disabled) { transform: scale(0.93); }

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