:root {
  --bg: #070a0f;
  --bg-elevated: #0c1119;
  --panel: #101722;
  --panel-strong: #131c28;
  --panel-soft: #0c131d;
  --line: #223041;
  --line-soft: #182433;
  --text: #edf4f7;
  --muted: #8fa0af;
  --subtle: #627384;
  --cyan: #36d9d1;
  --cyan-strong: #67f1ea;
  --green: #42d897;
  --amber: #ffbb55;
  --red: #ff6b78;
  --violet: #9b8cff;
  --blue: #66a8ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
  --radius: 16px;
  --sidebar-width: 246px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 86% -10%, rgba(33, 177, 177, .09), transparent 30rem),
    var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1.15em; height: 1.15em; fill: currentColor; }
code, pre, .terminal { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

::selection { color: #031010; background: var(--cyan); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.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;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: rgba(9, 14, 21, .96);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(54, 217, 209, .35);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(54, 217, 209, .2), rgba(54, 217, 209, .03));
  box-shadow: inset 0 0 18px rgba(54, 217, 209, .08), 0 0 22px rgba(54, 217, 209, .08);
}

.brand-mark span { position: absolute; border: 1.5px solid var(--cyan); transform: rotate(30deg); }
.brand-mark span:nth-child(1) { width: 15px; height: 15px; }
.brand-mark span:nth-child(2) { width: 9px; height: 9px; transform: rotate(90deg); }
.brand-mark span:nth-child(3) { width: 3px; height: 3px; border: 0; background: var(--cyan-strong); box-shadow: 0 0 8px var(--cyan); }
.brand-mark.large { width: 46px; height: 46px; border-radius: 14px; }
.brand-mark.large span:nth-child(1) { width: 21px; height: 21px; }
.brand-mark.large span:nth-child(2) { width: 12px; height: 12px; }

.brand-copy, .auth-brand > div { display: flex; flex-direction: column; }
.brand-copy strong, .auth-brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand-copy small, .auth-brand small { color: var(--subtle); font-size: 8px; letter-spacing: .14em; }
.sidebar-close { display: none; margin-left: auto; }

.primary-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 22px 13px; }
.nav-label { margin: 11px 10px 5px; color: #4f6374; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav-label:first-child { margin-top: 0; }

.nav-item {
  position: relative;
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #94a5b4;
  transition: color .18s, border-color .18s, background .18s;
}

.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.nav-item.active {
  color: var(--cyan-strong);
  border-color: rgba(54, 217, 209, .13);
  background: linear-gradient(90deg, rgba(54, 217, 209, .13), rgba(54, 217, 209, .025));
}
.nav-item.active::before { position: absolute; left: -14px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--cyan); content: ""; box-shadow: 0 0 12px var(--cyan); }
.nav-badge { margin-left: auto; padding: 1px 6px; border: 1px solid rgba(54, 217, 209, .25); border-radius: 999px; color: var(--cyan); font-size: 9px; }
.nav-count { min-width: 20px; margin-left: auto; padding: 1px 6px; border-radius: 999px; color: #160f02; background: var(--amber); font-size: 10px; font-weight: 800; text-align: center; }

.sidebar-footer { padding: 15px 14px; border-top: 1px solid var(--line-soft); }
.host-state, .account-row { display: flex; align-items: center; gap: 10px; }
.host-state { padding: 10px 11px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255, 255, 255, .018); }
.host-state > span:nth-child(2), .account-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.host-state strong, .account-copy strong { font-size: 12px; font-weight: 600; }
.host-state small, .account-copy small { color: var(--subtle); font-size: 10px; }
.account-row { width: 100%; margin-top: 10px; padding: 6px 4px 0; color: var(--text); background: transparent; border: 0; }
.avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--cyan); background: rgba(54, 217, 209, .12); font-weight: 700; }

