/* ==========================================================================
   Arka — The Success Operating System
   Dark Navy Theme with Gold Accents — Phase 1 MVP
   ========================================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #0a1628;
  --navy-light: #101d33;
  --navy-card: #0f1a2e;
  --navy-border: rgba(201, 168, 76, 0.12);
  --gold: #c9a84c;
  --gold-dim: rgba(201, 168, 76, 0.10);
  --gold-glow: rgba(201, 168, 76, 0.25);
  --gold-bright: #e2c566;
  --text: #e8e4dc;
  --text-dim: #8a8678;
  --text-muted: #5a5647;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--gold); text-decoration: none; }

/* ---- App Shell ---- */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { display: none; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; }
.screen-content {
  flex: 1; padding: 1.25rem;
  padding-bottom: calc(5.5rem + var(--safe-bottom));
  overflow-y: auto;
}

/* ---- Auth ---- */
.auth-screen {
  justify-content: center; align-items: center;
  padding: 2rem 1.25rem;
  background: radial-gradient(ellipse at 50% 20%, rgba(201,168,76,0.06) 0%, transparent 60%);
}
.auth-logo { font-family:'Space Grotesk',sans-serif; font-size:2.25rem; font-weight:700; color:var(--gold); letter-spacing:-0.02em; margin-bottom:0.25rem; }
.auth-logo-dot { display:inline-block; width:8px; height:8px; background:var(--gold); border-radius:50%; margin-left:2px; box-shadow:0 0 12px var(--gold); }
.auth-subtitle { font-size:0.85rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.15em; margin-bottom:2.5rem; }
.auth-card { width:100%; max-width:380px; background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius); padding:2rem 1.5rem; }
.auth-tabs { display:flex; margin-bottom:1.75rem; border-bottom:1px solid rgba(201,168,76,0.08); }
.auth-tab { flex:1; padding:0.75rem; font-family:'Space Grotesk',sans-serif; font-size:0.85rem; font-weight:600; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); background:none; border:none; cursor:pointer; transition:color 0.2s; position:relative; }
.auth-tab.active { color:var(--gold); }
.auth-tab.active::after { content:''; position:absolute; bottom:-1px; left:0; right:0; height:2px; background:var(--gold); }
.auth-form { display:none; }
.auth-form.active { display:block; }

.form-group { margin-bottom:1rem; }
.form-label { display:flex; align-items:center; gap:0.35rem; font-size:0.7rem; text-transform:uppercase; letter-spacing:0.12em; color:var(--text-dim); margin-bottom:0.4rem; }
.form-label svg { width:14px; height:14px; stroke:var(--gold); fill:none; stroke-width:2; }
.form-input { width:100%; padding:0.75rem 1rem; background:var(--navy); border:1px solid rgba(201,168,76,0.1); border-radius:var(--radius-sm); color:var(--text); font-size:0.95rem; font-family:inherit; outline:none; transition:border-color 0.2s; }
.form-input:focus { border-color:var(--gold); }
.form-input::placeholder { color:var(--text-muted); }
.form-input-lg { font-size:1.2rem; padding:1rem 1.25rem; text-align:center; }
.form-input:disabled { opacity:0.4; cursor:not-allowed; }
.form-error { font-size:0.78rem; color:var(--red); margin-top:0.5rem; }
.form-check { display:flex; align-items:center; gap:0.5rem; font-size:0.85rem; color:var(--text-dim); cursor:pointer; }
.form-check input[type="checkbox"] { width:18px; height:18px; accent-color:var(--gold); cursor:pointer; }

