[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --surface: #fff;
  --surface2: #f8faf9;
  --ink: #1c302f;
  --muted: #637773;
  --line: #e0e8e4;
  --accent: #087f64;
  --accent-bg: #e6f5ee;
  --sidebar: #102c2b;
  --shadow: 0 12px 35px #183c3010;
  --warn: #9a6319;
  --warn-bg: #fff5df;
  --danger: #a34444;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101b1b;
  --surface: #182828;
  --surface2: #1d3030;
  --ink: #e2eeea;
  --muted: #a0b6af;
  --line: #2c4140;
  --accent: #79dfb8;
  --accent-bg: #23463b;
  --sidebar: #0c2020;
  --shadow: 0 12px 35px #0002;
  --warn: #f4cb7f;
  --warn-bg: #423823;
  --danger: #f1a2a2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #4fc49b;
  outline-offset: 3px;
}
button,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
}
button {
  padding: 9px 13px;
  font-weight: 600;
  transition: background 0.15s;
}
button:hover:not(:disabled) {
  background: var(--surface2);
}
button.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
button.primary:hover:not(:disabled) {
  filter: brightness(0.93);
  background: var(--accent);
}
[data-theme="dark"] button.primary {
  color: #08251e;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
input,
select,
textarea {
  padding: 8px 11px;
  max-width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
}
input[type="password"] {
  font-family: ui-monospace, monospace;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 660;
  line-height: 1.25;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 14px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 18px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  background: var(--sidebar);
  color: #d7e6df;
  padding: 18px 14px 12px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 246px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.brand img {
  width: 39px;
  height: 39px;
}
.brand span small {
  display: block;
  font-size: 10px;
  font-weight: 450;
  color: #91aaa1;
  letter-spacing: 0.4px;
  margin-top: 5px;
}
.nav {
  overflow: auto;
  scrollbar-width: thin;
  flex: 1;
  padding: 0 0 10px;
}
.nav-group {
  font-size: 9px;
  color: #7e9e92;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 11px 5px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #b2c9bf;
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  min-height: 36px;
  margin: 1px 0;
}
.nav a:hover {
  background: #ffffff08;
  color: #fff;
}
.nav a.active {
  background: #284941;
  color: #b3f4d4;
}
.nav a.active .icon {
  color: #76ddb0;
}
.sidefoot {
  border-top: 1px solid #315048;
  padding: 15px 9px 0;
  font-size: 11px;
  color: #96b2a5;
}
.sidefoot .dot {
  background: #6dd8a9;
  margin-right: 6px;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.selector {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.selector select {
  border-color: transparent;
  font-weight: 600;
  max-width: 185px;
  background: transparent;
  padding-left: 3px;
  font-size: 13px;
}
.topright {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
}
.avatar {
  background: var(--accent-bg);
  color: var(--accent);
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 750;
  font-size: 11px;
  flex: none;
}
.divider {
  width: 1px;
  height: 25px;
  background: var(--line);
}
.content {
  padding: 32px 34px 48px;
  max-width: 1640px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
}
.page-head p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 9px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.pill.good {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: transparent;
}
.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: transparent;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: currentColor;
  display: inline-block;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
}
.notice .icon {
  color: var(--accent);
}
.notice strong {
  color: var(--ink);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body {
  padding: 22px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 {
  font-size: 14px;
}
.metric {
  padding: 21px;
}
.metric-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.metric-label .icon {
  color: var(--accent);
  background: var(--accent-bg);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  padding: 6px;
}
.metric-value {
  font-size: 31px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -1px;
  margin-top: 10px;
}
.metric-foot {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--muted);
  background: var(--surface2);
  padding: 11px 21px;
  white-space: nowrap;
}
td {
  padding: 15px 21px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
td .small {
  font-size: 10px;
}
tr:first-child td {
  border-top: 0;
}
.server-mark {
  width: 32px;
  height: 34px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--accent);
  flex: none;
}
.progress {
  height: 5px;
  min-width: 65px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  max-width: 100%;
}
.list-item {
  padding: 15px 21px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.list-item:last-child {
  border: 0;
}
.list-item h3 {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.list-item p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.list-item .icon {
  color: var(--accent);
  margin-top: 2px;
}
.list-item time {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.empty {
  padding: 34px 23px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 9px;
  color: var(--accent);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 5px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.segmented {
  display: inline-flex;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.segmented button {
  border: 0;
  background: transparent;
  font-size: 11px;
  padding: 7px 12px;
}
.segmented button.selected {
  background: var(--surface);
  box-shadow: 0 1px 4px #0001;
  color: var(--accent);
}
.chat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: 560px;
}
.chat-list {
  border-right: 1px solid var(--line);
  padding: 14px;
  background: var(--surface2);
}
.chat-list button {
  display: block;
  text-align: left;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.chat-list button.active {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.chat-list .pill {
  margin-top: 7px;
}
.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-title {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.chat-messages {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 330px;
  max-height: 560px;
  overflow: auto;
  flex: 1;
}
.message {
  max-width: 86%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
}
.message.user {
  align-self: flex-end;
  background: var(--accent-bg);
  padding: 13px 17px;
  border-radius: 12px 12px 3px 12px;
}
.message.assistant {
  padding: 0 4px;
}
.message-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  white-space: normal;
}
.composer {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
}
.composer textarea {
  width: 100%;
  border: 0;
  background: var(--surface2);
  min-height: 70px;
}
.composer .row {
  justify-content: space-between;
  margin-top: 9px;
}
.session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.session-card {
  padding: 20px;
}
.session-card h2 {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.session-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  font-size: 11px;
}
.session-meta dt {
  color: var(--muted);
  margin-bottom: 3px;
}
.session-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.actions button {
  font-size: 11px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 12px;
}
.field label {
  font-weight: 600;
}
.code {
  background: var(--surface2);
  border: 1px solid var(--line);
  padding: 13px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 8px;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.capability {
  padding: 22px;
}
.capability .icon {
  color: var(--accent);
  width: 25px;
  height: 25px;
  margin-bottom: 16px;
}
.capability p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 9px;
  min-height: 40px;
}
.capability .pill {
  margin-top: 17px;
}
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-brand {
  background: var(--sidebar);
  color: #e4f0e8;
  padding: 10vw 8vw;
  display: flex;
  justify-content: center;
  flex-direction: column;
}
.login-brand img {
  width: 60px;
  height: 60px;
  margin-bottom: 45px;
}
.login-brand h1 {
  font-size: 43px;
  max-width: 440px;
  letter-spacing: -1.9px;
}
.login-brand p {
  color: #a5bfb2;
  max-width: 370px;
  line-height: 1.8;
  margin-top: 22px;
}
.login-form {
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 9vw;
  max-width: 670px;
}
.login-form h2 {
  font-size: 27px;
  margin-bottom: 10px;
}
.login-form form {
  display: grid;
  gap: 15px;
  margin: 27px 0;
}
.login-form .notice {
  font-size: 11px;
}
.login-options {
  margin-top: 24px;
  display: flex;
  gap: 9px;
}
.login-options button {
  font-size: 11px;
}
.menu-toggle {
  display: none;
}
.mobile-shade {
  display: none;
}
.footer-note {
  color: var(--muted);
  font-size: 10px;
  margin-top: 26px;
}
.loading {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100vw - 30px);
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  padding: 12px 20px;
  font-size: 13px;
  box-shadow: 0 10px 40px #0002;
  display: none;
}
.secret {
  user-select: all;
}
.error-text {
  color: var(--danger);
  font-size: 12px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (min-width: 1600px) {
  .content {
    padding-top: 40px;
  }
  .metric-grid {
    gap: 20px;
  }
  .card-body {
    padding: 26px;
  }
}
@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .sidebar {
    width: 216px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand {
    font-size: 12px;
  }
  .topbar {
    padding: 15px 22px;
  }
  .content {
    padding: 26px 22px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric-grid {
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .metric-value {
    font-size: 26px;
  }
  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user-name {
    display: none;
  }
  .chat-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}
@media (max-width: 800px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s;
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-shade.open {
    display: block;
    position: fixed;
    inset: 0;
    background: #001b2470;
    z-index: 35;
  }
  .main {
    width: 100%;
  }
  .topbar {
    padding: 12px 16px;
    min-height: 68px;
    gap: 10px;
  }
  .menu-toggle {
    display: inline-flex;
    padding: 7px;
    border: 0;
  }
  .selector {
    gap: 3px;
    flex: 1;
  }
  .selector select {
    max-width: 155px;
    font-size: 11px;
    padding-right: 1px;
  }
  .topright {
    gap: 3px;
  }
  .topright button {
    padding: 7px;
    font-size: 11px;
  }
  .topright .divider {
    display: none;
  }
  .topright .avatar {
    display: none;
  }
  .content {
    padding: 23px 16px 36px;
  }
  .page-head h1 {
    font-size: 25px;
  }
  .page-head p {
    font-size: 12px;
  }
  .page-head {
    gap: 12px;
    margin-bottom: 20px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .session-grid {
    grid-template-columns: 1fr;
  }
  .card-head {
    padding: 17px;
  }
  .chat-layout {
    grid-template-columns: 1fr;
    min-height: 500px;
  }
  .chat-list {
    display: flex;
    gap: 8px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }
  .chat-list button {
    min-width: 155px;
    max-width: 210px;
    margin: 0;
  }
  .chat-list > .small {
    display: none;
  }
  .chat-title {
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 34px 25px;
  }
  .login-brand img {
    width: 40px;
    height: 40px;
    margin-bottom: 21px;
  }
  .login-brand h1 {
    font-size: 31px;
    max-width: 430px;
  }
  .login-brand p {
    display: none;
  }
  .login-form {
    padding: 34px 25px;
    max-width: 100%;
  }
  .login-form h2 {
    font-size: 24px;
  }
  .chat-messages {
    padding: 19px;
  }
  .message {
    max-width: 94%;
  }
  .card-body {
    padding: 18px;
  }
}
@media (max-width: 420px) {
  .selector select {
    max-width: 110px;
  }
  .selector select:nth-child(2) {
    max-width: 100px;
  }
  .topright .theme-toggle {
    display: none;
  }
  .topbar {
    gap: 4px;
  }
  .topright {
    margin-left: 0;
  }
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .page-head {
    display: block;
  }
  .page-head > .row {
    margin-top: 13px;
  }
  .metric {
    padding: 15px;
  }
  .metric-label {
    font-size: 10px;
  }
  .metric-value {
    font-size: 26px;
  }
  .capability-grid {
    grid-template-columns: 1fr;
  }
  .notice {
    font-size: 11px;
  }
  .brand {
    font-size: 14px;
  }
  .composer {
    padding: 13px;
  }
  .session-meta {
    font-size: 10px;
  }
  .toolbar {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.approval-binding {
  display: grid;
  gap: 7px;
  font-size: 10px;
  margin: 12px 0 0;
}
.approval-binding > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
}
.approval-binding dt {
  color: var(--muted);
}
.approval-binding dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  font-family: ui-monospace, monospace;
}
@media (max-width: 800px) {
  .sidebar {
    visibility: hidden;
  }
  .sidebar.open {
    visibility: visible;
  }
}
/* The operator shell remains available across dense and conversational workflows. */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.mobile-identity {
  display: none;
}
@media (max-width: 800px) {
  .mobile-identity {
    display: block;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
    font-size: 11px;
    overflow-wrap: anywhere;
  }
}
.sidebar > .brand,
.sidebar > .nav-collapse,
.sidebar > .sidefoot {
  flex: none;
}
.nav {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #466257 transparent;
}
.nav::-webkit-scrollbar {
  width: 4px;
}
.nav::-webkit-scrollbar-thumb {
  background: #466257;
  border-radius: 8px;
}
.nav-collapse {
  color: #aac6b9;
  background: transparent;
  border-color: #315048;
  align-self: flex-end;
  padding: 6px;
  margin: 5px 7px 9px;
}
.profile-avatar {
  border: 0;
  padding: 0;
}
.profile-avatar:hover {
  background: var(--accent-bg) !important;
}
.profile-panel {
  display: flex;
  gap: 17px;
  align-items: center;
}
.profile-panel > .avatar {
  width: 54px;
  height: 54px;
  font-size: 17px;
}
.profile-links {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 18px;
}
.metric {
  padding: 17px 19px;
}
.metric-value {
  font-size: 27px;
  margin-top: 6px;
}
.metric-foot {
  margin-top: 6px;
}
.capability {
  padding: 18px;
}
.capability .icon {
  margin-bottom: 9px;
}
.capability p {
  min-height: 0;
}
.capability .pill {
  margin-top: 12px;
}
.chat-page {
  gap: 14px;
}
.chat-page > .page-head {
  margin-bottom: 2px;
}
.chat-page > .toolbar {
  margin-bottom: 0;
}
.chat-layout {
  height: auto;
  min-height: 0;
  grid-template-columns: 254px minmax(0, 1fr);
}
.chat-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
  padding: 15px;
  max-height: max(32rem, calc(100dvh - 285px));
}
.chat-list > button {
  margin: 0;
  font-size: 12px;
  padding: 10px;
}
.chat-list > input {
  width: 100%;
  font-size: 11px;
  flex: none;
}
.archive-filter {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  padding: 0 2px;
}
.archive-filter input {
  padding: 0;
  accent-color: var(--accent);
}
.conversation-items {
  overflow: auto;
  scrollbar-width: thin;
  flex: 1;
  min-height: 0;
}
.conversation-items > button {
  padding: 12px 11px;
  border-color: transparent;
  background: transparent;
  margin: 3px 0;
  font-weight: 450;
}
.conversation-items > button.active {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 2px 7px #00000005;
}
.conversation-items > button strong {
  display: block;
  font-weight: 600;
  line-height: 1.5;
}
.conversation-meta {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
}
.chat-main {
  min-height: 0;
  position: relative;
}
.chat-title {
  padding: 17px 21px;
  flex: none;
}
.chat-title h2 {
  font-size: 14px;
}
.chat-messages {
  flex: 0 1 auto;
  min-height: 12rem;
  max-height: clamp(16rem, 52dvh, 48rem);
  padding: 23px 26px;
  scrollbar-width: thin;
  gap: 24px;
}
.message {
  max-width: 94%;
  font-size: 13px;
  white-space: normal;
}
.message.user {
  padding: 12px 17px;
  max-width: 88%;
  border-radius: 13px 13px 3px 13px;
}
.message-label {
  font-weight: 650;
  font-size: 10px;
}
.message-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}
.message-footer button {
  font-size: 9px;
  padding: 2px 5px;
  font-weight: 450;
}
.markdown {
  overflow-wrap: anywhere;
  min-width: 0;
}
.markdown p {
  white-space: pre-wrap;
  margin: 6px 0;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5 {
  margin: 16px 0 8px;
  font-size: 16px;
}
.markdown a {
  color: var(--accent);
  text-underline-offset: 2px;
}
.markdown code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  background: var(--surface2);
  padding: 2px 4px;
  border-radius: 4px;
}
.markdown .table-wrap {
  margin: 12px 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.markdown td,
.markdown th {
  padding: 8px 12px;
  white-space: normal;
  min-width: 70px;
}
.markdown-bullet {
  padding-left: 9px;
  margin: 5px 0;
}
.code-block {
  margin: 13px 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface2);
}
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 10px;
  border-bottom: 1px solid var(--line);
}
.code-toolbar button {
  padding: 2px 5px;
  font-size: 10px;
}
.code-block pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  max-width: 100%;
}
.code-block pre code {
  padding: 0;
  background: none;
  white-space: pre;
  font-size: 11px;
}
.conversation-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 35px 10%;
  color: var(--muted);
}
.conversation-empty > .icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 15px;
}
.conversation-empty h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.conversation-empty p {
  font-size: 12px;
  margin-top: 10px;
  max-width: 370px;
}
.composer {
  flex: none;
  padding: 13px 19px;
  background: var(--surface);
}
.composer textarea {
  border: 1px solid var(--line);
  background: var(--surface2);
  min-height: 78px;
  max-height: 180px;
  font-size: 12px;
  line-height: 1.7;
}
.composer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.composer-toolbar > .row {
  margin: 0;
  justify-content: flex-start;
  gap: 5px;
}
.composer-toolbar .small {
  font-size: 9px;
}
.composer-toolbar .primary {
  padding: 7px 11px;
  font-size: 11px;
}
.attachment-button {
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  font-weight: 400;
}
.control-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
  padding: 8px 19px;
  color: var(--muted);
}
.control-strip .small {
  font-size: 10px;
}
.control-strip button {
  font-size: 10px;
  padding: 5px 7px;
}
.session-card > .control-strip {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 13px;
  padding: 8px;
}
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 125px;
  overflow: auto;
  padding: 7px 18px;
  border-top: 1px solid var(--line);
}
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 10px;
  max-width: 100%;
  flex-wrap: wrap;
}
.attachment-chip .icon {
  width: 14px;
  height: 14px;
}
.attachment-chip button {
  font-size: 9px;
  padding: 3px;
}
.attachment-preview {
  position: absolute;
  inset: 0;
  background: var(--surface);
  padding: 45px 20px 20px;
  z-index: 10;
  display: grid;
  place-items: center;
}
.attachment-preview > button {
  position: absolute;
  right: 10px;
  top: 7px;
  font-size: 22px;
}
.attachment-preview > img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.manager-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.agent-card {
  padding: 17px;
}
.agent-card h2 {
  font-size: 14px;
}
.agent-card .actions {
  margin-top: 14px;
}
.agent-card .small {
  font-size: 11px;
}
.agent-card .icon {
  color: var(--accent);
}
@media (min-width: 801px) {
  html.nav-collapsed .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  html.nav-collapsed .sidebar {
    width: 76px;
    padding-left: 10px;
    padding-right: 10px;
  }
  html.nav-collapsed .brand {
    padding-left: 7px;
    padding-right: 7px;
  }
  html.nav-collapsed .brand img {
    width: 36px;
    height: 36px;
  }
  html.nav-collapsed .brand > span,
  html.nav-collapsed .nav-group,
  html.nav-collapsed .nav a > span:not(.icon),
  html.nav-collapsed .sidefoot {
    display: none;
  }
  html.nav-collapsed .nav a {
    justify-content: center;
    padding: 10px 9px;
    margin: 4px 0;
  }
  html.nav-collapsed .nav-collapse {
    align-self: center;
    margin: 8px 0 0;
  }
}
@media (max-width: 1150px) {
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .composer-toolbar {
    flex-wrap: wrap;
  }
  .composer-toolbar > .row:last-child {
    margin-left: auto;
  }
  .composer-toolbar span.small {
    display: none;
  }
}
@media (max-width: 800px) {
  .nav-collapse {
    display: none;
  }
  .chat-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .chat-list {
    display: flex;
    flex-direction: column;
    max-height: 235px;
    padding: 12px;
    gap: 8px;
    overflow: hidden;
  }
  .chat-list > button {
    max-width: none;
    min-width: 0;
  }
  .conversation-items {
    display: flex;
    gap: 8px;
    overflow: auto;
    min-height: 66px;
  }
  .conversation-items > button {
    flex: none;
    min-width: 170px;
    max-width: 220px;
    margin: 0;
  }
  .chat-list > input {
    padding: 7px 10px;
  }
  .archive-filter {
    font-size: 9px;
  }
  .chat-main {
    min-height: 0;
  }
  .chat-messages {
    padding: 18px;
  }
  .control-strip {
    padding: 8px 14px;
  }
  .chat-title {
    padding: 14px;
  }
  .composer {
    padding: 11px 13px;
  }
  .composer-toolbar span.small {
    display: none;
  }
  .manager-settings {
    grid-template-columns: 1fr;
  }
  .profile-panel {
    align-items: flex-start;
  }
  .message.user {
    max-width: 94%;
  }
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .agent-grid {
    grid-template-columns: 1fr;
  }
  .control-strip .actions {
    gap: 2px;
  }
  .chat-title .row {
    gap: 0;
  }
  .chat-title .row button {
    padding: 4px 7px;
  }
  .composer-toolbar {
    gap: 5px;
  }
  .composer-toolbar > .row {
    gap: 2px;
  }
  .composer-toolbar > .row:last-child {
    margin-left: auto;
  }
  .composer-toolbar > .row:last-child > .quiet {
    font-size: 9px;
  }
  .profile-panel > .avatar {
    width: 42px;
    height: 42px;
    font-size: 13px;
  }
}

.agent-lifecycle {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.agent-lifecycle > .small {
  font-size: 10px;
  margin-bottom: 7px;
}
.agent-lifecycle button {
  font-size: 10px;
  padding: 6px 8px;
}
.agent-logs {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.agent-logs summary {
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
}
.agent-logs .list-item {
  padding: 10px 0;
}
.agent-logs .list-item h3 {
  font-size: 10px;
}
.agent-logs .list-item p,
.agent-logs .list-item time {
  font-size: 9px;
}
.agent-logs .empty {
  padding: 13px 4px;
  font-size: 10px;
}
.agent-logs .empty strong {
  font-size: 11px;
}
.agent-logs .empty > .icon {
  display: none;
}

.approval-plan {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  min-width: 0;
}
.approval-plan > h3 {
  font-size: 11px;
}
.approval-plan > .code {
  margin: 0;
  font-size: 10px;
  max-width: 100%;
}
.approval-plan > ol {
  margin: 0;
  padding-left: 19px;
  font-size: 10px;
  color: var(--muted);
}
.approval-plan > ol li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.session-tree { overflow-wrap: anywhere; padding-inline-start: 1.2rem; }
.session-tree li { margin-block: .4rem; }

.session-tree .tree-child { margin-inline-start: 1.2rem; }

@media (max-width: 800px) {
  .synthetic-discovery-row { flex-wrap: wrap; }
  .synthetic-discovery-row .grow { flex-basis: calc(100% - 48px); min-width: 0; }
  .synthetic-discovery-row button { margin-inline-start: 36px; }
}

.admin-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-fields input, .admin-fields select { width: 100%; min-width: 0; }
.admin-resources { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.admin-values { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: .5rem 1rem; margin: 0; }
.admin-values dt { font-size: .82rem; opacity: .75; }
.admin-values dd { margin: 0; overflow-wrap: anywhere; font-size: .85rem; }
@media (max-width: 600px) { .admin-fields { grid-template-columns: 1fr; } .admin-values { grid-template-columns: 1fr; gap: .2rem; } .admin-values dd { margin-bottom: .6rem; } }
.admin-binding { display: block; overflow-wrap: anywhere; white-space: normal; margin-top: .5rem; font-size: .75rem; }

.brand-image { object-fit: contain; flex-shrink: 0; }
.login-brand .brand-logo { width: min(100%, 320px); height: auto; margin-bottom: 36px; }
.brand-loading { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.brand-loading .brand-mark { width: 74px; height: 74px; }
.admin-heading .brand-logo { width: 160px; height: auto; max-width: 36vw; }
.admin-heading > div { flex: 1; min-width: 0; }
@media (max-width: 800px) { .login-brand .brand-logo { width: 230px; margin-bottom: 22px; } }

.maintenance-steps { padding-left: 1.3rem; display: grid; gap: .6rem; font-size: .85rem; }

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.activity-repeat {
  white-space: nowrap;
  font-weight: 600;
}

/* Stacked forms and recovery steps retain their vertical layout at every width. */
.list-item.stack,
.notice.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

/* Dense controls grow with their content; only history and data tables scroll. */
.project-workspaces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}
.project-workspace {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--surface);
}
.project-workspace.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.card,
.card-body,
.stack,
.chat-main > *,
.admin-fields > *,
.manager-settings > * {
  min-width: 0;
}
.chat-main > :not(.chat-messages) {
  flex-shrink: 0;
}
.chat-title,
.card-head,
.notice,
.profile-links > .row {
  flex-wrap: wrap;
}
.chat-title h2,
.card-head h2,
.notice,
.admin-fields label,
.control-strip {
  overflow-wrap: anywhere;
}
.chat-messages > * {
  flex-shrink: 0;
}
.conversation-items,
.chat-messages,
.table-wrap,
.code-block pre {
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.content input,
.content select,
.content textarea,
.ccc-chat-content input,
.ccc-chat-content select,
.ccc-chat-content textarea {
  max-width: 100%;
  min-width: 0;
}
:focus-visible {
  scroll-margin-block: 7rem 2rem;
}
@media (max-height: 500px) {
  .topbar {
    position: static;
  }
  .sidebar {
    overflow-y: auto;
  }
  .sidebar .nav {
    flex-shrink: 0;
    min-height: 8rem;
  }
}

.account-profile {
  scroll-margin-top: 100px;
}
.account-profile:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
