/* Original Ops components, styled as a compact model-service console. */
:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  --bg: #f5f7fa;
  --surface: #fff;
  --surface-subtle: #f7f9fc;
  --surface-hover: #f0f4f8;
  --ink: #1d2939;
  --text-secondary: #4e5969;
  --muted: #667085;
  --faint: #8a94a3;
  --line: #e3e9f0;
  --line-strong: #d5dde7;
  --primary: #1268e8;
  --primary-hover: #0f5cc9;
  --primary-active: #0958d9;
  --primary-soft: #edf5ff;
  --primary-softer: #f6faff;
  --primary-border: #c6ddfb;
  --focus-ring: #1268e826;
  --green: #137a54;
  --lime: var(--primary-soft);
  --white: #fff;
  --red: #c93636;
  --amber: #8a5a00;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px #16283d08;
  --shadow-sm: 0 5px 16px #16283d0a;
  --shadow-md: 0 14px 36px #16283d14, 0 3px 10px #16283d08;
  --shadow-menu: 0 16px 38px #16283d1f, 0 3px 10px #16283d0a;
  --sidebar-width: 200px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
input:disabled,
textarea:disabled {
  color: var(--muted);
  cursor: not-allowed;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.5px;
  font-weight: 650;
  line-height: 1.35;
}
h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.15px;
}
h3 {
  font-size: 13px;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
small {
  font-size: 11px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 1.2px;
  line-height: 1.5;
}
.ui-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  min-height: 100vh;
}
.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 25;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-brand,
.header-account {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-brand strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand-product {
  font-weight: 500;
  color: var(--muted);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--white);
  background: var(--primary);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 8px #1268e824;
  font-weight: 750;
  font-size: 20px;
  letter-spacing: -2px;
  padding-right: 2px;
}
.brand-mark span {
  color: #c4dcff;
}
.workspace-label {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 2px;
}
.private-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-right: 12px;
}
.private-badge .ui-icon {
  width: 14px;
  height: 14px;
}
.avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
}
.owner-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: -5px;
}
.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px;
  overflow: hidden;
}
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.nav-label {
  padding: 12px 12px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.35px;
  line-height: 1.5;
}
.nav-label:not(:first-child) {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 2px 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}
.nav-button .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--faint);
  transition: color 0.16s ease;
}
.nav-button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}
.nav-button:hover .ui-icon {
  color: var(--text-secondary);
}
.nav-button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.nav-button.active .ui-icon {
  color: var(--primary);
}
.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 16px;
}
.collapse-button {
  font-size: 12px;
  color: var(--muted);
}
.logout {
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font-size: 11px;
  padding: 8px 12px;
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}
.logout:hover {
  background: #fff1f0;
  color: var(--red);
}
.is-collapsed {
  --sidebar-width: 64px;
}
.is-collapsed .sidebar {
  padding-inline: 8px;
}
.is-collapsed .nav-text,
.is-collapsed .nav-label,
.is-collapsed .logout {
  display: none;
}
.is-collapsed .nav-button {
  justify-content: center;
  padding: 11px;
  margin-bottom: 6px;
}
.main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  background: var(--bg);
}
.content {
  max-width: 1560px;
  padding: 26px 28px 40px;
  margin: 0 auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head h1 {
  margin: 0 0 7px;
}
.page-head p {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.button,
button.primary,
.icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text-secondary);
  padding: 7px 12px;
  min-height: 32px;
  line-height: 18px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}