select.form-input { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8678' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 1rem center; padding-right:2.5rem; }

/* ---- Buttons ---- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:0.5rem; padding:0.8rem 1.5rem; border:none; border-radius:var(--radius-sm); font-family:'Space Grotesk',sans-serif; font-size:0.9rem; font-weight:600; cursor:pointer; transition:all 0.2s; letter-spacing:0.02em; }
.btn svg { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; }
.btn-primary { background:var(--gold); color:var(--navy); }
.btn-primary:hover { filter:brightness(1.1); }
.btn-primary:active { transform:scale(0.98); }
.btn-primary:disabled { opacity:0.5; cursor:not-allowed; }
.btn-full { width:100%; }
.btn-secondary { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(201,168,76,0.15); }
.btn-secondary:hover { background:rgba(201,168,76,0.15); }
.btn-ghost { background:transparent; color:var(--text-dim); padding:0.5rem; }
.btn-danger { background:rgba(239,68,68,0.1); color:var(--red); border:1px solid rgba(239,68,68,0.15); }
.btn-danger:hover { background:rgba(239,68,68,0.15); }
.btn-sm { padding:0.4rem 0.75rem; font-size:0.78rem; }
.btn-icon { width:36px; height:36px; padding:0; border-radius:0.5rem; }
.btn-link { background:none; border:none; color:var(--text-dim); font-size:0.85rem; cursor:pointer; font-family:inherit; text-decoration:underline; text-underline-offset:2px; transition:color 0.2s; }
.btn-link:hover { color:var(--gold); }

/* ---- Onboarding — Welcome Screen ---- */
.onboard-screen { justify-content:center; align-items:center; padding:2rem 1.25rem; background:radial-gradient(ellipse at 50% 30%, rgba(201,168,76,0.05) 0%, transparent 60%); }
.onboard-container { width:100%; max-width:440px; }
.onboard-step { display:none; }
.onboard-step.active { display:block; animation:fadeInUp 0.4s ease; }
.onboard-header { text-align:center; margin-bottom:2rem; }
.onboard-step-label { font-size:0.7rem; text-transform:uppercase; letter-spacing:0.15em; color:var(--text-muted); margin-bottom:0.75rem; }
.onboard-title { font-size:1.6rem; margin-bottom:0.5rem; }
.onboard-sub { font-size:0.9rem; color:var(--text-dim); line-height:1.5; }

.onboard-progress { height:3px; background:rgba(201,168,76,0.08); border-radius:2px; margin-bottom:2rem; overflow:hidden; }
.onboard-progress-fill { height:100%; background:var(--gold); border-radius:2px; transition:width 0.5s ease; }

.onboard-btn-row { display:flex; gap:0.75rem; }
.onboard-skip-link { text-align:center; margin-top:1rem; }

/* Welcome */
.onboard-welcome { text-align:center; }
.onboard-welcome-icon { margin-bottom:1.5rem; }
.onboard-welcome-icon svg { width:48px; height:48px; stroke:var(--gold); fill:none; stroke-width:1.5; filter:drop-shadow(0 0 20px rgba(201,168,76,0.3)); }
.onboard-welcome-title { font-size:2rem; font-weight:700; margin-bottom:0.5rem; background:linear-gradient(135deg, var(--gold), var(--gold-bright)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.onboard-welcome-tagline { font-size:0.95rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.15em; margin-bottom:2.5rem; }
.onboard-welcome-features { display:flex; flex-direction:column; gap:1rem; margin-bottom:2.5rem; text-align:left; }
.onboard-feature { display:flex; align-items:flex-start; gap:0.85rem; padding:0.85rem 1rem; background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius-sm); }
.onboard-feature-icon svg { width:22px; height:22px; stroke:var(--gold); fill:none; stroke-width:2; flex-shrink:0; margin-top:2px; }
.onboard-feature-title { font-family:'Space Grotesk',sans-serif; font-size:0.9rem; font-weight:600; margin-bottom:0.15rem; }
.onboard-feature-desc { font-size:0.8rem; color:var(--text-dim); line-height:1.4; }
.onboard-welcome-note { font-size:0.75rem; color:var(--text-muted); margin-top:1rem; }

/* Nakshatra */
.nakshatra-grid { display:flex; flex-wrap:wrap; gap:0.5rem; margin-bottom:2rem; max-height:280px; overflow-y:auto; padding-right:0.25rem; }
.nakshatra-chip { padding:0.5rem 0.85rem; font-size:0.82rem; background:var(--navy-card); border:1.5px solid rgba(201,168,76,0.1); border-radius:100px; color:var(--text); cursor:pointer; transition:all 0.2s; font-family:inherit; white-space:nowrap; }
.nakshatra-chip:hover { border-color:rgba(201,168,76,0.3); }
.nakshatra-chip.selected { border-color:var(--gold); background:rgba(201,168,76,0.1); color:var(--gold); }

/* Domain Selection */
.domain-select-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; margin-bottom:2rem; }
.domain-select-card { display:flex; align-items:center; gap:0.75rem; padding:1rem; background:var(--navy-card); border:1.5px solid rgba(201,168,76,0.08); border-radius:var(--radius-sm); cursor:pointer; transition:all 0.2s; user-select:none; }
.domain-select-card:hover { border-color:rgba(201,168,76,0.2); }
.domain-select-card.selected { border-color:var(--gold); background:rgba(201,168,76,0.06); }
.domain-select-icon { width:36px; height:36px; display:flex; align-items:center; justify-content:center; background:var(--gold-dim); border-radius:0.5rem; flex-shrink:0; }
.domain-select-icon svg { width:18px; height:18px; stroke:var(--gold); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.domain-select-label { font-family:'Space Grotesk',sans-serif; font-size:0.82rem; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; flex:1; }
.domain-select-check { width:20px; height:20px; border-radius:50%; border:1.5px solid rgba(201,168,76,0.2); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:all 0.2s; }
.domain-select-check svg { width:12px; height:12px; stroke:transparent; fill:none; stroke-width:3; }
.domain-select-card.selected .domain-select-check { background:var(--gold); border-color:var(--gold); }
.domain-select-card.selected .domain-select-check svg { stroke:var(--navy); }

/* ---- Top Bar ---- */
.top-bar { display:flex; align-items:center; justify-content:space-between; padding:1rem 1.25rem; padding-top:calc(1rem + env(safe-area-inset-top, 0px)); }
.top-bar-logo { font-family:'Space Grotesk',sans-serif; font-size:1.3rem; font-weight:700; color:var(--gold); }
.top-bar-score { display:flex; align-items:center; gap:0.4rem; font-family:'Space Grotesk',sans-serif; font-size:0.75rem; font-weight:600; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.1em; }
.top-bar-score svg { width:16px; height:16px; stroke:var(--gold); fill:none; stroke-width:2; }
.top-bar-score-value { font-size:1.1rem; color:var(--gold); }

/* ---- Section Headers ---- */
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.section-title { font-size:0.7rem; text-transform:uppercase; letter-spacing:0.15em; color:var(--text-dim); }

/* ---- Dashboard Greeting ---- */
.dashboard-greeting { margin-bottom:1rem; }
.dashboard-greeting-text { font-size:1.1rem; color:var(--text-dim); }
.dashboard-greeting-text span { color:var(--text); font-weight:500; }

/* ---- Arka Score Card — Circle Ring ---- */
.score-card { background:linear-gradient(135deg, var(--navy-card) 0%, rgba(201,168,76,0.04) 100%); border:1px solid var(--navy-border); border-radius:var(--radius); padding:1.75rem; text-align:center; margin-bottom:1.5rem; position:relative; overflow:hidden; }
.score-card::before { content:''; position:absolute; top:-50%; left:-50%; width:200%; height:200%; background:radial-gradient(circle at center, rgba(201,168,76,0.04) 0%, transparent 50%); pointer-events:none; }
.score-ring { position:relative; width:140px; height:140px; margin:0 auto 1rem; }
.score-ring svg { width:100%; height:100%; }
.score-ring-value { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.score-value { font-family:'Space Grotesk',sans-serif; font-size:2.5rem; font-weight:700; color:var(--gold); line-height:1; }
.score-label { font-size:0.6rem; text-transform:uppercase; letter-spacing:0.15em; color:var(--text-muted); margin-top:0.25rem; }
.score-stats { display:flex; justify-content:center; gap:2.5rem; position:relative; }
.score-stat { text-align:center; }
.score-stat-value { font-family:'Space Grotesk',sans-serif; font-size:1.1rem; font-weight:600; color:var(--text); }
.score-stat-sep { opacity:0.4; }
.score-stat-label { font-size:0.6rem; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); }

/* ---- 11 Domains Grid ---- */
.domains-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; margin-bottom:1.5rem; }
.domain-card { background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius); padding:1.25rem; cursor:pointer; transition:all 0.25s; position:relative; }
.domain-card:hover { border-color:rgba(201,168,76,0.25); transform:translateY(-2px); }
.domain-card:active { transform:scale(0.98); }
.domain-card-icon { width:42px; height:42px; display:flex; align-items:center; justify-content:center; background:var(--gold-dim); border-radius:0.75rem; margin-bottom:0.9rem; }
.domain-card-icon svg { width:20px; height:20px; stroke:var(--gold); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.domain-card-name { font-family:'Space Grotesk',sans-serif; font-size:0.82rem; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; margin-bottom:0.25rem; }
.domain-card-sync { font-size:0.65rem; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); }
.domain-card-sync span { color:var(--gold); }

