:root {
  color-scheme: light;
  --bg: #f8fbff;
  --surface: #ffffff;
  --surface-2: #f1f6ff;
  --text: #202124;
  --muted: #5f6368;
  --blue: #1a73e8;
  --blue-dark: #1558b0;
  --green: #188038;
  --yellow: #fbbc04;
  --red: #d93025;
  --border: #dfe7f5;
  --shadow: 0 22px 60px rgba(26, 115, 232, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
}

:root.dark {
  color-scheme: dark;
  --bg: #0f1726;
  --surface: #162033;
  --surface-2: #1d2b45;
  --text: #eef3fb;
  --muted: #a8b3c7;
  --blue: #8ab4f8;
  --blue-dark: #5f9bf5;
  --green: #81c995;
  --border: #2d3a51;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(26, 115, 232, 0.14), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--surface-2));
  color: var(--text);
}

.login-page {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(26, 115, 232, 0.14), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--surface-2));
}

.login-shell { width: min(440px, calc(100% - 32px)); }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 18px;
}

.login-card h1 { margin: 6px 0 24px; font-size: clamp(2rem, 8vw, 3rem); }
.login-copy { margin: 0 0 26px; color: var(--muted); line-height: 1.6; }
.login-form { display: grid; gap: 14px; }
.login-form label { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.login-form input {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  color: var(--text);
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  outline: none;
}
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.google-login-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #3c4043;
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.25px;
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.google-login-button:hover {
  background: #f8fafd;
  border-color: #d2e3fc;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
}
.google-login-button:active {
  background: #f1f3f4;
}
.google-login-button:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}
.google-g {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.google-g svg {
  display: block;
  width: 18px;
  height: 18px;
}
.password-fallback { margin-top: 16px; }
.login-message { min-height: 22px; margin: 16px 0 0; color: var(--muted); line-height: 1.5; }
.login-message.error { color: var(--red); }
.login-message.success { color: var(--green); }
.login-footnote { display: block; margin-top: 20px; color: var(--muted); line-height: 1.5; }

button, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 12px; padding-left: 5px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: white;
  background: var(--blue);
  font-weight: 900;
  font-size: 1.45rem;
}
.brand strong { display: block; font-size: 1.15rem; letter-spacing: -0.03em; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; }

.desktop-nav { display: flex; align-items: center; gap: 5px; }
.desktop-nav a {
  padding: 12px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  transition: 0.18s ease;
}
.desktop-nav a:hover, .desktop-nav a.active { background: var(--surface-2); color: var(--blue); }

.actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .primary-button, .big-blue-button, .refresh-icon-button, .usage-details-button, .status-card.clickable {
  border: 0;
  cursor: pointer;
}
.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
}
.primary-button, .big-blue-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: white;
  background: #1a73e8;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(26, 115, 232, 0.26);
}
.primary-button { padding: 14px 18px; }
.big-blue-button { padding: 18px 28px; font-size: 1rem; }
.primary-button:hover, .big-blue-button:hover { background: #1558b0; transform: translateY(-1px); }
.menu-button {
  min-height: 48px;
  touch-action: manipulation;
}
.menu-button-icon {
  width: 18px;
  display: inline-grid;
  gap: 4px;
}
.menu-button-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.menu-button-caret { transition: transform 0.18s ease; }
.menu-button[aria-expanded="true"] .menu-button-caret { transform: rotate(180deg); }
.menu-button:focus-visible,
.icon-button:focus-visible,
.dropdown a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 42%, white);
  outline-offset: 3px;
}
.refresh-icon-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  color: white;
  background: #1a73e8;
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.24);
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease;
}
.refresh-icon-button:hover { background: #1558b0; transform: translateY(-1px) rotate(18deg); }
.refresh-icon-button:disabled { opacity: 0.72; cursor: wait; }
.refresh-icon-button.is-spinning span { animation: spin-refresh 0.8s linear infinite; }
@keyframes spin-refresh { to { transform: rotate(360deg); } }
.usage-actions { display: inline-flex; align-items: center; gap: 10px; }
.usage-details-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #1a73e8;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-weight: 900;
  transition: 0.18s ease;
}
.usage-details-button:hover { color: white; background: #1a73e8; transform: translateY(-1px); }

.menu-wrap { position: relative; }
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 250px;
  display: none;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 30;
}
.dropdown.open { display: grid; }
.dropdown a {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border-radius: 15px;
  color: var(--muted);
  font-weight: 700;
}
.dropdown a:hover { background: var(--surface-2); color: var(--blue); }
.dropdown a.logout-menu-item {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 15px 15px;
  color: var(--red);
}
.dropdown a.logout-menu-item:hover {
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
}

