:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121d;
  --bg-card: rgba(16, 24, 39, 0.7);
  --bg-card-hover: rgba(22, 32, 51, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.18);
  --shadow-pulse: 0 0 40px rgba(168, 85, 247, 0.25);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Lights */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.glow-1 {
  top: -100px;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, rgba(59, 130, 246, 0.05) 70%);
}

.glow-2 {
  bottom: 50px;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, rgba(236, 72, 153, 0.03) 70%);
}

/* App Layout */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Top Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

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

.brand-logo {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-core {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 6px;
  transform: rotate(45deg);
  box-shadow: 0 0 15px var(--accent-cyan);
}

.logo-ring {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  border-radius: 50%;
  animation: spinSlow 12s linear infinite;
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

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

.voice-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px 8px 4px 10px;
  border-radius: var(--radius-md);
}

.voice-selector-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.select-voice {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.select-voice option {
  background: #0d121d;
  color: var(--text-primary);
}

.time-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.time-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.date-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Button styles */
button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-cyan);
  border-color: var(--border-glow);
}

.btn-icon.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

#badge-firebase-status {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

#badge-firebase-status.connected {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

#btn-toggle-handsfree {
  width: auto;
  padding: 0 12px;
  gap: 6px;
}

#btn-toggle-handsfree.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
  border-color: var(--accent-cyan);
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.btn-icon-subtle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-subtle:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.icon {
  width: 18px;
  height: 18px;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 22px;
  align-items: start;
}

/* Executive Cards */
.executive-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.executive-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Voice Hero Card */
.voice-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 24px 22px;
  background: radial-gradient(circle at top, rgba(30, 41, 59, 0.7) 0%, rgba(13, 18, 29, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: var(--shadow-glow);
}

.voice-orb-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 190px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#voice-canvas {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: 100%;
}

.orb-overlay-controls {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  width: auto;
  z-index: 3;
}

.wake-words-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px auto 0;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  max-width: 900px;
}

.wake-hint-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wake-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.state-pill {
  background: rgba(13, 18, 29, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseDot 1.4s infinite ease-in-out;
}

/* Live Spoken Transcript Box */
.transcript-box {
  width: 100%;
  max-width: 900px;
  margin: 14px auto 0;
  background: rgba(7, 9, 14, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  transition: all 0.3s ease;
}

.speaker-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-align: center;
}

.spoken-text {
  font-size: 0.98rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

/* Interaction Bar */
.interaction-bar {
  width: 100%;
  max-width: 900px;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.mic-button {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mic-button:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.6);
}

.mic-button.listening {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
  animation: pulseListening 1.2s infinite;
}

@keyframes pulseListening {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.mic-wave-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.4);
  opacity: 0;
  pointer-events: none;
}

.text-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.text-input-wrap input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 13px 48px 13px 18px;
  border-radius: var(--radius-full);
  outline: none;
  transition: all 0.25s ease;
}

