:root {
  --bg-backdrop: #e9eff8;
  --shell-bg: #f8fafe;
  --surface-white: #ffffff;
  --ink-primary: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-orange: #f97316;

  /* Claymorphism shadows */
  --clay-shell:
    0 28px 60px rgba(15, 23, 42, 0.08),
    0 8px 20px rgba(59, 130, 246, 0.06),
    inset 0 2px 6px rgba(255, 255, 255, 0.9);

  --clay-card:
    0 14px 28px rgba(15, 23, 42, 0.08),
    0 4px 10px rgba(15, 23, 42, 0.04),
    inset 0 4px 10px rgba(255, 255, 255, 0.65),
    inset 0 -6px 14px rgba(15, 23, 42, 0.06);

  --clay-pill:
    0 8px 18px rgba(15, 23, 42, 0.06),
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -3px 6px rgba(15, 23, 42, 0.04);

  --clay-dark-pill:
    0 10px 22px rgba(15, 23, 42, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.16);

  --clay-inset:
    inset 0 3px 8px rgba(15, 23, 42, 0.06),
    inset 0 -2px 6px rgba(255, 255, 255, 0.9);

  --radius-shell: 32px;
  --radius-card: 26px;
  --radius-pill: 999px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 12% 15%, #eef4ff 0%, #e4ecf8 48%, #dde7f6 100%);
  color: var(--ink-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-backdrop {
  height: 100vh;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.app-backdrop[hidden],
.floating-ai-btn[hidden] {
  display: none !important;
}

/* Pure White Encrypted PIN Lock Screen */
.pin-lock-screen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.pin-lock-screen[hidden] {
  display: none !important;
}

.pin-tiny-ring {
  width: 34px;
  height: 34px;
}

.pin-tiny-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pin-ring-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 3;
}

.pin-ring-fg {
  fill: none;
  stroke: #0f172a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 87.96;
  stroke-dashoffset: 62;
  animation: pinSpin 1.8s linear infinite;
  transform-origin: center;
}

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

.pin-dialog {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
  border: 1px solid #f1f5f9;
  text-align: center;
}

.pin-dialog.shake {
  animation: pinShake 0.32s ease;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.pin-prompt {
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 14px;
}

.pin-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pin-digit {
  width: 46px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: center;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.05);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pin-digit:focus {
  background: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.pin-error {
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #dc2626;
}

.app-shell {
  width: 100%;
  max-width: 1520px;
  height: calc(100vh - 32px);
  background: var(--shell-bg);
  border-radius: var(--radius-shell);
  box-shadow: var(--clay-shell);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  padding: 26px 18px;
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 48px);
}

.brand-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 28px;
  border-radius: 18px;
  background: linear-gradient(145deg, #1e293b, #090d16);
  display: grid;
  place-items: center;
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

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

.nav-item {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.nav-item:hover:not(.active) {
  background: #f1f5fb;
  color: var(--ink-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, #172033 0%, #0b111e 100%);
  color: #ffffff;
  box-shadow:
    var(--clay-dark-pill),
    -4px 0 14px rgba(59, 130, 246, 0.45);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-topic-sidebar-btn {
  border: none;
  background: linear-gradient(135deg, #172033 0%, #0b111e 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--clay-dark-pill);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.add-topic-sidebar-btn:hover {
  transform: translateY(-2px);
}

.plus-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.ai-assistant-card {
  background: linear-gradient(145deg, #eef4ff, #e3ecfc);
  border-radius: 20px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--clay-pill);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.18s ease;
}

.ai-assistant-card:hover {
  transform: translateY(-2px);
}

.ai-orb {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.16);
  flex-shrink: 0;
}

.ai-meta {
  display: flex;
  flex-direction: column;
}

.ai-meta strong {
  font-size: 0.86rem;
  color: var(--ink-primary);
}

.ai-meta span {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Main Content */
.main-content {
  padding: 26px 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar,
.lesson-stage::-webkit-scrollbar,
.lesson-sidebar::-webkit-scrollbar {
  display: none;
}

.lesson-stage,
.lesson-sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pill-ico,
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-footer-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-clay {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, #60a5fa, #6366f1);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 20px rgba(99, 102, 241, 0.28),
    inset 0 3px 6px rgba(255, 255, 255, 0.55);
  border: 3px solid #ffffff;
  flex-shrink: 0;
}

.greeting-title {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.greeting-sub {
  font-size: 0.84rem;
  color: var(--ink-muted);
  font-weight: 500;
}

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

.streak-pill {
  background: #ffffff;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--clay-pill);
}

.streak-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.icon-circle-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--ink-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  box-shadow: var(--clay-pill);
  transition: transform 0.18s ease;
}

.icon-circle-btn:hover {
  transform: translateY(-2px);
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid #ffffff;
}

/* Search Bar */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: #eff4fb;
  border-radius: var(--radius-pill);
  padding: 13px 44px 13px 48px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-primary);
  box-shadow: var(--clay-inset);
  outline: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-input:focus {
  background: #ffffff;
  box-shadow:
    0 8px 20px rgba(59, 130, 246, 0.12),
    inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

.search-clear {
  position: absolute;
  right: 16px;
  border: none;
  background: #dbe4f3;
  color: var(--ink-primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(125deg, #98a8ff 0%, #68b5ff 55%, #7ad3ff 100%);
  border-radius: 28px;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 18px 36px rgba(99, 132, 255, 0.26),
    inset 0 4px 12px rgba(255, 255, 255, 0.55),
    inset 0 -8px 18px rgba(37, 99, 235, 0.18);
  margin-bottom: 20px;
}

.hero-left {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  z-index: 2;
  max-width: 640px;
}

.hero-icon-tile {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.12),
    inset 0 -3px 6px rgba(15, 23, 42, 0.06);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(15, 23, 42, 0.72);
  margin-bottom: 4px;
}

.hero-text h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b1120;
  margin-bottom: 6px;
}

.hero-text p {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.8);
  font-weight: 500;
  margin-bottom: 16px;
}

.cta-pill-btn {
  border: none;
  background: linear-gradient(135deg, #172033 0%, #090d16 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--clay-dark-pill);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta-pill-btn:hover {
  transform: translateY(-2px);
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  z-index: 2;
}

.hero-decor-badges {
  display: flex;
  align-items: center;
}

.decor-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
  margin-left: -10px;
}

.decor-circle.c1 { background: #dbeafe; }
.decor-circle.c2 { background: #ede9fe; }
.decor-circle.c3 { background: #fef3c7; }

/* Progress Rings */
.progress-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
}

.progress-ring .ring-bg {
  stroke: rgba(15, 23, 42, 0.14);
}

.progress-ring .ring-fg {
  stroke: #0f172a;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.4s ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
}

/* Filter Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-pill {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: #ffffff;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--clay-pill);
  transition: all 0.18s ease;
}

.filter-pill:hover:not(.active) {
  transform: translateY(-2px);
}

.filter-pill.active {
  background: linear-gradient(135deg, #172033 0%, #090d16 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--clay-dark-pill);
}

/* Topic Cards Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.topic-card {
  border-radius: var(--radius-card);
  padding: 22px 24px;
  box-shadow: var(--clay-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 190px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 36px rgba(15, 23, 42, 0.12),
    inset 0 4px 12px rgba(255, 255, 255, 0.72),
    inset 0 -6px 14px rgba(15, 23, 42, 0.06);
}

/* Vibrant Claymorphism Card Themes */
.theme-lavender {
  background: linear-gradient(135deg, #eab5ff 0%, #dc9bff 100%);
}

.theme-amber {
  background: linear-gradient(135deg, #ffbd59 0%, #ffa23a 100%);
}

.theme-mint {
  background: linear-gradient(135deg, #8df0c4 0%, #5fdba7 100%);
}

.theme-coral {
  background: linear-gradient(135deg, #ffabc1 0%, #ff8da8 100%);
}

.theme-sky {
  background: linear-gradient(135deg, #9ad0ff 0%, #6cb8ff 100%);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.78);
  margin-bottom: 4px;
}

.level-chip {
  background: rgba(255, 255, 255, 0.45);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.86rem;
  color: rgba(15, 23, 42, 0.78);
  font-weight: 500;
  max-width: 90%;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.75);
}

.card-open-hint {
  background: rgba(15, 23, 42, 0.1);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  color: #0f172a;
}

/* Subviews (Tools / Analytics) */
.subview-header {
  margin-bottom: 18px;
}

.subview-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.subview-header p {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.tools-grid,
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.analytics-top-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 20px;
}

.pie-card-body {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 6px;
}

.pie-svg-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  flex-shrink: 0;
}

.pie-center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pie-center-label strong {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink-primary);
  line-height: 1.1;
}

.pie-center-label span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.pie-legend-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.heatmap-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

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

.heatmap-col {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 6px;
}

.heatmap-cell {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  background: #edf2f7;
  transition: transform 0.15s ease;
}

.heatmap-cell:hover {
  transform: scale(1.18);
}

.heatmap-cell.lvl-1 { background: #bfdbfe; }
.heatmap-cell.lvl-2 { background: #60a5fa; }
.heatmap-cell.lvl-3 { background: #2563eb; }
.heatmap-cell.lvl-4 { background: #1e3a8a; }

.heatmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.heatmap-scale {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.heatmap-scale .heatmap-cell {
  width: 12px;
  height: 12px;
}

.tool-clay-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--clay-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}

.tool-badge.purple { background: #f3e8ff; color: #7e22ce; }
.tool-badge.orange { background: #ffedd5; color: #c2410c; }
.tool-badge.mint { background: #dcfce7; color: #15803d; }
.tool-badge.blue { background: #dbeafe; color: #1d4ed8; }

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

.scorecard-form > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.scorecard-form input[type="text"] {
  border: none;
  background: #eff4fb;
  border-radius: 12px;
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink-primary);
  box-shadow: var(--clay-inset);
}

.score-sliders {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-sliders label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.score-sliders input[type="range"] {
  width: 100%;
  accent-color: #0f172a;
  cursor: pointer;
}

.score-status {
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}
.score-status.approved { background: #dcfce7; color: #15803d; }
.score-status.conditional { background: #fef3c7; color: #b45309; }
.score-status.rejected { background: #fee2e2; color: #b91c1c; }

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.calc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 10px;
}

.calc-row label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.calc-row input {
  width: 100%;
  min-width: 0;
  border: none;
  background: #eff4fb;
  border-radius: 12px;
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 700;
  color: var(--ink-primary);
  box-shadow: var(--clay-inset);
}

.calc-result {
  background: linear-gradient(135deg, #eef4ff, #e0ecff);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.mini-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.mini-checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
}

.mini-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0f172a;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-clay-panel {
  width: 100%;
  max-width: 920px;
  max-height: 88vh;
  background: #f8fafe;
  border-radius: 30px;
  box-shadow:
    0 30px 70px rgba(15, 23, 42, 0.24),
    inset 0 2px 6px rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compact-modal {
  max-width: 520px;
}

/* Large Popup Study Card for Lesson Modal */
#lessonModal {
  padding: 16px;
}

#lessonModal .modal-clay-panel {
  max-width: 1300px;
  width: 95vw;
  height: 92vh;
  max-height: 92vh;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.92);
}

#lessonModal .modal-header {
  padding: 18px 28px;
}

#lessonModal .modal-body {
  grid-template-columns: 250px 1fr;
}

.modal-header {
  padding: 22px 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plain-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.modal-category-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.55);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-header p {
  font-size: 0.88rem;
  color: rgba(15, 23, 42, 0.78);
  font-weight: 500;
}

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

.bookmark-btn,
.close-modal-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--clay-pill);
}

.bookmark-btn.saved {
  background: #0f172a;
  color: #fbbf24;
}

.modal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lesson-sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 18px 14px;
  overflow-y: auto;
}

.lesson-sidebar-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 8px 10px;
}

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

.lesson-tab-btn {
  border: none;
  background: #f8fafe;
  border-radius: 16px;
  padding: 12px 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.16s ease;
}

.lesson-tab-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: var(--clay-dark-pill);
}

.lesson-status-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.lesson-tab-btn.completed .lesson-status-dot {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.lesson-tab-text strong {
  display: block;
  font-size: 0.84rem;
  line-height: 1.3;
}

.lesson-tab-text span {
  font-size: 0.74rem;
  opacity: 0.75;
}

.lesson-stage {
  padding: 22px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #f8fafe;
}

.study-container {
  width: 100%;
  max-width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.study-header-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.study-module-tag {
  display: inline-flex;
  align-self: flex-start;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.study-mode-bar {
  display: inline-flex;
  align-self: flex-start;
  background: #e9eff8;
  padding: 5px;
  border-radius: 999px;
  gap: 6px;
  box-shadow: var(--clay-inset);
}

.mode-tab-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mode-tab-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: var(--clay-dark-pill);
}

/* Video Lecture Player (NotebookLM-style) */
#videoLectureView {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#videoLectureView[hidden],
#moduleQuizView[hidden] {
  display: none !important;
}

.lecture-player {
  flex: 1;
  min-height: 460px;
  background: #0b1120;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 22px 48px rgba(15, 23, 42, 0.24),
    inset 0 2px 6px rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
}

.lecture-stage {
  position: relative;
  flex: 1;
  min-height: 400px;
  background: radial-gradient(circle at 20% 20%, #1e293b 0%, #0f172a 55%, #090d16 100%);
  padding: 40px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lecture-stage::-webkit-scrollbar {
  display: none;
}

.lecture-stage::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 70%);
  top: -60px;
  right: -40px;
  pointer-events: none;
}

.lecture-slide {
  position: relative;
  z-index: 2;
  animation: lectureSlideIn 0.35s ease;
}

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

.lecture-slide-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.lecture-slide-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.28;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.lecture-slide-body {
  font-size: 1.02rem;
  line-height: 1.65;
  color: #cbd5e1;
  max-width: 92%;
}

.lecture-slide-body .key-term {
  color: #60a5fa;
}

.lecture-list {
  margin: 14px 0 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 94%;
}

.lecture-list li {
  font-size: 1rem;
  line-height: 1.55;
  color: #e2e8f0;
  padding-left: 4px;
}

.lecture-list li strong.lead-label {
  color: #ffffff;
  font-weight: 800;
}

.lecture-list li .key-term {
  color: #60a5fa;
}

.lecture-slide-formula {
  margin-top: 14px;
  display: inline-block;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: #93c5fd;
  font-weight: 700;
}

.lecture-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 14px;
  background: rgba(9, 13, 22, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 14px;
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: center;
  z-index: 3;
}

.lecture-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 3px;
  padding: 0 4px;
}

.lecture-seg {
  flex: 1;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lecture-seg.done {
  background: #60a5fa;
}

.lecture-seg.active {
  background: #38bdf8;
}

.lecture-controls {
  padding: 12px 18px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lecture-ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lecture-btn {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.16s ease;
}

.lecture-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lecture-btn.primary {
  background: #3b82f6;
  color: #ffffff;
}

.lecture-btn.primary:hover {
  background: #2563eb;
}

.lecture-btn.glow-next {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.75);
  animation: nextGlowPulse 1.4s infinite;
}

@keyframes nextGlowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.8), 0 0 14px rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(96, 165, 250, 0), 0 0 20px rgba(59, 130, 246, 0.9);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0), 0 0 14px rgba(59, 130, 246, 0.7);
  }
}

.lecture-slide-counter {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
}

/* End-of-Lecture 3-Question Quiz */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: lectureSlideIn 0.3s ease;
}

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

.quiz-header h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.quiz-question-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--clay-pill);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.quiz-q-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin-bottom: 12px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-option:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.quiz-option input[type="radio"] {
  accent-color: #0f172a;
  width: 16px;
  height: 16px;
}

.quiz-option.correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

.quiz-option.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

.quiz-result-banner {
  border-radius: 18px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-result-banner.pass {
  background: #dcfce7;
  color: #15803d;
}

.quiz-result-banner.fail {
  background: #fee2e2;
  color: #b91c1c;
}

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

.lesson-stage h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.3;
}

.lesson-summary {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #334155;
  font-weight: 500;
}

.study-section-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.study-points-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.study-point-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--clay-pill);
  border: 1px solid rgba(226, 232, 240, 0.75);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.study-point-num {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.study-point-body {
  flex: 1;
  font-size: 0.96rem;
  line-height: 1.65;
  color: #334155;
}

.study-point-title {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 3px;
}

.key-term {
  color: #2563eb;
  font-weight: 700;
}

.study-deep-dive {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: var(--clay-pill);
  border: 1px solid rgba(226, 232, 240, 0.85);
}

.study-deep-dive p {
  font-size: 0.95rem;
  line-height: 1.72;
  color: #334155;
  margin-bottom: 10px;
}

.study-deep-dive p:last-child {
  margin-bottom: 0;
}

.study-formula-box {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 8px;
  border-left: 3px solid #2563eb;
}

.industry-callout {
  background: linear-gradient(135deg, #eff6ff 0%, #e0edff 100%);
  border-left: 4px solid #2563eb;
  border-radius: 18px;
  padding: 18px 22px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #1e293b;
  box-shadow: var(--clay-pill);
}

.industry-callout strong.callout-label {
  display: block;
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.secondary-pill-btn {
  border: none;
  background: #ffffff;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--clay-pill);
}

/* Add Topic Form */
.add-topic-form {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.add-topic-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.add-topic-form input,
.add-topic-form select,
.add-topic-form textarea {
  border: none;
  background: #eff4fb;
  border-radius: 14px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink-primary);
  box-shadow: var(--clay-inset);
  outline: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Empty State & Toast */
.empty-state {
  text-align: center;
  padding: 46px 20px;
  background: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: var(--clay-card);
}

.empty-emoji {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--ink-muted);
  margin: 6px 0 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--clay-dark-pill);
  z-index: 200;
}

/* Floating Live AI Button & Drawer */
.floating-ai-btn {
  position: fixed;
  bottom: 24px;
  right: 26px;
  z-index: 150;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow:
    0 16px 34px rgba(30, 58, 138, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-ai-btn:hover {
  transform: translateY(-3px);
}

.floating-ai-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.live-ai-drawer {
  position: fixed;
  bottom: 24px;
  right: 26px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 48px);
  background: #f8fafe;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 28px 60px rgba(15, 23, 42, 0.22),
    inset 0 2px 6px rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 160;
}

.live-ai-drawer[hidden] {
  display: none;
}

.live-ai-header {
  background: linear-gradient(125deg, #98a8ff 0%, #68b5ff 55%, #7ad3ff 100%);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.live-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.72);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.live-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.live-status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28);
}

.live-status-dot.connecting {
  background: #f59e0b;
}

.live-ai-title-wrap h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0b1120;
}

.live-ai-title-wrap p {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.78);
}

.live-ai-key-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.live-ai-key-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: #eff4fb;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  box-shadow: var(--clay-inset);
  outline: none;
}

.small-pill {
  padding: 8px 14px;
  font-size: 0.78rem;
}

.live-ai-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px 4px;
  overflow-x: auto;
}

.ai-chip {
  border: none;
  background: #ffffff;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--clay-pill);
}

.ai-chip:hover {
  background: #eef4ff;
}

.live-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-msg {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 90%;
}

.ai-msg.assistant {
  background: #ffffff;
  color: var(--ink-primary);
  align-self: flex-start;
  box-shadow: var(--clay-pill);
}

.ai-msg.user {
  background: #0f172a;
  color: #ffffff;
  align-self: flex-end;
  box-shadow: var(--clay-dark-pill);
}

.ai-msg strong {
  display: block;
  font-size: 0.72rem;
  opacity: 0.75;
  margin-bottom: 2px;
}

.live-ai-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.live-ai-input-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: #eff4fb;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-family: inherit;
  font-size: 0.84rem;
  box-shadow: var(--clay-inset);
  outline: none;
}

.mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #eff4fb;
  color: var(--ink-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--clay-pill);
  flex-shrink: 0;
}

.mic-btn.recording {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

.mic-btn:disabled,
.live-ai-input-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Desktop / Landscape Only Gate */
.desktop-only-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 12% 15%, #eef4ff 0%, #e4ecf8 48%, #dde7f6 100%);
  z-index: 10000;
  padding: 24px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.desktop-only-card {
  max-width: 380px;
  background: #ffffff;
  border-radius: 28px;
  padding: 32px 26px;
  box-shadow: var(--clay-card);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.desktop-only-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.desktop-only-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.desktop-only-card p {
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Block Mobile & Portrait Mode */
@media (max-width: 900px), (orientation: portrait) and (max-width: 1024px) {
  .desktop-only-screen {
    display: flex;
  }
  .app-backdrop,
  .pin-lock-screen {
    display: none !important;
  }
}