.content { padding-top: 48px; }
.hero {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}
.compact-hero {
  margin-bottom: 20px;
}
.eyebrow, .card-label {
  margin: 0 0 8px;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
}
h1 { max-width: 790px; margin: 0; font-size: clamp(2.3rem, 6vw, 5.8rem); line-height: 0.95; letter-spacing: -0.07em; }
.hero-copy { max-width: 640px; color: var(--muted); font-size: 1.12rem; line-height: 1.65; }

.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.status-card, .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}
.status-card {
  min-height: 150px;
  padding: 26px;
  text-align: left;
  color: var(--text);
}
.status-card strong { display: block; font-size: clamp(1.8rem, 3vw, 2.75rem); letter-spacing: -0.05em; }
.status-card small { display: block; margin-top: 10px; color: var(--muted); }
.status-card.clickable:hover { outline: 3px solid color-mix(in srgb, var(--blue) 22%, transparent); transform: translateY(-2px); }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.usage-head .card-label { margin-bottom: 0; }
.usage-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.usage-meta { display: block; margin-top: 6px; color: var(--muted); }
.progress { height: 18px; margin-top: 22px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progress span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1a73e8, #8ab4f8); transition: width 0.4s ease; }

.main-view { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr); gap: 20px; }
.panel { padding: 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
h2 { margin: 0; font-size: 1.7rem; letter-spacing: -0.04em; }
.live-dot {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 999px;
  color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent);
  font-weight: 900;
}
.live-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 14%, transparent); }
.activity-list, .commit-list { display: grid; gap: 12px; }
.activity-item, .commit-item {
  display: grid;
  gap: 6px;
  padding: 17px;
  border-radius: 20px;
  background: var(--surface-2);
}
.activity-top, .commit-top { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.badge { padding: 6px 10px; border-radius: 999px; background: #1a73e8; color: white; font-weight: 900; font-size: 0.78rem; }
.item-title { font-weight: 900; }
.item-detail, .meta { color: var(--muted); line-height: 1.45; }
.sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue); font-weight: 900; }

.details-dialog {
  width: min(620px, calc(100% - 28px));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.details-dialog::backdrop { background: rgba(15, 23, 38, 0.45); backdrop-filter: blur(4px); }
.details-dialog form { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dialog-note { margin: 8px 0 20px; color: var(--muted); line-height: 1.55; }
.details-list { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.details-list dt { color: var(--muted); font-weight: 800; }
.details-list dd { margin: 0; font-weight: 900; overflow-wrap: anywhere; }

.agents-page { padding-top: 30px; }
.agents-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.agents-hero h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); }
.hierarchy-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.legend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 1000;
  letter-spacing: 0.02em;
}
.legend-pill.ceo { background: linear-gradient(135deg, #202124, #1a73e8); }
.legend-pill.senior { background: #1a73e8; }
.legend-pill.junior { background: #5f6368; }
.legend-arrow { color: var(--muted); font-weight: 1000; }
.agent-org-chart {
  display: grid;
  justify-items: center;
  gap: 0;
}
.agent-card,
.agent-tier-card {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  box-shadow: var(--shadow);
}
.agent-card {
  width: min(880px, 100%);
  padding: clamp(22px, 4vw, 36px);
  border-radius: 34px;
}
.ceo-agent {
  position: relative;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--blue) 34%, var(--border));
}
.ceo-agent::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--blue) 22%, transparent), transparent 24rem),
    linear-gradient(135deg, color-mix(in srgb, var(--yellow) 13%, transparent), transparent 48%);
  pointer-events: none;
}
.agent-card > *, .agent-tier-card > * { position: relative; }
.agent-card-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.agent-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 28px;
  flex: 0 0 86px;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #202124, #1a73e8 62%, #fbbc04);
  box-shadow: 0 20px 46px rgba(26, 115, 232, 0.28);
}
.agent-rank {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.agent-card h2,
.agent-tier-card h2 {
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 3.6rem);
}
.agent-function,
.agent-description,
.agent-tier-card p {
  color: var(--muted);
  line-height: 1.6;
}
.agent-function { margin: 8px 0 0; font-weight: 800; }
.agent-description { font-size: 1.05rem; }
.agent-responsibilities,
.future-agent-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.agent-responsibilities span,
.future-agent-slots span {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
}
.agent-prompt-box {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--border));
  border-radius: 22px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}
