/* ═══════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════ */
:root {
  --bg:        #070a0f;
  --bg2:       #0b0f16;
  --surface:   #10151e;
  --surface2:  #161c27;
  --surface3:  #1c2433;
  --border:    #1e2a3a;
  --border2:   #283850;
  --text:      #dde6f0;
  --muted:     #4a6080;
  --muted2:    #263040;

  /* Status */
  --fire:   #e8442a; --fire-d:   rgba(232,68,42,0.12);
  --amber:  #e8a030; --amber-d:  rgba(232,160,48,0.12);
  --green:  #28c88a; --green-d:  rgba(40,200,138,0.12);
  --blue:   #3a90e0; --blue-d:   rgba(58,144,224,0.12);
  --purple: #9060d8; --purple-d: rgba(144,96,216,0.12);

  /* Planets */
  --p-sun:     #e8b84b; --p-sun-d:     rgba(232,184,75,0.10);
  --p-moon:    #a8b8d8; --p-moon-d:    rgba(168,184,216,0.10);
  --p-mars:    #c84040; --p-mars-d:    rgba(200,64,64,0.10);
  --p-mercury: #60b880; --p-mercury-d: rgba(96,184,128,0.10);
  --p-jupiter: #8060d0; --p-jupiter-d: rgba(128,96,208,0.10);
  --p-venus:   #d060a0; --p-venus-d:   rgba(208,96,160,0.10);
  --p-saturn:  #608090; --p-saturn-d:  rgba(96,128,144,0.10);

  --planet-color: var(--p-moon);
  --planet-d:     var(--p-moon-d);

  --nav-w: 64px;
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
}

