/* =============================================================
   Atlis Benefits – layout & branding overrides for atlis-world
   Loaded AFTER app.css; scoped via body.atlis-layout
   ============================================================= */

/* ── Brand variables (overridden dynamically by employer branding) ── */
:root {
  --brand-primary: #0d9488;
  --brand-primary-dark: #0f766e;
  --brand-primary-light: #14b8a6;
  --brand-primary-bg: #f0fdfa;
  --brand-primary-bg-dark: #d1fae5;
  --brand-primary-text: #065f46;
  --brand-heading-font: 'Playfair Display', Georgia, serif;
  --brand-body-font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Mobile-first container ───────────────────────────────── */
.atlis-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Branded header ───────────────────────────────────────── */
.atlis-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: calc(100vw - 32px);
  max-width: 398px;
  margin: 0 auto;
}

.atlis-header-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.atlis-logo {
  height: 36px;
  width: auto;
}

.atlis-header-subtitle {
  font-family: var(--brand-body-font);
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.3px;
  margin: 0;
}

/* White-label header: employer logo */
.atlis-header-employer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1px;
  flex-shrink: 0;
}

.atlis-header-employer-name {
  font-family: var(--brand-heading-font);
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

/* ── Override body background for Atlis ───────────────────── */
body.atlis-layout {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
  padding: 0 0 40px 0;
  font-family: var(--brand-body-font);
}

/* ── Reduce body top-padding so header sits at top ────────── */
body.atlis-layout .atlis-container {
  padding-top: 4px;
}

/* ── Card grid: single-column on mobile ───────────────────── */
body.atlis-layout .cards-grid {
  gap: 12px;
  justify-content: center;
}

/* ── Hide the original header (replaced by atlis-header) ─── */
body.atlis-layout .header {
  display: none !important;
}

/* ── Hide filters & count badge on Atlis ──────────────────── */
body.atlis-layout .filters,
body.atlis-layout .count-badge {
  display: none;
}

/* ── Mode toggle: positioned inside the header (right side) ── */
body.atlis-layout .atlis-header .global-mode-toggle {
  position: relative;
  top: auto;
  right: auto;
  margin-left: auto;
  margin-bottom: 0;
  background: var(--toggle-bg, rgba(0, 0, 0, 0.06));
}

body.atlis-layout .atlis-header .global-mode-toggle .mode-btn {
  color: var(--toggle-color, rgba(0, 0, 0, 0.35));
}

body.atlis-layout .atlis-header .global-mode-toggle .mode-btn:hover {
  color: var(--toggle-hover, rgba(0, 0, 0, 0.6));
}

body.atlis-layout .atlis-header .global-mode-toggle .mode-btn.active {
  background: var(--toggle-active-bg, rgba(0, 0, 0, 0.12));
  color: var(--toggle-active-color, #0f172a);
}

/* ── Loading overlay: Atlis brand colors ──────────────────── */
body.atlis-layout .loading-overlay {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
}

body.atlis-layout .loading-brand h1 {
  font-family: var(--brand-heading-font);
  font-style: italic;
}

/* =============================================================
   Employer Badge & Branding Modal
   ============================================================= */

/* ── Header badge ───────────────────────────────────────────── */
.employer-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.employer-badge:hover {
  background: #f1f5f9;
  border-color: var(--brand-primary);
}

.employer-badge-active {
  border-color: var(--brand-primary);
  background: var(--brand-primary-bg);
}

.employer-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.employer-badge-icon svg {
  width: 18px;
  height: 18px;
}

.employer-badge-active .employer-badge-icon {
  color: var(--brand-primary);
}

.employer-badge-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
}

/* ── Modal overlay ──────────────────────────────────────────── */
.employer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: employerFadeIn 0.2s ease;
}

.employer-modal-overlay.hidden {
  display: none;
}

@keyframes employerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.employer-modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: employerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.employer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}

.employer-modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-primary);
}

.employer-modal-header-left svg {
  width: 20px;
  height: 20px;
}

.employer-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.employer-modal-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  border-radius: 8px;
  transition: all 0.15s;
  font-size: 20px;
  line-height: 1;
}

.employer-modal-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.employer-modal-body {
  padding: 20px;
}

.employer-modal-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

/* ── Search input ───────────────────────────────────────────── */
.employer-input-row {
  display: flex;
  gap: 8px;
}

.employer-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.employer-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.employer-input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s;
  box-sizing: border-box;
}