.agent-prompt-box summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 1000;
}
.agent-prompt-box p { margin: 12px 0 0; line-height: 1.65; }
.hierarchy-connector {
  width: 4px;
  height: 56px;
  background: linear-gradient(180deg, var(--blue), color-mix(in srgb, var(--blue) 12%, transparent));
}
.agent-branches {
  display: grid;
  gap: 22px;
  width: min(980px, 100%);
}
.agent-branch-card {
  position: relative;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  box-shadow: var(--shadow);
  padding: 24px;
  border-radius: 30px;
}
.agent-branch-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.agent-branch-card h2,
.agent-branch-card h3 {
  margin: 8px 0 0;
  letter-spacing: -0.04em;
}
.agent-branch-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.agent-branch-card h3 { font-size: clamp(1.35rem, 3vw, 2.1rem); }
.agent-branch-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.agent-mini-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 20px;
  font-size: 1.7rem;
  color: #fff;
  box-shadow: 0 16px 32px rgba(26, 115, 232, 0.20);
}
.agent-mini-icon.senior { background: linear-gradient(135deg, #1a73e8, #1558b0); }
.agent-mini-icon.junior { background: linear-gradient(135deg, #5f6368, #202124); }
.senior-tier { border-left: 7px solid var(--blue); }
.junior-tier { border-left: 7px solid var(--muted); box-shadow: none; }
.branch-connector {
  width: 4px;
  height: 38px;
  margin: 18px 0 0 27px;
  background: linear-gradient(180deg, var(--blue), color-mix(in srgb, var(--blue) 12%, transparent));
  border-radius: 999px;
}
.junior-stack {
  display: grid;
  gap: 14px;
  margin-left: 42px;
}
.future-senior-slot {
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}


.agent-menu-status {
  margin: 0 0 22px;
}
.agent-menu-status.compact {
  margin: 0 22px 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.agent-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.agent-status-head h2 { margin: 0; }
.agent-status-refresh {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}
.agent-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.agent-status-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-2);
}
.agent-status-card.rank-ceo { border-color: color-mix(in srgb, var(--blue) 38%, var(--border)); }
.agent-status-card.rank-senior { border-left: 5px solid var(--blue); }
.agent-status-card.rank-junior { border-left: 5px solid var(--muted); }
.agent-status-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.agent-status-main h3 {
  margin: 7px 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.agent-status-main p,
.agent-status-scope,
.agent-status-card small {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.agent-status-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 17px;
  background: color-mix(in srgb, var(--blue) 14%, var(--surface));
  font-size: 1.45rem;
}
.agent-status-state {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 9px;
  padding: 11px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 64%, transparent);
}
.agent-status-state small {
  grid-column: 2;
  margin: 0;
}
.status-light {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 14%, transparent);
}
.status-working .status-light {
  background: var(--yellow);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--yellow) 18%, transparent);
  animation: agent-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes agent-pulse { to { transform: scale(1.18); } }

@media (max-width: 760px) {
  .agents-hero,
  .agent-card-top { align-items: flex-start; flex-direction: column; }
  .hierarchy-legend { width: 100%; justify-content: center; flex-wrap: wrap; border-radius: 24px; }
  .agent-branch-head, .agent-status-head { flex-direction: column; }
  .junior-stack { margin-left: 0; }
  .branch-connector { margin-left: 26px; }
  .agent-icon { width: 76px; height: 76px; flex-basis: 76px; border-radius: 24px; }
}

@media (max-width: 860px) {
  .desktop-nav { display: none; }
  .hero, .status-grid, .main-view { grid-template-columns: 1fr; }
  .topbar { border-radius: 28px; align-items: flex-start; }
  .brand small { display: none; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 20px, 1220px); padding-top: 10px; }
  .topbar {
    top: 8px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    border-radius: 24px;
    padding: 10px;
  }
  .brand { min-width: 0; flex: 1; }
  .brand strong { font-size: 1rem; }
  .brand .brand-mark { width: 42px; height: 42px; border-radius: 14px; margin-bottom: 0; }
  .actions { width: auto; flex: 0 0 auto; justify-content: flex-end; gap: 8px; }
  .icon-button { width: 46px; height: 46px; flex: 0 0 auto; }
  .menu-wrap { position: static; }
  .primary-button.menu-button {
    flex: 0 0 auto;
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(26, 115, 232, 0.28);
  }
  .menu-button-text,
  .menu-button-caret { display: none; }
  .menu-button-icon { width: 21px; gap: 5px; }
  .dropdown {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(76px + env(safe-area-inset-top));
    min-width: 0;
    width: auto;
    max-height: min(72vh, 520px);
    overflow-y: auto;
    padding: 12px;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 38, 0.30);
  }
  .dropdown.open { display: grid; gap: 6px; }
  .dropdown a {
    min-height: 54px;
    padding: 15px 16px;
    border-radius: 17px;
    font-size: 1rem;
  }
  .status-card, .panel { padding: 20px; }
  .details-list { grid-template-columns: 1fr; }
}


