/* ==========================================================================
   NotePlus Play — Design Tokens & Components
   Loaded alongside Tailwind CDN + Metronic during incremental migration.
   Scoped to .np-* classes and body[data-np-shell] to avoid bleed into
   un-migrated Metronic pages.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --np-brand:        #10B981;
  --np-brand-dark:   #059669;
  --np-brand-darker: #047857;
  --np-brand-light:  #D1FAE5;
  --np-brand-soft:   #ECFDF5;

  --np-ai:        #8B5CF6;
  --np-ai-dark:   #7C3AED;
  --np-ai-darker: #6D28D9;
  --np-ai-light:  #EDE9FE;

  --np-streak:        #F59E0B;
  --np-streak-dark:   #D97706;
  --np-streak-darker: #B45309;
  --np-streak-light:  #FEF3C7;

  --np-achieve:       #EC4899;
  --np-achieve-dark:  #DB2777;
  --np-achieve-light: #FCE7F3;

  --np-gold:      #FFB800;
  --np-gold-dark: #D89200;

  --np-ink:       #0F172A;
  --np-ink-soft:  #334155;
  --np-ink-muted: #64748B;

  --np-paper:      #FAFAF9;
  --np-paper-warm: #FDFCFB;
  --np-border:     #F1F5F9;
  --np-border-2:   #E2E8F0;

  /* Surfaces (these flip in dark mode) */
  --np-surface:       #ffffff;
  --np-surface-2:     #F8FAFC;
  --np-surface-hover: #F8FAFC;
  --np-topbar-bg:     rgba(250, 250, 249, 0.82);

  /* Per-subject theme variables — set dynamically; defaults match brand */
  --np-subject:        var(--np-brand);
  --np-subject-dark:   var(--np-brand-dark);
  --np-subject-darker: var(--np-brand-darker);
  --np-subject-soft:   var(--np-brand-soft);
  --np-subject-light:  var(--np-brand-light);

  /* Typography */
  --np-font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --np-font-sans:    'Inter', system-ui, sans-serif;
  --np-font-chunky:  'Nunito', system-ui, sans-serif;
  --np-font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Dark mode token overrides ---------- */
/* Activated by html[data-np-theme="dark"] (set in base.html before paint). */
html[data-np-theme="dark"] {
  /* Soft/translucent backgrounds so chips & active states aren't blinding */
  --np-brand-soft:    rgba(16, 185, 129, 0.16);
  --np-brand-light:   rgba(16, 185, 129, 0.24);
  --np-ai-light:      rgba(139, 92, 246, 0.22);
  --np-streak-light:  rgba(245, 158, 11, 0.20);
  --np-achieve-light: rgba(236, 72, 153, 0.22);

  /* Ink / text */
  --np-ink:       #E6EAF2;
  --np-ink-soft:  #C2CAD8;
  --np-ink-muted: #8B95A7;

  /* Surfaces & lines */
  --np-paper:         #0E1422;
  --np-paper-warm:    #131A2A;
  --np-border:        #232C3D;
  --np-border-2:      #38435C;
  --np-surface:       #161E2E;
  --np-surface-2:     #1E2738;
  --np-surface-hover: #232E44;
  --np-topbar-bg:     rgba(14, 20, 34, 0.85);

  /* Per-subject defaults follow the brand */
  --np-subject:        var(--np-brand);
  --np-subject-dark:   var(--np-brand-dark);
  --np-subject-darker: #6EE7B7;
  --np-subject-soft:   rgba(16, 185, 129, 0.16);
  --np-subject-light:  rgba(16, 185, 129, 0.24);

  color-scheme: dark;
}

