/* ==========================================================================
   AnkaDrishti · Light Sky Blue Theme · High Visibility & Elegance
   ========================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Cinzel', Georgia, serif;

  /* Light Sky Blue Palette */
  --bg-deep: #e0f2fe;             /* Soft sky blue */
  --bg-surface: #f0f7ff;          /* Crisp sky-tinted white */
  --panel: rgba(255, 255, 255, 0.94);
  --panel-card: #ffffff;
  --panel-elevated: #ffffff;
  
  /* Sky Blue Accents & Neon */
  --sky: #0284c7;                 /* Sky Blue Primary */
  --sky-bright: #0ea5e9;
  --sky-light: #38bdf8;
  --sky-soft: #e0f2fe;
  --sky-glow: rgba(14, 165, 233, 0.22);
  --sky-border: #7dd3fc;
  --sky-border-subtle: #bae6fd;

  --cyan: #0284c7;                /* Main brand blue */
  --cyan-bright: #0ea5e9;
  --cyan-glow: rgba(14, 165, 233, 0.2);
  --cyan-border: #7dd3fc;
  --cyan-bg: #e0f2fe;

  /* Quick Analysis 8 Pastels (High Contrast for Light Mode) */
  --purple-tile: #6d28d9;
  --purple-border: #ddd6fe;
  --purple-bg: #f5f3ff;

  --amber-tile: #b45309;
  --amber-border: #fde68a;
  --amber-bg: #fffbeb;

  --magenta-tile: #be185d;
  --magenta-border: #fbcfe8;
  --magenta-bg: #fdf2f8;

  --emerald-tile: #15803d;
  --emerald-border: #bbf7d0;
  --emerald-bg: #f0fdf4;

  --rose-tile: #be123c;
  --rose-border: #fecdd3;
  --rose-bg: #fff1f2;

  --violet-tile: #7c3aed;
  --violet-border: #ddd6fe;
  --violet-bg: #f5f3ff;

  --blue-tile: #0e7490;
  --blue-border: #a5f3fc;
  --blue-bg: #ecfeff;

  /* Gold & Neutral */
  --gold: #b45309;
  --gold-glow: rgba(180, 83, 9, 0.18);
  --border: #e2e8f0;

  /* High-Contrast Typography */
  --text: #0f172a;                /* Deep slate/navy for maximum visibility */
  --text-muted: #334155;          /* Crisp secondary text */
  --text-dim: #64748b;            /* Soft label text */

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 8px 24px rgba(2, 132, 199, 0.08);
  --shadow-glow: 0 0 16px rgba(14, 165, 233, 0.2);

  color-scheme: light;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #e0f7fa 100%);
  position: relative;
  overflow-x: hidden;
}

/* Background Atmosphere */
.cosmic-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}
.orb-teal { width: 420px; height: 420px; background: radial-gradient(circle, #38bdf8, transparent); top: -60px; left: -80px; }
.orb-gold { width: 440px; height: 440px; background: radial-gradient(circle, #fde68a, transparent); top: 35%; right: -100px; }
.orb-purple { width: 400px; height: 400px; background: radial-gradient(circle, #c4b5fd, transparent); bottom: -60px; left: 15%; }

.cosmic-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(14, 165, 233, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ==========================================================================
   Mobile Device Frame (Handheld Viewport)
   ========================================================================== */
.mobile-device-frame {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  background: var(--bg-surface);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(2, 132, 199, 0.15);
}

@media (min-width: 481px) {
  body { padding: 18px 0; }
  .mobile-device-frame {
    border-radius: 50px;
    height: 92vh;
    min-height: 840px;
    max-height: 920px;
    border: 9px solid #cbd5e1;
    box-shadow: 0 0 0 2px #94a3b8, 0 25px 70px rgba(2, 132, 199, 0.2);
  }
}

/* Category Pill Navigation Bar (Compact, 38px, High Space Utilization with Left/Right Arrows) */
.dash-category-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -2px;
  margin-bottom: 6px;
  width: 100%;
}

.dash-cat-arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  color: var(--sky);
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
  flex-shrink: 0;
  transition: all 0.15s ease;
  user-select: none;
  z-index: 5;
  padding: 0;
  line-height: 1;
}
.dash-cat-arrow:hover {
  background: var(--sky);
  color: #ffffff;
  border-color: var(--sky);
  transform: scale(1.1);
}
.dash-cat-arrow:active {
  transform: scale(0.92);
}

body.dark .dash-cat-arrow {
  background: #0f1c30;
  border-color: var(--border);
  color: var(--sky);
}
body.dark .dash-cat-arrow:hover {
  background: var(--sky);
  color: #060d17;
}

.dash-category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 4px 6px;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dash-category-bar.dragging {
  cursor: grabbing;
  user-select: none;
}
.dash-category-bar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.dash-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1.5px solid var(--sky-border-subtle);
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.05);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.dash-cat-pill:hover {
  border-color: var(--sky);
  color: var(--sky);
}
.dash-cat-pill.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--sky-glow);
}
.dash-cat-pill .cat-icon { font-size: 13px; }

/* Tool Mode Selector Pills (Phone, Vehicle, Property) */
.tool-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1.5px solid var(--sky-border-subtle);
  color: #475569;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.05);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tool-mode-pill:hover {
  border-color: var(--sky);
  color: var(--sky);
}
.tool-mode-pill.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #ffffff;
}
body.dark .tool-mode-pill {
  background: #0e1b30;
  border-color: var(--border);
  color: #cbd5e1;
}
body.dark .tool-mode-pill.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #060d17;
}