/* GRID BG */
body::before {
  content:'';
  position:fixed; inset:0;
  background-image:
    linear-gradient(rgba(58,144,224,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58,144,224,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events:none; z-index:0;
}

/* ═══════════════════════════════════════════
   SIDE NAV
═══════════════════════════════════════════ */
.sidenav {
  width: var(--nav-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  flex-shrink: 0;
}

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--planet-color);
  transition: color 1s;
  margin-bottom: 12px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
}

.nav-sep { width: 32px; height: 1px; background: var(--border); margin: 6px 0; }

.nav-btn {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  gap: 3px;
  position: relative;
}

.nav-btn:hover { background: var(--surface); }
.nav-btn.active { background: var(--surface2); border-color: var(--border2); }
.nav-btn.active::before {
  content:'';
  position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:3px; height:24px;
  background: var(--planet-color);
  border-radius:0 3px 3px 0;
  transition: background 1s;
}

.nav-icon { font-size:22px; line-height:1; }
.nav-label {
  font-family:'DM Mono', monospace;
  font-size:7px;
  letter-spacing:0.08em;
  color:var(--muted);
  text-transform:uppercase;
}
.nav-btn.active .nav-label { color: var(--planet-color); transition: color 1s; }

.nav-planet-orb {
  width:36px; height:36px;
  border-radius:50%;
  border:1px solid var(--planet-color);
  display:flex; align-items:center; justify-content:center;
  font-size:18px;
  margin-top:auto;
  margin-bottom:4px;
  animation: orbpulse 3s ease-in-out infinite;
  transition: border-color 1s;
}

@keyframes orbpulse {
  0%,100%{box-shadow:0 0 0 0 var(--planet-color);}
  50%{box-shadow:0 0 12px 2px var(--planet-d);}
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
.main {
  margin-left: var(--nav-w);
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(7,10,15,0.9);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.topbar-left { display:flex; align-items:center; gap:16px; }

.screen-title {
  font-family:'Bebas Neue', sans-serif;
  font-size:20px;
  letter-spacing:2px;
  color:var(--text);
}

.planet-chip {
  display:flex; align-items:center; gap:6px;
  padding:4px 10px;
  background: var(--planet-d);
  border:1px solid var(--planet-color);
  border-radius:20px;
  font-family:'DM Mono', monospace;
  font-size:10px;
  letter-spacing:0.08em;
  color:var(--planet-color);
  transition: all 1s;
}

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

.clock-display {
  font-family:'DM Mono', monospace;
  font-size:13px;
  color:var(--muted);
  letter-spacing:0.05em;
}

.api-key-row {
  display:flex; align-items:center; gap:6px;
}

.api-input {
  background: var(--surface);
  border:1px solid var(--border);
  border-radius:6px;
  padding:5px 10px;
  font-family:'DM Mono', monospace;
  font-size:10px;
  color:var(--text);
  outline:none;
  width:180px;
  letter-spacing:0.04em;
}

.api-input::placeholder { color:var(--muted2); }
.api-input:focus { border-color:var(--border2); }

.api-badge {
  font-family:'DM Mono', monospace;
  font-size:9px;
  padding:3px 8px;
  border-radius:10px;
  letter-spacing:0.06em;
}
.api-ok  { background:var(--green-d); color:var(--green); }
.api-no  { background:var(--fire-d); color:var(--fire); }

/* SCREENS */
.screen { display:none; flex:1; overflow-x:hidden; overflow-y:auto; }
.screen.active { display:flex; flex-direction:column; overflow-x:hidden; overflow-y:auto; }

/* ═══════════════════════════════════════════
   HOME DASHBOARD
═══════════════════════════════════════════ */
.home-body {
  flex:1; overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-content:start;
}

@media(min-width:769px) {
  .home-body {
    padding:24px;
    display:grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap:16px;
  }
  .dc-wide { grid-column:span 3; }
  .dc-half { grid-column:span 1; }
  .ai-nudge { grid-column:span 2; }
  .quick-capture { grid-column:span 3; }
}

/* CARDS */
.dash-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  cursor:pointer;
  transition:all 0.2s;
  position:relative;
  overflow:hidden;
}

.dash-card:hover { border-color:var(--border2); transform:translateY(-1px); }
.dash-card::after {
  content:'';
  position:absolute; top:0; left:0; right:0; height:2px;
  border-radius:var(--radius) var(--radius) 0 0;
}

.dc-planet::after  { background:var(--planet-color); }
.dc-triage::after  { background:var(--fire); }
.dc-finance::after { background:var(--green); }
.dc-habit::after   { background:var(--purple); }
.dc-agent::after   { background:var(--blue); }
.dc-project::after { background:var(--amber); }

.dc-label {
  font-family:'DM Mono', monospace;
  font-size:9px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:10px;
}

.dc-title {
  font-family:'Bebas Neue', sans-serif;
  font-size:28px;
  letter-spacing:1px;
  line-height:1;
  margin-bottom:6px;
}

.dc-sub { font-size:13px; color:var(--muted); line-height:1.5; }

.dc-stat {
  font-family:'Bebas Neue', sans-serif;
  font-size:42px;
  letter-spacing:1px;
  line-height:1;
  margin:8px 0 4px;
}

.dc-bar-track { height:3px; background:var(--border); border-radius:4px; overflow:hidden; margin-top:10px; }
.dc-bar-fill  { height:100%; border-radius:4px; transition:width 0.8s ease; }

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

.dc-item {
  display:flex; align-items:center; gap:8px;
  font-size:12px; color:var(--muted);
  padding:5px 0;
  border-bottom:1px solid var(--border);
}
.dc-item:last-child { border-bottom:none; }
.dc-item-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }

/* PLANET CARD FULL WIDTH — handled in desktop media query */

.planet-essence {
  font-family:'Crimson Pro', serif;
  font-size:15px;
  font-style:italic;
  color:var(--text);
  opacity:0.8;
  line-height:1.7;
  margin-top:8px;
}

.keyword-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.keyword-chip {
  padding:3px 10px;
  border-radius:20px;
  font-family:'DM Mono', monospace;
  font-size:9px;
  letter-spacing:0.08em;
  background:var(--planet-d);
  color:var(--planet-color);
  border:1px solid transparent;
  transition:all 1s;
}

/* AI NUDGE */
.ai-nudge {
  background:var(--surface);
  border:1px solid var(--border2);
  border-radius:var(--radius);
  padding:20px;
  grid-column:span 2;
  position:relative;
  overflow:hidden;
}

.ai-nudge::before {
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(135deg, var(--blue-d), transparent 60%);
  pointer-events:none;
}

.ai-nudge-label {
  font-family:'DM Mono', monospace;
  font-size:9px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--blue);
  margin-bottom:10px;
  display:flex; align-items:center; gap:8px;
}

