/* Tie-dye ambient + crabilouse glass — bensguide v3 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #030305;
  --text: #f4f4f6;
  --muted: rgba(255,255,255,0.62);
  --dim: rgba(255,255,255,0.38);
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.11);
  --accent: #a8b4ff;
  --accent-soft: rgba(168,180,255,0.14);
  --lavender: #c4b5fd;
  --lavender-soft: rgba(196,181,253,0.14);
  --ok: #7dffb8;
  --ok-soft: rgba(125,255,184,0.12);
  --mind: #c4a1ff;
  --mind-soft: rgba(196,161,255,0.12);
  --body: #ffb86c;
  --body-soft: rgba(255,184,108,0.12);
  --social: #7ec8ff;
  --social-soft: rgba(126,200,255,0.12);
  --create: #ff7eb3;
  --create-soft: rgba(255,126,179,0.12);
  --glass-bg: rgba(8, 8, 16, 0.48);
  --glass-blur: blur(48px) saturate(1.65);
  --glass-highlight: rgba(255,255,255,0.1);
  --font: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tray-h: clamp(50px, 9vw, 58px);
  --sidebar-w: clamp(220px, 24vw, 268px);
  --bottom-nav-h: 58px;
  --radius: clamp(12px, 2vw, 18px);
  --card-w: clamp(148px, 40vw, 210px);
  --scrollbar-track: rgba(255, 255, 255, 0.04);
  --scrollbar-thumb: rgba(196, 181, 253, 0.32);
  --scrollbar-thumb-hover: rgba(168, 180, 255, 0.52);
  --ui-scale: 1.1;
}

html { font-size: clamp(13px, 1.55vw, 15px); -webkit-text-size-adjust: 100%; }
html, body {
  min-height: 100%;
  height: auto;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.page-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(0.45rem, 1.1vw, 1rem) 1.5rem;
  box-sizing: border-box;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-corner { background: transparent; }

/* Tie-dye moving gradient under glass */
.ambient-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.tie-dye {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 45% 35% at 20% 30%, rgba(140,160,255,0.32), transparent 55%),
    radial-gradient(ellipse 40% 45% at 75% 25%, rgba(180,150,255,0.3), transparent 50%),
    radial-gradient(ellipse 50% 40% at 60% 75%, rgba(255,126,179,0.28), transparent 55%),
    radial-gradient(ellipse 35% 50% at 15% 80%, rgba(255,184,108,0.25), transparent 50%),
    radial-gradient(ellipse 42% 38% at 85% 55%, rgba(126,200,255,0.22), transparent 52%);
  filter: blur(60px);
  animation: tieDyeDrift 28s ease-in-out infinite alternate;
}
.tie-dye-2 {
  animation-duration: 36s;
  animation-direction: alternate-reverse;
  opacity: 0.7;
  transform: rotate(15deg);
}
@keyframes tieDyeDrift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(-4%, 3%) rotate(2deg) scale(1.05); }
  66% { transform: translate(3%, -2%) rotate(-1deg) scale(0.98); }
  100% { transform: translate(-2%, 4%) rotate(1deg) scale(1.02); }
}
.ambient-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.2; mix-blend-mode: screen; }
.ambient-glass {
  position: absolute; inset: 0;
  background: linear-gradient(165deg, rgba(3,3,8,0.25) 0%, rgba(3,3,10,0.55) 45%, rgba(2,2,6,0.72) 100%);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.human { font-size: 0.92rem; line-height: 1.5; color: var(--muted); }

/* Glass */
.glass-bar, .glass-panel, .liquid-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-strong);
}
.liquid-glass {
  position: relative;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 1px 0 var(--glass-highlight);
}
.liquid-glass::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(145deg, rgba(255,255,255,0.14), transparent 40%, rgba(255,255,255,0.06));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.glass-panel { border-radius: 20px; padding: 0.85rem; }
.glass-inset {
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
}
.glass-input {
  width: 100%; background: rgba(0,0,0,0.35); border: 1px solid var(--border);
  border-radius: 10px; padding: calc(0.7rem * var(--ui-scale)) calc(0.9rem * var(--ui-scale)); color: var(--text); font: inherit; margin-top: 0.5rem;
}
.glass-btn {
  font: inherit; color: var(--text); border: 1px solid var(--border);
  background: rgba(255,255,255,0.06); cursor: pointer; border-radius: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.glass-btn:hover { background: rgba(255,255,255,0.11); border-color: var(--border-strong); }
.glass-btn:active { transform: scale(0.98); }
.pill { font-size: calc(0.78rem * var(--ui-scale)); padding: calc(0.42rem * var(--ui-scale)) calc(0.85rem * var(--ui-scale)); border-radius: 999px; }
.pill.accent { background: var(--lavender-soft); border-color: rgba(196,181,253,0.35); color: var(--lavender); }
.pill.mind { background: var(--mind-soft); border-color: rgba(196,161,255,0.3); color: var(--mind); }
.pill.body { background: var(--body-soft); border-color: rgba(255,184,108,0.3); color: var(--body); }
.pill.warn { background: rgba(255,120,100,0.12); border-color: rgba(255,120,100,0.3); color: #ff9a8b; }

.page-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }

/* Phase badges */
.phase {
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.12rem 0.38rem; border-radius: 4px; text-transform: uppercase;
  flex-shrink: 0;
}
.phase.p1 { background: var(--ok-soft); color: var(--ok); }
.phase.p2 { background: var(--mind-soft); color: var(--mind); }
.phase.p3 { background: rgba(255,255,255,0.08); color: var(--dim); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.mock,
.status-dot.active { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.planned { background: var(--dim); }
.status-dot.partial { background: #fbbf24; }

/* Tray — in page flow; scrolls away by default (Round G) */
.tray-bar {
  position: relative;
  z-index: 50;
  display: flex; align-items: center; gap: clamp(0.4rem, 2vw, 0.85rem);
  padding: 0.4rem clamp(0.6rem, 2vw, 1rem);
  margin-bottom: 0.45rem;
  border-radius: var(--radius);
  min-height: var(--tray-h);
}
body.bar-scroll-away .tray-bar { position: relative; }
body.bar-sticky-up .tray-bar { position: sticky; top: 0; z-index: 50; }
body.bar-os-only .tray-bar { display: none; }
body.bar-slim .tray-bar {
  position: sticky;
  top: 0;
  z-index: 55;
  min-height: 40px;
  padding: 0.25rem 0.55rem;
  margin-bottom: 0.35rem;
  border-radius: 0 0 var(--radius) var(--radius);
}
body.bar-slim .tray-meta,
body.bar-slim .tray-last { display: none !important; }
body.bar-slim .logo-btn { font-size: 0.82rem; }
body.bar-slim .capture-chip { font-size: 0.62rem; padding: 0.28rem 0.5rem; }
body.bar-slim .icon-btn.round { width: 28px; height: 28px; }
body.bar-slim .main-hdr { padding: 0.5rem 0.75rem; margin-bottom: 0.35rem; }
body.bar-slim .view-desc { display: none; }

body.layout-scroll-together .sidebar {
  max-height: none;
  overflow: visible;
}
.tray-brand { flex-shrink: 0; }
.logo-btn { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.02em; }
.tray-meta { display: block; font-size: 0.62rem; color: var(--dim); }
.tray-capture {
  display: flex; flex: 1; align-items: center; gap: 0.45rem; min-width: 0; overflow: hidden;
}
.tray-nav { display: flex; flex-wrap: nowrap; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.tray-nav::-webkit-scrollbar { display: none; }
.tray-nav-chip {
  font-size: 1rem; padding: 0.4rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.2);
  color: var(--muted); cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.tray-nav-chip:hover { border-color: var(--lavender); color: var(--text); background: var(--lavender-soft); }
.tray-moment {
  display: flex; align-items: center; gap: 0.4rem; flex: 1; min-width: 0;
  padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.25); cursor: pointer; font-size: 1rem; text-align: left;
}
.tray-moment:hover { border-color: var(--lavender); }
.tray-moment-label { color: var(--lavender); font-size: 0.78rem; text-transform: uppercase; flex-shrink: 0; }
.tray-moment-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tray-moment-go { color: var(--dim); flex-shrink: 0; }
.feel-tabs { margin-bottom: 0.65rem; }
.emotion-scale-panel { margin-top: 0.65rem; }
.scale-panel-inner { padding: 0.85rem; }
.scale-drag-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.emotion-range { flex: 1; accent-color: var(--lavender); }
.scale-out { font-weight: 600; min-width: 1.5rem; text-align: center; }
.feeling-log-recent { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.log-chip {
  font-size: 0.62rem; padding: 0.2rem 0.45rem; border-radius: 999px;
  background: var(--chip, var(--lavender-soft)); border: 1px solid var(--chip, var(--glass-border));
}

  flex: 1; display: flex; gap: 0.3rem; overflow-x: auto; scrollbar-width: none; min-width: 0;
}
.tray-capture::-webkit-scrollbar { display: none; }
.capture-chip {
  flex-shrink: 0; font: inherit; font-size: 0.7rem; font-weight: 500;
  padding: 0.38rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); cursor: pointer;
}
.tray-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.lock-pill { font-size: 0.62rem; color: var(--dim); }
.lock-pill.unlocked { color: var(--ok); }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.icon-btn.round {
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Shell — one page scroll, no trapped height */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: auto;
  min-height: min(72vh, 680px);
  padding: 0;
  gap: 0.65rem;
}
body.layout-sidebar-sticky .sidebar {
  position: sticky;
  top: 0.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 1rem);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column; gap: 0.1rem;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-head { margin-bottom: 0.35rem; padding: 0 0.25rem; }
.sidebar-sub { font-size: 0.72rem; color: var(--dim); margin-top: 0.1rem; }
.nav-block { margin-top: 0.5rem; }
.nav-grow { flex: 1; }
.nav-heading {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--dim); padding: 0 0.45rem; margin-bottom: 0.2rem;
}
.nav-link {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.4rem;
  width: 100%; text-align: left; font: inherit; font-size: 0.8rem;
  padding: 0.42rem 0.5rem; border: none; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: all 0.12s var(--ease);
}
.nav-ico { display: flex; align-items: center; flex-shrink: 0; opacity: 0.72; color: inherit; }
.nav-link.active .nav-ico { opacity: 1; color: var(--lavender); }
.nav-link .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link .phase { flex-shrink: 0; margin-left: auto; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--lavender); background: var(--lavender-soft); }
.nav-link.sub { padding-left: 1rem; font-size: 0.74rem; }
.sidebar-legend {
  margin-top: auto; padding: 0.65rem 0.45rem 0;
  border-top: 1px solid var(--border); font-size: 0.6rem; line-height: 1.55; color: var(--dim);
}
.legend-row { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.2rem; }

/* Main */
.main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  border-radius: 20px; overflow: visible;
}
.main-hdr {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: clamp(0.7rem, 2vw, 1rem); margin-bottom: 0.45rem; border-radius: var(--radius); flex-shrink: 0;
}
.view-title { font-size: clamp(1.05rem, 2.5vw, 1.3rem); font-weight: 600; letter-spacing: -0.02em; }
.view-desc { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; max-width: min(48ch, 100%); line-height: 1.45; }
.hdr-actions { display: flex; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.panel {
  display: none; flex: 1; min-height: 0;
  overflow: visible;
  padding: 0 clamp(0.45rem, 2vw, 0.75rem) 1rem;
  animation: fadeIn 0.3s var(--ease);
}
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Section blocks inside panels */
.section-block { margin-bottom: 1.25rem; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.65rem; flex-wrap: wrap;
}
.section-head h3 { font-size: 0.88rem; font-weight: 600; }
.section-head .human { font-size: 0.78rem; margin-top: 0.15rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: clamp(0.55rem, 2vw, 0.75rem);
}
.wide-card { padding: clamp(0.9rem, 2.5vw, 1.15rem); }
.span-2 { grid-column: 1 / -1; }

/* Human feel / mind vs body */
.feel-card { padding: 1rem; }
.feel-card.mind { border-left: 3px solid var(--mind); }
.feel-card.body { border-left: 3px solid var(--body); }
.feel-card.social { border-left: 3px solid var(--social); }
.feel-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.feel-card.mind .feel-label { color: var(--mind); }
.feel-card.body .feel-label { color: var(--body); }
.feel-card.social .feel-label { color: var(--social); }
.feel-words { font-size: 1.05rem; font-weight: 500; margin-bottom: 0.25rem; }
.feel-data { font-size: 0.75rem; color: var(--dim); }
.feel-data strong { color: var(--muted); font-weight: 500; }

.resource-card { padding: 1rem; }
.resource-card h4 { font-size: 0.85rem; margin-bottom: 0.35rem; }
.resource-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

/* Master control overview */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.status-tile { padding: 0.85rem 1rem; }
.status-tile .tile-top { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.35rem; }
.status-tile .tile-title { font-size: 0.78rem; font-weight: 500; }
.status-tile .tile-val { font-size: 0.85rem; color: var(--muted); }
.status-tile .tile-val.ok { color: var(--ok); }
.status-tile .tile-val.warn { color: #ff9a8b; }
td.warn { color: #ff9a8b; }

.dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.55rem;
}
.dev-card { padding: 0.85rem 1rem; }
.dev-card h4 { font-size: 0.85rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.4rem; }
.dev-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dev-actions .glass-btn { font-size: 0.82rem; padding: 0.5rem 0.78rem; }
.dev-path {
  font-family: ui-monospace, monospace; font-size: 0.65rem;
  color: var(--dim); word-break: break-all;
  margin: 0.5rem 0; padding: 0.45rem; background: rgba(0,0,0,0.3); border-radius: 6px;
}

/* Roadmap — panel-roadmap-full must only show when active */
.panel.panel-roadmap-full.active { display: block; }
/* Roadmap */
.roadmap { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }
.roadmap-intro { margin-bottom: 0.5rem; max-width: 72ch; }
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  width: 100%;
}
.phase-block { padding: 1rem; }
.phase-block-wide { min-height: 0; }
.phase-block-head { margin-bottom: 0.65rem; }
.phase-block h4 { font-size: 0.9rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.phase-progress {
  height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06);
  margin: 0.5rem 0 0.25rem; overflow: hidden;
}
.phase-progress-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--ok), var(--lavender));
  transition: width 0.35s var(--ease);
}
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.feature-list-compact { gap: 0.28rem; max-height: min(52vh, 520px); overflow-y: auto; }
.feature-list li {
  display: grid; grid-template-columns: auto auto 1fr; align-items: start; gap: 0.45rem;
  font-size: 0.78rem; color: var(--muted); line-height: 1.4;
}
.feature-list li span:last-child { flex: 1; }
.feat-status { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.feat-done span:last-child { color: var(--text); }
.status-dot.progress { background: #ffb86c; box-shadow: 0 0 6px rgba(255,184,108,0.45); }

/* Timeline horizontal — display only set via .active */
.panel.panel-timeline-full.active { display: flex; flex-direction: column; }
.panel-timeline-full { min-height: min(82vh, 920px); }
.timeline-head { margin-bottom: 0.65rem; flex-shrink: 0; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.45rem; }
.timeline-legend .leg::before {
  content: ''; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  margin-right: 0.3rem; vertical-align: middle;
}
.timeline-legend .leg.mind::before { background: var(--mind); }
.timeline-legend .leg.body::before { background: var(--body); }
.timeline-legend .leg.create::before { background: var(--create); }
.timeline-legend .leg.calendar::before { background: var(--lavender); }
.timeline-legend .leg.session::before { background: var(--social); }
/* ===== Timeline swim-lane ===== */
.timeline-mount { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Swim container — outer clips, inner scrolls both axes */
.tl-swim {
  display: flex; flex-direction: column;
  overflow-x: auto; overflow-y: auto;
  flex: 1; min-height: min(72vh, 820px);
  scrollbar-width: thin;
}

/* Header row: sticky corner + day labels */
.tl-swim-head {
  display: flex; flex-direction: row; align-items: stretch;
  position: sticky; top: 0; z-index: 4;
}
.tl-corner {
  flex-shrink: 0; width: clamp(100px, 9vw, 140px);
  position: sticky; left: 0; z-index: 5;
  padding: 0.45rem 0.5rem; font-size: 0.7rem;
  border-radius: 0; display: flex; align-items: center;
}
.tl-day-headers { display: flex; }
.tl-day-head {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); padding: 0.55rem 0.45rem;
  border-left: 1px solid var(--border);
  background: rgba(6,6,10,0.85);
  backdrop-filter: blur(12px);
  letter-spacing: 0.04em;
}

/* Body rows */
.tl-swim-body { display: flex; flex-direction: column; flex: 1; }
.tl-track-row { display: flex; flex-direction: row; align-items: stretch; border-top: 1px solid var(--border); }
.tl-track-label {
  flex-shrink: 0; width: clamp(100px, 9vw, 140px);
  position: sticky; left: 0; z-index: 3;
  padding: 0.55rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.15rem;
  border-radius: 0; font-size: 0.78rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
}
.tl-track-ico { font-size: 1rem; line-height: 1; }
.tl-track-name { font-size: 0.68rem; color: var(--dim); line-height: 1.3; }
.tl-track-cells { display: flex; flex-direction: row; }
.tl-cell {
  flex-shrink: 0; min-height: clamp(72px, 10vh, 140px);
  padding: 0.4rem 0.35rem; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.tl-cell-empty { font-size: 0.7rem; align-self: center; opacity: 0.35; }

/* Timeline cards */
.tl-card {
  padding: 0.45rem 0.5rem; font-size: 0.78rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  position: relative;
}
.tl-card-create { border-color: rgba(125,255,184,0.3); }
.tl-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.3rem; }
.tl-card-kind { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.tl-del {
  background: none; border: none; color: var(--dim); cursor: pointer;
  font-size: 0.75rem; padding: 0.1rem 0.25rem; border-radius: 4px; opacity: 0;
  transition: opacity 0.1s;
}
.tl-card:hover .tl-del { opacity: 1; }
.tl-del:hover { color: #ff9a8b; }
.tl-card-words { font-size: 0.82rem; line-height: 1.35; margin: 0; }
.tl-card-time { font-size: 0.65rem; }
.tl-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }

/* Empty state */
.tl-empty-state {
  padding: clamp(1.5rem, 4vw, 3rem); text-align: center; margin: auto;
  max-width: min(600px, 95%);
}
.tl-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.tl-empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.tl-empty-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.time-group { display: flex; flex-direction: column; flex-shrink: 0; }
.time-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--dim); margin-bottom: 0.55rem;
}
.time-group.today .time-label { color: var(--ok); }
.timeline-track { display: flex; gap: clamp(0.45rem, 2vw, 0.7rem); }
.timeline-card {
  width: var(--card-w); flex-shrink: 0; padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.timeline-card.featured { border-color: rgba(125,255,184,0.3); }
.card-type { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.card-type.mind { color: var(--mind); }
.card-type.body { color: var(--body); }
.card-type.create { color: var(--create); }
.timeline-card h3 { font-size: 0.92rem; font-weight: 600; }
.timeline-card p { font-size: 0.76rem; color: var(--muted); }
.scroll-hint { text-align: center; font-size: 0.68rem; padding: 0.25rem; color: var(--dim); }

/* Graph, search, tables */
.graph-stage { min-height: 300px; padding: 1rem; display: flex; align-items: center; justify-content: center; }
.graph-svg { width: 100%; max-width: 720px; }
.edge { stroke: rgba(255,255,255,0.1); stroke-width: 1.5; }
.g-node circle { fill: rgba(6,6,10,0.9); stroke: rgba(255,255,255,0.2); stroke-width: 1.5; }
.g-node.hub circle { stroke: var(--lavender); fill: var(--lavender-soft); filter: drop-shadow(0 0 12px rgba(196,181,253,0.45)); }
.g-node.pinned circle { stroke: var(--accent); filter: drop-shadow(0 0 8px rgba(168,180,255,0.35)); }
.g-node text { fill: var(--text); font-size: 9px; text-anchor: middle; font-family: var(--font); }

/* Dynamic graph (guide_link) */
.graph-stage { min-height: 320px; }
.edge-own { stroke: rgba(255,255,255,0.05); stroke-dasharray: 3 4; }
.edge-real { stroke: var(--accent); stroke-width: 1.6; opacity: 0.55; }
.edge-real.active { opacity: 1; stroke-width: 2.4; filter: drop-shadow(0 0 5px var(--accent-soft)); }
.graph-node { cursor: pointer; transition: opacity 0.18s var(--ease); }
.graph-node circle {
  fill: hsl(var(--nhue) 60% 16%); stroke: hsl(var(--nhue) 80% 65%); stroke-width: 1.5;
  transition: r 0.15s var(--ease);
}
.graph-node:hover circle { stroke-width: 2.5; }
.graph-node.sel circle { stroke-width: 3; filter: drop-shadow(0 0 8px hsl(var(--nhue) 80% 65% / 0.5)); }
.graph-node.dim { opacity: 0.25; }
.link-del { color: var(--dim); }
.link-del:hover { color: var(--create); }

/* ===== Journal full-height layout ===== */
.panel.panel-journal-full.active { display: flex; flex-direction: column; }
.panel-journal-full { min-height: min(80vh, 900px); }
.journal-layout {
  display: grid;
  grid-template-columns: clamp(260px, 35%, 500px) 1fr;
  gap: clamp(0.65rem, 1.5vw, 1.25rem);
  flex: 1; min-height: 0;
}
.journal-compose-col { display: flex; flex-direction: column; height: 100%; min-height: min(70vh, 800px); }
.journal-textarea {
  flex: 1; min-height: min(55vh, 640px) !important;
  font-family: 'Georgia', 'Iowan Old Style', serif;
  font-size: 1rem; line-height: 28px;
  padding: 8px 14px 8px 46px;
  resize: vertical;
  background-color: rgba(20, 18, 28, 0.55);
  background-image:
    linear-gradient(90deg, transparent 36px, rgba(255, 126, 179, 0.28) 36px, rgba(255, 126, 179, 0.28) 38px, transparent 38px),
    repeating-linear-gradient(transparent, transparent 27px, rgba(255, 255, 255, 0.08) 27px, rgba(255, 255, 255, 0.08) 28px);
  background-attachment: local;
}
.journal-list-col { display: flex; flex-direction: column; min-height: 0; }
.journal-list-scroll { flex: 1; overflow-y: auto; max-height: min(80vh, 900px); display: flex; flex-direction: column; gap: 0.5rem; }
.journal-day-head { display: flex; align-items: center; gap: 0.5rem; }
.journal-entries { padding: 0.5rem 0; display: flex; flex-direction: column; gap: 0.65rem; }
.journal-entry-row { padding: 0.5rem 0.5rem 0.5rem 0.9rem; border-left: 2px solid rgba(255,126,179,0.3); }
.journal-entry-time { margin-bottom: 0.2rem; }
.journal-mood-tag {
  font-size: 0.62rem; padding: 0.15rem 0.4rem; border-radius: 999px;
  background: rgba(196,181,253,0.15); color: var(--lavender); margin-left: 0.35rem;
}
.journal-entry-text { font-family: 'Georgia', serif; font-size: 0.96rem; line-height: 1.65; }
@media (max-width: 700px) {
  .journal-layout { grid-template-columns: 1fr; }
  .journal-list-col { max-height: 40vh; }
}

/* ===== Body & meds ===== */
.body-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(0.65rem, 1.5vw, 1.15rem);
}
.med-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.35rem; }
.med-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.55rem 0.65rem;
}
.med-item.med-taken { opacity: 0.65; }
.med-item-info { flex: 1; min-width: 0; }
.med-item-info strong { display: block; font-size: 0.9rem; }
.med-item-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.med-check { font-size: 0.82rem; color: var(--ok); font-weight: 500; }
.med-today-log { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.35rem; }

