/* ── Tokens ───────────────────────────────────────── */
:root {
  --blue:       #007AFF;
  --blue-bg:    rgba(0, 122, 255, 0.08);
  --blue-text:  #0062CC;

  --text:       #1C1C1E;
  --text-2:     #6C6C70;
  --text-3:     #AEAEB2;

  --border:     rgba(0, 0, 0, 0.09);
  --surface:    #FFFFFF;
  --surface-2:  #F9F9F9;

  --rail-w:     154px;
  --ctx-w:      220px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius: 0.625rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

/* ── LOGIN ────────────────────────────────────────── */
.login {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(80% 55% at 50% 0%,  rgba(255,235,200,0.06) 0%, transparent 100%),
    radial-gradient(60% 70% at 18% 8%,  rgba(255,240,210,0.20) 0%, transparent 100%),
    radial-gradient(60% 70% at 37% 4%,  rgba(255,235,200,0.18) 0%, transparent 100%),
    radial-gradient(60% 70% at 63% 6%,  rgba(255,240,210,0.19) 0%, transparent 100%),
    radial-gradient(60% 70% at 82% 11%, rgba(255,235,200,0.17) 0%, transparent 100%),
    #060605;
}

.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
}

.login-brand {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}

.login-product {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.login-heading {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  color: #fff;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}

.field input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: var(--radius);
  padding: 0.6875rem 0.875rem;
  font-size: 0.9375rem;
  color: #fff;
  outline: none;
  transition: border-color 150ms var(--ease);
}

.field input:focus { border-color: rgba(255,255,255,0.35); }
.field input::placeholder { color: rgba(255,255,255,0.25); }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  color: #060605;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: opacity 150ms var(--ease);
}

.btn-primary:hover { opacity: 0.88; }

/* ── APP SHELL ────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── RAIL ─────────────────────────────────────────── */
.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  padding: 0 8px;
  height: 100%;
}

.rail-logo {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  flex-shrink: 0;
}

.rail-logo span {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-left: 4px;
  align-self: flex-end;
  margin-bottom: 2px;
}

.rail-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
  overflow-y: auto;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.625rem;
  border-radius: 0.5rem;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 120ms var(--ease), color 120ms var(--ease);
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
}

.rail-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.rail-item.is-active {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 600;
}

.rail-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-icon svg { width: 18px; height: 18px; }

.rail-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.rail-dipson {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 0.75rem;
  background: var(--blue);
  color: #fff;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 8px 0;
  transition: opacity 150ms var(--ease);
  flex-shrink: 0;
}

.rail-dipson:hover { opacity: 0.88; }
.rail-dipson svg { width: 14px; height: 14px; flex-shrink: 0; }

.rail-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 120ms var(--ease);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.rail-profile:hover { background: var(--surface-2); }

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-handle {
  font-size: 0.6875rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-more {
  color: var(--text-3);
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

/* ── CENTER ───────────────────────────────────────── */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.center-header {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.center-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.center-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* ── TODAY SCREEN ─────────────────────────────────── */
.today-section { margin-bottom: 2rem; }

.today-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.needs-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.needs-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  transition: background 120ms var(--ease);
}

.needs-item:hover { background: var(--surface-2); }

.needs-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.needs-icon svg { width: 16px; height: 16px; }

.needs-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.needs-action {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
  white-space: nowrap;
}

.needs-action:hover { background: var(--blue-bg); border-color: rgba(0,122,255,0.2); }

.next-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.next-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  transition: background 120ms var(--ease);
}

.next-item:hover { background: var(--surface-2); }

.next-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.next-icon svg { width: 16px; height: 16px; color: var(--text-2); }

.next-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.next-time {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.2;
  margin-top: 1px;
}

.empty-state {
  padding: 1.25rem 1rem;
  font-size: 0.875rem;
  color: var(--text-3);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 0.5rem;
}

.stub-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.stub-sub { font-size: 0.875rem; color: var(--text-3); }

/* ── CONTEXT PANEL ────────────────────────────────── */
.context-panel {
  width: var(--ctx-w);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 1.25rem 1rem;
  overflow-y: auto;
}

.ctx-program {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.ctx-badge {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ctx-program-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.ctx-program-sub  { font-size: 0.6875rem; color: var(--text-3); line-height: 1.2; }

.ctx-stat { margin-bottom: 1.25rem; }

.ctx-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.ctx-kr-wrap { display: flex; align-items: center; gap: 0.75rem; }
.kr-ring-svg { width: 44px; height: 44px; }
.kr-num { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.04em; line-height: 1; }
.kr-unit { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

.ctx-stat-value { font-size: 1.125rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em; line-height: 1; }
.ctx-stat-note  { font-size: 0.8125rem; color: var(--text-2); line-height: 1.4; }
.ctx-divider    { height: 1px; background: var(--border); margin: 0 0 1.25rem; }

/* ── PROFILE SCREEN ───────────────────────────────── */
.profile-screen {
  padding: 1.5rem;
}

.profile-hub {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.profile-hub-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-hub-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.profile-hub-handle {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 2px;
}

.profile-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.625rem;
}

.profile-hub-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--blue-bg);
  cursor: pointer;
  transition: background 120ms var(--ease);
}

.profile-hub-card:hover { background: rgba(0,122,255,0.13); }

.profile-hub-card-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--blue);
}