.page-view { display: none; }
.page-view.active-page { display: block; }
.chat-page { padding-top: 30px; }
.chat-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 150px);
}
.chat-sidebar, .chat-main {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}
.chat-sidebar { padding: 18px; display: flex; flex-direction: column; min-height: 720px; }
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chat-sidebar-head h2, .chat-main-head h1 { margin: 0; letter-spacing: -0.05em; }
.new-chat-button, .send-chat-button {
  border: 0;
  cursor: pointer;
  color: #fff;
  background: #1a73e8;
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}
.new-chat-button { border-radius: 999px; padding: 12px 14px; font-weight: 900; }
.chat-session-list { display: grid; gap: 8px; overflow: auto; padding-right: 4px; }
.chat-session-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 17px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 13px 14px;
  text-align: left;
  transition: 0.18s ease;
}
.chat-session-button:hover, .chat-session-button.active { background: var(--surface-2); border-color: var(--border); }
.chat-session-button strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-session-button small, .chat-save-note, .muted-list-note { color: var(--muted); line-height: 1.5; }
.chat-save-note { margin-top: auto; font-size: 0.82rem; }
.chat-save-note code { color: var(--blue); }
.chat-main { display: grid; grid-template-rows: auto 1fr; min-height: 720px; overflow: hidden; }
.chat-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(138, 180, 248, 0.22);
  background:
    linear-gradient(180deg, rgba(23, 31, 48, 0.98), rgba(9, 13, 22, 0.98));
  color: #d7e6ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
