/* Nervous Intern desk companion — shared UI */
.nav-group { border-top: 1px solid var(--border-soft); padding-top: 0.55rem; }
.nav-group summary { cursor: pointer; color: var(--muted); font-size: 0.79rem; font-weight: 700; padding: 0.25rem 0.5rem; }
.nav-group .nav { margin-top: 0.35rem; }
.overview-main { max-width: 1440px; width: 100%; }
.overview-summary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; }
.overview-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.65rem; }
.overview-agent { min-width: 0; text-align: left; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--text); padding: 0.8rem; cursor: pointer; }
.overview-agent:hover, .overview-agent.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }
.overview-agent-head { display: flex; align-items: center; gap: 0.4rem; }
.overview-agent-emoji { font-size: 1.4rem; }
.overview-agent-count { margin-left: auto; color: var(--muted); font-size: 0.73rem; white-space: nowrap; }
.overview-agent-action { margin-top: 0.55rem; font-size: 0.79rem; line-height: 1.35; min-height: 2.15rem; }
.overview-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.overview-facts { display: grid; gap: 0.35rem; font-size: 0.86rem; }
.overview-subtitle { font-size: 0.9rem; margin: 1.1rem 0 0.5rem; }
.overview-task-list { display: grid; gap: 0.4rem; }
.overview-task { display: flex; justify-content: space-between; align-items: baseline; gap: 0.7rem; text-decoration: none; color: var(--text); border: 1px solid var(--border-soft); border-radius: 8px; padding: 0.55rem 0.65rem; }
.overview-task:hover { border-color: var(--accent); }
.overview-task span { text-align: right; white-space: nowrap; }
.overview-feed { display: grid; gap: 0.45rem; max-height: 470px; overflow: auto; }
.overview-event { display: flex; gap: 0.55rem; border-bottom: 1px solid var(--border-soft); padding: 0.45rem 0; font-size: 0.84rem; }
.overview-event-emoji { font-size: 1.1rem; }
.overview-context-note { color: var(--muted); font-size: 0.8rem; margin: 0.8rem 0.25rem; }
.projects-main { max-width: 1320px; width: 100%; }
.project-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 1rem 0 1.5rem; }
.project-totals .card { margin: 0; }
.project-totals .value { font-size: 1.7rem; line-height: 1.2; }
.project-section { margin: 1.35rem 0 1.75rem; }
.project-section h2 { font-size: 1.05rem; margin: 0 0 0.65rem; }
.project-list { display: grid; gap: 0.75rem; }
.project-card { margin: 0; overflow: hidden; }
.project-card + .project-card { margin-top: 0; }
.project-card[open] { border-color: var(--accent); }
.project-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.project-card-head::-webkit-details-marker { display: none; }
.project-card-head::before { content: "▸"; color: var(--muted); margin-right: -0.55rem; }
.project-card[open] .project-card-head::before { content: "▾"; }
.project-title-wrap, .project-meta { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.project-title-wrap { flex: 1; flex-wrap: wrap; }
.project-name { overflow-wrap: anywhere; }
.project-meta { white-space: nowrap; }
.project-focus-pill, .project-status { border-radius: 999px; padding: 0.16rem 0.5rem; font-size: 0.72rem; font-weight: 700; }
.project-focus-pill { color: var(--accent-2); background: var(--glow); }
.project-status { color: var(--muted); background: var(--panel-2); }
.project-card.in_progress .project-status { color: var(--accent-2); background: var(--glow); }
.project-card.finished .project-status { color: var(--ok); background: var(--panel-2); }
.project-percent { font-weight: 800; font-variant-numeric: tabular-nums; }
.project-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--bar-bg); margin-top: 0.65rem; }
.project-progress-fill { height: 100%; border-radius: inherit; background: var(--bar-fill); transition: width 0.35s ease; }
.project-card.finished > .project-progress-track .project-progress-fill { background: var(--ok); }
.project-task-heading { margin: 1.05rem 0 0.5rem; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.project-task-list { display: grid; gap: 0.45rem; }
.project-task { padding: 0.65rem 0.75rem; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel-2); }
.project-task-top, .project-task-info { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.project-task-top { font-size: 0.86rem; }
.project-task-top strong { overflow-wrap: anywhere; }
.project-task-link { color: var(--text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.project-task-link:hover { color: var(--accent-2); text-decoration: underline; }
.project-task-percent { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-task-info { color: var(--muted); font-size: 0.76rem; margin-top: 0.2rem; }
.project-task .project-progress-track { height: 5px; margin-top: 0.5rem; }
@media (max-width: 800px) {
  .overview-summary, .overview-detail { grid-template-columns: 1fr; }
  .project-card-head { align-items: flex-start; }
  .project-meta { flex-direction: column; align-items: flex-end; gap: 0.2rem; }
}
@media (max-width: 520px) {
  .project-totals { gap: 0.4rem; }
  .project-totals .card { padding: 0.55rem; }
  .project-totals .card-title { font-size: 0.7rem; }
  .project-totals .value { font-size: 1.25rem; }
}
:root, body.theme-night {
  --bg: #0f1419;
  --panel: #1a2332;
  --panel-2: #202a3d;
  --border: #2d3a4d;
  --border-soft: #253247;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #5b9fd4;
  --accent-2: #7dc0f0;
  --watch: #e85d5d;
  --alone: #e6b84d;
  --ok: #6bcb8a;
  --bar-bg: #2a3548;
  --bar-fill: #5b9fd4;
  --bubble: #243044;
  --bubble-border: #3a4a63;
  --ci-red: #e85d5d;
  --ci-yellow: #e6b84d;
  --ci-green: #6bcb8a;
  --glow: rgba(91, 159, 212, 0.18);
  --shadow: 0 1px 2px rgba(0,0,0,0.35);
  --slack-purple: #4a154b;
  --slack-purple-2: #3a0f3a;
  --slack-active: #1164a3;
  --gh-header: #010409;
  --gh-panel: #0d1117;
  --gh-border: #30363d;
  --gh-blue: #58a6ff;
  --gh-green: #3fb950;
  --gh-red: #f85149;
  --mail-side: #1a2332;
}
body.theme-day {
  --bg: #e8eef6;
  --panel: #ffffff;
  --panel-2: #f4f7fc;
  --border: #c5d0e0;
  --border-soft: #dde4ee;
  --text: #1a2332;
  --muted: #5a6a82;
  --accent: #3a7eb8;
  --accent-2: #2664a0;
  --watch: #d64545;
  --alone: #c99420;
  --ok: #3a9e62;
  --bar-bg: #dce4f0;
  --bar-fill: #3a7eb8;
  --bubble: #f0f5fb;
  --bubble-border: #b8c8dc;
  --ci-red: #d64545;
  --ci-yellow: #c99420;
  --ci-green: #3a9e62;
  --glow: rgba(58, 126, 184, 0.15);
  --shadow: 0 1px 2px rgba(20,40,80,0.06);
  --slack-purple: #611f69;
  --slack-purple-2: #4a154b;
  --slack-active: #1164a3;
  --gh-header: #24292f;
  --gh-panel: #ffffff;
  --gh-border: #d0d7de;
  --gh-blue: #0969da;
  --gh-green: #1a7f37;
  --gh-red: #cf222e;
  --mail-side: #f4f7fc;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  transition: background 0.7s ease, color 0.45s ease;
}

/* Layout ---------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.main {
  min-width: 0;
  padding: 1rem 1.15rem 2rem;
}
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.15rem 0.35rem;
}
.brand-avatar {
  font-size: 1.9rem;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
  animation: moodPulse 2.8s ease-in-out infinite;
}
.brand-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.05rem;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--panel-2); }
.nav a.active {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--accent-2);
  font-weight: 700;
}
.nav a .icon { font-size: 1rem; width: 1.2rem; text-align: center; }
.nav-section-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.35rem 0.65rem 0.1rem;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}
.global-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ctl-btn {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ctl-btn:hover { border-color: var(--accent); }
.ctl-btn.on.watch { background: var(--watch); border-color: #ff8a8a; color: #fff; box-shadow: 0 0 0 3px rgba(232,93,93,0.35); }
.ctl-btn.leave-work {
  font-weight: 800;
  letter-spacing: 0.01em;
  border-width: 2px;
  background: linear-gradient(135deg, #3a1d2e 0%, #2a2038 100%);
  border-color: #e6b84d;
  box-shadow: 0 0 0 2px rgba(230,184,77,0.25), inset 0 -2px 0 rgba(0,0,0,0.25);
  text-transform: lowercase;
}
.ctl-btn.leave-work:hover {
  border-color: #ffd666;
  box-shadow: 0 0 0 3px rgba(230,184,77,0.4);
}
.ctl-btn.leave-work.on.leave {
  background: linear-gradient(135deg, #5a2030 0%, #3a1840 100%);
  border-color: #e85d5d;
  color: #fff;
  animation: leave-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(232,93,93,0.35);
}
.ctl-btn.leave-work.come-back:not(.on) {
  /* dramatic "please leave" resting state */
}
@keyframes leave-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}
.work-toast {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffd666;
  background: rgba(90, 32, 48, 0.55);
  border: 1px dashed #e6b84d;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  line-height: 1.3;
}
body.work-stopped .sidebar {
  box-shadow: inset 3px 0 0 #e85d5d;
}
body.theme-day .ctl-btn.leave-work {
  background: linear-gradient(135deg, #ffe8c8 0%, #f5d0e0 100%);
  color: #4a2030;
  border-color: #d4a017;
}
body.theme-day .ctl-btn.leave-work.on.leave {
  background: linear-gradient(135deg, #e85d5d 0%, #c44 100%);
  color: #fff;
  border-color: #a33;
}
body.theme-day .work-toast {
  color: #7a3010;
  background: #fff3d6;
  border-color: #d4a017;
}
.sound-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  user-select: none;
  cursor: pointer;
  padding: 0.15rem 0.15rem;
}
.sound-toggle input { accent-color: var(--accent); cursor: pointer; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bar-bg);
  color: var(--muted);
}
.badge.on { color: #0f1419; background: var(--ok); border-color: #4aad6e; }
.badge.dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}
.llm-err {
  font-size: 0.72rem;
  color: var(--alone);
  word-break: break-word;
  padding: 0 0.15rem;
}

/* Page header ----------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-title .icon { font-size: 1.6rem; }
.page-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

#banner {
  display: none;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}
#banner.watching {
  display: block;
  background: var(--watch);
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
#banner.alone {
  display: block;
  background: var(--alone);
  color: #1a1508;
}
#banner.flash { animation: bannerFlash 0.85s ease-out 1, pulse 1.4s ease-in-out 0.85s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.82; } }
@keyframes bannerFlash {
  0% { filter: brightness(1.55); transform: scale(1.02); box-shadow: 0 0 24px rgba(232,93,93,0.55); }
  100% { filter: brightness(1); transform: scale(1); box-shadow: none; }
}
@keyframes moodPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes plantThrive {
  0% { transform: scale(0.92) rotate(-4deg); filter: saturate(0.7); }
  60% { transform: scale(1.08) rotate(2deg); filter: saturate(1.2); }
  100% { transform: scale(1) rotate(0deg); filter: saturate(1); }
}
@keyframes plantWilt {
  0% { transform: scale(1) rotate(0deg); filter: saturate(1); }
  50% { transform: scale(0.9) rotate(-8deg); filter: saturate(0.55) brightness(0.9); }
  100% { transform: scale(0.96) rotate(-3deg); filter: saturate(0.75); }
}
.plant-emoji.thrive { animation: plantThrive 0.7s ease-out 1; }
.plant-emoji.wilt { animation: plantWilt 0.75s ease-out 1; }

/* Cards ----------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 0.75rem; }
.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.card-title.row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.value { font-size: 1.05rem; font-weight: 600; word-break: break-word; }
.muted { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.err { color: var(--watch); font-size: 0.85rem; }
.bar-track { height: 12px; background: var(--bar-bg); border-radius: 6px; overflow: hidden; margin-top: 0.5rem; }
.bar-fill { height: 100%; background: var(--bar-fill); border-radius: 6px; transition: width 0.4s ease; width: 0%; }
.bar-fill.plant { background: var(--ok); transition: width 0.55s ease; }
ul.list { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
ul.list li { margin: 0.25rem 0; }
pre.tail {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
}
body.theme-day pre.tail { color: #3a4a63; }

/* Desk / character ------------------------------------------------------ */
.character-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.mood-avatar {
  font-size: 3.6rem;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.18));
  transition: transform 0.35s ease;
  flex-shrink: 0;
  animation: moodPulse 2.4s ease-in-out infinite;
}
.speech-wrap { flex: 1; min-width: 0; }
.speech-bubble {
  position: relative;
  background: var(--bubble);
  border: 1px solid var(--bubble-border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 0 0 3px var(--glow);
  transition: background 0.45s ease, border-color 0.45s ease;
}
.speech-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 1.1rem;
  width: 12px;
  height: 12px;
  background: var(--bubble);
  border-left: 1px solid var(--bubble-border);
  border-bottom: 1px solid var(--bubble-border);
  transform: rotate(45deg);
}
.speech-meta { margin-top: 0.45rem; font-size: 0.78rem; color: var(--muted); }
.theme-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-left: 0.35rem;
}
.plant-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
}
.plant-emoji {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
  transition: transform 0.35s ease, filter 0.35s ease;
}
.plant-whisper {
  margin-top: 0.45rem;
  font-style: italic;
  font-size: 0.92rem;
  font-weight: 500;
}
.plant-blurb { margin-top: 0.25rem; font-size: 0.82rem; color: var(--muted); }
.act-btn {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.act-btn:hover { border-color: var(--accent); }
.act-btn:disabled { opacity: 0.55; cursor: wait; }
.act-btn.water { background: #1e3a2f; }
.act-btn.water:hover { border-color: var(--ok); background: #244a3a; }
body.theme-day .act-btn.water { background: #e4f3ea; }


/* Active coworker arc banner ------------------------------------------- */
.arc-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  max-width: 100%;
}
.arc-banner[hidden] { display: none !important; }
.arc-banner.conflict {
  background: color-mix(in srgb, var(--watch) 22%, var(--panel-2));
  border-color: color-mix(in srgb, var(--watch) 55%, var(--border));
  color: var(--text);
}
.arc-banner.alliance {
  background: color-mix(in srgb, var(--ok) 28%, var(--panel-2));
  border-color: color-mix(in srgb, var(--ok) 55%, var(--border));
  color: var(--text);
}
/* Coworkers ------------------------------------------------------------- */
.coworkers-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}
@media (max-width: 560px) { .coworkers-row { grid-template-columns: 1fr; } }
.coworker-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  text-align: center;
}
.coworker-chip .face { font-size: 1.85rem; line-height: 1; }
.coworker-chip .cname { font-weight: 700; font-size: 0.9rem; margin-top: 0.2rem; }
.coworker-chip .cmood { font-size: 0.72rem; color: var(--muted); }
.coworker-chip .cagenda { font-size: 0.72rem; margin-top: 0.25rem; opacity: 0.85; }
.coworker-chip .carc {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: normal;
  line-height: 1.25;
  max-width: 100%;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.coworker-chip .carc.alliance { color: #0f1419; background: var(--ok); border-color: transparent; }
.coworker-chip .carc.conflict { color: #fff; background: var(--watch); border-color: transparent; }
.activity-feed { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.activity-feed li { margin: 0.28rem 0; }
.activity-feed .who { font-weight: 700; color: var(--accent-2); }

/* Slack surface --------------------------------------------------------- */
.slack {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 560px;
  background: var(--panel);
}
@media (max-width: 720px) { .slack { grid-template-columns: 1fr; } }
.slack-side {
  background: var(--slack-purple);
  color: #eadfe9;
  padding: 0.85rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.slack-workspace {
  font-weight: 800;
  font-size: 1rem;
  padding: 0 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.slack-workspace .status-dot { background: #6bcb8a; }
.slack-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  padding: 0.4rem 0.35rem 0.15rem;
}
.slack-channel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.88);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.slack-channel:hover { background: rgba(255,255,255,0.06); }
.slack-channel.active { background: var(--slack-active); color: #fff; font-weight: 700; }
.slack-channel .hash { opacity: 0.7; }
.slack-channel .count {
  margin-left: auto;
  font-size: 0.68rem;
  background: rgba(255,255,255,0.14);
  padding: 0.05rem 0.35rem;
  border-radius: 8px;
}
.slack-main {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  min-width: 0;
}
.slack-header {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.slack-header .ch-name { font-weight: 800; font-size: 1rem; }
.slack-header .ch-topic { font-size: 0.82rem; color: var(--muted); }
.slack-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 340px;
  max-height: 560px;
}
.slack-msg {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.55rem;
  align-items: flex-start;
}
.slack-msg .avatar {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.slack-msg .who { font-weight: 700; font-size: 0.9rem; }
.slack-msg .who .ts { font-weight: 400; color: var(--muted); font-size: 0.72rem; margin-left: 0.35rem; }
.slack-msg .text { font-size: 0.92rem; word-break: break-word; }
.slack-msg.bot .avatar { background: #2b2842; border-color: #4a3f68; }
.slack-msg.self .avatar { background: #1e3a3a; border-color: #3f6a6a; }
.slack-composer {
  border-top: 1px solid var(--border);
  padding: 0.55rem 1rem 0.65rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.slack-composer .fake-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  cursor: not-allowed;
}

/* Mail client ----------------------------------------------------------- */
.mail-client {
  display: grid;
  grid-template-columns: 180px 300px 1fr;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  min-height: 560px;
}
@media (max-width: 940px) { .mail-client { grid-template-columns: 1fr 1fr; } .mail-body-pane { grid-column: 1 / -1; border-top: 1px solid var(--border); } }
@media (max-width: 620px) { .mail-client { grid-template-columns: 1fr; } .mail-folders { display: none; } }
.mail-folders {
  background: var(--mail-side);
  border-right: 1px solid var(--border);
  padding: 0.85rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mail-folder {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.88rem;
}
.mail-folder:hover { background: var(--panel-2); }
.mail-folder.active { background: var(--panel-2); font-weight: 700; color: var(--accent-2); }
.mail-folder .count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--muted);
}
.mail-list-pane {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 560px;
}
.mail-list-head {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  background: var(--panel);
  position: sticky; top: 0;
}
.mail-list-head .lbl { font-weight: 700; font-size: 0.85rem; }
.mail-row {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.15s;
}
.mail-row:hover { background: var(--panel-2); }
.mail-row.selected { background: var(--panel-2); border-left: 3px solid var(--accent); padding-left: calc(0.75rem - 3px); }
.mail-row .from-line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
}
.mail-row .from-line .when { font-weight: 400; color: var(--muted); font-size: 0.72rem; }
.mail-row .subj-line { font-size: 0.82rem; margin-top: 0.15rem; }
.mail-row .preview { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-body-pane {
  padding: 1rem 1.15rem;
  overflow-y: auto;
  max-height: 560px;
  background: var(--panel);
}
.mail-body-pane .subj { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.35rem; }
.mail-body-pane .hdr { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.6rem; }
.mail-body-pane .body {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.55;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.7rem;
}
.mail-empty {
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Repo (github-ish) ----------------------------------------------------- */
.repo-shell {
  border: 1px solid var(--gh-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--gh-panel);
}
.repo-topbar {
  background: var(--gh-header);
  color: #fff;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
}
.repo-topbar .octo { font-size: 1.1rem; }
.repo-topbar .slash { opacity: 0.55; }
.repo-topbar .owner { color: #b4c1cf; }
.repo-topbar .name { font-weight: 700; }
.repo-topbar .visibility {
  margin-left: auto;
  font-size: 0.7rem;
  border: 1px solid #6e7681;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  color: #b4c1cf;
}
.repo-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem 0;
  border-bottom: 1px solid var(--gh-border);
  background: var(--gh-panel);
}
.repo-tab {
  background: none;
  border: none;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.repo-tab.active { border-bottom-color: #fd8c73; font-weight: 700; }
.repo-tab .cnt {
  display: inline-block;
  background: var(--bar-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  margin-left: 0.3rem;
}
.repo-content { padding: 0.75rem 1rem 1rem; }
.repo-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.ci-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--gh-border);
  background: var(--panel-2);
  margin-bottom: 0.8rem;
}
.ci-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.ci-badge.green { background: var(--gh-green); color: #fff; border-color: transparent; }
.ci-badge.red { background: var(--gh-red); color: #fff; border-color: transparent; }
.ci-badge.yellow { background: var(--ci-yellow); color: #1a1508; border-color: transparent; }
.commit-row, .pr-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gh-border);
  border-bottom: none;
  background: var(--gh-panel);
  font-size: 0.88rem;
}
.commit-row:first-child, .pr-row:first-child { border-radius: 8px 8px 0 0; }
.commit-row:last-child, .pr-row:last-child { border-radius: 0 0 8px 8px; border-bottom: 1px solid var(--gh-border); }
.commit-row:only-child, .pr-row:only-child { border-radius: 8px; border-bottom: 1px solid var(--gh-border); }
.commit-row .sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--gh-blue);
  font-weight: 700;
}
.commit-row .msg { font-weight: 500; }
.commit-row .meta, .pr-row .meta { font-size: 0.72rem; color: var(--muted); text-align: right; }
.pr-row .icon { font-size: 1.1rem; color: var(--gh-green); }
.pr-row .title { font-weight: 600; }
.pr-row .num { color: var(--muted); font-weight: 400; }

/* Meetings -------------------------------------------------------------- */
.meeting-stage {
  background: linear-gradient(180deg, #0a1120 0%, #0f1a2c 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  color: #e7ecf3;
  position: relative;
  overflow: hidden;
}
body.theme-day .meeting-stage { background: linear-gradient(180deg, #1e2a3f 0%, #263752 100%); color: #f4f7fc; }
.meeting-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.meeting-title { font-size: 1.05rem; font-weight: 700; }
.meeting-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #cfd8e8;
  border: 1px solid rgba(255,255,255,0.15);
}
.meeting-live-pill.live { background: var(--watch); color: #fff; border-color: transparent; }
.meeting-live-pill.live::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
.meeting-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 720px) { .meeting-tiles { grid-template-columns: repeat(2, 1fr); } }
.meeting-tile {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.55rem;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.meeting-tile.speaking { border-color: #6bcb8a; box-shadow: 0 0 0 2px rgba(107,203,138,0.35); }
.meeting-tile .face { font-size: 1.8rem; line-height: 1; }
.meeting-tile .who { font-size: 0.72rem; opacity: 0.85; }
.transcript-scroll {
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mtg-line {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.mtg-line .who { font-weight: 700; color: #7dc0f0; }
.mtg-line .at { font-size: 0.7rem; color: #a2b4cc; margin-left: 0.35rem; }

/* Kanban ---------------------------------------------------------------- */
.jira-main { max-width: 1560px; width: 100%; }
.jira-seed { margin-bottom: 0.75rem; }
.jira-seed summary { cursor: pointer; font-weight: 700; }
.jira-seed[open] summary { margin-bottom: 0.6rem; }
.jira-toolbar { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.75rem; }
.jira-toolbar label { font-size: 0.82rem; font-weight: 700; }
.jira-toolbar select { min-width: min(360px, 55vw); }
.jira-toolbar .muted { margin-left: auto; }
.jira-editor { margin-bottom: 0.75rem; }
.jira-editor h2 { font-size: 1rem; margin: 0 0 0.75rem; }
.jira-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.jira-form label { display: grid; gap: 0.25rem; font-size: 0.78rem; font-weight: 700; }
.jira-form input, .jira-form select, .jira-toolbar select { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 0.45rem 0.55rem; background: var(--panel); color: var(--text); font: inherit; }
.jira-form input[type="range"] { padding: 0; accent-color: var(--accent); }
.jira-form-actions { display: flex; align-items: end; gap: 0.4rem; }
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
@media (max-width: 900px) { .kanban-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-col {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  min-height: 200px;
}
.kanban-col-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-col-title .cnt {
  background: var(--bar-bg);
  color: var(--text);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.68rem;
}
.k-card {
  display: grid;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  font-size: 0.82rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.k-card:hover { border-color: var(--accent); }
.k-card .ktitle { font-weight: 600; }
.k-card .kmeta { font-size: 0.68rem; color: var(--muted); margin-top: 0.2rem; }
.k-card .k-progress-label { font-size: 0.75rem; font-weight: 800; margin-top: 0.4rem; font-variant-numeric: tabular-nums; }
.k-card .project-progress-track { display: block; width: 100%; height: 5px; margin-top: 0.2rem; }
.k-card .project-progress-fill { display: block; }
.k-card.selected { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 700px) { .jira-form { grid-template-columns: 1fr; } .jira-toolbar { flex-wrap: wrap; } .jira-toolbar .muted { margin-left: 0; } }

/* Journal --------------------------------------------------------------- */
.journal-entries {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 620px;
  overflow-y: auto;
}
.journal-entry {
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  border-radius: 6px;
  font-size: 0.86rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.journal-entry .when { color: var(--muted); font-size: 0.72rem; margin-right: 0.4rem; }

/* Utility --------------------------------------------------------------- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  margin-right: 0.35rem;
}
footer.page-foot {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

/* Seed project form ----------------------------------------------------- */
.seed-card { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); }
.seed-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.seed-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.seed-label .req { color: var(--accent); }
.seed-label input,
.seed-label textarea {
  font: inherit;
  font-size: 0.92rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--fg);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  resize: vertical;
}
.seed-label input:focus,
.seed-label textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.seed-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; }
.act-btn.seed-submit {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  border-color: var(--accent);
  font-weight: 600;
}
.seed-focus {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.seed-desk-note {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.seed-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.seed-link { color: var(--accent); text-decoration: none; font-size: 0.78rem; }
.seed-link:hover { text-decoration: underline; }


/* Fake metrics / dashboard ------------------------------------------------ */
.dash-header-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.dash-banner { margin-bottom: 0.85rem; }
.dash-banner-row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap;
}
.dash-kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.25rem;
}
.dash-overall { text-align: right; min-width: 7rem; }
.dash-overall-score {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ci-red);
  line-height: 1;
}
.dash-overall-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.dash-ok-pill {
  display: inline-flex; align-items: center; gap: 0.15rem;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: rgba(107, 203, 138, 0.18); color: #3d9a5f; border: 1px solid rgba(107, 203, 138, 0.45);
}
body.theme-day .dash-ok-pill { background: #e4f3ea; color: #1f7a3d; border-color: #9fd4b0; }
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}
.dash-kpi {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.dash-kpi.bad { border-color: rgba(232, 93, 93, 0.35); }
.dash-kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 0.35rem; }
.dash-kpi-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-check {
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--ok); color: #0f1419; font-size: 0.7rem; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
}
.dash-kpi-value {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ci-red);
}
.dash-kpi-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.dash-kpi-delta { font-size: 0.72rem; color: var(--muted); }
.dash-chart { width: 100%; height: 76px; margin: 0.35rem 0; }
.dash-spark { width: 100%; height: 100%; display: block; }
.dash-chart-caption { font-size: 0.8rem; }
.dash-dual { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.35rem; }
.dash-meter-label { font-size: 0.85rem; margin-bottom: 0.3rem; }
.dash-meter-track {
  height: 10px; border-radius: 999px; background: var(--bar-bg); overflow: hidden;
  border: 1px solid var(--border-soft);
}
.dash-meter-fill { height: 100%; border-radius: 999px; background: var(--ok); }
.dash-meter-fill.bad { background: linear-gradient(90deg, #e85d5d, #e6b84d); }
.dash-meter-note { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; }
.dash-incidents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.dash-incidents li {
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  padding: 0.45rem 0.55rem; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--border-soft); font-size: 0.86rem;
}
.dash-sev {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem; border-radius: 4px;
  background: rgba(232,93,93,0.2); color: var(--ci-red); border: 1px solid rgba(232,93,93,0.4);
}
.dash-inc-text { flex: 1; min-width: 12rem; }

/* HR / Notion parody wiki ------------------------------------------------ */
.wiki-header-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.wiki-main .wiki-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: 28rem;
}
@media (max-width: 820px) {
  .wiki-main .wiki-shell { grid-template-columns: 1fr; }
}
.wiki-tree {
  background: var(--panel-2);
  border-right: 1px solid var(--border-soft);
  padding: 0.85rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
}
.wiki-tree-head { padding: 0 0.35rem 0.35rem; }
.wiki-workspace { font-weight: 800; font-size: 0.92rem; letter-spacing: -0.01em; }
.wiki-workspace-sub { font-size: 0.72rem; margin-top: 0.1rem; }
.wiki-tree-search {
  font-size: 0.75rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--panel);
}
.wiki-tree-body { display: flex; flex-direction: column; gap: 0.65rem; overflow: auto; }
.wiki-sec-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); padding: 0.15rem 0.4rem 0.35rem;
}
.wiki-tree-link {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.45rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 0.86rem;
  border: 1px solid transparent;
}
.wiki-tree-link:hover { background: var(--panel); border-color: var(--border-soft); }
.wiki-tree-link.active {
  background: rgba(91, 159, 212, 0.14);
  border-color: rgba(91, 159, 212, 0.35);
  font-weight: 650;
}
body.theme-day .wiki-tree-link.active { background: #e8f1fa; border-color: #b7d0e8; }
.wiki-tree-ico { width: 1.25rem; text-align: center; flex-shrink: 0; }
.wiki-tree-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-page { padding: 1rem 1.15rem 1.25rem; min-width: 0; }
.wiki-crumbs {
  display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center;
  font-size: 0.78rem; color: var(--muted); margin-bottom: 0.75rem;
}
.wiki-crumb-sep { opacity: 0.55; }
.wiki-crumb.current { color: var(--text); font-weight: 650; }
.wiki-page-head {
  display: flex; align-items: flex-start; gap: 0.65rem; margin-bottom: 0.85rem; flex-wrap: wrap;
}
.wiki-page-icon {
  width: 2.4rem; height: 2.4rem; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.wiki-page-titles { flex: 1; min-width: 10rem; }
.wiki-page-title {
  margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
}
.wiki-page-meta { font-size: 0.78rem; margin-top: 0.2rem; }
.wiki-body {
  font-size: 0.92rem; line-height: 1.55;
  color: var(--text);
}
.wiki-body .wiki-h { margin: 1.1rem 0 0.45rem; font-weight: 800; letter-spacing: -0.01em; }
.wiki-body h2.wiki-h { font-size: 1.2rem; }
.wiki-body h3.wiki-h { font-size: 1.05rem; }
.wiki-body h4.wiki-h { font-size: 0.95rem; }
.wiki-body p { margin: 0.45rem 0; }
.wiki-ul, .wiki-ol { margin: 0.35rem 0 0.55rem 1.1rem; padding: 0; }
.wiki-ul li, .wiki-ol li { margin: 0.2rem 0; }
.wiki-check { list-style: none; margin-left: -0.6rem; }
.wiki-quote {
  margin: 0.6rem 0; padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--panel-2); border-radius: 0 8px 8px 0;
  color: var(--muted); font-style: italic;
}
.wiki-hr { border: none; border-top: 1px solid var(--border-soft); margin: 1rem 0; }
.wiki-table {
  width: 100%; border-collapse: collapse; margin: 0.55rem 0 0.85rem;
  font-size: 0.84rem;
}
.wiki-table th, .wiki-table td {
  border: 1px solid var(--border-soft); padding: 0.35rem 0.5rem; text-align: left;
}
.wiki-table th { background: var(--panel-2); font-weight: 700; }
.wiki-pre {
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: 8px; padding: 0.65rem 0.75rem; overflow: auto; font-size: 0.8rem;
}
.wiki-body code {
  font-size: 0.84em; background: var(--panel-2); padding: 0.05rem 0.3rem; border-radius: 4px;
  border: 1px solid var(--border-soft);
}
.wiki-ilink { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid rgba(91,159,212,0.35); }
.wiki-ilink:hover { border-bottom-color: var(--accent); }
.wiki-ok {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.12rem 0.4rem; border-radius: 999px;
  background: rgba(107, 203, 138, 0.18); color: #3d9a5f; border: 1px solid rgba(107, 203, 138, 0.45);
}
body.theme-day .wiki-ok { background: #e4f3ea; color: #1f7a3d; border-color: #9fd4b0; }
.wiki-empty-fluff {
  margin-top: 1.25rem; padding-top: 0.75rem;
  border-top: 1px dashed var(--border-soft); font-size: 0.8rem;
}


/* ----- Drive (deliverables browser) ----- */
.drive-header-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.drive-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.55rem 0.85rem; margin-bottom: 0.65rem;
}
.drive-path { display: flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; }
.drive-crumb-sep { opacity: 0.5; }
.drive-crumb.current { font-weight: 700; color: var(--text); }
.drive-toolbar-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.drive-view-toggle { display: inline-flex; gap: 0.2rem; }
.drive-view-btn.active {
  background: var(--panel-2); border-color: var(--accent);
  color: var(--text); font-weight: 700;
}
.drive-main .drive-shell {
  display: grid; grid-template-columns: minmax(16rem, 1.05fr) minmax(18rem, 1.35fr);
  gap: 0; padding: 0; overflow: hidden; min-height: 22rem;
}
@media (max-width: 900px) {
  .drive-main .drive-shell { grid-template-columns: 1fr; }
}
.drive-list-pane {
  border-right: 1px solid var(--border-soft);
  padding: 0.65rem 0.55rem 0.85rem;
  min-height: 18rem; max-height: 70vh; overflow: auto;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.drive-list-pane.is-grid .drive-list-head { display: none; }
.drive-list-head {
  display: grid; grid-template-columns: 1fr 3.5rem 8.5rem 4.2rem;
  gap: 0.35rem; padding: 0.2rem 0.55rem 0.35rem 2.2rem;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 0.2rem;
}
.drive-list.view-list { display: flex; flex-direction: column; gap: 0.15rem; }
.drive-list.view-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.45rem; padding: 0.25rem;
}
.drive-item {
  display: grid; grid-template-columns: 1.4rem 1fr 3.5rem 8.5rem 4.2rem;
  gap: 0.35rem; align-items: center;
  padding: 0.38rem 0.5rem; border-radius: 8px;
  text-decoration: none; color: inherit;
  border: 1px solid transparent; font-size: 0.86rem;
}
.drive-item:hover { background: var(--panel); border-color: var(--border-soft); }
.drive-item.active {
  background: rgba(91, 159, 212, 0.14); border-color: rgba(91, 159, 212, 0.4);
}
body.theme-day .drive-item.active { background: #e8f1fa; border-color: #b7d0e8; }
.drive-list.view-grid .drive-item {
  grid-template-columns: 1fr; text-align: center; padding: 0.75rem 0.5rem;
  border: 1px solid var(--border-soft); background: var(--panel-2);
  min-height: 6.5rem;
}
.drive-list.view-grid .drive-item-ico { font-size: 1.6rem; margin: 0 auto 0.25rem; }
.drive-list.view-grid .drive-item-kind,
.drive-list.view-grid .drive-item-mtime,
.drive-list.view-grid .drive-item-size { display: none; }
.drive-item-ico { text-align: center; flex-shrink: 0; }
.drive-item-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}
.drive-list.view-grid .drive-item-name { white-space: normal; font-size: 0.78rem; line-height: 1.25; }
.drive-item-kind, .drive-item-mtime, .drive-item-size { font-size: 0.75rem; }
.drive-empty {
  text-align: center; padding: 2rem 1rem; display: flex; flex-direction: column;
  gap: 0.35rem; align-items: center;
}
.drive-empty-ico { font-size: 1.8rem; }
.drive-empty-hint { font-size: 0.8rem; opacity: 0.85; }
.drive-preview {
  padding: 1rem 1.15rem 1.25rem; min-width: 0; max-height: 70vh; overflow: auto;
}
.drive-preview-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 12rem; font-size: 0.9rem; text-align: center; padding: 1rem;
}
.drive-preview-head {
  display: flex; align-items: flex-start; gap: 0.65rem; margin-bottom: 0.85rem;
}
.drive-preview-icon {
  width: 2.4rem; height: 2.4rem; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.drive-preview-titles { flex: 1; min-width: 10rem; }
.drive-preview-title {
  margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25;
  word-break: break-word;
}
.drive-preview-meta { font-size: 0.78rem; margin-top: 0.2rem; }
.drive-file-body { font-size: 0.92rem; line-height: 1.55; }


/* Team / recruit ---------------------------------------------------------- */
.team-layout { align-items: start; }
.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.team-card {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  box-shadow: var(--shadow);
}
.team-card.recruited { border-color: var(--accent); }
.team-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.team-card-top .face { font-size: 1.7rem; line-height: 1; }
.team-card-id { flex: 1; min-width: 0; }
.team-card .cname { font-weight: 700; font-size: 0.95rem; }
.team-card .cmood { font-size: 0.72rem; color: var(--muted); }
.team-card .cagenda { font-size: 0.78rem; margin-top: 0.35rem; opacity: 0.9; }
.team-card .carc {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--muted);
}
.team-card .carc.alliance { color: #0f1419; background: var(--ok); border-color: transparent; }
.team-card .carc.conflict { color: #fff; background: var(--watch); border-color: transparent; }
.team-card .tiny { font-size: 0.7rem; margin-top: 0.25rem; }
.mem-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  vertical-align: middle;
}
.core-pill { background: var(--bar-bg); color: var(--muted); }
.hire-pill { background: var(--accent); color: #fff; }
.ctl-btn.tiny { padding: 0.2rem 0.45rem; font-size: 0.72rem; }
.ctl-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.recruit-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}
.recruit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.recruit-form input,
.recruit-form textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.recruit-form textarea { resize: vertical; min-height: 4rem; }
.row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}


/* Agenda visibility */
.cagenda {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
}
.cagenda strong {
  color: var(--muted);
  font-weight: 650;
  margin-right: 0.25rem;
}
.agenda-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.agenda-summary li {
  font-size: 0.88rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: var(--panel-2, rgba(0,0,0,0.04));
  border: 1px solid var(--border, rgba(0,0,0,0.08));
}
.agenda-summary .agenda-text {
  color: var(--text);
}
.coworker-chip .cagenda {
  font-size: 0.75rem;
  max-width: 11rem;
}


/* —— The Boss (human operator dashboard) —— */
.boss-layout { align-items: start; }
.boss-form select {
  font: inherit;
  font-weight: 400;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.boss-inbox-strip { margin-bottom: 0.75rem; }
.boss-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 11rem;
  overflow: auto;
  margin-top: 0.35rem;
}
.boss-inbox-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  font-size: 0.82rem;
}
.boss-inbox-row.unread {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.boss-inbox-row .kind { font-size: 1rem; line-height: 1.2; }
.boss-inbox-body { flex: 1; min-width: 0; }
.boss-inbox-row .from-line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.boss-inbox-row .when { color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.boss-inbox-row .preview {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boss-slack-tail {
  margin: 0.4rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--bar-bg);
  border: 1px solid var(--border-soft);
  font-size: 0.72rem;
  line-height: 1.45;
  max-height: 10rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
body[data-page="boss"] .page-title .icon { filter: none; }


/* ----- Mini rooms ----- */
.rooms-layout { align-items: start; }
.rooms-create { margin-bottom: 0.75rem; }
.rooms-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 28rem; overflow: auto; }
.room-row {
  text-align: left;
  border: 1px solid var(--border, #2a3344);
  background: var(--card-2, rgba(255,255,255,0.03));
  color: inherit;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.room-row:hover { border-color: var(--accent, #6ea8fe); }
.room-row.active { border-color: var(--accent, #6ea8fe); background: rgba(110,168,254,0.08); }
.room-row-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.room-peek { margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rooms-members { margin-bottom: 0.85rem; }
.member-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.45rem; }
.member-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: rgba(255,255,255,0.06); border-radius: 999px;
  padding: 0.15rem 0.45rem; font-size: 0.82rem;
}
.member-chip .chip-x {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1;
}
.rooms-invite { display: flex; gap: 0.5rem; align-items: end; flex-wrap: wrap; }
.rooms-invite label { flex: 1; min-width: 10rem; margin: 0; }
.rooms-chat { margin-bottom: 0.85rem; }
.chat-thread {
  max-height: 18rem; overflow: auto;
  border: 1px solid var(--border, #2a3344);
  border-radius: 8px; padding: 0.5rem; margin: 0.35rem 0 0.5rem;
  background: rgba(0,0,0,0.15);
}
.chat-msg { padding: 0.35rem 0.4rem; border-radius: 6px; margin-bottom: 0.3rem; }
.chat-msg.boss { background: rgba(110,168,254,0.12); }
.chat-msg.system { opacity: 0.75; font-style: italic; }
.chat-meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; }
.chat-meta .when { color: var(--muted); }
.chat-text { margin-top: 0.15rem; white-space: pre-wrap; word-break: break-word; }
.task-list { list-style: none; padding: 0; margin: 0.35rem 0 0.6rem; }
.task-item {
  border: 1px solid var(--border, #2a3344); border-radius: 8px;
  padding: 0.45rem 0.55rem; margin-bottom: 0.35rem;
}
.task-item.status-done { opacity: 0.65; }
.task-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.task-item .pill {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem; border-radius: 999px; background: rgba(255,255,255,0.08);
}
body[data-page="rooms"] .page-title .icon { filter: none; }


/* ----- Snapshots ----- */
.snap-list { display: flex; flex-direction: column; gap: 0.45rem; }
.snap-row {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: center;
  border: 1px solid var(--border, #2a3344); border-radius: 8px; padding: 0.5rem 0.65rem;
}
.snap-row-main { min-width: 0; flex: 1; }
.snap-mini { list-style: none; padding: 0; margin: 0; font-size: 0.82rem; }
.snap-mini li { padding: 0.2rem 0; color: var(--muted); border-bottom: 1px solid rgba(255,255,255,0.04); }
.snap-mini li:last-child { border-bottom: 0; }

.chat-msg.task-chip {
  background: rgba(110, 200, 140, 0.12);
  border: 1px dashed rgba(110, 200, 140, 0.35);
}
.chat-msg.task-chip .chat-text { font-size: 0.9rem; }

/* Boss-created work stays visibly urgent across Projects and Task board. */
.project-create { margin-bottom: 0.9rem; }
.project-task-right { display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap; }
.boss-priority-badge, .k-priority-badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 0.12rem 0.45rem;
  color: #b42318; background: rgba(220, 38, 38, 0.12); border: 1px solid rgba(220, 38, 38, 0.35);
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.035em; text-transform: uppercase;
}
.k-card.priority-boss { border-color: #dc2626; box-shadow: inset 3px 0 0 #dc2626; }
.k-card.priority-boss:hover { border-color: #b91c1c; }
.k-card .k-priority-badge { justify-self: start; margin-top: 0.35rem; }
.priority-note { margin: -0.25rem 0 0.75rem; color: #b42318; font-size: 0.82rem; font-weight: 650; }
.project-task.priority-boss { border-left: 3px solid #dc2626; }


/* Slack workspace layout */
.slack-shell { display:grid; grid-template-columns:260px minmax(0,1fr); height:calc(100vh - 240px); min-height:360px; max-height:760px; border:1px solid var(--border); border-radius:10px; overflow:hidden; background:var(--panel); }
.slack-side { min-height:0; background:var(--slack-purple); color:#eadfe9; padding:.75rem .55rem; display:flex; flex-direction:column; gap:.25rem; overflow-y:auto; overscroll-behavior:contain; }
.slack-workspace { position:sticky; top:0; z-index:1; background:var(--slack-purple); padding:.45rem .4rem .75rem; display:flex; align-items:center; gap:.5rem; font-weight:800; border-bottom:1px solid rgba(255,255,255,.15); }
.slack-plus { margin-left:auto; width:28px; height:28px; border:0; border-radius:5px; color:#fff; background:rgba(255,255,255,.15); font-size:1.2rem; cursor:pointer; }
.slack-plus:hover { background:rgba(255,255,255,.25); }
.slack-section { display:flex; justify-content:space-between; margin-top:.7rem; padding:.25rem .4rem; font-size:.69rem; text-transform:uppercase; letter-spacing:.08em; color:rgba(255,255,255,.62); font-weight:700; }
.slack-channel { min-height:31px; padding:.3rem .45rem; border:0; border-radius:5px; display:flex; align-items:center; gap:.45rem; background:transparent; color:rgba(255,255,255,.86); font-size:.83rem; text-align:left; cursor:pointer; }
.slack-channel:hover { background:rgba(255,255,255,.08); }
.slack-channel.active { background:var(--slack-active); color:#fff; }
.slack-channel .hash { width:15px; color:rgba(255,255,255,.56); text-align:center; }
.slack-nav-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slack-channel .count { margin-left:auto; font-size:.64rem; opacity:.68; }
.slack-dm-avatar,.slack-person-avatar { width:20px; height:20px; display:grid; place-items:center; border-radius:4px; background:rgba(255,255,255,.15); font-size:.8rem; flex:none; }
.slack-person { display:flex; align-items:center; gap:.5rem; border:0; border-radius:5px; padding:.28rem .45rem; background:transparent; color:rgba(255,255,255,.82); text-align:left; cursor:pointer; font-size:.8rem; }
.slack-person:hover { background:rgba(255,255,255,.08); color:white; }
.slack-person-online { margin-left:auto; width:7px; height:7px; border-radius:50%; background:#58c78b; }
.slack-new-channel { display:grid; gap:.45rem; padding:.55rem .45rem; border-radius:6px; background:rgba(0,0,0,.18); font-size:.72rem; }
.slack-new-channel label { display:grid; gap:.2rem; }
.slack-new-channel input { min-width:0; width:100%; border:1px solid rgba(255,255,255,.2); border-radius:4px; padding:.35rem; background:rgba(0,0,0,.2); color:white; font:inherit; }
.slack-small-btn { padding:.3rem .5rem; border:0; border-radius:4px; color:#fff; background:var(--slack-active); cursor:pointer; font-size:.72rem; }
.slack-small-btn.muted-btn { margin-left:.3rem; background:rgba(255,255,255,.14); }
.slack-main { min-width:0; min-height:0; display:flex; flex-direction:column; overflow:hidden; background:var(--panel); }
.slack-header { order:0; flex:0 0 auto; min-height:65px; padding:.7rem 1.1rem; border-bottom:1px solid var(--border); display:flex; align-items:center; }
.slack-channel-heading { display:grid; gap:.1rem; }
.slack-header .ch-name { font-size:1rem; font-weight:800; }
.slack-header .ch-topic { font-size:.75rem; color:var(--muted); }
.slack-messages { order:1; flex:1 1 0; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:.75rem; padding:1rem 1.1rem; overscroll-behavior:contain; }
.slack-msg { display:grid; grid-template-columns:36px minmax(0,1fr); gap:.65rem; align-items:start; }
.slack-msg .avatar { width:34px; height:34px; display:grid; place-items:center; border:0; border-radius:6px; background:var(--panel-2); font-size:1.1rem; }
.slack-msg.self .avatar { background:#d7e9e6; }
.slack-msg-head { display:flex; align-items:baseline; gap:.55rem; margin-bottom:.15rem; }
.slack-msg-head strong { font-size:.84rem; }
.slack-msg-head time { color:var(--muted); font-size:.66rem; }
.slack-msg .text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.88rem; line-height:1.45; }
.slack-empty { margin:auto; color:var(--muted); font-size:.86rem; }
.slack-composer { order:3; flex:0 0 auto; display:flex; flex-direction:column; align-items:stretch; width:auto; min-width:0; margin:.1rem 1rem .85rem; padding:.45rem .6rem .35rem; border:1px solid var(--border); border-radius:9px; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.slack-composer-tools { display:flex; gap:.65rem; margin-bottom:.35rem; }
.slack-composer-tools label { display:flex; align-items:center; gap:.3rem; color:var(--muted); font-size:.68rem; }
.slack-composer-tools select { max-width:175px; border:0; border-radius:4px; padding:.2rem; background:var(--panel-2); color:var(--text); font-size:.68rem; }
#slackChannels,#slackDMs,#slackPeople { flex:0 0 auto; }
#slackMentions { min-width:110px; }
.slack-compose-row { display:flex; gap:.55rem; align-items:flex-end; }
.slack-compose-row textarea { display:block; flex:1; width:100%; min-width:0; min-height:48px; resize:vertical; border:0; outline:0; background:transparent; color:var(--text); font:inherit; font-size:.88rem; }
.slack-compose-row button { border:0; border-radius:5px; padding:.42rem .75rem; background:#007a5a; color:#fff; font-weight:700; cursor:pointer; }
.slack-compose-row button:hover { background:#006448; }
.slack-compose-hint { padding:.2rem 0 0; color:var(--muted); font-size:.62rem; }
.slack-action-tag { display:inline-block; margin-top:.3rem; color:#735e16; background:#fff2c2; padding:.08rem .35rem; border-radius:3px; font-size:.58rem; font-weight:800; letter-spacing:.04em; }
@media (max-width:760px) { .slack-shell { grid-template-columns:180px minmax(0,1fr); max-height:none; } .slack-side { padding:.5rem .35rem; } .slack-person { font-size:.72rem; } }
@media (max-width:560px) { .slack-shell { height:auto; min-height:0; max-height:none; grid-template-columns:1fr; overflow:visible; } .slack-side { max-height:260px; overflow-y:auto; } .slack-main { min-height:480px; } .slack-messages { min-height:0; } }

.slack-requests { order:2; flex:0 0 auto; min-height:82px; max-height:150px; overflow-y:auto; padding:.45rem 1rem .5rem; border-top:1px solid var(--border-soft); background:var(--panel-2); }
.slack-requests-title { display:flex; gap:.35rem; align-items:center; margin-bottom:.35rem; font-size:.68rem; color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.slack-request-list { display:grid; gap:.35rem; }
.slack-request { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.15rem .5rem; align-items:center; padding:.4rem .5rem; border:1px solid var(--border-soft); border-radius:6px; background:var(--panel); }
.slack-request-head { min-width:0; display:flex; align-items:center; gap:.45rem; }
.slack-request-head strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.77rem; }
.slack-request-status { flex:none; color:#815d00; background:#fff1bf; border-radius:999px; padding:.08rem .36rem; font-size:.6rem; font-weight:800; text-transform:capitalize; }
.slack-request-status.status-done { color:#17623a; background:#dff4e7; }
.slack-request-status.status-in_progress { color:#145a8d; background:#dceeff; }
.slack-request-meta { color:var(--muted); font-size:.65rem; }
.slack-request-track { grid-column:1; height:4px; border-radius:9px; overflow:hidden; background:var(--bar-bg); }
.slack-request-track span { display:block; height:100%; border-radius:inherit; background:var(--bar-fill); }
.slack-request-done { grid-column:2; grid-row:1 / span 3; border:1px solid var(--border); border-radius:4px; padding:.25rem .45rem; color:var(--text); background:var(--panel-2); font-size:.65rem; cursor:pointer; }
.slack-request-done:hover { border-color:var(--ok); }

/* Nervous Corp brand */
.brand-logo { flex: none; display: block; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.12)); }
.brand-logo:hover { animation: corpJitter 0.35s ease-in-out 2; }
@keyframes corpJitter { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-1px) rotate(-2deg); } 75% { transform: translateX(1px) rotate(2deg); } }
.brand .brand-title { font-size: 1.05rem; font-weight: 800; }
.mood-emoji { font-size: 1.15em; margin-right: 0.15rem; }

/* unread dot on a nav item (e.g. a bot tagged the Boss on Slack) */
.nav a { position: relative; }
.nav-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e0393e;
  box-shadow: 0 0 0 2px var(--panel); margin-left: auto; align-self: center; }
.nav-dot[hidden] { display: none; }

/* Public demo: read-only visitors, admin login, toast */
.nc-toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid #d64545; border-radius: 10px; padding: 0.6rem 0.9rem;
  font-size: 0.85rem; box-shadow: 0 6px 20px rgba(20, 40, 80, 0.18); opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: min(360px, calc(100vw - 36px)); }
.nc-toast.show { opacity: 1; transform: none; }
.auth-box { font-size: 0.8rem; margin: 0.35rem 0 0.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.auth-box:empty { display: none; }
.auth-state { font-weight: 700; color: var(--muted); }
.auth-state.admin { color: var(--ok, #1f9d74); }
.auth-link { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 6px;
  padding: 0.15rem 0.5rem; font: inherit; font-size: 0.78rem; cursor: pointer; }
.auth-link:hover { border-color: var(--accent); }
.auth-form { display: flex; gap: 0.3rem; width: 100%; }
.auth-form input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.4rem;
  background: var(--panel); color: var(--text); font: inherit; font-size: 0.8rem; }
.auth-err { color: #d64545; font-size: 0.75rem; width: 100%; }
body.readonly .ctl-btn.leave-work, body.readonly #watchBtn, body.readonly #cmpReset, body.readonly #cmpLabel { opacity: 0.55; }
