/* Apple-style Matte Black / Matte White Minimalism */

:root {
  --bg: #F2F0EF;
  --bg-2: #ffffff;
  --bg-3: #e5e5ea;
  --text-main: #1d1d1f;
  --text-muted: #86868b;
  --border: #d2d2d7;
  --accent: #000000;
  --bg-alpha: rgba(242, 240, 239, 0.85);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  
  --nav-height: 60px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #1c1c1e;
  --bg-3: #2c2c2e;
  --text-main: #F5F5F7;
  --text-muted: #86868b;
  --border: #38383a;
  --accent: #ffffff;
  --bg-alpha: rgba(0, 0, 0, 0.85);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.initially-hidden {
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.initially-hidden.revealed {
  opacity: 1;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input, select, textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.text-center {
  text-align: center;
}

/* Staggered Reveal Animation */
.stagger-reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: staggerRevealAnim 0.6s var(--ease) forwards;
}
@keyframes staggerRevealAnim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Intro Animation Overlay */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 1.5s var(--ease), backdrop-filter 1.5s var(--ease), opacity 1s var(--ease);
}
.intro-text {
  color: var(--text-main);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  text-align: center;
  transition: all 1.5s var(--ease);
  letter-spacing: -0.04em;
}

/* Typewriter Utils */
.type-cursor {
  animation: blink 1s step-end infinite;
  display: inline-block;
  margin-left: 4px;
  color: var(--text-main);
  vertical-align: bottom;
}
@keyframes blink { 50% { opacity: 0; } }

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center; /* Centered tabs */
  padding: 0 40px;
  background: var(--bg-alpha);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav-logo {
  position: absolute;
  left: 40px;
  display: flex;
  align-items: center;
}
.nav-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-right-actions {
  position: absolute;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-btn {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.nav-btn:hover {
  color: var(--text-main);
}
.nav-btn.active {
  color: var(--bg);
  background: var(--text-main);
}

/* Page wrap */
.page-wrap {
  padding-top: var(--nav-height);
}
.page {
  display: none;
  min-height: calc(100vh - var(--nav-height));
  animation: fadeIn 0.3s ease;
}
.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Auth View Crossfade Animation */
.auth-view {
  animation: fadeInView 0.3s ease-out;
  display: none;
}
.auth-view.active {
  display: block;
}
@keyframes fadeInView {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.2s var(--ease), background 0.2s, opacity 0.2s, color 0.3s var(--ease);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}
.btn-primary {
  background: var(--text-main);
  color: var(--bg);
}
.btn-primary:hover {
  transform: scale(1.02);
  opacity: 0.9;
}
.btn-ghost {
  background: var(--bg-2);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-3);
  transform: scale(1.02);
}
.btn-circular {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-circular:hover {
  background: var(--bg-3);
  transform: scale(1.05);
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

/* Hero */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 60px;
}
.hero-content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.hero-h1 {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 24px;
  color: var(--text-main);
}
.hero-sub {
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 40px;
  max-width: 600px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Videos */
.split-video-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
}
.video-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.video-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}
.split-video-container .inline-video {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.inline-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-3);
}

/* Explorer */
.explorer {
  padding: 80px 24px;
  max-width: 1024px;
  margin: 0 auto;
}
.explorer-header {
  margin-bottom: 40px;
}
.explorer-header h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.explorer-header p {
  color: var(--text-muted);
  font-size: 16px;
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}
.filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.filter-select {
  appearance: none;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.filter-select:focus {
  border-color: var(--text-muted);
}
.add-compare-btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-3);
  color: var(--text-main);
  border: 1px solid var(--border);
  transition: all 0.2s;
  height: 46px;
}
.add-compare-btn:hover:not(:disabled) {
  background: var(--text-muted);
  color: var(--bg);
}
.add-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.topics-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.topics-grid {
  display: grid;
  gap: 24px;
}
.topic-group {
  margin-bottom: 16px;
}
.topic-group-header {
  margin-bottom: 12px;
}
.topic-chip-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.topic-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.question-summary-btn {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
  transition: background 0.2s, border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.question-summary-btn:hover {
  background: var(--bg-3);
}
.question-summary-btn strong {
  font-weight: 600;
  color: var(--text-main);
}

/* Compare */
.compare-tray {
  margin-top: 60px;
  display: none;
}
.compare-tray.visible {
  display: block;
}
.compare-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.compare-tray-title {
  font-size: 18px;
  font-weight: 600;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.compare-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.compare-panel-head {
  padding: 16px 20px;
  background: var(--bg-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.compare-panel-title {
  font-weight: 600;
  font-size: 15px;
}
.compare-panel-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.compare-panel-remove {
  font-size: 20px;
  color: var(--text-muted);
}
.compare-panel-remove:hover {
  color: var(--text-main);
}
.compare-panel-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compare-chip {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.compare-chip:hover {
  border-color: var(--text-muted);
}
.compare-q-count {
  color: var(--text-muted);
}

/* Chat Page */
.chat-page {
  display: flex;
  height: calc(100vh - var(--nav-height));
  background: var(--bg);
}
.chat-sidebar {
  width: 280px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 32px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.chat-sidebar-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.chat-history-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-history-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-history-list li:hover {
  background: var(--bg-3);
  color: var(--text-main);
}
.chat-history-list li.active {
  background: var(--bg-3);
  color: var(--text-main);
  font-weight: 500;
}
.analytics-stat {
  background: var(--bg-3);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color 0.3s var(--ease);
}
.stat-val {
  font-size: 24px;
  font-weight: 700;
}
.stat-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.chat-top-bar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s var(--ease);
}
.chat-top-bar h2 {
  font-size: 18px;
  font-weight: 600;
}
.chat-notice {
  font-size: 12px;
  color: var(--text-muted);
}

.prompts-strip {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s var(--ease);
}
.prompts-strip::-webkit-scrollbar { height: 0; }
.prompt-chip {
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-muted);
  transition: all 0.2s;
}
.prompt-chip:hover {
  background: var(--bg-3);
  color: var(--text-main);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px;
}
.msg-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  line-height: 1.6;
  max-width: 85%;
}
.msg-user {
  background: var(--text-main);
  color: var(--bg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-ai {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.msg-ai p { margin-bottom: 12px; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai ul, .msg-ai ol { margin: 8px 0; padding-left: 20px; }
.msg-ai code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }

.sources-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: flex-start;
}
.source-tag {
  padding: 4px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.source-tag strong {
  color: var(--text-main);
}
.citation-btn {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8em;
  vertical-align: super;
  padding: 0 4px;
  cursor: pointer;
}
.citation-btn:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.chat-input-area {
  padding: 24px;
}
.chat-input-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  transition: border-color 0.2s, background-color 0.3s var(--ease);
}
.chat-input-wrap:focus-within {
  border-color: var(--text-muted);
}
.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 15px;
  resize: none;
  max-height: 150px;
  padding: 6px 0;
}
.chat-input::placeholder {
  color: var(--text-muted);
}
.chat-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text-main);
  color: var(--bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.chat-send:hover:not(:disabled) {
  transform: scale(1.05);
}
.chat-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.empty-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  text-align: center;
}
.empty-chat h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
  position: relative;
}
.modal-overlay.open .modal {
  transform: scale(1);
}
.modal-head {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: border-color 0.3s var(--ease);
}
.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.modal-meta {
  display: flex;
  gap: 8px;
}
.modal-meta-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.3s var(--ease);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.modal-close:hover {
  background: var(--text-main);
  color: var(--bg);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.q-card {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.3s var(--ease);
}
.q-card-head {
  margin-bottom: 12px;
}
.q-num-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-main);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  z-index: 400;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 24px;
}
.dashboard-widget {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s var(--ease);
}
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.widget-header h3 {
  font-size: 16px;
  font-weight: 600;
}
.btn-close-widget {
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s var(--ease);
}
.btn-close-widget:hover {
  color: var(--text-main);
}
.widget-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.widget-list li {
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 12px;
  border-radius: var(--radius);
  transition: background-color 0.3s var(--ease);
}
.widget-list li strong {
  color: var(--text-main);
}
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: background-color 0.3s var(--ease);
}
.progress-bar {
  height: 100%;
  background: var(--text-main);
}
.widget-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Creative Studio */
.studio-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
.studio-controls.panel {
  background: var(--bg-2);
  border: 1px solid rgba(134, 134, 139, 0.2);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.studio-preview.panel {
  border-radius: 24px;
  padding: 0; 
  border: 1px solid rgba(134, 134, 139, 0.2);
  background-color: var(--bg);
  background-image: 
    linear-gradient(rgba(134, 134, 139, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134, 134, 139, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center top;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

[data-theme="light"] .studio-preview.panel {
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.03);
}
[data-theme="light"] .studio-controls.panel {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  text-align: center;
}
.preview-content {
  padding: 40px;
  background: var(--bg-2);
  border-radius: 12px;
  margin: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.custom-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: var(--bg-3);
  transition: all 0.2s var(--ease);
  flex: 1;
  justify-content: center;
}
.custom-radio input[type="radio"] {
  display: none;
}
.custom-radio:has(input:checked) {
  border-color: var(--text-main);
  background: var(--text-main);
  color: var(--bg);
  font-weight: 600;
}

/* Timetable */
.timetable-page {
  display: flex;
  height: calc(100vh - var(--nav-height));
}
.tt-chat-area {
  max-width: 400px;
}
.timetable-visual {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}
.tt-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tt-day {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.tt-day h4 {
  font-size: 15px;
  margin-bottom: 12px;
}
.tt-block {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--bg-3);
  border-radius: 8px;
  transition: background-color 0.3s var(--ease);
}
.tt-block input[type="checkbox"] {
  accent-color: var(--text-main);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Custom GPTs (NotebookLM clone) */
.customgpt-page {
  display: flex;
  height: calc(100vh - var(--nav-height));
  background: var(--bg);
}
.gpt-sidebar {
  width: 320px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
  overflow-y: auto;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.gpt-sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
}
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-3);
  transition: all 0.2s var(--ease);
  cursor: pointer;
}
.drop-zone:hover {
  border-color: var(--text-muted);
  background: var(--bg-2);
}
.kb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-3);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.kb-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.kb-icon {
  font-size: 18px;
}
.kb-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-2);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid var(--border);
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--text-main);
  border-color: var(--text-main);
}
input:checked + .slider:before {
  transform: translateX(16px);
  background-color: var(--bg);
}

