/* 
 * Songkhep AI - NoteGPT Inspired Clean UI System
 * Engineered with Taste Skill Anti-Slop System (https://www.tasteskill.dev)
 * Aesthetic Read: Cold Precision Monochrome + Cobalt Pop (Zero Warm-Beige Cliché)
 */

:root {
  --bg-dark-base: #fafafa;
  --bg-dark-surface: #ffffff;
  --bg-dark-card: #f8fafc;
  --bg-dark-subtle: #f1f5f9;
  --bg-dark-hover: #e2e8f0;
  
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.16);
  --border-focus: #0f172a;

  --accent-blue: #090d16;
  --accent-blue-hover: #1e293b;
  --accent-blue-glow: rgba(37, 99, 235, 0.08);

  --text-main: #090d16;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 16px -8px rgba(15, 23, 42, 0.06);
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body.dark-theme {
  font-family: 'Baloo Da 2', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark-base);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

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

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* 1. Slim Icon Navigation (NoteGPT Left Bar) */
.slim-nav {
  width: 72px;
  min-width: 72px;
  background-color: var(--bg-dark-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  z-index: 50;
}

.nav-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-dark-card);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 58px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-btn:hover {
  background-color: var(--bg-dark-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.nav-btn:active {
  transform: scale(0.96);
}

.nav-btn.active {
  background-color: var(--text-main);
  color: #ffffff;
  border: 1px solid var(--text-main);
}

.nav-label {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Avatar at Bottom */
.nav-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-avatar-btn {
  cursor: pointer;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text-main);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-card);
}

/* 2. Notes Drawer (Sliding Left Panel) */
.notes-drawer {
  width: 300px;
  min-width: 300px;
  background-color: var(--bg-dark-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: slideIn 0.2s ease;
  z-index: 40;
}

@keyframes slideIn {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-title-group h3 {
  font-size: 16.5px;
  font-weight: 700;
}

.drawer-count-badge {
  font-size: 12px;
  font-family: var(--font-mono);
  background-color: var(--bg-dark-card);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-dark-card);
}

.drawer-search {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-search input {
  width: 100%;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text-main);
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.drawer-search input:focus {
  border-color: var(--border-focus);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-card:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-dark-subtle);
  transform: translateY(-1px);
}

.drawer-card:active {
  transform: scale(0.985);
}

.drawer-thumb {
  width: 70px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #000;
}

.drawer-card-info {
  flex: 1;
  overflow: hidden;
}

.drawer-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.drawer-card-date {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 3. Main Content Workspace */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  background-color: var(--bg-dark-base);
}

/* Topbar */
.app-topbar {
  height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-dark-surface);
}

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

.topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.topbar-icon-btn:active {
  transform: scale(0.97);
}

.doc-active-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-pill {
  background-color: var(--bg-dark-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.auth-pill:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-dark-card);
}

.auth-pill:active {
  transform: scale(0.97);
}

.topbar-btn {
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.topbar-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

/* VIEW A: NoteGPT Hero Input View */
.home-hero-layout {
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px 60px;
  display: flex;
  justify-content: center;
}

.hero-center-box {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 12px;
  text-align: center;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 28px;
  text-align: center;
}

/* Source Type Segmented Switcher (Taste Skill Clean Minimalist) */
.source-pills-row {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  background-color: var(--bg-dark-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.source-pill:hover {
  color: var(--text-main);
}

.source-pill:active {
  transform: scale(0.97);
}

.source-pill.active {
  background-color: #ffffff;
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Glass Card Input Box */
.input-glass-card {
  width: 100%;
  background-color: var(--bg-dark-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.input-textarea-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.15s ease;
}

.input-textarea-wrapper:focus-within {
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px var(--border-focus);
}

.input-textarea-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 15.5px;
  line-height: 1.5;
}

.clear-input-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s ease;
}

.clear-input-icon-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-dark-subtle);
}

.dropzone-box {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-dark-card);
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone-box:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-dark-subtle);
}

.hidden-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 30px;
  display: block;
  margin-bottom: 8px;
}