.terminal-titlebar-copy { min-width: 0; flex: 1; }
.terminal-titlebar-copy .card-label { color: #81c995; margin-bottom: 3px; }
.chat-main-head h1 {
  max-width: 720px;
  color: #f8fbff;
  font-family: inherit;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal-traffic-lights {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.traffic-light {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(0, 0, 0, 0.28);
}
.traffic-red { background: #ff5f57; }
.traffic-yellow { background: #ffbd2e; }
.traffic-green {
  background: #28c840;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.traffic-green:hover,
.traffic-green:focus-visible {
  transform: scale(1.12);
  filter: brightness(1.08);
  outline: none;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.36), 0 0 0 4px rgba(40, 200, 64, 0.22);
}
.chat-status {
  padding: 10px 14px;
  border-radius: 999px;
  color: #81c995;
  background: rgba(129, 201, 149, 0.12);
  border: 1px solid rgba(129, 201, 149, 0.22);
  font-weight: 900;
  white-space: nowrap;
}
.chat-messages {
  overflow: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat-terminal {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: #05070d;
}
.empty-chat { margin: auto; max-width: 560px; text-align: center; color: var(--muted); }
.empty-chat .brand-mark { margin: 0 auto 18px; }
.empty-chat h2 { color: var(--text); font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.06em; margin: 0 0 12px; }
.chat-message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: start; }
.chat-message.from-user { max-width: 82%; align-self: flex-end; grid-template-columns: minmax(0, 1fr) 42px; }
.chat-message.from-user .message-avatar { grid-column: 2; grid-row: 1; }
.chat-message.from-user .message-bubble { grid-column: 1; grid-row: 1; background: #1a73e8; color: #fff; border-color: #1a73e8; }
.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--blue);
  font-weight: 900;
}
.message-bubble {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px 18px;
  background: var(--surface);
  line-height: 1.6;
}
.message-meta { color: var(--muted); font-size: 0.8rem; font-weight: 800; margin-bottom: 8px; }
.from-user .message-meta { color: rgba(255,255,255,0.78); }
.message-content pre { overflow: auto; padding: 14px; border-radius: 14px; background: rgba(0,0,0,0.08); }
.message-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.tool-events {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue) 6%, var(--surface-2));
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-x: auto;
}
.tool-events-title {
  color: var(--blue);
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tool-event-row { white-space: pre; }
.chat-message.is-thinking .message-bubble {
  border-color: color-mix(in srgb, var(--blue) 32%, var(--border));
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}
.thinking-live {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}
.thinking-emoji {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 1.35rem;
  animation: thinking-pulse 1.6s infinite ease-in-out;
}
.thinking-copy { display: grid; gap: 1px; }
.thinking-copy strong { color: var(--blue); font-weight: 900; text-transform: capitalize; }
.thinking-copy small { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.thinking-note {
  display: block;
  max-width: 420px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.thinking-dots { display: inline-flex; align-items: center; gap: 5px; margin-left: 2px; vertical-align: middle; }
.thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  animation: thinking-bounce 1s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.14s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.28s; }
@keyframes thinking-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.42; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.chat-composer {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(26, 115, 232, 0.10);
}
.chat-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  max-height: 180px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 12px;
  font: inherit;
}
.send-chat-button { width: 56px; height: 56px; border-radius: 20px; font-size: 1.35rem; }
.send-chat-button:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 880px) {
  .chat-shell { grid-template-columns: 1fr; }
  .chat-sidebar, .chat-main { min-height: auto; }
  .chat-message.from-user { max-width: 100%; }
}

/* Kraw_os integrated remote shell chat */
.terminal-window {
  background: #05070d;
  color: #d7e6ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 22px;
  gap: 8px;
}
.terminal-window::selection { background: rgba(26, 115, 232, 0.45); }
.terminal-block {
  display: grid;
  gap: 3px;
  width: 100%;
}
.terminal-block + .terminal-block { margin-top: 8px; }
.terminal-block.system {
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(138, 180, 248, 0.24);
}
.terminal-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 1.45em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal-line.input { color: #f8fbff; }
.terminal-line.output { color: #d7e6ff; }
.terminal-line.tool { color: #8ab4f8; }
.terminal-line.working { color: #81c995; }
.terminal-line.muted { color: #7f8da3; }
.terminal-prompt {
  flex: 0 0 auto;
  color: #81c995;
  font-weight: 900;
}
.terminal-prefix {
  flex: 0 0 auto;
  min-width: 72px;
  color: #8ab4f8;
  font-weight: 900;
}
.terminal-placeholder { color: #607089; }
.terminal-tool-events {
  display: grid;
  gap: 2px;
  margin: 4px 0;
}
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: #81c995;
  animation: terminal-blink 1s steps(1) infinite;
}
@keyframes terminal-blink { 50% { opacity: 0; } }
.terminal-composer {
  grid-template-columns: auto minmax(0, 1fr) 56px;
  align-items: center;
  background: #05070d;
  border-width: 1px 0 0;
  border-color: rgba(138, 180, 248, 0.24);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 18px 16px;
}
.composer-prompt {
  padding-left: 10px;
  color: #81c995;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 900;
  white-space: nowrap;
}
.terminal-composer textarea {
  color: #f8fbff;
  caret-color: #81c995;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
.terminal-composer textarea::placeholder { color: #607089; }
.terminal-composer .send-chat-button {
  background: #1558b0;
  box-shadow: 0 12px 26px rgba(21, 88, 176, 0.28);
}
:root.dark .terminal-window, :root.dark .terminal-composer, :root.dark .chat-terminal { background: #03050a; }
.chat-main.shell-fullscreen,
.chat-main:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: #05070d;
}
.chat-main.shell-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.chat-main.shell-fullscreen .chat-main-head,
.chat-main:fullscreen .chat-main-head {
  padding-top: max(15px, env(safe-area-inset-top));
}
.chat-main.shell-fullscreen .chat-terminal,
.chat-main:fullscreen .chat-terminal {
  height: 100%;
}
.chat-main.shell-fullscreen .traffic-green,
.chat-main:fullscreen .traffic-green {
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.36), 0 0 0 4px rgba(40, 200, 64, 0.22);
}
@media (max-width: 560px) {
  .terminal-composer { grid-template-columns: 1fr 48px; }
  .composer-prompt { grid-column: 1 / -1; padding: 4px 10px 0; }
  .terminal-prefix { min-width: 58px; }
  .chat-main-head { gap: 10px; padding: 13px 14px; }
  .chat-status { display: none; }
}

/* Terminal viewport fixes: keep the page stable and scroll inside the shell */
.chat-page.active-page {
  height: calc(100vh - 118px);
  overflow: hidden;
}
.chat-shell {
  height: 100%;
  min-height: 0;
}
.chat-sidebar {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-session-list {
  min-height: 0;
  overflow-y: auto;
}
.chat-main {
  min-height: 0;
  height: 100%;
}
.chat-terminal {
  min-height: 0;
  height: 100%;
}
.chat-messages,
.terminal-window {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #30425f #05070d;
  scrollbar-width: thin;
}
.terminal-window::-webkit-scrollbar { width: 10px; }
.terminal-window::-webkit-scrollbar-track { background: #05070d; }
.terminal-window::-webkit-scrollbar-thumb {
  background: #30425f;
  border-radius: 999px;
}
.terminal-window::-webkit-scrollbar-thumb:hover { background: #4b638b; }
.terminal-block.prompt-preview { margin-top: auto; }
@media (max-width: 880px) {
  .chat-page.active-page {
    height: auto;
    min-height: calc(100vh - 118px);
    overflow: visible;
  }
  .chat-shell { height: auto; }
  .chat-main { height: calc(100vh - 180px); min-height: 560px; }
  .chat-sidebar { height: auto; max-height: 280px; }
}

/* Kraw_os idea pipeline */
.pipeline-page { padding-top: 30px; }
.pipeline-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.pipeline-hero h1 {
  max-width: 820px;
  font-size: clamp(2rem, 5vw, 4.6rem);
}
.pipeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
}
.pipeline-posts-main {
  min-height: 58vh;
}
.pipeline-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(170px, 0.8fr) minmax(170px, 0.8fr) minmax(160px, 0.75fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.pipeline-idea-dialog {
  width: min(980px, 75vw);
  max-width: calc(100vw - 32px);
  max-height: 75vh;
  border: 0;
  border-radius: 34px;
  padding: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.pipeline-idea-dialog::backdrop {
  background: color-mix(in srgb, var(--bg) 24%, rgba(10, 18, 32, 0.52));
  backdrop-filter: blur(12px);
}
.pipeline-idea-dialog .pipeline-editor {
  max-height: 75vh;
  overflow: auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}
.pipeline-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pipeline-form {
  display: grid;
  gap: 16px;
}
.pipeline-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}
.pipeline-form input,
.pipeline-form textarea,
.pipeline-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  outline: none;
}
.pipeline-form textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}
.pipeline-form input:focus,
.pipeline-form textarea:focus,
.pipeline-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 16%, transparent);
}
.pipeline-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pipeline-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pipeline-auto-note {
  color: var(--muted);
  line-height: 1.45;
  font-weight: 800;
}
.pipeline-save-status {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}
.pipeline-save-status[data-kind="busy"] { color: var(--blue); }
.pipeline-save-status[data-kind="success"] { color: var(--green); }
.pipeline-save-status[data-kind="error"] { color: var(--red); }
.pipeline-posts-head {
  align-items: center;
  gap: 14px;
}
.pipeline-view-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.view-toggle-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  padding: 8px 12px;
}
.view-toggle-button.active {
  background: var(--blue);
  color: #fff;
}
.pipeline-search-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 14px;
}
.pipeline-search-label input,
.pipeline-search-label select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  color: var(--text);
  padding: 13px 15px;
  font: inherit;
  outline: none;
}
.pipeline-search-label input:focus,
.pipeline-search-label select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 16%, transparent);
}
.pipeline-post-list {
  display: grid;
  gap: 12px;
  max-height: 780px;
  overflow: auto;
  padding-right: 4px;
}
.pipeline-post-list.grid-view {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: start;
}
.pipeline-post-list.list-view {
  grid-template-columns: 1fr;
}
.pipeline-post {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--blue);
  border-radius: 20px;
  background: var(--surface-2);
  cursor: pointer;
}
.pipeline-post.priority-laag { border-left-color: var(--green); }
.pipeline-post.priority-midden { border-left-color: var(--blue); }
.pipeline-post.priority-hoog { border-left-color: var(--yellow); }
.pipeline-post.priority-suppa-important { border-left-color: var(--red); }
.pipeline-post-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  position: relative;
}
.pipeline-post-head strong { font-size: 1.04rem; }
.pipeline-post-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  flex: 0 0 auto;
}
.pipeline-state-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
}
.thinking-spinner {
  width: 21px;
  height: 21px;
  border: 3px solid color-mix(in srgb, var(--blue) 22%, transparent);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin-refresh 0.8s linear infinite;
}
.ready-check {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 1000;
  line-height: 1;
}
.waiting-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.7;
}
.pipeline-more-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.pipeline-more-dots {
  display: block;
  width: 28px;
  height: 24px;
  flex: 0 0 28px;
  fill: currentColor;
}
.pipeline-more-button:hover,
.pipeline-more-button[aria-expanded="true"] {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}
.pipeline-more-menu {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 4;
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}
.pipeline-more-menu button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
  font-weight: 800;
}
.pipeline-more-menu button:hover {
  background: var(--surface-2);
  color: var(--blue);
}
.pipeline-priority {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}
.pipeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pipeline-tags span {
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}
.pipeline-tags .expansion-badge {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
}
.pipeline-tags .owner-badge {
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
}
.pipeline-post.expansion-klaar .expansion-badge { color: var(--green); }
.pipeline-post.expansion-fout .expansion-badge { color: var(--red); }
.pipeline-post.expansion-bezig .expansion-badge { animation: pulse-badge 1.4s ease-in-out infinite; }
@keyframes pulse-badge {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
.pipeline-summary {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}
.pipeline-raw {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}
.pipeline-post details {
  color: var(--muted);
  line-height: 1.55;
}
.pipeline-post summary {
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}
.pipeline-details {
  margin-top: 8px;
  white-space: normal;
}
@media (max-width: 900px) {
  .pipeline-hero,
  .pipeline-layout,
  .pipeline-meta-grid,
  .pipeline-filter-bar { grid-template-columns: 1fr; }
  .pipeline-hero { align-items: flex-start; flex-direction: column; }
  .pipeline-post-list { max-height: none; }
  .pipeline-idea-dialog {
    width: calc(100vw - 24px);
    max-height: 86vh;
  }
  .pipeline-idea-dialog .pipeline-editor { max-height: 86vh; }
}

/* Kraw_os financial menu */
.financial-page { padding-top: 30px; }
.financial-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.financial-hero h1 {
  max-width: 860px;
  font-size: clamp(2rem, 5vw, 4.6rem);
}
.financial-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.financial-kpi-card {
  min-height: 142px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}
.financial-kpi-card strong {
  display: block;
  font-size: clamp(1.65rem, 2.8vw, 2.45rem);
  letter-spacing: -0.06em;
  line-height: 1;
}
.financial-kpi-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.4;
  font-weight: 800;
}
.financial-kpi-card.positive { border-color: color-mix(in srgb, var(--green) 36%, var(--border)); }
.financial-kpi-card.positive strong { color: var(--green); }
.financial-kpi-card.negative { border-color: color-mix(in srgb, var(--red) 36%, var(--border)); }
.financial-kpi-card.negative strong { color: var(--red); }
.financial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 20px;
}
.financial-table-head { align-items: center; }
.financial-updated {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}
.financial-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
}
.financial-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}
.financial-table th,
.financial-table td {
  padding: 14px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}
