:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f7f8;
  color: #172033;
}

body.home-body,
body.login-body {
  background:
    linear-gradient(90deg, rgba(8, 18, 29, 0.9), rgba(8, 18, 29, 0.62) 47%, rgba(8, 18, 29, 0.78)),
    url("/assets/ai-background.webp") center / cover fixed no-repeat,
    #0f1f2e;
}

.hero {
  min-height: 64vh;
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(7, 15, 27, 0.93), rgba(9, 29, 39, 0.7) 48%, rgba(7, 15, 27, 0.84)),
    url("/assets/ai-background.webp") center / cover no-repeat,
    #0f1f2e;
  color: #ffffff;
  padding: 82px 0 98px;
}

.hero-inner {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: #b8f3e9;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(52px, 9vw, 108px);
  line-height: 0.92;
  letter-spacing: 0;
}

.lede {
  margin: 24px 0 0;
  max-width: 760px;
  color: #d8fff8;
  line-height: 1.5;
  font-size: clamp(18px, 2.4vw, 24px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  background: #ffffff;
  color: #115e59;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: #ffffff;
}

button.button {
  cursor: pointer;
  font: inherit;
}

.content {
  width: min(1120px, calc(100vw - 32px));
  margin: -36px auto 0;
  padding-bottom: 56px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature,
.panel {
  background: #ffffff;
  border: 1px solid rgba(217, 226, 236, 0.94);
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(23, 32, 51, 0.11);
}

.features .feature:first-child {
  border-color: #14b8a6;
}

.feature {
  position: relative;
  min-height: 156px;
  padding: 22px;
}

.feature-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 28px;
  margin-bottom: 20px;
  border: 1px solid #ccfbf1;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
}

.feature h2 {
  margin: 0 0 10px;
  color: #172033;
  font-size: 18px;
}

.feature p {
  margin: 0;
  color: #62748e;
  line-height: 1.55;
  font-size: 14px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.panel {
  padding: 22px;
}

.label {
  display: block;
  margin-bottom: 10px;
  color: #62748e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

code {
  overflow-wrap: anywhere;
  color: #0f766e;
  font: 14px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-list code {
  padding: 9px 11px;
  border-radius: 8px;
  background: #f3f6f8;
}

#tools {
  margin-top: 18px;
}

.setup-panel {
  margin-top: 20px;
}

.setup-panel p {
  margin: 0 0 14px;
  color: #62748e;
  line-height: 1.55;
}

.setup-panel pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f7fafc;
}

.setup-panel pre code {
  display: block;
  padding: 14px 16px;
  color: #172033;
  line-height: 1.6;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.86);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.legal-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(8, 18, 29, 0.92), rgba(8, 18, 29, 0.66) 48%, rgba(8, 18, 29, 0.86)),
    url("/assets/ai-background.webp") center / cover fixed no-repeat,
    #0f1f2e;
  color: #172033;
}

.legal-page {
  width: min(860px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 18px;
  color: #d8fff8;
  font-weight: 900;
  text-decoration: none;
}

.legal-card {
  padding: 34px;
  border: 1px solid rgba(217, 226, 236, 0.94);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.24);
}

.legal-card h1 {
  margin: 0;
  max-width: 720px;
  color: #172033;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 0.96;
}

.legal-card h2 {
  margin: 28px 0 10px;
  color: #172033;
  font-size: 18px;
}

.legal-card p,
.legal-card li {
  color: #52647c;
  font-size: 15px;
  line-height: 1.68;
}

.legal-card p {
  margin: 16px 0 0;
}

.legal-card ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.legal-card code {
  color: #0f766e;
  font-size: 13px;
}

.legal-updated {
  color: #62748e;
  font-weight: 800;
}

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid #d9e2ec;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #172033;
  text-decoration: none;
  font-weight: 900;
}

.brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #115e59;
  color: #ffffff;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

nav a {
  color: #43546d;
  text-decoration: none;
  font-weight: 700;
}

.nav-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #43546d;
  cursor: pointer;
  font: 700 14px Inter, ui-sans-serif, system-ui, sans-serif;
}

.nav-icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  color: #43546d;
  cursor: pointer;
}

.nav-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 18px;
}

.topbar-metric {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafb;
  cursor: pointer;
  font: inherit;
}

.topbar-metric:hover {
  border-color: #7dd3fc;
}

.topbar-metric span {
  color: #62748e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-metric strong {
  color: #172033;
  font-size: 14px;
  line-height: 1.1;
}

.agent-status-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #2b3440;
  border-radius: 8px;
  background: #151a21;
  color: #d8dee9;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.agent-status-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.agent-status-dialog::backdrop {
  background: rgba(3, 7, 18, 0.68);
}

.info-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #2b3440;
}