/* Light-on-soft text for chips, crumbs & active nav in dark mode */
html[data-np-theme="dark"] .np-pill-brand   { color: #6EE7B7; }
html[data-np-theme="dark"] .np-pill-ai      { color: #C4B5FD; }
html[data-np-theme="dark"] .np-pill-streak  { color: #FCD34D; }
html[data-np-theme="dark"] .np-pill-achieve { color: #F9A8D4; }
html[data-np-theme="dark"] .np-pill-gold    { color: #FCD34D; }
html[data-np-theme="dark"] .np-crumb,
html[data-np-theme="dark"] .np-crumb:hover  { color: #6EE7B7; }
html[data-np-theme="dark"] .np-crumb-current,
html[data-np-theme="dark"] .np-crumb-current:hover { color: #fff; }
html[data-np-theme="dark"] .np-nav-item.active            { color: #6EE7B7; }
html[data-np-theme="dark"] .np-nav-item.active .np-nav-ic { color: #34D399; }

/* Headings: Metronic forces a near-black heading color (--bs-heading-color
   #071437) on h1-h6, which doesn't flip. Follow the ink token in dark mode. */
html[data-np-theme="dark"] body[data-np-shell] h1,
html[data-np-theme="dark"] body[data-np-shell] h2,
html[data-np-theme="dark"] body[data-np-shell] h3,
html[data-np-theme="dark"] body[data-np-shell] h4,
html[data-np-theme="dark"] body[data-np-shell] h5,
html[data-np-theme="dark"] body[data-np-shell] h6 { color: var(--np-ink); }

/* Active topic row label used dark-brand text on a soft-green chip */
html[data-np-theme="dark"] .np-topic-row.np-topic-active span { color: #6EE7B7 !important; }

/* Math help panel sits on a translucent purple in dark mode */
html[data-np-theme="dark"] #mathHelp,
html[data-np-theme="dark"] #mathHelp code { color: var(--np-ink-soft); }

/* Surfaces that were hardcoded gradients */
html[data-np-theme="dark"] .np-tutor-feed { background: var(--np-surface); }

/* Theme-toggle icon swap (sun shown in dark, moon shown in light) */
.np-theme-ic-sun { display: none; }
html[data-np-theme="dark"] .np-theme-ic-sun  { display: inline-flex; }
html[data-np-theme="dark"] .np-theme-ic-moon { display: none; }

/* ---------- Body & root container ---------- */
body[data-np-shell] {
  font-family: var(--np-font-sans);
  background: var(--np-paper);
  color: var(--np-ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

body[data-np-shell] h1,
body[data-np-shell] h2,
body[data-np-shell] h3,
body[data-np-shell] h4,
body[data-np-shell] .np-display {
  font-family: var(--np-font-display);
  letter-spacing: -0.01em;
}

/* Hide legacy Metronic chrome wrappers when running NotePlus Play shell */
body[data-np-shell] #kt_app_header,
body[data-np-shell] #kt_app_footer,
body[data-np-shell] #kt_app_toolbar {
  display: none !important;
}

/* ---------- Chunky button system ---------- */
.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--np-font-chunky);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 16px;
  padding: 14px 22px;
  border: 2px solid transparent;
  transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
  user-select: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}
.np-btn:active { transform: translateY(2px); }
.np-btn-primary { background: var(--np-brand); color: #fff; border-color: var(--np-brand-dark); box-shadow: 0 4px 0 0 var(--np-brand-darker); }
.np-btn-primary:active { box-shadow: 0 2px 0 0 var(--np-brand-darker); }
.np-btn-primary:hover  { background: var(--np-brand-dark); color: #fff; }

.np-btn-ai { background: var(--np-ai); color: #fff; border-color: var(--np-ai-dark); box-shadow: 0 4px 0 0 var(--np-ai-darker); }
.np-btn-ai:active { box-shadow: 0 2px 0 0 var(--np-ai-darker); }
.np-btn-ai:hover  { background: var(--np-ai-dark); color: #fff; }

.np-btn-streak { background: var(--np-streak); color: #fff; border-color: var(--np-streak-dark); box-shadow: 0 4px 0 0 var(--np-streak-darker); }
.np-btn-streak:active { box-shadow: 0 2px 0 0 var(--np-streak-darker); }

.np-btn-gold { background: var(--np-gold); color: #5C3D00; border-color: var(--np-gold-dark); box-shadow: 0 4px 0 0 #A06A00; }
.np-btn-gold:active { box-shadow: 0 2px 0 0 #A06A00; }

.np-btn-outline { background: var(--np-surface); color: var(--np-ink); border-color: var(--np-border-2); box-shadow: 0 4px 0 0 var(--np-border-2); }
.np-btn-outline:active { box-shadow: 0 2px 0 0 var(--np-border-2); }
.np-btn-outline:hover  { background: var(--np-surface-hover); }

.np-btn-ghost { background: transparent; color: var(--np-ink); border-color: transparent; box-shadow: none; }
.np-btn-ghost:hover { background: var(--np-border); }

.np-btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 12px; }
.np-btn-lg { padding: 18px 30px; font-size: 16px; }

/* ---------- Pills / chips ---------- */
.np-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--np-border);
  color: var(--np-ink-soft);
}
.np-pill-brand   { background: var(--np-brand-soft);   color: var(--np-brand-darker); }
.np-pill-ai      { background: var(--np-ai-light);     color: var(--np-ai-darker); }
.np-pill-streak  { background: var(--np-streak-light); color: var(--np-streak-darker); }
.np-pill-achieve { background: var(--np-achieve-light);color: var(--np-achieve-dark); }
.np-pill-gold    { background: rgba(255,184,0,0.18);   color: var(--np-gold-dark); }
.np-pill-pro {
  background: linear-gradient(90deg, var(--np-streak), var(--np-achieve));
  color: #fff;
  font-weight: 700;
}

/* ---------- Cards ---------- */
.np-card {
  background: var(--np-surface);
  border: 1.5px solid var(--np-border);
  border-radius: 24px;
  padding: 24px;
  transition: border-color .15s ease, transform .15s ease;
}
.np-card:hover { border-color: var(--np-border-2); }
.np-card-flat { background: var(--np-surface); border: 1px solid var(--np-border); border-radius: 16px; }

/* ---------- Sidebar ---------- */
.np-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--np-surface);
  border-right: 1.5px solid var(--np-border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  z-index: 30;
}

.np-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--np-ink-muted);
  cursor: pointer;
  transition: all .12s ease;
  text-decoration: none;
  font-size: 14px;
}
.np-nav-item:hover { background: var(--np-border); color: var(--np-ink); }
.np-nav-item.active {
  background: var(--np-subject-soft);
  color: var(--np-subject-darker);
}
.np-nav-item.active .np-nav-ic { color: var(--np-subject); }
.np-nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--np-ink-muted);
  padding: 0 8px;
  margin: 16px 0 4px;
}

/* ---------- Main content area shift to accommodate sidebar ---------- */
.np-main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.np-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--np-topbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--np-border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.np-search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.np-search input {
  width: 100%;
  background: var(--np-surface);
  border: 1px solid var(--np-border-2);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  font-size: 14px;
  outline: none;
  transition: border-color .12s ease;
  font-family: inherit;
}
.np-search input:focus { border-color: var(--np-brand); }
.np-search .np-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--np-ink-muted);
}
.np-search .np-search-kbd {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  background: var(--np-border);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--np-ink-muted);
}

/* ---------- FAB (floating action buttons) ---------- */
.np-fab {
  position: fixed;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  border: 2px solid;
  transition: transform .1s;
  box-shadow: 0 6px 0 0 rgba(0,0,0,.15), 0 20px 40px -10px rgba(0,0,0,.2);
}
.np-fab:active { transform: translateY(3px); }
.np-fab-capture { right: 24px; background: var(--np-brand);    color: #fff; border-color: var(--np-brand-dark); }
.np-fab-tutor   { right: 96px; background: var(--np-ai);       color: #fff; border-color: var(--np-ai-dark); }

/* ---------- Modal overlay ---------- */
.np-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.np-modal-overlay.np-open {
  display: flex;
  animation: np-fade-in .2s ease;
}
.np-modal-box {
  background: var(--np-surface);
  border-radius: 28px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ---------- Side panel (used for AI tutor) ---------- */
.np-side-panel {
  position: fixed;
  right: -440px;
  top: 0; bottom: 0;
  width: 420px;
  background: var(--np-surface);
  border-left: 1.5px solid var(--np-border);
  z-index: 70;
  transition: right .3s cubic-bezier(.32,.72,0,1);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px -20px rgba(0,0,0,.12);
}
.np-side-panel.np-open { right: 0; }

/* ---------- AI Tutor panel internals ---------- */
.np-tutor-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1.5px solid var(--np-border);
}
.np-tutor-avatar {
  width: 40px; height: 40px;
  border-radius: 14px;
  background: var(--np-ai-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.np-tutor-header-text { flex: 1; min-width: 0; }
.np-tutor-title { font-weight: 800; font-size: 15px; line-height: 1.2; }
.np-tutor-subtitle { font-size: 11px; color: var(--np-ink-muted); margin-top: 2px; }
.np-tutor-icon-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--np-ink-muted); padding: 6px; border-radius: 8px;
  transition: background .12s, color .12s;
}
.np-tutor-icon-btn:hover { background: var(--np-border); color: var(--np-ink); }

.np-tutor-feed {
  flex: 1; overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #FAFAF9 0%, #fff 100%);
}
.np-tutor-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 88%;
  line-height: 1.5;
  font-size: 14px;
  word-wrap: break-word;
  animation: np-fade-in .15s ease;
}
.np-tutor-bubble-user {
  background: var(--np-brand);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.np-tutor-bubble-assistant {
  background: var(--np-surface);
  color: var(--np-ink);
  border: 1.5px solid var(--np-border);
  border-bottom-left-radius: 4px;
}
.np-tutor-bubble code {
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--np-font-mono);
  font-size: 12px;
}
.np-tutor-bubble-user code { background: rgba(255,255,255,0.2); color: #fff; }

.np-tutor-thinking {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 14px 16px;
}
.np-tutor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--np-ink-muted);
  animation: np-tutor-bounce 1.2s infinite ease-in-out;
}
.np-tutor-dot:nth-child(2) { animation-delay: 0.15s; }
.np-tutor-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes np-tutor-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

.np-tutor-quick-row {
  display: flex; flex-wrap: nowrap;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1.5px solid var(--np-border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  background: var(--np-surface);
}
.np-tutor-quick-row::-webkit-scrollbar { display: none; }
.np-tutor-quick {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--np-border);
  color: var(--np-ink-soft);
  font-size: 12px; font-weight: 600;
  border: none; cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.np-tutor-quick:hover { background: var(--np-ai-light); color: var(--np-ai-darker); }

.np-tutor-input-wrap {
  position: relative;
  padding: 12px 14px;
  border-top: 1.5px solid var(--np-border);
  background: var(--np-surface);
}
.np-tutor-input {
  width: 100%;
  background: var(--np-paper);
  border: 1.5px solid var(--np-border);
  border-radius: 14px;
  padding: 12px 48px 12px 14px;
  font-family: inherit; font-size: 14px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  line-height: 1.4;
  transition: border-color .12s;
}
.np-tutor-input:focus { border-color: var(--np-ai); background: var(--np-surface); }
.np-tutor-input:disabled { opacity: 0.6; cursor: not-allowed; }
.np-tutor-send {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--np-ai);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .08s;
}
.np-tutor-send:hover  { background: var(--np-ai-dark); }
.np-tutor-send:active { transform: scale(0.95); }
.np-tutor-send:disabled { opacity: 0.4; cursor: not-allowed; }

.np-tutor-footer {
  padding: 8px 14px 12px;
  font-size: 10px;
  color: var(--np-ink-muted);
  text-align: center;
  border-top: 1px solid var(--np-border);
  background: var(--np-paper);
}
.np-tutor-footer kbd {
  background: var(--np-surface);
  border: 1px solid var(--np-border-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--np-font-mono);
  font-size: 10px;
}

/* ---------- Quick Capture modal extras ---------- */
.np-capture-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--np-paper);
  border: 1px solid var(--np-border);
  border-radius: 12px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.np-capture-opt:hover { background: var(--np-surface); border-color: var(--np-border-2); }
.np-capture-opt input[type="checkbox"] { accent-color: var(--np-brand); width: 16px; height: 16px; }

#npCaptureDrop:hover, #npCaptureDrop.np-dz-hover {
  background: var(--np-brand-soft);
  border-color: var(--np-brand);
}

/* ---------- Toggle switch ---------- */
.np-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.np-switch input { opacity: 0; width: 0; height: 0; }
.np-switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #E5E7EB; border-radius: 999px;
  transition: background .15s;
}
.np-switch-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .15s;
}
.np-switch input:checked + .np-switch-slider { background: var(--np-brand); }
.np-switch input:checked + .np-switch-slider::before { transform: translateX(20px); }

.np-streak-pref {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 16px; margin-bottom: 8px;
  border-radius: 14px; background: var(--np-paper); border: 1px solid var(--np-border);
}

/* ---------- Focus mode overlay ---------- */
.np-focus-mode {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at top, #1E293B 0%, #0F172A 60%);
  z-index: 90;
  display: none;
  flex-direction: column;
  color: #E2E8F0;
  font-family: var(--np-font-sans);
}
.np-focus-mode.np-open {
  display: flex;
  animation: np-fade-in .3s ease;
}

/* Top toolbar */
.np-focus-toolbar {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.np-focus-toolbar-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.1); }
.np-focus-exit {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: #CBD5E1;
  font-family: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; padding: 6px 10px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.np-focus-exit:hover { background: rgba(255,255,255,0.06); color: #fff; }
.np-focus-context { font-size: 13px; color: #94A3B8; display: inline-flex; align-items: center; gap: 6px; }

.np-focus-presets {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 4px; border-radius: 10px;
  margin-left: auto;
}
.np-focus-presets-label { font-size: 12px; color: #94A3B8; padding: 0 8px; font-weight: 600; }
.np-focus-presets button {
  background: transparent; border: none; color: #CBD5E1;
  font-family: inherit; font-weight: 700; font-size: 12px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  transition: background .12s, color .12s;
}
.np-focus-presets button:hover { background: rgba(255,255,255,0.06); }
.np-focus-presets button.np-focus-preset-active {
  background: #10B981; color: #fff;
}

.np-focus-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #94A3B8; }
.np-focus-custom input {
  width: 50px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #E2E8F0; border-radius: 6px; padding: 4px 6px; font-family: inherit; font-size: 12px;
}
.np-focus-custom label { font-weight: 600; }

.np-focus-sound { display: inline-flex; align-items: center; gap: 6px; }
.np-focus-sound select {
  background: rgba(255,255,255,0.06);
  color: #E2E8F0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}

/* Main body */
.np-focus-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 32px 48px;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .np-focus-body { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
}

.np-focus-ring-col { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.np-focus-ring-wrap { position: relative; width: 280px; height: 280px; }
.np-focus-svg { width: 100%; height: 100%; }
.np-focus-ring-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.np-focus-time {
  font-family: var(--np-font-display);
  font-weight: 800;
  font-size: 64px;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}
.np-focus-phase {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-top: 12px;
  color: #10B981;
}
.np-focus-controls { display: flex; gap: 8px; }
.np-focus-total { font-size: 12px; color: #64748B; }

/* Right panel */
.np-focus-content-col { width: 100%; }
.np-focus-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
  padding: 28px;
}
.np-focus-panel-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; color: #94A3B8; margin-bottom: 4px;
}
.np-focus-panel-title {
  font-family: var(--np-font-display);
  font-weight: 800;
  font-size: 24px;
  color: #fff;
  margin: 0 0 20px;
}

.np-focus-goal-label {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: #94A3B8; margin-bottom: 6px;
}
.np-focus-goal-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #E2E8F0;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit; font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
  margin-bottom: 20px;
}
.np-focus-goal-input:focus { border-color: #10B981; background: rgba(255,255,255,0.06); }
.np-focus-goal-input::placeholder { color: #475569; }

.np-focus-launches { display: flex; flex-direction: column; gap: 8px; }
.np-focus-launch {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background .12s, border-color .12s, transform .12s;
}
.np-focus-launch:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.np-focus-launch-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.np-focus-launch-txt { flex: 1; min-width: 0; }
.np-focus-launch-title { font-weight: 700; color: #E2E8F0; font-size: 14px; }
.np-focus-launch-sub { font-size: 12px; color: #94A3B8; }

/* Footer */
.np-focus-footer {
  padding: 14px 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #64748B;
  flex-wrap: wrap; gap: 8px;
}
.np-focus-footer kbd {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 6px;
  font-family: var(--np-font-mono); font-size: 11px;
  color: #CBD5E1;
}

/* When focus mode is open, mute body chrome */
body[data-np-focus-active] .np-fab { display: none !important; }
body[data-np-focus-active] .np-side-panel.np-open { display: none !important; }

/* ---------- Progress bar ---------- */
.np-progress {
  background: var(--np-border);
  border-radius: 999px;
  overflow: hidden;
  height: 12px;
}
.np-progress > .np-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--np-brand);
  transition: width .4s ease;
}

/* ---------- Toast ---------- */
.np-toast {
  pointer-events: auto;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 8px 24px -4px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: np-toast-in .25s cubic-bezier(.32,.72,0,1);
}
.np-toast-success { background: var(--np-brand); }
.np-toast-info    { background: var(--np-ai); }
.np-toast-warn    { background: var(--np-streak); }
.np-toast-error   { background: #EF4444; }
.np-toast-leave   { animation: np-toast-out .2s ease forwards; }

/* ---------- Animations ---------- */
@keyframes np-fade-in   { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes np-toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes np-toast-out { to   { opacity: 0; transform: translateY(8px); } }
@keyframes np-flicker   { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.05) rotate(2deg); } }
@keyframes np-bounce-soft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes np-fall      { 0% { transform: translateY(-20px) rotate(0); opacity: 1; } 100% { transform: translateY(400px) rotate(540deg); opacity: 0; } }

.np-fire { animation: np-flicker 2s ease-in-out infinite; display: inline-block; }
.np-mascot-bounce { animation: np-bounce-soft 3s ease-in-out infinite; }
.np-confetti { position: fixed; width: 10px; height: 10px; border-radius: 2px; animation: np-fall 2.5s linear forwards; z-index: 100; }

/* ---------- Streak heatmap (used in commit 6) ---------- */
.np-heatmap-cell { width: 14px; height: 14px; border-radius: 3px; background: var(--np-border); }
.np-h-1 { background: #A7F3D0; } .np-h-2 { background: #6EE7B7; } .np-h-3 { background: #34D399; }
.np-h-4 { background: var(--np-brand); } .np-h-5 { background: var(--np-brand-darker); }
.np-h-frozen { background: repeating-linear-gradient(45deg, #DBEAFE, #DBEAFE 3px, #BFDBFE 3px, #BFDBFE 6px); }

/* ---------- Flashcard flip (used in commit ports of study page) ---------- */
.np-flip-card { perspective: 1200px; }
.np-flip-inner { position: relative; width: 100%; height: 100%; transition: transform .6s; transform-style: preserve-3d; }
.np-flip-card.np-flipped .np-flip-inner { transform: rotateY(180deg); }
.np-flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.np-flip-back { transform: rotateY(180deg); }

/* ---------- Difficulty buttons (Anki-style review) ---------- */
.np-diff-btn {
  flex: 1; padding: 18px 12px; border-radius: 18px; border: 2px solid;
  font-family: var(--np-font-chunky); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: 13px; cursor: pointer; transition: transform .08s;
}
.np-diff-btn:active { transform: translateY(2px); }
.np-diff-again { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; box-shadow: 0 4px 0 0 #F87171; }
.np-diff-hard  { background: #FEF3C7; color: #92400E; border-color: #FCD34D; box-shadow: 0 4px 0 0 #F59E0B; }
.np-diff-good  { background: #DBEAFE; color: #1D4ED8; border-color: #93C5FD; box-shadow: 0 4px 0 0 #60A5FA; }
.np-diff-easy  { background: #D1FACE; color: #047857; border-color: #6EE7B7; box-shadow: 0 4px 0 0 #34D399; }

/* ---------- Utility: hide scrollbar but allow scroll ---------- */
.np-no-scrollbar::-webkit-scrollbar { display: none; }
.np-no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 1024px) {
  .np-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .np-sidebar.np-open { transform: translateX(0); }
  .np-main { margin-left: 0; }
}

/* ---------- Breadcrumbs (pill trail) ---------- */
.np-crumbs { display:flex; align-items:center; flex-wrap:wrap; gap:6px; list-style:none; margin:0; padding:0; font-size:12px; }
.np-crumb {
  display:inline-flex; align-items:center; gap:5px; white-space:nowrap; line-height:1;
  background:var(--np-brand-soft); color:var(--np-brand-darker);
  padding:5px 11px; border-radius:999px; font-weight:700;
  transition:background .12s ease, color .12s ease;
}
.np-crumb a { color:inherit; text-decoration:none; display:inline-flex; align-items:center; gap:5px; }
.np-crumb:hover { background:var(--np-brand-light); color:var(--np-brand-darker); }
.np-crumb-current { background:var(--np-brand); color:#fff; }
.np-crumb-current:hover { background:var(--np-brand); color:#fff; }
.np-crumb i[data-lucide], .np-crumb svg { width:13px; height:13px; }
.np-crumb-sep { color:var(--np-ink-muted); opacity:.55; font-size:14px; line-height:1; user-select:none; }

/* ---------- Slim scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(100,116,139,0.35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.55); }

/* ---------- Sidebar collapse ---------- */
.np-sidebar { transition: width .18s ease, transform .25s ease; }
.np-main { transition: margin-left .18s ease; }
.np-collapse-btn {
  flex-shrink:0; width:28px; height:28px; border-radius:9px; border:1px solid var(--np-border);
  background:var(--np-surface); color:var(--np-ink-muted); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition: background .12s, color .12s;
}
.np-collapse-btn:hover { background:var(--np-paper); color:var(--np-ink); }
.np-collapse-btn i { transition: transform .18s ease; }

.np-app-shell.np-collapsed .np-sidebar { width:74px; padding-left:12px; padding-right:12px; }
.np-app-shell.np-collapsed .np-main { margin-left:74px; }
.np-app-shell.np-collapsed .np-sidebar .np-collapse-hide { display:none !important; }
.np-app-shell.np-collapsed .np-sidebar .np-nav-section { display:none; }
.np-app-shell.np-collapsed .np-sidebar .np-nav-item { font-size:0; gap:0; justify-content:center; padding:10px 0; }
.np-app-shell.np-collapsed .np-sidebar .np-nav-item .np-pill { display:none; }
.np-app-shell.np-collapsed .np-sidebar .np-brand-row { flex-direction:column; gap:10px; }
.np-app-shell.np-collapsed .np-sidebar .np-side-streak { justify-content:center; padding:10px; }
.np-app-shell.np-collapsed .np-sidebar .np-user-card { justify-content:center; padding:10px; }
.np-app-shell.np-collapsed .np-collapse-btn i { transform: rotate(180deg); }

@media (max-width: 1024px) {
  .np-app-shell.np-collapsed .np-main { margin-left: 0; }
}
.np-app-shell.np-collapsed .np-sidebar .np-brand-row { align-items:center; }
.np-app-shell.np-collapsed .np-sidebar .np-brand-row > a { flex:0 0 auto; justify-content:center; }

/* ---------- Grid / List view toggle ---------- */
.np-viewtoggle { display:inline-flex; gap:2px; padding:3px; background:var(--np-paper); border:1px solid var(--np-border-2); border-radius:11px; }
.np-viewtoggle button {
  display:inline-flex; align-items:center; gap:6px; border:none; background:transparent;
  color:var(--np-ink-muted); font-family:inherit; font-size:12.5px; font-weight:700;
  padding:6px 11px; border-radius:8px; cursor:pointer; transition:background .12s, color .12s;
}
.np-viewtoggle button:hover { color:var(--np-ink); }
.np-viewtoggle button.is-active { background:var(--np-surface); color:var(--np-brand-darker); box-shadow:0 1px 2px rgba(15,23,42,0.08); }

/* Panes: grid shows by default; list shows when scope has .np-show-list */
.np-views [data-view-pane="list"] { display:none; }
.np-views.np-show-list [data-view-pane="grid"] { display:none !important; }
.np-views.np-show-list [data-view-pane="list"] { display:block; }

/* List rows */
.np-listview { display:flex; flex-direction:column; gap:8px; }
.np-listrow {
  display:flex; align-items:center; gap:14px; background:var(--np-surface);
  border:1px solid var(--np-border-2); border-radius:14px; padding:12px 16px;
  text-decoration:none; color:inherit; transition:border-color .12s, transform .12s;
}
.np-listrow:hover { border-color:var(--np-brand); transform:translateX(2px); }
.np-listrow-ico { width:38px; height:38px; border-radius:11px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.np-listrow-main { flex:1; min-width:0; }
.np-listrow-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.np-listrow-sub { font-size:12px; color:var(--np-ink-muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.np-listrow-meta { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.np-listrow-bar { width:120px; }
@media (max-width:640px) {
  .np-listrow-bar { display:none; }
  .np-listrow-meta .np-listrow-hide-sm { display:none; }
}

/* ---------- Collection card: text clamps + corner watermark ---------- */
.np-card-title-2 { display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.np-card-line-1 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.np-card-desc-2 { display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:36px; }
.np-card-watermark { position:absolute; top:-12px; right:-12px; width:104px; height:104px; color:var(--tile-color, var(--np-brand)); opacity:0.06; pointer-events:none; z-index:0; }
.np-card-watermark.np-wm-ai { color:var(--np-ai); opacity:0.09; }

/* ---------- Subject dialog pickers (shared so create + edit match) ---------- */
.np-subj-quick { display:inline-flex; align-items:center; gap:6px; padding:6px 11px; border:1.5px solid var(--np-border-2); border-radius:999px; background:var(--np-surface); color:var(--np-ink-soft); font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; transition:border-color .12s, background .12s, color .12s; }
.np-subj-quick:hover { border-color:var(--np-brand); color:var(--np-brand-darker); background:var(--np-brand-soft); }
.np-icon-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(44px, 1fr)); gap:8px; margin-top:8px; }
.np-icon-pick { aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; border:1.5px solid var(--np-border-2); border-radius:12px; background:var(--np-surface); color:var(--np-ink-soft); cursor:pointer; transition:border-color .12s, background .12s, color .12s, transform .12s; }
.np-icon-pick:hover { transform:translateY(-2px); color:var(--np-ink); }
.np-icon-pick.is-active { border-color:var(--np-brand); background:var(--np-brand-soft); color:var(--np-brand-darker); }
.np-icon-pick svg, .np-icon-pick i { width:20px; height:20px; }
.np-color-pick { width:30px; height:30px; border-radius:50%; border:2px solid transparent; cursor:pointer; padding:0; outline:2px solid transparent; outline-offset:2px; box-shadow:inset 0 0 0 1px rgba(0,0,0,0.08); transition:transform .12s, outline-color .12s; }
.np-color-pick:hover { transform:scale(1.12); }
.np-color-pick.is-active { outline-color:var(--np-ink); }
.np-color-custom { width:30px; height:30px; border-radius:50%; border:1.5px dashed var(--np-border-2); display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative; color:var(--np-ink-muted); overflow:hidden; }
.np-color-custom:hover { color:var(--np-ink); border-color:var(--np-brand); }
.np-color-custom input[type=color] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; border:none; padding:0; }
