:root {
  --brand: #0f9f76;
  --brand-strong: #0a7d5c;
  --brand-soft: #e8f6f0;
  --accent: #e8912d;
  --accent-soft: #fff1e4;
  --ink: #1d2522;
  --ink-soft: #63716b;
  --ink-faint: #8b9993;
  --line: #e5eae7;
  --surface: #ffffff;
  --surface-subtle: #f5f8f6;
  --surface-strong: #eef3f0;
  --danger: #d24f3f;
  --danger-soft: #fdecea;
  --info: #3b78c2;
  --info-soft: #eaf2fc;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 18px 50px rgba(25, 50, 40, 0.09);
  --shadow-sm: 0 1px 2px rgba(25, 50, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--surface-subtle);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 15px;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--ink-soft);
}

.faint {
  color: var(--ink-faint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--brand-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--surface-subtle);
  border-color: var(--brand);
  color: var(--brand-strong);
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: #b73a2d;
}

.btn.sm {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.btn.block {
  width: 100%;
}

.btn.link {
  background: transparent;
  border-color: transparent;
  color: var(--brand-strong);
  padding: 0;
  min-height: 28px;
}

.btn.link:hover {
  background: transparent;
  color: var(--ink);
}

.icon-btn {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.field {
  display: grid;
  gap: 7px;
}

.label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.help {
  color: var(--ink-faint);
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.row.wrap {
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.tag.green {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tag.amber {
  background: var(--accent-soft);
  color: #99601c;
}

.tag.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.blue {
  background: var(--info-soft);
  color: var(--info);
}

.copy-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.copy-line code {
  min-width: 0;
  overflow: hidden;
}

/* Auth and setup screens */
.centered-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card,
.setup-card {
  width: min(440px, 100%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 8px 18px rgba(15, 159, 118, 0.25);
}

.brand-lockup h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-lockup p {
  color: var(--ink-faint);
  font-size: 12px;
}

.surface-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.auth-card .surface-panel,
.setup-card .surface-panel {
  padding: 26px;
}

.auth-mode-head {
  margin-bottom: 22px;
}

.auth-mode-head h2 {
  font-size: 20px;
  line-height: 1.3;
}

.auth-mode-head p {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 13px;
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
}

.auth-switch a {
  color: var(--brand-strong);
  font-weight: 600;
}

.tabs {
  display: flex;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
}

.tab.active {
  color: var(--brand-strong);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.auth-form,
.setup-form {
  display: grid;
  gap: 16px;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}

.sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 18px;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
}

.sidebar-brand span {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-link:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.nav-link svg {
  width: 17px;
  height: 17px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.sidebar-support {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.sidebar-support-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.sidebar-support-icon svg {
  width: 17px;
  height: 17px;
}

.sidebar-support-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-support-meta span {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
}

.sidebar-support-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--brand-strong);
  font-weight: 700;
}

.user-meta {
  min-width: 0;
}

.user-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.user-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-faint);
  font-size: 11px;
}

.mobile-topbar {
  display: none;
}

.content {
  min-width: 0;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(229, 234, 231, 0.9);
  background: rgba(245, 248, 246, 0.88);
  backdrop-filter: blur(12px);
}

.page {
  display: grid;
  gap: 22px;
  padding: 26px 28px 48px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-head h1 {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.page-head p {
  color: var(--ink-soft);
  margin-top: 3px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  font-size: 14px;
}

.panel-body {
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-width: 0;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  margin-top: 8px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.metric-sub {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 12px;
}

.chart {
  min-height: 270px;
}

.chart-bars {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 8px 4px 0;
}

.bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bar-value {
  color: var(--ink-soft);
  font-size: 11px;
}

.bar-track {
  width: 100%;
  max-width: 46px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  border-radius: 7px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 7px 7px 0 0;
  background: var(--brand);
  transition: height 0.25s ease;
}

.bar-fill.accent {
  background: var(--accent);
}

.bar-label {
  color: var(--ink-faint);
  font-size: 11px;
  white-space: nowrap;
}

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

.quick-action {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.quick-action:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.quick-action .quick-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand-strong);
}

.quick-action strong {
  display: block;
  font-size: 13px;
}

.quick-action span {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--ink-soft);
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface-subtle);
}

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

.data-table tbody tr:hover td {
  background: #fbfdfc;
}

.actions {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--ink-faint);
  text-align: center;
  gap: 7px;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #86571b;
  font-size: 13px;
}

.notice.info {
  background: var(--info-soft);
  color: var(--info);
}

.content-notice {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.faq-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 650;
}

.faq-item summary::after {
  content: '+';
  margin-left: auto;
  color: var(--ink-faint);
  font-weight: 600;
}

.faq-item[open] summary::after {
  content: '-';
}

.faq-item p,
.faq-item ol,
.faq-item ul {
  margin: 0;
  padding: 0 14px 13px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.faq-item summary + * {
  margin-top: -2px;
}

.faq-steps,
.faq-codes {
  padding-left: 30px !important;
}

.faq-item p.muted {
  padding-top: 10px;
}

.faq-item .wb-model-chips {
  max-height: 300px;
  overflow: auto;
  padding: 2px 14px 12px;
}

.faq-model-wrap {
  overflow-x: auto;
  padding: 2px 14px 10px;
}

.faq-model-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 12px;
}

.faq-model-table th,
.faq-model-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.faq-model-table th {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.faq-model-table tr:last-child td {
  border-bottom: 0;
}

.faq-model-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
}

.faq-model-name:hover {
  text-decoration: underline;
}

.faq-model-table .cap {
  text-align: center;
  color: var(--ink-faint);
}

.faq-model-table .cap.ok {
  color: var(--brand-strong);
  font-weight: 700;
}

.faq-hl {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-family: var(--mono);
  font-size: 12px;
}

.auth-card > .notice {
  margin-bottom: 12px;
}

.code-block {
  display: block;
  min-width: 0;
  overflow-x: auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #18211e;
  color: #dcebe4;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}

.inline-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brand-strong);
}

.guide-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.guide-step:last-child {
  border-bottom: 0;
}

.step-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
}

.guide-step h4 {
  margin-bottom: 5px;
  font-size: 13px;
}

.guide-step p {
  color: var(--ink-soft);
  font-size: 13px;
}

.wb-config-card {
  overflow: hidden;
}

.wb-config-head {
  align-items: flex-start;
  gap: 16px;
}

.wb-config-head h3 {
  font-size: 18px;
}

.wb-config-head p {
  margin-top: 3px;
  font-size: 13px;
}

.wb-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  overflow-x: auto;
}

.wb-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.wb-tabs button:hover {
  background: var(--surface);
  color: var(--ink);
}

.wb-tabs button.on {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 159, 118, 0.18);
}