.agent-status-dialog h2 {
  margin: 0;
  color: #f4f6f8;
  font-size: 20px;
}

.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #384657;
  border-radius: 6px;
  background: #111827;
  color: #d8dee9;
  cursor: pointer;
  font: 900 14px Inter, ui-sans-serif, system-ui, sans-serif;
}

.agent-status-list {
  max-height: min(560px, calc(100vh - 150px));
  padding: 10px;
  overflow-x: auto;
  overflow-y: auto;
}

.agent-status-list p {
  margin: 0;
  color: #8b98a8;
}

.agent-status-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.agent-status-table th,
.agent-status-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #2b3440;
  text-align: left;
  vertical-align: middle;
}

.agent-status-table th {
  color: #8b98a8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agent-status-table td {
  color: #d8dee9;
  font-size: 12px;
  line-height: 1.25;
}

.agent-status-table th:nth-child(1),
.agent-status-table td:nth-child(1) {
  width: 20%;
}

.agent-status-table th:nth-child(2),
.agent-status-table td:nth-child(2) {
  width: 17%;
}

.agent-status-table th:nth-child(3),
.agent-status-table td:nth-child(3) {
  width: 10%;
}

.agent-status-table th:nth-child(4),
.agent-status-table td:nth-child(4) {
  width: 40%;
}

.agent-status-table th:nth-child(5),
.agent-status-table td:nth-child(5) {
  width: 13%;
  text-align: right;
}

.agent-status-table tr:last-child td {
  border-bottom: 0;
}

.agent-status-name {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.agent-status-name strong {
  min-width: 0;
  overflow: hidden;
  color: #f4f6f8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-status-table .agent-color-dot {
  margin-top: 0;
}

.agent-status-table .idle,
.agent-status-table .working,
.agent-status-table .offline {
  font-weight: 900;
  text-transform: capitalize;
}

.agent-status-table .idle {
  color: #86efac;
}

.agent-status-table .working {
  color: #fbbf24;
}

.agent-status-table .offline {
  color: #8b98a8;
}

.agent-status-table code {
  color: #7dd3fc;
  overflow-wrap: anywhere;
}

.agent-token-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.agent-token-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #384657;
  border-radius: 6px;
  background: #111827;
  color: #d8dee9;
  cursor: pointer;
  font: 900 13px Inter, ui-sans-serif, system-ui, sans-serif;
}

.agent-status-add-row td {
  background: #10161e;
  color: #8b98a8;
}

.agent-status-add-row input {
  width: 100%;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #384657;
  border-radius: 6px;
  background: #0d1219;
  color: #f4f6f8;
  font: 12px Inter, ui-sans-serif, system-ui, sans-serif;
}

.agent-status-add-row input:focus {
  outline: 3px solid rgba(125, 211, 252, 0.18);
  border-color: #7dd3fc;
}

.agent-status-add-row input::placeholder {
  color: #6f7d8f;
}

.agent-status-generate {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #111827;
  color: #dbeafe;
  cursor: pointer;
  font: 900 18px Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1;
}

.agent-status-generate:disabled {
  cursor: wait;
  opacity: 0.68;
}

.agent-row-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 5px;
}

.agent-info,
.agent-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  font: 900 14px Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1;
}

.agent-info {
  border: 1px solid #2563eb;
  background: #111827;
  color: #dbeafe;
}

.agent-remove {
  border: 1px solid #7f1d1d;
  background: #1f1315;
  color: #fecaca;
}

.panel-icon-button {
  min-height: 32px;
  border: 1px solid #384657;
  border-radius: 8px;
  background: #111827;
  color: #d8dee9;
  cursor: pointer;
  font: 900 13px Inter, ui-sans-serif, system-ui, sans-serif;
}

.panel-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-titlebar .label {
  margin-bottom: 0;
}

.panel-icon-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #7dd3fc;
  font-size: 18px;
}