/* ---- Domain Detail ---- */
.domain-header { display:flex; align-items:center; gap:1rem; margin-bottom:1.5rem; }
.domain-back { width:36px; height:36px; display:flex; align-items:center; justify-content:center; background:var(--gold-dim); border-radius:0.5rem; cursor:pointer; border:none; transition:background 0.2s; }
.domain-back:hover { background:rgba(201,168,76,0.15); }
.domain-back svg { width:18px; height:18px; stroke:var(--gold); fill:none; stroke-width:2; }
.domain-title-row { flex:1; }
.domain-detail-name { font-size:1.25rem; margin-bottom:0.1rem; }
.domain-detail-sync { font-size:0.7rem; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-dim); }
.domain-detail-sync span { color:var(--gold); }

/* ---- Goals ---- */
.goals-list { display:flex; flex-direction:column; gap:0.75rem; margin-bottom:1.5rem; }
.goal-card { background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius-sm); padding:1rem 1.25rem; }
.goal-card-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:0.25rem; }
.goal-card-title { font-size:0.95rem; font-weight:500; flex:1; }
.goal-card-actions { display:flex; gap:0.25rem; flex-shrink:0; }
.goal-card-desc { font-size:0.82rem; color:var(--text-dim); line-height:1.5; }

/* ---- Habit Cards ---- */
.habits-list { display:flex; flex-direction:column; gap:0.5rem; margin-bottom:1.5rem; }
.habit-card { display:flex; align-items:center; gap:0.75rem; padding:0.85rem 1rem; background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius-sm); cursor:pointer; transition:all 0.2s; }
.habit-card:hover { border-color:rgba(201,168,76,0.2); }
.habit-card.completed { border-color:rgba(34,197,94,0.2); }
.habit-checkbox { width:28px; height:28px; border-radius:0.5rem; border:2px solid rgba(201,168,76,0.2); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:all 0.25s; }
.habit-card.completed .habit-checkbox { background:var(--green); border-color:var(--green); }
.habit-checkbox svg { width:14px; height:14px; stroke:var(--navy); fill:none; stroke-width:3; opacity:0; transition:opacity 0.2s; }
.habit-card.completed .habit-checkbox svg { opacity:1; }
.habit-info { flex:1; min-width:0; }
.habit-title { font-size:0.88rem; font-weight:500; }
.habit-card.completed .habit-title { text-decoration:line-through; opacity:0.6; }
.habit-meta { font-size:0.7rem; color:var(--text-muted); }
.habit-streak { font-family:'Space Grotesk',sans-serif; font-size:0.75rem; font-weight:600; color:var(--gold); white-space:nowrap; }
.habit-delete { width:24px; height:24px; display:flex; align-items:center; justify-content:center; background:none; border:none; cursor:pointer; opacity:0; transition:opacity 0.2s; }
.habit-card:hover .habit-delete { opacity:0.5; }
.habit-delete:hover { opacity:1 !important; }
.habit-delete svg { width:14px; height:14px; stroke:var(--red); fill:none; stroke-width:2; }