.pulse-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(66, 216, 151, .08), 0 0 8px rgba(66, 216, 151, .45); }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 76px; align-items: center; gap: 14px; padding: 0 clamp(20px, 3.2vw, 50px); border-bottom: 1px solid var(--line-soft); background: rgba(7, 10, 15, .86); backdrop-filter: blur(18px); }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title > span { color: var(--subtle); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.topbar-title h1 { margin: 0; font-size: 18px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.connection-pill, .read-only-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .018); font-size: 11px; }
.connection-pill > span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.read-only-chip svg { width: 13px; }
.read-only-chip.small { padding: 4px 9px; }
.menu-button { display: none; }

.page-content { width: 100%; max-width: 1530px; margin: 0 auto; padding: 34px clamp(20px, 3.2vw, 50px) 70px; }
.page-content:has(.chat-layout) { max-width: none; height: calc(100vh - 76px); padding: 20px clamp(16px, 2vw, 30px); overflow: hidden; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; color: var(--text); background: transparent; font-weight: 650; transition: transform .15s, border-color .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #041313; background: linear-gradient(135deg, var(--cyan-strong), #2bc4bc); box-shadow: 0 8px 24px rgba(54, 217, 209, .14); }
.button.primary:hover { background: linear-gradient(135deg, #86fff8, #36d9d1); }
.button.ghost { border-color: var(--line); color: var(--muted); background: rgba(255, 255, 255, .02); }
.button.ghost:hover { color: var(--text); border-color: #35485c; }
.button.compact { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button svg { width: 14px; height: 14px; }

.icon-button { display: inline-grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }

.hero-strip { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; overflow: hidden; padding: 28px 30px; border: 1px solid rgba(54, 217, 209, .13); border-radius: var(--radius); background: linear-gradient(105deg, rgba(54, 217, 209, .08), rgba(17, 27, 39, .8) 48%, rgba(19, 28, 40, .4)); }
.hero-strip::after { position: absolute; top: -180px; right: -20px; width: 360px; height: 360px; border: 1px solid rgba(54, 217, 209, .09); border-radius: 50%; content: ""; box-shadow: inset 0 0 70px rgba(54, 217, 209, .03), 0 0 0 50px rgba(54, 217, 209, .015); pointer-events: none; }
.hero-strip > * { position: relative; z-index: 1; }
.hero-strip h2 { margin: 7px 0 2px; font-size: clamp(23px, 3vw, 32px); letter-spacing: -.035em; }
.hero-strip p { max-width: 690px; margin: 0; color: var(--muted); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.metric-card { display: flex; min-height: 112px; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: linear-gradient(145deg, rgba(17, 24, 35, .95), rgba(12, 18, 27, .95)); }
.metric-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; font-size: 17px; font-weight: 800; }
.metric-icon.cyan { color: var(--cyan); background: rgba(54, 217, 209, .1); }
.metric-icon.green { color: var(--green); background: rgba(66, 216, 151, .1); }
.metric-icon.amber { color: var(--amber); background: rgba(255, 187, 85, .1); }
.metric-icon.violet { color: var(--violet); background: rgba(155, 140, 255, .1); }
.metric-card > div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 7px; }
.metric-card span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.metric-card strong { font-size: 25px; line-height: 1.1; }
.metric-card small { color: var(--subtle); font-size: 10px; }

.section-block { margin-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 22px; }
.section-heading h2 { margin: 3px 0 0; font-size: 22px; }
.section-heading p { max-width: 520px; margin: 0; color: var(--subtle); font-size: 12px; text-align: right; }
.service-group { margin-top: 24px; }
.service-group-heading { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.service-group-heading h3 { margin: 0; font-size: 13px; font-weight: 650; }
.service-group-heading > span:last-child { margin-left: auto; color: var(--subtle); font-size: 10px; }
.category-symbol { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: var(--cyan); background: rgba(54, 217, 209, .1); font-size: 12px; }
.category-telegram { color: var(--blue) !important; background-color: rgba(102, 168, 255, .1) !important; }
.category-3d-printing { color: var(--violet) !important; background-color: rgba(155, 140, 255, .1) !important; }
.category-agents { color: var(--cyan) !important; background-color: rgba(54, 217, 209, .1) !important; }
.category-wechat { color: var(--green) !important; background-color: rgba(66, 216, 151, .1) !important; }
.category-system { color: var(--amber) !important; background-color: rgba(255, 187, 85, .1) !important; }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.service-card { position: relative; min-width: 0; padding: 17px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 14px; background: linear-gradient(145deg, rgba(17, 24, 35, .96), rgba(11, 17, 25, .96)); transition: transform .18s, border-color .18s, box-shadow .18s; }
.service-card:hover { transform: translateY(-2px); border-color: #31465b; box-shadow: var(--shadow); }
.service-card-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.service-avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--cyan); background: rgba(54, 217, 209, .1); font-weight: 800; }
.service-avatar.large { width: 56px; height: 56px; border-radius: 15px; font-size: 20px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .02); font-size: 9px; white-space: nowrap; }
.status-pill > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-healthy { color: var(--green); border-color: rgba(66, 216, 151, .22); background: rgba(66, 216, 151, .06); }
.status-running { color: var(--blue); border-color: rgba(102, 168, 255, .22); background: rgba(102, 168, 255, .06); }
.status-degraded { color: var(--amber); border-color: rgba(255, 187, 85, .22); background: rgba(255, 187, 85, .06); }
.status-offline, .status-failed, .status-unhealthy, .status-stopped, .status-unreachable { color: var(--red); border-color: rgba(255, 107, 120, .22); background: rgba(255, 107, 120, .06); }
.status-unknown { color: var(--muted); border-color: rgba(143, 160, 175, .22); background: rgba(143, 160, 175, .06); }
.service-card-copy h4 { margin: 16px 0 2px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.service-card-copy p { min-height: 34px; margin: 0; overflow: hidden; color: var(--subtle); font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.service-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0; }
.service-meta div { min-width: 0; padding: 8px 9px; border-radius: 8px; background: rgba(255, 255, 255, .025); }
.service-meta dt { color: var(--subtle); font-size: 8px; text-transform: uppercase; }
.service-meta dd { margin: 1px 0 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.service-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--subtle); font-size: 9px; }
.service-card-footer span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-card-footer span:last-child { color: var(--cyan); font-size: 14px; }

.empty-state { padding: 60px 25px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-state h3 { margin: 12px 0 3px; color: var(--text); }
.empty-state p { margin: 0; }
.empty-icon { display: grid; width: 48px; height: 48px; margin: auto; place-items: center; border-radius: 14px; color: var(--cyan); background: rgba(54, 217, 209, .08); }

.panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16, 23, 34, .97), rgba(10, 16, 24, .97)); box-shadow: 0 12px 45px rgba(0, 0, 0, .08); }
.service-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(16, 23, 34, .72); }
.service-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.service-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.service-title-line h2 { margin: 0; font-size: 23px; }
.service-identity p { margin: 3px 0 0; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.detail-panel { min-width: 0; padding: 20px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.panel-heading h3 { margin: 2px 0 0; font-size: 15px; }
.panel-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--cyan); background: rgba(54, 217, 209, .08); }
.detail-list { margin: 5px 0 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(85px, .35fr) minmax(0, 1fr); gap: 15px; padding: 10px 2px; border-bottom: 1px solid rgba(34, 48, 65, .55); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--subtle); }
.detail-list dd { min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; }
.detail-list code { padding: 2px 5px; border-radius: 5px; color: #b8c7d2; background: rgba(0, 0, 0, .2); font-size: 11px; }
.inline-state { color: var(--muted); }
.state-active { color: var(--green); }
.danger-text { color: var(--red); }
.panel-empty { display: grid; min-height: 205px; place-items: center; color: var(--subtle); text-align: center; }
.payload-details { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.payload-details summary { padding: 12px 2px 0; color: var(--cyan); font-size: 11px; }
.payload-details pre { max-height: 260px; padding: 12px; overflow: auto; border-radius: 9px; color: #b8c8d4; background: #080d13; font-size: 10px; }
.log-panel { margin-top: 16px; overflow: hidden; }
.log-heading { align-items: center; padding: 18px 20px; }
.log-actions { display: flex; align-items: center; gap: 8px; }
.terminal { min-height: 250px; max-height: 450px; padding: 18px 20px; overflow: auto; color: #b6c9d4; background: #070b10; font-size: 11px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; }
.terminal::selection { color: #071010; background: var(--cyan); }
.terminal-muted { color: var(--subtle); }
.panel-footer { display: flex; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--line-soft); color: var(--subtle); font-size: 9px; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin: 15px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; }
.alert > span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border-radius: 50%; font-weight: 800; }
.alert p { margin: 0; }
.alert.error { color: #ffadb5; border-color: rgba(255, 107, 120, .23); background: rgba(255, 107, 120, .07); }
.alert.error > span { color: #1b0508; background: var(--red); }

/* Chat */
.chat-layout { display: grid; height: 100%; min-height: 0; grid-template-columns: 238px minmax(0, 1fr); gap: 14px; }
.conversation-panel { display: flex; min-height: 0; flex-direction: column; padding: 13px; overflow: hidden; }
.conversation-heading { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 10px 6px; }
.conversation-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-soft); border-radius: 9px; color: var(--subtle); background: rgba(0, 0, 0, .12); }
.conversation-search svg { width: 14px; }
.conversation-search input { width: 100%; min-width: 0; height: 34px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.conversation-search input::placeholder { color: #4d6071; }
.conversation-list { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 4px; margin-top: 10px; overflow: auto; }
.conversation-item { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); }
.conversation-item:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.conversation-item.active { color: var(--text); border-color: rgba(54, 217, 209, .13); background: rgba(54, 217, 209, .07); }
.conversation-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--cyan); background: rgba(54, 217, 209, .07); }
.conversation-item > span:last-child { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.conversation-item strong { overflow: hidden; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item small { color: var(--subtle); font-size: 9px; }
.conversation-empty { padding: 30px 13px; color: var(--subtle); font-size: 11px; text-align: center; }

.chat-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.assistant-identity { display: flex; align-items: center; gap: 10px; }
.assistant-identity > div { display: flex; flex-direction: column; }
.assistant-identity strong { font-size: 13px; }
.assistant-identity small { display: flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 9px; }
.assistant-identity .pulse-dot { width: 5px; height: 5px; }
.assistant-mark { position: relative; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(54, 217, 209, .24); border-radius: 50%; background: radial-gradient(circle, rgba(54, 217, 209, .16), rgba(54, 217, 209, .02)); box-shadow: 0 0 20px rgba(54, 217, 209, .07); }
.assistant-mark::before, .assistant-mark::after, .assistant-mark > span::before, .assistant-mark > span::after { position: absolute; width: 11px; height: 1px; background: var(--cyan); content: ""; }
.assistant-mark::after { transform: rotate(90deg); }
.assistant-mark > span::before { transform: rotate(45deg); }
.assistant-mark > span::after { transform: rotate(-45deg); }
.assistant-mark.large { width: 54px; height: 54px; }
.assistant-mark.large::before, .assistant-mark.large::after, .assistant-mark.large > span::before, .assistant-mark.large > span::after { width: 17px; }
.provider-picker { display: flex; align-items: center; gap: 8px; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.provider-picker select { min-width: 126px; height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #0b121a; outline: 0; font-size: 11px; text-transform: none; letter-spacing: 0; }
.provider-picker select:focus { border-color: var(--cyan); }

.message-stream { min-height: 0; flex: 1; overflow: auto; scroll-behavior: smooth; }
.assistant-welcome { display: flex; min-height: 100%; max-width: 700px; margin: auto; padding: 45px 24px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.assistant-welcome h2 { margin: 18px 0 4px; font-size: 25px; }
.assistant-welcome > p { max-width: 530px; margin: 0; color: var(--muted); }
.prompt-suggestions { display: grid; width: min(100%, 680px); grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 28px; }
.prompt-suggestions button { min-height: 78px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 11px; color: var(--muted); background: rgba(255, 255, 255, .018); font-size: 11px; text-align: left; }
.prompt-suggestions button:hover { color: var(--text); border-color: rgba(54, 217, 209, .3); background: rgba(54, 217, 209, .035); }
.prompt-suggestions button span { display: block; margin-bottom: 9px; color: var(--cyan); font-size: 15px; }
.message { display: grid; max-width: 890px; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; margin: 0 auto; padding: 24px; }
.message + .message { border-top: 1px solid rgba(34, 48, 65, .45); }
.message-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: var(--cyan); background: rgba(54, 217, 209, .1); font-size: 12px; font-weight: 700; }
.message-user .message-avatar { color: var(--blue); background: rgba(102, 168, 255, .1); }
.message-meta { display: flex; align-items: baseline; gap: 9px; }
.message-meta strong { font-size: 11px; }
.message-meta time { color: var(--subtle); font-size: 9px; }
.message-content { margin-top: 5px; color: #c6d2da; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-user .message-content { color: var(--text); }
.message.streaming .message-content::after { display: inline-block; width: 5px; height: 13px; margin-left: 3px; vertical-align: -2px; background: var(--cyan); content: ""; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tool-timeline { display: flex; flex-direction: column; gap: 7px; margin-top: 13px; }
.tool-event { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(0, 0, 0, .12); }
.tool-event > span { position: relative; width: 7px; height: 7px; margin: 5px auto 0; border: 1px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 7px rgba(54, 217, 209, .3); }
.tool-event > div { display: flex; min-width: 0; flex-direction: column; }
.tool-event strong { font-size: 10px; font-weight: 600; }
.tool-event small { overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.event-error > span { border-color: var(--red); }
.event-done > span { border-color: var(--green); }

.composer { padding: 12px 18px 15px; border-top: 1px solid var(--line-soft); background: rgba(8, 13, 19, .68); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; max-width: 890px; margin: auto; padding: 7px 7px 7px 14px; border: 1px solid #2a3b4d; border-radius: 13px; background: #0b121a; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: rgba(54, 217, 209, .6); box-shadow: 0 0 0 3px rgba(54, 217, 209, .05); }
.composer textarea { width: 100%; min-height: 36px; max-height: 150px; padding: 7px 0; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.5; }
.composer textarea::placeholder { color: #536676; }
.composer-tools { display: flex; align-items: center; gap: 5px; }
.attachment-button:disabled { cursor: not-allowed; opacity: .3; }
.send-button, .stop-button { display: grid; width: 35px; height: 35px; padding: 0; place-items: center; border: 0; border-radius: 9px; color: #041313; background: var(--cyan); }
.send-button:hover { background: var(--cyan-strong); }
.send-button svg { width: 16px; }
.send-button:disabled { cursor: progress; opacity: .45; }
.stop-button { display: none; color: var(--muted); border: 1px solid var(--line); background: transparent; }
.stop-button:disabled { cursor: not-allowed; opacity: .35; }
.composer-footer { display: flex; max-width: 890px; justify-content: space-between; gap: 14px; margin: 7px auto 0; color: var(--subtle); font-size: 8px; }
kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: rgba(255, 255, 255, .025); font-family: inherit; font-size: 8px; }

/* Authentication */
.auth-page { overflow-x: hidden; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, .8fr) minmax(470px, 1.2fr); }
.auth-panel { display: flex; width: min(100%, 480px); margin: auto; padding: 45px clamp(28px, 5vw, 65px); flex-direction: column; justify-content: center; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 70px; }
.auth-heading h1 { margin: 9px 0 5px; font-size: 31px; letter-spacing: -.04em; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; }
.field > input, .password-field { width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(15, 23, 33, .8); outline: 0; }
.field > input { padding: 0 13px; }
.password-field { display: flex; overflow: hidden; }
.password-field input { min-width: 0; flex: 1; padding: 0 13px; border: 0; outline: 0; color: var(--text); background: transparent; }
.password-toggle { padding: 0 13px; border: 0; color: var(--cyan); background: transparent; font-size: 10px; }
.field > input:focus, .password-field:focus-within { border-color: rgba(54, 217, 209, .65); box-shadow: 0 0 0 3px rgba(54, 217, 209, .05); }
.auth-submit { margin-top: 5px; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 23px 0 0; color: var(--subtle); font-size: 9px; }
.auth-note svg { width: 12px; }
.auth-visual { position: relative; min-height: 100vh; overflow: hidden; border-left: 1px solid var(--line-soft); background: linear-gradient(145deg, #09131b, #071015 50%, #080b11); }
.grid-glow { position: absolute; inset: 0; background-image: linear-gradient(rgba(54, 217, 209, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(54, 217, 209, .045) 1px, transparent 1px); background-size: 45px 45px; mask-image: radial-gradient(circle at center, #000 5%, transparent 72%); }
.grid-glow::before { position: absolute; top: 50%; left: 50%; width: 420px; height: 420px; border: 1px solid rgba(54, 217, 209, .11); border-radius: 50%; content: ""; transform: translate(-50%, -50%); box-shadow: 0 0 0 75px rgba(54, 217, 209, .018), inset 0 0 100px rgba(54, 217, 209, .035); }
.orbit-card { position: absolute; display: grid; min-width: 150px; grid-template-columns: 24px auto; column-gap: 9px; padding: 12px 14px; border: 1px solid rgba(54, 217, 209, .16); border-radius: 12px; background: rgba(10, 19, 27, .86); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); backdrop-filter: blur(10px); }
.orbit-card > span { grid-row: 1 / 3; width: 22px; height: 22px; margin-top: 4px; border: 1px solid var(--cyan); border-radius: 7px; background: rgba(54, 217, 209, .08); }
.orbit-card > span::after { display: block; width: 5px; height: 5px; margin: 8px; border-radius: 50%; background: var(--green); content: ""; box-shadow: 0 0 8px var(--green); }
.orbit-card strong { font-size: 11px; }
.orbit-card small { color: var(--subtle); font-size: 9px; }
.card-one { top: 28%; left: 17%; }
.card-two { top: 47%; right: 13%; }
.card-three { top: 65%; left: 24%; }
.visual-copy { position: absolute; right: 9%; bottom: 7%; text-align: right; }
.visual-copy small { color: var(--cyan); font-size: 9px; letter-spacing: .13em; }
.visual-copy strong { display: block; margin-top: 8px; font-size: clamp(22px, 3vw, 38px); line-height: 1.22; letter-spacing: -.04em; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; width: min(360px, calc(100vw - 40px)); flex-direction: column; gap: 8px; }
.toast { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #111a24; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255, 107, 120, .35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversation-panel { display: none; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 265px; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(0, 0, 0, .4); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: inline-grid; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; visibility: hidden; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s, visibility .2s; }
  body.sidebar-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .workspace { margin-left: 0; }
  .topbar { height: 66px; padding: 0 17px; }
  .page-content { padding: 22px 17px 50px; }
  .page-content:has(.chat-layout) { height: calc(100vh - 66px); padding: 10px; }
  .connection-pill { display: none; }
  .hero-strip { align-items: flex-start; flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { width: min(100%, 520px); }
  .auth-visual { display: none; }
}

@media (max-width: 580px) {
  .topbar-title > span { display: none; }
  .topbar-title h1 { max-width: 155px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions .button { font-size: 0; }
  .topbar-actions .button::first-letter { font-size: 14px; }
  .hero-strip { padding: 22px; }
  .hero-strip .button { width: 100%; }
  .metric-grid, .service-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading p { text-align: left; }
  .service-hero { align-items: flex-start; flex-direction: column; }
  .service-title-line h2 { font-size: 19px; }
  .log-heading { align-items: flex-start; flex-direction: column; }
  .chat-header { padding: 0 13px; }
  .provider-picker > span { display: none; }
  .provider-picker select { min-width: 105px; }
  .assistant-identity > div { display: none; }
  .assistant-welcome { justify-content: flex-start; padding-top: 55px; }
  .prompt-suggestions { grid-template-columns: 1fr; }
  .prompt-suggestions button { min-height: 58px; }
  .message { padding: 18px 13px; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .message-avatar { width: 28px; height: 28px; }
  .composer { padding: 8px; }
  .composer-footer span:last-child { display: none; }
  .auth-brand { margin-bottom: 50px; }
  .auth-panel { padding: 34px 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
