:root {
  --bg: #07090e;
  --panel: rgba(18, 22, 32, 0.76);
  --panel-2: rgba(26, 32, 46, 0.82);
  --panel-metal: linear-gradient(155deg, rgba(34, 41, 60, 0.74) 0%, rgba(17, 21, 31, 0.86) 52%, rgba(11, 14, 21, 0.94) 100%);
  --line: rgba(255, 255, 255, 0.085);
  --line-bright: rgba(165, 192, 255, 0.28);
  --text: #eef1f8;
  --muted: #8e98b0;
  --accent: #7c9cff;
  --accent-2: #b48cff;
  --iridium: #60a5fa;
  --gold: #fbbf24;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow-deep:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.65),
    0 16px 38px -10px rgba(0, 0, 0, 0.72),
    0 4px 14px rgba(0, 0, 0, 0.48);
  --shadow-elevated:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 24px rgba(124, 156, 255, 0.06),
    0 24px 56px -12px rgba(0, 0, 0, 0.85),
    0 8px 24px rgba(0, 0, 0, 0.6);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ——— Ambient WebGL Shader Canvas ——— */
canvas.shader-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
}

/* ——— Window & Glass/Metal Chrome ——— */
.window {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 218px 1fr;
  height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, rgba(16, 20, 30, 0.82) 0%, rgba(10, 12, 19, 0.92) 100%);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 8px 0 32px rgba(0, 0, 0, 0.45);
  padding: 16px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 16px;
}
.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #090b10;
  font-weight: 800;
  background: linear-gradient(135deg, #9bb5ff 0%, #7c9cff 45%, #c4a1ff 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    0 4px 14px rgba(124, 156, 255, 0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 750;
  font-size: 14px;
  letter-spacing: 1.4px;
  background: linear-gradient(90deg, #ffffff, #b7c8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 600;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7.5px 10px;
  border-radius: 9px;
  color: var(--muted);
  border: 1px solid transparent;
  background: none;
  text-align: left;
  width: 100%;
  font-size: 13px;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-ico {
  width: 18px;
  text-align: center;
  font-size: 13px;
  opacity: 0.85;
}
.nav:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}
.nav.active {
  background: linear-gradient(90deg, rgba(124, 156, 255, 0.18), rgba(180, 140, 255, 0.06));
  color: #ffffff;
  border-color: rgba(124, 156, 255, 0.32);
  box-shadow:
    inset 2px 0 0 var(--accent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 16px -4px rgba(0, 0, 0, 0.5);
  font-weight: 600;
}
.nav .badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07090e;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 750;
  padding: 1px 7px;
  box-shadow: 0 2px 8px rgba(124, 156, 255, 0.45);
}
.nav-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 8px 4px;
}
.sidebar .foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  padding: 10px;
  line-height: 1.45;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 24, 0.68);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
  z-index: 10;
}
.topbar h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: linear-gradient(180deg, #ffffff 0%, #c5cee2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar .spacer { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(36, 43, 62, 0.8), rgba(20, 24, 36, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px rgba(0, 0, 0, 0.35);
  font-size: 11.5px;
  color: var(--muted);
}
.chip b { color: var(--text); font-weight: 700; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}
.dot.off {
  background: var(--bad);
  box-shadow: 0 0 8px var(--bad);
}

.content {
  padding: 18px 24px 56px;
  overflow-y: auto;
  flex: 1;
}

/* ——— Compact Gamified Bento Grid & Glass/Metal Cards ——— */
.view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1360px;
  margin: 0 auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 11px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  align-items: start;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--panel-metal);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px 16px;
  box-shadow: var(--shadow-deep);
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    filter 0.25s ease;
}

/* Specular cursor-tracking rim light */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 0%),
    rgba(165, 195, 255, 0.11),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}
.card > * {
  position: relative;
  z-index: 1;
}
.card:hover {
  border-color: rgba(165, 192, 255, 0.22);
  box-shadow: var(--shadow-elevated);
}

/* ——— Purposeful Loading Greyout + Diagonal Metallic Shine Sweep ——— */
.card.is-loading {
  filter: saturate(0.42) brightness(0.84);
  transform: scale(0.993);
  pointer-events: none;
  border-color: rgba(124, 156, 255, 0.35);
}
.card.is-loading::after,
.card.is-refreshing::after {
  content: "";
  position: absolute;
  inset: -40% -120%;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    transparent 30%,
    rgba(124, 156, 255, 0.08) 43%,
    rgba(255, 255, 255, 0.34) 50%,
    rgba(180, 140, 255, 0.12) 57%,
    transparent 70%
  );
  animation: metalShineSweep 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.card.is-refreshing::after {
  animation-duration: 0.7s;
  opacity: 0.65;
}