/* Role Cards in Wizard */
.role-card {
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.role-card:hover {
  background: var(--bg-3);
  border-color: var(--text-muted);
}
.role-card.selected {
  border-color: var(--text-main);
  background: var(--bg-3);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: all 0.3s var(--ease);
}
.pricing-card.featured {
  border-color: var(--text-muted);
  transform: translateY(-8px);
}
.badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.pricing-card h3 {
  font-size: 20px;
  margin-bottom: 16px;
}
.price {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 24px;
}
.price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}
.pricing-features {
  list-style: none;
  margin-bottom: 32px;
  text-align: left;
  flex: 1;
}
.pricing-features li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
}
.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="20 6 9 17 4 12"/></svg>') no-repeat center;
  mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="20 6 9 17 4 12"/></svg>') no-repeat center;
  color: var(--text-main);
}

/* Marquee / Testimonials */
.testimonials-section {
  padding: 120px 0;
  background: var(--bg);
  overflow: hidden;
  transition: background-color 0.3s var(--ease);
}
.marquee-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 20px 0;
}
.marquee-content {
  display: flex;
  width: max-content;
  animation: marquee 60s linear infinite;
  gap: 24px;
  padding-left: 24px;
}
.marquee-content:hover {
  animation-play-state: paused;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 12px)); }
}
.testimonial-card {
  width: 350px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.testimonial-quote {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.6;
  font-style: italic;
}
.testimonial-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Auth Wizard Checkboxes */
.subject-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-main);
  transition: border-color 0.3s var(--ease);
}
.subject-checkboxes label:last-child {
  border-bottom: none;
}
.subject-checkboxes input[type="checkbox"] {
  accent-color: var(--text-main);
  width: 16px;
  height: 16px;
}

