@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --panel: #12161e;
  --line: #252b36;
  --muted: #858e9e;
  --text: #e9edf4;
  --lime: #c0ef79;
  --orange: #f1bd72;
}
* {
  box-sizing: border-box;
}
html {
  overflow-y: scroll;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px "DM Sans",
    system-ui,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
input:focus,
select:focus {
  outline: 1px solid var(--lime);
}
.sidebar {
  width: 244px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #10131a;
  border-right: 1px solid var(--line);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand {
  --brand-orange: #f59a45;
  text-decoration: none;
  color: #fafafa;
  font:
    bold 20px "Space Grotesk",
    sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.7px;
}
.brand-name {
  white-space: nowrap;
}
.brand-secondary {
  font-weight: 400;
  color: #a2aab7;
}
.brand-initial {
  color: var(--brand-orange);
}
.brand-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  background-color: var(--brand-orange);
  -webkit-mask: url('/static/ad_icon.webp') center / contain no-repeat;
  mask: url('/static/ad_icon.webp') center / contain no-repeat;
}
.server small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.nav-label {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #687284;
  margin: 5px 12px -12px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  padding: 12px;
  border-radius: 7px;
  text-align: left;
  color: #9ca5b6;
  font-size: 12px;
}
nav button.selected {
  background: #202a20;
  color: var(--lime);
}
nav b {
  margin-left: auto;
  background: #303b2c;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.sidebar-main { min-height: 0; overflow-y: auto; }
.sidebar-bottom { margin-top: auto; flex-shrink: 0; }
.server {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.dot.amber {
  background: var(--orange);
}
main {
  margin-left: 244px;
}
header {
  height: 72px;
  border-bottom: 1px solid #1c222d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  font-size: 11px;
  color: #8993a3;
}
.slash {
  margin: 0 15px;
  color: #444d5c;
}
#breadcrumb {
  color: #d3dae6;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}
.header-actions form {
  margin: 0;
}
.header-actions .secondary {
  padding: 6px 9px;
}
.readonly-badge {
  font: 10px monospace;
  color: var(--orange);
  border: 1px solid #59472d;
  background: #211c15;
  border-radius: 5px;
  padding: 6px 9px;
}
.content {
  max-width: 1600px;
  margin: auto;
  padding: 38px 40px 20px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
h1 {
  font:
    500 36px "Space Grotesk",
    sans-serif;
  letter-spacing: -1.5px;
  margin: 10px 0;
}
.accent {
  color: var(--lime);
}
.secondary {
  background: #1b212b;
  border: 1px solid #343d4b;
  border-radius: 7px;
  padding: 11px 14px;
  font-size: 11px;
}
.secondary:hover {
  border-color: #7a915e;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #11151c;
  margin-bottom: 35px;
}
.stat {
  padding: 20px 23px;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border: 0;
}
.stat-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
.stat-value {
  font:
    500 30px "Space Grotesk",
    sans-serif;
  margin-top: 10px;
}
.stat-value small {
  font:
    10px "DM Sans",
    sans-serif;
  margin-left: 10px;
  color: #727f90;
}
.green {
  color: var(--lime);
}
.amber {
  color: var(--orange);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
h2 {
  font:
    500 17px "Space Grotesk",
    sans-serif;
  margin: 0;
}
.section-heading h2 span {
  font: 10px monospace;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #a2acbb;
  margin-left: 6px;
}
.muted {
  color: var(--muted);
}
.live-label {
  font-size: 10px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.search {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #10141b;
  padding: 0 6px 0 12px;
}
.search:focus-within {
  outline: 1px solid var(--lime);
}
.search input:focus {
  outline: none;
}
.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  padding: 3px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #818c9d);
  cursor: pointer;
}
.search-clear:hover { color: var(--text); }
.search-clear:focus-visible { outline-offset: 1px; }
.search-icon {
  display: block;
  flex: 0 0 20px;
  color: #818c9d;
}
.search input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  padding: 11px 0;
  font-size: 11px;
  color: var(--text);
}
select {
  background: #12171f;
  color: #aeb7c7;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 7px;
  font-size: 11px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card {
  --status-color: #8590a0;
  background: var(--panel);
  border: 1px solid var(--status-color);
  border-radius: 11px;
  padding: 24px 20px 20px;
  transition: border-color 0.15s;
  position: relative;
  min-width: 0;
}
.card[data-status="idle"] { --status-color: #91ad78; }
.card[data-status="running"] { --status-color: var(--lime); }
.card[data-status="waiting_for_confirmation"] { --status-color: var(--orange); }
.card[data-status="paused"] { --status-color: #b6afda; }
.card[data-status="finished"] { --status-color: #606060; }
.card[data-status="error"],
.card[data-status="stuck"] { --status-color: #ee9393; }
.card[data-status="deleting"] { --status-color: #d6ab79; }
.card-status {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 32px);
  padding: 0 8px;
  background: var(--panel);
  color: var(--status-color);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.agent-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #232c27;
  border: 1px solid #344038;
  color: #c7e4ac;
  font: 16px monospace;
}
.card:nth-child(3n + 2) .agent-icon {
  background: #282438;
  border-color: #3c3550;
  color: #bbacf0;
}
.card:nth-child(3n) .agent-icon {
  background: #1d2c36;
  border-color: #2a4254;
  color: #8ccce7;
}
.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 9px;
  border-radius: 4px;
  padding: 5px 7px;
  background: #202a1e;
  color: var(--lime);
}
.badge.waiting {
  background: #30281d;
  color: var(--orange);
}
.badge.paused {
  background: #262736;
  color: #b6afda;
}
.badge.done {
  background: #1b2b33;
  color: #89c7dc;
}
.badge.error {
  background: #352022;
  color: #ee9393;
}
.card h3 {
  font:
    500 16px "Space Grotesk",
    sans-serif;
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}
.card-agent-id {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: #8590a0;
  font: 10px monospace;
  overflow-wrap: anywhere;
  user-select: text;
}
.copy-session-id { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font: inherit; white-space: nowrap; }
.copy-session-id:hover { color: var(--lime); border-color: var(--lime); }
.copy-session-id svg { flex-shrink: 0; }
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 10px;
  color: #b9c2d0;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.card-meta span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #8590a0;
  font-size: 10px;
  margin: 14px 0 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6f7c8f;
  font: 9px monospace;
}
.open-detail {
  background: transparent;
  color: #bec9d7;
  font:
    10px "DM Sans",
    sans-serif;
  padding: 6px;
}
.open-detail:hover {
  color: var(--lime);
}
footer {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  color: #4f5b6d;
  font-size: 9px;
  margin-top: 33px;
  padding-top: 20px;
  border-top: 1px solid #1d232d;
}
footer > span:first-child {
  letter-spacing: 1.6px;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 70px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
}
dialog {
  background: #11161e;
  color: var(--text);
  border: 1px solid #35404f;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 30px 100px #0009;
}
dialog::backdrop {
  background: #05070bd4;
  backdrop-filter: blur(5px);
}
.details {
  width: min(850px, calc(100vw - 30px));
  height: 90dvh;
  max-width: none;
  max-height: none;
  overflow: hidden;
  transition: width 180ms ease-out, height 180ms ease-out, border-radius 180ms ease-out;
}
.details[data-fullscreen="true"] {
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  border: 0;
}
html:has(#details[open][data-fullscreen="true"]) { overflow: hidden; }
.detail-window-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
#details .dialog-heading { gap: 16px; }
#details .dialog-heading h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
#detail-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#detail-content > .dialog-heading {
  flex-shrink: 0;
}
.dialog-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #11161e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading h2 {
  margin-top: 8px;
  font-size: 23px;
}
.icon-button {
  background: #232b37;
  color: #aeb9c9;
  font-size: 22px;
  border-radius: 6px;
  width: 30px;
  height: 30px;
}
.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.detail-body > .conversation,
.detail-body > .detail-side {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.conversation {
  padding: 25px;
  min-width: 0;
}
.detail-side {
  display: flex;
  flex-direction: column;
  background: #0e131a;
  border-left: 1px solid var(--line);
  padding: 25px 20px;
}
.detail-side > * { flex-shrink: 0; }
.technical-events-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 24px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.technical-events-toggle input { margin: 0; flex-shrink: 0; }
.session-bottom { margin-top: auto; }
.goal-panel { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
.goal-panel h3 { font-size: 14px; }
.goal-panel label { display: block; font-size: 12px; margin: 10px 0 6px; }
.goal-panel textarea, .goal-panel input { width: 100%; box-sizing: border-box; background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 8px; border-radius: 6px; }
.goal-panel button { margin-top: 8px; }
.goal-panel p { overflow-wrap: anywhere; }
.session-bottom > button { width: 100%; margin-top: 16px; }
.detail-side dt {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
}
.detail-side dd {
  font-size: 12px;
  margin: 0 0 24px;
  overflow-wrap: anywhere;
}
.message {
  background: #1b222d;
  border: 1px solid #2a3442;
  padding: 14px;
  border-radius: 8px;
  margin: 14px 0;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.message.agent {
  background: #18221c;
  border-color: #2c3b2d;
}
.message strong {
  display: block;
  font-size: 10px;
  color: var(--lime);
  margin-bottom: 5px;
}
.message.user strong {
  color: #aebed8;
}
.timeline {
  padding: 12px 0;
  color: #8c9aab;
  font: 10px monospace;
  line-height: 1.8;
}
.form-note {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
@media (min-width: 1600px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1150px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content {
    padding: 30px 25px;
  }
  .stat {
    padding: 16px;
  }
  .stat-value small {
    display: block;
    margin: 5px 0 0;
  }
  .sidebar {
    width: 215px;
    padding: 25px 16px;
  }
  .brand {
    font-size: 18px;
    gap: 6px;
  }
  main {
    margin-left: 215px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: relative;
    width: auto;
    padding: 15px;
    gap: 15px;
  }
  .brand {
    font-size: 22px;
  }
  .nav-label {
    display: none;
  }
  nav {
    display: flex;
  }
  nav button {
    flex: 1;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  main {
    margin-left: 0;
  }
  header {
    height: 50px;
    padding: 0 20px;
  }
  .content {
    padding: 25px 18px;
  }
  .heading {
    align-items: flex-start;
    gap: 15px;
  }
  h1 {
    font-size: 29px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 25px;
  }
  .stat:nth-child(2) {
    border: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .search {
    flex-basis: 100%;
  }
  .toolbar select {
    flex: 1;
    min-width: 0;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .detail-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  }
  .detail-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .dialog-heading {
    padding: 20px;
  }
  .dialog-heading h2 {
    font-size: 20px;
  }
  .conversation {
    padding: 20px;
  }
  footer {
    flex-wrap: wrap;
  }
  .live-label {
    font-size: 9px;
  }
  .stats .stat-value {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

[hidden] { display: none !important; }
.message-text { white-space: pre-wrap; }
#connection-error, #event-error { color: var(--orange); line-height: 1.6; }
#load-more { margin-top: 20px; }
button:disabled, button[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.badge.unknown, .badge.idle, .badge.deleting { color: #b1bac9; background: #252b36; }

.server > .dot { flex-shrink: 0; align-self: flex-start; margin-top: 5px; }
.server .diagnostic-error { color: var(--orange); }

.project-editor { border-top: 1px solid var(--border, #303642); margin-top: 24px; padding-top: 20px; }
.project-editor label { display: block; margin-bottom: 8px; font-size: 12px; }
.project-editor select, .project-editor input {
  display: block; width: 100%; min-width: 0; box-sizing: border-box;
  background: #141923; color: #e9eef5; border: 1px solid #3b4556;
  border-radius: 8px; padding: 10px; margin-bottom: 10px; font: inherit;
}
.project-editor button { margin: 0 4px 8px 0; }
.project-editor form { margin-top: 14px; }
.card-project { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; color: #b1bac9; }
.card-top { gap: 12px; }


.launch-dialog { width: min(640px, calc(100vw - 32px)); max-height: 90vh; overflow: auto;
  color: #e9eef5; background: #141923; border: 1px solid #3b4556; border-radius: 16px; padding: 0; }
.launch-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.launch-form { padding: 24px; }
.launch-form label { display: block; font-size: 13px; margin: 16px 0 8px; }
.launch-form input, .launch-form select, .launch-form textarea { width: 100%; box-sizing: border-box;
  background: #1b2330; color: #e9eef5; border: 1px solid #3b4556; border-radius: 8px; padding: 10px; font: inherit; }
.launch-form textarea { resize: vertical; }
.launch-form :is(input,select,textarea):focus { outline: 2px solid #9caaff; outline-offset: 2px; }
.launch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.project-editor input:focus, .project-editor select:focus { outline: 2px solid #9caaff; outline-offset: 2px; }

.heading { flex-wrap: wrap; gap: 20px; }
.new-agent-button {
  flex-shrink: 0; background: var(--lime); color: #141923;
  border: 1px solid var(--lime); border-radius: 8px;
  padding: 12px 18px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.new-agent-button:hover { filter: brightness(1.08); }
.new-agent-button:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
/* Tool calls keep commands and results readable without expanding the timeline. */
.tool-event { margin: 10px 0; border: 1px solid var(--border, #39413c); border-radius: 10px; }
.tool-placeholder { padding: 12px; color: var(--muted); }
.tool-event summary { cursor: pointer; padding: 12px; overflow-wrap: anywhere; }
.tool-event summary span { display: block; font-size: 12px; opacity: .65; margin-top: 5px; }
.tool-body { padding: 0 12px 12px; min-width: 0; }
.tool-body pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; padding: 12px; border-radius: 6px; background: rgba(0,0,0,.15); font-size: 12px; }
.tool-result { margin-top: 14px; }
.message-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.message-toggle { font-size: 11px; padding: 6px 9px; }
.markdown-message { overflow-wrap: anywhere; line-height: 1.65; }
.markdown-message p { margin: 0 0 1em; }
.markdown-message h1, .markdown-message h2, .markdown-message h3 { margin: 1em 0 .5em; line-height: 1.3; }
.markdown-message h1 { font-size: 1.5em; }
.markdown-message h2 { font-size: 1.3em; }
.markdown-message h3 { font-size: 1.15em; }
.message .markdown-message strong { display: inline; font-size: inherit; color: inherit; margin: 0; }
.markdown-message a { color: #b5d989; text-decoration: underline; }
.markdown-message ul, .markdown-message ol { padding-left: 1.6em; margin: .6em 0 1em; }
.markdown-message li { margin: .3em 0; }
.markdown-message blockquote { margin: 1em 0; padding: .5em 1em; border-left: 3px solid #789b65; }
.markdown-message pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: rgba(0,0,0,.2); border-radius: 6px; }
.markdown-message code { font-family: monospace; background: rgba(0,0,0,.15); padding: .1em .3em; border-radius: 3px; }
.markdown-message pre code { padding: 0; background: none; }
.markdown-table { overflow-x: auto; margin: 1em 0; }
.markdown-table table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 12px; }
.markdown-table th, .markdown-table td { padding: 10px; border: 1px solid #39413c; text-align: left; vertical-align: top; }
.markdown-table th { background: rgba(0,0,0,.15); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 7px; color: #9ca5b6; font-size: 12px; text-decoration: none; }
.nav-link.selected { background: #202a20; color: var(--lime); }
.nav-link:hover { background: #1b222d; }
.usage-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 24px 0; }
.usage-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.usage-filters input, .usage-filters select { padding: 10px; border: 1px solid #343d4b; border-radius: 7px; background: #151b24; color: #e1e8ed; color-scheme: dark; }
.usage-chart { margin: 24px 0; padding: 20px; background: #11151c; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.usage-chart h2 { font-size: 17px; margin: 0 0 18px; }
.usage-chart summary { cursor: pointer; }
.usage-plot { overflow-x: auto; }
.usage-plot svg { display: block; width: 100%; max-height: 340px; }
.usage-plot text { fill: #aebed0; font-size: 10px; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; }
.usage-legend span { display: flex; align-items: center; gap: 6px; }
.usage-legend i { width: 10px; height: 10px; border-radius: 3px; }
.usage-table { overflow-x: auto; }
.usage-table table { border-collapse: collapse; width: 100%; font-size: 12px; }
.usage-table th, .usage-table td { padding: 12px; border-bottom: 1px solid #2c3541; text-align: right; }
.usage-table th:first-child, .usage-table td:first-child { text-align: left; }
#usage-filter-error { color: #ef92ae; }
#usage-summary .stat-value { font-size: 25px; overflow-wrap: anywhere; }
nav b:empty { display: none; }

#fullscreen-details { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
#fullscreen-details svg { display: block; flex-shrink: 0; }

.message-composer { flex-shrink: 0; padding: 12px 20px; border-top: 1px solid var(--line); }
.message-composer label { display: block; font-size: 12px; margin-bottom: 6px; }
.message-composer textarea { width: 100%; min-height: 54px; max-height: 110px; resize: vertical; background: #151b24; color: var(--text); border: 1px solid #343d4b; border-radius: 7px; padding: 10px; font: inherit; font-size: 13px; }
.message-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; }
.message-send-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.session-context { text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.instruction-settings { max-width: 1000px; }
.instruction-snapshot pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font: inherit; }
.session-context progress { display: block; width: 100%; height: 5px; margin-top: 5px; border: 0; border-radius: 999px; overflow: hidden; appearance: none; background: var(--line); }
.session-context progress[hidden] { display: none; }
.session-context progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.session-context progress::-webkit-progress-value { background: var(--lime); border-radius: 999px; transition: width .15s ease; }
.session-context progress::-moz-progress-bar { background: var(--lime); border-radius: 999px; }
.message-composer .form-note { margin: 6px 0 0; }

.message-actions #refresh-detail { justify-self: end; }
@media (max-width: 700px) {
  .message-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .message-actions .session-context { grid-column: 1 / -1; grid-row: 2; }
}

.title-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 0; flex: 1; min-width: 0; }
.title-editor input { min-width: 0; width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font: 500 18px "Space Grotesk", sans-serif; }
.title-editor button { justify-self: start; }
.title-editor .form-note { margin: 0; grid-column: 1 / -1; }
.title-editor .form-note:empty { display: none; }
#details .dialog-heading:has(.title-editor) { align-items: flex-start; --title-control-height: 40px; }
#details .title-editor input,
#details .title-editor button,
#details .dialog-heading:has(.title-editor) .icon-button {
  box-sizing: border-box;
  height: var(--title-control-height);
}
#details .dialog-heading:has(.title-editor) .icon-button {
  width: var(--title-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
@media (max-width: 600px) {
  .title-editor { grid-template-columns: minmax(0, 1fr); }
  .title-editor input { font-size: 16px; }
}

#details .dialog-heading:has(.title-editor) .icon-button { font-size: 28px; }
#details .dialog-heading:has(.title-editor) #fullscreen-details svg { width: 24px; height: 24px; }

.department-nav summary { cursor: pointer; list-style: none; }
.department-nav summary::-webkit-details-marker { display: none; }
.department-chevron { display: block; flex-shrink: 0; margin-left: auto; transition: transform 150ms; }
.department-nav[open] .department-chevron { transform: rotate(180deg); }
#department-links { display: grid; gap: 4px; padding: 4px 0 8px 22px; }
.department-link { display: block; padding: 8px 10px; border-radius: 6px; color: #aeb7c7; text-decoration: none; font-size: 12px; overflow-wrap: anywhere; }
.department-link:hover { background: #202a1e; }
.department-link.selected { color: var(--lime); background: #202a1e; }
.sidebar nav { overflow-y: auto; min-height: 0; }

.automation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.automation-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.automation-card { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: var(--panel); }
.automation-card h2 { margin: 0; overflow-wrap: anywhere; }
.automation-card p { margin: 0; color: var(--muted); font-size: 12px; }
.automation-card.selected { border-color: var(--lime); }
.automation-card button { justify-self: start; }
.automation-detail { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.automation-detail h2 { overflow-wrap: anywhere; }
.automation-detail .heading { gap: 16px; flex-wrap: wrap; }
.automation-description { white-space: pre-wrap; max-height: 130px; overflow: auto; color: var(--muted); }
.automation-history th, .automation-history td { text-align: left; vertical-align: top; }
.automation-history td:nth-child(3) { max-width: 360px; white-space: normal; overflow-wrap: anywhere; }
.automation-tag { display: block; color: var(--lime); font-size: 11px; margin: 0 0 12px; text-decoration: none; overflow-wrap: anywhere; }
.automation-form-row { display: flex; align-items: center; gap: 10px; }
.automation-form-row input[type="checkbox"] { width: auto; }
.automation-form-row input[type="number"] { width: 100px; }
#automation-memory { font: 12px monospace; }
#automation-editor { max-height: 90dvh; overflow-y: auto; }
#automation-worker { margin-bottom: 20px; }
header a { color: inherit; text-decoration: none; }
header a:hover { color: var(--text); }
.mcp-section { margin-top: 28px; }
.mcp-section summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.mcp-error { color: var(--orange); line-height: 1.6; }
.mcp-error:empty { display: none; }
.mcp-ok { color: var(--lime); line-height: 1.6; }
.mcp-list { padding-left: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.mcp-table th, .mcp-table td { text-align: left; }
.mcp-table a, .mcp-list a, .mcp-facts a, .mcp-job a { color: var(--lime); }
.mcp-tag { margin-left: 8px; font-size: 10px; color: var(--orange); border: 1px solid #59472d; border-radius: 5px; padding: 2px 6px; }
.mcp-job-heading { justify-content: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.mcp-job-heading h2 { margin: 0; overflow-wrap: anywhere; }
.mcp-result { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.mcp-result.yellow { border-color: #59472d; color: var(--orange); }
.mcp-result.red { border-color: #6b2f35; color: #f08a8a; }
.mcp-result.green { border-color: #48593a; color: var(--lime); }
.mcp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 20px; }
.mcp-facts dt { color: var(--muted); }
.mcp-facts dd { margin: 0; overflow-wrap: anywhere; }
.mcp-facts ul { margin: 0; padding-left: 18px; }
.mcp-reasons { padding-left: 18px; line-height: 1.7; overflow-wrap: anywhere; }
.mcp-reasons li.block { color: #f08a8a; font-weight: 600; }
.mcp-reasons li.lower { color: var(--muted); }
.mcp-reasons details { font-weight: 400; color: var(--muted); }
.mcp-form { max-width: 640px; margin-top: 24px; }
.mcp-field { display: grid; gap: 6px; margin-bottom: 14px; }
.mcp-field .form-note { margin: 0; }
.mcp-required { color: var(--orange); }
.mcp-stages { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.mcp-stages li { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.mcp-stages li.done { color: var(--lime); border-color: #48593a; }
.mcp-stages li.current { color: var(--text); border-color: var(--lime); }
.mcp-log { max-height: 360px; overflow: auto; background: #0e1218; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12px monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.mcp-danger { border: 1px solid #6b2f35; border-radius: 10px; padding: 4px 20px 20px; max-width: 640px; display: grid; gap: 10px; }
.mcp-danger h2 { color: #f08a8a; }
.secondary.danger { border-color: #6b2f35; color: #f08a8a; justify-self: start; }
@media (max-width: 700px) { .mcp-facts { grid-template-columns: 1fr; } }
.mcp-reasons > .dismissed > .mcp-reason-text { text-decoration: line-through; color: var(--muted); }
.mcp-review-form textarea { display: block; width: 100%; box-sizing: border-box; margin: 8px 0; }
.agent-config-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 10px; }
.agent-config-tabs [role="tab"] { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 6px; padding: 10px 16px; cursor: pointer; font: inherit; }
.agent-config-tabs [aria-selected="true"] { color: #e4e8ff; background: #242b40; border-color: #424f76; }
.agent-config-tabs [role="tab"]:focus-visible { outline: 2px solid #9caaff; outline-offset: 2px; }
.nextcloud-integration { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 12px 0; overflow-wrap: anywhere; }
.nextcloud-deliveries { max-height: 500px; overflow: auto; }
.launch-form .nextcloud-enabled input { width: auto; }