.dropzone-box p {
  font-size: 15px;
  color: var(--text-secondary);
}

.card-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.model-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.engine-badge {
  font-size: 13px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background-color: var(--bg-dark-card);
  padding: 5px 10px;
  border-radius: 6px;
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.clean-select {
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  outline: none;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.clean-select:focus {
  border-color: var(--border-focus);
}

.generate-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background-color: var(--text-main);
  color: #ffffff;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--text-main);
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.generate-action-btn:hover {
  background-color: #222222;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* My Notes Section (Cards with Images / Thumbnails) */
.my-notes-section {
  width: 100%;
  margin-top: 42px;
}

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

.notes-section-title {
  font-size: 19px;
  font-weight: 700;
}

.view-all-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}

.view-all-link:hover {
  color: #60a5fa;
}

.notes-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.video-note-card {
  background-color: var(--bg-dark-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.video-note-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.video-note-card:active {
  transform: scale(0.985);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 145px;
  background-color: #000;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-note-card:hover .card-img-wrapper img {
  transform: scale(1.03);
}

.card-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
}

/* Note Delete Buttons (Taste Skill High-Contrast / Anti-Slop) */
.card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(4px);
}

.video-note-card:hover .card-delete-btn {
  opacity: 1;
}

.card-delete-btn:hover {
  background-color: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
}

.card-delete-btn:active {
  transform: scale(0.95);
}

.drawer-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 6px;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.drawer-card:hover .drawer-delete-btn {
  opacity: 1;
}

.drawer-delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.28);
  transform: scale(1.08);
}

.drawer-delete-btn:active {
  transform: scale(0.95);
}

