/* ===== KAUTILYA.AI DESIGN TOKENS — single source of truth ===== */
:root {
  /* Base palette */
  --bg:         #06090f;
  --surface:    #0c1220;
  --surface2:   #111b30;
  --surface3:   #182440;
  --border:     #1c2e4a;
  --border-glow:#2a4470;
  --text:       #dde9f7;
  --text-dim:   #9fb8d0;
  --muted:      #5a7590;

  /* Kautilya brand purple */
  --primary:       #6c63ff;
  --primary-dark:  #5a52e0;
  --primary-dim:   rgba(108,99,255,0.15);
  --primary-border:rgba(108,99,255,0.35);

  /* Accent palette */
  --blue:   #4e9eff;
  --cyan:   #2dd4c0;
  --purple: #9b72ff;
  --gold:   #f0c040;
  --green:  #34d399;
  --orange: #fb923c;
  --red:    #f87171;
  --pink:   #f472b6;
  --teal:   #22d3ee;
  --lime:   #a3e635;
  --sky:    #7dcfff;

  /* LearnGraph node colours */
  --node-concept:      #6c63ff;
  --node-prerequisite: #fb923c;
  --node-skill:        #34d399;
  --node-question:     #f87171;
  --node-insight:      #f0c040;
  --node-example:      #94a3b8;
  --node-exercise:     #2dd4c0;
  --node-resource:     #7dcfff;

  /* ArgGraph node colours */
  --nc-decision:    #f0c040;
  --nc-scenario:    #4e9eff;
  --nc-assumption:  #fb923c;
  --nc-evidence:    #34d399;
  --nc-principle:   #2dd4c0;
  --nc-consequence: #9b72ff;
  --nc-question:    #f87171;
  --nc-hypothesis:  #f472b6;
  --nc-example:     #94a3b8;
  --nc-claim:       #7dcfff;

  /* Radius */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  /* Typography */
  --font:      'Inter', ui-sans-serif, system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Animation */
  --t: 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --nav-height: 52px;
}

/* ===== SHARED NAV ===== */
.knav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(10,16,32,0.98) 0%, rgba(6,9,15,0.92) 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  gap: 12px;
}

.knav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.knav-glyph {
  font-size: 18px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary));
  line-height: 1;
}
.knav-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.knav-ai { color: var(--primary); }

.knav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.knav-hub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--t);
  white-space: nowrap;
}
.knav-hub:hover { border-color: var(--border-glow); color: var(--text); }

.knav-btn {
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 16px;
  transition: var(--t);
}
.knav-btn:hover { border-color: var(--border-glow); color: var(--text); }

/* ===== SHARED SETTINGS MODAL ===== */
.settings-modal, .shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.settings-modal.hidden, .shortcuts-modal.hidden { display: none; }

.settings-bd, .shortcuts-bd {
  position: absolute;
  inset: 0;
  background: rgba(6,9,15,0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.settings-card, .shortcuts-card {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  animation: modal-pop 0.2s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modal-pop {
  from { opacity:0; transform: scale(0.95) translateY(8px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.settings-hd, .shortcuts-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.settings-title, .shortcuts-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.settings-close, .shortcuts-close {
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t);
}
.settings-close:hover, .shortcuts-close:hover { border-color: var(--border-glow); color: var(--text); }

.settings-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-input {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 12px;
  outline: none;
  transition: var(--t);
}
.settings-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-dim); }
.settings-input::placeholder { color: var(--muted); }

.settings-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.settings-actions { display: flex; gap: 8px; }
.settings-btn {
  flex: 1;
  cursor: pointer;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: var(--t);
}
.settings-btn-primary {
  border: 1px solid var(--primary-border);
  background: var(--primary-dim);
  color: var(--primary);
}
.settings-btn-primary:hover { background: rgba(108,99,255,0.22); }
.settings-btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.settings-btn-ghost:hover { color: var(--text); }

/* ===== SHORTCUTS MODAL ===== */
.shortcuts-list {
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
}
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface3);
  border: 1px solid var(--border-glow);
  border-radius: 5px;
  padding: 3px 7px;
  color: var(--text);
  white-space: nowrap;
  min-width: 56px;
  text-align: center;
  flex-shrink: 0;
}

/* ===== SHARED TOAST ===== */
.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 600;
  pointer-events: none;
}
.toast {
  background: var(--surface3);
  border: 1px solid var(--border-glow);
  border-radius: 9px;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toast-in 0.2s ease;
  white-space: nowrap;
}
.toast-error { border-color: rgba(248,113,113,0.5); color: var(--red); }
.toast-out { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in  { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform:translateY(-4px); } }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .knav { padding: 0 14px; }
  .knav-name { font-size: 13px; }
}