.ai-pulse { width:6px; height:6px; border-radius:50%; background:var(--blue); animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

.ai-nudge-text {
  font-size:14px;
  color:var(--text);
  line-height:1.7;
  min-height:48px;
}

.ai-nudge-actions { display:flex; gap:8px; margin-top:14px; }

/* QUICK CAPTURE */
.quick-capture {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  grid-column:span 3;
}

.qc-row { display:flex; gap:8px; align-items:center; }
.qc-input {
  flex:1;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 14px;
  font-family:'Outfit', sans-serif;
  font-size:14px;
  color:var(--text);
  outline:none;
  transition:border 0.15s;
}
.qc-input:focus { border-color:var(--border2); }
.qc-input::placeholder { color:var(--muted2); }

/* ═══════════════════════════════════════════
   SHARED PANEL LAYOUT
═══════════════════════════════════════════ */
.panel-layout {
  flex:1; display:grid;
  grid-template-columns:280px 1fr;
  overflow:hidden;
}

.panel-left {
  border-right:1px solid var(--border);
  background:var(--bg2);
  overflow-y:auto;
  display:flex;
  flex-direction:column;
}

.panel-right {
  overflow-y:auto;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.panel-section { padding:20px; border-bottom:1px solid var(--border); }

.sec-label {
  font-family:'DM Mono', monospace;
  font-size:9px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:14px;
  display:flex; align-items:center; gap:8px;
}
.sec-label::after { content:''; flex:1; height:1px; background:var(--border); }

/* ═══════════════════════════════════════════
   TRIAGE
═══════════════════════════════════════════ */
.bucket-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px;
  cursor:pointer;
  border-bottom:1px solid var(--border);
  user-select:none;
  transition:background 0.15s;
}
.bucket-head:hover { background:var(--surface); }

.bucket-name { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; }
.b-dot { width:8px; height:8px; border-radius:50%; }
.b-count {
  font-family:'DM Mono', monospace; font-size:10px;
  padding:2px 7px; border-radius:10px;
}

.b-fire .b-dot,.b-fire .b-count  { background:var(--fire-d); color:var(--fire); }
.b-fire .b-dot { background:var(--fire); }
.b-amber .b-dot { background:var(--amber); }
.b-amber .b-count { background:var(--amber-d); color:var(--amber); }
.b-green .b-dot { background:var(--green); }
.b-green .b-count { background:var(--green-d); color:var(--green); }
.b-blue .b-dot { background:var(--blue); }
.b-blue .b-count { background:var(--blue-d); color:var(--blue); }

.bucket-items { padding:8px 12px; display:flex; flex-direction:column; gap:5px; }

.triage-item {
  padding:9px 11px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  cursor:pointer;
  transition:all 0.15s;
  display:flex; align-items:flex-start; gap:8px;
  animation:fadeUp 0.2s ease forwards;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(4px);} to{opacity:1;transform:translateY(0);} }
.triage-item:hover { border-color:var(--border2); transform:translateX(2px); }

.ti-color { width:3px; border-radius:2px; flex-shrink:0; align-self:stretch; }
.ti-body { flex:1; }
.ti-text { font-size:12px; line-height:1.4; }
.ti-meta { font-family:'DM Mono', monospace; font-size:9px; color:var(--muted); margin-top:3px; }
.ti-del { background:none; border:none; color:var(--muted2); cursor:pointer; font-size:14px; transition:color 0.15s; }
.ti-del:hover { color:var(--fire); }

.triage-add { padding:12px; border-top:1px solid var(--border); margin-top:auto; }
.t-add-row { display:flex; gap:6px; }

.triage-detail {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  flex-shrink:0;
}

.td-placeholder {
  text-align:center;
  padding:40px 0;
  color:var(--muted);
  font-size:13px;
  font-style:italic;
}

/* ═══════════════════════════════════════════
   HABIT COMPASS (embedded)
═══════════════════════════════════════════ */
.habit-layout {
  flex:1; display:grid;
  grid-template-columns:220px 1fr 240px;
  overflow:hidden;
}

.hour-list {
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:8px;
}

.hour-row {
  display:flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius:7px;
  transition:background 0.15s;
  cursor:default;
}
.hour-row:hover { background:var(--surface2); }
.hour-row.now { background:var(--surface2); border:1px solid var(--border2); }
.hr-time { font-family:'DM Mono', monospace; font-size:10px; color:var(--muted); width:40px; }
.hr-glyph { font-size:13px; }
.hr-name { font-family:'Cinzel', serif; font-size:11px; flex:1; }
.hr-now { font-family:'DM Mono', monospace; font-size:8px; color:var(--planet-color); }

.habit-center { overflow-y:auto; padding:24px; display:flex; flex-direction:column; gap:16px; }

