:root {
  color-scheme: dark;
  --ink: #cdd9e5;
  --muted: #768390;
  --line: #2a303b;
  --paper: #1c2128;
  --field: #22272e;
  --sidebar-bg: #161b22;
  --sidebar-width: 224px;
  --mint: #2dba85;
  --teal: #26b5c6;
  --coral: #f07070;
  --gold: #f0c040;
  --charcoal: #0d1117;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--charcoal);
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* === Sidebar === */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.brand,
.hero-actions,
.budget-form {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--mint);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-group {
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--line);
}

.sidebar-group:last-child {
  border-bottom: 0;
}

.sidebar-group-label {
  margin: 0 0 4px;
  padding: 0 14px;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.sidebar-nav a {
  display: block;
  padding: 7px 14px;
  margin: 1px 8px;
  border-radius: 8px;
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--muted);
  transition: color 140ms ease, background 140ms ease;
}

.sidebar-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.is-active {
  color: #ffffff;
  background: rgba(45, 186, 133, 0.2);
}

.sidebar-status {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
  flex-shrink: 0;
}

.sidebar-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sidebar-bg);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.55);
}

.sidebar-overlay.is-open {
  display: block;
}

main {
  margin-left: var(--sidebar-width);
  padding: 32px clamp(20px, 4vw, 56px) calc(60px + var(--safe-bottom));
}

.command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  min-height: auto;
  align-items: start;
}

.command-copy {
  min-height: min(680px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 5vw, 64px);
  color: #ffffff;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(18, 22, 25, 0.92), rgba(18, 22, 25, 0.56)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
  box-shadow: var(--shadow);
}

.hero-side {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.command-copy .eyebrow {
  color: var(--gold);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Avenir Next Condensed", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 6.8vw, 4.9rem);
  line-height: 1;
}

h2 {
  margin: 0;
  font-family: "Avenir Next Condensed", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.7rem, 4vw, 3.1rem);
  line-height: 1.02;
}

h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

p {
  line-height: 1.65;
}

.command-copy p:not(.eyebrow) {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 650;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 850;
}

.button.primary {
  color: #ffffff;
  background: var(--coral);
  border-color: var(--coral);
}

.button.secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.button.danger {
  color: #ffffff;
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.score-console,
.shell-panel,
.budget-card,
.portfolio-card,
.review-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.score-console {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 22px;
}

.score-console div:not(.xp-track) {
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--field);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.score-console strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.xp-track {
  grid-column: 1 / -1;
  height: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.xp-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--gold), var(--coral));
  transition: width 220ms ease;
}

.score-console p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.shell-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.shell-head p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 650;
}

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

.shell-stat {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--field);
}

.shell-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.shell-stat small,
.shell-install small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.shell-install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(8, 126, 139, 0.08), rgba(246, 196, 69, 0.12));
}

.shell-install strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.shell-install p {
  margin: 0;
  color: var(--muted);
}

.auth-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
}

.auth-panel-head,
.auth-user {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.auth-panel-head h3 {
  margin: 0;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.auth-user {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--field);
}

.auth-user strong {
  display: block;
  margin-top: 6px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-actions .button {
  flex: 1 1 150px;
}

.auth-form[hidden],
.auth-user[hidden] {
  display: none !important;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 12px 0 54px;
}

.photo-strip article {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--charcoal);
}

.photo-strip img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.05);
}

.photo-strip span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(23, 27, 31, 0.74);
  font-weight: 900;
}

.section-grid,
.money-layout,
.agent-lab {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 46px 0;
  border-top: 1px solid var(--line);
}

.money-layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

.section-heading {
  position: sticky;
  top: 24px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 650;
}

.quest-board,
.metric-grid,
.dashboard-grid,
.performance-grid,
.badge-grid,
.council-grid,
.prompt-grid,
.stack-grid,
.connector-grid,
.agent-grid {
  display: grid;
  gap: 14px;
}

.quest-board,
.metric-grid,
.dashboard-grid,
.performance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-column {
  display: grid;
  gap: 14px;
}

.connector-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.performance-layout {
  display: grid;
  gap: 14px;
}

.performance-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.badge-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.council-layout {
  display: grid;
  gap: 14px;
}

.council-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.automation-layout {
  display: grid;
  gap: 14px;
}

.zapier-builder {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 74, 0, 0.32);
  border-radius: 10px;
  background: rgba(255, 74, 0, 0.06);
}

.zapier-builder-head,
.zapier-builder-actions,
.zap-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.zapier-builder-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.zapier-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr);
  gap: 12px;
}

.zapier-builder-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.zapier-builder-grid textarea,
.zapier-builder-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.zapier-builder-grid textarea {
  padding: 10px 12px;
  resize: vertical;
}

.zapier-builder-grid select {
  padding: 0 12px;
}

.zapier-json-field {
  grid-column: 1 / -1;
}

.zapier-result {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.zapier-result p {
  margin: 6px 0 0;
}

.zapier-result--loading {
  border-color: rgba(240, 192, 64, 0.4);
  color: var(--gold);
}

.zapier-result--ok {
  border-color: rgba(45, 186, 133, 0.4);
  color: var(--ink);
}

.zapier-result--err {
  border-color: rgba(240, 112, 112, 0.5);
  color: var(--coral);
}

.zap-step-list,
.zap-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 0;
}

.zap-step-list li,
.zap-list-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.zap-step-list li {
  list-style-position: inside;
}

.zap-step-list small,
.zap-list-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.prompt-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quest,
.metric,
.dashboard-card,
.performance-card,
.badge-card,
.stack-card,
.connector,
.agent,
.input-panel,
.history-panel,
.vault-panel {
  min-height: 154px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  animation: rise-in 420ms ease both;
}

.quest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.quest.done {
  border-color: rgba(25, 169, 116, 0.45);
  background: rgba(25, 169, 116, 0.1);
}

.quest p,
.metric p,
.connector p,
.agent p {
  margin: 0;
  color: var(--muted);
}

.quest button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  cursor: pointer;
  font-weight: 900;
}

.quest.done button {
  color: #ffffff;
  background: var(--mint);
  border-color: var(--mint);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--field);
  font-size: 0.78rem;
  font-weight: 850;
}

.metric {
  min-height: 190px;
}

.dashboard-card,
.performance-card,
.badge-card,
.council-card,
.prompt-card,
.stack-card {
  min-height: 180px;
}

.dashboard-top,
.performance-card-top,
.council-card-top,
.connector-head,
.dashboard-feed-head,
.voice-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-feed,
.voice-preview {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
}

.dashboard-feed-head h3,
.voice-preview-head strong {
  margin: 0;
}

.voice-preview {
  display: grid;
  gap: 10px;
  min-height: 164px;
  background: var(--field);
}

.voice-preview p,
.voice-feed-panel p,
.voice-preview small {
  margin: 0;
}

.voice-preview p,
.voice-feed-panel p {
  color: var(--ink);
}

.voice-preview small,
.voice-feed-panel small {
  color: var(--muted);
}

.voice-feed-panel .history-item {
  padding: 12px 0;
}

.dashboard-score {
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 54px;
  padding: 0 10px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  font-weight: 950;
}

.dashboard-card small,
.performance-card small,
.stack-card p {
  color: var(--muted);
  font-weight: 700;
}

.performance-summary {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(23, 27, 31, 0.96), rgba(8, 126, 139, 0.92));
  color: #ffffff;
  box-shadow: var(--shadow);
}

.performance-head p:not(.eyebrow) {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
}

.performance-summary .eyebrow {
  color: var(--gold);
}

.performance-summary h3 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.performance-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.performance-stat {
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.performance-stat strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.performance-stat small {
  display: block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

.performance-card-score {
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 54px;
  padding: 0 10px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--charcoal), var(--coral));
  font-weight: 950;
}

.performance-card p,
.badge-card p,
.council-card p {
  margin: 0;
  color: var(--muted);
}

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

.summary-card {
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.summary-card strong {
  display: block;
  font-size: 1.4rem;
}

.summary-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.badge-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.badge-card.unlocked {
  border-color: rgba(25, 169, 116, 0.45);
  background: rgba(45, 186, 133, 0.1);
  border-color: rgba(45, 186, 133, 0.3);
}

.badge-card.locked {
  opacity: 0.84;
}

.council-brief {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(240, 192, 64, 0.1), var(--paper));
}

.automation-brief {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(38, 181, 198, 0.1), var(--paper));
}

.council-card {
  display: grid;
  gap: 14px;
}

.council-card small {
  color: var(--muted);
  font-weight: 700;
}

.prompt-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: var(--field);
}

.prompt-panel small {
  color: var(--muted);
  line-height: 1.55;
}

.prompt-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.prompt-card p {
  margin: 0;
  color: var(--muted);
}

.micro-actions {
  align-items: center;
}

.input-panel > small {
  color: var(--muted);
  line-height: 1.55;
}

.metric-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.metric-score {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  height: 64px;
  border-radius: 18px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 950;
}

.metric:nth-child(2n) .metric-score {
  background: var(--mint);
}

.metric:nth-child(3n) .metric-score {
  background: var(--coral);
}

.meter {
  height: 10px;
  overflow: hidden;
  margin-top: 18px;
  border-radius: 8px;
  background: var(--field);
}