.financial-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.financial-table tr:last-child td { border-bottom: 0; }
.financial-table .positive { color: var(--green); font-weight: 900; }
.financial-table .negative { color: var(--red); font-weight: 900; }
.financial-table .neutral { color: var(--muted); font-weight: 900; }
.financial-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.financial-status.gesloten { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.financial-status.watchlist { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 18%, transparent); }
.financial-empty {
  color: var(--muted);
  text-align: center !important;
  padding: 34px !important;
}
.financial-empty code,
.financial-hero code { color: var(--blue); font-weight: 900; }
.financial-suggestion-list { display: grid; gap: 12px; }
.financial-suggestion {
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.financial-suggestion strong { color: var(--blue); }
.financial-suggestion p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.big-blue-button.is-loading { opacity: 0.72; cursor: wait; }
@media (max-width: 1050px) {
  .financial-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .financial-hero { align-items: flex-start; flex-direction: column; }
  .financial-kpi-grid { grid-template-columns: 1fr; }
}

/* Financial dashboard phase 2 */
.financial-subnav {
  position: sticky;
  top: 104px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin: 0 0 20px;
  border-radius: 999px;
  box-shadow: 0 18px 46px rgba(26, 115, 232, 0.20);
}
.financial-tab-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 1000;
  padding: 12px 18px;
}
.financial-tab-button.active,
.financial-tab-button:hover {
  background: var(--blue);
  color: #fff;
}
.financial-tab-panel { display: none; }
.financial-tab-panel.active { display: block; }
.financial-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) minmax(280px, 0.85fr);
  gap: 20px;
  margin-bottom: 20px;
}
.financial-allocation-content {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}
.allocation-donut {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--surface-2) 0 100%);
  box-shadow: inset 0 0 0 1px var(--border), 0 18px 40px rgba(26, 115, 232, 0.14);
}
.allocation-donut::after {
  content: "";
  position: absolute;
  inset: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
}
.allocation-donut span,
.allocation-donut small {
  position: relative;
  z-index: 1;
  text-align: center;
}
.allocation-donut span {
  display: block;
  max-width: 120px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 1000;
  letter-spacing: -0.05em;
}
.allocation-donut small {
  margin-top: 40px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.allocation-legend,
.financial-metric-list,
.financial-agent-grid {
  display: grid;
  gap: 10px;
}
.allocation-row,
.financial-metric-row,
.financial-agent-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
}
.allocation-row {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 10px;
}
.allocation-color {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--allocation-color, var(--blue));
}
.allocation-row small,
.financial-metric-row small,
.financial-agent-card p {
  color: var(--muted);
  line-height: 1.45;
}
.financial-metric-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.financial-metric-row span {
  display: block;
  text-align: right;
  font-weight: 1000;
  font-size: 1.15rem;
}
.financial-metric-row .positive { color: var(--green); }
.financial-metric-row .negative { color: var(--red); }
.financial-agent-lab {
  display: grid;
  gap: 20px;
}
.financial-agent-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.financial-agent-card strong { color: var(--blue); font-size: 1.15rem; }
.financial-agent-card span {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}
@media (max-width: 1120px) {
  .financial-dashboard-grid,
  .financial-agent-grid { grid-template-columns: 1fr; }
  .financial-allocation-content { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 680px) {
  .financial-subnav { width: 100%; border-radius: 24px; flex-direction: column; align-items: stretch; }
  .financial-tab-button { width: 100%; }
  .allocation-donut { width: 190px; height: 190px; }
  .allocation-row,
  .financial-metric-row { grid-template-columns: 1fr; }
  .financial-metric-row span { text-align: left; }
}

/* YouTube playlist downloader */
.playlist-page { max-width: 1000px; margin: 0 auto; }
.playlist-hero, .playlist-result, .playlist-progress-panel { padding: clamp(24px, 5vw, 48px); }
.playlist-hero-copy { text-align: center; margin: 0 auto 30px; }
.playlist-hero-copy h1 { max-width: none; font-size: clamp(2.4rem, 7vw, 5rem); }
.playlist-hero-copy p { max-width: 680px; margin: 20px auto 0; color: var(--muted); line-height: 1.65; font-size: 1.05rem; }
.playlist-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; max-width: 820px; margin: 0 auto; }
.playlist-search-form input { min-width: 0; min-height: 58px; padding: 0 22px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; outline: none; }
.playlist-search-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.playlist-search-button, .playlist-download-button, .playlist-zip-link { border: 0; border-radius: 999px; color: #fff; font-weight: 900; cursor: pointer; transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease; }
.playlist-search-button { min-width: 140px; padding: 0 26px; background: #1a73e8; box-shadow: 0 14px 30px rgba(26, 115, 232, 0.24); }
.playlist-search-button:hover:not(:disabled) { background: #1558b0; transform: translateY(-1px); }
.playlist-search-button:disabled, .playlist-download-button:disabled { cursor: wait; opacity: 0.72; }
.button-spinner { display: none; width: 17px; height: 17px; margin-right: 8px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; vertical-align: -3px; animation: spin-refresh .75s linear infinite; }
.playlist-search-button.is-loading .button-spinner { display: inline-block; }
.playlist-notice { min-height: 24px; margin: 16px auto 0; text-align: center; color: var(--muted); }
.playlist-notice.loading { color: var(--blue); }
.playlist-notice.success { color: var(--green); }
.playlist-notice.error { color: var(--red); font-weight: 700; }
.playlist-result, .playlist-progress-panel { margin-top: 22px; }
.playlist-result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.playlist-result-head h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.04em; }
.playlist-summary { color: var(--muted); line-height: 1.5; }
.playlist-format-pill { flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; background: var(--surface-2); color: var(--blue); font-weight: 900; font-size: .85rem; }
.playlist-entry-list { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.playlist-entry { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--surface) 82%, var(--surface-2)); }
.playlist-entry img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.playlist-entry strong, .playlist-entry span { display: block; overflow-wrap: anywhere; }
.playlist-entry strong { margin-bottom: 7px; line-height: 1.35; }
.playlist-entry span { color: var(--muted); font-size: .9rem; }
.playlist-entry.unavailable { opacity: .7; border-color: color-mix(in srgb, var(--red) 36%, var(--border)); }
.playlist-entry.unavailable span { color: var(--red); }
.playlist-download-actions { display: flex; justify-content: center; margin-top: 30px; }
.playlist-download-button { min-width: 230px; min-height: 58px; padding: 0 30px; background: #188038; box-shadow: 0 14px 30px rgba(24, 128, 56, .24); font-size: 1.05rem; }
.playlist-download-button:hover:not(:disabled) { background: #11682c; transform: translateY(-1px); }
.playlist-stage-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 26px 0 14px; }
.playlist-stage-list span { padding: 10px 8px; border-radius: 12px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: .82rem; font-weight: 800; }
.playlist-stage-list span.active { background: color-mix(in srgb, var(--blue) 18%, var(--surface)); color: var(--blue); outline: 2px solid color-mix(in srgb, var(--blue) 40%, transparent); }
.playlist-stage-list span.complete { background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green); }
.playlist-stage-list span.error { background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: var(--red); }
.playlist-progress-track { height: 18px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.playlist-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1a73e8, #8ab4f8); transition: width .4s ease; }
.playlist-progress-track span.error { background: var(--red); }
.playlist-zip-link { display: flex; width: fit-content; min-height: 56px; align-items: center; justify-content: center; margin: 26px auto 0; padding: 0 28px; background: #188038; box-shadow: 0 14px 30px rgba(24, 128, 56, .24); }
.playlist-zip-link:hover { background: #11682c; transform: translateY(-1px); }
.playlist-legal { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }

@media (max-width: 720px) {
  .playlist-search-form { grid-template-columns: 1fr; }
  .playlist-search-button { min-height: 56px; }
  .playlist-result-head { display: grid; }
  .playlist-format-pill { width: fit-content; }
  .playlist-entry { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .playlist-entry img { width: 84px; }
  .playlist-stage-list { grid-template-columns: 1fr 1fr; }
}