.planet-hero {
  background:var(--surface);
  border:1px solid var(--border2);
  border-radius:var(--radius);
  padding:24px;
  position:relative; overflow:hidden;
}
.planet-hero::before {
  content:'';
  position:absolute; top:-40px; right:-40px;
  width:160px; height:160px;
  border-radius:50%;
  background:radial-gradient(circle, var(--planet-d) 0%, transparent 70%);
  transition:background 1s;
}

.ph-glyph { font-size:48px; margin-bottom:10px; filter:drop-shadow(0 0 16px var(--planet-color)); animation:floatY 4s ease-in-out infinite; }
@keyframes floatY { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-4px);} }
.ph-name { font-family:'Cinzel', serif; font-size:26px; font-weight:600; letter-spacing:0.12em; color:var(--planet-color); transition:color 1s; }
.ph-sub { font-family:'DM Mono', monospace; font-size:10px; color:var(--muted); letter-spacing:0.1em; margin:4px 0 12px; }
.ph-essence { font-family:'Crimson Pro', serif; font-size:14px; font-style:italic; color:var(--text); opacity:0.8; line-height:1.7; margin-bottom:14px; }

.suggest-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.suggest-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:14px;
  cursor:pointer;
  transition:all 0.2s;
}
.suggest-card:hover { border-color:var(--border2); transform:translateY(-1px); }
.suggest-card.logged { border-color:var(--planet-color); opacity:0.7; }
.sc-icon { font-size:20px; margin-bottom:6px; }
.sc-name { font-family:'Cinzel', serif; font-size:13px; margin-bottom:3px; }
.sc-desc { font-size:12px; color:var(--muted); line-height:1.4; font-style:italic; }
.sc-dur  { font-family:'DM Mono', monospace; font-size:9px; color:var(--planet-color); margin-top:6px; transition:color 1s; }

.journal-box {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
}
.j-prompt { font-family:'Crimson Pro', serif; font-size:14px; font-style:italic; color:var(--muted); margin-bottom:10px; line-height:1.6; }
.j-prompt span { color:var(--planet-color); transition:color 1s; }
.j-textarea {
  width:100%; background:transparent; border:none; outline:none;
  font-family:'Crimson Pro', serif; font-size:14px; color:var(--text);
  line-height:1.8; resize:none; min-height:70px;
}
.j-textarea::placeholder { color:var(--muted2); font-style:italic; }
.j-actions { display:flex; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }

/* ═══════════════════════════════════════════
   FLOW LEDGER (embedded)
═══════════════════════════════════════════ */
.flow-layout {
  flex:1; display:grid;
  grid-template-columns:300px 1fr;
  overflow:hidden;
}

.channel-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  margin-bottom:10px;
}
.channel-head {
  padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between;
  cursor:pointer;
  border-bottom:1px solid var(--border);
  transition:background 0.15s;
}
.channel-head:hover { background:var(--surface2); }
.ch-name { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; }
.ch-pip { width:8px; height:8px; border-radius:50%; }
.ch-total { font-family:'Bebas Neue', sans-serif; font-size:18px; letter-spacing:1px; }

.entry-list { padding:8px 12px; display:flex; flex-direction:column; gap:5px; }
.flow-entry {
  display:flex; align-items:flex-start; gap:8px;
  padding:8px 10px;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:7px;
  animation:fadeUp 0.2s ease;
}
.fe-amount { font-family:'Bebas Neue', sans-serif; font-size:16px; letter-spacing:1px; min-width:64px; }
.fe-body { flex:1; }
.fe-desc { font-size:12px; line-height:1.4; }
.fe-meta { font-family:'DM Mono', monospace; font-size:9px; color:var(--muted); margin-top:2px; }
.fe-del { background:none; border:none; color:var(--muted2); cursor:pointer; font-size:13px; }
.fe-del:hover { color:var(--fire); }

.flow-stats {
  display:grid; grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:16px;
}
.fstat {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
}
.fstat-label { font-family:'DM Mono', monospace; font-size:9px; letter-spacing:0.14em; text-transform:uppercase; color:var(--muted); margin-bottom:6px; }
.fstat-val { font-family:'Bebas Neue', sans-serif; font-size:28px; letter-spacing:1px; line-height:1; }

.habit-signals { display:flex; flex-direction:column; gap:8px; }
.signal-row {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:8px;
}
.sig-icon { font-size:16px; flex-shrink:0; }
.sig-body { flex:1; }
.sig-text { font-size:12px; color:var(--text); line-height:1.4; }
.sig-sub  { font-family:'DM Mono', monospace; font-size:10px; color:var(--muted); margin-top:2px; }
.sig-dot  { width:7px; height:7px; border-radius:50%; flex-shrink:0; margin-top:4px; }
.sig-warn { background:var(--amber); animation:pulse 2s infinite; }
.sig-ok   { background:var(--green); }
.sig-info { background:var(--blue); }

