:root {
  --bg: #f5efe5;
  --surface: rgba(255, 251, 246, 0.84);
  --surface-strong: #fff9f1;
  --surface-dark: #1b2943;
  --text: #231c1a;
  --muted: #6d615b;
  --line: rgba(35, 28, 26, 0.1);
  --navy: #18355d;
  --blue: #5a82ff;
  --blue-soft: #dfe7ff;
  --teal: #42b8a2;
  --gold: #efb14d;
  --gold-soft: #fff0c8;
  --coral: #dc7563;
  --shadow: 0 28px 70px rgba(69, 47, 35, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(90, 130, 255, 0.2), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(66, 184, 162, 0.16), transparent 22%),
    radial-gradient(circle at 15% 85%, rgba(239, 177, 77, 0.14), transparent 18%),
    linear-gradient(180deg, #fff8ee 0%, var(--bg) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.75;
  pointer-events: none;
}

body::before {
  width: 300px;
  height: 300px;
  background: rgba(90, 130, 255, 0.13);
  top: 20px;
  left: -100px;
}

body::after {
  width: 260px;
  height: 260px;
  background: rgba(220, 117, 99, 0.12);
  right: -70px;
  bottom: 20px;
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 22px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.hero-copy::before,
.hero-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--gold));
}

.hero-copy {
  padding: 36px;
  background:
    linear-gradient(145deg, rgba(255, 251, 246, 0.98), rgba(247, 238, 228, 0.9)),
    var(--surface);
}

.hero-card,
.panel {
  padding: 24px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(250, 244, 236, 0.82));
}

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 30%),
    linear-gradient(145deg, rgba(24, 53, 93, 0.97), rgba(90, 130, 255, 0.86)),
    var(--surface-dark);
  box-shadow:
    0 28px 54px rgba(24, 53, 93, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.eyebrow,
.panel-kicker,
.hero-card-label,
.timer-label,
.stage-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 800;
}

.eyebrow,
.panel-kicker,
.stage-kicker {
  color: var(--muted);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
.hero-card h2,
.timer-display {
  font-family: "Fraunces", serif;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 0.98;
  max-width: 12ch;
  margin-bottom: 16px;
}

.hero-card h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.06;
  margin-bottom: 12px;
}

.hero-text {
  max-width: 620px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 22px;
}

.hero-card-label,
.hero-card p {
  color: rgba(255, 255, 255, 0.84);
}

.hero-actions,
.timer-actions,
.chat-actions,
.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.panel {
  grid-column: span 6;
}

