/* StudyIT — Design system */
:root {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --bg-card: #1e2a3a;
  --border: #2d3d52;
  --text: #e6edf3;
  --text-muted: #8b9cb3;
  --accent: #e8a54b;
  --accent-dim: #c4923d;
  --accent-glow: rgba(232, 165, 75, 0.25);
  --success: #4ade80;
  --error: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.2s ease;
}

.technical-summary-result {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 245, 255, 0.98));
}

.technical-summary-header {
  align-items: flex-start;
}

.technical-summary-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tech-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.1rem 1rem;
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.07);
}

.tech-note {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(168, 85, 247, 0.06));
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.6;
}

.tech-concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.tech-concept-card,
.tech-example-card,
.tech-reference-card,
.tech-callout-card {
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(76, 29, 149, 0.05);
}

.tech-concept-card h4,
.tech-example-card h4,
.tech-reference-card h4 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  color: #4c1d95;
}

.tech-concept-card p,
.tech-example-card p,
.tech-callout-card p {
  margin: 0;
  line-height: 1.65;
}

.technical-summary-result {
  display: grid;
  gap: 1.5rem;
}

.technical-summary-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.12);
}

.technical-summary-body {
  display: grid;
  gap: 1.4rem;
}

.tech-section {
  display: grid;
  gap: 0.9rem;
}

.tech-note {
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.05), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.tech-table-wrap {
  overflow-x: auto;
}

.tech-table {
  table-layout: fixed;
}

.tech-table th {
  white-space: nowrap;
}

.tech-table th:nth-child(1),
.tech-table td:nth-child(1) {
  width: 22%;
}

.tech-table th:nth-child(2),
.tech-table td:nth-child(2) {
  width: 25%;
}

.tech-table th:nth-child(3),
.tech-table td:nth-child(3) {
  width: 14%;
}

.tech-table th:nth-child(4),
.tech-table td:nth-child(4) {
  width: 39%;
}

.tech-table td {
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tech-example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.tech-callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.tech-callout-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 255, 0.94));
}

.tech-callout-warn {
  border-color: rgba(245, 158, 11, 0.24);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.94));
}

.tech-callout-connect {
  border-color: rgba(59, 130, 246, 0.18);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(245, 243, 255, 0.94));
}

.tech-problem,
.tech-answer,
.tech-insight {
  margin-top: 0.75rem !important;
}

.tech-steps,
.tech-mechanism-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  line-height: 1.6;
}

.tech-mechanism-list li {
  display: grid;
  gap: 0.2rem;
}

.tech-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.tech-reference-list,
.tech-reference-card ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: block;
}

.logo:hover {
  color: var(--text);
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  flex: 1;
}

.btn-logout {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Main */
.main {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* Views */
.view {
  display: none;
}

.view.view-active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Home */
#view-home.view-active {
  display: block;
}

.home-layout-toolbar {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(26, 35, 50, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.home-layout-toolbar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.home-layout-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.home-widget {
  --widget-span: 12;
  grid-column: span var(--widget-span);
  min-width: 0;
}

.home-widget-content {
  min-width: 0;
}

.home-widget-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px dashed rgba(232, 165, 75, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(232, 165, 75, 0.08);
}

.home-widget-handle {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: grab;
}

.home-widget-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.home-widget-resizer {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(232, 165, 75, 0.35);
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(232, 165, 75, 0.7) 48% 54%, transparent 54% 100%),
    linear-gradient(135deg, transparent 0 62%, rgba(232, 165, 75, 0.5) 62% 68%, transparent 68% 100%),
    rgba(18, 24, 35, 0.55);
  cursor: ew-resize;
  touch-action: none;
  flex: 0 0 auto;
}

#view-home.layout-editing .home-layout-toolbar {
  display: flex !important;
}

#view-home.layout-editing .home-widget-controls {
  display: flex;
}

#view-home.layout-editing .home-widget {
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(232, 165, 75, 0.35);
  background: rgba(255, 255, 255, 0.01);
}

#view-home.layout-editing .home-widget.dragging {
  opacity: 0.55;
}

#view-home.layout-editing .home-widget.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.hero p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.today-panel {
  margin-top: 0;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(30, 42, 58, 0.96), rgba(20, 27, 39, 0.92));
  box-shadow: var(--shadow);
  position: static;
}

.today-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.today-panel-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.today-panel h2 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.35rem;
}

.today-panel-header p {
  margin: 0;
  color: var(--text-muted);
}

/* Today's Tasks Progress Bar */
.today-progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.today-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.today-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.today-progress-fill.complete {
  background: linear-gradient(90deg, var(--success), #22c55e);
}

.today-progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.today-tasks-list {
  max-height: none;
  overflow: visible;
}

@media (max-width: 960px) {
  #view-home.view-active {
    display: block;
  }

  .home-layout-grid {
    gap: 1rem;
  }

  .today-panel {
    margin-top: 2rem;
    position: static;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.card p {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--bg);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

/* Scheduler flow */
.flow-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.25rem 0;
}

.back:hover {
  color: var(--accent);
}

.steps {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-elevated);
}

.step.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.scheduler-step {
  display: none;
}

.scheduler-step.step-active {
  display: block;
}

.scheduler-step h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.scheduler-step .hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Form */
.form-dates {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 760px;
}

.form-dates label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-dates input {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.form-dates input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.availability-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(26, 35, 50, 0.55);
  padding: 1rem;
}

.availability-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.availability-header p {
  margin: 0.35rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.weekly-availability {
  display: grid;
  gap: 0.75rem;
}

.availability-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) 90px;
  gap: 0.75rem;
  align-items: center;
}

.availability-row span {
  color: var(--text);
  font-weight: 500;
}

.availability-row input[type="time"] {
  font-family: var(--font-mono);
}

.availability-total {
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
}