.text-input-wrap input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.btn-send {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-send:hover {
  background: var(--accent-cyan);
  color: #0d121d;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Quick Prompts Tray */
.quick-prompts-tray {
  width: 100%;
  max-width: 900px;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tray-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chips-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.mic-button.listening .mic-wave-ring {
  border-color: rgba(239, 68, 68, 0.8);
  animation: rippleRing 1.5s infinite;
}

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

.icon-mic {
  width: 22px;
  height: 22px;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.prompt-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

/* Tasks Card */
.tasks-card {
  min-height: 380px;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

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

.count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.count-badge-subtle {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
}

.filter-tabs {
  display: flex;
  background: rgba(7, 9, 14, 0.7);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.tab-btn {
  background: transparent;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: rgba(13, 18, 29, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

.task-item.completed {
  opacity: 0.55;
  background: rgba(7, 9, 14, 0.4);
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.task-checkbox:hover {
  border-color: var(--accent-emerald);
}

.task-item.completed .task-checkbox {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.task-checkbox svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  opacity: 0;
}

.task-item.completed .task-checkbox svg {
  opacity: 1;
}

.task-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.priority-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
}

.priority-high {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.priority-low {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.category-tag {
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

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

.btn-action-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-action-icon:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.82rem;
  max-width: 320px;
}

.empty-subtle {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 14px 0;
  text-align: center;
}

/* Side Card Lists */
.side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.side-list::-webkit-scrollbar {
  width: 4px;
}

.side-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(13, 18, 29, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.reminder-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reminder-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

/* Shopping Quick Add */
.shopping-quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.shopping-quick-add input {
  flex: 1;
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.shopping-quick-add input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.btn-icon-xs {
  width: 30px;
  height: 30px;
  background: var(--accent-blue);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
}

.shopping-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(13, 18, 29, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.shopping-item-row.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.habit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(13, 18, 29, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.habit-streak {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* History Stream Accordion */
.pointer {
  cursor: pointer;
  user-select: none;
}

.toggle-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.toggle-arrow.open {
  transform: rotate(180deg);
}

.history-stream-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-stream-container.expanded {
  max-height: 260px;
  margin-top: 10px;
}

.history-stream-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-msg {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.4;
}

.history-msg.user {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  align-self: flex-end;
  color: #bae6fd;
}

.history-msg.assistant {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  align-self: flex-start;
  color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(13, 18, 29, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  backdrop-filter: blur(16px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STUDENT ACADEMIC HUB & TIMETABLE ENHANCEMENTS
   ========================================================================== */

/* Mode Switcher Tray */
.mode-switcher-tray {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-toggle-btn:hover {
  color: var(--text-primary);
}

.mode-toggle-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(59, 130, 246, 0.3));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.student-chip {
  border-color: rgba(168, 85, 247, 0.3) !important;
  background: rgba(168, 85, 247, 0.08) !important;
}

.student-chip:hover {
  border-color: rgba(168, 85, 247, 0.6) !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.25) !important;
}

/* Proactive Check-in Banner */
.student-checkin-banner {
  background: linear-gradient(135deg, rgba(16, 24, 39, 0.85) 0%, rgba(30, 27, 75, 0.7) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 25px rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  animation: fadeIn 0.4s ease;
  position: relative;
  overflow: hidden;
}

.student-checkin-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.checkin-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 280px;
}

.checkin-icon-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.checkin-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid rgba(168, 85, 247, 0.4);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.checkin-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.checkin-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.checkin-heading {
  font-size: 1.05rem;
  font-weight: 750;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.checkin-prompt-text {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.4;
}

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

.btn-checkin-action {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-checkin-action.primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-checkin-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-checkin-action.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid var(--border-color);
}

.btn-checkin-action.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

/* Tomorrow's Readiness Alert Deck */
.tomorrow-readiness-card {
  border-color: rgba(245, 158, 11, 0.35) !important;
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.8) 0%, rgba(30, 20, 10, 0.5) 100%) !important;
}

.urgency-fire {
  animation: flicker 1.8s infinite alternate;
}

@keyframes flicker {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4)); }
  100% { transform: scale(1.12); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)); }
}

.urgency-badge {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.readiness-status-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  padding: 3px 10px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.readiness-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.readiness-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.readiness-item:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
}

.readiness-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.readiness-subject {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.readiness-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
}

/* Timetable Days Nav */
.timetable-days-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.day-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.day-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.day-tab-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.25));
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

/* Timetable Slots Grid */
.timetable-slots-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  position: relative;
}

.slot-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(3px);
}

.slot-card.live-now {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(16, 24, 39, 0.6) 100%);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.slot-card.free-period {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
}

.slot-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slot-time-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: #38bdf8;
  min-width: 95px;
  text-align: center;
}

.slot-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot-subject-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.slot-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.slot-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.slot-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill-live {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.status-pill-free {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

/* Homework Quick Add */
.homework-quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.homework-quick-add input[type="text"],
.homework-quick-add input[type="date"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.homework-quick-add input[type="text"]:focus,
.homework-quick-add input[type="date"]:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

#input-hw-title { flex: 2; min-width: 180px; }
#input-hw-subject { flex: 1; min-width: 120px; }
#input-hw-date { width: 145px; }

/* Homework Subject Tags */
.hw-subject-pill {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hw-due-pill {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.hw-due-pill.tomorrow {
  color: #fbbf24;
  font-weight: 700;
}

/* Modal Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: #0d131f;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 750;
  color: #f8fafc;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #f8fafc;
}

.modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-section-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

.preset-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.preset-card:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.preset-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  margin-left: 10px;
}

.preset-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

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

.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 4px 0;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.modal-divider span {
  padding: 0 10px;
}

.dropzone-area {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.04);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dropzone-area:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.dropzone-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.dropzone-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.highlight {
  color: #38bdf8;
  font-weight: 700;
}

.modal-textarea,
.modal-input,
.modal-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.modal-textarea:focus,
.modal-input:focus,
.modal-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN & ALIGNMENT SYSTEM
   ========================================================================== */

/* Base Layout Constraints */
body {
  overflow-x: hidden;
}

.app-layout {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  box-sizing: border-box;
}

/* Tablet & Medium Screens (< 1100px) */
@media (max-width: 1100px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 18px;
  }

  .brand-section {
    justify-content: space-between;
    width: 100%;
  }

  .header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

/* Small Tablets & Large Phones (< 768px) */
@media (max-width: 768px) {
  .app-layout {
    padding: 12px 14px 50px;
  }

  .app-header {
    padding: 14px 14px;
    gap: 12px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    font-size: 0.74rem;
  }

  .header-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mode-switcher-tray {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mode-toggle-btn {
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .header-controls > div:not(.mode-switcher-tray) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .time-widget {
    order: 3;
    width: 100%;
    align-items: center;
    padding: 6px 10px;
  }

  /* Voice Orb Section */
  .voice-orb-section {
    padding: 24px 16px 18px;
  }

  .voice-orb-container {
    height: 170px;
  }

  #voice-canvas {
    width: 170px;
    height: 170px;
  }

  .spoken-phrase-box {
    padding: 10px 14px;
    min-height: 54px;
  }

  .spoken-text {
    font-size: 0.92rem;
  }

  /* Quick Prompts Tray */
  .quick-prompts-tray {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .quick-prompts-tray::-webkit-scrollbar {
    display: none;
  }

  .prompt-chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Chat Input Bar */
  .chat-input-bar {
    padding: 6px 8px;
  }

  .chat-input {
    font-size: 0.85rem;
    padding: 8px 10px;
  }

  .btn-mic {
    width: 42px;
    height: 42px;
  }

  .btn-send {
    width: 40px;
    height: 40px;
  }

  /* Cards Header & Filter Tabs */
  .card-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
    padding: 14px 16px;
  }

  .card-title-group {
    width: 100%;
    justify-content: space-between;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .header-action-group {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }

  .header-action-group button {
    flex: 1;
    justify-content: center;
    min-width: 140px;
  }

  /* Student Hub: Check-in Banner */
  .student-checkin-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }

  .checkin-content {
    min-width: unset;
    width: 100%;
  }

  .checkin-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .btn-checkin-action {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  /* Timetable Slots */
  .timetable-days-nav {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 6px;
  }

  .timetable-days-nav::-webkit-scrollbar {
    display: none;
  }

  .slot-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }

  .slot-left {
    width: 100%;
    align-items: flex-start;
    gap: 12px;
  }

  .slot-time-badge {
    min-width: 80px;
    padding: 4px 8px;
  }

  .slot-right {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
  }

  /* Homework Quick Add Form */
  .homework-quick-add {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #input-hw-title,
  #input-hw-subject,
  #input-hw-date,
  #btn-add-hw-submit {
    width: 100% !important;
    min-width: unset !important;
  }

  #btn-add-hw-submit {
    padding: 10px;
    justify-content: center;
  }

  /* Modals on Mobile */
  .modal-dialog {
    max-width: 96vw;
    margin: 8px;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .modal-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
  }

  .modal-footer button {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile Portrait & Small Screens (< 480px) */
@media (max-width: 480px) {
  .app-layout {
    padding: 8px 10px 40px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 1.05rem;
    gap: 6px;
  }

  .badge-status {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .card-title {
    font-size: 0.98rem;
  }

  .task-item {
    padding: 10px 12px;
    gap: 10px;
  }

  .task-badges {
    flex-wrap: wrap;
    gap: 4px;
  }

  .badge {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .dropzone-area {
    padding: 16px 12px;
  }

  .preset-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .preset-card button {
    width: 100%;
    justify-content: center;
  }

  .toast {
    max-width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
    font-size: 0.8rem;
  }
}