.employer-input:focus {
  border-color: var(--brand-primary);
  background: white;
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
}

.employer-apply-btn {
  padding: 11px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
}

.employer-apply-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.employer-apply-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Loading state ──────────────────────────────────────────── */
.employer-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--brand-primary-bg);
  border-radius: 12px;
  animation: employerFadeIn 0.2s ease;
}

.employer-loading span {
  font-size: 13px;
  color: var(--brand-primary-dark);
  font-weight: 500;
}

.employer-spinner {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.employer-spinner-ring {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: employerSpin 0.6s linear infinite;
}

.employer-loading .employer-spinner-ring {
  border-color: var(--brand-primary-bg-dark);
  border-top-color: var(--brand-primary);
}

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

/* ── Error ──────────────────────────────────────────────────── */
.employer-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 10px;
  line-height: 1.5;
}

/* ── Brand preview ──────────────────────────────────────────── */
.employer-preview {
  margin-top: 16px;
  animation: employerSlideUp 0.25s ease;
}

.employer-preview-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.employer-preview-check {
  width: 16px;
  height: 16px;
  color: #059669;
}

.employer-preview-header span {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.employer-preview-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fafbfc;
}

.employer-preview-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.employer-preview-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
  border: 1px solid #e2e8f0;
  padding: 2px;
}

.employer-preview-info {
  flex: 1;
}

.employer-preview-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.employer-preview-domain {
  font-size: 12px;
  color: #94a3b8;
}

.employer-preview-palette {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.employer-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s;
}

.employer-swatch:hover {
  transform: scale(1.15);
}