.availability-summary {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Subject blocks */
#subjects-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.subject-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.subject-block h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.subject-block .row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.subject-block input[type="text"],
.subject-block input[type="number"] {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  min-width: 120px;
}

.subject-block input:focus {
  outline: none;
  border-color: var(--accent);
}

.chapter-source {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chapter-source button {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}

.chapters-list {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.chapters-empty {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 20, 25, 0.35);
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.chapter-item:last-child {
  border-bottom: none;
}

.chapter-name-input {
  flex: 1;
  min-width: 220px;
}

.chapter-difficulty-select {
  min-width: 110px;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.chapter-item .diff-label {
  min-width: 4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-remove-chapter {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-add-chapter-inline {
  margin-top: 0.75rem;
}

.upload-inline {
  margin-top: 0.5rem;
}

.upload-inline input[type="file"] {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Schedule output */
.schedule-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.timeline-shell {
  padding: 1.25rem;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.timeline-days {
  display: grid;
  gap: 1rem;
}

.timeline-day {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(20, 27, 39, 0.8);
  padding: 1rem;
  cursor: pointer;
}

.timeline-day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.timeline-day-header h3 {
  margin: 0;
  color: var(--text);
}

.timeline-day-header p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-task-list {
  display: grid;
  gap: 0.65rem;
}

.timeline-task {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 22, 0.45);
  padding: 0.8rem 0.9rem;
}

.timeline-task.break-task {
  background: rgba(232, 165, 75, 0.08);
}

.timeline-time {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
}

.timeline-task-title {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.timeline-task-meta {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-empty {
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}

.calendar-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(232, 165, 75, 0.08), rgba(0, 0, 0, 0));
}

.calendar-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.calendar-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.calendar-chip {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(26, 35, 50, 0.6);
  color: var(--text-muted);
  white-space: nowrap;
}

.calendar-chip strong {
  color: var(--accent);
  font-weight: 600;
}

.calendar-month {
  padding: 1.1rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.calendar-month:last-child {
  border-bottom: none;
}

.calendar-month-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.02em;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.calendar-weekday {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.35rem 0;
}

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

.calendar-cell {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(26, 35, 50, 0.55);
  min-height: 132px;
  padding: 0.6rem 0.6rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color var(--transition), background var(--transition);
}

.calendar-cell:hover {
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(30, 42, 58, 0.7);
}

.calendar-cell-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-cell-out {
  opacity: 0.35;
}

.calendar-cell-has {
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.calendar-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.calendar-daynum {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.calendar-total {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.calendar-bar {
  height: 6px;
  background: rgba(45, 61, 82, 0.6);
  border-radius: 999px;
  overflow: hidden;
}

.calendar-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(232, 165, 75, 0.8), rgba(232, 165, 75, 0.35));
  border-radius: 999px;
}

.calendar-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.calendar-item {
  border: 1px solid rgba(45, 61, 82, 0.6);
  background: rgba(15, 20, 25, 0.25);
  border-radius: 9px;
  padding: 0.35rem 0.45rem;
}

.calendar-item-title {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.calendar-item-sub {
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.calendar-more {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.1rem 0.2rem;
}

@media (max-width: 900px) {
  .calendar-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .calendar-weekdays {
    gap: 0.35rem;
  }
  .calendar-grid {
    gap: 0.35rem;
  }
  .calendar-cell {
    min-height: 120px;
  }

  .header {
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Learning Tools */
.tools-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: stretch;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: radial-gradient(circle at top left, rgba(232, 165, 75, 0.12), transparent 55%), var(--bg-card);
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .tools-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .tools-actions {
    padding-top: 0;
  }

  .summary-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-actions .status {
    text-align: left;
  }

  .library-card {
    flex-direction: column;
  }

  .library-card-actions {
    flex-direction: row;
  }
}

.tools-input label,
.tools-output label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.input-options {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.tab {
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.tab.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

#lesson-text {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  resize: vertical;
  min-height: 160px;
}

#lesson-text:focus {
  outline: none;
  border-color: var(--accent);
}

.upload-zone {
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(15, 20, 25, 0.5);
}

.upload-zone.hidden {
  display: none;
}

.upload-zone input[type="file"] {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.youtube-zone {
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(15, 20, 25, 0.5);
}

.youtube-zone.hidden {
  display: none;
}

.youtube-zone input[type="url"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.youtube-zone input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.youtube-zone .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.tools-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 4.95rem;
}

.summary-format {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.summary-format label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.summary-format select {
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.summary-format select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.tools-actions .btn {
  width: 100%;
  justify-content: flex-start;
  gap: 0.4rem;
}

.quiz-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quiz-controls #quiz-count {
  width: 3.25rem;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.quiz-controls #quiz-count:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.quiz-insights-panel {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.3rem;
  padding: 1rem;
  border: 1px solid rgba(122, 87, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
}

.quiz-insights-header {
  display: grid;
  gap: 0.35rem;
}

.quiz-insights-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

#quiz-topic-recommendation {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.quiz-history-list {
  display: grid;
  gap: 0.65rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.quiz-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(122, 87, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.quiz-history-copy {
  min-width: 0;
}

.quiz-history-copy h4 {
  margin: 0 0 0.2rem;
  font-size: 0.94rem;
  color: var(--text);
}

.quiz-history-copy p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quiz-history-score {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-dim);
}

.quiz-history-empty {
  padding: 0.9rem 1rem;
  border: 1px dashed rgba(122, 87, 255, 0.18);
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.68);
}

.summary-result {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(232, 165, 75, 0.15);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary-body p {
  margin: 0 0 0.6rem 0;
}

.summary-body p:last-child {
  margin-bottom: 0;
}

.summary-page {
  background: radial-gradient(circle at top left, rgba(232, 165, 75, 0.1), transparent 55%), var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  max-width: 980px;
  margin: 0 auto;
}

.summary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.summary-actions .status {
  margin: 0;
  text-align: center;
  flex-basis: 100%;
}

.summary-content {
  max-width: 720px;
  margin: 0 auto;
}

.summary-heading-main {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.summary-heading {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 1rem 0 0.35rem 0;
  color: var(--accent);
}

.summary-list {
  margin: 0.15rem 0 0.6rem 0;
  padding-left: 1.2rem;
  list-style: none;
}

.summary-list li {
  position: relative;
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  color: var(--text);
}

.summary-list li::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.25);
}

.summary-paragraph {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Enhanced PDF-style summary components */
.summary-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid rgba(232, 165, 75, 0.3);
  margin-top: 1.25rem !important;
  margin-bottom: 0.75rem !important;
}

.summary-section-header:first-child {
  margin-top: 0 !important;
}

.summary-emoji {
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
}

.summary-body strong {
  color: var(--accent);
  font-weight: 700;
}

.summary-body em {
  font-style: italic;
  color: var(--text);
}

.summary-body code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(232, 165, 75, 0.1);
  color: var(--accent);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  word-break: break-word;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.95rem;
}

.summary-table thead {
  background: rgba(232, 165, 75, 0.1);
}

.summary-table th {
  padding: 0.75rem 0.9rem;
  text-align: left;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 2px solid rgba(232, 165, 75, 0.3);
}

.summary-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.summary-table tr:last-child td {
  border-bottom: none;
}

.summary-table tbody tr:hover {
  background: rgba(232, 165, 75, 0.05);
}

@media print {
  .summary-page.pdf-export-page {
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

.pdf-exporting .summary-actions,
.pdf-exporting .summary-page {
  box-shadow: none !important;
}

.pdf-export-capture {
  position: absolute;
  left: 0;
  top: 0;
  width: 980px;
  opacity: 1;
  pointer-events: none;
  z-index: 1;
  background: #ffffff;
}

.pdf-export-capture .summary-actions,
.pdf-export-capture .summary-page {
  box-shadow: none !important;
  border: 0 !important;
  background: #ffffff !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pdf-export-capture .summary-content {
  max-width: none !important;
  margin: 0 !important;
}

.pdf-export-capture .pdf-avoid-break {
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.pdf-export-capture .pdf-allow-break {
  break-inside: auto;
  page-break-inside: auto;
}

.pdf-export-capture .pdf-linearize {
  grid-template-columns: 1fr !important;
}

.pdf-export-capture .tech-table.pdf-compact-table {
  font-size: 0.84rem;
}

.pdf-export-capture .tech-table.pdf-compact-table th {
  white-space: normal;
  font-size: 0.82rem;
}

.pdf-export-capture .tech-table.pdf-compact-table th,
.pdf-export-capture .tech-table.pdf-compact-table td {
  padding: 0.45rem 0.55rem;
}

.doubts-panel {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.doubts-panel.hidden {
  display: none;
}

.doubts-panel input {
  flex: 1;
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.doubts-panel input:focus {
  outline: none;
  border-color: var(--accent);
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

/* Quiz Interface */
.quiz-interface {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.quiz-progress {
  margin-bottom: 2rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

#quiz-question-counter {
  font-weight: 600;
}

#quiz-score {
  font-weight: 600;
  color: var(--accent);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.quiz-main {
  margin-top: 2rem;
}

.quiz-question-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
  line-height: 1.6;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateX(4px);
}

.quiz-option:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.1);
  color: var(--success);
}

.quiz-option.wrong {
  border-color: var(--error);
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
}

.quiz-feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.quiz-feedback.hidden {
  display: none;
}

.quiz-explanation {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.quiz-result-panel {
  text-align: center;
}

.quiz-result-panel h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.quiz-result-panel .score-display {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.quiz-result-panel .score-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.quiz-result-panel .btn {
  margin-top: 1rem;
}

.status.success {
  color: var(--success);
}

/* Quiz styles */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s;
}

.quiz-option:hover:not(:disabled) {
  background: var(--border);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.quiz-option.wrong {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.quiz-explanation {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.file-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.05));
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.file-preview-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  flex-shrink: 0;
  animation: slideIn 0.3s ease;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.preview-filename {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.preview-size {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.preview-replace {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-replace {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.file-preview.hidden {
  display: none;
}

.library-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.library-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.library-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.library-section-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1.15rem;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.library-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.library-card-body {
  min-width: 0;
}

.library-card-body h4 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 1rem;
}

.library-card-body p {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  word-break: break-word;
}

.library-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.library-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.library-empty {
  margin: 0;
  color: var(--text-muted);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden {
  display: none !important;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(2px);
}

.confirm-modal-card {
  position: relative;
  width: min(92vw, 420px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.confirm-modal-card h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.confirm-modal-card p {
  margin: 0;
  color: var(--text-muted);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.day-plan-modal-card {
  width: min(92vw, 760px);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.day-plan-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.day-plan-modal-header p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.day-plan-modal-list {
  display: grid;
  gap: 0.75rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.day-plan-task {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(20, 27, 39, 0.78);
  padding: 0.9rem;
}

.day-plan-task.completed {
  opacity: 0.72;
}

.day-plan-task-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.day-plan-task-title {
  margin: 0;
  color: var(--text);
}

.day-plan-task-time {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
}

.day-plan-task-meta {
  margin: 0.35rem 0 0.75rem;
  color: var(--text-muted);
}

.day-plan-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.day-plan-task-actions .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.day-plan-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .availability-row,
  .timeline-task,
  .timeline-day-header,
  .day-plan-modal-header,
  .day-plan-task-top {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

/* Footer */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer p {
  margin: 0;
}

/* Loading */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 2026 refresh: light modern purple theme */
:root {
  --bg: #f6f3ff;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(122, 87, 255, 0.16);
  --text: #24183d;
  --text-muted: #73688f;
  --accent: #7b5cff;
  --accent-dim: #5f3ff2;
  --accent-glow: rgba(123, 92, 255, 0.2);
  --success: #16a34a;
  --error: #dc2626;
  --shadow: 0 24px 60px rgba(86, 58, 176, 0.12);
}

body {
  background:
    radial-gradient(circle at top left, rgba(162, 134, 255, 0.24), transparent 34%),
    radial-gradient(circle at top right, rgba(118, 83, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #fcfbff 0%, #f6f2ff 55%, #f1ebff 100%);
  color: var(--text);
}

.app {
  max-width: 1280px;
  padding: 0 1.75rem;
}

.header {
  padding: 1.7rem 0 1.35rem;
  border-bottom: 1px solid rgba(122, 87, 255, 0.12);
}

.logo {
  color: var(--accent-dim);
}

.logo:hover {
  color: #3d245f;
}

.logo-mark {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 12px 20px rgba(123, 92, 255, 0.16));
}

.tagline {
  color: #766b8f;
}

.hero {
  margin-bottom: 2rem;
  padding: 2rem 0 0.5rem;
}

.hero h1 {
  color: #24183d;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  line-height: 1.03;
}

.hero p {
  max-width: 620px;
  color: #6b607f;
  font-size: 1.08rem;
}

.cards {
  gap: 1.25rem;
}

.card,
.today-panel,
.scheduler-step,
.tools-layout,
.summary-page,
.quiz-interface,
.library-section,
.subject-block,
.schedule-output,
.confirm-modal-card {
  border: 1px solid rgba(122, 87, 255, 0.14);
  box-shadow: 0 22px 50px rgba(96, 65, 191, 0.09);
}

.card,
.today-panel,
.summary-page,
.quiz-interface,
.library-section,
.subject-block,
.schedule-output,
.tools-layout,
.confirm-modal-card,
.availability-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 244, 255, 0.96));
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1.9rem;
}

.card::before,
.today-panel::before,
.summary-page::before,
.quiz-interface::before,
.library-section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #9a7bff 0%, #7b5cff 45%, #c15dff 100%);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 92, 255, 0.24);
  box-shadow: 0 28px 60px rgba(101, 69, 198, 0.14);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.16), rgba(203, 143, 255, 0.18));
  color: var(--accent-dim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.today-panel,
.library-section,
.summary-page,
.quiz-interface {
  position: relative;
}

.today-panel-label,
.summary-pill,
.app-dialog-eyebrow {
  color: var(--accent-dim);
}

.btn {
  border-radius: 14px;
  font-weight: 600;
  padding: 0.72rem 1.25rem;
  box-shadow: 0 10px 24px rgba(102, 73, 192, 0.08);
}

.btn-primary,
.btn-logout,
.tab.active,
.progress-fill,
.today-progress-fill {
  color: #ffffff;
  border: none;
  background: linear-gradient(135deg, #9c7cff 0%, #7b5cff 48%, #b55cff 100%);
}

.btn-primary:hover,
.btn-logout:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #8f6dff 0%, #6946ff 48%, #a84dff 100%);
  box-shadow: 0 18px 32px rgba(107, 73, 230, 0.2);
}

.btn-secondary,
.tab,
.back {
  border: 1px solid rgba(122, 87, 255, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: #3b2e57;
}

.btn-secondary:hover,
.tab:hover,
.back:hover {
  background: rgba(123, 92, 255, 0.08);
  color: var(--accent-dim);
  border-color: rgba(122, 87, 255, 0.22);
}

.back {
  padding: 0.65rem 1rem;
  border-radius: 999px;
}

.flow-header,
.library-section-header,
.today-panel-header,
.summary-actions {
  align-items: center;
}

.step {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(122, 87, 255, 0.1);
  color: #7b7190;
}

.step.active {
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.14), rgba(193, 93, 255, 0.15));
  color: var(--accent-dim);
  border-color: rgba(122, 87, 255, 0.16);
}

.form-dates input,
.subject-block input[type="text"],
.subject-block input[type="number"],
.chapter-difficulty-select,
.youtube-zone input[type="url"],
.summary-format select,
.quiz-controls #quiz-count,
.doubts-panel input,
#lesson-text,
.app-dialog-field input {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border: 1px solid rgba(122, 87, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.form-dates input:focus,
.subject-block input:focus,
.chapter-difficulty-select:focus,
.youtube-zone input:focus,
.summary-format select:focus,
.quiz-controls #quiz-count:focus,
.doubts-panel input:focus,
#lesson-text:focus,
.app-dialog-field input:focus {
  outline: none;
  border-color: rgba(123, 92, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.12);
}

.availability-panel,
.upload-zone,
.youtube-zone,
.timeline-day,
.timeline-task,
.day-plan-task,
.library-card,
.quiz-feedback,
.calendar-item,
.calendar-cell,
.home-layout-toolbar,
#view-home.layout-editing .home-widget {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(122, 87, 255, 0.14);
  backdrop-filter: blur(12px);
}

.availability-row,
.chapters-empty,
.calendar-chip,
.timeline-day-header,
.manual-chapter-item,
.subject-upload-row {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(122, 87, 255, 0.14);
}

.availability-row,
.chapters-empty,
.manual-chapter-item,
.subject-upload-row {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.calendar-chip {
  color: #5d5177;
}

.timeline-task.break-task,
.calendar-cell-has,
.summary-table thead,
.summary-body code {
  background: rgba(123, 92, 255, 0.08);
}

.timeline-time,
.day-plan-task-time,
#quiz-score,
.summary-heading,
.library-section-header h3,
.subject-block h3,
.calendar-month-header h3,
.calendar-daynum {
  color: var(--accent-dim);
}

.progress-bar,
.today-progress-bar,
.calendar-bar {
  background: rgba(123, 92, 255, 0.08);
  border-color: rgba(122, 87, 255, 0.12);
}

.progress-fill,
.today-progress-fill,
.calendar-bar-fill {
  background: linear-gradient(90deg, #a27aff 0%, #7b5cff 50%, #bb5dff 100%);
}

.today-progress-fill.complete {
  background: linear-gradient(90deg, #34d399, #16a34a);
}

.confirm-modal-backdrop {
  background: rgba(81, 52, 157, 0.2);
  backdrop-filter: blur(12px);
}

.confirm-modal-card {
  width: min(92vw, 480px);
}

.app-dialog-card {
  width: min(92vw, 520px);
}

.app-dialog-header {
  margin-bottom: 1rem;
}

.app-dialog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  background: rgba(123, 92, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-dialog-form {
  margin-top: 1rem;
}

.app-dialog-fields {
  display: grid;
  gap: 0.9rem;
}

.quiz-topic-modal-card {
  width: min(560px, calc(100vw - 2rem));
}

.topic-selection-name-wrap {
  margin-top: 0.85rem;
}

.topic-selection-name-field {
  display: grid;
  gap: 0.4rem;
}

.topic-selection-name-field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.topic-selection-name-field input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(122, 87, 255, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.topic-selection-name-field input:focus {
  outline: none;
  border-color: rgba(123, 92, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.12);
}

.quiz-topic-list {
  display: grid;
  gap: 0.75rem;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.quiz-topic-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
}

.quiz-topic-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.quiz-topic-item span {
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

.quiz-topic-footer {
  min-height: 1.4rem;
  margin-top: 0.9rem;
}

.quiz-topic-error {
  color: #d14343;
  font-size: 0.92rem;
  font-weight: 600;
}

.app-dialog-field {
  display: grid;
  gap: 0.38rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.app-dialog-field span {
  font-weight: 600;
  color: #5f5477;
}

.app-dialog-field input {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  font-family: var(--font);
}

.app-toast-region {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 1100;
  display: grid;
  gap: 0.7rem;
}

.app-toast {
  min-width: 260px;
  max-width: 360px;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(76, 48, 145, 0.22);
  animation: fadeIn 0.18s ease;
}

.app-toast-info {
  background: linear-gradient(135deg, #8f6dff, #6f50f7);
}

.app-toast-success {
  background: linear-gradient(135deg, #7e5eff, #a74bff);
}

.app-toast-error {
  background: linear-gradient(135deg, #f97316, #dc2626);
}

.volie-ui-open {
  overflow: hidden;
}

.volie-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  min-width: 232px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(232, 165, 75, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(21, 28, 39, 0.96), rgba(15, 20, 29, 0.98)),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  color: #f8fbff;
  box-shadow:
    0 24px 60px rgba(5, 10, 20, 0.42),
    0 0 0 1px rgba(255,255,255,0.03) inset;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(22px);
  transition:
    transform 0.28s cubic-bezier(.2,.8,.2,1),
    box-shadow 0.28s ease,
    border-color 0.24s ease;
}

.volie-toggle:hover {
  transform: translateY(-5px);
  box-shadow:
    0 32px 72px rgba(5, 10, 20, 0.5),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  border-color: rgba(232, 165, 75, 0.28);
}

.volie-toggle:active {
  transform: translateY(-1px) scale(0.985);
}

.volie-toggle-orbit {
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(circle at 25% 30%, rgba(89, 213, 196, 0.22), transparent 28%),
    radial-gradient(circle at 72% 70%, rgba(232, 165, 75, 0.24), transparent 30%);
  animation: volieOrbit 10s linear infinite;
  z-index: -1;
}

.volie-toggle-mark {
  width: 2.85rem;
  height: 2.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #f4b45c, #4dc8bb);
  color: #11202b;
  font-size: 1.22rem;
  box-shadow: 0 16px 34px rgba(77, 200, 187, 0.22);
}

.volie-toggle-copy {
  display: grid;
  text-align: left;
  line-height: 1.08;
}

.volie-toggle-copy strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.volie-toggle-copy span {
  margin-top: 0.18rem;
  font-size: 0.8rem;
  color: rgba(232, 239, 247, 0.68);
}

.volie-toggle-hint {
  align-self: center;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.volie-scrim {
  position: fixed;
  inset: 0;
  z-index: 1088;
  background:
    radial-gradient(circle at top, rgba(77, 200, 187, 0.12), transparent 34%),
    rgba(7, 10, 16, 0.52);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.volie-scrim.hidden {
  display: block;
}

.volie-scrim.volie-open {
  opacity: 1;
  pointer-events: auto;
}

.volie-panel {
  position: fixed;
  inset: 2rem;
  z-index: 1090;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(13, 18, 26, 0.98), rgba(12, 18, 25, 0.96)),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  box-shadow:
    0 48px 120px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255,255,255,0.03) inset;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.24s ease,
    transform 0.32s cubic-bezier(.2,.8,.2,1),
    visibility 0s linear 0.32s;
}

.volie-panel.hidden {
  display: grid;
}

.volie-panel.volie-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.24s ease,
    transform 0.34s cubic-bezier(.2,.8,.2,1),
    visibility 0s linear 0s;
}

.volie-panel-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(232, 165, 75, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(77, 200, 187, 0.12), transparent 22%);
}

.volie-panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.45rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
}

.volie-header-copy {
  min-width: 0;
}

.volie-eyebrow {
  margin-bottom: 0.38rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 165, 75, 0.82);
}

.volie-panel-header h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: #f5f9ff;
  font-size: 1.55rem;
}

.volie-header-mark {
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(232, 165, 75, 0.22), rgba(77, 200, 187, 0.18));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.volie-panel-header p {
  margin: 0.4rem 0 0;
  max-width: 42rem;
  color: rgba(230, 237, 243, 0.68);
}

.volie-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.volie-panel .btn,
.volie-panel .volie-header-chip,
.volie-panel .volie-suggestion-card,
.volie-panel .volie-chat-delete {
  -webkit-tap-highlight-color: transparent;
}

.volie-panel .btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.volie-panel .btn-primary {
  background: linear-gradient(135deg, #f0ad59, #49c8bb);
  color: #10212d;
}

.volie-panel .btn-primary:hover {
  background: linear-gradient(135deg, #f4b867, #58d5c4);
  color: #10212d;
}

.volie-panel .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #eef4fb;
  border-color: rgba(255, 255, 255, 0.1);
}

.volie-panel .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.16);
}

.volie-header-chip {
  display: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0.62rem 0.88rem;
  background: rgba(255,255,255,0.04);
  color: #eff5fb;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.volie-panel-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
}

.volie-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    radial-gradient(circle at top left, rgba(232, 165, 75, 0.08), transparent 40%);
}

.volie-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.volie-sidebar-label {
  color: #f7fbff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.volie-account-note {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  color: rgba(230, 237, 243, 0.68);
  font-size: 0.83rem;
  line-height: 1.55;
}

.volie-chat-list {
  display: grid;
  gap: 0.72rem;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.15rem;
}

.volie-chat-empty {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  color: rgba(230, 237, 243, 0.62);
  font-size: 0.9rem;
  line-height: 1.5;
}

.volie-chat-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.52rem;
}

.volie-chat-select {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 0.82rem;
  background: rgba(255,255,255,0.045);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.volie-chat-item:hover .volie-chat-select {
  transform: translateY(-1px);
  border-color: rgba(77, 200, 187, 0.18);
  background: rgba(255,255,255,0.06);
}

.volie-chat-item.active .volie-chat-select {
  border-color: rgba(232, 165, 75, 0.24);
  background: linear-gradient(135deg, rgba(232, 165, 75, 0.12), rgba(255,255,255,0.06));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.volie-chat-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(77, 200, 187, 0.85), rgba(232, 165, 75, 0.88));
  color: #12202b;
  font-size: 0.82rem;
  font-weight: 800;
}

.volie-chat-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.volie-chat-copy strong {
  color: #f7fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.volie-chat-copy span {
  color: rgba(230, 237, 243, 0.58);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.volie-chat-time {
  color: rgba(230, 237, 243, 0.46);
  font-size: 0.72rem;
  white-space: nowrap;
}

.volie-chat-delete {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  color: rgba(230, 237, 243, 0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.volie-chat-delete:hover {
  transform: scale(1.06);
  background: rgba(248, 113, 113, 0.12);
  color: #ffc4c4;
}

.volie-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  background:
    radial-gradient(circle at top center, rgba(77, 200, 187, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.02));
}

.volie-main-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0.75rem;
}

.volie-presence {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(230, 237, 243, 0.76);
  font-size: 0.84rem;
  font-weight: 600;
}

.volie-presence-dot {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  background: #58d5c4;
  box-shadow: 0 0 0 6px rgba(88, 213, 196, 0.12);
}

.volie-context-pill {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: rgba(230, 237, 243, 0.58);
  font-size: 0.76rem;
}

.volie-message-list {
  overflow-y: auto;
  padding: 0.55rem 1.25rem 1.25rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.volie-message-list::-webkit-scrollbar,
.volie-chat-list::-webkit-scrollbar {
  width: 10px;
}

.volie-message-list::-webkit-scrollbar-track,
.volie-chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.volie-message-list::-webkit-scrollbar-thumb,
.volie-chat-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.volie-empty-state {
  display: grid;
  gap: 1.2rem;
  padding: 1.6rem;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025)),
    radial-gradient(circle at top right, rgba(232, 165, 75, 0.12), transparent 32%);
  color: rgba(230, 237, 243, 0.72);
  animation: volieFadeIn 0.36s ease;
}

.volie-empty-hero {
  max-width: 44rem;
}

.volie-empty-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.36rem 0.68rem;
  border-radius: 999px;
  background: rgba(232, 165, 75, 0.14);
  color: #ffd9a0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.volie-empty-state h4 {
  margin: 0.9rem 0 0.4rem;
  color: #f7fbff;
  font-size: clamp(1.4rem, 2vw, 2.15rem);
}

.volie-empty-state p {
  margin: 0;
  line-height: 1.7;
}

.volie-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.volie-suggestion-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background: rgba(255,255,255,0.045);
  color: #eff5fb;
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.volie-suggestion-card:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 200, 187, 0.24);
  background: rgba(255,255,255,0.06);
}

.volie-suggestion-card strong {
  font-size: 0.96rem;
}

.volie-suggestion-card span {
  color: rgba(230, 237, 243, 0.62);
  font-size: 0.84rem;
  line-height: 1.5;
}

.volie-message {
  width: fit-content;
  max-width: min(760px, 74%);
  padding: 0.22rem 0.95rem;
  border-radius: 22px;
  line-height: 1.4;
  word-break: break-word;
  font-size: 1rem;
  transform: translateY(10px);
  opacity: 0;
  animation: volieMessageIn 0.28s cubic-bezier(.2,.8,.2,1) forwards;
}

.volie-message.user {
  justify-self: end;
  background: linear-gradient(135deg, #f0ad59, #49c8bb);
  color: #10212d;
  box-shadow: 0 18px 36px rgba(77, 200, 187, 0.18);
}

.volie-message.assistant {
  justify-self: start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #eef4fb;
}

.volie-message.assistant.typing {
  min-width: 104px;
  overflow: hidden;
}

.volie-message-meta {
  display: block;
  margin-bottom: 0.22rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.volie-message.user .volie-message-meta {
  color: rgba(16, 33, 45, 0.64);
}

.volie-message.assistant .volie-message-meta {
  color: rgba(232, 165, 75, 0.9);
}

.volie-message-body p {
  margin: 0;
}

.volie-message-body p + p,
.volie-message-body p + .volie-rich-list,
.volie-message-body .volie-rich-list + p,
.volie-message-body .volie-rich-list + .volie-rich-list {
  margin-top: 0.6rem;
}

.volie-message-body strong {
  font-weight: 700;
  color: inherit;
}

.volie-message-body em {
  font-style: italic;
}

.volie-highlight-label {
  font-weight: 800;
  color: #ffd28a;
}

.volie-rich-list {
  margin: 0;
  padding-left: 1.15rem;
}

.volie-rich-list li + li {
  margin-top: 0.3rem;
}

.volie-thinking-block {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.12rem 0;
  animation: volieThinkingGlow 1.8s ease-in-out infinite;
}

.volie-thinking-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: rgba(230, 237, 243, 0.68);
}

.volie-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.volie-thinking-dots span {
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(232, 165, 75, 0.95);
  animation: volieThinkingDots 1s ease-in-out infinite;
}

.volie-thinking-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.volie-thinking-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

.volie-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.1rem;
}

.volie-typing-indicator span {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: rgba(77, 200, 187, 0.8);
  animation: volieTyping 1s ease-in-out infinite;
}

.volie-typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.volie-typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

.volie-caret {
  display: inline-block;
  width: 0.58ch;
  animation: volieCaret 0.9s steps(1) infinite;
}

.volie-composer {
  padding: 0 1.25rem 1.25rem;
}

.volie-composer-label {
  display: inline-block;
  margin-bottom: 0.62rem;
  color: rgba(230, 237, 243, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.volie-composer textarea {
  width: 100%;
  resize: none;
  min-height: 82px;
  max-height: 190px;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
  color: #eef4fb;
  font-family: var(--font);
  font-size: 0.96rem;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.volie-composer textarea::placeholder {
  color: rgba(230, 237, 243, 0.42);
}

.volie-composer textarea:focus {
  outline: none;
  border-color: rgba(77, 200, 187, 0.28);
  box-shadow: 0 0 0 4px rgba(77, 200, 187, 0.1);
  transform: translateY(-1px);
}

.volie-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.82rem;
}

.volie-composer-actions .btn {
  min-width: 108px;
  transition: transform 0.2s ease, opacity 0.18s ease;
}

.volie-composer-actions .btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.volie-composer-actions .btn:disabled {
  opacity: 0.7;
}

.volie-status {
  min-height: 1.2rem;
  color: rgba(230, 237, 243, 0.56);
  font-size: 0.83rem;
}

.volie-status[data-tone="error"] {
  color: #f8a8a8;
}

.volie-status[data-tone="success"] {
  color: #7adfd3;
}

@keyframes volieOrbit {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.06); }
  to { transform: rotate(360deg) scale(1); }
}

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

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

@keyframes volieTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes volieThinkingDots {
  0%, 80%, 100% { transform: translateY(0) scale(0.9); opacity: 0.35; }
  40% { transform: translateY(-2px) scale(1); opacity: 1; }
}

@keyframes volieThinkingGlow {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(2px); opacity: 1; }
}

@keyframes volieCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 980px) {
  .volie-panel {
    inset: 1rem;
    border-radius: 28px;
  }

  .volie-header-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .volie-panel-body {
    grid-template-columns: 1fr;
  }

  .volie-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(320px, calc(100% - 2.2rem));
    z-index: 3;
    border-right: 1px solid rgba(255,255,255,0.08);
    transform: translateX(-106%);
    transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
    box-shadow: 24px 0 60px rgba(0,0,0,0.28);
  }

  .volie-panel.volie-sidebar-open .volie-sidebar {
    transform: translateX(0);
  }

  .volie-context-pill {
    display: none;
  }
}

@media (max-width: 720px) {
  .volie-toggle {
    min-width: 0;
    grid-template-columns: auto 1fr;
  }

  .volie-toggle-hint {
    display: none;
  }

  .volie-suggestion-grid {
    grid-template-columns: 1fr;
  }

  .volie-message {
    max-width: 88%;
  }
}

@media (max-width: 560px) {
  .volie-toggle {
    right: 0.9rem;
    bottom: 0.9rem;
    padding: 0.74rem;
    border-radius: 22px;
  }

  .volie-toggle-copy {
    display: none;
  }

  .volie-panel {
    inset: 0.6rem;
    border-radius: 24px;
  }

  .volie-panel-header,
  .volie-main-topbar,
  .volie-message-list,
  .volie-composer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .volie-panel-header {
    padding-top: 1rem;
    padding-bottom: 0.9rem;
  }

  .volie-header-actions {
    gap: 0.5rem;
  }

  .volie-header-chip,
  .volie-close {
    padding-left: 0.72rem;
    padding-right: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .volie-toggle,
  .volie-panel,
  .volie-scrim,
  .volie-toggle-orbit,
  .volie-message,
  .volie-typing-indicator span {
    animation: none !important;
    transition: none !important;
  }
}

/* Scheduler Dark Override */
.scheduler-intro,
.scheduler-flow-header,
.scheduler-step-panel,
.scheduler-note-card,
.scheduler-view .form-dates input,
.scheduler-view .subject-block input[type="text"],
.scheduler-view .subject-block input[type="number"],
.scheduler-view .chapter-difficulty-select,
.scheduler-view .subject-field,
.scheduler-view .chapter-field,
.scheduler-view .availability-field,
.schedule-range-card,
.schedule-stat-card,
.scheduler-view .subject-block,
.scheduler-view .availability-panel,
.scheduler-view .availability-row,
.scheduler-view .manual-chapter-item,
.scheduler-view .subject-upload-row,
.scheduler-view .chapters-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(15, 21, 30, 0.98)) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24) !important;
}

.scheduler-flow-header .back,
.scheduler-flow-header .step {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #eef4fb !important;
}

.scheduler-flow-header .back:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fbff !important;
  box-shadow: none !important;
}

.scheduler-flow-header .step.active {
  background: linear-gradient(135deg, rgba(232, 165, 75, 0.14), rgba(77, 200, 187, 0.16)) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f7fbff !important;
}

.scheduler-intro-copy h2,
.scheduler-step h2,
.scheduler-step-copy h2,
.scheduler-view .subject-block h3,
.schedule-stat-card strong,
.schedule-range-card strong {
  color: #f7fbff !important;
}

.scheduler-eyebrow,
.scheduler-step-kicker,
.scheduler-note-label {
  color: #ffd28a !important;
}

.scheduler-intro-copy p,
.scheduler-step-copy p,
.scheduler-step .hint,
.scheduler-view .form-dates label,
.scheduler-view .subject-field,
.scheduler-view .chapter-field,
.scheduler-view .availability-field {
  color: var(--text-muted) !important;
}

.scheduler-view .form-dates input::placeholder,
.scheduler-view .subject-block input::placeholder {
  color: rgba(230, 237, 243, 0.42) !important;
}

.scheduler-view .form-dates input:focus,
.scheduler-view .subject-block input:focus,
.scheduler-view .chapter-difficulty-select:focus {
  border-color: rgba(77, 200, 187, 0.28) !important;
  box-shadow: 0 0 0 4px rgba(77, 200, 187, 0.1) !important;
}

.quiz-insights-panel,
.quiz-history-item,
.quiz-history-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(15, 21, 30, 0.98)) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text) !important;
}

.quiz-insights-label,
.quiz-history-score {
  color: #ffd28a !important;
}

#quiz-topic-recommendation,
.quiz-history-copy h4 {
  color: #f7fbff !important;
}

.quiz-history-copy p,
.quiz-history-empty {
  color: var(--text-muted) !important;
}

.schedule-output,
.timeline-shell,
.timeline-day,
.timeline-day-header,
.timeline-task,
.day-plan-task,
.calendar-item,
.calendar-cell,
.timeline-empty,
.day-plan-empty,
.day-plan-modal-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(15, 21, 30, 0.98)) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text) !important;
}

.timeline-day:hover,
.calendar-cell:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(22, 31, 43, 0.98), rgba(17, 24, 34, 0.98)) !important;
}

.timeline-day-header h3,
.timeline-task-title,
.day-plan-task-title,
.calendar-item-title {
  color: #f7fbff !important;
}

.timeline-day-header p,
.timeline-task-meta,
.day-plan-task-meta,
.day-plan-task-time,
.calendar-item-sub,
.calendar-total,
.calendar-more,
.timeline-empty,
.day-plan-empty {
  color: var(--text-muted) !important;
}

.timeline-time,
.calendar-daynum {
  color: #ffd28a !important;
}

.timeline-task.break-task,
.calendar-cell-has {
  background:
    linear-gradient(180deg, rgba(232, 165, 75, 0.08), rgba(77, 200, 187, 0.06)),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(15, 21, 30, 0.98)) !important;
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.12) !important;
}

/* Site-wide Volie Theme Override */
:root {
  --bg: #0f1419;
  --bg-elevated: #17202c;
  --bg-card: #131b26;
  --border: rgba(255, 255, 255, 0.09);
  --text: #e6edf3;
  --text-muted: #8b9cb3;
  --accent: #e8a54b;
  --accent-dim: #49c8bb;
  --accent-glow: rgba(232, 165, 75, 0.2);
  --success: #58d5c4;
  --error: #f87171;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

body {
  background:
    radial-gradient(circle at top left, rgba(232, 165, 75, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(77, 200, 187, 0.12), transparent 24%),
    linear-gradient(180deg, #0f1419 0%, #111823 52%, #0c121a 100%);
  color: var(--text);
}

.header,
.footer,
.scheduler-flow-header,
.summary-actions,
.library-section-header,
.today-panel-header {
  border-color: rgba(255, 255, 255, 0.08);
}

.logo,
.hero h1,
.card h2,
.today-panel h2,
.scheduler-intro-copy h2,
.scheduler-step h2,
.library-section-header h3,
.summary-heading,
.summary-page h2,
.quiz-interface h2,
.confirm-modal-card h3,
.day-plan-modal-header h3,
.app-dialog-header h3,
.subject-block h3,
.calendar-month-header h3,
.calendar-daynum,
.schedule-stat-card strong,
.schedule-range-card strong {
  color: #f7fbff;
}

.tagline,
.hero p,
.card p,
.today-panel-header p,
.scheduler-intro-copy p,
.scheduler-step-copy p,
.scheduler-step .hint,
.summary-page p,
.library-meta,
.day-plan-modal-header p,
.app-dialog-header p,
.tools-input label,
.status,
.hint,
.auth-hint {
  color: var(--text-muted);
}

.hero,
.hero h1,
.hero p {
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
  border: none !important;
}

.card,
.today-panel,
.scheduler-step,
.scheduler-step-panel,
.tools-layout,
.summary-page,
.quiz-interface,
.library-section,
.subject-block,
.schedule-output,
.availability-panel,
.upload-zone,
.youtube-zone,
.timeline-day,
.timeline-task,
.day-plan-task,
.library-card,
.quiz-feedback,
.calendar-item,
.calendar-cell,
.home-layout-toolbar,
#view-home.layout-editing .home-widget,
.confirm-modal-card,
.app-dialog-card,
.quiz-topic-item,
.quiz-insights-panel,
.scheduler-intro,
.scheduler-note-card,
.schedule-range-card,
.schedule-stat-card,
.generation-overlay-card,
.availability-row,
.manual-chapter-item,
.subject-upload-row,
.chapters-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(15, 21, 30, 0.98));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.24);
  color: var(--text);
}

.card::before,
.today-panel::before,
.summary-page::before,
.quiz-interface::before,
.library-section::before {
  background: linear-gradient(90deg, #e8a54b 0%, #49c8bb 100%);
}

.card-icon,
.scheduler-eyebrow,
.scheduler-step-kicker,
.scheduler-note-label,
.today-panel-label,
.summary-pill,
.app-dialog-eyebrow {
  color: #ffd28a;
}

.card-icon,
.calendar-chip,
.step.active,
.scheduler-flow-header .step.active {
  background: linear-gradient(135deg, rgba(232, 165, 75, 0.14), rgba(77, 200, 187, 0.16));
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-primary,
.btn-logout,
.tab.active,
.progress-fill,
.today-progress-fill,
.calendar-bar-fill {
  background: linear-gradient(135deg, #f0ad59 0%, #49c8bb 100%);
  color: #10212d;
}

.btn-primary:hover,
.btn-logout:hover {
  background: linear-gradient(135deg, #f4b867 0%, #58d5c4 100%);
  color: #10212d;
}

.btn-secondary,
.tab,
.back {
  background: rgba(255, 255, 255, 0.05);
  color: #eef4fb;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover,
.tab:hover,
.back:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.16);
}

.step,
.scheduler-flow-header .step {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.form-dates input,
.subject-block input[type="text"],
.subject-block input[type="number"],
.chapter-difficulty-select,
.youtube-zone input[type="url"],
.summary-format select,
.quiz-controls #quiz-count,
.doubts-panel input,
#lesson-text,
.app-dialog-field input,
.topic-selection-name-field input,
.availability-row input[type="time"],
.upload-zone input[type="file"],
.volie-composer textarea {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  color: #eef4fb;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.form-dates input::placeholder,
.subject-block input::placeholder,
.youtube-zone input::placeholder,
#lesson-text::placeholder,
.doubts-panel input::placeholder,
.app-dialog-field input::placeholder,
.topic-selection-name-field input::placeholder {
  color: rgba(230, 237, 243, 0.42);
}

.form-dates input:focus,
.subject-block input:focus,
.chapter-difficulty-select:focus,
.youtube-zone input:focus,
.summary-format select:focus,
.quiz-controls #quiz-count:focus,
.doubts-panel input:focus,
#lesson-text:focus,
.app-dialog-field input:focus,
.topic-selection-name-field input:focus,
.availability-row input[type="time"]:focus {
  outline: none;
  border-color: rgba(77, 200, 187, 0.28);
  box-shadow: 0 0 0 4px rgba(77, 200, 187, 0.1);
}

.summary-result,
.summary-content,
.technical-summary-result,
.pdf-export-capture .summary-content {
  color: var(--text);
}

.tech-section,
.tech-concept-card,
.tech-example-card,
.tech-reference-card,
.tech-callout-card,
.tech-note {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(15, 21, 30, 0.98));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.tech-concept-card h4,
.tech-example-card h4,
.tech-reference-card h4,
.tech-callout-card h4,
.summary-table th,
.summary-table td,
.summary-body code {
  color: var(--text);
}

.tech-callout-warn,
.quiz-feedback.incorrect,
.app-toast-error {
  border-color: rgba(248, 113, 113, 0.22);
}

.tech-callout-connect,
.quiz-feedback.correct,
.app-toast-success {
  border-color: rgba(77, 200, 187, 0.22);
}

.summary-table,
.summary-table th,
.summary-table td,
.tech-table,
.tech-table th,
.tech-table td {
  border-color: rgba(255, 255, 255, 0.08);
}

.summary-table thead,
.summary-body code,
.timeline-task.break-task,
.calendar-cell-has,
.progress-bar,
.today-progress-bar,
.calendar-bar {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.quiz-option,
.library-card,
.timeline-task,
.day-plan-task,
.calendar-item,
.calendar-cell,
.availability-row,
.manual-chapter-item,
.subject-upload-row,
.quiz-topic-item {
  border-color: rgba(255, 255, 255, 0.08);
}

.confirm-modal-backdrop,
.auth-wrapper-modal {
  background:
    radial-gradient(circle at top, rgba(77, 200, 187, 0.1), transparent 30%),
    rgba(7, 10, 16, 0.62);
  backdrop-filter: blur(16px);
}

.app-dialog-eyebrow,
.summary-pill,
.today-panel-label,
.scheduler-eyebrow,
.scheduler-step-kicker,
.scheduler-note-label,
.quiz-insights-label {
  background: rgba(232, 165, 75, 0.12);
}

.app-toast {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.app-toast-info {
  background: linear-gradient(135deg, #e8a54b, #49c8bb);
  color: #10212d;
}

.app-toast-success {
  background: linear-gradient(135deg, #58d5c4, #49c8bb);
  color: #10212d;
}

.app-toast-error {
  background: linear-gradient(135deg, #f87171, #fb923c);
  color: #fff5f5;
}

.home-widget,
.today-panel,
.library-section,
.summary-page,
.quiz-interface,
.scheduler-intro,
.scheduler-step-panel,
.generation-overlay-card {
  position: relative;
  overflow: hidden;
}

.home-widget::before,
.scheduler-step-panel::before,
.generation-overlay-card::before,
.availability-panel::before,
.upload-zone::before,
.youtube-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(232, 165, 75, 0.08), transparent 30%),
    radial-gradient(circle at bottom left, rgba(77, 200, 187, 0.08), transparent 28%);
}

.home-widget-hero::before {
  display: none;
}

.app-toast-hide {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.generation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.generation-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(98, 70, 191, 0.16);
  backdrop-filter: blur(14px);
}

.generation-overlay-card {
  position: relative;
  width: min(92vw, 420px);
  padding: 1.5rem;
  border-radius: 28px;
  border: 1px solid rgba(122, 87, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 243, 255, 0.95));
  box-shadow: 0 30px 80px rgba(84, 56, 168, 0.18);
  display: grid;
  justify-items: center;
  gap: 1.2rem;
}

.generation-ring-shell {
  width: 132px;
  height: 132px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.generation-ring {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
}

.generation-ring-track,
.generation-ring-progress {
  fill: none;
  stroke-width: 10;
}

.generation-ring-track {
  stroke: rgba(123, 92, 255, 0.12);
}

.generation-ring-progress {
  stroke: url(#generation-ring-gradient);
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.generation-ring-inner {
  position: absolute;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #f7f1ff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.generation-percent {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #5f3ff2;
}

.generation-copy {
  text-align: center;
}

.generation-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: rgba(123, 92, 255, 0.08);
  color: #6a47f4;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.generation-copy h3 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
  color: #24183d;
}

.generation-copy p {
  margin: 0;
  color: #766a91;
  line-height: 1.6;
}

/* Scheduler revamp */
.scheduler-view {
  position: relative;
}

.scheduler-shell {
  display: grid;
  gap: 1.4rem;
}

.scheduler-intro {
  display: block;
  padding: 1.15rem 1.3rem;
  border-radius: 24px;
  border: 1px solid rgba(122, 87, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 244, 255, 0.95));
  box-shadow: 0 18px 40px rgba(98, 70, 183, 0.07);
}

.scheduler-eyebrow,
.scheduler-step-kicker,
.scheduler-note-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-dim);
}

.scheduler-intro-copy h2,
.scheduler-step h2 {
  margin: 0.32rem 0 0.45rem;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.scheduler-intro-copy p,
.scheduler-step-copy p,
.scheduler-step .hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 52ch;
}

.scheduler-intro-notes {
  display: none;
}

.scheduler-note-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.05rem 1rem;
  border-radius: 22px;
  border: 1px solid rgba(122, 87, 255, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.scheduler-note-card strong {
  color: var(--text);
  line-height: 1.45;
}

.scheduler-flow-header {
  margin-bottom: 0;
  padding: 0.82rem 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(122, 87, 255, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(98, 70, 183, 0.06);
}

.scheduler-flow-header .back {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(122, 87, 255, 0.16);
  color: #6c6482;
  padding: 0.74rem 1rem;
  border-radius: 999px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.scheduler-flow-header .back:hover {
  transform: translateY(-1px);
  color: var(--accent-dim);
  border-color: rgba(123, 92, 255, 0.3);
  box-shadow: 0 10px 24px rgba(123, 92, 255, 0.14);
}

.scheduler-flow-header .steps {
  gap: 0.7rem;
  overflow: hidden;
  transition: max-width 0.24s ease, opacity 0.2s ease, margin 0.24s ease, transform 0.24s ease;
  max-width: 100%;
  opacity: 1;
}

.scheduler-flow-header .step {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(122, 87, 255, 0.12);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.scheduler-flow-header .step.active {
  background: rgba(123, 92, 255, 0.12);
  box-shadow: none;
  transform: none;
}

.scheduler-flow-header.scheduler-flow-header-steps-hidden .steps {
  max-width: 0;
  opacity: 0;
  margin: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.scheduler-step.step-active {
  animation: schedulerStepIn 0.48s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scheduler-step-panel {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(122, 87, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 247, 255, 0.95));
  box-shadow: 0 16px 36px rgba(98, 70, 183, 0.06);
}

.scheduler-step-copy {
  display: grid;
  gap: 0.1rem;
}

.scheduler-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.scheduler-view .form-dates {
  max-width: none;
  gap: 1.05rem;
}

.scheduler-view .form-dates label,
.scheduler-view .subject-field,
.scheduler-view .chapter-field,
.scheduler-view .availability-field {
  display: grid;
  gap: 0.45rem;
  color: #5a506e;
  font-size: 0.92rem;
  font-weight: 600;
}

.scheduler-view .form-dates input,
.scheduler-view .subject-block input[type="text"],
.scheduler-view .subject-block input[type="number"],
.scheduler-view .chapter-difficulty-select {
  padding: 0.88rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.availability-panel {
  border-radius: 20px;
  padding: 1rem;
}

.availability-header {
  display: grid;
  gap: 0;
}

.availability-header h3 {
  margin: 0;
}

.availability-header p {
  display: none;
}

.weekly-availability {
  gap: 0.85rem;
}

.availability-row {
  grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr) 96px;
  padding: 0.8rem 0.85rem;
  border-radius: 18px;
  animation: schedulerLiftIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--row-index, 0) * 55ms);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease, opacity 0.22s ease;
}

.availability-row:hover {
  transform: none;
  box-shadow: 0 8px 20px rgba(123, 92, 255, 0.05);
  border-color: rgba(123, 92, 255, 0.18);
}

.availability-row.is-active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 241, 255, 0.92));
}

.availability-row.is-empty {
  opacity: 0.82;
}

.availability-day {
  display: grid;
  gap: 0.16rem;
}

.availability-day-name {
  color: var(--text);
  font-weight: 700;
}

.availability-day-state {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.availability-total {
  justify-self: end;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(123, 92, 255, 0.14);
  background: rgba(123, 92, 255, 0.08);
  color: var(--accent-dim);
  font-weight: 700;
}

.availability-summary {
  margin-top: 0;
  padding: 0.8rem 0.9rem;
  border-top: none;
  border-radius: 16px;
  background: rgba(123, 92, 255, 0.06);
  border: 1px solid rgba(123, 92, 255, 0.12);
}

.scheduler-cta-row,
.scheduler-actions,
.scheduler-output-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.subjects-container {
  display: grid;
  gap: 1rem;
}

.subject-block {
  gap: 1rem;
  padding: 1rem;
  border-radius: 20px;
  animation: schedulerLiftIn 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--subject-index, 0) * 70ms);
}

.subject-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.subject-block-header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.08rem;
}

.subject-priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(123, 92, 255, 0.08);
  border: 1px solid rgba(123, 92, 255, 0.12);
  color: var(--accent-dim);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.subject-core-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.subject-block.is-dragging {
  opacity: 0.55;
  transform: scale(0.985);
}

.subject-block.is-drop-target {
  border-color: rgba(123, 92, 255, 0.34);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, 0.08), 0 18px 34px rgba(123, 92, 255, 0.08);
}

.upload-inline {
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px dashed rgba(123, 92, 255, 0.25);
  background: rgba(123, 92, 255, 0.05);
}

.chapters-list {
  display: grid;
  gap: 0.85rem;
}

.chapter-item {
  grid-template-columns: minmax(0, 1.35fr) minmax(150px, 0.5fr) auto;
  gap: 0.85rem;
  align-items: end;
  padding: 0.78rem;
  border-radius: 16px;
  animation: schedulerLiftIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--chapter-index, 0) * 45ms);
}

.chapter-item-main,
.chapter-item-side {
  min-width: 0;
}

.chapter-item-side {
  display: grid;
  gap: 0.4rem;
}

.diff-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-shell {
  padding: 1rem;
}

.timeline-meta {
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.schedule-range-card,
.schedule-stat-card {
  min-height: auto;
  border-radius: 18px;
  border: 1px solid rgba(122, 87, 255, 0.12);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.82rem 0.92rem;
  display: grid;
  align-content: center;
  gap: 0.18rem;
}

.schedule-range-card {
  min-width: min(100%, 260px);
}

.schedule-stat-card strong {
  font-size: 0.98rem;
  color: var(--text);
}

.schedule-stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 700;
}

.timeline-days {
  gap: 1rem;
}

.timeline-day {
  padding: 0.9rem;
  border-radius: 20px;
  animation: schedulerLiftIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--day-index, 0) * 70ms);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.timeline-day:hover {
  transform: none;
  box-shadow: 0 10px 24px rgba(123, 92, 255, 0.06);
  border-color: rgba(123, 92, 255, 0.18);
}

.timeline-day-header {
  padding: 0.25rem;
  border-radius: 18px;
}

.timeline-task-list {
  gap: 0.75rem;
}

.timeline-task {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0.95rem;
  padding: 0.76rem 0.88rem;
  border-radius: 16px;
  animation: schedulerLiftIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--task-index, 0) * 35ms);
}

.timeline-time {
  font-weight: 700;
}

.timeline-task-title {
  line-height: 1.35;
}

.schedule-empty-state {
  padding: 2rem 1.4rem;
  display: grid;
  gap: 0.45rem;
  text-align: center;
  color: var(--text-muted);
}

.schedule-empty-state h3 {
  margin: 0;
  color: var(--text);
}

@keyframes schedulerStepIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.footer {
  border-top: 1px solid rgba(122, 87, 255, 0.12);
  color: #7b7092;
}

@media (max-width: 768px) {
  .app {
    padding: 0 1rem;
  }

  .header {
    gap: 0.85rem;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .tools-layout,
  .quiz-interface,
  .summary-page {
    padding: 1rem;
  }

  .app-toast-region {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .app-toast {
    min-width: 0;
    max-width: none;
  }

  .generation-overlay-card {
    width: 100%;
    max-width: 360px;
    padding: 1.2rem;
  }

  .generation-ring {
    width: 116px;
    height: 116px;
  }

  .generation-ring-inner {
    width: 86px;
    height: 86px;
  }

  .scheduler-intro,
  .scheduler-field-grid,
  .subject-core-fields {
    grid-template-columns: 1fr;
  }

  .scheduler-step-panel,
  .scheduler-intro,
  .scheduler-flow-header {
    padding: 0.95rem;
  }

  .availability-row,
  .chapter-item,
  .timeline-task,
  .timeline-day-header {
    grid-template-columns: 1fr;
  }

  .subject-block-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-range-card,
  .schedule-stat-card {
    min-height: auto;
  }
}