/* ===== People grid ===== */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 0.55rem; }
.person-card { padding: 0.65rem 0.75rem; }
.person-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.person-toggle { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 0.1rem 0.3rem; }
.person-id { flex: 1; min-width: 0; }
.person-id strong { display: block; font-size: 0.9rem; }
.person-last { font-size: 0.72rem; flex-shrink: 0; }
.person-last.warn { color: #ffb86c; }
.person-last.ok { color: var(--ok); }
.person-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.person-detail { margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
.person-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0.4rem; }
.person-field { display: flex; flex-direction: column; gap: 0.2rem; }
.person-field .glass-input { font-size: 0.9rem; }
.person-history { margin-top: 0.65rem; }
.person-event-list { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.35rem; max-height: 14rem; overflow-y: auto; }
.person-remove { color: var(--dim); font-size: 0.8rem; }
.person-remove:hover { color: #ff9a8b; }

/* ===== Habits layout ===== */
.habits-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.65rem, 1.5vw, 1.15rem);
}
.tracker-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.35rem; }
.tracker-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.55rem 0.65rem;
}
.tracker-info { flex: 1; min-width: 0; }
.tracker-info strong { display: block; font-size: 0.88rem; }
.tracker-controls { display: flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.toggle-label { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; font-size: 0.82rem; }
@media (max-width: 760px) {
  .habits-layout { grid-template-columns: 1fr; }
}

/* ===== Faith layout ===== */
.faith-layout {
  display: grid;
  grid-template-columns: clamp(260px, 38%, 460px) 1fr;
  gap: clamp(0.65rem, 1.5vw, 1.25rem);
  margin-top: 0.5rem;
}
.faith-compose { padding: 1rem; }
.faith-list-col { overflow-y: auto; max-height: min(75vh, 820px); }
.faith-entry-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.faith-type-badge {
  font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 999px;
  background: rgba(196,181,253,0.15); color: var(--lavender);
}
.plan-item { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.25rem; }
.plan-done { opacity: 0.5; text-decoration: line-through; }
.faith-tabs { margin-bottom: 0.65rem; }
@media (max-width: 700px) {
  .faith-layout { grid-template-columns: 1fr; }
}

/* ===== Search improvements ===== */
.search-box { padding: 0.65rem; display: flex; align-items: center; gap: 0.5rem; }
.search-input { flex: 1; background: transparent; border: none; outline: none; font: inherit; font-size: 1.1rem; color: var(--text); padding: 0.25rem 0; }
.search-input::placeholder { color: var(--dim); }
.search-empty { padding: 0.5rem 0; }
.search-tips { margin-top: 0.65rem; }
.search-count { margin-bottom: 0.65rem; padding: 0.35rem 0; }
.search-group { margin-bottom: 1rem; }
.search-group-head { margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; }
.search-results-list { display: flex; flex-direction: column; gap: 0.35rem; }
.hit-row { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem 0.75rem; }
.hit-ico { font-size: 1rem; flex-shrink: 0; padding-top: 0.1rem; }
.hit-body { flex: 1; min-width: 0; }
.hit-words { display: block; font-size: 0.9rem; line-height: 1.35; margin-bottom: 0.15rem; }
.hit-meta { display: block; }

/* ===== Journal — lined notebook feel ===== */
#panel-journal .journal-compose textarea {
  font-family: 'Georgia', 'Iowan Old Style', serif;
  font-size: 1rem;
  line-height: 28px;
  padding: 6px 14px 6px 46px;
  background-color: rgba(20, 18, 28, 0.55);
  background-image:
    linear-gradient(90deg, transparent 36px, rgba(255, 126, 179, 0.28) 36px, rgba(255, 126, 179, 0.28) 38px, transparent 38px),
    repeating-linear-gradient(transparent, transparent 27px, rgba(255, 255, 255, 0.08) 27px, rgba(255, 255, 255, 0.08) 28px);
  background-attachment: local;
  border-radius: 8px;
}
#panel-journal .journal-day {
  font-family: 'Georgia', 'Iowan Old Style', serif;
  background-color: rgba(20, 18, 28, 0.45);
  background-image:
    linear-gradient(90deg, transparent 36px, rgba(255, 126, 179, 0.22) 36px, rgba(255, 126, 179, 0.22) 38px, transparent 38px),
    repeating-linear-gradient(transparent, transparent 27px, rgba(255, 255, 255, 0.06) 27px, rgba(255, 255, 255, 0.06) 28px);
}
#panel-journal .journal-day summary { font-family: var(--font); }
#panel-journal .journal-day .cluster-row-stack { padding-left: 46px; border-bottom: none; }
#panel-journal .journal-day .cluster-row-stack p.human { line-height: 28px; margin: 0; }
#panel-journal .journal-day .cluster-row-stack .row-label { font-family: var(--font); }