@keyframes metalShineSweep {
  0% { transform: translateX(-45%) rotate(2deg); }
  100% { transform: translateX(45%) rotate(2deg); }
}

/* Lock-in pulse after loading completes */
.card.just-updated {
  animation: cardLockIn 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardLockIn {
  0% {
    border-color: rgba(74, 222, 128, 0.65);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 0 28px rgba(124, 156, 255, 0.32),
      var(--shadow-deep);
  }
  100% {
    border-color: var(--line);
    box-shadow: var(--shadow-deep);
  }
}

/* Skeleton lines inside loading cards */
.skel-line {
  height: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  margin-bottom: 10px;
}
.skel-line.sm { width: 45%; height: 10px; }
.skel-line.md { width: 60%; height: 13px; margin-bottom: 14px; }
.skel-line.lg { width: 70%; height: 26px; margin-bottom: 0; }
.skel-line.full { width: 100%; height: 34px; }

/* ——— Compact Gamified HUD Stat & Progress Cards ——— */
.stat {
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.stat .label,
.progress .label,
.card h3 {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--muted);
  font-weight: 650;
}
.card h3 { margin-bottom: 10px; }
.stat-badge {
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c5d1eb;
}
.tone-level .stat-badge {
  background: rgba(124, 156, 255, 0.16);
  border-color: rgba(124, 156, 255, 0.35);
  color: #a9c0ff;
}
.tone-xp .stat-badge {
  background: rgba(180, 140, 255, 0.16);
  border-color: rgba(180, 140, 255, 0.35);
  color: #d4bfff;
}
.tone-gold .stat-badge {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.stat .value {
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: linear-gradient(180deg, #ffffff 10%, #bac6de 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat .value small {
  font-size: 13px;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  font-weight: 650;
}
.delta-up {
  font-size: 12px;
  color: var(--good);
  -webkit-text-fill-color: var(--good);
  margin-left: 6px;
  animation: deltaBounce 0.6s ease;
}
@keyframes deltaBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px) scale(1.15); }
}