/* ---- Today Check-in ---- */
.today-greeting { font-size:1.3rem; margin-bottom:0.25rem; }
.today-date { font-size:0.8rem; color:var(--text-dim); margin-bottom:1.5rem; }
.today-progress-bar { height:6px; background:var(--navy-card); border-radius:3px; margin-bottom:0.5rem; overflow:hidden; }
.today-progress-fill { height:100%; background:linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius:3px; transition:width 0.5s ease; }
.today-progress-text { font-size:0.75rem; color:var(--text-dim); text-align:right; margin-bottom:1.5rem; }

/* ---- User Data Section ---- */
.data-header { margin-bottom:1.5rem; }
.data-title { font-size:1.25rem; display:flex; align-items:center; gap:0.5rem; margin-bottom:0.4rem; }
.data-title svg { width:22px; height:22px; stroke:var(--gold); fill:none; stroke-width:2; }
.data-subtitle { font-size:0.85rem; color:var(--text-dim); line-height:1.5; }

.data-section { background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius); padding:1.25rem; margin-bottom:1rem; }
.data-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.data-section-title { font-family:'Space Grotesk',sans-serif; font-size:0.82rem; font-weight:600; text-transform:uppercase; letter-spacing:0.08em; display:flex; align-items:center; gap:0.4rem; }
.data-section-title svg { width:16px; height:16px; stroke:var(--gold); fill:none; stroke-width:2; }