/* ===== News panel — view states + layout ===== */
#panel-news .news-toolbar-block { margin-bottom: 0.75rem; }
#panel-news .news-extension-hint {
  margin: 0.35rem 0 0.65rem; font-size: 0.88rem; line-height: 1.5;
}
#panel-news .news-extension-hint code {
  font-size: 0.78rem; background: rgba(0,0,0,0.35); padding: 0.1rem 0.35rem; border-radius: 4px;
}
#panel-news.news-platform-web .news-picker { display: flex; }
#panel-news.news-platform-web #newsHistoryBlock { display: none; }
#panel-news.news-platform-web .news-web-library { display: none; }
#panel-news.news-platform-web .news-headlines-extra { display: none; }
#panel-news.news-platform-desktop .news-web-library { display: none; }
#panel-news.news-view-outlet .news-picker { display: none; }
#panel-news.news-view-browse .news-picker,
#panel-news.news-view-read .news-picker { display: none; }

/* Full-height news panel */
#panel-news { display: flex; flex-direction: column; min-height: min(88vh, 960px); max-height: none; }
#panel-news.news-view-outlets .news-picker { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#panel-news.news-view-outlets .news-picker .section-block { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#panel-news.news-view-outlet .news-stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.news-outlet-hdr {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; margin-bottom: 0.65rem;
}
.outlet-hdr-icon { width: 40px; height: 40px; border-radius: 10px; }
.outlet-hdr-text { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.outlet-hdr-text strong { font-size: 1.1rem; }

.news-outlet-split {
  display: grid;
  grid-template-columns: minmax(200px, 24%) 1fr;
  gap: 0.65rem;
  flex: 1;
  min-height: min(75vh, 820px);
}
.news-outlet-split.list-narrow { grid-template-columns: minmax(160px, 18%) 1fr; }
.news-saved-col {
  overflow-y: auto; padding: 0.5rem; min-height: 0;
  max-height: none;
  flex: 1;
}
.news-reader-col {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0.65rem 0.85rem;
  flex: 1;
}
.news-reader-col .news-reader { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.news-reader-frame-wrap.scrollable { flex: 1; min-height: min(72vh, 900px); overflow: auto; display: flex; }
.news-reader-frame-wrap.scrollable .news-archive-frame { min-height: min(70vh, 880px); height: auto; }
.news-saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.saved-list-label { padding: 0.35rem 0.5rem 0.25rem; }
.library-article-btn.active { border-color: var(--lavender); box-shadow: 0 0 0 1px var(--lavender); }
.outlet-saved-count { font-size: 0.58rem; color: var(--ok); margin-top: 0.1rem; }

.news-headlines-extra { margin-top: 0.65rem; padding: 0.65rem 0.85rem; }
.news-headlines-extra summary { cursor: pointer; padding: 0.35rem 0; }

.gamebar-log {
  margin-top: 0.5rem; padding: 0.65rem; max-height: 140px; overflow: auto;
  font-family: ui-monospace, monospace; font-size: 0.72rem; white-space: pre-wrap;
}

#panel-news .news-web-library .section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; justify-content: space-between; }
#panel-news .news-web-library .section-head h3 { margin: 0; }
#panel-news #newsLibrarySearch { flex: 1; min-width: 140px; max-width: 280px; }
#panel-news .news-library-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; max-height: min(360px, 42vh); overflow-y: auto; }
#panel-news .library-article-btn { width: 100%; text-align: left; padding: 0.65rem 0.85rem; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); background: rgba(0,0,0,0.2); cursor: pointer; display: flex; flex-direction: column; gap: 0.25rem; }
#panel-news .library-article-btn:hover { border-color: rgba(255,126,179,0.35); }
#panel-news .library-article-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
#panel-news .library-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
#panel-news .news-library-empty { padding: 1rem; }
#panel-news .news-archive-frame { width: 100%; flex: 1; min-height: min(70vh, 880px); border: none; border-radius: var(--radius); background: #fff; margin-top: 0.35rem; }

#panel-news .news-browser-slot { margin-bottom: 0.75rem; }
#panel-news .news-browser.chrome { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
#panel-news .news-browser-toolbar { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
#panel-news .news-browser-url { flex: 1; min-width: 120px; font-size: 0.82rem; }
#panel-news .news-browser-frame { width: 100%; min-height: min(280px, 32vh); border: none; border-radius: var(--radius); background: #fff; }
#panel-news .news-browser-hint { margin: 0; }
#panel-news .news-external-panel { padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
#panel-news .news-external-head { display: flex; flex-direction: column; gap: 0.15rem; }
#panel-news .news-external-url { word-break: break-all; margin: 0; }
#panel-news .news-stage-panes { display: flex; flex-direction: column; gap: 0.75rem; }
#panel-news.news-view-browse .news-pane-reader { display: none; }
#panel-news.news-view-read .news-pane-reader { display: flex; }
#panel-news.news-view-library .news-stage-panes { display: grid; grid-template-columns: 1fr; }
#panel-news.news-view-library .news-pane-headlines { display: none; }
#panel-news.news-view-library .news-pane-reader { display: flex; min-height: min(520px, 60vh); }

#panel-news .news-stage {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 1rem;
}
#panel-news .news-pane {
  padding: 0.85rem; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
#panel-news .news-pane h4 {
  font-size: 0.72rem; margin: 0 0 0.6rem; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0;
}
#panel-news .news-reader { flex: 1; min-height: 0; overflow-y: auto; }
#panel-news.news-view-browse .news-pane-reader { display: none; }
#panel-news.news-view-read .news-pane-reader { display: flex; }

