/* BotPanel — VS Code inspired console */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --radius-sm: 4px;
  --titlebar-h: 36px;
  --tabs-h: 36px;
  --statusbar-h: 22px;
  --activity-w: 48px;
  --sidebar-w: 262px;
  --transition: 140ms ease;
}

:root[data-theme="dark"] {
  --bg: #1e1e1e;
  --bg-2: #252526;
  --bg-3: #2d2d30;
  --bg-4: #3c3c3c;
  --bg-5: #333333;
  --border: #3c3c3c;
  --border-2: #4a4a4a;
  --text: #cccccc;
  --text-2: #9d9d9d;
  --text-3: #6e6e6e;
  --accent: #007acc;
  --accent-2: #1f8ad2;
  --accent-fg: #ffffff;
  --green: #89d185;
  --green-bg: rgba(137, 209, 133, .12);
  --red: #f48771;
  --red-bg: rgba(244, 135, 113, .12);
  --yellow: #cca700;
  --yellow-bg: rgba(204, 167, 0, .12);
  --blue: #75beff;
  --purple: #c586c0;
  --hover: #2a2d2e;
  --hover-2: #37373d;
  --input-bg: #3c3c3c;
  --log-bg: #0d0d0d;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  --selection: #264f78;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f3f3f3;
  --bg-3: #ececec;
  --bg-4: #e5e5e5;
  --bg-5: #f8f8f8;
  --border: #e0e0e0;
  --border-2: #cfcfcf;
  --text: #333333;
  --text-2: #6e6e6e;
  --text-3: #8c8c8c;
  --accent: #0066b8;
  --accent-2: #0078d4;
  --accent-fg: #ffffff;
  --green: #1a7f37;
  --green-bg: rgba(26, 127, 55, .1);
  --red: #cf222e;
  --red-bg: rgba(207, 34, 46, .08);
  --yellow: #9a6700;
  --yellow-bg: rgba(154, 103, 0, .1);
  --blue: #0969da;
  --purple: #8250df;
  --hover: #e8e8e8;
  --hover-2: #dedede;
  --input-bg: #ffffff;
  --log-bg: #fafafa;
  --shadow: 0 12px 40px rgba(0, 0, 0, .16);
  --selection: #add6ff;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.muted { color: var(--text-2); }
.mono { font-family: var(--mono); }
.mobile-only { display: none !important; }

/* ------------------------------ login ------------------------------ */
.login-shell {
  height: 100vh;
  display: flex;
  background: var(--bg);
}
.login-art {
  flex: 1 1 56%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(0, 122, 204, .22), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(197, 134, 192, .12), transparent 55%),
    linear-gradient(135deg, #101a24 0%, #0d1117 45%, #161b22 100%);
  color: #d7e3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.3));
  pointer-events: none;
}
.login-art::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  top: -160px;
  border-radius: 50%;
  border: 1px solid rgba(117, 190, 255, .18);
  box-shadow: 0 0 0 60px rgba(117, 190, 255, .04), 0 0 0 120px rgba(117, 190, 255, .025);
  pointer-events: none;
}
.login-art-inner { position: relative; z-index: 1; max-width: 560px; width: 100%; }
.brand-lockup { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #007acc, #005a9e);
  color: #fff; font-family: var(--mono); font-weight: 700; font-size: 17px;
  box-shadow: 0 10px 26px rgba(0, 122, 204, .35);
}
.brand-lockup h1 { margin: 0; font-size: 28px; letter-spacing: -.3px; color: #f2f7fb; }
.brand-lockup p { margin: 4px 0 0; color: #8ea6b8; font-size: 13px; }
.login-terminal {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(8, 12, 16, .72);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  overflow: hidden;
  margin-bottom: 26px;
}
.terminal-dots { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.terminal-dots i { width: 9px; height: 9px; border-radius: 50%; background: #555; }
.terminal-dots i:nth-child(1) { background: #f06a5e; }
.terminal-dots i:nth-child(2) { background: #e6b34a; }
.terminal-dots i:nth-child(3) { background: #67c15e; }
.login-terminal pre {
  margin: 0; padding: 16px 18px; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.85; color: #b9c8d3; overflow: auto;
}
.t-dim { color: #667788; } .t-green { color: #7ee787; } .t-blue { color: #79c0ff; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; color: #9fb2c2; font-size: 13px; }
.feature-list li { display: flex; align-items: center; gap: 10px; }
.feature-list .dot { width: 6px; height: 6px; border-radius: 50%; background: #79c0ff; box-shadow: 0 0 12px #79c0ff; }
.login-meta { margin-top: 34px; font-family: var(--mono); font-size: 11px; color: #5f7688; letter-spacing: .3px; }
.login-panel {
  flex: 0 0 44%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
  background: var(--bg);
  border-left: 1px solid var(--border);
}
.login-card { width: 100%; max-width: 372px; }
.login-badge {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--green); background: var(--green-bg);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  padding: 4px 10px; border-radius: 999px; font-size: 11px; margin-bottom: 20px;
}
.login-badge .icon { width: 13px; height: 13px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.2px; }
.login-sub { margin: 0 0 24px; color: var(--text-2); font-size: 13px; }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; height: 38px; padding: 0 11px;
  background: var(--input-bg); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 42px; }
.password-wrap .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.check-row input { width: 14px; height: 14px; accent-color: var(--accent); }
.check-row.compact { white-space: nowrap; }
.form-error {
  margin: 4px 0 12px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  color: var(--red); font-size: 12.5px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--bg-3); color: var(--text);
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--hover-2); border-color: var(--border-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--red) 45%, var(--border)); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-block { width: 100%; height: 39px; margin-top: 6px; }
.btn .icon { width: 14px; height: 14px; }
.login-hint { margin: 16px 0 0; color: var(--text-3); font-size: 11.5px; text-align: center; }
.icon-btn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--text-2); border-radius: var(--radius-sm);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------------------------- workbench ---------------------------- */
.workbench {
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--titlebar-h) 1fr var(--statusbar-h);
  background: var(--bg);
}
.titlebar {
  display: flex; align-items: center; gap: 12px; overflow: hidden;
  padding: 0 10px; background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
  min-width: 0;
}
.titlebar button, .titlebar input { -webkit-app-region: no-drag; }
.titlebar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-logo {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--accent), #005a9e);
  color: #fff; font-family: var(--mono); font-size: 9px; font-weight: 700;
}
.app-name { font-size: 12.5px; font-weight: 600; letter-spacing: .1px; }
.menubar { display: flex; gap: 2px; margin-left: 8px; }
.menubar button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 4px 8px; border-radius: var(--radius-sm); font-size: 12px;
}
.menubar button:hover { background: var(--hover); color: var(--text); }
.command-trigger {
  margin: 0 auto; width: min(480px, 38vw); min-width: 0; height: 25px;
  display: flex; align-items: center; gap: 8px; padding: 0 9px;
  border: 1px solid var(--border-2); background: var(--bg-2);
  border-radius: 5px; color: var(--text-2); font-size: 12px;
  overflow: hidden; white-space: nowrap;
}
.command-trigger:hover { border-color: var(--accent); color: var(--text); }
.command-trigger span { overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; }
.command-trigger kbd {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; line-height: 15px;
}
.titlebar-right { display: flex; align-items: center; gap: 8px; }
.title-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); display: inline-block; flex: 0 0 auto; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 8px color-mix(in srgb, var(--green) 65%, transparent); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 8px color-mix(in srgb, var(--red) 65%, transparent); }
.status-dot.warn { background: var(--yellow); }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent;
  padding: 3px 6px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 12px;
}
.user-chip:hover { background: var(--hover); color: var(--text); }
.avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--bg-4);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text); text-transform: uppercase;
}
.workbench-body { display: grid; grid-template-columns: var(--activity-w) var(--sidebar-w) 1fr; min-height: 0; width: 100%; overflow: hidden; }
.activitybar {
  background: var(--bg-3); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 4px 0;
}
.activity-item {
  width: 44px; height: 44px; margin: 1px 0; border: 0; background: transparent;
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
  position: relative; border-left: 2px solid transparent;
}
.activity-item .icon { width: 21px; height: 21px; }
.activity-item:hover { color: var(--text); }
.activity-item.active { color: var(--text); border-left-color: var(--accent); }
.activity-spacer { flex: 1; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; transition: transform var(--transition);
}
.sidebar-head {
  height: 35px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-2); flex: 0 0 auto;
}
.sidebar-head-actions { display: flex; }
.sidebar-tree { flex: 1; overflow: auto; padding: 2px 0 10px; }
.tree-item {
  width: 100%; height: 28px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 12px; border: 0; background: transparent; color: var(--text-2);
  text-align: left; font-size: 12.5px; white-space: nowrap;
}
.tree-item:hover { background: var(--hover); color: var(--text); }
.tree-item.active { background: var(--hover-2); color: var(--text); }
.tree-item .icon { width: 15px; height: 15px; color: var(--text-3); }
.tree-item span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tree-child { padding-left: 30px; }
.tree-child .status-dot { width: 6px; height: 6px; }
.tree-badge {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: var(--bg-4); color: var(--text-2); flex: 0 0 auto !important;
}
.tree-badge.ok { background: var(--green-bg); color: var(--green); }
.tree-badge.bad { background: var(--red-bg); color: var(--red); }
.tree-muted { font-family: var(--mono); font-size: 10px; color: var(--text-3); flex: 0 0 auto !important; }
.tree-ext { width: 12px !important; height: 12px !important; opacity: 0; }
.tree-item:hover .tree-ext { opacity: .8; }
.tree-group-title {
  width: 100%; height: 26px; display: flex; align-items: center; gap: 4px;
  padding: 0 8px; border: 0; background: transparent; color: var(--text-2);
  font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
}
.tree-group-title:hover { color: var(--text); }
.tree-chevron { width: 13px !important; height: 13px !important; transition: transform var(--transition); }
.tree-group.collapsed .tree-chevron { transform: rotate(-90deg); }
.tree-group.collapsed .tree-children { display: none; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 9px 12px; font-size: 11px; color: var(--text-2); flex: 0 0 auto; }
.sidebar-foot-row { display: flex; align-items: center; gap: 7px; }
.sidebar-foot-meta { margin-top: 3px; font-family: var(--mono); color: var(--text-3); font-size: 10px; }