.stats-section {
  padding: 120px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: center;
}
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.stat-num {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1;
}
.stat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.how-it-works { padding: 120px 0; }
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
}
.how-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.how-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--text-main);
  transition: background-color 0.3s var(--ease);
}
.how-title { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.how-text { font-size: 15px; color: var(--text-muted); }

.split-video-section { padding-bottom: 120px; }
.footer { padding: 60px 0; border-top: 1px solid var(--border); text-align: center; transition: border-color 0.3s var(--ease); }

@media(max-width: 768px) {
  .nav { padding: 0 20px; justify-content: space-between; }
  .nav-logo { position: static; display: flex; }
  .nav-right-actions { position: static; }
  .hero-h1 { font-size: 40px; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .split-video-container { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
  .how-grid { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .studio-layout { grid-template-columns: 1fr; }
  .timetable-page { flex-direction: column; height: auto; }
  .tt-chat-area { max-width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .customgpt-page { flex-direction: column; height: auto; }
  .gpt-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}

/* AI Thinking UI */
.thinking-container { margin-bottom: 12px; user-select: none; }
.thinking-header {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 16px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 100px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.thinking-shimmer {
  font-size: 12px; font-weight: 500;
  background: linear-gradient(90deg, #86868b 0%, #f5f5f7 50%, #86868b 100%);
  background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.thinking-content {
  max-height: 0; overflow: hidden; font-size: 13px; color: #86868b;
  border-left: 2px solid var(--border); margin-left: 14px; padding-left: 16px; opacity: 0;
  transition: border-color 0.3s var(--ease);
}
.thinking-content.expanded { max-height: 800px; margin-top: 12px; opacity: 1; }