.dashboard {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.dashboard-hero {
  margin-bottom: 24px;
}

.dashboard-hero h1 {
  max-width: 860px;
  font-size: clamp(42px, 7vw, 78px);
  color: #172033;
}

.dashboard-lede {
  max-width: 760px;
  margin: 18px 0 0;
  color: #43546d;
  line-height: 1.6;
  font-size: 18px;
}

.dashboard-section {
  margin-top: 18px;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

pre code {
  display: block;
  color: #172033;
  line-height: 1.6;
}

.login-page {
  width: min(1080px, calc(100vw - 32px));
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: 48px;
  margin: 0 auto;
  padding: 56px 0;
}

.login-intro {
  max-width: 560px;
}

.login-intro h1 {
  color: #ffffff;
  font-size: clamp(42px, 6.5vw, 82px);
  line-height: 0.98;
}

.login-intro p:not(.eyebrow) {
  margin: 22px 0 0;
  max-width: 520px;
  color: #d8fff8;
  font-size: 18px;
  line-height: 1.6;
}

.login-shell {
  width: 100%;
}

.login-form {
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(23, 32, 51, 0.12);
}

.login-form-header {
  margin-bottom: 8px;
}

.login-form-header h2 {
  margin: 0;
  color: #172033;
  font-size: 24px;
  line-height: 1.2;
}

.login-form-header p {
  margin: 8px 0 0;
  color: #62748e;
  line-height: 1.5;
}

.login-form label {
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #172033;
  background: #ffffff;
  font: 15px Inter, ui-sans-serif, system-ui, sans-serif;
}

.login-form input:focus {
  outline: 3px solid rgba(20, 184, 166, 0.22);
  border-color: #14b8a6;
}

.login-form button {
  width: 100%;
  margin-top: 4px;
  border-color: #115e59;
  background: #115e59;
  color: #ffffff;
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #be123c;
  font-size: 14px;
  line-height: 1.45;
}

.form-note {
  margin: 0;
  color: #62748e;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.audit-panel {
  min-height: 420px;
}

.audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.audit-header .label {
  margin-bottom: 0;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  color: #115e59;
  cursor: pointer;
  font: 700 13px Inter, ui-sans-serif, system-ui, sans-serif;
}

.audit-log {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-log li {
  padding: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafb;
}

.audit-log li.empty {
  color: #62748e;
}

.audit-log time {
  display: block;
  margin-bottom: 8px;
  color: #62748e;
  font-size: 12px;
  font-weight: 800;
}

.audit-log pre {
  margin: 0;
  overflow-x: auto;
}

.audit-log code {
  display: block;
  color: #172033;
  line-height: 1.5;
  white-space: pre;
}

.dashboard-body {
  background: #0b0f14;
  color: #d8dee9;
}

.dashboard-body .topbar {
  background: #11161d;
  border-bottom-color: #2b3440;
}

.dashboard-body .brand,
.dashboard-body nav a,
.dashboard-body .nav-button,
.dashboard-body .nav-icon-button {
  color: #d8dee9;
}

.dashboard-body .nav-icon-button {
  border-color: #2b3440;
  background: #151a21;
}

.dashboard-body .topbar-metric {
  border-color: #2b3440;
  background: #151a21;
}

.dashboard-body .topbar-metric span {
  color: #8b98a8;
}

.dashboard-body .topbar-metric strong {
  color: #f4f6f8;
}

.dashboard-body {
  overflow: hidden;
}

.chat-dashboard {
  width: min(1440px, calc(100vw - 32px));
  height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  margin: 0 auto;
  padding: 16px 0;
  overflow: hidden;
}

.chat-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.sidebar-panel,
.chat-room-panel {
  background: #151a21;
  border: 1px solid #2b3440;
  border-radius: 6px;
  box-shadow: none;
}

.sidebar-panel {
  padding: 16px;
}

.dashboard-welcome {
  background:
    linear-gradient(145deg, rgba(20, 184, 166, 0.18), rgba(125, 211, 252, 0.08)),
    #151a21;
}

.dashboard-welcome h1 {
  margin: 0;
  color: #f4f6f8;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

.dashboard-welcome p {
  margin: 12px 0 16px;
  color: #aab4c1;
  font-size: 13px;
  line-height: 1.55;
}

.welcome-action {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0b2636;
  cursor: pointer;
  font: 900 13px Inter, ui-sans-serif, system-ui, sans-serif;
}

.welcome-action:hover {
  background: #ffffff;
}

.dashboard-body .label {
  color: #8b98a8;
}

.sidebar-panel strong {
  color: #f4f6f8;
  font-size: 26px;
  line-height: 1;
}

.sidebar-panel code,
.chat-room-panel code {
  color: #7dd3fc;
}

.agent-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #242c36;
  color: #d8dee9;
  font-size: 13px;
}

.agent-list li:last-child {
  border-bottom: 0;
}

.agent-color-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--agent-color, #7dd3fc);
  box-shadow: 0 0 18px color-mix(in srgb, var(--agent-color, #7dd3fc) 48%, transparent);
}

.agent-details {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.agent-topline {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.agent-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f4f6f8;
  font-weight: 900;
}

.agent-list small {
  max-width: 100%;
  color: #8b98a8;
  font-size: 12px;
  line-height: 1.35;
}

.agent-list strong {
  color: #f4f6f8;
  font-size: 12px;
  text-transform: capitalize;
}

.agent-list .idle {
  color: #86efac;
}

.agent-list .working {
  color: #fbbf24;
}

.agent-list .offline {
  color: #8b98a8;
}

.agent-toggle {
  min-width: 64px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #384657;
  border-radius: 6px;
  background: #111827;
  color: #d8dee9;
  cursor: pointer;
  font: 800 12px Inter, ui-sans-serif, system-ui, sans-serif;
}

.agent-toggle:hover {
  border-color: #7dd3fc;
  color: #ffffff;
}

.chat-room-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid #2b3440;
}

.chat-room-header h2 {
  margin: 0;
  color: #8b98a8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
}

.dashboard-body .small-button {
  border-color: #384657;
  background: #1f2933;
  color: #fbbf24;
}

.dashboard-body .audit-log {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  margin: 0;
  padding: 20px;
  background: #0d1219;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dashboard-body .audit-log li {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.dashboard-body .audit-log li.empty {
  padding: 16px;
  color: #8b98a8;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-row.user {
  flex-direction: row-reverse;
}

.chat-row.system {
  justify-content: center;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid #3b4a5f;
  border-radius: 50%;
  background: #202b3a;
  color: #e5edf6;
  font-size: 11px;
  font-weight: 900;
}

.chat-row.user .chat-avatar {
  background: #2563eb;
  border-color: #60a5fa;
}

.chat-row.agent .chat-avatar {
  background: color-mix(in srgb, var(--agent-color, #22c55e) 70%, #0f172a);
  border-color: color-mix(in srgb, var(--agent-color, #22c55e) 72%, #ffffff);
}

.chat-row.error .chat-avatar {
  background: #ea580c;
  border-color: #fdba74;
}

.chat-row.system .chat-avatar {
  display: none;
}

.chat-bubble {
  width: fit-content;
  max-width: min(760px, calc(100% - 52px));
  min-width: 220px;
  border: 1px solid #3b4a5f;
  border-radius: 16px;
  background: #1b2431;
  color: #f8fafc;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.chat-row.user .chat-bubble {
  background: #1e40af;
  border-color: #60a5fa;
}

.chat-row.agent .chat-bubble {
  background: color-mix(in srgb, var(--agent-color, #22c55e) 34%, #111827);
  border-color: color-mix(in srgb, var(--agent-color, #22c55e) 70%, #334155);
}

.chat-row.error .chat-bubble {
  background: #7c2d12;
  border-color: #fdba74;
}

.chat-row.system .chat-bubble {
  max-width: min(560px, 80%);
  min-width: 0;
  background: #263244;
  border-color: #475569;
}

.chat-titlebar {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px 0;
  color: #f8fafc;
}

.chat-titlebar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.chat-titlebar time {
  margin-left: auto;
  color: rgba(248, 250, 252, 0.72);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-markdown {
  display: block;
  min-width: 0;
  padding: 8px 14px 14px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-markdown p {
  margin: 0 0 12px;
  color: inherit;
}

.chat-markdown p:last-child {
  margin-bottom: 0;
}

.chat-markdown strong {
  color: #ffffff;
}

.chat-markdown code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.52);
  color: #fef3c7;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chat-markdown pre {
  max-width: 100%;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  background: rgba(8, 11, 16, 0.76);
}

.chat-markdown pre code {
  padding: 0;
  background: transparent;
  color: #f8fafc;
  white-space: pre-wrap;
}

.dashboard-body .audit-log pre {
  padding: 12px;
}

.dashboard-body .audit-log code {
  color: #c9d3df;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #2b3440;
  background: #11161d;
}

.chat-composer input {
  min-width: 0;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #384657;
  border-radius: 8px;
  background: #0d1219;
  color: #f4f6f8;
  font: 15px Inter, ui-sans-serif, system-ui, sans-serif;
}

.chat-composer input:focus {
  outline: 3px solid rgba(125, 211, 252, 0.18);
  border-color: #7dd3fc;
}

.chat-composer input::placeholder {
  color: #6f7d8f;
}

.chat-composer button {
  min-width: 82px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  background: #0f172a;
  color: #e0f2fe;
  cursor: pointer;
  font: 900 13px Inter, ui-sans-serif, system-ui, sans-serif;
}

.chat-composer button:disabled,
.chat-composer input:disabled {
  cursor: wait;
  opacity: 0.64;
}

@media (max-width: 860px) {
  .login-page {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 42px 0;
  }

  .login-intro {
    max-width: 680px;
  }

  .login-intro h1 {
    font-size: clamp(40px, 11vw, 64px);
  }

  .login-intro p:not(.eyebrow) {
    font-size: 16px;
  }

  .features,
  .panel-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  nav {
    flex-wrap: wrap;
  }

  .hero {
    min-height: 72vh;
    padding: 56px 0 82px;
  }

  .login-form {
    padding: 22px;
  }

  .features,
  .panel-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-card.wide {
    grid-column: span 1;
  }

  .log-titlebar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-titlebar {
    padding: 8px 12px;
  }

}