#panel-news .outlet-grid {
  max-height: min(380px, 45vh);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 0.15rem;
}
#panel-news .region-tabs { position: sticky; top: 0; z-index: 2; background: var(--bg, rgba(12,10,18,0.92)); padding: 0.25rem 0 0.5rem; }
#panel-news .region-tab { flex-shrink: 0; }

#panel-news .news-reading-section { margin-top: 0.5rem; }
#panel-news .news-history-summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem;
  padding: 0.35rem 0; margin-bottom: 0.35rem;
}
#panel-news .news-history-summary::-webkit-details-marker { display: none; }
#panel-news .news-history-summary h3 { font-size: 0.88rem; font-weight: 600; margin: 0; }
#panel-news .saved-list { max-height: 240px; overflow-y: auto; }

#panel-news .news-site-mock { padding: 0; background: none; border: none; }
#panel-news .news-site-hdr { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.5rem; }
#panel-news .news-site-hdr img { flex-shrink: 0; margin-top: 0.15rem; }
#panel-news .live-headlines { margin: 0; min-width: 0; position: relative; }
#panel-news .live-headlines .headlines-count { margin: 0 0 0.4rem; }
#panel-news .live-headlines .news-headlines { max-height: min(340px, 40vh); overflow-y: auto; position: relative; z-index: 1; }
#panel-news .headline-btn { position: relative; z-index: 2; }
#panel-news .dev-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
#panel-news .survey-open { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
#panel-news .news-paste { width: 100%; }

#panel-news .headline-btn {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem;
  width: 100%; text-align: left; padding: 0.55rem 0.65rem; border-radius: 10px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); color: var(--text);
  font-size: 0.8rem; cursor: pointer; line-height: 1.35;
}
#panel-news .headline-btn span:first-child { flex: 1; min-width: 0; }
#panel-news .headline-btn .dim { flex-shrink: 0; font-size: 0.62rem; margin-top: 0.2rem; white-space: nowrap; }
#panel-news .headline-btn:hover { border-color: var(--lavender); background: var(--lavender-soft); }

#panel-news .reader-meta { margin-bottom: 0.5rem; }
#panel-news .reader-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; line-height: 1.35; }
#panel-news .reading-row { flex-wrap: wrap; gap: 0.5rem; }
#panel-news .reading-meta { flex: 1; min-width: 0; }
#panel-news .reading-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; }

.archive-status { font-size: 0.65rem; padding: 0.18rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.archive-ok { background: rgba(125, 255, 184, 0.15); color: var(--ok); }
.archive-miss { background: rgba(255, 200, 100, 0.12); color: #fcd34d; }
.archive-unknown { background: rgba(255, 255, 255, 0.08); color: var(--dim); }

/* ===== News — followed terms ===== */
.news-follow { padding: 0.85rem 1rem; }
.follow-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.follow-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.follow-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--accent-soft); }
.follow-go { background: none; border: none; color: var(--text); cursor: pointer; font-size: 0.82rem; }
.follow-go:hover { color: var(--accent); text-decoration: underline; }
.follow-x { background: none; border: none; color: var(--dim); cursor: pointer; }
.follow-x:hover { color: var(--create); }
.reader-url { word-break: break-all; }

/* ===== People cards ===== */
.person-card { padding: 0.75rem 0.85rem; margin-bottom: 0.5rem; }
.person-row { display: flex; align-items: center; gap: 0.6rem; }
.person-toggle { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 0.9rem; flex-shrink: 0; }
.person-id { display: flex; flex-direction: column; gap: 0.05rem; flex: 1; min-width: 0; }
.person-last { font-size: 0.8rem; color: var(--muted); flex-shrink: 0; }
.person-last.warn { color: #ffcf6c; }
.person-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.person-detail { margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.5rem; }
.person-fields { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.person-field { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 140px; }
.person-events { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.25rem; }
.person-remove { color: var(--dim); }
.person-remove:hover { color: var(--create); }

/* ===== Learning subjects ===== */
.subject-chip {
  padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 0.82rem;
}
.subject-chip.active { background: var(--mind-soft); color: var(--text); border-color: var(--mind); }
.subject-detail { margin-top: 0.5rem; }
.subject-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; margin: 0.5rem 0; }
.subject-section { display: flex; flex-direction: column; gap: 0.2rem; }
.subject-history { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.4rem; }
.subject-history .cluster-row-inline { padding: 0.3rem 0; }

.search-box { padding: 1.25rem; margin-bottom: 0.85rem; }
.search-input {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 0.8rem 1rem;
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(0,0,0,0.35); color: var(--text);
}
.search-input:focus { outline: none; border-color: rgba(125,255,184,0.4); box-shadow: 0 0 0 3px var(--ok-soft); }
.hit-row { padding: 0.8rem 1rem; font-size: 0.82rem; display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.4rem; }
.hit-cat { font-size: 0.6rem; text-transform: uppercase; color: var(--ok); min-width: 52px; }

.data-table { width: 100%; font-size: 0.78rem; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 0.5rem 0.45rem; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--dim); font-size: 0.65rem; text-transform: uppercase; }

.plugin-card { padding: 0.85rem; margin-bottom: 0.5rem; }
.plugin-why { font-size: 0.82rem; color: var(--muted); line-height: 1.45; margin: 0.35rem 0; }