.data-grid { display:flex; flex-direction:column; gap:0.75rem; }
.data-item { display:flex; flex-direction:column; gap:0.15rem; }
.data-item-label { font-size:0.65rem; text-transform:uppercase; letter-spacing:0.12em; color:var(--text-muted); }
.data-item-value { font-size:0.9rem; display:flex; align-items:center; gap:0.5rem; }
.data-empty { color:var(--text-muted); font-style:italic; }
.data-delete-btn { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; background:none; border:none; cursor:pointer; opacity:0.4; transition:opacity 0.2s; padding:0; }
.data-delete-btn:hover { opacity:1; }
.data-delete-btn svg { width:12px; height:12px; stroke:var(--red); fill:none; stroke-width:2; }

.data-danger-zone { border-color:rgba(239,68,68,0.15); }
.data-danger-desc { font-size:0.82rem; color:var(--text-dim); margin-bottom:1rem; line-height:1.5; }

/* ---- Settings ---- */
.settings-heading { font-size:1.25rem; margin-bottom:1.5rem; display:flex; align-items:center; gap:0.5rem; }
.settings-heading svg { width:22px; height:22px; stroke:var(--gold); fill:none; stroke-width:2; }
.settings-section { background:var(--navy-card); border:1px solid var(--navy-border); border-radius:var(--radius); overflow:hidden; margin-bottom:1rem; }
.settings-item { display:flex; align-items:center; gap:0.85rem; padding:1rem 1.25rem; border-bottom:1px solid rgba(201,168,76,0.05); transition:background 0.2s; }
.settings-item:last-child { border-bottom:none; }
.settings-item:hover { background:rgba(201,168,76,0.03); }
.settings-item-icon { width:20px; height:20px; flex-shrink:0; }
.settings-item-icon svg { width:20px; height:20px; stroke:var(--gold); fill:none; stroke-width:2; }
.settings-item-label { font-size:0.9rem; font-weight:500; flex:1; }
.settings-item-sub { font-size:0.78rem; color:var(--text-dim); }
.settings-item-arrow { width:16px; height:16px; transform:rotate(180deg); opacity:0.3; }
.settings-item-arrow svg { width:16px; height:16px; stroke:var(--text-dim); fill:none; stroke-width:2; }
.settings-version { text-align:center; font-size:0.7rem; color:var(--text-muted); margin-top:2rem; }