.meter span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.money-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(320px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.finance-summary-grid {
  margin-bottom: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.budget-card,
.portfolio-card,
.review-panel {
  padding: 16px;
}

.budget-form {
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}

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

.finance-form .button,
.finance-form small,
.finance-form .cash-meter {
  grid-column: 1 / -1;
}

.input-panel {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}

.budget-form label,
.input-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.budget-form input,
.input-panel input,
.input-panel select,
.input-panel textarea,
.vault-panel textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
}

.input-panel textarea,
.vault-panel textarea {
  min-height: 118px;
  padding: 12px;
  resize: vertical;
}

.history-item {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item strong {
  display: block;
}

.history-item small {
  color: var(--muted);
  font-weight: 750;
}

.history-actions,
.vault-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  cursor: pointer;
  font-weight: 850;
}

.cash-meter {
  margin-top: 18px;
  padding: 16px;
  border-radius: 20px;
  background: var(--charcoal);
  color: #ffffff;
}

.cash-meter span {
  display: block;
  font-size: 2rem;
  font-weight: 950;
}

.cash-meter.is-negative {
  background: linear-gradient(135deg, #5b1f1f, #962e2e);
}

.cash-meter small {
  color: rgba(255, 255, 255, 0.72);
}

.finance-doctrine-card,
.finance-portfolio-card {
  display: grid;
  gap: 14px;
}

.finance-rule,
.finance-score-row,
.finance-section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.finance-rule,
.finance-score-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.finance-rule:last-child,
.finance-score-row:last-child {
  border-bottom: 0;
}

.finance-rule strong,
.finance-score-row strong,
.finance-section-head strong {
  display: block;
}

.finance-rule small,
.finance-score-row small,
.finance-section-head small {
  color: var(--muted);
}

.finance-score-copy {
  display: grid;
  gap: 6px;
}

.finance-score-value {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 88px;
}

.finance-score-value span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.finance-warning-list {
  margin-top: 8px;
}

.portfolio-divider {
  height: 1px;
  background: var(--line);
}

.finance-ops-grid {
  margin-top: 0;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1.2fr);
  align-items: start;
}

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

.finance-ops-grid .input-panel h3,
.finance-ops-grid .input-panel .form-span-2,
.finance-ops-grid .input-panel .button,
.finance-ops-grid .input-panel small {
  grid-column: 1 / -1;
}

.finance-transaction-summary {
  margin-bottom: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.csv-placeholder-card {
  gap: 16px;
  margin-top: 0;
  align-items: center;
}

.finance-portfolio-card,
.finance-ops-grid .history-panel {
  max-height: 520px;
  overflow: auto;
}

.csv-placeholder-card p {
  margin-top: 0;
}

.portfolio-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.portfolio-row:last-child {
  border-bottom: 0;
}

.portfolio-row strong {
  display: block;
}

.portfolio-row small {
  color: var(--muted);
}

.status {
  align-self: start;
  min-width: 86px;
  padding: 6px 9px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 950;
  background: var(--field);
}

.status.live {
  color: #ffffff;
  background: var(--mint);
}

.status.watch {
  color: var(--ink);
  background: var(--gold);
}

.status.locked {
  color: #ffffff;
  background: var(--coral);
}

.status.now {
  color: #ffffff;
  background: var(--teal);
}

.status.next {
  color: #ffffff;
  background: var(--mint);
}

.status.queue {
  color: var(--ink);
  background: #dfe7ec;
}

.status.later {
  color: #ffffff;
  background: var(--charcoal);
}

.connector strong,
.agent strong {
  display: block;
  margin-bottom: 8px;
}

.stack-card {
  display: grid;
  gap: 10px;
}

.stack-phase {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
}

.review-panel p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
  font-weight: 700;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-actions .button {
  min-width: 170px;
}

.review-panel small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.review-disclaimer {
  font-weight: 700;
}

.vault-actions {
  margin-bottom: 14px;
}

.vault-panel textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.footer {
  padding: 26px calc(20px + var(--safe-right)) calc(92px + var(--safe-bottom)) calc(20px + var(--safe-left));
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--sidebar-bg);
}

.mobile-dock {
  position: fixed;
  right: calc(12px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  left: calc(12px + var(--safe-left));
  z-index: 30;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(22, 27, 34, 0.92);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
}

.mobile-dock a {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 8px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.mobile-dock a.is-active {
  background: var(--ink);
  color: #ffffff;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Portfolio Manager === */

.portf-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portf-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.portf-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portf-positions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.position-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--field);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.position-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.position-head strong {
  display: block;
  font-size: 1rem;
}

.position-head small {
  color: var(--muted);
  font-weight: 750;
}

.position-values {
  display: flex;
  gap: 18px;
}

.position-values div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.position-values strong {
  font-size: 1rem;
}

.position-values small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.position-notes {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

.alloc-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.alloc-row:last-child {
  border-bottom: 0;
}

.alloc-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alloc-label span {
  font-weight: 850;
  font-size: 0.86rem;
}

.alloc-label small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.alloc-bars {
  position: relative;
  height: 26px;
}

.alloc-bar-target,
.alloc-bar-actual {
  position: absolute;
  top: 0;
  left: 0;
  height: 12px;
  border-radius: 6px;
  min-width: 2px;
  transition: width 300ms ease;
}

.alloc-bar-target {
  top: 0;
  background: var(--line);
}

.alloc-bar-actual {
  top: 14px;
  background: var(--teal);
}

.alloc-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 72px;
  text-align: right;
}

.drift-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
}

.drift-ok { background: rgba(25, 169, 116, 0.14); color: var(--mint); }
.drift-over { background: rgba(246, 196, 69, 0.2); color: #b08000; }
.drift-under { background: rgba(232, 93, 79, 0.14); color: var(--coral); }

.rebalance-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rebalance-action:last-child { border-bottom: 0; }
.rebalance-action strong { display: block; }
.rebalance-action small { color: var(--muted); }

.profit-rule-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.profit-rule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.profit-rule-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.income-stream-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  margin-top: 8px;
}

.income-stream-form input,
.income-stream-form select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  font: inherit;
  font-size: 0.88rem;
}

.income-stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.income-stream-item:last-child { border-bottom: 0; }

.income-stream-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

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

.agent-mandate-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--field);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mandate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.mandate-can,
.mandate-cant {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mandate-can strong { color: var(--mint); font-size: 0.8rem; }
.mandate-cant strong { color: var(--coral); font-size: 0.8rem; }

.mandate-can ul,
.mandate-cant ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.pill-read-only { background: rgba(8, 126, 139, 0.12); color: var(--teal); }
.pill-sandbox-capped { background: rgba(246, 196, 69, 0.18); color: #9a7200; }
.pill-research-only { background: rgba(25, 169, 116, 0.12); color: var(--mint); }

.portf-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.88rem;
}

.portf-ok { color: var(--mint); }

/* === Settings === */

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.platform-cat-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.settings-toggle-row:last-child { border-bottom: 0; }
.settings-toggle-row strong { display: block; font-size: 0.9rem; }
.settings-toggle-row small { color: var(--muted); font-size: 0.8rem; }

.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--line);
  transition: background 180ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 180ms ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--mint);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* === Integration Key Vault === */

.keys-warning {
  padding: 14px 18px;
  border: 1px solid rgba(248, 163, 20, 0.45);
  border-radius: 16px;
  background: rgba(246, 196, 69, 0.12);
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 4px;
}

.keys-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keys-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.84rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.keys-filter-btn.active,
.keys-filter-btn:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

/* === Keys search === */

.keys-search-row {
  width: 100%;
}

.keys-search {
  width: min(100%, 560px);
  padding: 10px 16px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.95rem;
}

.keys-search:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(45, 186, 133, 0.12);
}

.keys-filter {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.keys-filter::-webkit-scrollbar {
  display: none;
}

/* === Integration grid === */

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 1200px) {
  .integration-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.integration-card {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  animation: rise-in 420ms ease both;
  display: flex;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.integration-card:hover {
  border-color: rgba(45, 186, 133, 0.35);
  transform: translateY(-1px);
}

.integration-tile {
  position: relative;
  width: 100%;
  padding-right: 36px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.integration-tile:focus-visible {
  outline: 3px solid rgba(45, 186, 133, 0.22);
  outline-offset: 2px;
}

.integration-tile.is-connected {
  border-color: rgba(45, 186, 133, 0.45);
  background: linear-gradient(180deg, rgba(45, 186, 133, 0.08), var(--paper));
}

.integration-tile-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.integration-tile-copy strong,
.connection-summary-item strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.integration-tile-copy small,
.connection-summary-item small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
}

.integration-tile-status {
  display: inline-flex;
  position: absolute;
  top: 8px;
  right: 8px;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.integration-tile.is-connected .integration-tile-status {
  border-color: rgba(45, 186, 133, 0.35);
  color: var(--mint);
  background: rgba(45, 186, 133, 0.1);
}

.intg-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.integration-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.integration-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.integration-label div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.integration-label strong {
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intg-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.conn-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}

.conn-badge--apikey  { background: rgba(45, 186, 133, 0.15); color: var(--mint); }
.conn-badge--oauth   { background: rgba(38, 181, 198, 0.15); color: var(--teal); }
.conn-badge--csv     { background: rgba(240, 192, 64, 0.15);  color: var(--gold); }
.conn-badge--webhook { background: rgba(240, 112, 112, 0.15); color: var(--coral); }
.conn-badge--token   { background: rgba(45, 186, 133, 0.15);  color: var(--mint); }

.conn-type-note {
  font-size: 0.8rem;
  color: var(--teal);
  margin: 0;
  padding: 6px 10px;
  background: rgba(38, 181, 198, 0.07);
  border-radius: 8px;
  border-left: 3px solid var(--teal);
  line-height: 1.4;
}

.integration-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 190px;
}

.intg-btn-sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.integration-toggle {
  flex-shrink: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
  margin-top: 3px;
}

.status-dot--on {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(25, 169, 116, 0.2);
}

.key-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.key-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.83rem;
  font-weight: 800;
  color: var(--muted);
}

.key-label input,
.key-label textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}

.key-label textarea {
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
}

.key-field-wrap {
  display: flex;
  gap: 6px;
}

.key-field-wrap input {
  flex: 1;
  min-width: 0;
}

.advanced-key-fields {
  margin-top: 2px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.advanced-key-fields summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 900;
}

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

.advanced-key-grid .key-label:nth-last-child(-n + 2) {
  grid-column: 1 / -1;
}