/* ------------------------------ editor ------------------------------ */
.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); overflow: hidden; }
.tabs { height: var(--tabs-h); display: flex; align-items: stretch; background: var(--bg-2); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 10px;
  border: 0; border-right: 1px solid var(--border); background: var(--bg-2);
  color: var(--text-2); font-size: 12.5px; white-space: nowrap; position: relative;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--bg); color: var(--text); }
.tab.active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--accent); }
.tab .icon { width: 14px; height: 14px; color: var(--text-3); }
.tab-close { width: 18px; height: 18px; border: 0; background: transparent; color: var(--text-3); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; }
.tab-close:hover { background: var(--hover-2); color: var(--text); }
.tab-close .icon { width: 11px; height: 11px; }
.editor-scroll { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 18px 22px 30px; width: 100%; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .1px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.hero-card { padding: 16px; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); pointer-events: none; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-2); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; background: var(--bg-4); color: var(--text-2); white-space: nowrap;
}
.pill-ok { background: var(--green-bg); color: var(--green); }
.pill-bad { background: var(--red-bg); color: var(--red); }
.pill-warn { background: var(--yellow-bg); color: var(--yellow); }
.pill-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.hero-value { margin-top: 12px; font-size: 20px; font-weight: 600; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-sub { margin-top: 3px; font-size: 12px; color: var(--text-2); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-actions { margin-top: 13px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent;
  color: var(--accent-2); font-size: 12px; padding: 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn .icon { width: 12px; height: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric-list { display: grid; gap: 10px; }
.metric-row { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.metric-row .metric-label { color: var(--text-2); }
.metric-row .metric-value { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; white-space: nowrap; }
.metric-bar { height: 6px; background: var(--bg-4); border-radius: 99px; overflow: hidden; }
.metric-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 400ms ease; }
.metric-fill.green { background: var(--green); }
.metric-fill.yellow { background: var(--yellow); }
.metric-fill.red { background: var(--red); }
.spark { width: 100%; height: 70px; margin-top: 14px; display: block; }
.spark-legend { display: flex; gap: 14px; align-items: center; font-size: 10.5px; color: var(--text-2); margin-top: 4px; }
.spark-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.legend-cpu { background: var(--accent); }
.legend-mem { background: var(--green); }
.spark-legend .muted { margin-left: auto; }
.kv-list { display: grid; gap: 8px; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.kv-key { color: var(--text-2); white-space: nowrap; }
.kv-val { font-family: var(--mono); font-size: 11.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-note { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--text-3); font-size: 11px; }
.service-compact { display: grid; gap: 2px; }
.service-row { display: flex; align-items: center; gap: 9px; padding: 8px 4px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.service-row:last-child { border-bottom: 0; }
.service-row .name { flex: 1; min-width: 0; }
.service-row .name strong { font-weight: 500; font-size: 12.5px; }
.service-row .name small { display: block; color: var(--text-3); font-size: 10.5px; font-family: var(--mono); }
.service-row .state { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); text-align: left;
}
.quick-btn:hover { border-color: var(--accent); background: var(--hover); }
.quick-btn .icon { width: 17px; height: 17px; color: var(--accent-2); margin-bottom: 3px; }
.quick-btn span { font-size: 12.5px; }
.quick-btn small { color: var(--text-3); font-size: 10.5px; }

/* ----------------------------- services ----------------------------- */
.service-list { display: grid; gap: 10px; }
.service-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.service-card-head { display: flex; align-items: center; gap: 10px; }
.service-card-head .icon { width: 18px; height: 18px; color: var(--text-2); }
.service-card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.service-card-head .pill { margin-left: auto; }
.service-card-body { margin-top: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.service-meta { font-size: 11px; color: var(--text-2); }
.service-meta b { display: block; font-weight: 500; color: var(--text); font-family: var(--mono); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-ports { margin-top: 9px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-actions { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--bg-4); color: var(--text-2); }
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-bad { background: var(--red-bg); color: var(--red); }
.badge-warn { background: var(--yellow-bg); color: var(--yellow); }

/* ------------------------------- bot -------------------------------- */
.bot-grid { display: grid; grid-template-columns: 330px 1fr; gap: 12px; margin-bottom: 12px; }
.profile-card { text-align: center; padding: 22px 16px; }
.avatar-lg {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #2b8ce6, #1155a8);
  border: 2px solid color-mix(in srgb, var(--blue) 45%, transparent);
}
.profile-name { font-size: 18px; font-weight: 600; }
.profile-sub { color: var(--text-2); font-size: 12px; margin-top: 3px; font-family: var(--mono); }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.profile-stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 8px; }
.profile-stat b { display: block; font-size: 13px; font-weight: 600; }
.profile-stat span { font-size: 10.5px; color: var(--text-3); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chain { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chain-node { flex: 1; min-width: 110px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--bg); }
.chain-node b { display: block; font-size: 12px; font-weight: 600; }
.chain-node span { font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.chain-node.ok { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.chain-node.bad { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.chain-arrow { color: var(--text-3); font-family: var(--mono); font-size: 14px; }

/* ------------------------------- logs ------------------------------- */
.page-logs { display: flex; flex-direction: column; padding-bottom: 18px; }
.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); }
.segmented button { border: 0; background: transparent; color: var(--text-2); padding: 6px 11px; font-size: 12px; border-right: 1px solid var(--border); }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--hover); color: var(--text); }
.segmented button.active { background: var(--accent); color: var(--accent-fg); }
.log-search { display: flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 9px; height: 30px; flex: 1; min-width: 180px; }
.log-search .icon { width: 13px; height: 13px; color: var(--text-3); }
.log-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 12px; height: 100%; }
.log-shell { height: calc(100vh - 315px); min-height: 320px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: var(--log-bg); }
.log-meta { display: flex; justify-content: space-between; gap: 10px; padding: 5px 10px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.log-view { flex: 1; overflow: auto; padding: 8px 0 30px; font-family: var(--mono); font-size: 11.5px; line-height: 1.65; }
.log-line { display: flex; gap: 10px; padding: 0 12px; white-space: pre-wrap; word-break: break-word; }
.log-line:hover { background: rgba(255,255,255,.03); }
.log-ln { flex: 0 0 44px; text-align: right; color: var(--text-3); user-select: none; }
.log-text { flex: 1; min-width: 0; }
.log-empty { padding: 18px; color: var(--text-3); font-family: var(--mono); }
.log-error .log-text { color: var(--red); }
.log-warn .log-text { color: var(--yellow); }
.log-debug .log-text { color: var(--text-3); }
.log-hit { background: rgba(204, 167, 0, .25); border-radius: 2px; }

/* -------------------------------- web -------------------------------- */
.page-web { display: flex; flex-direction: column; padding-bottom: 16px; }
.web-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.web-tabs button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2);
  border-radius: var(--radius-sm); font-size: 12px;
}
.web-tabs button:hover { color: var(--text); border-color: var(--border-2); }
.web-tabs button.active { border-color: var(--accent); color: var(--text); background: var(--hover); }
.web-tabs .icon { width: 14px; height: 14px; }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 5px 7px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.browser-lock { display: inline-flex; color: var(--green); padding: 0 3px; }
.browser-lock .icon { width: 13px; height: 13px; }
.browser-bar input { flex: 1; height: 26px; border: 0; background: transparent; color: var(--text-2); font-family: var(--mono); font-size: 11px; outline: none; min-width: 0; }
.web-frame-wrap { height: calc(100vh - 285px); min-height: 340px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; position: relative; background: #fff; }
.web-frame { width: 100%; height: 100%; border: 0; display: none; background: #fff; }
.web-frame.active { display: block; }
.web-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #667; background: var(--bg-2); text-align: center; padding: 20px; }
.web-placeholder.hidden { display: none; }
.web-placeholder-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-4); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.web-placeholder-icon .icon { width: 22px; height: 22px; }
.web-placeholder h3 { margin: 8px 0 0; font-size: 14px; color: var(--text); }
.web-placeholder p { margin: 0; max-width: 380px; font-size: 12px; color: var(--text-2); }

/* ----------------------------- settings ----------------------------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-stack { display: grid; gap: 0; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.security-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 12px; color: var(--text-2); }
.security-list li { display: flex; gap: 8px; align-items: flex-start; }
.security-list .icon { width: 13px; height: 13px; color: var(--green); margin-top: 2px; }

/* ---------------------------- statusbar ----------------------------- */
.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--statusbar-h); padding: 0 10px; background: var(--accent); color: #fff;
  font-size: 11px; overflow: hidden;
}
.statusbar-left, .statusbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.status-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.status-item .icon { width: 12px; height: 12px; }
.statusbar a { color: #fff; }

/* ----------------------------- palette ------------------------------ */
.palette { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 1000; display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; }
.palette-box { width: min(640px, 92vw); background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.palette-input .icon { color: var(--text-2); }
.palette-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; }
.palette-list { max-height: 340px; overflow: auto; padding: 5px; }
.palette-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: transparent; color: var(--text); border-radius: 4px; text-align: left; font-size: 12.5px; }
.palette-item:hover, .palette-item.active { background: var(--selection); }
.palette-item .icon { width: 15px; height: 15px; color: var(--text-2); }
.palette-item small { margin-left: auto; color: var(--text-3); font-family: var(--mono); font-size: 10px; }
.palette-empty { padding: 14px; color: var(--text-3); font-size: 12px; }

/* ------------------------------- toast ------------------------------- */
.toast {
  position: fixed; right: 18px; bottom: 40px; z-index: 1200; max-width: min(380px, 90vw);
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-3);
  border: 1px solid var(--border-2); box-shadow: var(--shadow); color: var(--text);
  font-size: 12.5px; transform: translateY(8px); opacity: 0; transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }

/* ----------------------------- responsive ---------------------------- */
@media (max-width: 1180px) {
  .command-trigger { width: min(360px, 30vw); }
  .service-card-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 250px; }
  .hero-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .bot-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .menubar { display: none; }
  .command-trigger { width: min(320px, 34vw); }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-flex !important; }
  .workbench { grid-template-rows: 44px 1fr var(--statusbar-h); }
  .titlebar { height: 44px; gap: 6px; padding: 0 6px; }
  .app-name { display: none; }
  .title-status span:last-child { display: none; }
  .command-trigger { flex: 1; width: auto; min-width: 0; }
  .command-trigger span, .command-trigger kbd { display: none; }
  .command-trigger { justify-content: flex-start; padding: 0 8px; }
  .user-chip #user-name { display: none; }
  .workbench-body { display: flex; flex-direction: column; }
  .editor { order: 1; flex: 1; min-height: 0; }
  .activitybar {
    order: 2; flex-direction: row; width: 100%; height: 52px; padding: 0;
    border-right: 0; border-top: 1px solid var(--border); overflow-x: auto;
    justify-content: space-around; flex: 0 0 52px;
  }
  .activity-item { width: auto; min-width: 48px; height: 50px; margin: 0; border-left: 0; border-top: 2px solid transparent; flex: 1; }
  .activity-item.active { border-left: 0; border-top-color: var(--accent); }
  .activity-spacer { display: none; }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 44px; bottom: var(--statusbar-h);
    width: min(290px, 84vw); transform: translateX(-102%); box-shadow: 18px 0 40px rgba(0,0,0,.45);
  }
  .workbench.sidebar-open .sidebar { transform: translateX(0); }
  .workbench.sidebar-open::after { content: ""; position: fixed; inset: 44px 0 var(--statusbar-h) 0; background: rgba(0,0,0,.4); z-index: 50; }
  .tabs { height: 34px; }
  .page { padding: 12px 12px 24px; }
  .page-head { flex-direction: column; gap: 10px; margin-bottom: 12px; }
  .page-head h2 { font-size: 18px; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .card { padding: 12px; }
  .hero-grid { gap: 9px; }
  .grid-2 { gap: 9px; }
  .service-card-body { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .statusbar { padding: 0 6px; font-size: 10px; }
  .statusbar-left, .statusbar-right { gap: 8px; }
  .hide-sm { display: none !important; }
  .log-shell { height: calc(100vh - 300px); min-height: 300px; }
  .log-view { font-size: 10.5px; }
  .log-line { padding: 0 8px; gap: 7px; }
  .log-ln { flex-basis: 30px; }
  .web-frame-wrap { height: calc(100vh - 300px); min-height: 300px; }
  .web-tabs button { flex: 1; justify-content: center; }
  .login-shell { flex-direction: column; overflow: auto; }
  .login-art { flex: 0 0 auto; min-height: 210px; padding: 26px 22px; }
  .login-art .login-terminal, .login-art .feature-list, .login-art .login-meta { display: none; }
  .brand-lockup { margin-bottom: 0; }
  .brand-lockup h1 { font-size: 24px; }
  .login-panel { flex: 1; border-left: 0; border-top: 1px solid var(--border); padding: 28px 22px 40px; align-items: flex-start; }
  .login-card { max-width: 100%; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .page-actions .btn { flex: 1 1 130px; min-width: 0; }
  .quick-grid { grid-template-columns: 1fr; }
  .service-card-body { grid-template-columns: 1fr; }
  .profile-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