.card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.card-platform-tag {
  background-color: var(--bg-dark-card);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

/* VIEW B: Loading View */
.loading-state-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.pulse-loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  animation: pulse 1.4s infinite;
  margin-bottom: 24px;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* VIEW C: NoteGPT Split Screen Workspace */
.workspace-split-layout {
  flex: 1;
  display: flex;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* Left Panel: Video + Transcript */
.workspace-left-panel {
  width: 440px;
  min-width: 400px;
  background-color: var(--bg-dark-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-preview-card {
  position: relative;
  width: 100%;
  height: 220px;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-thumbnail-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay-button {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: rgba(220, 38, 38, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.video-meta-overlay {
  position: absolute;
  bottom: 8px;
  right: 10px;
}

.duration-badge {
  background-color: rgba(0, 0, 0, 0.8);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.transcript-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.transcript-box-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-dark-card);
}

.transcript-subtabs {
  display: flex;
  gap: 8px;
}

.ts-tab {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.ts-tab:hover {
  color: var(--text-main);
}

.ts-tab.active {
  color: #60a5fa;
  background-color: var(--accent-blue-glow);
}

.transcript-quick-tools {
  display: flex;
  gap: 8px;
}

.mini-tool-btn {
  background-color: var(--bg-dark-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-tool-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.mini-tool-btn:active {
  transform: scale(0.96);
}

.transcript-segments-stream {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ts-segment-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  transition: background-color 0.15s ease;
}

.ts-segment-row:hover {
  background-color: var(--bg-dark-card);
}

.ts-time-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: #60a5fa;
  font-weight: 600;
}

.ts-text {
  font-size: 15.5px;
  color: var(--text-main);
  line-height: 1.68;
}

/* Right Panel: AI Notes & Mind Map */
.workspace-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark-base);
}

.panel-mode-toggle {
  display: flex;
  gap: 10px;
  padding: 14px 28px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.mode-tab:hover {
  color: var(--text-main);
}

.mode-tab.active {
  color: var(--text-ink);
  border-bottom-color: var(--text-ink);
}

.feature-pills-bar {
  display: flex;
  gap: 8px;
  padding: 12px 28px;
  background-color: var(--bg-dark-surface);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.feature-pill:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.feature-pill:active {
  transform: scale(0.97);
}

.feature-pill.active {
  background-color: var(--btn-ink);
  color: #ffffff;
  border-color: var(--btn-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.notes-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editorial-box {
  background-color: var(--bg-dark-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.box-header-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.box-header-title h4, .editorial-h3 {
  font-size: 20px;
  font-weight: 700;
}

.pill-mini-btn {
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-mini-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.pill-mini-btn:active {
  transform: scale(0.96);
}

.editorial-paragraph {
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--text-main);
}

/* Mind Map Visual Canvas */
.mindmap-box {
  border-left: 3px solid #3b82f6;
}

.mindmap-visual-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.mm-root-node {
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  color: #93c5fd;
}

.mm-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.mm-branch-tag {
  background-color: var(--bg-dark-subtle);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text-secondary);
}

/* NoteGPT Highlights */
.editorial-highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-main);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.highlight-item:hover {
  border-color: var(--border-hover);
  transform: translateX(2px);
}

/* NoteGPT Key Insights */
.editorial-insights-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-card {
  padding: 16px 18px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.insight-card:hover {
  border-color: var(--border-hover);
}

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

.insight-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.insight-details-text {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-secondary);
}

/* NoteGPT Markdown Output - High Contrast Crisp Code Terminal */
.notegpt-markdown-box {
  background-color: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.72;
  color: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 540px;
  overflow-y: auto;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Takeaways */
.editorial-takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.takeaway-row-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 15.5px;
  line-height: 1.6;
}

.takeaway-ts {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  background-color: var(--accent-blue);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  height: fit-content;
  white-space: nowrap;
}

/* Chapters */
.editorial-chapters-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chapter-card-item {
  border-left: 3px solid #3b82f6;
  padding-left: 16px;
}

.chapter-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.chapter-title-text {
  font-size: 16.5px;
  font-weight: 700;
}

.chapter-summary-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Chat Stream Inside Panel */
.chat-panel-container {
  height: 520px;
  display: flex;
  flex-direction: column;
}

.chat-stream-box {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.65;
}

.chat-msg.bot {
  align-self: flex-start;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-blue);
  color: #fff;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.chat-input-row input {
  flex: 1;
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s ease;
}

.chat-input-row input:focus {
  border-color: var(--border-focus);
}

.chat-send-action {
  background-color: var(--accent-blue);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.chat-send-action:hover {
  background-color: var(--accent-blue-hover);
}

.chat-send-action:active {
  transform: scale(0.96);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.auth-modal-card {
  width: 440px;
  max-width: 92vw;
  background-color: var(--bg-dark-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-top h3 {
  font-size: 19px;
  font-weight: 700;
}

.modal-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-dark-card);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 9px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  transition: all 0.15s ease;
}

.auth-tab.active {
  background-color: var(--bg-dark-surface);
  color: var(--text-main);
}

.auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  background-color: var(--bg-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--border-focus);
}

.auth-submit-btn {
  background-color: var(--text-main);
  border: 1px solid var(--text-main);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
}

.auth-submit-btn:hover {
  background-color: #222222;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.auth-error-text {
  color: #ef4444;
  font-size: 13.5px;
}

/* =====================================================================
   USER PROFILE DROPDOWN (NoteGPT / Taste Skill Precision Component)
   ===================================================================== */
.profile-dropdown-card {
  position: absolute;
  top: 58px;
  right: 18px;
  width: 310px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  animation: dropdownFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background-color: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.profile-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #0f172a;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.profile-info-block {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-info-block h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-info-block p {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-plan-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.profile-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.profile-stat-box {
  background-color: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.profile-stat-box .stat-num {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.profile-stat-box .stat-lbl {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.profile-card-actions {
  padding: 8px;
}

.profile-action-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.profile-action-row:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.profile-card-footer {
  padding: 8px 12px 12px 12px;
  border-top: 1px solid #f1f5f9;
}

.profile-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  color: #dc2626;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-logout-btn:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* =====================================================================
   TOAST NOTIFICATION SYSTEM (Taste Skill Clean Toasts)
   ===================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #0f172a;
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.25);
  border: 1px solid #334155;
  animation: toastSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-msg.toast-success {
  border-left: 4px solid #10b981;
}

.toast-msg.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-msg.toast-info {
  border-left: 4px solid #3b82f6;
}

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