.profile-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.profile-tile {
  background: var(--surface);
  padding: 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 120ms var(--ease);
  min-height: 52px;
}

.profile-tile:hover { background: var(--surface-2); }

.profile-tile-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

/* ── CONTEXT TILE GRID ────────────────────────────── */
.ctx-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}

.ctx-tile {
  aspect-ratio: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms var(--ease);
}

.ctx-tile:hover { background: var(--surface-2); }

.ctx-tile-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

.ctx-tile:hover .ctx-tile-label { color: var(--text); }

/* make program row in menu clickable */
a.pm-program-row {
  display: block;
  transition: background 120ms var(--ease);
}
a.pm-program-row:hover { background: var(--surface-2); }

/* ── PROFILE MENU ─────────────────────────────────── */
.profile-menu {
  position: fixed;
  left: 8px;
  bottom: 60px;
  width: calc(var(--rail-w) - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  overflow: hidden;
  display: none;
}

.profile-menu.is-open { display: block; }

.pm-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: background 120ms var(--ease);
}

.pm-user:hover { background: var(--surface-2); }

.pm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pm-user-info { flex: 1; min-width: 0; }
.pm-name  { font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-email { font-size: 0.6875rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-ext   { color: var(--text-3); flex-shrink: 0; }
.pm-ext svg { width: 12px; height: 12px; }

.pm-section-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.625rem 0.875rem 0.25rem;
}

.pm-program-row { padding: 0.5rem 0.875rem 0.75rem; border-bottom: 1px solid var(--border); }
.pm-program-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.pm-program-sub  { font-size: 0.6875rem; color: var(--text-3); line-height: 1.4; }

.pm-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-2);
  transition: background 120ms var(--ease), color 120ms var(--ease);
  text-align: left;
}

.pm-action:hover { background: var(--surface-2); color: var(--text); }
.pm-action svg { width: 14px; height: 14px; flex-shrink: 0; }
.pm-action.is-danger { color: #FF3B30; }
.pm-action.is-danger:hover { background: rgba(255,59,48,0.06); color: #FF3B30; }

/* ── SVG ICON SIZING ─────────────────────────────────── */
.rail-icon svg { width: 18px; height: 18px; flex-shrink: 0; }
.rail-dipson svg { width: 14px; height: 14px; flex-shrink: 0; }
.needs-icon svg { width: 16px; height: 16px; flex-shrink: 0; }
.next-icon svg  { width: 16px; height: 16px; flex-shrink: 0; }
.pm-ext svg    { width: 12px; height: 12px; flex-shrink: 0; }
.profile-chevron {
  margin-left: auto;
  color: var(--text-3);
  display: flex;
  align-items: center;
}
.profile-chevron svg { width: 14px; height: 14px; }

/* ── STAT STRIP ───────────────────────────────────────── */
.stat-strip {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.75rem;
}
.stat-item {
  flex: 1;
  padding: 1rem 1.25rem;
}
.stat-item + .stat-item {
  border-left: 1px solid var(--border);
}
.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.375rem;
}
.stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.stat-delta {
  font-size: 0.75rem;
  font-weight: 500;
}
.stat-delta.is-pos { color: #34C759; }
.stat-delta.is-neg { color: #FF3B30; }

/* ── CALM EMPTY STATE ─────────────────────────────────── */
.calm-empty {
  font-size: 0.875rem;
  color: var(--text-3);
  padding: 0.25rem 0;
}

/* ── BRANDS PANEL ─────────────────────────────────────── */
.ctx-panel-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.375rem;
  border-radius: 0.5rem;
  text-align: left;
  transition: background 120ms var(--ease);
  margin-bottom: 2px;
}
.brand-row:hover { background: var(--surface-2); }
.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-info { flex: 1; min-width: 0; }
.brand-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-mode { font-size: 0.6875rem; color: var(--text-3); }
.brand-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.brand-create {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--blue);
  transition: color 120ms var(--ease);
}
.brand-create:hover { color: var(--blue-text); }
.brand-create svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── BRAND HEADER CARD (Athletics rail) ──────────── */
.brand-header-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  text-align: left;
  transition: background 120ms var(--ease);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.brand-header-card:hover { background: var(--surface-2); }

.brand-header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-header-info { flex: 1; min-width: 0; }
.brand-header-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.brand-header-mode {
  font-size: 0.6875rem;
  color: var(--text-3);
  line-height: 1.2;
}
.brand-header-chevron { color: var(--text-3); display: flex; align-items: center; flex-shrink: 0; }
.brand-header-chevron svg { width: 13px; height: 13px; }

/* ── BRAND SWITCHER ───────────────────────────────── */
.brand-switcher-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms var(--ease);
}
.brand-switcher-overlay.is-open { opacity: 1; pointer-events: auto; }