/* ═══════════════════════════════════════════
   PROJECT PLANS
═══════════════════════════════════════════ */
.project-layout {
  flex:1; display:grid;
  grid-template-columns:260px 1fr;
  overflow:hidden;
}

.proj-list { padding:12px; display:flex; flex-direction:column; gap:6px; overflow-y:auto; }

.proj-item {
  padding:12px 14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  cursor:pointer;
  transition:all 0.15s;
}
.proj-item:hover { border-color:var(--border2); }
.proj-item.active { border-color:var(--amber); }
.proj-name { font-size:13px; font-weight:500; margin-bottom:3px; }
.proj-meta { font-family:'DM Mono', monospace; font-size:10px; color:var(--muted); }
.proj-bar { margin-top:8px; height:3px; background:var(--border); border-radius:4px; overflow:hidden; }
.proj-bar-fill { height:100%; background:var(--amber); border-radius:4px; transition:width 0.6s; }

.proj-detail { padding:24px; overflow-y:auto; display:flex; flex-direction:column; gap:16px; }

.proj-header-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  position:relative; overflow:hidden;
}
.proj-header-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--amber); }

.proj-title-input {
  font-family:'Bebas Neue', sans-serif;
  font-size:28px;
  letter-spacing:2px;
  background:transparent;
  border:none;
  outline:none;
  color:var(--text);
  width:100%;
  margin-bottom:6px;
}

.proj-desc-input {
  background:transparent;
  border:none;
  outline:none;
  font-size:13px;
  color:var(--muted);
  width:100%;
  line-height:1.6;
  resize:none;
  font-family:'Outfit', sans-serif;
}

.proj-meta-row { display:flex; gap:12px; margin-top:14px; flex-wrap:wrap; }

.proj-tag {
  padding:4px 12px;
  border-radius:20px;
  font-family:'DM Mono', monospace;
  font-size:10px;
  letter-spacing:0.06em;
  background:var(--surface2);
  border:1px solid var(--border);
  color:var(--muted);
  cursor:pointer;
  transition:all 0.15s;
}
.proj-tag.active { background:var(--amber-d); border-color:var(--amber); color:var(--amber); }

/* CHECKLIST */
.checklist-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
}

.check-item {
  display:flex; align-items:flex-start; gap:10px;
  padding:9px 0;
  border-bottom:1px solid var(--border);
  cursor:pointer;
  transition:opacity 0.15s;
}
.check-item:last-child { border-bottom:none; }
.check-box {
  width:18px; height:18px;
  border:1.5px solid var(--border2);
  border-radius:5px;
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  margin-top:1px;
  transition:all 0.15s;
}
.check-item.done .check-box { background:var(--green); border-color:var(--green); }
.check-item.done .check-box::after { content:'✓'; font-size:10px; color:var(--bg); font-weight:700; }
.check-item.done .ci-text { text-decoration:line-through; opacity:0.4; }
.ci-body { flex:1; }
.ci-text { font-size:13px; line-height:1.4; }
.ci-meta { display:flex; gap:10px; margin-top:4px; flex-wrap:wrap; }
.ci-tag {
  font-family:'DM Mono', monospace; font-size:9px;
  padding:1px 7px; border-radius:10px;
  letter-spacing:0.05em;
}
.ci-cost { background:var(--green-d); color:var(--green); }
.ci-where { background:var(--blue-d); color:var(--blue); }
.ci-planet { background:var(--planet-d); color:var(--planet-color); transition:all 1s; }
.ci-del { background:none; border:none; color:var(--muted2); cursor:pointer; font-size:13px; }
.ci-del:hover { color:var(--fire); }

/* BUDGET SUMMARY */
.budget-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 0;
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.budget-row:last-child { border-bottom:none; }
.budget-total { font-family:'Bebas Neue', sans-serif; font-size:22px; letter-spacing:1px; color:var(--amber); }

/* ═══════════════════════════════════════════
   AI AGENT SCREEN
═══════════════════════════════════════════ */
.agent-layout { flex:1; display:flex; flex-direction:column; overflow:hidden; }

.agent-messages {
  flex:1; overflow-y:auto;
  padding:24px;
  display:flex; flex-direction:column;
  gap:16px;
}