/* ---- Bottom Nav ---- */
.bottom-nav { position:fixed; bottom:0; left:0; right:0; background:rgba(10,22,40,0.95); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border-top:1px solid var(--navy-border); display:flex; justify-content:space-around; padding:0.6rem 0; padding-bottom:calc(0.6rem + var(--safe-bottom)); z-index:100; }
.nav-item { display:flex; flex-direction:column; align-items:center; gap:0.2rem; padding:0.4rem 0.75rem; cursor:pointer; border:none; background:none; color:var(--text-muted); transition:color 0.2s; }
.nav-item.active { color:var(--gold); }
.nav-item svg { width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.nav-item-label { font-size:0.6rem; text-transform:uppercase; letter-spacing:0.08em; font-family:'Space Grotesk',sans-serif; font-weight:600; }

/* ---- Modal ---- */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:200; display:none; align-items:flex-end; justify-content:center; }
.modal-overlay.active { display:flex; animation:fadeIn 0.2s ease; }
.modal-content { width:100%; max-width:500px; max-height:85vh; background:var(--navy-light); border-radius:var(--radius) var(--radius) 0 0; padding:1.5rem; padding-bottom:calc(1.5rem + var(--safe-bottom)); overflow-y:auto; animation:slideUp 0.3s ease; }
.modal-handle { width:40px; height:4px; background:rgba(201,168,76,0.2); border-radius:2px; margin:0 auto 1.25rem; }
.modal-title { font-size:1.1rem; margin-bottom:1.25rem; }
.install-modal-icon svg { width:48px; height:48px; stroke:var(--gold); fill:none; stroke-width:1.5; margin-bottom:0.5rem; }

/* ---- Suggestion Chips ---- */
.suggestions-wrap { display:flex; flex-wrap:wrap; gap:0.5rem; margin-bottom:1.25rem; }
.suggestion-chip { padding:0.45rem 0.85rem; font-size:0.8rem; background:var(--gold-dim); border:1px solid rgba(201,168,76,0.12); border-radius:100px; color:var(--text); cursor:pointer; transition:all 0.2s; font-family:inherit; border-style:solid; }
.suggestion-chip:hover { background:rgba(201,168,76,0.15); border-color:var(--gold); }

/* ---- Empty State ---- */
.empty-state { text-align:center; padding:3rem 1.5rem; }
.empty-state-icon svg { width:40px; height:40px; stroke:var(--text-muted); fill:none; stroke-width:1.5; opacity:0.4; }
.empty-state-title { font-size:1rem; margin-bottom:0.5rem; }
.empty-state-desc { font-size:0.85rem; color:var(--text-dim); margin-bottom:1.5rem; line-height:1.5; }

/* ---- Toast ---- */
.toast { position:fixed; bottom:calc(5rem + var(--safe-bottom)); left:50%; transform:translateX(-50%); padding:0.7rem 1.5rem; background:var(--navy-light); border:1px solid var(--navy-border); border-radius:100px; font-size:0.85rem; z-index:300; animation:fadeInUp 0.3s ease, fadeOut 0.3s ease 2.5s forwards; white-space:nowrap; }

/* ---- Loading ---- */
.loading { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1rem; padding:3rem; }
.spinner { width:32px; height:32px; border:3px solid rgba(201,168,76,0.15); border-top-color:var(--gold); border-radius:50%; animation:spin 0.8s linear infinite; }