.brand-switcher-panel {
  position: absolute;
  left: 8px;
  top: 104px;
  width: calc(var(--rail-w) - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
}

.brand-switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.brand-switcher-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.brand-switcher-close {
  color: var(--text-3);
  font-size: 0.8125rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 120ms var(--ease);
}
.brand-switcher-close:hover { background: var(--surface-2); color: var(--text); }

.brand-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-align: left;
  transition: background 120ms var(--ease);
}
.brand-switcher-item:hover { background: var(--surface-2); }

.brand-switcher-personal {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--blue);
  border-top: 1px solid var(--border);
  transition: background 120ms var(--ease);
}
.brand-switcher-personal:hover { background: var(--blue-bg); }
.brand-switcher-personal svg { width: 13px; height: 13px; }

/* ── KSUITE DRAWER ────────────────────────────────── */
.ksuite-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 16px rgba(0,0,0,0.08);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 220ms var(--ease);
  display: flex;
  flex-direction: column;
  padding: 0 8px;
}
.ksuite-drawer.is-open { transform: translateX(0); }

.ksuite-drawer-head {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 0 8px;
}
.ksuite-drawer-close {
  color: var(--text-3);
  font-size: 0.8125rem;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 120ms var(--ease);
}
.ksuite-drawer-close:hover { background: var(--surface-2); color: var(--text); }

.ksuite-drawer-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 0.625rem;
  margin-bottom: 4px;
  flex-shrink: 0;
}

/* ── DIPSON SURFACE (home) ────────────────────────── */
.dipson-surface {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(3rem, 14vh, 7rem);
  padding-bottom: 2rem;
  text-align: center;
}

.dipson-mark {
  width: 52px;
  height: 52px;
  background: var(--blue-bg);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}
.dipson-mark svg { width: 26px; height: 26px; }
.dipson-mark img { width: 32px; height: 32px; object-fit: contain; }

.dipson-greeting {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.dipson-sub {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

.dipson-proactive {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1.25rem;
  width: 100%;
  max-width: 440px;
  text-align: left;
}

.dipson-proactive-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.4;
}

.dipson-proactive-action {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
  transition: color 120ms var(--ease);
}
.dipson-proactive-action:hover { color: var(--blue-text); }

/* shared input row */
.dipson-form { width: 100%; max-width: 440px; margin-bottom: 0.875rem; }

.dipson-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.4375rem 0.4375rem 0.4375rem 1.125rem;
  gap: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.dipson-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

.dipson-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--text);
  min-width: 0;
}
.dipson-input::placeholder { color: var(--text-3); }

.dipson-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 150ms var(--ease);
}
.dipson-send:hover { opacity: 0.85; }
.dipson-send svg { width: 14px; height: 14px; }

.dipson-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 440px;
  margin-bottom: 1.5rem;
}

.dipson-chip {
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-2);
  background: transparent;
  transition: border-color 120ms var(--ease), color 120ms var(--ease);
}
.dipson-chip:hover { border-color: var(--blue); color: var(--blue); }

/* shared thread */
.dipson-thread {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  max-width: 440px;
  overflow-y: auto;
}

/* home thread can grow */
#dipson-home-thread { max-height: 40vh; }

.dipson-msg {
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.625rem 0.875rem;
  border-radius: 0.875rem;
  text-align: left;
}

.dipson-msg-user {
  background: var(--blue-bg);
  color: var(--blue-text);
  align-self: flex-end;
  max-width: 85%;
}

.dipson-msg-reply {
  background: var(--surface-2);
  color: var(--text);
  align-self: flex-start;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.dipson-msg-mark { flex-shrink: 0; color: var(--blue); display: flex; align-items: center; }
.dipson-msg-mark svg { width: 13px; height: 13px; margin-top: 2px; }

.dipson-msg-loading {
  background: var(--surface-2);
  color: var(--text-3);
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dipson-msg-loading svg { width: 13px; height: 13px; color: var(--blue); }

/* ── DIPSON FAB ───────────────────────────────────── */
.dipson-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,122,255,0.32), 0 1px 4px rgba(0,0,0,0.12);
  z-index: 90;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}
.dipson-fab:hover { opacity: 0.9; transform: scale(1.06); }
.dipson-fab svg { width: 22px; height: 22px; }
.dipson-fab img { width: 26px; height: 26px; object-fit: contain; }
.dipson-fab.is-hidden { opacity: 0; pointer-events: none; transform: scale(0.85); }

/* ── DIPSON PANEL (non-home right drawer) ─────────── */
.dipson-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--ctx-w);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  z-index: 110;
  transform: translateX(100%);
  transition: transform 220ms var(--ease);
}
.dipson-panel.is-open { transform: translateX(0); }

.dipson-panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  height: 52px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dipson-panel-mark {
  width: 26px;
  height: 26px;
  background: var(--blue-bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}
.dipson-panel-mark svg { width: 13px; height: 13px; }
.dipson-panel-mark img { width: 16px; height: 16px; object-fit: contain; }

.dipson-panel-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.dipson-panel-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-3);
  font-size: 0.8125rem;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.dipson-panel-close:hover { background: var(--surface-2); color: var(--text); }

.dipson-panel-thread {
  flex: 1;
  max-width: none;
  padding: 1rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.dipson-panel-form {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