.embed-body {
  min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.65rem; text-align: center; padding: 1.5rem;
}
.embed-vinyl {
  width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(#0a0a0a, #1a1a1a, #111, #222, #0a0a0a);
  border: 2px solid rgba(255,255,255,0.08);
  animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: calc(var(--bottom-nav-h) + 1rem); left: 50%;
  transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-strong); padding: 0.6rem 1rem;
  border-radius: 999px; font-size: 0.78rem; z-index: 200;
  pointer-events: none; transition: all 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.bottom-nav {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  margin-top: 0.5rem;
  padding: 0.3rem 0.4rem calc(0.3rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  border-radius: var(--radius) var(--radius) 0 0;
}
.bottom-btn {
  flex: 1; font: inherit; font-size: 0.6rem; padding: 0.35rem 0.2rem;
  border: none; background: transparent; color: var(--dim); cursor: pointer; max-width: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.12rem;
}
.bottom-btn .ico { margin: 0; opacity: 0.75; }
.bottom-btn.active { color: var(--lavender); }
.bottom-btn.active .ico { opacity: 1; color: var(--lavender); }
.bottom-btn span { font-size: 0.58rem; line-height: 1; }

/* Security key is optional local setup, not a blocking screen. */
.lock-pill { color: var(--ok); }

body.dev-mode::after {
  content: 'dev';
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 0.5rem);
  right: 0.5rem;
  z-index: 250;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lavender);
  background: var(--lavender-soft);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  pointer-events: none;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px; min-height: 48px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Mobile tap targets */
@media (max-width: 900px) {
  .capture-chip, .bottom-btn, .glass-btn.pill, .nav-link { min-height: 44px; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .shell { min-height: 60vh; }
  .tray-meta { display: none; }
}
@media (max-width: 480px) {
  :root { --card-w: 78vw; }
  .capture-chip:nth-child(n+4) { display: none; }
}
@media (min-width: 901px) { .scroll-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .tie-dye, .embed-vinyl { animation: none !important; }
}

/* Phone Photo Studio */
.photo-studio-layout {
  display: grid;
  grid-template-columns: 1fr min(240px, 32vw);
  gap: 0.65rem;
  min-height: 320px;
}
.photo-grid-mock {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.45rem;
}
.photo-thumb {
  aspect-ratio: 1; border-radius: 10px; position: relative;
  background: rgba(255,255,255,0.04); cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 0.35rem;
}
.photo-thumb.selected { outline: 2px solid var(--ok); outline-offset: 2px; }
.thumb-badge {
  position: absolute; top: 0.35rem; left: 0.35rem;
  font-size: 0.55rem; text-transform: uppercase;
  padding: 0.12rem 0.35rem; border-radius: 4px;
  background: rgba(0,0,0,0.5); color: var(--ok);
}
.thumb-badge.shot { color: #ffb86c; }
.thumb-badge.vid { color: #7ec8ff; }
.thumb-meta { font-size: 0.58rem; color: var(--dim); }
.photo-sidebar { padding: 0.85rem; }
@media (max-width: 700px) {
  .photo-studio-layout { grid-template-columns: 1fr; }
}

/* SVG icons */
.ico { display: inline-block; vertical-align: -2px; margin-right: 0.25rem; flex-shrink: 0; }
.capture-chip { display: inline-flex; align-items: center; gap: 0.15rem; }

/* Survey modal */
.survey-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.survey-modal.open { opacity: 1; pointer-events: auto; visibility: visible; }
.survey-sheet.mass-survey { max-width: min(640px, 94vw); max-height: 88vh; overflow-y: auto; }
.survey-sheet {
  width: min(480px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 1.25rem;
}
.survey-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.survey-form fieldset { border: none; margin: 1rem 0; padding: 0; }
.survey-form legend { font-size: 0.78rem; margin-bottom: 0.45rem; }
.survey-opt {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; padding: 0.4rem 0;
  cursor: pointer;
}
.survey-open { display: block; margin: 1rem 0; }
.survey-open span { display: block; margin-bottom: 0.35rem; }
.run-check { margin-top: 0.75rem; padding: 0.65rem; background: var(--lavender-soft); border-radius: 10px; }
.survey-actions { margin-top: 1rem; }

/* Evolution log */
.evo-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.65rem; }
.evo-entry { padding: 0.85rem 1rem; }
.evo-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.68rem; color: var(--dim); margin-bottom: 0.35rem; }
.evo-entry h4 { font-size: 0.88rem; margin-bottom: 0.25rem; }
.evo-answers {
  font-size: 0.65rem; margin-top: 0.5rem; padding: 0.5rem;
  background: rgba(0,0,0,0.35); border-radius: 8px; overflow-x: auto;
  color: var(--muted);
}
.prompt-box { margin-top: 1rem; padding: 1rem; }
.prompt-box.hidden { display: none; }

/* Theme sliders */
.theme-sliders { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.theme-sliders label {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.82rem; color: var(--muted);
}
.theme-sliders input[type="range"] { flex: 1; accent-color: var(--lavender); }

.dev-card.span-2 { grid-column: 1 / -1; }

/* Survey invite banner */
.survey-invite {
  position: relative;
  z-index: 46;
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  padding: 0.6rem 0.85rem;
  max-width: min(540px, 94vw);
  margin: 0.75rem auto;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.survey-invite.hidden { display: none; }
.survey-invite-ico { display: flex; color: var(--lavender); }
.survey-invite-copy { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.78rem; }

/* News browser */
.news-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0.75rem; align-items: center;
}
.news-toolbar .glass-input { flex: 1; min-width: 180px; }
.region-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }
.region-tab {
  font: inherit; font-size: 0.72rem; padding: 0.35rem 0.65rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.region-tab.active { background: var(--lavender-soft); color: var(--lavender); border-color: transparent; }
.outlet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr));
  gap: 0.55rem;
  padding: 0.35rem;
}
#panel-news .outlet-grid {
  max-height: min(52vh, 640px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.outlet-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 0.7rem 0.45rem; border: 1px solid var(--border); border-radius: 14px;
  background: rgba(255,255,255,0.03); cursor: pointer; font: inherit; color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  min-height: 108px;
}
.outlet-tile:hover { transform: translateY(-1px); }
.outlet-tile:hover, .outlet-tile.active { border-color: var(--lavender); background: var(--lavender-soft); }
.outlet-tile.active { box-shadow: 0 0 0 1px var(--lavender); }
.outlet-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.outlet-icon img { width: 30px; height: 30px; object-fit: contain; }
.outlet-name { font-size: 0.72rem; text-align: center; line-height: 1.25; color: var(--muted); font-weight: 500; }
.bias-pill {
  font-size: 0.52rem; padding: 0.12rem 0.35rem; border-radius: 999px;
  white-space: nowrap; letter-spacing: 0.02em;
}
.bias-c { background: rgba(255,255,255,0.1); color: var(--muted); }
.bias-cl { background: rgba(126,200,255,0.18); color: #9dd4ff; }
.bias-l, .bias-fl { background: rgba(96,165,250,0.2); color: #93c5fd; }
.bias-cr { background: rgba(251,191,36,0.15); color: #fcd34d; }
.bias-r, .bias-fr { background: rgba(248,113,113,0.18); color: #fca5a5; }
.bias-lib { background: rgba(167,139,250,0.18); color: #c4b5fd; }
.bias-inv { background: rgba(125,255,184,0.15); color: var(--ok); }
.bias-legend { margin-top: 0.5rem; font-size: 0.68rem; }
/* legacy — panel-news uses .news-stage; health panel may still use .news-reader-layout */
.news-reader-layout {
  display: grid; grid-template-columns: 1fr; gap: 0.65rem; margin-bottom: 1rem;
}
.news-pane { padding: 0.85rem; min-height: 220px; display: flex; flex-direction: column; }
.news-pane h4 { font-size: 0.78rem; margin-bottom: 0.5rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.news-frame, .news-reader { flex: 1; min-height: 160px; }
.frame-placeholder { padding: 0.75rem; font-size: 0.82rem; }
.reader-meta { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.5rem; font-size: 0.78rem; }
.reader-text { font-size: 0.85rem; line-height: 1.55; color: var(--text); }
.reader-note { margin-top: 0.65rem; font-size: 0.68rem; }
.saved-list { display: flex; flex-direction: column; gap: 0.5rem; }
.saved-article { padding: 0.75rem; }
.saved-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.65rem; color: var(--dim); margin-bottom: 0.35rem; }
.saved-article h4 { font-size: 0.85rem; margin-bottom: 0.25rem; }

@media (max-width: 900px) {
  #panel-news .outlet-grid { max-height: min(280px, 38vh); }
  .news-outlet-split { grid-template-columns: 1fr; min-height: min(70vh, 640px); }
  .news-saved-col { max-height: 200px; }
  .music-workspace { grid-template-columns: 1fr; }
  .crab-iframe { min-height: 280px; }
}

/* Music + crabilouse workspace */
.music-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 42%);
  gap: 0.75rem;
  align-items: start;
}
.music-local { min-width: 0; }
.sync-status { padding: 0.75rem; font-size: 0.78rem; display: flex; flex-direction: column; gap: 0.45rem; }
.sync-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.path-chip {
  font-family: ui-monospace, monospace; font-size: 0.65rem;
  background: rgba(0,0,0,0.35); padding: 0.15rem 0.4rem; border-radius: 6px;
  color: var(--muted);
}
.path-chip.small { font-size: 0.58rem; display: block; margin-top: 0.25rem; }
.album-tree { display: flex; flex-direction: column; gap: 0.5rem; }
.album-folder { padding: 0.65rem 0.75rem; }
.album-folder summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; list-style: none; }
.album-folder summary::-webkit-details-marker { display: none; }
.album-pick {
  font: inherit; font-weight: 600; font-size: 0.85rem; border: none; background: none;
  color: var(--lavender); cursor: pointer; padding: 0;
}
.album-pick.active, .album-pick:hover { text-decoration: underline; }
.song-list { list-style: none; margin-top: 0.55rem; padding-left: 0.25rem; display: flex; flex-direction: column; gap: 0.55rem; }
.song-row { padding: 0.45rem 0; border-top: 1px solid var(--border); }
.song-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.82rem; }
.version-pill { font-size: 0.62rem; padding: 0.1rem 0.35rem; border-radius: 6px; background: var(--lavender-soft); color: var(--lavender); }
.music-embed-pane { padding: 0.75rem; position: sticky; top: 0; min-height: 420px; display: flex; flex-direction: column; }
.crab-embed-wrap { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; min-height: 0; }
.crab-iframe {
  width: 100%; flex: 1; min-height: 360px; border: 1px solid var(--border);
  border-radius: 12px; background: rgba(0,0,0,0.4);
}
.crab-embed-note { font-size: 0.72rem; }
.latest-survey { padding: 0.85rem; margin-bottom: 0.5rem; }
.survey-result-list { list-style: none; font-size: 0.82rem; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.tray-last { font-size: 0.58rem; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
@media (min-width: 1100px) { .tray-last { display: inline; } }

/* Tray capture pop — below bar in document flow */
.tray-capture-pop {
  position: absolute;
  top: calc(var(--tray-h) + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 180; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  padding: 0.55rem 0.75rem; max-width: min(420px, 92vw);
  border-radius: 12px;
}
.tray-capture-pop.hidden { display: none; }
.tray-capture-pop .glass-input { flex: 1; min-width: 140px; margin: 0; }

.priority-strip { margin-bottom: 1rem; }
.priority-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin-bottom: 0.55rem; font-size: 0.85rem; }
.priority-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.45rem; }
.priority-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,0.03); cursor: pointer; font: inherit; color: var(--text);
  text-align: left; transition: border-color 0.15s, background 0.15s;
}
.priority-card:hover { border-color: var(--lavender); background: var(--lavender-soft); }
.priority-label { font-weight: 600; font-size: 0.82rem; }

.capture-recent { list-style: none; padding: 0.75rem; font-size: 0.82rem; display: flex; flex-direction: column; gap: 0.35rem; }
.site-setup { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; }
.site-step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.step-num {
  width: 1.35rem; height: 1.35rem; border-radius: 50%; font-size: 0.65rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--lavender-soft); color: var(--lavender); flex-shrink: 0;
}
.security-checklist { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.5rem; }
.security-row {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; cursor: pointer;
}
.security-row input { accent-color: var(--lavender); }