.msg {
  display:flex; gap:12px;
  animation:fadeUp 0.25s ease forwards;
}

.msg-avatar {
  width:32px; height:32px;
  border-radius:50%;
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:14px;
  border:1px solid var(--border2);
}
.msg-ai .msg-avatar { background:var(--blue-d); color:var(--blue); }
.msg-user .msg-avatar { background:var(--surface2); }
.msg-user { flex-direction:row-reverse; }

.msg-bubble {
  max-width:70%;
  padding:12px 16px;
  border-radius:12px;
  font-size:14px;
  line-height:1.7;
}
.msg-ai .msg-bubble { background:var(--surface); border:1px solid var(--border); border-radius:4px 12px 12px 12px; }
.msg-user .msg-bubble { background:var(--surface2); border:1px solid var(--border2); border-radius:12px 4px 12px 12px; text-align:right; }

.msg-actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.msg-action {
  padding:4px 10px;
  border-radius:6px;
  font-family:'DM Mono', monospace;
  font-size:10px;
  background:var(--surface2);
  border:1px solid var(--border2);
  color:var(--muted);
  cursor:pointer;
  transition:all 0.15s;
  letter-spacing:0.04em;
}
.msg-action:hover { color:var(--text); border-color:var(--blue); }

.agent-input-area {
  border-top:1px solid var(--border);
  padding:16px 24px;
  display:flex; gap:10px;
  background:var(--bg2);
  flex-shrink:0;
}

.agent-input {
  flex:1;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 16px;
  font-family:'Outfit', sans-serif;
  font-size:14px;
  color:var(--text);
  outline:none;
  transition:border 0.15s;
  resize:none;
  min-height:44px;
  max-height:120px;
}
.agent-input:focus { border-color:var(--border2); }
.agent-input::placeholder { color:var(--muted2); }

/* ═══════════════════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════════════════ */
.btn {
  padding:8px 16px;
  border-radius:8px;
  font-family:'DM Mono', monospace;
  font-size:11px;
  letter-spacing:0.06em;
  cursor:pointer;
  border:1px solid var(--border2);
  background:var(--surface2);
  color:var(--muted);
  transition:all 0.15s;
}
.btn:hover { color:var(--text); border-color:var(--border2); }
.btn-primary { background:var(--blue); border-color:var(--blue); color:white; }
.btn-primary:hover { opacity:0.85; }
.btn-fire { background:var(--fire); border-color:var(--fire); color:white; }
.btn-green { background:var(--green); border-color:var(--green); color:var(--bg); }
.btn-amber { background:var(--amber); border-color:var(--amber); color:var(--bg); }
.btn-sm { padding:5px 10px; font-size:10px; }
.btn-icon { width:36px; height:36px; padding:0; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }

.input {
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  padding:9px 12px;
  font-family:'Outfit', sans-serif;
  font-size:13px;
  color:var(--text);
  outline:none;
  transition:border 0.15s;
  width:100%;
}
.input:focus { border-color:var(--border2); }
.input::placeholder { color:var(--muted2); }

.select {
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px 10px;
  font-family:'DM Mono', monospace;
  font-size:11px;
  color:var(--text);
  outline:none;
  cursor:pointer;
}
.select option { background:var(--surface2); }

.empty {
  text-align:center;
  padding:24px 0;
  font-size:12px;
  color:var(--muted);
  font-style:italic;
}

/* TOAST */
.toast {
  position:fixed; bottom:20px; right:20px;
  background:var(--surface2);
  border:1px solid var(--border2);
  border-radius:10px;
  padding:10px 16px;
  font-family:'DM Mono', monospace;
  font-size:11px;
  letter-spacing:0.04em;
  z-index:9999;
  transform:translateY(50px); opacity:0;
  transition:all 0.3s;
}
.toast.show { transform:translateY(0); opacity:1; }