.panel-wide {
  grid-column: span 12;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin-bottom: 0;
  font-size: 1.38rem;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(90, 130, 255, 0.18), rgba(223, 231, 255, 0.9));
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid rgba(90, 130, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.workspace-panel {
  padding-bottom: 28px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 18px;
}

.thread-sidebar,
.planner-sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.sidebar-block,
.upload-box,
.prompt-box,
.timer-card,
.step-card,
.task-item,
.plan-list li,
.chat-bubble,
.thread-card,
.calendar-card {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(35, 28, 26, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sidebar-block,
.upload-box,
.prompt-box,
.timer-card,
.step-card,
.thread-card,
.calendar-card {
  padding: 18px;
}

.sidebar-head,
.chat-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.sidebar-head h3,
.chat-stage-head h3 {
  margin-bottom: 0;
}

.account-kicker {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-block {
  background:
    radial-gradient(circle at top right, rgba(239, 177, 77, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(241, 246, 255, 0.88));
  border-color: rgba(239, 177, 77, 0.22);
  box-shadow:
    0 24px 44px rgba(24, 53, 93, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.premium-chip {
  background: linear-gradient(90deg, rgba(239, 177, 77, 0.22), rgba(255, 241, 200, 0.92));
  color: #7a5207;
  border: 1px solid rgba(239, 177, 77, 0.3);
}

.account-status-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(24, 53, 93, 0.08);
  display: grid;
  gap: 8px;
}

.pro-card {
  background:
    radial-gradient(circle at top right, rgba(239, 177, 77, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.92), rgba(242, 246, 255, 0.82));
  border-color: rgba(239, 177, 77, 0.22);
}

.pro-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pro-feature-chip {
  background: rgba(239, 177, 77, 0.18);
  color: #7a5207;
  border: 1px solid rgba(239, 177, 77, 0.28);
}

.thread-list,
.calendar-list,
.task-list {
  display: grid;
  gap: 12px;
}

.calendar-list {
  max-height: 760px;
  overflow: auto;
  padding-right: 6px;
}

.thread-folder {
  display: grid;
  gap: 10px;
}

.thread-folder-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(24, 53, 93, 0.06);
}

.thread-folder-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0;
  background: transparent;
  color: inherit;
}

.thread-folder-title {
  margin: 0;
  font-size: 0.92rem;
  color: var(--navy);
}

.thread-folder-count {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.thread-folder-body {
  display: grid;
  gap: 10px;
}

.thread-folder.collapsed .thread-folder-body {
  display: none;
}

.folder-chevron {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
}

.calendar-ask {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.calendar-month-label {
  margin-bottom: 0;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 320px;
  gap: 18px;
  align-items: start;
}

.calendar-filter-bar {
  margin: 6px 0 14px;
}

.calendar-filter-bar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.study-lab-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.worksheet-lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.study-zone {
  border-radius: 26px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(90, 130, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 241, 234, 0.84));
  border: 1px solid rgba(35, 28, 26, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.study-zone-copy {
  color: var(--muted);
  margin-bottom: 16px;
}

.flashcard-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.flashcard-shell {
  perspective: 1200px;
}

.flashcard {
  position: relative;
  min-height: 220px;
  border: 0;
  padding: 0;
  width: 100%;
  background: transparent;
  transform-style: preserve-3d;
  transition: transform 380ms ease;
}

.flashcard.is-flipped {
  transform: rotateY(180deg) translateY(-4px);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  backface-visibility: hidden;
  text-align: left;
  box-shadow: 0 24px 44px rgba(24, 53, 93, 0.14);
}

.flashcard-front {
  background:
    linear-gradient(150deg, rgba(24, 53, 93, 0.96), rgba(90, 130, 255, 0.88)),
    var(--navy);
  color: white;
}

.flashcard-back {
  background:
    linear-gradient(160deg, rgba(255, 249, 241, 0.98), rgba(237, 246, 255, 0.94)),
    var(--surface-strong);
  color: var(--text);
  transform: rotateY(180deg);
}

.flashcard-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.75;
}

.flashcard-text {
  font-size: 1.05rem;
  line-height: 1.55;
}

.flashcard-hint {
  font-size: 0.82rem;
  opacity: 0.78;
}

.quiz-zone {
  display: grid;
  gap: 14px;
}

.quiz-card {
  border-radius: 24px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 240, 231, 0.92));
  border: 1px solid rgba(35, 28, 26, 0.07);
  box-shadow: 0 20px 44px rgba(69, 47, 35, 0.1);
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.quiz-question {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 18px;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 53, 93, 0.07);
  color: var(--navy);
  border: 1px solid transparent;
}

.quiz-option:hover {
  box-shadow: 0 14px 26px rgba(24, 53, 93, 0.1);
}

.quiz-option.correct {
  background: rgba(66, 184, 162, 0.18);
  border-color: rgba(66, 184, 162, 0.35);
}

.quiz-option.wrong {
  background: rgba(220, 117, 99, 0.16);
  border-color: rgba(220, 117, 99, 0.32);
}

.quiz-option.reveal {
  border-color: rgba(24, 53, 93, 0.16);
}

.quiz-feedback {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 53, 93, 0.06);
  color: var(--muted);
  line-height: 1.55;
}

.quiz-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.calendar-board-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-board-main,
.calendar-board-side {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(35, 28, 26, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  padding: 18px;
}

.calendar-close-button {
  display: none;
}

.calendar-weekdays {
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.calendar-day {
  min-height: 82px;
  padding: 10px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(35, 28, 26, 0.06);
  display: grid;
  align-content: start;
  gap: 6px;
  cursor: pointer;
}

.calendar-day.drop-target {
  border-color: rgba(90, 130, 255, 0.5);
  box-shadow: inset 0 0 0 2px rgba(90, 130, 255, 0.18);
  background: rgba(232, 239, 255, 0.92);
}

.large-calendar-grid .calendar-day {
  min-height: 132px;
  padding: 12px 10px;
}

.large-calendar-grid .calendar-day-number {
  font-size: 0.88rem;
}

.large-calendar-grid .calendar-dot {
  font-size: 0.74rem;
  padding: 5px 8px;
}

.calendar-day.muted {
  opacity: 0.45;
}

.calendar-day.today {
  border-color: rgba(90, 130, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(90, 130, 255, 0.16);
}

.calendar-day-number {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--navy);
}

.calendar-dot-list {
  display: grid;
  gap: 4px;
}

.calendar-dot {
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.2;
  background: rgba(24, 53, 93, 0.08);
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-dot-deadline,
.calendar-chip-deadline,
.calendar-card-deadline {
  background: rgba(220, 117, 99, 0.14);
  color: #8e3c2e;
}

.calendar-dot-study,
.calendar-chip-study,
.calendar-card-study {
  background: rgba(90, 130, 255, 0.14);
  color: #274ca8;
}

.calendar-dot-class,
.calendar-chip-class,
.calendar-card-class {
  background: rgba(66, 184, 162, 0.15);
  color: #17685a;
}

.calendar-dot-exam,
.calendar-chip-exam,
.calendar-card-exam {
  background: rgba(239, 177, 77, 0.2);
  color: #8a5b0b;
}

.calendar-chip {
  border: 1px solid transparent;
}

.calendar-card {
  cursor: grab;
}

.calendar-card:active {
  cursor: grabbing;
}

.calendar-card-deadline {
  border-color: rgba(220, 117, 99, 0.2);
}

.calendar-card-study {
  border-color: rgba(90, 130, 255, 0.2);
}

.calendar-card-class {
  border-color: rgba(66, 184, 162, 0.2);
}

.calendar-card-exam {
  border-color: rgba(239, 177, 77, 0.24);
}

.thread-card {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.thread-card.active {
  border-color: rgba(90, 130, 255, 0.35);
  box-shadow: 0 16px 28px rgba(24, 53, 93, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.82));
}

.thread-card:hover,
.calendar-card:hover {
  transform: translateY(-1px);
}

.thread-card h4,
.calendar-card h4 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.thread-meta,
.calendar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.thread-preview,
.calendar-card p,
.prompt-output,
.timer-status,
.upload-meta,
.task-item.completed .task-text,
.upload-box p,
.prompt-box p {
  color: var(--muted);
  line-height: 1.55;
}

.coach-form,
.calendar-form,
.chat-form {
  display: grid;
  gap: 14px;
}

.chat-stage {
  display: grid;
  grid-template-rows: auto auto minmax(420px, 1fr) auto;
  gap: 16px;
}

.chat-top-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  align-items: stretch;
}

.chat-messages {
  min-height: 420px;
  max-height: 760px;
  overflow: auto;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(246, 239, 230, 0.92));
  border: 1px solid rgba(35, 28, 26, 0.07);
  display: grid;
  gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.chat-empty {
  align-self: center;
  justify-self: center;
  max-width: 440px;
  text-align: center;
  color: var(--muted);
}

.chat-bubble {
  padding: 16px 18px;
  max-width: min(88%, 760px);
  white-space: pre-wrap;
  line-height: 1.6;
}

.bubble-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-bubble.user {
  justify-self: end;
  color: white;
  background: linear-gradient(90deg, rgba(24, 53, 93, 0.97), rgba(90, 130, 255, 0.92));
}

.chat-bubble.assistant {
  justify-self: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 248, 255, 0.92));
  border: 1px solid rgba(90, 130, 255, 0.08);
}

.chat-bubble.system {
  justify-self: center;
  background: rgba(66, 184, 162, 0.12);
}

.bubble-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.chat-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quick-ai-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-status-text {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.auth-status-text strong {
  color: var(--navy);
}

.hidden {
  display: none !important;
}

.upload-box,
.prompt-box,
.composer-card {
  display: grid;
  gap: 12px;
}

.worksheet-zone {
  display: grid;
  gap: 12px;
  min-height: 180px;
}

#worksheetQuestionZone {
  max-height: 760px;
  overflow: auto;
  padding-right: 6px;
}

#programReflectionInput {
  width: 100%;
}

.worksheet-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(24, 53, 93, 0.08);
  display: grid;
  gap: 8px;
}

.compact-note {
  background: rgba(24, 53, 93, 0.06);
}

.worksheet-card h4,
.worksheet-card h5,
.worksheet-review-score {
  margin: 0;
  color: var(--navy);
}

.worksheet-card h5 {
  margin-top: 4px;
  font-size: 0.92rem;
}

.worksheet-card p,
.worksheet-card li {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.worksheet-card ul,
.worksheet-card ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.worksheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.worksheet-tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(24, 53, 93, 0.08);
  color: var(--navy);
}

.worksheet-card textarea,
#worksheetAnswerInput {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(24, 53, 93, 0.12);
  background: rgba(255, 255, 255, 0.85);
  padding: 14px 15px;
  font: inherit;
  color: var(--ink);
  resize: vertical;
}