.value-changed {
  animation: statValuePop 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes statValuePop {
  0% { transform: scale(1); }
  35% {
    transform: scale(1.03);
    border-color: rgba(124, 156, 255, 0.55);
    box-shadow: 0 0 24px rgba(124, 156, 255, 0.28), var(--shadow-deep);
  }
  100% { transform: scale(1); }
}

.progress {
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.progress .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.prog-pct {
  font-size: 15px;
  font-weight: 750;
  color: #ffffff;
}
.bar {
  height: 9px;
  border-radius: 99px;
  background: rgba(8, 10, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5b8aff, #9f7aea, #4ade80);
  box-shadow: 0 0 12px rgba(124, 156, 255, 0.55);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ——— Floating Gamified +XP Spark ——— */
.xp-spark {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.4px;
  color: #07090e;
  background: linear-gradient(135deg, #a5bfff 0%, #4ade80 100%);
  box-shadow: 0 6px 20px rgba(74, 222, 128, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: xpFloatUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes xpFloatUp {
  0% { opacity: 0; transform: translateY(6px) scale(0.85); }
  20% { opacity: 1; transform: translateY(-6px) scale(1.04); }
  100% { opacity: 0; transform: translateY(-34px) scale(0.96); }
}

/* ——— Interactive Today Widgets (Calendar & Journal Shared Header / Expand) ——— */
.interactive-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.interactive-widget.expanded {
  grid-column: 1 / -1;
  border-color: rgba(140, 170, 255, 0.32);
  box-shadow: var(--shadow-elevated);
}
.expanding-transition {
  animation: widgetExpand 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes widgetExpand {
  from {
    opacity: 0.72;
    transform: translateY(4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.widget-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.widget-title-group {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.widget-h3 {
  margin: 0 0 2px !important;
  font-size: 12px !important;
  color: #dce3f4 !important;
  letter-spacing: 0.7px !important;
}
.widget-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.accent-text {
  color: #9cb6ff;
  font-weight: 600;
}

.metal-btn {
  background: linear-gradient(180deg, rgba(44, 53, 76, 0.85) 0%, rgba(22, 27, 40, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 3px 8px rgba(0, 0, 0, 0.4);
  color: #dbe3f6;
  transition: all 0.18s ease;
}
.metal-btn:hover {
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}
.metal-btn.is-open {
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.24), rgba(180, 140, 255, 0.18));
  border-color: rgba(124, 156, 255, 0.45);
}

.widget-expand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 11px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(124, 156, 255, 0.08), rgba(180, 140, 255, 0.05));
  border: 1px dashed rgba(145, 175, 255, 0.24);
  color: #b4c6f0;
  font-size: 11.5px;
  font-weight: 550;
  transition: all 0.18s ease;
}
.widget-expand-strip:hover {
  background: linear-gradient(90deg, rgba(124, 156, 255, 0.16), rgba(180, 140, 255, 0.12));
  border-style: solid;
  border-color: rgba(145, 175, 255, 0.45);
  color: #ffffff;
}
.strip-arrow {
  font-weight: 700;
  color: var(--accent);
}

/* ——— 1. Calendar Widget Styles (Compact + Expanded Month Grid) ——— */
.cal-date-tile {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(52, 64, 96, 0.9), rgba(20, 25, 38, 0.96));
  border: 1px solid rgba(165, 192, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 14px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.cal-date-tile:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}
.cal-wk {
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.9px;
  color: var(--accent);
}
.cal-num {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 1px 0;
}
.cal-mo {
  font-size: 8px;
  color: var(--muted);
  font-weight: 650;
}

/* Day horizon bar with laser NOW marker */
.cal-horizon {
  position: relative;
  height: 14px;
  border-radius: 99px;
  background: rgba(8, 10, 16, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  overflow: visible;
}
.cal-horizon-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.18), rgba(124, 156, 255, 0.22));
  transition: width 0.4s ease;
}
.cal-horizon-seg {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 99px;
  background: var(--seg-color, var(--accent));
  opacity: 0.75;
  box-shadow: 0 0 6px var(--seg-color, var(--accent));
}
.cal-horizon-seg.done {
  opacity: 0.4;
}
.cal-now-laser {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff, 0 0 14px var(--accent);
  border-radius: 2px;
}
.cal-now-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #ffffff;
  background: rgba(124, 156, 255, 0.85);
  padding: 0 4px;
  border-radius: 3px;
}

.cal-compact-list,
.cal-day-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(12, 15, 23, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--dom-color, var(--accent));
  transition: all 0.16s ease;
}
.cal-row:hover {
  background: rgba(26, 32, 48, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
}
.cal-row.done {
  opacity: 0.62;
}
.cal-row.done .cal-title {
  text-decoration: line-through;
  color: var(--muted);
}

.cal-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 13, 20, 0.8);
  color: #07090e;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0;
  transition: all 0.16s ease;
}
.cal-check:hover {
  border-color: var(--good);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}
.cal-check.done {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border-color: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.35);
}

.cal-time {
  display: flex;
  flex-direction: column;
  min-width: 44px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.cal-t-start {
  font-size: 11.5px;
  font-weight: 700;
  color: #dce3f4;
}
.cal-t-end {
  font-size: 10px;
  color: var(--muted);
}
.cal-main {
  flex: 1;
  min-width: 0;
}
.cal-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-meta {
  font-size: 10.5px;
  color: var(--muted);
}
.dom-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 99px;
  color: var(--dom-color, var(--accent));
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Expanded Calendar 2-Pane Layout */
.cal-expanded-body {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 16px;
  margin-top: 4px;
  align-items: start;
}
@media (max-width: 900px) {
  .cal-expanded-body,
  .jrn-expanded-body {
    grid-template-columns: 1fr;
  }
}

.cal-month-pane {
  background: rgba(9, 12, 19, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-month-title {
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.cal-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  position: relative;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(20, 25, 38, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: all 0.15s ease;
}
.cal-day.muted-day {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}
.cal-day:hover {
  border-color: rgba(124, 156, 255, 0.45);
  background: rgba(38, 46, 68, 0.85);
  transform: translateY(-1px);
}
.cal-day.is-today {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.2);
}
.cal-day.is-selected {
  background: linear-gradient(145deg, rgba(124, 156, 255, 0.32), rgba(180, 140, 255, 0.22));
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(124, 156, 255, 0.35);
}
.cal-day-num {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text);
}
.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.cal-day-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cal-day-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}
.cal-schedule-form {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(9, 12, 19, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cal-form-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 650;
}
.cal-form-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.cal-form-row input {
  flex: 1;
  min-width: 160px;
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.cal-form-row select {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

/* ——— 2. Mindful Journal & Reflection Studio Styles ——— */
.journal-orb-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 25%, rgba(180, 140, 255, 0.45), rgba(26, 32, 52, 0.95) 70%);
  border: 1px solid rgba(180, 140, 255, 0.42);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 6px 16px rgba(124, 156, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease;
}
.journal-orb-badge:hover {
  transform: scale(1.05);
}
.orb-score {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}
.orb-sub {
  font-size: 8px;
  letter-spacing: 0.8px;
  color: #d4bfff;
  font-weight: 750;
  margin-top: 2px;
}

.journal-mood-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(9, 12, 19, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.strip-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.mood-orbs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.mood-orb {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 27, 40, 0.85);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.mood-orb:hover {
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}
.mood-orb.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07090e;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(124, 156, 255, 0.5);
}
.mood-orb.energy-orb.active {
  background: linear-gradient(135deg, #4ade80, #38bdf8);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.45);
}

.journal-latest-preview,
.jrn-entry-card {
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(11, 14, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: all 0.18s ease;
}
.journal-latest-preview:hover,
.jrn-entry-card:hover {
  border-color: rgba(180, 140, 255, 0.32);
  background: rgba(18, 23, 35, 0.78);
}
.jrn-prev-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.jrn-prompt-chip {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(180, 140, 255, 0.16);
  border: 1px solid rgba(180, 140, 255, 0.32);
  color: #d8b4fe;
}
.jrn-prev-title {
  font-size: 12.5px;
  color: #ffffff;
}
.jrn-time {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
}
.jrn-prev-body {
  font-size: 12.5px;
  color: #c6cfdf;
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jrn-tags,
.jrn-entry-foot {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
  align-items: center;
}
.jrn-tag {
  font-size: 10.5px;
  color: #9cb6ff;
  background: rgba(124, 156, 255, 0.1);
  padding: 1px 6px;
  border-radius: 6px;
}
.jrn-metric-pill {
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 6px;
}

.jrn-quick-form {
  display: flex;
  gap: 7px;
}
.jrn-quick-input {
  flex: 1;
  background: rgba(12, 15, 23, 0.78);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.jrn-quick-input:focus,
.jrn-title-input:focus,
.jrn-body-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 156, 255, 0.2);
}

/* Expanded Journal Studio */
.jrn-expanded-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  margin-top: 4px;
  align-items: start;
}
.jrn-composer-pane {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: rgba(9, 12, 19, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 12px;
}
.jrn-pane-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
}
.jrn-prompts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.jrn-prompt-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 25, 38, 0.75);
  color: #c5cee2;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.jrn-prompt-btn:hover {
  border-color: var(--accent-2);
  color: #ffffff;
}
.jrn-prompt-btn.active {
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.25), rgba(180, 140, 255, 0.25));
  border-color: var(--accent-2);
  color: #ffffff;
}
.jrn-tag-picker {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.jrn-tag-chip {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 22, 34, 0.7);
  color: var(--muted);
}
.jrn-tag-chip.on {
  background: rgba(124, 156, 255, 0.2);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.jrn-title-input,
.jrn-body-area {
  width: 100%;
  background: rgba(15, 19, 29, 0.88);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  resize: vertical;
}
.jrn-submit-row {
  display: flex;
  justify-content: flex-end;
}
.jrn-archive-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.jrn-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ——— Tables, Forms, Approvals & Buttons ——— */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 8px 7px 0;
}
td {
  padding: 6.5px 8px 6.5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
  word-break: break-word;
}
.empty { color: var(--muted); font-size: 12.5px; padding: 4px 0; }
.err { color: var(--warn); font-size: 12px; margin-top: 8px; }
.block-wide { grid-column: 1 / -1; }

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-head-row h3 { margin: 0; }
.badge-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--warn);
}
.attention-pulse {
  border-color: rgba(251, 191, 36, 0.35);
}

.approval {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.approval:first-of-type { border-top: 0; padding-top: 0; }
.approval .who { color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.approval .what { font-weight: 650; margin-bottom: 3px; color: #ffffff; }
.approval .why { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.btns { display: flex; gap: 7px; flex-wrap: wrap; }
.btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(38, 45, 64, 0.85), rgba(22, 27, 40, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 3px 8px rgba(0, 0, 0, 0.35);
  border-radius: 9px;
  padding: 6.5px 13px;
  font-weight: 600;
  font-size: 12.5px;
  transition: all 0.16s ease;
}
.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, #8aa7ff 0%, #6d8dff 55%, #a37fff 100%);
  border-color: rgba(255, 255, 255, 0.28);
  color: #07090e;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 14px rgba(124, 156, 255, 0.35);
}
.btn.primary:hover {
  filter: brightness(1.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 6px 18px rgba(124, 156, 255, 0.5);
}
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 11.5px; }
.btn.tiny { padding: 2px 8px; font-size: 11px; border-radius: 7px; }

form.form label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin: 0 0 4px;
}
form.form input, form.form select {
  width: 100%;
  background: rgba(12, 15, 23, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash { color: var(--good); font-size: 12px; font-weight: 600; }

svg.chart { width: 100%; height: 90px; }

/* ——— Toasts (Attention) ——— */
.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
  width: 340px;
}
.toast {
  background: rgba(24, 30, 46, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(145, 175, 255, 0.28);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-elevated);
  animation: in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast .t { font-weight: 650; margin-bottom: 3px; }
.toast .b { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.toast .m { font-size: 10.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 4px; font-weight: 700; }
.toast.critical { border-color: var(--bad); }
@keyframes in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }

/* ——— Inbox ——— */
.item { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.urg {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 6px;
  padding: 2px 7px;
  height: fit-content;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 700;
}
.urg.high, .urg.critical { background: rgba(248, 113, 113, 0.15); color: var(--bad); }
.urg.normal { background: rgba(124, 156, 255, 0.15); color: var(--accent); }
.deliv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.deliv .chip { font-size: 11px; padding: 2px 8px; }
.done { opacity: 0.5; }

/* ——— Multi-Device Lab ——— */
.lab { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.lab .controls { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 10px;
}
.seg button { border: 0; background: none; border-radius: 7px; padding: 6px 0; color: var(--muted); font-size: 12px; }
.seg button.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07090e;
  font-weight: 700;
}
.frames { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.frame {
  position: relative;
  background: #05060a;
  border: 2px solid #2b3043;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.frame.phone { width: 340px; height: 640px; border-radius: 42px; }
.frame.watch { width: 200px; height: 250px; border-radius: 48px; border-width: 4px; }
.frame .bezel { padding: 14px 18px 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.frame .screen { padding: 8px 14px 18px; overflow: auto; flex: 1; }
.frame.watch .screen { padding: 4px 14px 14px; }
.frame .caption { color: var(--muted); font-size: 11px; text-align: center; margin-top: 10px; }
.frame .active-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--good);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.frame.active .active-ring { opacity: 1; }
.frame .ftoasts { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.frame .toast { padding: 9px 11px; border-radius: 16px; }
.frame.watch .toast { padding: 8px 10px; }
.frame.watch .stat .value { font-size: 36px; }
.frame.watch .card { padding: 10px 12px; border-radius: 16px; margin-bottom: 8px; }
.frame.phone .stats, .frame.watch .stats { grid-template-columns: 1fr; margin-bottom: 8px; }
.frame.haptic { animation: buzz 0.5s; }
@keyframes buzz {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}
.caption-blocks { color: var(--muted); font-size: 11px; margin: 0 0 8px; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.note b { color: var(--text); }


/* ——— 3. 7-Domain Mastery Strip, Active Quests Drawer & Focus Session Banner ——— */
.mastery-strip-card {
  padding: 10px 14px;
}
.mastery-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
}
.mastery-pills-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mastery-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--accent);
  padding-right: 4px;
}
.mastery-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  background: rgba(10, 13, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cdd5e7;
}
.mastery-mini-pill b {
  color: var(--dom-color, var(--accent));
  font-weight: 750;
}
.mastery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dom-color, var(--accent));
  box-shadow: 0 0 6px var(--dom-color, var(--accent));
}
.mastery-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.streak-chip,
.quest-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fde68a;
}
.quest-chip {
  background: rgba(124, 156, 255, 0.14);
  border-color: rgba(124, 156, 255, 0.32);
  color: #b7c8ff;
}

.mastery-expanded-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
@media (max-width: 900px) {
  .mastery-expanded-grid { grid-template-columns: 1fr; }
}
.mastery-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attr-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(10, 13, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.attr-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
}
.attr-name { font-weight: 700; }
.attr-meta { color: var(--muted); font-size: 11px; }
.attr-bar { height: 6px; }

.quest-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(10, 13, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.quest-title {
  font-size: 12.5px;
  font-weight: 650;
  color: #ffffff;
}
.quest-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* Active Focus Session Banner inside Calendar */
.focus-active-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(124, 156, 255, 0.2), rgba(74, 222, 128, 0.14));
  border: 1px solid rgba(74, 222, 128, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px rgba(0, 0, 0, 0.35);
}
.focus-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
  animation: focusPulse 1.4s ease-in-out infinite;
}
@keyframes focusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.65; }
}
.focus-info { flex: 1; min-width: 0; }
.focus-lbl {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--good);
}
.focus-name {
  font-size: 12.5px;
  font-weight: 650;
  color: #ffffff;
}
.focus-trigger-btn {
  opacity: 0.78;
}
.cal-row:hover .focus-trigger-btn {
  opacity: 1;
}

.enhancer-select {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
}

/* ——— 4. ⌘K Global Command & Concierge Palette ——— */
.hidden { display: none !important; }

.cmd-trigger {
  cursor: pointer;
  transition: all 0.18s ease;
}
.cmd-trigger:hover {
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(124, 156, 255, 0.3);
}
.cmd-kbd,
.palette-kbd {
  font-size: 10.5px;
  font-weight: 750;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(124, 156, 255, 0.2);
  border: 1px solid rgba(124, 156, 255, 0.4);
  color: #b7c8ff;
}

.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 11, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11vh;
  animation: fadeIn 0.16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.palette-modal {
  width: min(640px, 92vw);
  padding: 14px;
  border-color: rgba(145, 175, 255, 0.35);
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.palette-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.palette-input {
  flex: 1;
  background: transparent;
  border: 0;
  font-size: 14px;
  color: #ffffff;
  outline: none;
}
.palette-reply {
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.16), rgba(180, 140, 255, 0.12));
  border: 1px solid rgba(145, 175, 255, 0.32);
}
.concierge-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--accent);
  margin-bottom: 4px;
}
.concierge-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #eef1f8;
}
.palette-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 310px;
  overflow-y: auto;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}