.wb-tabs svg {
  width: 15px;
  height: 15px;
}

.wb-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid rgba(229, 234, 231, 0.72);
}

.wb-step-number {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.wb-step-number svg {
  width: 14px;
  height: 14px;
}

.wb-step-body {
  min-width: 0;
  flex: 1;
}

.wb-step-body h4 {
  margin-bottom: 5px;
  font-size: 14px;
}

.wb-step-body p {
  color: var(--ink-soft);
  font-size: 13px;
}

.wb-step-body p + .btn,
.wb-step-body p + .wb-code-box,
.wb-step-body p + .wb-key-box,
.wb-step-body p + .wb-warning,
.wb-step-body p + .wb-model-list {
  margin-top: 10px;
}

.wb-code-box {
  position: relative;
  margin-top: 10px;
  padding: 42px 14px 14px;
  border-radius: var(--radius-sm);
  background: #18211e;
  color: #dcebe4;
  overflow: hidden;
}

.wb-code-box > .btn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 28px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.wb-code-box > .btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
}

.wb-code-box code,
.wb-code-box pre {
  display: block;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wb-prompt-box pre {
  max-height: 420px;
  overflow: auto;
}

.wb-key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 10px;
  padding: 8px 9px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.wb-key-box code {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.key-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.key-copy-row input {
  flex: 1;
  min-width: 0;
}

.wb-kv-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.wb-kv-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wb-kv-list li > span {
  width: 70px;
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 12px;
}

.wb-kv-list code {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.wb-warning {
  margin-top: 9px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.wb-model-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.wb-model-list summary {
  padding: 9px 12px;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.wb-model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
}

.wb-model-chip {
  min-height: 27px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.wb-model-chip:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.wb-key-manager {
  overflow: hidden;
}

.wb-key-manager > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.wb-key-manager > summary::-webkit-details-marker {
  display: none;
}

.wb-key-manager > summary span {
  display: grid;
  gap: 2px;
}

.wb-key-manager > summary strong {
  font-size: 14px;
}

.wb-key-manager > summary small {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 400;
}

.wb-key-manager > summary svg {
  transition: transform 0.18s ease;
}

.wb-key-manager[open] > summary svg {
  transform: rotate(180deg);
}

.wb-key-manager[open] > summary {
  border-bottom: 1px solid var(--line);
}

.wb-manager-actions {
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.segmented button.active {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: var(--shadow-sm);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 28, 24, 0.46);
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 15px;
}

.modal-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
}

.modal-close:hover {
  background: var(--surface-subtle);
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.toast.success {
  background: var(--brand);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--info);
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

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

  .quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 0 15px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .mobile-nav {
    margin-left: auto;
  }

  .mobile-nav select {
    min-height: 34px;
    padding: 0 9px;
    border-radius: var(--radius-sm);
    border-color: var(--line);
    background: var(--surface);
  }

  .topbar {
    display: none;
  }

  .page {
    padding: 20px 15px 40px;
  }

  .page-head {
    display: grid;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart-bars {
    gap: 7px;
  }

  .wb-config-head {
    flex-direction: column;
  }

  .wb-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .wb-tabs button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    white-space: normal;
  }

  .wb-step {
    padding: 13px;
  }

  .wb-key-box,
  .wb-kv-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .key-copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .wb-kv-list li > span {
    width: auto;
  }
}