/* SETUP GUIDE */
.tutorial-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.68);
  backdrop-filter:blur(8px);
  z-index:1200;
  display:none;
  align-items:center;
  justify-content:center;
  padding:22px;
}
.tutorial-overlay.open { display:flex; }
.tutorial-panel {
  width:min(880px, 96vw);
  max-height:90vh;
  overflow:hidden;
  background:var(--surface);
  border:1px solid var(--border2);
  border-radius:12px;
  display:grid;
  grid-template-columns:240px 1fr;
  box-shadow:0 28px 80px rgba(0,0,0,0.48);
}
.tutorial-side {
  background:var(--bg2);
  border-right:1px solid var(--border);
  padding:22px;
}
.tutorial-kicker {
  font-family:'DM Mono', monospace;
  font-size:9px;
  letter-spacing:0.18em;
  text-transform:uppercase;
  color:var(--planet-color);
  margin-bottom:8px;
}
.tutorial-title {
  font-family:'Bebas Neue', sans-serif;
  font-size:30px;
  letter-spacing:2px;
  line-height:1;
  margin-bottom:10px;
}
.tutorial-copy {
  font-size:13px;
  line-height:1.6;
  color:var(--muted);
}
.tutorial-steps {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:20px;
}
.tutorial-step-dot {
  display:flex;
  align-items:center;
  gap:8px;
  font-family:'DM Mono', monospace;
  font-size:10px;
  color:var(--muted);
}
.tutorial-step-dot::before {
  content:'';
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--border2);
}
.tutorial-step-dot.active { color:var(--planet-color); }
.tutorial-step-dot.active::before { background:var(--planet-color); }
.tutorial-main {
  padding:24px;
  overflow-y:auto;
}
.tutorial-head {
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
  margin-bottom:18px;
}
.tutorial-head h2 {
  font-family:'Bebas Neue', sans-serif;
  font-size:26px;
  letter-spacing:2px;
  line-height:1;
  margin-bottom:6px;
}
.tutorial-head p {
  font-size:13px;
  color:var(--muted);
  line-height:1.6;
  max-width:540px;
}
.tutorial-close {
  width:34px;
  height:34px;
  border-radius:8px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:18px;
}
.tutorial-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.tutorial-surface,
.tutorial-block {
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:8px;
  padding:14px;
}
.tutorial-surface strong {
  display:block;
  font-family:'DM Mono', monospace;
  font-size:10px;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--planet-color);
  margin-bottom:6px;
}
.tutorial-surface span,
.tutorial-block span {
  display:block;
  font-size:12px;
  line-height:1.5;
  color:var(--muted);
}
.tutorial-form-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.tutorial-field {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.tutorial-field.full { grid-column:1 / -1; }
.tutorial-field label {
  font-family:'DM Mono', monospace;
  font-size:9px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--muted);
}
.tutorial-field textarea {
  min-height:86px;
  resize:vertical;
}
.tutorial-actions {
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:22px;
  align-items:center;
}
.tutorial-actions-right {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.tutorial-progress {
  font-family:'DM Mono', monospace;
  font-size:10px;
  color:var(--muted);
}

/* MODAL */
.modal-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.6);
  backdrop-filter:blur(4px);
  z-index:1000;
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity 0.2s;
}
.modal-overlay.open { opacity:1; pointer-events:all; }
.modal {
  background:var(--surface);
  border:1px solid var(--border2);
  border-radius:16px;
  padding:28px;
  width:460px; max-width:90vw;
  transform:translateY(10px);
  transition:transform 0.2s;
}
.modal-overlay.open .modal { transform:translateY(0); }
.modal-title { font-family:'Bebas Neue', sans-serif; font-size:22px; letter-spacing:2px; margin-bottom:4px; }
.modal-sub { font-size:12px; color:var(--muted); margin-bottom:20px; }
.modal-field { margin-bottom:14px; }
.modal-label { font-family:'DM Mono', monospace; font-size:9px; letter-spacing:0.14em; text-transform:uppercase; color:var(--muted); margin-bottom:6px; }
.modal-row { display:flex; gap:10px; }
.modal-row .modal-field { flex:1; }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }

/* SCHEDULE VIEW TABS */
.sched-view-btn {
  padding:12px 20px;
  font-family:'DM Mono',monospace;
  font-size:11px;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--muted);
  background:transparent;
  border:none;
  border-right:1px solid var(--border);
  cursor:pointer;
  transition:all 0.15s;
  white-space:nowrap;
  position:relative;
}
.sched-view-btn:hover { color:var(--text); background:var(--surface); }
.sched-view-btn.active { color:var(--text); background:var(--surface); }
.sched-view-btn.active::after {
  content:'';
  position:absolute;
  bottom:0; left:0; right:0;
  height:2px;
  background:var(--planet-color);
  transition:background 1s;
}

/* TRIAGE STRIP ITEMS */
.tstrip-item {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:6px;
  font-size:11px;
  border:1px solid transparent;
  cursor:pointer;
  transition:all 0.15s;
  white-space:nowrap;
  max-width:180px;
}
.tstrip-item:hover { opacity:0.8; }