.palette-item.active,
.palette-item:hover {
  background: rgba(124, 156, 255, 0.15);
  border-color: rgba(124, 156, 255, 0.35);
}
.palette-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 12.5px;
}
.palette-main { flex: 1; min-width: 0; }
.palette-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}
.palette-sub {
  font-size: 11px;
  color: var(--muted);
}
.palette-cat {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
}
.palette-foot {
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ——— 5. Finance Command Center: Subsections, Treasury, Budgets, P&L Reports & Deep Insights ——— */
.finance-command-center {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fin-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.fin-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--accent);
  margin-bottom: 3px;
}
.fin-quick-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fin-subnav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (max-width: 900px) {
  .fin-subnav { grid-template-columns: repeat(2, 1fr); }
}
.fin-subtab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}
.fin-subtab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}
.fin-subtab.active {
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.22), rgba(75, 227, 154, 0.12));
  border-color: rgba(145, 175, 255, 0.42);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.fin-subtab-icon {
  font-size: 13px;
  color: var(--accent);
}
.fin-subtab-label {
  flex: 1;
  font-size: 12px;
  font-weight: 650;
}
.fin-subtab-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: #cfd8ea;
}

.fin-subsection-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 900px) {
  .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
.fin-kpi-box {
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(10, 13, 21, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fin-kpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.fin-kpi-val {
  font-size: 20px;
  font-weight: 750;
  color: #ffffff;
}
.fin-kpi-val.accent-emerald { color: #4be39a; }
.fin-kpi-val.accent-amber { color: #f5b942; }
.fin-kpi-sub {
  font-size: 11px;
  color: var(--muted);
}

.fin-two-col {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}
@media (max-width: 960px) {
  .fin-two-col { grid-template-columns: 1fr; }
}
.fin-pane {
  padding: 13px;
  border-radius: 12px;
  background: rgba(10, 13, 21, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fin-accounts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 680px) {
  .fin-accounts-grid { grid-template-columns: 1fr; }
}
.fin-account-card {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(16, 20, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--acc-color, var(--accent));
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fin-acc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.fin-acc-name {
  font-size: 12.5px;
  font-weight: 650;
  color: #ffffff;
}
.fin-acc-inst {
  font-size: 10.5px;
  color: var(--muted);
}
.fin-apy-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(75, 227, 154, 0.14);
  border: 1px solid rgba(75, 227, 154, 0.35);
  color: #4be39a;
}
.fin-acc-bal {
  font-size: 17px;
  font-weight: 750;
  color: #ffffff;
}
.fin-acc-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fin-acc-bar-row .bar { flex: 1; }
.fin-acc-pct {
  font-size: 10.5px;
  color: var(--muted);
}

.fin-cf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fin-cf-row,
.fin-traj-row {
  display: grid;
  grid-template-columns: 68px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(16, 20, 32, 0.55);
  font-size: 11.5px;
}
.fin-traj-row {
  grid-template-columns: 48px 1fr auto;
}
.fin-cf-month {
  font-weight: 650;
  color: #dbe3f4;
}
.fin-cf-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fin-cf-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.fin-cf-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.fin-cf-track i.inc { background: linear-gradient(90deg, #34d399, #4be39a); }
.fin-cf-track i.base { background: linear-gradient(90deg, #60a5fa, #7c9cff); }
.fin-cf-track i.exp { background: linear-gradient(90deg, #f59e0b, #fb7185); }
.fin-cf-net {
  font-weight: 700;
  color: #4be39a;
}
.fin-cf-rate {
  font-size: 10.5px;
  color: var(--muted);
}

/* Budgets & Envelopes */
.fin-env-list,
.fin-rec-list,
.fin-insights-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fin-envelope-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 20, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fin-env-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fin-env-cat {
  font-size: 11.5px;
  font-weight: 750;
  color: #ffffff;
  margin-right: 8px;
}
.fin-env-nums {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.fin-status-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}
.fin-status-pill.healthy {
  background: rgba(75, 227, 154, 0.14);
  color: #4be39a;
  border: 1px solid rgba(75, 227, 154, 0.32);
}
.fin-status-pill.warning {
  background: rgba(245, 185, 66, 0.16);
  color: #f5b942;
  border: 1px solid rgba(245, 185, 66, 0.35);
}
.fin-status-pill.over {
  background: rgba(255, 107, 139, 0.16);
  color: #ff6b8b;
  border: 1px solid rgba(255, 107, 139, 0.35);
}

.fin-rec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(16, 20, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.fin-rec-merchant {
  font-size: 12.5px;
  font-weight: 650;
  color: #ffffff;
}
.fin-rec-amt {
  font-size: 12.5px;
  color: #eef1f8;
}

/* Reports & P&L Statements */
.fin-report-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 900px) {
  .fin-report-tabs { grid-template-columns: repeat(2, 1fr); }
}
.fin-report-tab {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(14, 18, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.fin-report-tab.active {
  background: rgba(124, 156, 255, 0.18);
  border-color: rgba(124, 156, 255, 0.45);
}
.fin-rt-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}
.fin-rt-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.fin-exec-summary {
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.12), rgba(75, 227, 154, 0.08));
  border: 1px solid rgba(145, 175, 255, 0.25);
  font-size: 12.5px;
  line-height: 1.5;
  color: #e5ebf7;
}
.fin-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fin-report-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.fin-report-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.fin-kind-badge {
  font-size: 9.5px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}
.fin-kind-badge.income,
.fin-kind-badge.saving { color: #4be39a; }
.fin-kind-badge.fixed { color: #93c5fd; }
.fin-kind-badge.discretionary { color: #f5b942; }
.fin-kind-badge.tax { color: #c084fc; }
.delta-warn { color: #ff6b8b; font-weight: 700; }
.delta-ok { color: #4be39a; font-weight: 600; }

.fin-rec-notes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 6px;
}
.fin-audit-bullet {
  font-size: 12px;
  color: #d6def0;
}

/* Deep Insights Cards */
.fin-insight-card {
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(16, 20, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fin-ins-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.fin-ins-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.fin-ins-impact {
  font-size: 12px;
  color: #4be39a;
}
.fin-ins-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.fin-ins-narrative {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #c8d2e6;
}
.fin-ins-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