/* Pillar Sub-Tab Selector Pills (Multi-Row Wrapped to Ensure 100% Visibility of All 7 Pillars) */
.pillar-subtabs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
  margin-bottom: 14px;
}
.pillar-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1.5px solid var(--sky-border-subtle);
  color: #475569;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.05);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.pillar-sub-pill:hover {
  border-color: var(--sky);
  color: var(--sky);
  background: var(--sky-soft);
}
.pillar-sub-pill.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--sky-glow);
}
body.dark .pillar-sub-pill {
  background: #0e1b30;
  border-color: var(--border);
  color: #cbd5e1;
}
body.dark .pillar-sub-pill:hover {
  background: #162a45;
  border-color: var(--sky);
  color: #38bdf8;
}
body.dark .pillar-sub-pill.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--sky-glow);
}

/* iPhone Status Bar */
.device-status-bar {
  height: 44px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  position: relative;
  z-index: 20;
  user-select: none;
  flex-shrink: 0;
}

.status-time {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.dynamic-island {
  width: 110px;
  height: 28px;
  background: #0f172a;
  border-radius: 20px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #0f172a;
}

.status-svg {
  width: 16px;
  height: 16px;
}

.battery-icon {
  width: 22px;
  height: 11px;
  border: 1.5px solid #0f172a;
  border-radius: 3px;
  padding: 1px;
  display: flex;
  align-items: center;
  position: relative;
}
.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  width: 2px;
  height: 4px;
  background: #0f172a;
  border-radius: 0 1px 1px 0;
}
.battery-fill {
  width: 80%;
  height: 100%;
  background: #0f172a;
  border-radius: 1px;
}

/* ==========================================================================
   App Top Bar (Header)
   ========================================================================== */
.app-topbar {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 15;
}

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--sky-border-subtle);
  color: #0f172a;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
  transition: transform 0.15s, background 0.15s;
}
.topbar-icon-btn:active { transform: scale(0.92); }

.notif-btn .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.app-brand-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.app-brand-logo-box {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--sky);
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px var(--sky-glow);
}

.app-brand-logo-box svg { fill: #ffffff !important; }

.brand-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: #0f172a;
}

.brand-accent {
  color: var(--sky);
}

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

.topbar-icon-btn.match-btn {
  border-color: #fbcfe8;
  color: #db2777;
  font-size: 17px;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.12);
}
.topbar-icon-btn.match-btn:hover {
  background: #fdf2f8;
  border-color: #f472b6;
  transform: scale(1.08);
}
body.dark .topbar-icon-btn.match-btn {
  background: #111e33;
  border-color: rgba(219, 39, 119, 0.35);
  color: #f472b6;
}
body.dark .topbar-icon-btn.match-btn:hover {
  background: rgba(219, 39, 119, 0.2);
}

/* ==========================================================================
   Main Scrollable Content Area
   ========================================================================== */
.app-main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px 85px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}
.app-main-content::-webkit-scrollbar { display: none; }

.tab-view, .screen-flow-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.25s ease;
}

.entry-form-card {
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.1);
}

.entry-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.entry-card-icon {
  font-size: 24px;
}

.entry-card-title {
  font-size: 16px;
  font-weight: 850;
  color: #0f172a;
  display: block;
}

.entry-card-sub {
  font-size: 11.5px;
  color: #475569;
  display: block;
  margin-top: 1px;
}