.site-creds-form {
  display: grid;
  gap: 0.45rem;
  margin: 0.5rem 0 0.25rem;
}
.site-creds-form label {
  display: grid;
  gap: 0.2rem;
}
.site-creds-form input {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
  background: rgba(0,0,0,0.25);
  color: inherit;
}
.site-creds-panel summary { cursor: pointer; margin-top: 0.35rem; }

.version-log { display: grid; gap: 1rem; }
.version-phase { border-left: 2px solid var(--accent-soft, rgba(184,125,255,0.3)); padding-left: 0.85rem; }
.version-phase-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.version-phase-head h4 { margin: 0; }
.version-entry { padding: 0.6rem 0; border-top: 1px solid rgba(255,255,255,0.06); }
.version-entry:first-of-type { border-top: none; }
.version-entry-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.version-entry-title { margin: 0.25rem 0 0.35rem; font-weight: 600; }
.version-notes { margin: 0 0 0 1rem; padding: 0; font-size: 0.82rem; line-height: 1.55; color: var(--muted); }
.version-notes li { margin: 0.15rem 0; }
.alpha-prep-block { padding: 1rem; margin-bottom: 1rem; }
.alpha-list { margin: 0.5rem 0 0 1rem; font-size: 0.82rem; line-height: 1.55; color: var(--muted); }
body.density-adaptive .section-block { margin-bottom: clamp(0.75rem, 2vw, 1.25rem); }
@media (max-width: 900px) {
  body.density-adaptive .capture-chip { min-height: 44px; }
  body.density-adaptive .card-grid { gap: 0.45rem; }
}
@media (min-width: 901px) {
  body.density-adaptive .wide-card { padding: clamp(1rem, 2vw, 1.15rem); }
}

.survey-result-list li { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Harmony pre-1.0 */
.track-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.track-example { padding: 0.7rem; }
.track-ex-head { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; margin-bottom: 0.35rem; }
.track-cat {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--lavender); background: var(--lavender-soft); padding: 0.1rem 0.35rem; border-radius: 4px;
}

/* News wrapper flow */
.hidden { display: none !important; }
.news-site-mock { padding: 0.85rem; }
.news-site-hdr { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.5rem; }
.live-headlines { margin: 0.65rem 0; }
.live-headlines .news-headlines { max-height: 320px; overflow-y: auto; }
.news-headlines { list-style: none; margin: 0.5rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.headline-btn {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
  width: 100%; text-align: left; padding: 0.55rem 0.65rem; border-radius: 10px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); color: var(--text);
  font-size: 0.8rem; cursor: pointer; line-height: 1.35;
}
.headline-btn span:first-child { flex: 1; min-width: 0; }
.headline-btn:hover { border-color: var(--lavender); background: var(--lavender-soft); }
.reading-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.65rem; }
.reading-meta { display: flex; flex-direction: column; gap: 0.15rem; }
.reader-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }

/* Calendar */
.calendar-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
  padding: 0.65rem; margin: 0.75rem 0;
}
.calendar-add {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(190px, 230px) auto;
  gap: 0.65rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: end;
}
.calendar-add .glass-input { margin-top: 0; }
.calendar-viewport {
  padding: 0.75rem; min-height: 280px; transform-origin: top center;
  transform: scale(var(--cal-zoom, 1));
  transition: transform 0.08s ease-out;
}
.cal-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.45rem; }
.cal-cell { min-height: 100px; padding: 0.5rem; font-size: calc(0.75rem * var(--cal-zoom, 1)); }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; margin-top: 0.5rem; }
.cal-mini { padding: 0.4rem; min-height: 48px; font-size: 0.7rem; }
.cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 2px 1px; background: var(--lavender); }
.cal-dot.money { background: #c9a86a; }
.cal-dot.appointment { background: #8ab4d4; }
.cal-event { padding: 0.35rem 0; border-bottom: 1px solid var(--glass-border); font-size: 0.72rem; }
.cal-year { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
.cal-year-month { padding: 0.65rem; font-size: 0.78rem; }

/* Gear & expenses */
.gear-cat-bar { padding: 0.65rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.gear-new-cat { display: flex; gap: 0.35rem; align-items: center; margin-left: auto; }
.gear-card { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; }
.gear-editable:focus { outline: 1px dashed var(--lavender); border-radius: 4px; }
.gear-cat-select { width: 100%; font-size: 0.75rem; }
.gear-card-foot { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.35rem; }
.gear-card-foot .gear-cat-select { flex: 1; }
.gear-remove, .expense-card-foot .text-btn { color: var(--dim); flex-shrink: 0; }
.gear-remove:hover { color: var(--create); }
.expense-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.55rem; }
.expense-card { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.expense-row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.35rem; align-items: start; font-size: 0.78rem; }
.exp-editable { min-height: 1.2em; }
.expense-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.35rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }

/* Editable placeholder (body log, etc.) */
[contenteditable][data-ph]:empty::before {
  content: attr(data-ph);
  color: var(--dim);
  pointer-events: none;
}
.body-recent .cluster-row-inline { padding: 0.3rem 0; }

/* P1/P2 trackers — track bars, digest */
.track-counter { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.track-today strong { font-size: 1.15rem; }
.track-bars { display: flex; align-items: flex-end; gap: 0.4rem; height: 92px; padding-top: 0.25rem; }
.track-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.2rem; height: 100%; }
.track-bar { width: 100%; max-width: 30px; min-height: 6px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--body, #8aa) 0%, color-mix(in srgb, var(--body, #8aa) 55%, transparent) 100%); }
.track-bar-n { font-size: 0.7rem; color: var(--dim); }
.digest-out { margin-top: 0.5rem; }
.digest-out:empty { display: none; }
.plugin-remove, .link-remove { color: var(--dim); }
.plugin-remove:hover, .link-remove:hover { color: var(--create); }

/* ===== Reusable controls (stepper / slider / toggle / segmented) ===== */
.ctl-stepper { display: inline-flex; align-items: center; gap: 0.35rem; }
.ctl-step-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--glass-bg); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.ctl-step-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.ctl-step-val { min-width: 3.2rem; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.ctl-slider { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 180px; }
.ctl-range { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
.ctl-slider-val { min-width: 3rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--muted); }
.ctl-toggle { position: relative; display: inline-flex; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.ctl-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ctl-toggle-track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong);
  transition: background 0.18s var(--ease);
}
.ctl-toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.18s var(--ease);
}
.ctl-toggle input:checked + .ctl-toggle-track { background: var(--accent); }
.ctl-toggle input:checked + .ctl-toggle-track::after { transform: translateX(20px); }
.ctl-segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.ctl-seg-btn {
  padding: 0.35rem 0.7rem; background: transparent; color: var(--muted); border: none; cursor: pointer;
  font-size: 0.78rem; transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.ctl-seg-btn:not(:last-child) { border-right: 1px solid var(--border); }
.ctl-seg-btn.active { background: var(--accent-soft); color: var(--text); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.setting-label { font-size: 0.9rem; }
.setting-desc { font-size: 0.72rem; color: var(--dim); }
.setting-row-ctl { flex-shrink: 0; }

/* ===== Settings panel ===== */
.settings-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.settings-section { padding: 1.1rem; }
.settings-section .cluster-head { margin-bottom: 0.5rem; }
.db-status { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; font-size: 0.85rem; }
.db-stats .db-stat-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dim-chip { opacity: 0.7; }
.registry-group { margin-top: 0.6rem; }
.registry-group .row-label { display: block; margin-bottom: 0.2rem; }
.registry-group .setting-row { padding: 0.4rem 0; }

/* ===== Connection cards ===== */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.conn-card { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.35rem; }
.conn-card-head { display: flex; align-items: center; gap: 0.5rem; }
.conn-card .glass-btn { margin-top: auto; align-self: flex-start; }
.conn-detail { min-height: 1.1em; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--dim); }
.conn-dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok-soft); }
.conn-dot.warn { background: #ffcf6c; }
.conn-dot.down { background: #ff7e8a; }
.conn-dot.testing { background: var(--accent); animation: connpulse 0.8s ease-in-out infinite; }
.conn-dot.idle { background: var(--dim); }
@keyframes connpulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ===== Quick capture overlay ===== */
.capture-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--ease); padding: 1rem;
}
.capture-overlay.show { opacity: 1; pointer-events: auto; }
.capture-card { width: min(520px, 96vw); max-height: 90vh; overflow-y: auto; padding: 1.25rem; transform: translateY(10px); transition: transform 0.2s var(--ease); }
.capture-overlay.show .capture-card { transform: translateY(0); }
.capture-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.capture-rows { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }
.capture-row { display: flex; align-items: center; gap: 0.6rem; }
.capture-label { min-width: 4.5rem; font-size: 0.85rem; flex-shrink: 0; }
.capture-row .ctl-slider { flex: 1; }
.flash-ok { background: var(--ok-soft) !important; border-color: var(--ok) !important; color: var(--ok) !important; }

/* Skills */
.skill-card { padding: 0.85rem; }
.skill-steps { margin: 0.5rem 0 0.5rem 1.1rem; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }

/* Flow clusters — less gridlock */
.flow-cluster {
  padding: clamp(0.85rem, 2vw, 1.1rem);
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
}
.flow-cluster details { margin: 0; }
.cluster-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem;
  flex-wrap: wrap; margin-bottom: 0.65rem;
}
.cluster-head h3 { font-size: 0.88rem; font-weight: 600; margin: 0; }
details.flow-cluster > summary.cluster-head { list-style: none; cursor: pointer; margin-bottom: 0; }
details.flow-cluster > summary.cluster-head::-webkit-details-marker { display: none; }
details.flow-cluster[open] > summary.cluster-head { margin-bottom: 0.65rem; }
.cluster-divider { height: 1px; background: var(--glass-border); margin: 0.65rem 0; }
.cluster-row-inline {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline;
  padding: 0.4rem 0; font-size: 0.82rem;
}
.cluster-row-stack { padding: 0.55rem 0; border-bottom: 1px solid var(--glass-border); }
.cluster-row-stack:last-child { border-bottom: none; }
.row-label {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--body); min-width: 6rem; flex-shrink: 0;
}
.row-val { color: var(--text); flex: 1; min-width: 0; }
.row-val.editable:focus { outline: 1px dashed var(--lavender); border-radius: 4px; }
.warn-text { color: #d4a574; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-top: 0.35rem; }
.text-btn {
  background: none; border: none; color: var(--lavender); font-size: 0.78rem;
  cursor: pointer; padding: 0.15rem 0.35rem; text-decoration: underline; text-underline-offset: 2px;
}
.text-btn:hover { color: var(--text); }

/* Mood meters */
.mood-dashboard, .mood-strip-compact { border-left: 3px solid var(--mind); }
.meter-row { margin-bottom: 0.75rem; }
.meter-row.compact { margin-bottom: 0.45rem; }
.meter-head { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; align-items: baseline; margin-bottom: 0.35rem; }
.meter-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mind); }
.meter-words { font-size: 0.88rem; font-weight: 500; }
.meter-track {
  position: relative; height: 10px; border-radius: 999px;
  background: rgba(0,0,0,0.35); overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(180,160,220,0.5), var(--lavender));
  transition: width 0.2s var(--ease);
}
.meter-anxiety .meter-fill { background: linear-gradient(90deg, rgba(200,160,120,0.4), #c9a86a); }
.meter-val {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 0.58rem; color: var(--muted); pointer-events: none;
}
.meter-actions { display: flex; gap: 0.25rem; margin-top: 0.35rem; }
.spark-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--glass-border); }
.spark-line { width: 120px; height: 28px; color: var(--lavender); opacity: 0.85; }

/* System status rows */
.status-rows { display: flex; flex-direction: column; gap: 0.35rem; }
.status-row {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; padding: 0.35rem 0;
  border-bottom: 1px solid var(--glass-border);
}
.status-row:last-child { border-bottom: none; }
.status-row .tile-val { margin-left: auto; font-size: 0.72rem; }

/* Track catalog flow */
.track-flow { display: flex; flex-direction: column; gap: 0.5rem; }
.track-group { padding: 0.65rem; }
.track-group summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; text-transform: capitalize; }
.track-group-items { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.5rem; }
.track-example { padding: 0.5rem 0; border-bottom: 1px solid var(--glass-border); }
.track-example:last-child { border-bottom: none; }

/* Skills accordion flow */
.skill-flow { display: flex; flex-direction: column; gap: 0.25rem; }
.skill-row { font-size: 0.82rem; padding: 0.35rem 0; border-bottom: 1px solid var(--glass-border); }
.skill-row summary { cursor: pointer; list-style: none; }
.skill-row summary::-webkit-details-marker { display: none; }

/* Med cluster */
.med-site-strip { max-height: 140px; margin: 0.5rem 0; }
.med-reader-split { margin-top: 0.65rem; }
.med-reader-split .news-pane { padding: 0.65rem; background: rgba(0,0,0,0.15); border-radius: var(--radius); }

/* Polish inbox */
.polish-inbox { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
.polish-q { font-size: 0.8rem; line-height: 1.45; padding: 0.35rem 0; border-bottom: 1px solid var(--glass-border); }
.polish-q.done { opacity: 0.75; }
.polish-q.done::before { content: '✓ '; color: var(--lavender); }

.coming-up { margin-top: 0.35rem; }

/* Emotion spectrum — 50 feelings, red → green */
.emotion-spectrum { border-left: 3px solid var(--mind); }
.spectrum-bar {
  position: relative; height: 14px; border-radius: 999px; overflow: hidden; margin: 0.5rem 0;
}
.spectrum-gradient {
  height: 100%;
  background: linear-gradient(90deg,
    hsl(0 65% 45%) 0%,
    hsl(25 60% 48%) 12%,
    hsl(45 55% 45%) 22%,
    hsl(210 35% 42%) 38%,
    hsl(260 25% 48%) 50%,
    hsl(165 45% 42%) 62%,
    hsl(120 55% 42%) 78%,
    hsl(90 60% 44%) 100%);
}
.spectrum-marker {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}
.spectrum-current { font-size: 0.88rem; margin: 0.35rem 0 0.65rem; }
.emotion-cloud {
  display: flex; flex-wrap: wrap; gap: 0.35rem; max-height: 220px; overflow-y: auto;
  padding: 0.25rem 0;
}
.emotion-chip {
  font-size: 0.68rem; padding: 0.28rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--chip, var(--glass-border));
  background: var(--chip-soft, rgba(0,0,0,0.25)); color: var(--text);
  cursor: pointer; transition: transform 0.12s var(--ease), box-shadow 0.12s;
}
.emotion-chip:hover { transform: scale(1.04); box-shadow: 0 0 0 1px var(--chip); }
.emotion-chip.active {
  background: var(--chip); color: #fff; font-weight: 600;
  box-shadow: 0 0 12px var(--chip-soft);
}
.spectrum-legend {
  display: flex; gap: 0.5rem; align-items: center; font-size: 0.68rem; margin-top: 0.5rem;
}
.emotion-mini {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem; font-size: 0.82rem;
}
.emotion-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* Module home grid */
.module-home { margin-bottom: 1rem; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 6), minmax(0, 1fr));
  gap: 0.55rem; margin-top: 0.75rem; min-height: 200px;
}
.module-tile.dragging { opacity: 0.45; }
.module-size { font-size: 0.55rem; display: block; margin-bottom: 0.15rem; }
.module-note { display: block; margin-top: 0.25rem; line-height: 1.3; }
.theme-mind { border-left: 3px solid var(--mind); }
.theme-body { border-left: 3px solid var(--body); }
.theme-create { border-left: 3px solid var(--social); }
.theme-life { border-left: 3px solid var(--lavender); }
.theme-work { border-left: 3px solid #8ab4d4; }
.theme-system { border-left: 3px solid var(--dim); }
.tray-priority-widgets { display: flex; gap: 0.25rem; flex-shrink: 0; }
.priority-widget {
  font-size: 0.62rem; padding: 0.22rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.3);
  color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem;
  max-width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.pw-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
body[data-mobile-density="airy"] .module-grid { gap: 0.75rem; }
body[data-mobile-density="airy"] .module-tile { min-height: 88px; }
body[data-mobile-density="compact"] .module-grid { gap: 0.35rem; }
body[data-mobile-density="compact"] .module-label { font-size: 0.72rem; }
@media (max-width: 700px) {
  .module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tray-nav { display: none; }
  .tray-priority-widgets { flex: 1; overflow-x: auto; }
  .tray-moment { min-width: 0; }
}
.module-tile {
  position: relative; padding: 0; overflow: hidden; min-height: 72px;
  display: flex; flex-direction: column;
}
.module-tile.planned { opacity: 0.72; border-style: dashed; }
.module-tile.wiggle { animation: wiggle 0.35s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: rotate(-0.6deg); } to { transform: rotate(0.6deg); } }
.module-open {
  flex: 1; width: 100%; padding: 0.75rem; text-align: left;
  background: none; border: none; color: inherit; cursor: pointer;
}
.module-label { font-size: 0.82rem; font-weight: 600; display: block; }
.module-edit-bar {
  display: flex; gap: 0.15rem; padding: 0.25rem 0.5rem 0.4rem;
  border-top: 1px solid var(--glass-border);
}
.module-palette { margin-top: 0.75rem; padding: 0.65rem; }
.palette-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.palette-chip {
  font-size: 0.65rem; padding: 0.25rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.25); color: var(--muted); cursor: pointer;
}
.palette-chip:hover { border-color: var(--lavender); color: var(--text); }
.palette-chip.planned { border-style: dashed; }
.recipe-card { padding: 1rem; }
.recipe-list, .recipe-steps { margin: 0.5rem 0 0.5rem 1.1rem; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.recipe-steps li { margin-bottom: 0.35rem; }
.recipe-meta { margin-bottom: 0.5rem; }
.recipe-card details { margin-top: 0.5rem; padding: 0.35rem 0; border-top: 1px solid var(--glass-border); }
.recipe-card summary { cursor: pointer; font-size: 0.82rem; }
.timeline-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* Round H — contained OS + grid-primary shell */
body.os-contained .page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  min-height: 100vh;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.35);
}
body.os-contained .ambient-layer { border-radius: 0; }
body.shell-grid-primary .nav-link[data-view="home"] {
  border-color: var(--lavender);
  background: rgba(168, 180, 255, 0.08);
}
body.shell-grid-primary .sidebar-sub::after {
  content: ' · grid primary';
  opacity: 0.65;
}