.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--primary-border);
  color: var(--ink);
  text-decoration: none;
}
.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: translateY(1px);
}
.button.primary,
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 6px #1268e824;
  color: var(--white);
}
.button.primary:hover:not(:disabled),
button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--white);
}
.button.primary:active:not(:disabled),
button.primary:active:not(:disabled) {
  background: var(--primary-active);
  border-color: var(--primary-active);
}
.button:disabled,
button.primary:disabled,
.icon-button:disabled {
  box-shadow: none;
  transform: none;
}
.button[aria-busy="true"],
button[aria-busy="true"] {
  cursor: progress;
}
.button[aria-busy="true"]::before,
button[aria-busy="true"]::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ops-spin 0.7s linear infinite;
}
@keyframes ops-spin {
  to {
    transform: rotate(360deg);
  }
}
.button.small {
  min-height: 27px;
  padding: 4px 10px;
  font-size: 12px;
}
.button.danger {
  color: var(--red);
  background: #fff7f6;
  border-color: #ffd6d2;
  box-shadow: none;
}
.button.danger:hover:not(:disabled) {
  color: #a92828;
  background: #ffedeb;
  border-color: #ffbdb7;
}
.button.table-action {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
  box-shadow: none;
}
.button.table-action:hover:not(:disabled) {
  background: #e1efff;
  color: var(--primary-hover);
}
.icon-button {
  padding: 6px;
  min-width: 30px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.mobile-menu {
  display: none;
}
.section-tabs {
  display: flex;
  gap: 20px;
  margin: -4px 0 20px;
  border-bottom: 1px solid var(--line);
}
.section-tabs .button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  padding: 9px 3px 11px;
}
.section-tabs .button.primary {
  color: var(--primary);
  background: transparent;
  border-bottom-color: var(--primary);
  box-shadow: none;
  font-weight: 600;
}
.section-tabs .button:hover:not(:disabled) {
  color: var(--primary);
  background: var(--surface-hover);
}
.section-tabs .button.primary:hover:not(:disabled) {
  color: var(--primary-hover);
  background: var(--primary-softer);
  border-bottom-color: var(--primary-hover);
}
.pill,
.status-tag,
.provider-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  background: var(--surface-hover);
  color: var(--text-secondary);
  padding: 0 7px;
  border-radius: 999px;
  font-weight: 500;
}
.status-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.status-tag.success,
.pill.live {
  color: var(--green);
  background: #eaf8f1;
  border-color: #ccebdd;
}
.status-tag.danger {
  color: var(--red);
  background: #fff1f0;
  border-color: #ffd6d2;
}
.status-tag.blue,
.provider-tag {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}
.pill.warning {
  color: var(--amber);
  background: #fff8e8;
  border-color: #f4e2b8;
}
.notice {
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  background: var(--primary-softer);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
  padding: 11px 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.notice.warning {
  border-color: #f0dfb9;
  background: #fffbf0;
  color: var(--amber);
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card {
  padding: 18px 20px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}
.card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.card-value {
  font-variant-numeric: tabular-nums;
  font-size: 27px;
  letter-spacing: -0.7px;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 10px;
  color: var(--ink);
}
.card-foot {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 6px;
}
.card.dark {
  border-color: var(--primary-border);
  background: var(--primary-softer);
}
.card.dark .card-value {
  color: var(--primary);
}
.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.panel {
  padding: 20px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin: 0 0 5px;
  color: var(--ink);
}
.panel-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.panel + .panel.stacked,
#control-root .panel + .panel {
  margin-top: 16px;
}
.empty {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--muted);
}
.empty.compact {
  min-height: 112px;
  padding: 18px 24px;
}
.empty strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-symbol {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 24px;
  color: var(--faint);
}
.empty p {
  color: var(--muted);
  font-size: 12px;
  max-width: 350px;
  margin: 7px 16px;
}
.empty .button {
  margin-top: 8px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 11px 13px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  vertical-align: middle;
  line-height: 1.6;
  transition: background-color 0.14s ease;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: var(--primary-softer);
}
td small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
#control-root td {
  max-width: 20rem;
  overflow-wrap: anywhere;
}
.cell-title {
  color: var(--ink);
  font-weight: 600;
}
.model-chip {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  color: var(--muted);
}
.numeric {
  text-align: right;
}
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.positive {
  color: var(--green);
}
.negative,
.error {
  color: var(--red);
}
.row-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.category-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.category-icon.cloud {
  background: #eaf8f1;
  color: var(--green);
}
.category-icon.bundle {
  background: #f3efff;
  color: #7050b5;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.cost-row:last-child {
  border: 0;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d48a0a;
  margin-right: 7px;
}
.split-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.split-summary strong {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.6px;
}
.split-summary span {
  font-size: 11px;
  color: var(--muted);
}
.bar-chart {
  width: 100%;
  height: 14px;
  display: block;
  margin-bottom: 18px;
  border-radius: 4px;
}
.chart {
  width: 100%;
  height: 180px;
  display: block;
}
.legend {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alerts li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
}
.alerts li:last-child {
  border: 0;
}
.alerts small {
  display: block;
  color: var(--muted);
}
.section-space {
  margin-top: 20px;
}
.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}
.tabs button {
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: var(--muted);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}
.tabs button:hover:not(:disabled) {
  background: var(--surface);
  color: var(--ink);
}
.tabs button.active {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
  color: var(--primary);
  font-weight: 600;
}
.sim-top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.sim-top h2 {
  font-size: 16px;
  margin: 0 0 7px;
}
.sim-top p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.sim-top .target {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.sim-top input {
  width: 72px;
  background: var(--primary-softer);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  padding: 7px;
  border-radius: var(--radius-sm);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.field input,
.field select,
.field textarea,
.name-input {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--ink);
  background: var(--surface-subtle);
  width: 100%;
  min-width: 0;
  min-height: 35px;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.field input:hover:not(:disabled),
.field select:hover:not(:disabled),
.field textarea:hover:not(:disabled),
.name-input:hover:not(:disabled),
.table-input:hover:not(:disabled),
.sim-top input:hover:not(:disabled) {
  border-color: var(--primary-border);
  background: var(--surface);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.name-input:focus,
.table-input:focus,
.sim-top input:focus {
  background: var(--surface);
  border-color: var(--primary);
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.name-input:focus-visible,
.table-input:focus-visible,
.sim-top input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field input::placeholder,
.field textarea::placeholder,
.name-input::placeholder,
.table-input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled,
.name-input:disabled,
.table-input:disabled {
  background: var(--surface-hover);
  border-color: var(--line);
}
.field textarea {
  resize: vertical;
}
.field select[multiple] {
  min-height: 110px;
  padding: 6px;
}
.field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}
.table-input {
  width: 78px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.table-input.count {
  width: 62px;
}
form[aria-busy="true"] {
  cursor: progress;
}
form[aria-busy="true"] .field-grid {
  opacity: 0.88;
}
form[aria-busy="true"] .button {
  cursor: progress;
}
.select-control {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--ink);
}
.select-control.is-open {
  z-index: 70;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.select-trigger:hover:not(:disabled) {
  border-color: var(--primary-border);
  background: var(--surface);
}
.select-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.select-trigger:disabled {
  opacity: 1;
  border-color: var(--line);
  background: var(--surface-hover);
  box-shadow: none;
  color: var(--muted);
  cursor: not-allowed;
}
[data-select-value] {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-chevron {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--muted);
  transition: transform 0.16s ease;
}
.select-chevron::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.select-control.is-open .select-chevron {
  transform: rotate(180deg);
}
.select-control.is-open .select-trigger {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: block;
  width: 100%;
  min-width: 100%;
  max-height: 260px;
  margin: 0;
  padding: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.select-control.drop-up .select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.select-option {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  margin: 1px 0;
  padding: 6px 28px 6px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}
.select-option:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--ink);
}
.select-option.is-active:not(:disabled) {
  background: var(--primary-softer);
  box-shadow: inset 0 0 0 1px var(--primary-border);
  color: var(--ink);
}
.select-option[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.select-option[aria-selected="true"].is-active {
  background: #e1efff;
}
.select-option[aria-selected="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 4px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-65%) rotate(45deg);
}
.select-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.select-option:disabled {
  opacity: 0.55;
  background: transparent;
  cursor: not-allowed;
}
.select-control.has-error .select-trigger {
  border-color: var(--red);
  background: #fffafa;
}
.select-control.has-error .select-trigger:focus-visible,
.select-control.has-error.is-open .select-trigger {
  box-shadow: 0 0 0 3px #c9363614;
}
.select-error {
  display: block;
  margin-top: 5px;
  color: var(--red);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}
.data-skeleton {
  display: grid;
  gap: 8px;
  padding: 2px 0;
}
.data-skeleton > span {
  display: block;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}
.data-skeleton > span:first-child {
  height: 38px;
  background: var(--surface-hover);
}
.is-refreshing {
  position: relative;
  min-height: 48px;
  cursor: progress;
}
.is-refreshing > * {
  opacity: 0.88;
}
.is-refreshing::before {
  content: "";
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  pointer-events: none;
}
.is-refreshing::after {
  content: "正在刷新…";
  position: absolute;
  z-index: 9;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  pointer-events: none;
}
.results {
  margin-top: 20px;
}
.scenario-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
}
.scenario-detail {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
}
summary {
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.16s ease;
}
summary:hover {
  color: var(--primary);
}
details[open] > summary {
  margin-bottom: 18px;
}
details.panel {
  padding: 16px 20px;
}
.sources {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sources li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  line-height: 1.5;
}
.sources small {
  color: var(--muted);
}
.source-tag {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.footnote {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  margin-top: 20px;
}
.loading {
  padding: 40px;
  color: var(--muted);
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: auto;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
  z-index: 100;
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
}
#toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#toast.error {
  border-color: #ffd6d2;
  border-left-color: var(--red);
  background: #fffafa;
  color: #a92828;
}
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  padding: 38px;
  border-radius: var(--radius-xl);
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-md);
}
.login-card .brand-mark {
  margin-bottom: 22px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  font-size: 26px;
}
.login-card h1 {
  font-size: 24px;
  margin: 0 0 12px;
}
.login-card .muted {
  font-size: 12px;
  line-height: 1.75;
}
.login-card footer {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.login-card .eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 10px;
}
#login-action {
  margin-top: 24px;
}
#login-action p {
  margin: 0;
}
#login-action .button {
  width: 100%;
  min-height: 38px;
}
.local-help {
  padding: 12px 14px;
  border: 1px solid var(--primary-border);
  background: var(--primary-softer);
  font-size: 12px;
  line-height: 1.7;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.local-help code {
  color: var(--primary);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.login-card .error {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
}
.login-card .error:empty {
  display: none;
}
.no-margin {
  margin: 0;
}
.preview-note {
  font-size: 11px;
  color: var(--muted);
}
.saved-name {
  font-size: 13px;
  font-weight: 600;
}
.saved-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.saved-row:first-child {
  padding-top: 0;
}
.saved-row p {
  font-size: 12px;
  margin: 5px 0;
  color: var(--muted);
}
.saved-row:last-child {
  border: 0;
}
.span-full {
  grid-column: 1/-1;
}
code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.94em;
}
.connector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.connector {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 18px;
}
.connector p {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0 0;
}
.warning-list {
  padding-left: 18px;
  color: var(--amber);
  font-size: 12px;
  line-height: 1.9;
}
.amount-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.control-json {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 30rem;
  overflow: auto;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 11px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.control-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 0;
}
.control-toolbar:empty {
  display: none;
}
.list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.list-toolbar .control-toolbar {
  margin: 0;
}
.list-toolbar form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}
.list-toolbar .field-grid {
  grid-template-columns: repeat(3, minmax(100px, 190px));
  gap: 10px;
}
.list-toolbar .field-grid:has(input[type="hidden"]):not(:has(.field)) {
  display: none;
}
.data-panel [data-control-data] > .footnote {
  margin: 0 0 12px;
  font-size: 11px;
}
.data-panel [data-control-data] > .control-toolbar {
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
[data-control-editor] {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}
[data-control-editor] > h2,
[data-control-detail] > h2 {
  margin-bottom: 8px;
}
[data-control-editor] > .muted {
  font-size: 12px;
}
@media (max-width: 1150px) {
  :root {
    --sidebar-width: 180px;
  }
  .content {
    padding: 22px;
  }
  .cards {
    gap: 12px;
  }
  .card {
    padding: 16px;
  }
  .card-value {
    font-size: 24px;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .list-toolbar form {
    min-width: 0;
  }
}
@media (max-width: 760px) {
  .shell,
  .shell.is-collapsed {
    display: block;
    padding-top: 56px;
  }
  .topbar {
    height: 56px;
    position: fixed;
    left: 0;
    right: 0;
    padding: 0 16px;
    gap: 8px;
  }
  .header-brand {
    gap: 8px;
  }
  .header-brand strong {
    font-size: 15px;
  }
  .workspace-label,
  .owner-name,
  .private-badge {
    display: none;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .sidebar,
  .is-collapsed .sidebar {
    display: none;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 208px;
    height: calc(100dvh - 56px);
    z-index: 24;
    padding: 12px;
    box-shadow: 16px 0 36px #1d212915;
  }
  .nav-open .sidebar {
    display: flex;
  }
  .nav-open .nav-text,
  .nav-open .nav-label,
  .nav-open .logout {
    display: block;
  }
  .nav-open .nav-button {
    justify-content: flex-start;
  }
  .collapse-button {
    display: none;
  }
  .content {
    padding: 20px 16px 32px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  h1 {
    font-size: 21px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-value {
    font-size: 23px;
  }
  .card-foot {
    font-size: 10px;
  }
  .panel {
    padding: 16px;
    border-radius: 10px;
  }
  .field-grid {
    gap: 14px;
  }
  .sim-top {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }
  .connector-grid {
    grid-template-columns: 1fr;
  }
  .sources li,
  .saved-row {
    flex-direction: column;
    gap: 6px;
  }
  .table-wrap table {
    min-width: 600px;
  }
  .section-tabs {
    gap: 16px;
  }
  .list-toolbar {
    align-items: stretch;
  }
  .list-toolbar form {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .list-toolbar .field-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

#cloud-login { display: grid; gap: 16px; margin-top: 24px; text-align: left; }
#cloud-login label { display: grid; gap: 8px; font-size: 14px; }
#cloud-login input { width: 100%; box-sizing: border-box; min-height: 42px; }
#cloud-login button { margin-top: 4px; width: 100%; }