.count-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--sky-soft);
  color: var(--sky);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--sky-border);
}

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

/* ==========================================================================
   Home Screen Hero Section (Card & Wheel)
   ========================================================================== */
.home-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 2px;
  position: relative;
}

.home-hero-left {
  flex: 1;
  max-width: 205px;
}

.hero-brand-heading {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #0369a1;
  margin-bottom: 3px;
}

.hero-brand-sub {
  font-size: 12px;
  font-weight: 650;
  color: #334155;
  line-height: 1.45;
  margin-bottom: 10px;
}

.hero-gold-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  color: #0369a1;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

.badge-star {
  color: #d97706;
  font-size: 12px;
}

.home-hero-wheel-wrap {
  width: 145px;
  height: 145px;
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.celestial-wheel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 15px rgba(2, 132, 199, 0.18));
}

.sacred-geo-spin {
  transform-origin: 100px 100px;
  animation: slowSacredSpin 45s linear infinite;
}

@keyframes slowSacredSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Active Native Profile Card (Light Sky Card)
   ========================================================================== */
.active-profile-card {
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.1);
}

.profile-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
}

.profile-avatar-glow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sky-soft);
  border: 1.5px solid var(--sky);
  color: var(--sky);
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px var(--sky-glow);
  flex-shrink: 0;
}

.profile-card-details {
  display: flex;
  flex-direction: column;
}

.active-profile-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #0369a1;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-name-row strong {
  font-size: 16.5px;
  font-weight: 850;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.dropdown-chevron {
  color: #64748b;
  font-size: 13px;
  line-height: 1;
}

.profile-card-details small {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-top: 1px;
}

.btn-switch-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #f0f9ff;
  border: 1.5px solid var(--sky-border);
  color: #0369a1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1.25;
  text-align: left;
  transition: transform 0.12s, background 0.15s;
}
.btn-switch-profile:active { transform: scale(0.95); }

.switch-icon {
  font-size: 15px;
  color: var(--sky);
}

/* ==========================================================================
   Action Buttons Row (Add New Profile & Manage Profiles)
   ========================================================================== */
.profile-action-row {
  display: flex;
  gap: 10px;
}

.btn-action-primary {
  flex: 1.1;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #38bdf8 0%, #0284c7 100%);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-action-primary:active { transform: scale(0.97); }

.btn-generate-blueprint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--sky-bright), var(--sky));
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--sky-glow);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-generate-blueprint:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px var(--sky-glow);
}

.btn-generate-blueprint:active {
  transform: scale(0.97);
}

.btn-generate-blueprint:focus-visible {
  outline: 3px solid var(--sky-border);
  outline-offset: 3px;
}

body.dark .btn-generate-blueprint {
  color: #04111e;
}