/* ===== Electron tray — compact tracker ===== */
body.electron-host .page-wrap { max-width: 100%; }
body.electron-tray-compact {
  --sidebar-w: 0px;
  --tray-h: 48px;
  font-size: 0.94rem;
}
body.electron-tray-compact .sidebar { display: none !important; }
body.electron-tray-compact .shell {
  display: block;
  min-height: calc(100vh - var(--tray-h) - 1rem);
}
body.electron-tray-compact .main {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.65rem 1rem;
}
body.electron-tray-compact .view-header h2 { font-size: 1.05rem; }
body.electron-tray-compact .view-header .human { display: none; }
body.electron-tray-compact .tray-nav { max-width: 100%; }
body.electron-tray-compact .tray-priority-widgets { display: none; }
body.electron-tray-compact .tray-last { display: none !important; }
body.electron-tray-compact .lock-pill { font-size: 0.62rem; }
body.electron-tray-compact .electron-win-controls {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  margin-right: 0.25rem;
}
body.electron-tray-compact .electron-win-btn {
  font-size: 0.62rem;
  padding: 0.2rem 0.45rem;
}
body.electron-tray-compact #panel-news .outlet-grid { max-height: 220px; }
body.electron-tray-compact #panel-news .news-browser-frame { min-height: 180px; }
body.electron-tray-compact .panel { padding: 0.65rem; }
body.electron-tray-expanded .electron-win-controls [data-electron="expand"]::after {
  content: ' compact';
  font-size: 0.85em;
  opacity: 0.7;
}
body.electron-tray-expanded .shell {
  min-height: calc(100vh - var(--tray-h, 52px) - 1.5rem);
}
body.electron-tray-expanded .main {
  max-width: 100%;
  padding: 0.75rem 1rem 1.25rem;
}
body.electron-tray-expanded #panel-news.news-view-browse .news-stage-panes,
body.electron-tray-expanded #panel-news.news-view-read .news-stage-panes,
body.round-j-full-height #panel-news.news-view-browse .news-stage-panes,
body.round-j-full-height #panel-news.news-view-read .news-stage-panes {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
  min-height: min(72vh, 820px);
}
body.electron-tray-expanded #panel-news .live-headlines .news-headlines,
body.round-j-full-height #panel-news .live-headlines .news-headlines {
  max-height: min(520px, 58vh);
}
body.electron-tray-expanded #panel-news .outlet-grid,
body.round-j-full-height #panel-news .outlet-grid {
  max-height: min(420px, 50vh);
}
body.electron-tray-expanded .sidebar { display: flex !important; }
body.electron-host .survey-invite { display: none !important; }
body.electron-tray-compact .survey-invite { display: none !important; }
.trivia-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.65rem; }
@media (max-width: 900px) { .trivia-layout { grid-template-columns: 1fr; } }
.trivia-compose { padding: 0.85rem; }
.trivia-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 14rem; overflow: auto; }
.trivia-row { text-align: left; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 0.5rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.15rem; width: 100%; }
.trivia-row.selected { border-color: var(--accent); }
.trivia-review { padding: 0.85rem; }

/* ===== 0.0.0.9 polish pass — larger desktop/web UI ===== */
@media (min-width: 901px) {
  html { font-size: clamp(15px, 0.78vw, 18px); }
  .page-wrap { padding: 0 clamp(0.65rem, 1.2vw, 1.35rem) 1.75rem; }
  .tray-bar { min-height: 64px; padding: 0.7rem clamp(0.75rem, 1.5vw, 1.25rem); }
  .shell { gap: clamp(0.65rem, 1vw, 1.15rem); min-height: calc(100vh - 72px); width: 100%; }
  .sidebar { width: clamp(220px, 14vw, 300px); }
  .nav-link { font-size: 0.92rem; padding: 0.62rem 0.7rem; }
  .main { padding: clamp(0.65rem, 1vw, 1rem); flex: 1; width: 100%; }
  .panel { padding: clamp(0.85rem, 1.2vw, 1.35rem); }
  .section-block, .wide-card, .flow-cluster, .glass-panel { padding: clamp(1rem, 1.35vw, 1.35rem); }
  .view-header h2 { font-size: clamp(1.55rem, 2vw, 2.2rem); }
  .human { font-size: 1rem; line-height: 1.65; }
  .glass-btn, .pill, .glass-input { font-size: 0.95rem; }
  .pill { padding: 0.58rem 1rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
  .settings-body { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.15rem; }
  :root { --card-w: clamp(168px, 11vw, 220px); }
  .roadmap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .timeline-card { width: var(--card-w); min-height: min(200px, 22vh); }
  .calendar-viewport { min-height: min(82vh, 900px); }
  .journal-textarea { min-height: min(60vh, 700px) !important; }
  .body-grid { grid-template-columns: repeat(2, 1fr); }
  .habits-layout { grid-template-columns: 1fr 1fr; }
  .tl-swim { min-height: min(76vh, 860px); }
  .tl-track-label { width: clamp(120px, 10vw, 155px); }
  .outlet-icon { width: 56px; height: 56px; }
  .outlet-icon img { width: 36px; height: 36px; }
  #panel-news .outlet-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
    gap: 0.65rem;
    max-height: min(58vh, 720px);
  }
  .outlet-tile { min-height: 124px; padding: 0.85rem 0.55rem; }
  .outlet-name { font-size: 0.78rem; }

/* Taller / narrower than 16:9 — shrink so content still fits */
@media (max-aspect-ratio: 16/10) {
  html { font-size: clamp(13px, 1.35vw, 16px); }
  .shell { gap: 0.5rem; min-height: calc(100vh - 64px); }
  .sidebar { width: clamp(200px, 16vw, 260px); }
  .panel-timeline-full { min-height: min(74vh, 780px); }
  .timeline-scroll-wrap { min-height: min(58vh, 640px); }
  .roadmap-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
}
@media (max-aspect-ratio: 4/3) {
  html { font-size: clamp(12px, 1.2vw, 14px); }
  .master-event-list { max-height: min(42vh, 480px); }
}

.glass-btn, .glass-input, .region-tab, .capture-chip {
  min-height: 42px;
}

.liquid-glass {
  box-shadow:
    0 18px 55px rgba(0,0,0,0.52),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.version-log { display: flex; flex-direction: column; gap: 0.75rem; }
.version-phase { border-left: none; padding-left: 0; }
.version-phase-head { margin-bottom: 0.35rem; }
.version-entry { padding: 0.75rem 0; }
.version-entry-head .phase { display: none; }
.version-english { margin: 0.45rem 0 0.65rem; line-height: 1.65; }
.version-notes { list-style: disc; margin: 0.35rem 0 0 1.1rem; font-size: 0.88rem; color: var(--dim); }
.version-notes li { margin: 0.22rem 0; }
.version-entry-older { padding: 0.55rem 0; border-top: 1px solid var(--border); }

/* Master control event log */
.master-events-block { margin-top: 0.5rem; }
.master-event-filter { min-width: 10rem; font-size: 0.85rem; padding: 0.35rem 0.55rem; min-height: 36px; }
.master-event-feed { margin-top: 0.55rem; }
.master-event-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 0.45rem;
  max-height: min(58vh, 640px);
  overflow-y: auto;
}
.master-event-row {
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.65rem 0.75rem;
}
.master-event-ico { font-size: 1.1rem; line-height: 1.2; flex-shrink: 0; }
.master-event-body { flex: 1; min-width: 0; }
.master-event-body strong { display: block; font-size: 0.92rem; line-height: 1.3; margin-bottom: 0.15rem; }
.master-event-del {
  background: none; border: 1px solid transparent; color: var(--dim);
  cursor: pointer; font-size: 0.9rem; padding: 0.2rem 0.45rem; border-radius: 8px; flex-shrink: 0;
}
.master-event-del:hover { color: #ff9a8b; border-color: rgba(255,100,80,0.25); background: rgba(255,100,80,0.08); }

.calendar-viewport {
  min-height: min(760px, 72vh);
  padding: 1rem;
  overflow: auto;
  width: 100%;
}
.cal-week { gap: 0.7rem; }
.cal-cell {
  min-height: min(520px, 58vh);
  padding: 0.75rem;
  font-size: calc(0.86rem * var(--cal-zoom, 1));
}
.cal-day-events { display: grid; gap: 0.65rem; }
.cal-event {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  font-size: 0.86rem;
}
.cal-event strong { display: block; line-height: 1.25; }
.cal-event-ico {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--lavender-soft);
  color: var(--lavender);
  font-weight: 800;
  flex: 0 0 auto;
}
.cal-empty { display: inline-block; margin-top: 0.6rem; }
.cal-mini { min-height: 68px; }

.expense-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 0.85rem;
}
.expense-defaults {
  grid-column: 1 / -1;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 180px));
  gap: 0.75rem;
  align-items: end;
}
.expense-card { padding: 1rem; gap: 0.75rem; }
.expense-card label,
.expense-defaults label,
.gear-card label {
  display: grid;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.expense-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}
.expense-total {
  font-size: 1.2rem;
  color: var(--ok);
  white-space: nowrap;
}
.expense-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.expense-card-foot {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inventory-card { gap: 0.75rem; }
.inventory-card .glass-input { margin-top: 0; }
.gear-cat-bar .region-tabs { flex: 1; }

@media (max-width: 760px) {
  .expense-defaults,
  .expense-card-head,
  .expense-form-grid,
  .calendar-add {
    grid-template-columns: 1fr;
  }
  .cal-week { grid-template-columns: 1fr; }
  .cal-cell { min-height: 180px; }
}
.trivia-answers { margin: 0.5rem 0 0 1.1rem; }
.trivia-answers li.ok { color: var(--ok); font-weight: 600; }
.site-prereq-steps { margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.site-prereq-card { grid-column: span 1; }
.lock-dashlane, .lock-reregister { display: block; margin: 0.35rem auto 0; }

.module-rules-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}
.rule-chip {
  font-size: 0.62rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.pipeline-grid { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.65rem 0; }
.pipeline-step { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem 0.75rem; }
.pipeline-num { font-size: 0.65rem; font-weight: 700; color: var(--lavender); min-width: 1.2rem; }
.web-unsupported-pill {
  display: inline-block; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem; border-radius: 999px; background: rgba(255,184,108,0.15); color: #ffb86c;
  margin-right: 0.35rem;
}
body.platform-web .cap-unsupported { opacity: 0.72; }
.remote-status-strip { font-size: 0.82rem; }

.auth-gate {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: rgba(3, 3, 8, 0.92); backdrop-filter: blur(12px);
  padding: 1.5rem;
}
.auth-gate.hidden { display: none; }
body.is-locked .page-wrap { filter: blur(6px); pointer-events: none; user-select: none; }
.auth-gate-card { max-width: 22rem; width: 100%; padding: 1.35rem; text-align: center; }
.auth-gate-card h2 { margin: 0.35rem 0; font-size: 1.2rem; }
.auth-gate-btn { width: 100%; margin: 0.35rem 0; }
.auth-gate-status { min-height: 1.5rem; margin: 0.5rem 0; }
.reader-controls { margin-left: auto; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.reader-title { font-size: 1.05rem; line-height: 1.35; margin-bottom: 0.35rem; }