.key-reveal {
  flex-shrink: 0;
  min-width: 52px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

.key-reveal:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.key-actions .button {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.84rem;
}

.connection-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.connection-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.connection-summary-item span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.connection-summary-item:hover {
  border-color: rgba(45, 186, 133, 0.35);
}

@media (max-width: 880px) {
  .review-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-panel,
  .section-grid,
  .agent-lab {
    grid-template-columns: 1fr;
  }

  .money-layout {
    grid-template-columns: minmax(150px, 0.28fr) minmax(0, 0.72fr);
    gap: 14px;
  }

  .money-panel {
    grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1.1fr);
  }

  .ops-grid {
    grid-template-columns: minmax(220px, 0.85fr) minmax(240px, 1.15fr);
  }

  .money-content {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .money-content .finance-portfolio-card {
    grid-column: 1 / span 3;
  }

  .money-content .finance-ops-grid {
    grid-column: 4 / -1;
  }

  .finance-form,
  .finance-rule,
  .finance-score-row,
  .finance-section-head,
  .advanced-key-grid {
    grid-template-columns: 1fr;
  }

  .finance-summary-grid,
  .finance-transaction-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-score-value {
    justify-items: start;
  }

  .command-panel {
    min-height: auto;
  }

  .command-copy {
    min-height: 520px;
  }

  .shell-install {
    grid-template-columns: 1fr;
  }

  .auth-user {
    flex-direction: column;
    align-items: stretch;
  }

  .section-heading {
    position: static;
  }

  .photo-strip,
  .connector-grid,
  .portf-positions-grid,
  .agent-mandate-grid,
  .settings-platform-grid {
    grid-template-columns: 1fr;
  }

  .integration-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }

  .portf-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portf-main-grid,
  .zapier-builder-grid,
  .mandate-rules {
    grid-template-columns: 1fr;
  }

  .zapier-builder-head {
    flex-direction: column;
  }

  .income-stream-form {
    grid-template-columns: 1fr 1fr;
  }

  .income-stream-form input:first-child {
    grid-column: 1 / -1;
  }

  .performance-grid,
  .badge-grid,
  .council-grid,
  .prompt-grid,
  .performance-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  main {
    margin-left: 0;
    width: min(100% - 20px, 1180px);
    padding-top: 60px;
  }

  .command-copy {
    min-height: auto;
    padding: 22px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.8rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .auth-actions {
    flex-direction: column;
  }

  .score-console,
  .shell-grid,
  .quest-board,
  .metric-grid,
  .dashboard-grid,
  .performance-grid,
  .council-grid,
  .prompt-grid,
  .stack-grid,
  .agent-grid,
  .portf-summary-row {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .income-stream-form {
    grid-template-columns: 1fr;
  }

  .mobile-dock {
    display: grid;
  }

  .review-actions {
    width: 100%;
    flex-direction: column;
  }

  .review-actions .button {
    width: 100%;
  }

  .score-console div:not(.xp-track),
  .score-console p,
  .xp-track {
    grid-column: auto;
  }

  .section-grid,
  .money-layout,
  .agent-lab {
    padding: 34px 0;
  }

  .money-layout,
  .money-panel,
  .ops-grid,
  .money-content,
  .money-content .finance-portfolio-card,
  .money-content .finance-ops-grid {
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .integration-grid,
  .summary-grid,
  .finance-summary-grid,
  .finance-transaction-summary,
  .finance-ops-grid .input-panel {
    grid-template-columns: 1fr;
  }
}

/* === Modal === */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  width: min(560px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
}

.integration-modal-panel {
  width: min(720px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  margin: 0;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.integration-live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.integration-live-actions .button {
  min-height: 38px;
  padding: 0 14px;
}

.modal-result-list {
  display: grid;
  gap: 8px;
}

.modal-result-item {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.modal-result-item:last-child {
  border-bottom: 0;
}

.modal-result-item small {
  color: var(--muted);
  font-weight: 750;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.csv-preview-pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
  max-height: 220px;
  overflow-y: auto;
}

.error-text {
  color: var(--coral);
  font-size: 0.9rem;
}

/* === Section heading actions === */

.section-heading-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* === Live fetch status badge === */

.fetch-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.fetch-status--loading {
  color: var(--gold);
}

.fetch-status--ok {
  color: var(--mint);
}

.fetch-status--err {
  color: var(--coral);
}

.fetch-status a {
  color: inherit;
  font-weight: 850;
  text-decoration: underline;
}

/* === Layout wrappers (money, keys) === */

.keys-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.money-content {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.money-content > * {
  min-width: 0;
}

.money-content .finance-summary-grid,
.money-content .money-panel,
.money-content .csv-placeholder-card {
  grid-column: 1 / -1;
}

.money-content .finance-portfolio-card {
  grid-column: 1 / span 4;
}

.money-content .finance-ops-grid {
  grid-column: 5 / -1;
}

@media (max-width: 880px) {
  .money-content {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .money-content .finance-portfolio-card {
    grid-column: 1 / span 3;
  }

  .money-content .finance-ops-grid {
    grid-column: 4 / -1;
  }
}

@media (max-width: 640px) {
  .money-content,
  .money-content .finance-portfolio-card,
  .money-content .finance-ops-grid {
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .finance-ops-grid .input-panel {
    grid-template-columns: 1fr;
  }
}

/* === Connector cards with API key forms === */

.connector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.connector-head {
  align-items: flex-start;
}

.connector-head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.connector-head-left strong {
  display: block;
  font-size: 0.96rem;
}

.connector-head-left small {
  color: var(--muted);
  font-size: 0.78rem;
}

.connector-connect-btn {
  flex-shrink: 0;
}

/* === Claude Assistant === */

.assistant-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.assistant-context-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(45, 186, 133, 0.28);
  border-radius: 14px;
  background: rgba(45, 186, 133, 0.07);
}

.assistant-context-bar .eyebrow {
  margin: 0;
  flex-shrink: 0;
}

.assistant-context-bar p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.assistant-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 16px;
  align-items: start;
}

.chat-panel,
.agent-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-head,
.agent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-head strong,
.agent-panel-head strong {
  font-size: 0.95rem;
}

.chat-messages {
  min-height: 300px;
  max-height: 460px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.chat-bubble {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 18px;
  line-height: 1.55;
}

.chat-bubble p {
  margin: 0;
  font-size: 0.9rem;
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--mint);
  color: #ffffff;
  border-bottom-right-radius: 5px;
}

.chat-bubble--assistant {
  align-self: flex-start;
  background: var(--field);
  color: var(--ink);
  border-bottom-left-radius: 5px;
}

.chat-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 15px;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-7px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  align-items: flex-end;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  resize: none;
  line-height: 1.45;
}

.chat-input:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(45, 186, 133, 0.1);
}

.chat-send-btn {
  flex-shrink: 0;
  min-height: 44px;
}

.chat-status {
  padding: 4px 18px 10px;
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.chat-status--loading { color: var(--gold); }
.chat-status--err { color: var(--coral); }

.agent-panel-sub {
  margin: 0;
  padding: 12px 18px 4px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  flex-shrink: 0;
}

.agent-suggestions {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  overflow-y: auto;
}

.agent-suggestion {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: rise-in 380ms ease both;
}

.agent-suggestion-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agent-suggestion-type {
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--teal);
}

.agent-suggestion-title {
  font-size: 0.9rem;
  display: block;
}

.agent-suggestion-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.agent-suggestion-actions {
  display: flex;
  gap: 6px;
}

.agent-status {
  display: block;
  padding: 4px 18px 14px;
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.agent-status--loading { color: var(--gold); }
.agent-status--ok { color: var(--mint); }
.agent-status--err { color: var(--coral); }

.agent-empty {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
  font-style: italic;
}

@media (max-width: 880px) {
  .assistant-columns {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PWA / MOBILE SAFETY
   ============================================================ */
html { overflow-x: hidden; }

/* Ensure nothing punches through on narrow phones */
@media (max-width: 420px) {
  main {
    padding-left: max(12px, var(--safe-left));
    padding-right: max(12px, var(--safe-right));
  }
  .ops-grid,
  .money-panel,
  .finance-ops-grid {
    grid-template-columns: 1fr;
  }
  .performance-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   GLOBAL COMMAND STRIP
   ============================================================ */
.global-command-strip {
  padding: 14px 0 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.command-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.command-input {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  resize: none;
  line-height: 1.45;
  -webkit-appearance: none;
}

.command-input:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(45, 186, 133, 0.12);
}

.command-strip-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.command-strip-actions .button {
  min-height: 44px;
  min-width: 64px;
  padding: 0 16px;
}

.command-voice-btn {
  font-size: 1.1rem;
}

.command-feedback {
  min-height: 20px;
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.command-feedback--ok { color: var(--mint); }
.command-feedback--err { color: var(--coral); }
.command-feedback--loading { color: var(--gold); }

@media (max-width: 640px) {
  .command-bar-inner {
    grid-template-columns: 1fr;
  }
  .command-strip-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ============================================================
   DAILY OPERATING BRIEF
   ============================================================ */
.brief-section {
  padding: 20px 0 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.brief-section > p.eyebrow {
  margin-bottom: 6px;
}

.brief-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.brief-date-block h3 {
  margin: 2px 0 0;
  font-size: 1.3rem;
}

.brief-score-badge {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 20px;
  color: #fff;
  flex-shrink: 0;
}

.brief-score-badge strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.brief-score-badge small {
  display: block;
  font-size: 0.78rem;
  opacity: 0.92;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.brief-card {
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.brief-card strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-section-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.brief-actions,
.brief-warnings,
.brief-coach {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  margin-top: 10px;
}

.brief-action-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.45;
}

.brief-action-item:last-child { border-bottom: 0; }

.brief-warning-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--coral);
  line-height: 1.4;
}

.brief-warning-item:last-child { border-bottom: 0; }

.brief-coach p {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.brief-coach small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.brief-warnings {
  border-color: rgba(240, 112, 112, 0.3);
  background: rgba(240, 112, 112, 0.04);
}

@media (max-width: 880px) {
  .brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brief-score-badge { width: 62px; height: 62px; }
  .brief-score-badge strong { font-size: 1.55rem; }
}

/* ============================================================
   AI PROVIDERS SECTION
   ============================================================ */
.providers-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.provider-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.provider-card--connected {
  border-color: rgba(45, 186, 133, 0.4);
  background: linear-gradient(180deg, rgba(45, 186, 133, 0.06), var(--paper));
}

.provider-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.provider-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-card-title div { display: flex; flex-direction: column; gap: 2px; }
.provider-card-title strong { font-size: 0.95rem; }
.provider-card-title small { color: var(--muted); font-size: 0.76rem; font-weight: 750; }

.provider-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.provider-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provider-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-form-actions .button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.84rem;
}

.provider-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(38, 181, 198, 0.07);
  border-left: 3px solid var(--teal);
  font-size: 0.8rem;
  color: var(--teal);
  line-height: 1.45;
}

@media (max-width: 880px) {
  .providers-grid { grid-template-columns: 1fr; }
}

/* === HEALTH HUB === */
.health-content {
  display: grid;
  gap: 18px;
}

.health-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.health-main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.health-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.health-connectors-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}

.health-connectors-card p { color: var(--muted); margin: 4px 0 0; font-size: 0.9rem; }

@media (max-width: 880px) {
  .health-main-grid { grid-template-columns: 1fr; }
  .health-connectors-card { grid-template-columns: 1fr; }
}

/* === BOT LAB === */
.botlab-content { display: grid; gap: 18px; }

.botlab-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dashboard-card.is-alert {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.4) inset;
}

.botlab-warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 184, 92, 0.08);
  border: 1px solid rgba(255, 184, 92, 0.3);
  font-size: 0.88rem;
  color: var(--text);
  align-items: start;
}

.botlab-warning strong { color: var(--gold); }

.botlab-ops-grid { gap: 18px; }

.botlab-form label.form-span-2 { grid-column: 1 / -1; }

.bot-form-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
}

.botlab-history-panel { display: grid; gap: 12px; max-height: 720px; overflow-y: auto; }

.bot-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
}

.bot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.bot-card-head strong { display: block; font-size: 1rem; }
.bot-card-head small { color: var(--muted); font-size: 0.78rem; }

.bot-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bot-badge--ok { background: rgba(38, 181, 198, 0.15); color: var(--teal); }
.bot-badge--queue { background: rgba(150, 150, 170, 0.18); color: var(--muted); }
.bot-badge--warning { background: rgba(255, 184, 92, 0.15); color: var(--gold); }
.bot-badge--danger { background: rgba(255, 107, 107, 0.15); color: var(--coral); }
.bot-badge--live { background: rgba(126, 217, 87, 0.18); color: var(--mint); }

.bot-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.bot-card-stats div { display: grid; gap: 2px; }
.bot-card-stats .label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bot-card-stats strong { font-size: 0.92rem; }
.bot-card-stats .is-positive { color: var(--mint); }
.bot-card-stats .is-negative { color: var(--coral); }

.bot-card-notes {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.bot-card-exchange { color: var(--muted); font-size: 0.74rem; }

.bot-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-button-warn {
  background: rgba(255, 184, 92, 0.15);
  color: var(--gold);
  border-color: rgba(255, 184, 92, 0.3);
}

.mini-button-danger {
  background: rgba(255, 107, 107, 0.12);
  color: var(--coral);
  border-color: rgba(255, 107, 107, 0.3);
}

.botlab-trade-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}

.botlab-trade-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.botlab-trade-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.botlab-trade-form label { display: grid; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.botlab-trade-form label.form-span-2 { grid-column: 1 / -1; }
.botlab-trade-form button { grid-column: 1 / -1; justify-self: start; }

.bot-trade-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(38, 181, 198, 0.06);
  border: 1px solid var(--border);
}

.bot-trade-summary span { font-size: 1.2rem; font-weight: 700; }
.bot-trade-summary span.is-positive { color: var(--mint); }
.bot-trade-summary span.is-negative { color: var(--coral); }
.bot-trade-summary small { margin-left: auto; color: var(--muted); }

.bot-trade-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.bot-trade-row:last-child { border-bottom: none; }
.bot-trade-row strong { font-size: 0.85rem; letter-spacing: 0.04em; }
.bot-trade-row small { display: block; color: var(--muted); font-size: 0.76rem; }
.bot-trade-note { font-style: italic; }

.bot-trade-pnl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-weight: 700;
}

.bot-trade-pnl.is-positive { color: var(--mint); }
.bot-trade-pnl.is-negative { color: var(--coral); }

@media (max-width: 760px) {
  .botlab-ops-grid { grid-template-columns: 1fr; }
  .botlab-history-panel { max-height: none; }
}

/* === Claude tab (Flask-backed) === */
.claude-layout { display: flex; flex-direction: column; gap: 16px; }
.claude-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.claude-tier-group { display: inline-flex; gap: 6px; }
.claude-tier-btn {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 8px 14px;
  background: transparent;
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  line-height: 1.15;
}
.claude-tier-btn strong { font-size: 13px; font-weight: 600; }
.claude-tier-btn span { font-size: 11px; color: var(--muted, #9aa3b8); }
.claude-tier-btn:hover { border-color: rgba(255,255,255,0.25); }
.claude-tier-btn.is-active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.55);
}
.claude-toolbar-actions { display: inline-flex; gap: 10px; align-items: center; }
.claude-cost-bar {
  font-size: 12px; color: var(--muted, #9aa3b8);
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}

.claude-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  min-height: 480px;
}
.claude-sessions {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  max-height: 600px;
  overflow-y: auto;
}
.claude-sessions .eyebrow { margin: 0 0 10px; }
.claude-session-list { display: flex; flex-direction: column; gap: 4px; }
.claude-session {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text, #e7eaf3);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.claude-session:hover { background: rgba(255,255,255,0.05); }
.claude-session.is-active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); }
.claude-session__title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claude-session__meta { font-size: 11px; color: var(--muted, #9aa3b8); }
.claude-session-empty { font-size: 12px; color: var(--muted, #9aa3b8); padding: 8px; }

.claude-chat {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  gap: 10px;
  min-height: 480px;
}
.claude-messages {
  flex: 1; min-height: 320px; max-height: 60vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
}
.claude-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.claude-msg--user {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
}
.claude-msg--assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.claude-msg__meta { font-size: 11px; color: var(--muted, #9aa3b8); margin-top: 6px; }

.claude-input-row { display: flex; gap: 8px; align-items: stretch; }
.claude-input-row textarea {
  flex: 1;
  resize: vertical;
  background: rgba(0,0,0,0.25);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}
.claude-input-row textarea:focus { outline: none; border-color: rgba(99,102,241,0.6); }
.claude-input-row .button { align-self: flex-end; }

.claude-status { font-size: 12px; color: var(--muted, #9aa3b8); min-height: 16px; }
.claude-status[data-tone="error"] { color: #ff6b6b; }
.claude-status[data-tone="warn"] { color: #ffb84d; }

.claude-tool-line {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted, #9aa3b8);
  padding: 4px 12px;
  background: rgba(99,102,241,0.06);
  border-left: 2px solid rgba(99,102,241,0.4);
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 2px 0;
}

/* Tablet: stack the sessions sidebar above the chat (matches .assistant-columns pattern) */
@media (max-width: 880px) {
  .claude-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .claude-sessions {
    max-height: 180px;
    order: 2;        /* push sessions below chat on tablet */
  }
  .claude-chat { order: 1; min-height: 420px; }
  .claude-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .claude-tier-btn { padding: 8px 12px; }
  .claude-msg { max-width: 92%; }
}

/* Phone: tighter chrome, bigger touch targets, full-width messages */
@media (max-width: 640px) {
  .claude-tier-group { width: 100%; justify-content: space-between; }
  .claude-tier-btn {
    flex: 1;
    align-items: center;
    text-align: center;
    padding: 10px 6px;
  }
  .claude-tier-btn strong { font-size: 12px; }
  .claude-tier-btn span { font-size: 10px; }

  .claude-toolbar-actions { width: 100%; justify-content: space-between; }
  .claude-cost-bar { font-size: 11px; }

  .claude-grid { gap: 10px; }
  .claude-sessions { max-height: 150px; padding: 10px; }
  .claude-session__title { font-size: 12px; }
  .claude-session__meta { font-size: 10px; }

  .claude-chat { padding: 10px; gap: 8px; min-height: 380px; }
  .claude-messages {
    min-height: 260px;
    max-height: calc(100vh - 360px);
    font-size: 14px;
  }
  .claude-msg {
    max-width: 96%;
    padding: 9px 12px;
    font-size: 14px;
  }
  .claude-input-row { flex-direction: column; gap: 8px; }
  .claude-input-row textarea {
    font-size: 16px;     /* prevents iOS Safari zoom on focus */
    min-height: 56px;
    padding: 12px;
  }
  .claude-input-row .button {
    width: 100%;
    min-height: 44px;    /* iOS HIG minimum touch target */
    align-self: stretch;
  }
}

/* Small phone: collapse model labels to single letter */
@media (max-width: 420px) {
  .claude-tier-btn span { display: none; }
  .claude-tier-btn { padding: 12px 4px; }
  .claude-tier-btn strong { font-size: 13px; }
}

/* === Sidebar: collapsible "More" group === */
.sidebar-group--collapsible { margin-top: 6px; }
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 0;
  background: transparent;
  border: 0;
  color: var(--muted, #9aa3b8);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-group-toggle:hover { color: var(--text, #e7eaf3); }
.sidebar-group-chev { font-size: 10px; transition: transform .15s; }
.sidebar-group-items { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.sidebar-group-items a { font-size: 13px; opacity: 0.85; }

/* === Calendar (placeholder) === */
.calendar-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calendar-empty {
  padding: 24px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  color: var(--muted, #9aa3b8);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.calendar-empty .eyebrow { margin: 0 0 6px; }
.calendar-empty .button { align-self: flex-start; }
.calendar-help { font-size: 12px; margin: 0; opacity: 0.7; }

.calendar-events {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calendar-event {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid rgba(76,201,240,0.55);
  border-radius: 10px;
}
.calendar-event-time {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted, #9aa3b8);
  letter-spacing: 0.02em;
}
.calendar-event-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.calendar-event-location {
  font-size: 12px;
  color: var(--muted, #9aa3b8);
}

@media (max-width: 640px) {
  .calendar-event { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
}

/* === Habits (placeholder) === */
.habits-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.habits-card {
  padding: 16px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.habits-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.habits-card--building { border-left: 3px solid rgba(72, 187, 120, 0.7); }
.habits-card--breaking { border-left: 3px solid rgba(245, 101, 101, 0.7); }
.habits-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.habits-list li { font-size: 13px; line-height: 1.45; color: var(--text, #e7eaf3); }
.habits-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted, #9aa3b8);
  font-style: italic;
}

@media (max-width: 640px) {
  .habits-layout { grid-template-columns: 1fr; }
}

/* === Lean hero (no marketing copy, score console only) === */
.command-panel--lean {
  padding-top: 14px;
  padding-bottom: 14px;
}
.command-panel--lean .hero-side--full {
  width: 100%;
}

/* === Finances (live snapshot widget) === */
.finances-layout { display: flex; flex-direction: column; gap: 12px; }

.finances-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.finances-status { color: var(--muted, #9aa3b8); font-size: 12px; }
.finances-status[data-tone="error"] { color: #ff6b6b; }

.finances-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.finances-platform {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.finances-platform--ok       { border-left: 3px solid rgba(72,187,120,0.7); }
.finances-platform--error    { border-left: 3px solid rgba(245,101,101,0.7); }
.finances-platform--no_key,
.finances-platform--no_secret { border-left: 3px solid rgba(160,174,192,0.5); }

.finances-platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.finances-platform-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.finances-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted, #9aa3b8);
}
.finances-tag--ok       { background: rgba(72,187,120,0.18);  color: #9ae6b4; }
.finances-tag--error    { background: rgba(245,101,101,0.18); color: #fc8181; }
.finances-tag--no_key,
.finances-tag--no_secret { background: rgba(160,174,192,0.12); color: #cbd5e0; }

.finances-total {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #e7eaf3);
}
.finances-error {
  margin: 0;
  font-size: 12px;
  color: #fc8181;
  word-break: break-word;
}
.finances-empty,
.finances-empty-line {
  color: var(--muted, #9aa3b8);
  font-size: 13px;
  padding: 8px 0;
  margin: 0;
}

.finances-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.finances-table th,
.finances-table td {
  padding: 6px 4px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.finances-table th {
  font-weight: 500;
  color: var(--muted, #9aa3b8);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.finances-table .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .finances-platforms { grid-template-columns: 1fr; }
  .finances-platform { padding: 12px 14px; }
  .finances-table { font-size: 12px; }
}

/* === Polish pass === */
.section-grid > .section-heading h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.section-grid > .section-heading .eyebrow { margin-bottom: 4px; }
.brief-section .eyebrow { margin-bottom: 6px; }

/* Smoother focus + transitions */
a, button {
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(99,102,241,0.55);
  outline-offset: 2px;
}

/* Mobile: tighten up section padding */
@media (max-width: 640px) {
  .section-grid {
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .section-grid > .section-heading h2 { font-size: 19px; }
}

/* === Connectors (live API status thumbnails) === */
.connectors-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.connectors-status { color: var(--muted, #9aa3b8); font-size: 12px; }
.connectors-status[data-tone="error"] { color: #ff6b6b; }

.connectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.connector-tile {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.connector-tile-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.connector-tile-head strong { font-weight: 600; }
.connector-tile-meta {
  color: var(--muted, #9aa3b8);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.connector-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.connector-dot--ok       { background: #48bb78; box-shadow: 0 0 8px rgba(72,187,120,0.5); }
.connector-dot--error    { background: #f56565; box-shadow: 0 0 8px rgba(245,101,101,0.5); }
.connector-dot--missing  { background: #a0aec0; opacity: 0.55; }
.connector-dot--neutral  { background: #ecc94b; opacity: 0.7; }

@media (max-width: 640px) {
  .connectors-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .connector-tile { padding: 8px 10px; }
}

/* === Active sidebar link (set by router) === */
.sidebar-nav a.is-active {
  background: rgba(99,102,241,0.15);
  color: var(--text, #e7eaf3);
  border-radius: 6px;
}

/* === Page-mode body padding (each page starts cleaner) === */
main > section { transition: opacity .12s; }

/* === Aitor Omnibox (global AI input at top of every page) === */
#aitor-omnibox {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: rgba(10,10,14,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.omnibox-bar {
  display: grid;
  grid-template-columns: 130px 1fr auto auto;
  gap: 8px;
  align-items: stretch;
}
#omnibox-provider {
  background: rgba(255,255,255,0.04);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}
#omnibox-input {
  background: rgba(0,0,0,0.25);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  min-height: 40px;
  max-height: 160px;
}
#omnibox-input:focus { outline: none; border-color: rgba(99,102,241,0.6); }
#omnibox-send, #omnibox-new {
  background: rgba(99,102,241,0.18);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#omnibox-new { font-size: 18px; padding: 0 12px; }
#omnibox-send:hover, #omnibox-new:hover { background: rgba(99,102,241,0.3); }
#omnibox-send:disabled { opacity: 0.5; cursor: not-allowed; }

#omnibox-status {
  display: block;
  font-size: 12px;
  color: var(--muted, #9aa3b8);
  margin-top: 4px;
  min-height: 14px;
}
#omnibox-status[data-tone="error"] { color: #ff6b6b; }

.omnibox-thread {
  margin-top: 10px;
  max-height: 360px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.omnibox-thread.is-active { display: flex; }
.omnibox-msg {
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 90%;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.omnibox-msg--user {
  align-self: flex-end;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.4);
}
.omnibox-msg--assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.omnibox-msg-meta {
  font-size: 11px;
  color: var(--muted, #9aa3b8);
  margin-top: 4px;
}
.omnibox-tool {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted, #9aa3b8);
  margin-bottom: 4px;
  padding: 2px 8px;
  background: rgba(99,102,241,0.08);
  border-left: 2px solid rgba(99,102,241,0.5);
  border-radius: 4px;
  display: inline-block;
}

@media (max-width: 760px) {
  .omnibox-bar { grid-template-columns: 100px 1fr auto; }
  #omnibox-new { display: none; }
  #omnibox-input { font-size: 16px; }
}

/* === Today page === */
.today-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.today-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.today-header-top h2 {
  margin: 0;
  font-size: 26px;
}
.today-shift-row {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted, #9aa3b8);
}
.today-shift-row select {
  background: rgba(255,255,255,0.04);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.today-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.today-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
}
.today-stat span {
  font-size: 11px;
  color: var(--muted, #9aa3b8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.today-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

/* Day blocks */
.today-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.day-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
}
.day-block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.day-block-time {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted, #9aa3b8);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.day-block-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}
.day-block-progress {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted, #9aa3b8);
}
.day-block-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(76,201,240,0.06);
  border-left: 2px solid rgba(76,201,240,0.55);
  border-radius: 6px;
  font-size: 13px;
}
.day-block-event { display: flex; gap: 8px; }
.day-block-event-time {
  font-family: ui-monospace, monospace;
  color: var(--muted, #9aa3b8);
  min-width: 55px;
}
.day-block-tasks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-block-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.day-block-task:hover { background: rgba(255,255,255,0.04); }
.day-block-task-tick {
  width: 18px; height: 18px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--protocol-green, #00d68f);
  font-weight: 700;
  flex-shrink: 0;
}
.day-block-task.is-done { opacity: 0.55; }
.day-block-task.is-done .day-block-task-text { text-decoration: line-through; }
.day-block-task.is-done .day-block-task-tick {
  background: rgba(0,214,143,0.18);
  border-color: rgba(0,214,143,0.6);
}
.day-block-task-text { font-size: 14px; }
.day-block-add {
  margin-top: 8px;
}
.day-block-add input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(255,255,255,0.12);
  color: var(--text, #e7eaf3);
  font-size: 13px;
  padding: 6px 4px;
}
.day-block-add input:focus {
  outline: none;
  border-bottom-color: rgba(99,102,241,0.6);
}

/* Side panels */
.today-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.today-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.today-panel-head h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b8);
}

.today-calendar-list, .today-bills-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.today-calendar-list li {
  display: flex; gap: 8px;
  font-size: 13px;
}
.today-calendar-time {
  font-family: ui-monospace, monospace;
  color: var(--muted, #9aa3b8);
  min-width: 50px;
}

.today-bills-list li {
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
}
.today-bill-row {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; margin-bottom: 2px;
}
.today-bill-amount { color: var(--protocol-yellow, #ffd60a); font-variant-numeric: tabular-nums; }
.today-bill-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted, #9aa3b8);
}
.today-bill-paid {
  background: transparent;
  color: var(--muted, #9aa3b8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.today-bill-paid:hover { color: var(--text, #e7eaf3); border-color: rgba(255,255,255,0.3); }

.today-bill-form {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
}
.today-bill-form input, .today-bill-form select {
  background: rgba(0,0,0,0.2);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}
.today-bill-form-actions { display: flex; gap: 6px; }

.today-mail-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.today-mail-stats > div {
  text-align: center;
  padding: 8px;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
}
.today-mail-stats span { font-size: 11px; color: var(--muted, #9aa3b8); display: block; }
.today-mail-stats strong { font-size: 18px; font-weight: 700; }

@media (max-width: 880px) {
  .today-grid { grid-template-columns: 1fr; }
  .today-side { order: 2; }
}

/* === Today: work-hours quick-input row === */
.today-work-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.today-work-label { font-size: 13px; color: var(--muted, #9aa3b8); margin-right: 4px; }
.today-work-row input[type=time] {
  background: rgba(0,0,0,0.25);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.today-work-dash { color: var(--muted, #9aa3b8); font-size: 14px; }
.today-work-row button { padding: 6px 14px; font-size: 13px; }

/* Smash button on each day block */
.day-block-smash {
  background: transparent;
  color: var(--muted, #9aa3b8);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-left: 8px;
  transition: all .15s;
}
.day-block-smash:hover {
  color: var(--text, #e7eaf3);
  border-color: rgba(0,214,143,0.5);
  background: rgba(0,214,143,0.08);
}
.day-block.is-smashed .day-block-smash {
  color: var(--protocol-green, #00d68f);
  border-color: rgba(0,214,143,0.55);
  background: rgba(0,214,143,0.12);
}
.day-block.is-smashed { border-left: 3px solid rgba(0,214,143,0.55); }

/* Today panel: scan email + bills layout */
.today-panel-actions { display: inline-flex; gap: 6px; }
.today-scan-results {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
  font-size: 12px;
}
.today-scan-head { color: var(--muted, #9aa3b8); margin-bottom: 8px; }
.today-scan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.today-scan-list li {
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}
.today-scan-list label {
  display: grid;
  grid-template-columns: 18px 1fr auto auto auto;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.today-scan-name { font-size: 13px; font-weight: 500; }
.today-scan-amt { font-family: ui-monospace, monospace; color: var(--protocol-yellow, #ffd60a); }
.today-scan-due { font-family: ui-monospace, monospace; color: var(--muted, #9aa3b8); }
.today-scan-conf { color: var(--muted, #9aa3b8); }
.today-scan-source { font-size: 11px; color: var(--muted, #9aa3b8); margin-top: 4px; padding-left: 24px; opacity: 0.8; }
.today-scan-actions { display: flex; gap: 8px; margin-top: 10px; }

/* === Metrics page === */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metrics-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
}
.metrics-card--wide { grid-column: 1 / -1; }
.metrics-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.metrics-card-head h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b8);
}
.metrics-sub { font-size: 11px; color: var(--muted, #9aa3b8); }

/* Week grid */
.metrics-week-grid { display: flex; flex-direction: column; gap: 6px; }
.metrics-week-row {
  display: grid;
  grid-template-columns: 100px repeat(7, 1fr);
  gap: 6px;
  align-items: center;
}
.metrics-week-head .metrics-week-col {
  font-size: 11px;
  text-align: center;
  color: var(--muted, #9aa3b8);
  font-family: ui-monospace, monospace;
}
.metrics-week-rowlabel {
  font-size: 12px;
  color: var(--muted, #9aa3b8);
}
.metrics-week-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #0a0a0c;
}

/* Streaks */
.metrics-streaks { display: flex; flex-direction: column; gap: 8px; }
.metrics-streak {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
}
.metrics-streak-name { font-size: 13px; }
.metrics-streak-days {
  font-family: ui-monospace, monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--protocol-green, #00d68f);
}
.metrics-streak-days small { font-size: 12px; color: var(--muted, #9aa3b8); margin-left: 2px; }

/* Habit hit rate */
.metrics-habits { display: flex; flex-direction: column; gap: 6px; }
.metrics-habit-row {
  display: grid;
  grid-template-columns: 180px 1fr 60px;
  gap: 10px;
  align-items: center;
}
.metrics-habit-name { font-size: 13px; }
.metrics-habit-bar {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 5px;
  overflow: hidden;
}
.metrics-habit-bar span { display: block; height: 100%; transition: width .25s; }
.metrics-habit-pct {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted, #9aa3b8);
  text-align: right;
}

/* Bills card */
.metrics-bills { text-align: center; padding: 12px 0; }
.metrics-bills-big { font-family: ui-monospace, monospace; font-size: 36px; font-weight: 800; color: var(--protocol-yellow, #ffd60a); }
.metrics-bills-sub { font-size: 12px; color: var(--muted, #9aa3b8); margin-top: 4px; }

/* Coach */
.metrics-card--coach { background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(255,255,255,0.02) 100%); }
.metrics-coach-body p { margin: 0 0 10px; line-height: 1.55; font-size: 14px; }
.metrics-coach-body p:last-child { margin-bottom: 0; }

@media (max-width: 880px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metrics-week-row { grid-template-columns: 80px repeat(7, 1fr); gap: 4px; }
  .metrics-week-cell { height: 30px; font-size: 11px; }
  .metrics-habit-row { grid-template-columns: 130px 1fr 50px; }
}

/* === DASHBOARD / HOME === */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 24px 26px;
  background: linear-gradient(135deg, rgba(99,102,241,0.10) 0%, rgba(76,201,240,0.06) 60%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: "";
  position: absolute; top: -60px; right: -60px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(0,214,143,0.10), transparent 70%);
  pointer-events: none;
}
.dash-hero h1 {
  margin: 6px 0 14px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.dash-hero h1 span { color: var(--protocol-green, #00d68f); }
.dash-hero h1 small {
  font-size: 18px;
  font-weight: 500;
  color: var(--muted, #9aa3b8);
  margin-left: 4px;
}
.dash-hero-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.dash-hero-stat {
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  min-width: 90px;
}
.dash-hero-stat span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9aa3b8);
  display: block;
}
.dash-hero-stat strong {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #e7eaf3);
}

.dash-rings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-self: center;
}
.dash-ring { text-align: center; }
.dash-ring-svg { width: 90px; height: 90px; }
.dash-ring-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b8);
  margin-top: 2px;
}
.dash-ring-sub { font-size: 10px; color: var(--muted, #9aa3b8); opacity: 0.7; font-family: ui-monospace, monospace; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.dash-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
}
.dash-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.dash-card-head h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9aa3b8);
}
.dash-card-link {
  font-size: 11px;
  color: var(--muted, #9aa3b8);
}
.dash-card--money    { border-left: 3px solid #00d68f; }
.dash-card--bills    { border-left: 3px solid #ffd60a; }
.dash-card--cal      { border-left: 3px solid #4cc9f0; }
.dash-card--blocks   { border-left: 3px solid #b794f4; }
.dash-card--battles  { border-left: 3px solid #ff7849; }
.dash-card--coach    {
  border-left: 3px solid #f472b6;
  grid-column: 1 / -1;
}

.dash-empty { color: var(--muted, #9aa3b8); font-size: 12px; padding: 8px 0; }

/* Battles */
.dash-battles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash-battle {
  text-align: center;
  padding: 12px 6px;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
  border: 1px solid transparent;
}
.dash-battle.is-clean { border-color: rgba(0,214,143,0.4); background: rgba(0,214,143,0.06); }
.dash-battle.is-broken { border-color: rgba(255,71,87,0.4); background: rgba(255,71,87,0.06); }
.dash-battle-name {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b8);
}
.dash-battle-days {
  font-family: ui-monospace, monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--protocol-green, #00d68f);
}
.dash-battle-days small { font-size: 12px; color: var(--muted, #9aa3b8); margin-left: 1px; }
.dash-battle-state { font-size: 10px; color: var(--muted, #9aa3b8); }

/* Money */
.dash-money-big {
  font-family: ui-monospace, monospace;
  font-size: 28px;
  font-weight: 800;
  color: var(--protocol-green, #00d68f);
  margin-bottom: 8px;
}
.dash-money-rows { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.dash-money-rows > div { display: flex; justify-content: space-between; }
.dash-money-rows .is-neg strong { color: #ff6b6b; }

/* Bills */
.dash-bills { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-bills li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  font-size: 13px;
}
.dash-bill-amount { font-family: ui-monospace, monospace; color: #ffd60a; }
.dash-bill-due { font-size: 11px; color: var(--muted, #9aa3b8); }

/* Calendar peek */
.dash-cal { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-cal li { display: flex; gap: 8px; font-size: 13px; }
.dash-cal-time { font-family: ui-monospace, monospace; color: var(--muted, #9aa3b8); min-width: 50px; }

/* Block summary */
.dash-blocks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-block-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.dash-block-row.is-done { background: rgba(0,214,143,0.08); }
.dash-block-time { font-family: ui-monospace, monospace; color: var(--muted, #9aa3b8); font-size: 11px; }
.dash-block-progress { font-family: ui-monospace, monospace; color: var(--muted, #9aa3b8); }

/* Coach */
.dash-coach-body p { margin: 0 0 8px; line-height: 1.5; font-size: 13px; }
.dash-coach-empty { color: var(--muted, #9aa3b8); font-size: 12px; }

@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .dash-hero { grid-template-columns: 1fr; padding: 18px 18px; }
  .dash-hero h1 { font-size: 32px; }
  .dash-rings { grid-template-columns: repeat(4, 1fr); }
  .dash-ring-svg { width: 70px; height: 70px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-card--coach { grid-column: 1; }
}

/* === Day-block — artifact-style cards === */
.day-block {
  --bc-color: #4cc9f0;
  position: relative;
  padding: 16px 18px 14px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 4px solid var(--bc-color);
  border-radius: 14px;
  overflow: hidden;
}
.day-block::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 60%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bc-color) 10%, transparent), transparent);
  pointer-events: none;
}
.day-block--blue   { --bc-color: #4cc9f0; }
.day-block--teal   { --bc-color: #2dd4bf; }
.day-block--green  { --bc-color: #00d68f; }
.day-block--yellow { --bc-color: #ffd60a; }
.day-block--orange { --bc-color: #ff7849; }
.day-block--red    { --bc-color: #ff4757; }
.day-block--pink   { --bc-color: #f472b6; }
.day-block--purple { --bc-color: #b794f4; }

.day-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  position: relative;
}
.day-block-head-main { flex: 1; min-width: 0; }
.day-block-title-row { display: flex; align-items: center; gap: 8px; }
.day-block-emoji { font-size: 18px; }
.day-block-title {
  margin: 0;
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bc-color);
}
.day-block-sub {
  font-size: 12px;
  color: var(--muted, #9aa3b8);
  margin-top: 4px;
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.day-block-sub strong { color: var(--text, #e7eaf3); font-weight: 600; }
.day-block-sep { opacity: 0.5; }
.day-block-time { font-family: ui-monospace, monospace; letter-spacing: 0.02em; }
.day-block-diff { color: var(--bc-color); font-weight: 700; letter-spacing: 0.06em; }

.day-block-smash {
  background: transparent;
  color: var(--muted, #9aa3b8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.day-block-smash:hover {
  color: var(--bc-color);
  border-color: var(--bc-color);
  background: color-mix(in srgb, var(--bc-color) 10%, transparent);
}
.day-block.is-smashed .day-block-smash {
  color: var(--bc-color);
  border-color: var(--bc-color);
  background: color-mix(in srgb, var(--bc-color) 12%, transparent);
}

/* Progress bar inside block */
.day-block-progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 11px;
  color: var(--muted, #9aa3b8);
  font-family: ui-monospace, monospace;
}
.day-block-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}
.day-block-progress-bar span {
  display: block; height: 100%;
  background: var(--bc-color);
  transition: width .3s;
}

/* Events overlay inside block (calendar events that fall in this time range) */
.day-block-events {
  margin: 4px 0 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border-left: 2px solid rgba(76,201,240,0.5);
  font-size: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.day-block-event { display: flex; gap: 8px; }
.day-block-event-time { font-family: ui-monospace, monospace; color: var(--muted, #9aa3b8); min-width: 55px; }

/* Tasks list */
.day-block-tasks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.day-block-task {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  font-size: 14px;
}
.day-block-task:last-child { border-bottom: 0; }
.day-block-task:hover { background: rgba(255,255,255,0.015); border-radius: 4px; }
.day-block-task-tick {
  width: 20px; height: 20px;
  border: 1.5px solid var(--bc-color);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  color: var(--bc-color);
  background: transparent;
  transition: all .12s;
}
.day-block-task.is-done .day-block-task-tick {
  background: var(--bc-color);
  color: #0a0a0c;
}
.day-block-task.is-done .day-block-task-text {
  text-decoration: line-through;
  opacity: 0.55;
}
.day-block-task-text { font-weight: 500; }
.day-block-task-xp {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted, #9aa3b8);
  letter-spacing: 0.02em;
}
.day-block-task.is-done .day-block-task-xp { color: var(--bc-color); }

/* Mic button on certain tasks */
.day-block-task-mic {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  width: 32px; height: 32px;
  font-size: 14px;
  color: var(--muted, #9aa3b8);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.day-block-task-mic:hover {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.4);
  color: var(--text, #e7eaf3);
}

/* Add-task input at bottom of block */
.day-block-add { margin-top: 8px; }
.day-block-add input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  color: var(--muted, #9aa3b8);
  font-size: 12px;
  padding: 6px 4px;
}
.day-block-add input:focus {
  outline: none;
  border-bottom-color: var(--bc-color);
  color: var(--text, #e7eaf3);
}

@media (max-width: 640px) {
  .day-block { padding: 14px 14px 12px; }
  .day-block-title { font-size: 14px; }
  .day-block-task { grid-template-columns: 22px 1fr auto; font-size: 13px; padding: 9px 2px; }
  .day-block-task-mic { display: none; }
}

/* === Dashboard: greeting hero === */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.10) 0%, rgba(244,114,182,0.06) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  margin-bottom: 16px;
}
.dash-greeting {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #f472b6, #4cc9f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-greeting span { color: var(--protocol-green, #00d68f); -webkit-text-fill-color: var(--protocol-green, #00d68f); }
.dash-date { color: var(--muted, #9aa3b8); margin: 4px 0 0; font-size: 14px; }

.dash-hero-xp {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-family: ui-monospace, monospace;
}
.dash-xp-now { font-size: 28px; font-weight: 800; color: var(--protocol-green, #00d68f); }
.dash-xp-sep { color: var(--muted, #9aa3b8); font-size: 16px; }
.dash-xp-goal { font-size: 16px; color: var(--muted, #9aa3b8); }
.dash-hero-xp small { font-size: 11px; color: var(--muted, #9aa3b8); margin-left: 6px; letter-spacing: 0.06em; text-transform: uppercase; }

/* LIVE NOW banner */
.dash-live-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(0,214,143,0.08);
  border: 1px solid rgba(0,214,143,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.dash-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00d68f;
  box-shadow: 0 0 8px #00d68f;
  animation: dash-pulse 1.6s infinite;
}
@keyframes dash-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.dash-live-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--protocol-green, #00d68f);
}
.dash-live-block { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dash-live-block strong { color: var(--text, #e7eaf3); letter-spacing: 0.06em; }
.dash-live-time, .dash-live-progress {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted, #9aa3b8);
}
.dash-live-empty { color: var(--muted, #9aa3b8); font-style: italic; }

/* Dashboard card head with badge */
.dash-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-card-head h3 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b8);
  font-weight: 700;
}
.dash-card-badge {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  padding: 2px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  color: var(--text, #e7eaf3);
}
.dash-card-link { font-size: 11px; color: var(--muted, #9aa3b8); }
.dash-empty { color: var(--muted, #9aa3b8); font-size: 12px; padding: 8px 0; font-style: italic; }

/* Inbox card */
.dash-inbox { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; max-height: 380px; overflow-y: auto; }
.dash-inbox li { padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.dash-inbox li:last-child { border-bottom: 0; }
.dash-inbox-subject { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.dash-inbox-from { font-size: 11px; color: var(--muted, #9aa3b8); font-family: ui-monospace, monospace; margin-bottom: 4px; }
.dash-inbox-snippet { font-size: 11px; color: var(--muted, #9aa3b8); line-height: 1.4; opacity: 0.8; }

/* Drive card */
.dash-drive { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.dash-drive li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dash-drive li:last-child { border-bottom: 0; }
.dash-drive-icon { font-size: 18px; }
.dash-drive-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-drive-mod { font-size: 11px; color: var(--muted, #9aa3b8); grid-column: 2; }

/* Block-row tweaks for new dash */
.dash-block-row { display: grid; grid-template-columns: 22px 80px 1fr auto; gap: 8px; padding: 6px 6px; border-radius: 6px; font-size: 12px; }
.dash-block-emoji { font-size: 14px; }
.dash-block-row.is-done { background: rgba(0,214,143,0.08); }

/* === DEBT card on Money page === */
.debt-card {
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255,71,87,0.06) 0%, rgba(255,214,10,0.04) 100%);
  border: 1px solid rgba(255,107,107,0.22);
  border-radius: 14px;
  margin-bottom: 14px;
}
.debt-card-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.debt-card-head h3 { margin: 0; font-size: 16px; }
.debt-card-head small { color: var(--muted, #9aa3b8); font-size: 12px; display: block; }

.debt-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 16px;
}
.debt-stat {
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border-left: 3px solid transparent;
}
.debt-stat span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b8);
  display: block;
}
.debt-stat strong {
  font-family: ui-monospace, monospace;
  font-size: 22px;
  font-weight: 800;
  display: block; margin-top: 4px;
}
.debt-stat small { font-size: 11px; color: var(--muted, #9aa3b8); }
.debt-stat--total    { border-left-color: #f472b6; }
.debt-stat--total strong { color: #f472b6; }
.debt-stat--overdue  { border-left-color: #ff4757; }
.debt-stat--overdue strong { color: #ff4757; }
.debt-stat--7d       { border-left-color: #ff7849; }
.debt-stat--7d strong { color: #ff7849; }
.debt-stat--30d      { border-left-color: #ffd60a; }
.debt-stat--30d strong { color: #ffd60a; }

/* 30-day timeline strip */
.debt-timeline {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 2px;
  align-items: end;
  height: 90px;
  padding: 8px 4px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}
.debt-timeline-col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 3px;
  height: 100%;
  cursor: help;
}
.debt-timeline-bar {
  width: 80%;
  min-height: 4px;
  border-radius: 2px;
  transition: opacity .15s;
}
.debt-timeline-col:hover .debt-timeline-bar { opacity: 1 !important; }
.debt-timeline-label {
  font-family: ui-monospace, monospace;
  font-size: 8px;
  color: var(--muted, #9aa3b8);
  opacity: 0.6;
}

@media (max-width: 760px) {
  .debt-grid { grid-template-columns: 1fr 1fr; }
  .debt-timeline { height: 70px; }
  .debt-timeline-label { display: none; }
}

/* === Day-block polish — push closer to artifact === */
.day-block {
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--bc-color) 6%, transparent) 0%, transparent 60%),
    rgba(255,255,255,0.025);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.02);
}
.day-block::before { display: none; }  /* replaced by the radial background above */

.day-block-head { align-items: center; }
.day-block-title { font-size: 18px; letter-spacing: 0.06em; }
.day-block-emoji { font-size: 22px; line-height: 1; }
.day-block-sub { font-size: 13px; }
.day-block-sub strong { color: var(--bc-color); }
.day-block-diff {
  display: inline-block;
  padding: 1px 8px;
  background: color-mix(in srgb, var(--bc-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc-color) 35%, transparent);
  border-radius: 999px;
  color: var(--bc-color);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.day-block-progress-row {
  margin: 8px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.day-block-progress-bar { height: 5px; }

.day-block-tasks { gap: 2px; }
.day-block-task { padding: 12px 8px; font-size: 15px; border-bottom: 0; border-radius: 8px; }
.day-block-task:hover { background: rgba(255,255,255,0.025); }
.day-block-task-tick {
  width: 22px; height: 22px;
  border-width: 2px;
  border-radius: 6px;
}
.day-block-task-xp {
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-color);
  opacity: 0.75;
}
.day-block-task.is-done .day-block-task-xp { opacity: 1; }

.day-block-task-mic {
  background: color-mix(in srgb, var(--bc-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc-color) 30%, transparent);
  color: var(--bc-color);
}
.day-block-task-mic:hover {
  background: color-mix(in srgb, var(--bc-color) 20%, transparent);
}

/* === Connector brand icons === */
.connector-brand-img {
  width: 18px; height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}
.connector-brand-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #0a0a0c;
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}
.connector-tile-head {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
}
.connector-tile-head strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Money: net worth + donut layout === */
.networth-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(0,214,143,0.06) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(0,214,143,0.18);
  border-radius: 14px;
  margin-bottom: 14px;
}
.networth-main { display: flex; flex-direction: column; gap: 6px; }
.networth-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9aa3b8);
}
.networth-value {
  font-family: ui-monospace, monospace;
  font-size: 42px;
  font-weight: 800;
  color: var(--protocol-green, #00d68f);
  line-height: 1;
}
.networth-sub { font-size: 11px; color: var(--muted, #9aa3b8); }
.networth-breakdown { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.networth-row {
  display: flex; justify-content: space-between;
  font-size: 13px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
}
.networth-row strong { font-family: ui-monospace, monospace; }
.networth-row--negative strong { color: #ff6b6b; }

.nw-donut-wrap { display: flex; flex-direction: column; gap: 8px; }
.nw-donut { width: 100%; max-width: 200px; align-self: center; }
.nw-legend { display: flex; flex-direction: column; gap: 4px; }
.nw-legend-row {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 6px;
  font-size: 11px;
  align-items: center;
}
.nw-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.nw-legend-name { color: var(--muted, #9aa3b8); text-transform: capitalize; }
.nw-legend-val { font-family: ui-monospace, monospace; }

@media (max-width: 760px) {
  .networth-card { grid-template-columns: 1fr; }
  .networth-value { font-size: 32px; }
}

/* === Money: quick-log === */
.money-quicklog, .money-accounts, .money-budget, .money-platforms, .money-tx {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin-bottom: 12px;
}
.money-quicklog-head, .money-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.money-quicklog-head h3, .money-card-head h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9aa3b8);
}
.money-quicklog-toggle { display: inline-flex; gap: 4px; }
.ql-kind {
  padding: 6px 12px;
  background: transparent;
  color: var(--muted, #9aa3b8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ql-kind.is-active {
  background: rgba(0,214,143,0.15);
  border-color: rgba(0,214,143,0.5);
  color: #9ae6b4;
}
.ql-kind[data-kind="expense"].is-active {
  background: rgba(255,107,107,0.15);
  border-color: rgba(255,107,107,0.5);
  color: #fc8181;
}
.ql-form {
  display: grid;
  grid-template-columns: 120px 1fr 1fr auto;
  gap: 8px;
}
.ql-form input, .ql-form select {
  background: rgba(0,0,0,0.2);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.ql-status { display: block; font-size: 11px; color: var(--muted, #9aa3b8); margin-top: 6px; min-height: 12px; }

/* Accounts */
.acct-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  margin-bottom: 4px;
}
.acct-row-main { display: flex; flex-direction: column; }
.acct-row-name { font-size: 13px; font-weight: 500; }
.acct-row-type { font-size: 10px; color: var(--muted, #9aa3b8); text-transform: uppercase; letter-spacing: 0.04em; }
.acct-row-balance { display: inline-flex; align-items: center; gap: 6px; }
.acct-balance-input {
  background: rgba(0,0,0,0.25);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  width: 120px;
  text-align: right;
}
.acct-row-currency { font-size: 11px; color: var(--muted, #9aa3b8); }
.acct-row-delete {
  background: transparent;
  color: var(--muted, #9aa3b8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  width: 22px; height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.acct-form {
  display: grid; grid-template-columns: 1fr auto 120px 80px auto; gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}
.acct-form input, .acct-form select {
  background: rgba(0,0,0,0.2);
  color: var(--text, #e7eaf3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

/* Budget */
.money-period-toggle { display: inline-flex; gap: 4px; }
.period-btn {
  padding: 4px 12px;
  background: transparent;
  color: var(--muted, #9aa3b8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.period-btn.is-active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.5); color: var(--text, #e7eaf3); }

.budget-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.budget-stat {
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.budget-stat span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9aa3b8);
  display: block;
}
.budget-stat strong {
  font-family: ui-monospace, monospace;
  font-size: 18px;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}
.budget-stat--in { border-left-color: #00d68f; }
.budget-stat--in strong { color: #00d68f; }
.budget-stat--out { border-left-color: #ff6b6b; }
.budget-stat--out strong { color: #ff6b6b; }
.budget-stat--net { border-left-color: #4cc9f0; }
.budget-stat--net strong { color: #4cc9f0; }

.budget-breakdown-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.budget-breakdown-grid h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9aa3b8);
  margin: 0 0 8px;
}
.budget-bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.budget-bar {
  display: grid; grid-template-columns: 100px 1fr 70px; gap: 8px; align-items: center;
  font-size: 12px;
}
.budget-bar-label { color: var(--muted, #9aa3b8); text-transform: capitalize; }
.budget-bar-track { height: 10px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; }
.budget-bar-track span { display: block; height: 100%; background: linear-gradient(90deg, #4cc9f0, #b794f4); }
.budget-bar-value { font-family: ui-monospace, monospace; text-align: right; }

/* Platforms (mini) + transactions */
.platform-mini {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}
.platform-mini--ok { border-left: 3px solid #00d68f; }
.platform-mini--error { border-left: 3px solid #ff6b6b; }
.platform-mini--no_key, .platform-mini--no_secret { border-left: 3px solid #a0aec0; opacity: 0.7; }
.platform-mini-name { font-size: 11px; text-transform: capitalize; color: var(--muted, #9aa3b8); letter-spacing: 0.04em; }
.platform-mini strong { font-family: ui-monospace, monospace; font-size: 15px; }
.platform-mini small { font-size: 10px; color: var(--muted, #9aa3b8); }
.finances-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }

.tx-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tx {
  display: grid;
  grid-template-columns: 90px 90px 100px 1fr 24px;
  gap: 8px; align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  background: rgba(255,255,255,0.02);
}
.tx-date { font-family: ui-monospace, monospace; color: var(--muted, #9aa3b8); font-size: 11px; }
.tx-amount { font-family: ui-monospace, monospace; }
.tx--income .tx-amount { color: #00d68f; }
.tx--expense .tx-amount { color: #ff6b6b; }
.tx-meta { font-size: 11px; color: var(--muted, #9aa3b8); text-transform: capitalize; }
.tx-note { color: var(--muted, #9aa3b8); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-delete {
  background: transparent; color: var(--muted, #9aa3b8);
  border: 0; cursor: pointer; font-size: 16px; padding: 0;
}

@media (max-width: 760px) {
  .ql-form { grid-template-columns: 1fr 1fr; }
  .ql-form button { grid-column: 1 / -1; }
  .budget-breakdown-grid { grid-template-columns: 1fr; }
  .tx { grid-template-columns: 70px 80px 1fr 20px; }
  .tx-note { display: none; }
}

/* === Legacy / deprecation banner === */
.legacy-banner {
  padding: 16px 18px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  color: var(--text, #e7eaf3);
}
.legacy-banner p { margin: 0; font-size: 14px; }
.legacy-banner a { color: #fbd38d; font-weight: 600; }

/* === Protocol (21-day habits page, ported from Claude artifact) === */
.protocol-section {
  --protocol-red:    #ff4757;
  --protocol-orange: #ff7849;
  --protocol-yellow: #ffd60a;
  --protocol-green:  #00d68f;
  --protocol-teal:   #2dd4bf;
  --protocol-blue:   #4cc9f0;
  --protocol-purple: #b794f4;
  --protocol-pink:   #f472b6;
  --protocol-surface: #121218;
  --protocol-surface-2: #1a1a22;
  --protocol-border: #25252f;
  --protocol-border-bright: #3a3a48;
  --protocol-text: #f5f5f7;
  --protocol-text-dim: #8e8e98;
  --protocol-text-faint: #5a5a64;
  --protocol-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color: var(--protocol-text);
}

.protocol-header {
  border: 1px solid var(--protocol-border);
  border-radius: 16px;
  padding: 24px 24px 20px;
  background: linear-gradient(135deg, var(--protocol-surface) 0%, rgba(76,201,240,0.04) 100%);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.protocol-header::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(0,214,143,0.08), transparent 70%);
  pointer-events: none;
}
.protocol-header-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.protocol-brand {
  font-family: var(--protocol-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--protocol-text-dim);
}
.protocol-brand::first-letter { color: var(--protocol-green); }
.protocol-day-counter {
  font-family: var(--protocol-mono);
  font-weight: 700;
  border: 1px solid var(--protocol-border-bright);
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--protocol-surface-2);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.protocol-day-counter .num { color: var(--protocol-yellow); font-size: 16px; }
.protocol-day-counter .total { color: var(--protocol-text-faint); }

.protocol-header h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.protocol-header h1 span { color: var(--protocol-green); }

.protocol-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.protocol-stat {
  border: 1px solid var(--protocol-border);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.015);
}
.protocol-stat .stat-label {
  font-family: var(--protocol-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--protocol-text-dim);
  margin-bottom: 4px;
}
.protocol-stat .stat-value {
  font-family: var(--protocol-mono);
  font-size: 20px;
  font-weight: 700;
}
.stat-value.red    { color: var(--protocol-red); }
.stat-value.green  { color: var(--protocol-green); }
.stat-value.yellow { color: var(--protocol-yellow); }
.stat-value.blue   { color: var(--protocol-blue); }

.protocol-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 10px;
}
.protocol-section-head h2 {
  font-family: var(--protocol-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--protocol-text-dim);
  text-transform: uppercase;
  margin: 0;
}
.protocol-section-head .badge {
  font-family: var(--protocol-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--protocol-text-faint);
  border: 1px solid var(--protocol-border);
  border-radius: 4px;
  padding: 3px 8px;
}

/* RHYTHM */
.rhythm-list {
  border: 1px solid var(--protocol-border);
  border-radius: 12px;
  background: var(--protocol-surface);
  overflow: hidden;
}
.rhythm-row {
  display: grid;
  grid-template-columns: 64px 14px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--protocol-border);
  cursor: pointer;
  transition: background .12s;
}
.rhythm-row:last-child { border-bottom: 0; }
.rhythm-row:hover { background: rgba(255,255,255,0.025); }
.rhythm-row.done { opacity: 0.5; }
.rhythm-row.done .rhythm-label { text-decoration: line-through; }
.rhythm-time {
  font-family: var(--protocol-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--protocol-text-dim);
  letter-spacing: 0.04em;
}
.rhythm-dot { width: 8px; height: 8px; border-radius: 50%; }
.rhythm-label { font-size: 14px; color: var(--protocol-text); }
.rhythm-tag {
  font-family: var(--protocol-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--protocol-text-faint);
  border: 1px solid var(--protocol-border);
  border-radius: 3px;
  padding: 2px 6px;
}

/* BATTLES */
.battles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.battle {
  border: 1px solid var(--protocol-border);
  border-radius: 12px;
  background: var(--protocol-surface);
  padding: 16px 18px;
  text-align: center;
}
.battle-name {
  font-family: var(--protocol-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--protocol-text-dim);
  margin-bottom: 8px;
}
.battle-count {
  font-family: var(--protocol-mono);
  font-size: 36px;
  font-weight: 800;
  color: var(--protocol-green);
  line-height: 1;
}
.battle-unit {
  font-family: var(--protocol-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--protocol-text-faint);
  margin: 4px 0 12px;
  text-transform: uppercase;
}
.battle-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.toggle-btn {
  font-family: var(--protocol-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 8px 0;
  background: transparent;
  border: 1px solid var(--protocol-border-bright);
  border-radius: 6px;
  color: var(--protocol-text-dim);
  cursor: pointer;
  transition: all .15s;
}
.toggle-btn:hover { color: var(--protocol-text); border-color: var(--protocol-text-dim); }
.toggle-btn.active-clean {
  background: rgba(0,214,143,0.18);
  border-color: var(--protocol-green);
  color: var(--protocol-green);
}
.toggle-btn.active-broken {
  background: rgba(255,71,87,0.18);
  border-color: var(--protocol-red);
  color: var(--protocol-red);
}

/* CRAVINGS */
.cravings-card {
  border: 1px solid var(--protocol-red);
  background: rgba(255,71,87,0.04);
  border-radius: 12px;
  padding: 16px 22px;
}
.cravings-steps {
  margin: 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.cravings-steps li { font-size: 13px; line-height: 1.5; }

/* 21-DAY HABIT TRACKER */
.habit-tracker-wrap {
  border: 1px solid var(--protocol-border);
  border-radius: 12px;
  background: var(--protocol-surface);
  padding: 12px;
  overflow-x: auto;
}
.habit-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--protocol-mono);
  font-size: 11px;
}
.habit-table th,
.habit-table td {
  padding: 4px;
  text-align: center;
  border: 1px solid var(--protocol-border);
}
.habit-table th {
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--protocol-text-dim);
  background: rgba(255,255,255,0.02);
}
.habit-table .label-col {
  text-align: left;
  padding: 6px 10px;
  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--protocol-text);
  min-width: 140px;
}
.habit-table .hit-col {
  font-weight: 600;
  color: var(--protocol-green);
  padding: 4px 10px;
}
.habit-cell {
  width: 22px; height: 22px;
  cursor: pointer;
  transition: background .12s;
}
.habit-cell:hover { background: rgba(255,255,255,0.06); }
.habit-cell.done { background: var(--protocol-green); }
.habit-cell.today { box-shadow: inset 0 0 0 1px var(--protocol-yellow); }

@media (max-width: 640px) {
  .protocol-header { padding: 18px 16px 14px; }
  .protocol-header h1 { font-size: 26px; }
  .protocol-stats { grid-template-columns: 1fr 1fr; }
  .rhythm-row { grid-template-columns: 50px 10px 1fr auto; padding: 8px 10px; gap: 8px; }
  .rhythm-label { font-size: 13px; }
  .rhythm-tag { font-size: 8px; padding: 1px 5px; }
  .battle-count { font-size: 28px; }
  .habit-table .label-col { min-width: 110px; font-size: 11px; }
  .habit-cell { width: 18px; height: 18px; }
}