.action-icon-circle {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.btn-action-secondary {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  color: #0369a1;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.06);
  transition: transform 0.15s, background 0.15s;
}
.btn-action-secondary:active { transform: scale(0.97); }

/* ==========================================================================
   Quick Analysis Section Card (8 App Tiles)
   ========================================================================== */
.quick-analysis-card {
  background: #ffffff;
  border: 1.5px solid var(--sky-border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bolt-icon {
  color: #d97706;
  font-size: 17px;
}

.clock-icon {
  color: #0284c7;
  font-size: 17px;
}

.section-header-left strong {
  font-size: 15px;
  font-weight: 850;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.view-all-link {
  background: none;
  border: none;
  color: #0284c7;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* 8 Quick Analysis App Tiles (2 Rows x 4 Columns) */
.quick-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-tile {
  border-radius: 14px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 80px;
}
.quick-tile:active { transform: scale(0.94); }

.tile-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.tile-title {
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  color: #0f172a;
  letter-spacing: -0.1px;
}

/* 8 Theme Classes (Light Mode Pastels) */
.tile-purple { background: var(--purple-bg); border: 1.5px solid var(--purple-border); }
.icon-purple { color: var(--purple-tile); }

.tile-cyan { background: var(--cyan-bg); border: 1.5px solid var(--cyan-border); }
.icon-cyan { color: var(--cyan); }

.tile-amber { background: var(--amber-bg); border: 1.5px solid var(--amber-border); }
.icon-amber { color: var(--amber-tile); }

.tile-magenta { background: var(--magenta-bg); border: 1.5px solid var(--magenta-border); }
.icon-magenta { color: var(--magenta-tile); }

.tile-emerald { background: var(--emerald-bg); border: 1.5px solid var(--emerald-border); }
.icon-emerald { color: var(--emerald-tile); }

.tile-rose { background: var(--rose-bg); border: 1.5px solid var(--rose-border); }
.icon-rose { color: var(--rose-tile); }

.tile-violet { background: var(--violet-bg); border: 1.5px solid var(--violet-border); }
.icon-violet { color: var(--violet-tile); }

.tile-blue { background: var(--blue-bg); border: 1.5px solid var(--blue-border); }
.icon-blue { color: var(--blue-tile); }

/* ==========================================================================
   Recent Analyses Card
   ========================================================================== */
.recent-analyses-card {
  background: #ffffff;
  border: 1.5px solid var(--sky-border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.recent-item-card:hover {
  background: #f0f9ff;
  border-color: var(--sky);
  transform: translateY(-1px);
}

.recent-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recent-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sky-soft);
  border: 1px solid var(--sky-border);
  color: var(--sky);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.recent-item-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.recent-meta {
  display: block;
  font-size: 11px;
  color: #475569;
  margin-top: 1px;
}

.recent-chevron {
  color: #0284c7;
  font-size: 14px;
  font-weight: 800;
}

/* ==========================================================================
   Bottom Navigation Bar (Fixed 6 Tabs)
   ========================================================================== */
.mobile-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1.5px solid var(--sky-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  z-index: 50;
  box-shadow: 0 -8px 24px rgba(2, 132, 199, 0.08);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: #64748b;
  padding: 6px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.15s, transform 0.12s;
}

.nav-indicator-line {
  position: absolute;
  top: -1px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-tab .tab-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-tab .tab-label {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1px;
}

.nav-tab.active {
  color: #0284c7;
}

.nav-tab.active .nav-indicator-line {
  background: #0284c7;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.nav-tab.active .tab-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.4));
}

.nav-tab:active { transform: scale(0.92); }

/* ==========================================================================
   Detailed Feature View Content (Lo Shu, Cycles, Timeline, Remedies, Profiles)
   ========================================================================== */
.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 16px;
  font-weight: 850;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
}

.label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.metric {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  color: #0284c7;
}

.muted {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11px;
  font-weight: 800;
  margin: 2px 4px 2px 0;
}

/* Lo Shu 3x3 Magic Square */
.loshu-container {
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.1);
  margin-bottom: 12px;
}

.loshu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 320px;
  margin: 8px auto;
}

.cell {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  padding: 10px 4px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cell.present {
  background: #e0f2fe;
  border-color: #0284c7;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.15);
}

.cell.kua-added {
  background: #fef3c7;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.cell strong {
  font-size: 26px;
  font-weight: 900;
}
.cell.present strong { color: #0284c7; }
.cell.kua-added strong { color: #b45309; }
.cell:not(.present):not(.kua-added) strong { color: #94a3b8; }
.cell small { font-size: 9.5px; color: #64748b; font-weight: 600; }

.kua-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: #fde68a;
  color: #92400e;
  font-size: 9px;
  font-weight: 850;
}

/* Plane Cards & Dasha Heroes */
.plane-card, .pred-card, .pinnacle-card, .challenge-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}

.plane-header, .pred-header, .pinnacle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.plane-title, .pred-title { font-size: 14px; font-weight: 800; color: #0f172a; }

.plane-badge { display: inline-block; padding: 3px 8px; border-radius: var(--radius-full); font-size: 10px; font-weight: 800; }
.plane-badge.complete { background: #e0f2fe; color: #0284c7; border: 1px solid #7dd3fc; }
.plane-badge.partial { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.plane-badge.empty { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

.plane-bar { height: 6px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin: 3px 0; }
.plane-bar span { display: block; height: 100%; border-radius: 6px; }
.plane-bar span.complete { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.plane-bar span.partial { background: linear-gradient(90deg, #f59e0b, #d97706); }
.plane-bar span.empty { background: #ef4444; }

.num-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 900;
  font-size: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #7dd3fc;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.15);
  flex-shrink: 0;
}

.remedy-box {
  background: #f0f9ff;
  border-left: 3px solid #0284c7;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}
.remedy-box strong { color: #0284c7; font-size: 11px; display: block; margin-bottom: 3px; }
.remedy-list { margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.55; color: #0f172a; }

.challenge-card.is-major {
  border-color: #fde68a;
  background: #fffdf5;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12);
}

.challenge-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 9.5px;
  font-weight: 850;
  text-transform: uppercase;
}
.challenge-badge.major {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.challenge-badge.minor {
  background: #e0f2fe;
  color: #0284c7;
}

.dasha-hero {
  background: #ffffff;
  border: 1.5px solid var(--sky-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.1);
}

.dasha-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}
.dasha-box strong { color: #0284c7; font-size: 11px; display: block; margin-bottom: 3px; text-transform: uppercase; }
.dasha-box p { font-size: 12px; line-height: 1.5; color: #0f172a; margin: 0; }
.dasha-box ul { margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.5; color: #475569; }

/* Timeline Bar Chart */
.timeline { display: flex; align-items: end; gap: 6px; min-height: 180px; overflow-x: auto; padding: 10px 2px; }
.yearbar { flex: 1; min-width: 48px; text-align: center; font-size: 10.5px; }
.yearbar .column { background: linear-gradient(180deg, #38bdf8, #0284c7); border-radius: 6px 6px 2px 2px; margin: 5px auto; width: 65%; min-height: 20px; }

/* ==========================================================================
   Add/Edit Profile Modal / Bottom Sheet
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-sheet {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-top: 2px solid var(--sky);
  border-radius: 28px 28px 0 0;
  padding: 14px 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.2);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-drag-bar {
  width: 42px;
  height: 4px;
  border-radius: 3px;
  background: #cbd5e1;
  align-self: center;
  margin-bottom: 4px;
}

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

.modal-gem {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0284c7;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.modal-header h3 { font-size: 16px; font-weight: 850; color: #0f172a; }
.modal-header small { font-size: 11px; color: #475569; }

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
}

.modal-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.modal-form-row { display: flex; gap: 10px; }

.modal-form-group label {
  font-size: 10px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.5px;
}

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

.modal-icon {
  position: absolute;
  left: 12px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.7;
}

input[type="text"], input[type="date"] {
  width: 100%;
  height: 46px;
  padding: 0 12px 0 38px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

input[type="text"]:focus, input[type="date"]:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  background: #ffffff;
}

.modal-gender-segmented {
  display: flex;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 3px;
  height: 46px;
  gap: 4px;
}

.gender-btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.gender-btn.active {
  background: #ffffff;
  border: 1px solid #7dd3fc;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.btn-save-profile {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(90deg, #38bdf8 0%, #0284c7 100%);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.28);
}

.btn-cancel-modal {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.app-footer {
  text-align: center;
  font-size: 10.5px;
  color: #64748b;
  padding: 14px 4px 20px;
  line-height: 1.5;
}

/* ==========================================================================
   Dark Theme (Night Mode) Styles - Deep Cosmic Neon Sky
   ========================================================================== */
body.dark {
  --bg-deep: #050b14;
  --bg-surface: #0a1322;
  --panel: rgba(13, 24, 41, 0.94);
  --panel-card: #0f1c30;
  --panel-elevated: #152744;

  --sky: #38bdf8;
  --sky-bright: #7dd3fc;
  --sky-light: #bae6fd;
  --sky-soft: rgba(56, 189, 248, 0.12);
  --sky-glow: rgba(56, 189, 248, 0.28);
  --sky-border: rgba(56, 189, 248, 0.35);
  --sky-border-subtle: rgba(56, 189, 248, 0.2);

  --cyan: #38bdf8;
  --cyan-bright: #7dd3fc;
  --cyan-glow: rgba(56, 189, 248, 0.28);
  --cyan-border: rgba(56, 189, 248, 0.35);
  --cyan-bg: rgba(56, 189, 248, 0.12);

  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --border: #1e3148;

  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.3);

  color-scheme: dark;
}

body.dark .mobile-device-frame {
  background: var(--bg-surface);
  border-color: #1e293b;
  box-shadow: 0 0 0 2px #0f172a, 0 25px 70px rgba(0, 0, 0, 0.6);
}

body.dark .status-time,
body.dark .status-icons {
  color: #f8fafc;
}

body.dark .battery-icon {
  border-color: #f8fafc;
}
body.dark .battery-icon::after {
  background: #f8fafc;
}
body.dark .battery-fill {
  background: #f8fafc;
}

body.dark .dynamic-island {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark .topbar-icon-btn {
  background: #111e33;
  border-color: var(--sky-border-subtle);
  color: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .brand-title {
  color: #f8fafc;
}

body.dark .hero-brand-heading {
  color: #38bdf8;
}

body.dark .hero-brand-sub {
  color: #cbd5e1;
}

body.dark .hero-gold-badge {
  background: rgba(180, 83, 9, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

body.dark .entry-form-card,
body.dark .recent-analyses-card,
body.dark .active-profile-card,
body.dark .card,
body.dark .plane-card,
body.dark .pinnacle-card,
body.dark .challenge-card,
body.dark .dasha-hero {
  background: var(--panel-card);
  border-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

body.dark .entry-card-title,
body.dark .section-card-header strong,
body.dark .profile-name-row strong,
body.dark .modal-form-group label {
  color: var(--text);
}

body.dark .entry-card-sub,
body.dark .active-profile-label {
  color: var(--text-dim);
}

body.dark .modal-input-wrap {
  background: #091322;
  border-color: var(--border);
}

body.dark .modal-input-wrap input {
  color: #f8fafc;
  background: transparent;
}

body.dark .modal-gender-segmented {
  background: #091322;
  border-color: var(--border);
}

body.dark .gender-btn {
  color: var(--text-muted);
}

body.dark .gender-btn.active {
  background: #152b47;
  color: #38bdf8;
  border-color: var(--sky-border);
}

body.dark .recent-item-card {
  background: #0d192c;
  border-color: var(--border);
}

body.dark .recent-avatar-circle {
  background: #152744;
  border-color: var(--border);
  color: var(--sky);
}

body.dark .recent-item-info strong {
  color: var(--text);
}

body.dark .recent-meta {
  color: var(--text-dim);
}

body.dark .dash-cat-pill {
  background: #0e1b30;
  border-color: var(--border);
  color: #cbd5e1;
}

body.dark .dash-cat-pill.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #060d17;
}

body.dark .loshu-container {
  background: #0a1526;
  border-color: var(--border);
}

body.dark .cell {
  background: #0e1b30;
  border-color: var(--border);
  color: var(--text-dim);
}

body.dark .cell.present {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--sky);
  color: #38bdf8;
}

body.dark .cell strong {
  color: var(--text);
}

body.dark .mobile-bottom-nav {
  background: rgba(10, 21, 38, 0.94);
  border-top-color: var(--border);
}

body.dark .nav-tab {
  color: var(--text-dim);
}

body.dark .nav-tab.active {
  color: var(--sky);
}

body.dark .remedy-box {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}

body.dark .app-footer {
  color: var(--text-dim);
}

body.dark .section-title {
  color: var(--text);
}

body.dark .label {
  color: var(--text-dim);
}

body.dark .metric {
  color: var(--sky-bright);
}

body.dark .muted {
  color: var(--text-muted);
}

body.dark .chip {
  background: var(--sky-soft);
  border: 1px solid var(--sky-border-subtle);
  color: var(--sky-bright);
}

body.dark .cell small,
body.dark .recent-chevron {
  color: var(--text-dim);
}

body.dark .plane-title,
body.dark .pred-title,
body.dark .remedy-list,
body.dark .dasha-box p {
  color: var(--text);
}

body.dark .remedy-box strong,
body.dark .dasha-box strong,
body.dark .view-all-link {
  color: var(--sky-bright);
}

body.dark .dasha-box {
  background: #091322;
  border-color: var(--border);
}

body.dark .dasha-box ul {
  color: var(--text-muted);
}

body.dark .modal-header h3 {
  color: var(--text);
}

body.dark .modal-header small {
  color: var(--text-dim);
}

/* ==========================================================================
   Settings & Knowledge Hub Sheet Modal Styles
   ========================================================================== */
.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}

.settings-modal-sheet {
  background: var(--panel-card);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  border-top: 1.5px solid var(--sky-border);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-drag-bar {
  width: 42px;
  height: 4px;
  border-radius: 3px;
  background: #cbd5e1;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
body.dark .modal-drag-bar { background: #334155; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-icon-badge {
  font-size: 22px;
}

.settings-title {
  font-size: 16px;
  font-weight: 850;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.settings-sub {
  font-size: 11px;
  color: var(--sky);
  font-weight: 700;
  display: block;
}

.settings-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.settings-close-btn:hover {
  background: var(--sky-soft);
  color: var(--sky);
}

.settings-body {
  padding: 14px 16px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
}

.settings-card-label {
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.8px;
  color: var(--sky);
  margin-bottom: 4px;
}

.settings-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.bilingual-toggle-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lang-pill-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.lang-pill-btn:hover {
  border-color: var(--sky-border);
}
.lang-pill-btn.active {
  border-color: var(--sky);
  background: var(--sky-soft);
}
.lang-pill-btn .flag-icon {
  font-size: 20px;
  margin-right: 10px;
}
.lang-pill-info {
  flex: 1;
}
.lang-pill-info strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.lang-pill-info small {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
}
.lang-pill-btn .check-mark {
  color: var(--sky);
  font-weight: 900;
  font-size: 15px;
}

.theme-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--panel-card);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.theme-choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}
.theme-choice-btn.active {
  background: var(--sky);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--sky-glow);
}
body.dark .theme-choice-btn.active {
  color: #050b14;
}

.hub-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
  padding-bottom: 2px;
}
.hub-heading-icon {
  font-size: 20px;
  color: var(--sky);
}
.hub-section-heading h3 {
  font-size: 14.5px;
  font-weight: 850;
  color: var(--text);
  line-height: 1.3;
}
.hub-section-heading small {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sky);
}

/* Concept Cards */
.concept-accordion-card {
  background: var(--panel-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

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

.concept-badge-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sky-soft);
  color: var(--sky);
  border: 1.5px solid var(--sky-border);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

.concept-title-box h4 {
  font-size: 13.5px;
  font-weight: 850;
  color: var(--text);
  margin: 0;
  line-height: 1.25;
}
.concept-title-box small {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
}

.concept-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.concept-formula-box {
  background: var(--bg-surface);
  border: 1px solid var(--sky-border-subtle);
  border-left: 3px solid var(--sky);
  border-radius: 8px;
  padding: 8px 10px;
}
.concept-formula-box .formula-tag {
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.6px;
  color: var(--sky);
  margin-bottom: 3px;
}
.concept-formula-box code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.concept-formula-box p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.concept-example-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.5;
}
.concept-example-box strong {
  color: var(--sky);
  font-size: 11.5px;
}
.concept-example-box ul {
  padding-left: 16px;
  margin: 4px 0 0;
}
.concept-example-box li {
  margin-bottom: 2px;
}

.concept-note {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
}

.concept-loshu-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.mini-cell {
  background: var(--panel-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text);
}
body.dark .mini-cell {
  background: #111e33;
  border-color: var(--border);
}

/* ==========================================================================
   User Management & Auth Modal Styles
   ========================================================================== */
.topbar-icon-btn.btn-locked,
.topbar-icon-btn[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  filter: grayscale(1);
}

.unregistered-save-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1.5px dashed var(--sky-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.unregistered-save-prompt:hover {
  background: var(--sky-soft);
  border-color: var(--sky);
}
.save-prompt-icon {
  font-size: 24px;
  color: var(--sky);
  flex-shrink: 0;
}
.save-prompt-info {
  flex: 1;
}
.save-prompt-info strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.save-prompt-info small {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}
.btn-prompt-login {
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--sky);
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.auth-credential-input {
  height: 46px;
  border: 1.5px solid var(--sky-border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-credential-input:focus-within {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-glow);
}

.auth-credential-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 38px;
  border: 0;
  border-radius: inherit;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

.auth-credential-input input::placeholder {
  color: var(--text-dim);
  opacity: 0.9;
  font-weight: 500;
}

.auth-credential-input input:focus {
  box-shadow: none;
}

.auth-credential-input #authPassword {
  padding-right: 44px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--sky);
  background: var(--sky-soft);
  outline: none;
}

body.dark .auth-credential-input {
  border-color: var(--border);
  background: #091322;
}

body.dark .auth-credential-input input {
  color: var(--text);
}

.user-active-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  border: 1.5px solid #ffffff;
}
body.dark .user-active-dot {
  border-color: #0f1c30;
}

.auth-tabs-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.auth-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-tab-btn.active {
  background: var(--sky);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--sky-glow);
}
body.dark .auth-tab-btn.active {
  color: #050b14;
}

.auth-feedback-box {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: 2px;
}
.auth-feedback-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}
.auth-feedback-box.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}
body.dark .auth-feedback-box.error {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.35);
  color: #f87171;
}
body.dark .auth-feedback-box.success {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.35);
  color: #4ade80;
}

.auth-info-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
}

.auth-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--sky-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.auth-avatar-big {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky) 0%, #0369a1 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 0 16px var(--sky-glow);
  flex-shrink: 0;
}

.auth-user-details {
  display: flex;
  flex-direction: column;
}

.auth-user-badge {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.5px;
  color: #10b981;
}

.auth-username-text {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  margin: 1px 0;
}

.auth-user-meta {
  font-size: 11.5px;
  color: var(--text-dim);
}

.btn-logout-danger {
  height: 42px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #dc2626;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-logout-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}
body.dark .btn-logout-danger {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.35);
  color: #f87171;
}

/* ==========================================================================
   Print / One-Click PDF Report Export Styles
   ========================================================================== */
.btn-print-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1.5px solid var(--sky-border);
  color: var(--sky);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1.15;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-print-profile:hover {
  background: var(--sky);
  color: #ffffff;
  border-color: var(--sky);
}
body.dark .btn-print-profile {
  background: #0d1e35;
  border-color: var(--sky-border);
  color: var(--sky);
}

.printable-report-area {
  display: none;
}

/* ==========================================================================
   Education & Learning Guidance Module Styling
   ========================================================================== */
.edu-disclaimer-banner {
  background: #fffbeb;
  border: 1.5px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #92400e;
}
body.dark .edu-disclaimer-banner {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  border-left-color: #f59e0b;
  color: #fef3c7;
}

.edu-archetype-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.05), rgba(56, 189, 248, 0.1));
  border: 1.5px solid var(--sky-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
body.dark .edu-archetype-card {
  background: linear-gradient(135deg, rgba(15, 28, 48, 0.8), rgba(2, 132, 199, 0.15));
  border-color: var(--border);
}

.edu-domain-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}
body.dark .edu-domain-card {
  background: #0f1c30;
  border-color: var(--border);
}
.edu-domain-card:hover {
  border-color: var(--sky-border);
}

.edu-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.edu-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle, rgba(0,0,0,0.02));
  border: 1.5px solid var(--border);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
body.dark .edu-chip {
  background: #15243b;
  border-color: var(--border);
  color: #cbd5e1;
}
.edu-chip:hover {
  border-color: var(--sky);
  color: var(--sky);
  transform: translateY(-1px);
}
.edu-chip.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--sky-glow);
}

.edu-sprint-day {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-subtle, rgba(0,0,0,0.02));
  border: 1px solid var(--border);
  margin-bottom: 6px;
  transition: all 0.15s ease;
}
body.dark .edu-sprint-day {
  background: #0d1829;
  border-color: var(--border);
}
.edu-sprint-day.completed {
  opacity: 0.65;
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
}
.edu-sprint-day.completed .sprint-task {
  text-decoration: line-through;
}

.edu-day-badge {
  background: var(--sky-soft);
  color: var(--primary);
  font-weight: 850;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.edu-remedy-box {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-bottom: 8px;
}
body.dark .edu-remedy-box {
  background: #0e1a2d;
  border-color: var(--border);
}

@media print {
  /* Complete clean-sheet A4 formatting */
  @page {
    size: A4 portrait;
    margin: 15mm 15mm 15mm 15mm;
  }

  body, html {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
  }

  /* Hide screen-only interactive app frame */
  .mobile-device-frame,
  .cosmic-bg,
  .modal-overlay,
  #bottomNavBar,
  .dash-category-wrapper {
    display: none !important;
  }

  .printable-report-area {
    display: block !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-page {
    page-break-after: always;
    break-after: page;
    padding-bottom: 20px;
  }
  .print-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .print-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2.5px solid #0284c7;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  .print-logo-title h1 {
    font-size: 22pt;
    font-weight: 900;
    color: #0284c7;
    margin: 0;
    letter-spacing: -0.5px;
  }
  .print-logo-title small {
    font-size: 9pt;
    font-weight: 750;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .print-meta-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    background: #f8fafc;
  }
  .print-meta-box span {
    font-size: 8.5pt;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    display: block;
  }
  .print-meta-box strong {
    font-size: 14pt;
    color: #0284c7;
  }

  .print-section-title {
    font-size: 12pt;
    font-weight: 850;
    color: #0f172a;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 4px;
    margin: 14px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .print-card {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: #ffffff;
  }

  .print-loshu-table {
    margin: 10px auto;
    border-collapse: collapse;
    width: 210px;
  }
  .print-loshu-table td {
    width: 70px;
    height: 70px;
    border: 2px solid #0284c7;
    text-align: center;
    vertical-align: middle;
    font-size: 18pt;
    font-weight: 900;
    color: #0284c7;
    background: #f0f9ff;
  }
  .print-loshu-table td.empty {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #cbd5e1;
  }

  .print-footer-certification {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    font-size: 8.5pt;
    color: #64748b;
  }
}