/* WEEK GRID */
.week-col {
  flex:1;
  min-width:0;
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
}
.week-col:last-child { border-right:none; }
.week-col-head {
  padding:10px 8px;
  border-bottom:1px solid var(--border);
  text-align:center;
  background:var(--bg2);
  flex-shrink:0;
}
.week-col-body { flex:1; padding:6px; overflow-y:auto; display:flex; flex-direction:column; gap:4px; }

/* MONTH GRID */
.month-grid {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:1px;
  background:var(--border);
}
.month-cell {
  background:var(--bg);
  padding:4px;
  min-height:60px;
  cursor:pointer;
  transition:background 0.15s;
  overflow:hidden;
}
.month-cell:hover { background:var(--surface); }
.month-cell.today { background:var(--planet-d); }
.month-cell.other-month { opacity:0.35; }

/* QUARTER SECTION */
.quarter-section {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  margin-bottom:14px;
}
.quarter-head {
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--bg2);
}
.quarter-body { padding:14px 18px; }

/* UNSCHEDULED QUEUE */
.unsched-wrap {
  border-bottom:1px solid var(--border);
  background:var(--surface);
  max-height:140px;
  overflow:hidden;
  transition:max-height 0.3s ease;
}
.unsched-wrap.collapsed { max-height:40px; }
.unsched-toggle {
  padding:10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  user-select:none;
}
.unsched-items {
  padding:0 12px 10px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  overflow-x:auto;
}
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:4px; }

/* ═══════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════ */
@media(max-width:768px) {
  :root { --nav-w:0px; }
  body { flex-direction:column; overflow-y:auto; overflow-x:hidden; }
  .sidenav { display:none; }
  .mobile-nav {
    display:flex !important;
    position:fixed; bottom:0; left:0; right:0;
    background:var(--bg2);
    border-top:1px solid var(--border);
    z-index:200;
    padding:0;
  }
  .mob-btn {
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding:10px 4px;
    gap:3px;
    cursor:pointer;
    transition:background 0.15s;
    border:none; background:transparent;
  }
  .mob-btn.active { background:var(--surface); }
  .mob-icon { font-size:24px; }
  .mob-label { font-family:'DM Mono', monospace; font-size:8px; letter-spacing:0.06em; color:var(--muted); text-transform:uppercase; }
  .mob-btn.active .mob-label { color:var(--planet-color); }
  .main { margin-left:0; margin-bottom:60px; min-height:auto; overflow-y:auto; }
  .screen { overflow-y:auto; }
  .screen.active { overflow-y:auto; }
  .panel-layout { grid-template-columns:1fr; overflow-y:auto; }
  .panel-left { display:none; }
  .dc-wide,.dc-half { grid-column:span 1; }
  .habit-layout { grid-template-columns:1fr; overflow-y:auto; }
  .flow-layout { grid-template-columns:1fr; overflow-y:auto; }
  .project-layout { grid-template-columns:1fr; overflow-y:auto; }
  .suggest-grid { grid-template-columns:1fr 1fr; }
  .flow-stats { grid-template-columns:1fr 1fr; }
  .topbar { padding:10px 16px; }
  .api-key-row { display:none; }
  .clock-display { font-size:11px; }
  .tutorial-overlay { padding:10px; align-items:flex-start; overflow-y:auto; }
  .tutorial-panel {
    grid-template-columns:1fr;
    width:100%;
    max-height:none;
    margin-bottom:70px;
  }
  .tutorial-side {
    border-right:none;
    border-bottom:1px solid var(--border);
    padding:18px;
  }
  .tutorial-steps { flex-direction:row; flex-wrap:wrap; margin-top:14px; }
  .tutorial-main { padding:18px; }
  .tutorial-head { gap:10px; }
  .tutorial-grid,
  .tutorial-form-grid { grid-template-columns:1fr; }
  .tutorial-field.full { grid-column:auto; }
  .tutorial-actions { flex-direction:column; align-items:stretch; }
  .tutorial-actions-right { justify-content:stretch; }
  .tutorial-actions-right .btn { flex:1; }
  .panel-right { overflow-y:auto; }
  .agent-layout { overflow-y:auto; height:auto; min-height:calc(100vh - 120px); }
  .agent-messages { overflow-y:auto; flex:1; min-height:300px; }
  .habit-center { overflow-y:auto; }
  .proj-detail { overflow-y:auto; }
}