.employer-preview-fonts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.employer-font-tag {
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  background: white;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

/* ── Color picker fallback ──────────────────────────────────── */
.employer-color-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.employer-color-hint {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px 0;
  font-weight: 500;
}

.employer-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.employer-color-input {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  background: none;
  transition: border-color 0.15s;
}

.employer-color-input:hover {
  border-color: var(--brand-primary);
}

.employer-color-preview {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  font-family: monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.employer-color-apply {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.employer-color-apply:hover {
  background: #e2e8f0;
}

/* ── Reset section ──────────────────────────────────────────── */
.employer-reset-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.employer-reset-btn {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.employer-reset-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

/* ── Utility: hidden ────────────────────────────────────────── */
.employer-hidden {
  display: none !important;
}

/* =============================================================
   Persona Card Redesign — Atlis & Katnis only
   ============================================================= */

/* ── Viewport-filling card sizing (all cards) ─────────────── */
body.atlis-layout .card-container {
  width: calc(100vw - 32px);
  max-width: 398px;
  height: calc((100svh - 68px - 12px) / 2);
}

body.atlis-layout .cards-grid {
  padding: 0;
}

/* ── Reposition buttons to top corners (Atlis & Katnis) ───── */
body.atlis-layout [data-persona="Atlis"] .ask-btn-overlay,
body.atlis-layout [data-persona="Katnis"] .ask-btn-overlay {
  top: 8px;
  left: 8px;
  bottom: auto;
}

body.atlis-layout [data-persona="Atlis"] .play-btn-overlay,
body.atlis-layout [data-persona="Katnis"] .play-btn-overlay {
  top: 8px;
  right: 8px;
  bottom: auto;
}

/* ── Shrink buttons (Atlis & Katnis) ──────────────────────── */
body.atlis-layout [data-persona="Atlis"] .play-btn-overlay,
body.atlis-layout [data-persona="Atlis"] .ask-btn-overlay,
body.atlis-layout [data-persona="Katnis"] .play-btn-overlay,
body.atlis-layout [data-persona="Katnis"] .ask-btn-overlay {
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  opacity: 0.7;
}

body.atlis-layout [data-persona="Atlis"] .play-icon,
body.atlis-layout [data-persona="Katnis"] .play-icon {
  border-width: 6px 0 6px 10px;
  margin-left: 2px;
}

body.atlis-layout [data-persona="Atlis"] .ask-btn-overlay,
body.atlis-layout [data-persona="Katnis"] .ask-btn-overlay {
  font-size: 13px;
}

/* ── Remove black space between portrait and info ─────────── */
body.atlis-layout [data-persona="Atlis"] .portrait-section,
body.atlis-layout [data-persona="Katnis"] .portrait-section {
  background: transparent;
}

body.atlis-layout [data-persona="Atlis"] .card-front,
body.atlis-layout [data-persona="Katnis"] .card-front {
  background: none !important;
}

/* ── Compact info card — name + role only (Atlis & Katnis) ── */
body.atlis-layout [data-persona="Atlis"] .card-info,
body.atlis-layout [data-persona="Katnis"] .card-info {
  height: auto;
  padding: 8px 12px;
  text-align: center;
}

body.atlis-layout [data-persona="Atlis"] .name-row,
body.atlis-layout [data-persona="Katnis"] .name-row {
  margin-bottom: 0;
  justify-content: center;
  gap: 8px;
  align-items: baseline;
}

body.atlis-layout [data-persona="Atlis"] .name-row .title,
body.atlis-layout [data-persona="Katnis"] .name-row .title {
  text-align: left;
  max-width: none;
}

body.atlis-layout .stats-grid {
  display: none;
}

body.atlis-layout .card-info {
  height: auto;
}

body.atlis-layout [data-persona="Atlis"] .tagline,
body.atlis-layout [data-persona="Atlis"] .flip-hint,
body.atlis-layout [data-persona="Atlis"] .symbol-badge,
body.atlis-layout [data-persona="Katnis"] .tagline,
body.atlis-layout [data-persona="Katnis"] .flip-hint,
body.atlis-layout [data-persona="Katnis"] .symbol-badge {
  display: none;
}

/* =============================================================
   Hamburger Menu & Settings Side Panel
   ============================================================= */

/* ── Hamburger button ──────────────────────────────────────── */
.atlis-hamburger {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.atlis-hamburger:hover {
  background: rgba(0, 0, 0, 0.06);
}

.atlis-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #334155;
  border-radius: 1px;
  transition: all 0.2s ease;
}

/* ── Panel overlay ─────────────────────────────────────────── */
.atlis-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.atlis-panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── Panel drawer ──────────────────────────────────────────── */
.atlis-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: #fff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  z-index: 2001;
}

.atlis-panel-overlay.open .atlis-panel {
  transform: translateX(0);
}

.atlis-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.atlis-panel-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  font-family: var(--brand-body-font);
}

.atlis-panel-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.15s;
}

.atlis-panel-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.atlis-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

/* ── Panel menu items ──────────────────────────────────────── */
.atlis-panel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.atlis-panel-item:hover {
  background: #f8fafc;
}

.atlis-panel-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-primary-bg, #f0fdfa);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.atlis-panel-item-icon svg {
  width: 18px;
  height: 18px;
  color: var(--brand-primary, #0d9488);
}

.atlis-panel-item-content {
  flex: 1;
  min-width: 0;
}

.atlis-panel-item-label {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  font-family: var(--brand-body-font);
}

.atlis-panel-item-status {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atlis-panel-item-status.uploaded {
  color: #059669;
}

.atlis-panel-item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.atlis-panel-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.15s;
}

.atlis-panel-delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.atlis-panel-delete svg {
  width: 15px;
  height: 15px;
}

.atlis-panel-chevron {
  width: 16px;
  height: 16px;
  color: #cbd5e1;
}

/* ── Wellness dollars row ──────────────────────────────────── */
.atlis-panel-wellness-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.atlis-panel-dollar {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.atlis-panel-number-input {
  width: 80px;
  padding: 6px 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s;
}

.atlis-panel-number-input:focus {
  border-color: var(--brand-primary, #0d9488);
  background: white;
  box-shadow: 0 0 0 3px var(--brand-primary-bg, #f0fdfa);
}

.atlis-panel-save-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: var(--brand-primary, #0d9488);
  color: white;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.atlis-panel-save-btn:hover {
  opacity: 0.9;
}

.atlis-panel-save-btn.saved {
  background: #059669;
}

/* ── Loading spinner for uploads ───────────────────────────── */
.atlis-panel-item-status.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--brand-primary-bg, #f0fdfa);
  border-top-color: var(--brand-primary, #0d9488);
  border-radius: 50%;
  animation: employerSpin 0.6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

/* ================================================================
   Knowledge Editor
   ================================================================ */
.ke-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #f8fafc;
  overflow-y: auto;
  transition: opacity 0.2s;
}
.ke-overlay.hidden {
  display: none;
}
.ke-page {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f8fafc;
}
@media (min-width: 431px) {
  .ke-page { box-shadow: 0 0 40px rgba(0,0,0,0.08); }
}

/* Header */
.ke-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.ke-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}
.ke-back {
  width: 32px; height: 32px;
  border: none; background: none;
  color: #475569;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
}
.ke-back:hover { background: #f1f5f9; }
.ke-back svg { width: 20px; height: 20px; }
.ke-count {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}
.ke-add-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 10px;
  background: var(--brand-primary, #0d9488);
  color: #fff;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ke-add-btn:hover { background: #0f766e; }
.ke-new-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px; font-weight: 700;
  color: var(--brand-primary, #0d9488);
  margin-bottom: 4px;
}
.ke-persona-checkboxes {
  display: flex; gap: 12px; align-items: center;
  padding-top: 4px;
}

/* Auth */
.ke-auth {
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.ke-auth label {
  font-size: 13px; font-weight: 600; color: #334155;
}
.ke-auth input {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px; font-family: inherit;
  outline: none;
}
.ke-auth input:focus { border-color: var(--brand-primary, #0d9488); }
.ke-auth-btn {
  padding: 12px;
  border: none; border-radius: 14px;
  background: var(--brand-primary, #0d9488);
  color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ke-auth-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.ke-auth-btn:disabled { opacity: 0.6; transform: none; }
.ke-error {
  font-size: 13px; color: #dc2626; margin-top: 2px;
}

/* Filter */
.ke-filter {
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.ke-filter select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px; font-family: inherit;
  color: #334155;
  background: #f8fafc;
  outline: none;
}
.ke-filter select:focus { border-color: var(--brand-primary, #0d9488); }

/* List */
.ke-list {
  padding: 12px 16px 40px;
  display: flex; flex-direction: column; gap: 12px;
}
.ke-empty {
  text-align: center; padding: 40px 0; color: #64748b;
}

/* Card */
.ke-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; gap: 8px;
}
.ke-card-editing {
  box-shadow: 0 0 0 2px var(--brand-primary, #0d9488), 0 2px 12px rgba(0,0,0,0.08);
}
.ke-card-header {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ke-importance {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #fff;
  padding: 2px 8px; border-radius: 6px;
}
.ke-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
}
.ke-badge-auto { background: #f0fdfa; color: #065f46; }
.ke-badge-inactive { background: #fef2f2; color: #dc2626; }
.ke-tokens {
  font-size: 11px; color: #64748b; margin-left: auto;
}
.ke-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.3;
}
.ke-card-key {
  font-size: 11px; color: #64748b;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ke-card-desc {
  font-size: 13px; color: #475569; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ke-card-personas {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.ke-persona-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 8px; background: #f1f5f9; color: #334155;
}
.ke-persona-all { background: #f0fdfa; color: #065f46; }
.ke-edit-btn {
  align-self: flex-start;
  padding: 6px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 13px; font-weight: 600;
  color: #334155; cursor: pointer;
  transition: background 0.15s;
}
.ke-edit-btn:hover { background: #f8fafc; }
.ke-card-actions {
  display: flex; gap: 8px; align-items: center;
}
.ke-restore-btn {
  align-self: flex-start;
  padding: 6px 16px;
  border: 1px solid #fbbf24;
  border-radius: 10px;
  background: #fffbeb;
  font-size: 13px; font-weight: 600;
  color: #92400e; cursor: pointer;
  transition: background 0.15s;
}
.ke-restore-btn:hover { background: #fef3c7; }
.ke-restore-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Edit form */
.ke-field {
  display: flex; flex-direction: column; gap: 4px; flex: 1;
}
.ke-field label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #64748b;
}
.ke-field input,
.ke-field select,
.ke-field textarea {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px; font-family: inherit;
  color: #1e293b; outline: none; background: #fff;
}
.ke-field input:focus,
.ke-field select:focus,
.ke-field textarea:focus {
  border-color: var(--brand-primary, #0d9488);
}
.ke-disabled {
  background: #f8fafc !important; color: #64748b !important;
}
.ke-content-editor {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px !important; line-height: 1.5; resize: vertical;
}
.ke-field-row {
  display: flex; gap: 10px;
}
.ke-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: #334155; cursor: pointer;
}
.ke-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand-primary, #0d9488);
}
.ke-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px;
}
.ke-cancel-btn {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 13px; font-weight: 600;
  color: #334155; cursor: pointer;
}
.ke-cancel-btn:hover { background: #f8fafc; }
.ke-save-btn {
  padding: 8px 20px;
  border: none; border-radius: 10px;
  background: var(--brand-primary, #0d9488);
  color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.ke-save-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.ke-save-btn:disabled { opacity: 0.6; transform: none; }