.worksheet-score-chip {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(210, 127, 70, 0.15);
  color: #8b471b;
  font-weight: 800;
}

.export-box {
  align-content: start;
}

.export-actions {
  display: grid;
  gap: 10px;
}

.composer-card {
  align-content: start;
}

.composer-card textarea {
  min-height: 118px;
}

.worksheet-box {
  align-content: start;
}

.planner-sidebar {
  position: relative;
}

.calendar-zone {
  position: sticky;
  top: 18px;
  background:
    radial-gradient(circle at top right, rgba(90, 130, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(243, 247, 255, 0.8));
  border-color: rgba(90, 130, 255, 0.16);
  box-shadow:
    0 22px 48px rgba(24, 53, 93, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.calendar-expanded {
  overflow: hidden;
}

body.calendar-expanded .calendar-board-panel {
  position: fixed;
  inset: 24px;
  z-index: 35;
  overflow: auto;
  border-radius: 30px;
  box-shadow: 0 34px 90px rgba(24, 53, 93, 0.24);
}

body.calendar-expanded .calendar-board-grid {
  grid-template-columns: minmax(0, 1.9fr) 360px;
}

body.calendar-expanded .large-calendar-grid .calendar-day {
  min-height: 148px;
}

body.calendar-expanded .calendar-close-button {
  display: inline-flex;
}

.plan-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
}

.plan-list li {
  padding: 14px 16px;
}

.file-input,
input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea,
.file-input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.hero-button,
.primary-action,
.secondary-action,
.icon-button {
  border-radius: 16px;
  padding: 13px 17px;
  font-weight: 800;
}

.primary,
.primary-action {
  background: linear-gradient(90deg, var(--navy), var(--blue));
  color: white;
  box-shadow: 0 16px 28px rgba(24, 53, 93, 0.2);
}

.secondary,
.secondary-action,
.icon-button {
  background: rgba(24, 53, 93, 0.08);
  color: var(--navy);
  border: 1px solid rgba(24, 53, 93, 0.06);
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-button {
  padding: 10px 14px;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 16px;
}

.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.task-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-toggle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(90, 130, 255, 0.08);
  border: 2px solid rgba(90, 130, 255, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.task-item.completed .task-toggle {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.task-item.completed .task-text {
  text-decoration: line-through;
}

.timer-display {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  margin-bottom: 10px;
}

.timer-settings {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.timer-settings input {
  margin-top: 0;
  max-width: 140px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step-card span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(90, 130, 255, 0.12);
  color: var(--navy);
  font-weight: 800;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(24, 53, 93, 0.08);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 700;
}

.empty-state {
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(35, 28, 26, 0.14);
  color: var(--muted);
  text-align: center;
}

.upload-meta.warning {
  color: #9b5a12;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(24, 53, 93, 0.95);
  color: white;
  box-shadow: 0 18px 40px rgba(24, 53, 93, 0.24);
  transition: opacity 180ms ease, transform 180ms ease;
  max-width: min(calc(100vw - 24px), 760px);
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.timer-popup {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 53, 93, 0.28);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 60;
}

.timer-popup.visible {
  opacity: 1;
  pointer-events: auto;
}

.timer-popup-card {
  width: min(460px, 100%);
  padding: 26px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255, 250, 243, 0.98), rgba(238, 245, 255, 0.96));
  box-shadow: 0 28px 70px rgba(24, 53, 93, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.calendar-preview-card {
  width: min(640px, 100%);
}

.calendar-preview-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .hero,
  .dashboard,
  .steps-grid,
  .chat-tools,
  .chat-top-row,
  .worksheet-lab-grid,
  .study-lab-grid,
  .flashcard-deck {
    grid-template-columns: 1fr;
  }

  .calendar-board-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .panel-wide {
    grid-column: span 1;
  }

  .calendar-zone {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1400px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    border-radius: 24px;
    padding: 20px;
  }

  .task-form,
  .hero-actions,
  .timer-actions,
  .chat-actions,
  .stage-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel-header,
  .sidebar-head,
  .chat-stage-head,
  .task-item {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-ai-actions,
  .auth-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    width: calc(100vw - 20px);
    bottom: 18px;
    font-size: 0.92rem;
  }

  .chat-bubble {
    max-width: 100%;
  }
}