/* ---- Install Banner ---- */
.install-banner { background:linear-gradient(135deg, rgba(201,168,76,0.08) 0%, var(--navy-card) 100%); border:1px solid var(--navy-border); border-radius:var(--radius-sm); padding:1rem 1.25rem; display:flex; align-items:center; gap:1rem; margin-bottom:1.25rem; }
.install-banner-text { flex:1; }
.install-banner-title { font-size:0.85rem; font-weight:600; margin-bottom:0.15rem; display:flex; align-items:center; gap:0.35rem; }
.install-banner-title svg { width:16px; height:16px; stroke:var(--gold); fill:none; stroke-width:2; }
.install-banner-desc { font-size:0.75rem; color:var(--text-dim); }

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeInUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
@keyframes fadeOut { from { opacity:1; } to { opacity:0; pointer-events:none; } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes checkPop { 0% { transform:scale(0.8); } 50% { transform:scale(1.15); } 100% { transform:scale(1); } }
.habit-card.just-checked .habit-checkbox { animation:checkPop 0.35s ease; }

/* ---- Responsive ---- */
@media (min-width:640px) {
  .domains-grid { grid-template-columns:repeat(3,1fr); }
  .domain-select-grid { grid-template-columns:repeat(3,1fr); }
  .screen-content { max-width:600px; margin:0 auto; }
}

::-webkit-scrollbar { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(201,168,76,0.15); border-radius:2px; }

/* ==========================================================================
   AI Intelligence Components
   ========================================================================== */

/* ---- Sparkle Icon ---- */
.ai-sparkle { color:var(--gold); font-style:normal; }

/* ---- AI Insights Panel (domain detail) ---- */
.ai-insights-panel {
  background: linear-gradient(135deg, rgba(201,168,76,0.06) 0%, rgba(15,26,46,0.8) 100%);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.4s ease;
}

.ai-insights-header {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-insights-body { display: flex; flex-direction: column; gap: 0.6rem; }

.ai-insight-item {
  padding: 0.65rem 0.85rem;
  background: rgba(255,255,255,0.03);
  border-radius: 0.6rem;
  border-left: 2px solid rgba(201,168,76,0.3);
}
.ai-insight-type-warning { border-left-color: rgba(239,68,68,0.5); }
.ai-insight-type-encouragement { border-left-color: rgba(34,197,94,0.5); }

.ai-insight-text { font-size: 0.875rem; color: var(--text); line-height: 1.5; }
.ai-insight-action { font-size: 0.75rem; color: var(--gold); margin-top: 0.25rem; font-weight: 500; }

/* ---- AI Loading Dots ---- */
.ai-loading-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem 0;
}
.ai-loading-dots span {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.4;
  animation: aiDotPulse 1.2s ease-in-out infinite;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiDotPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---- SMART Goal Button ---- */
.smart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 100px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.smart-btn:hover { background: rgba(201,168,76,0.14); border-color: var(--gold); }
.smart-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- SMART Suggestion Card ---- */
.smart-suggestion {
  background: linear-gradient(135deg, rgba(201,168,76,0.07) 0%, rgba(15,26,46,0.6) 100%);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
  animation: fadeInUp 0.25s ease;
}
.smart-suggestion-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.smart-suggestion-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 0.35rem;
  font-style: italic;
}
.smart-suggestion-explanation {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.smart-suggestion-actions { display: flex; gap: 0.5rem; }

/* ---- AI Modal (habit breakdown) ---- */
.ai-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ai-modal-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.ai-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
}
.ai-loading-text { font-size: 0.82rem; color: var(--text-dim); }
.ai-empty { font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 1rem 0; }

/* ---- AI Habit Chips (selectable) ---- */
.ai-habits-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }

.ai-habit-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.ai-habit-chip.selected {
  background: rgba(201,168,76,0.07);
  border-color: rgba(201,168,76,0.25);
}
.ai-habit-chip:hover { border-color: rgba(201,168,76,0.2); }

.ai-habit-chip-check {
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ai-habit-chip-check svg { width: 12px; height: 12px; stroke: transparent; fill: none; stroke-width: 3; transition: stroke 0.2s; }
.ai-habit-chip.selected .ai-habit-chip-check {
  background: var(--gold);
  border-color: var(--gold);
}
.ai-habit-chip.selected .ai-habit-chip-check svg { stroke: var(--navy); }

.ai-habit-chip-content { flex: 1; }
.ai-habit-chip-title { font-size: 0.9rem; color: var(--text); font-weight: 500; margin-bottom: 0.15rem; }
.ai-habit-chip-meta { font-size: 0.75rem; color: var(--text-dim); }

.ai-habits-actions { display: flex; flex-direction: column; gap: 0.5rem; }
