:root {
  color-scheme: light;
  --bg: #050812;
  --panel: rgba(18, 24, 42, 0.74);
  --panel-strong: rgba(20, 27, 48, 0.94);
  --panel-soft: rgba(30, 41, 73, 0.52);
  --text: #e8eefc;
  --muted: #96a3c2;
  --line: rgba(148, 163, 255, 0.16);
  --line-strong: rgba(148, 163, 255, 0.28);
  --primary: #38bdf8;
  --primary-strong: #7dd3fc;
  --primary-soft: rgba(56, 189, 248, 0.14);
  --danger: #fb7185;
  --warning: #fbbf24;
  --success: #34d399;
  --sidebar: rgba(12, 16, 30, 0.9);
  --sidebar-soft: rgba(99, 102, 241, 0.22);
  --sidebar-text: #e8eefc;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  --input-bg: rgba(8, 13, 28, 0.66);
  --control-bg: var(--input-bg);
  --control-text: var(--text);
  --control-border: var(--line-strong);
  --control-border-hover: rgba(125, 211, 252, 0.52);
  --control-radius: 7px;
  --control-height: 36px;
  --control-compact-height: 30px;
  --control-padding-x: 10px;
  --control-focus: rgba(56, 189, 248, 0.14);
  --control-disabled-bg: rgba(148, 163, 184, 0.10);
  --control-placeholder: var(--muted);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(120% 90% at 18% 0%, rgba(37, 99, 235, 0.30), transparent 42%),
    radial-gradient(90% 80% at 88% 22%, rgba(139, 92, 246, 0.20), transparent 42%),
    radial-gradient(80% 70% at 45% 100%, rgba(6, 182, 212, 0.14), transparent 50%),
    linear-gradient(140deg, #162035 0%, #0a0f1b 48%, var(--bg) 100%);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background-color: var(--control-bg);
  color: var(--control-text);
  padding: 7px var(--control-padding-x);
  outline: none;
  line-height: 1.45;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover,
select:hover,
textarea:hover {
  border-color: var(--control-border-hover);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--control-focus);
}

input::placeholder,
textarea::placeholder {
  color: var(--control-placeholder);
  opacity: 0.72;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):disabled,
select:disabled,
textarea:disabled,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"])[readonly],
textarea[readonly] {
  background-color: var(--control-disabled-bg);
  color: var(--muted);
}

select {
  appearance: none;
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

select[multiple] {
  min-height: 128px;
  padding-right: var(--control-padding-x);
  background-image: none;
}

input[type="checkbox"],
input[type="radio"] {
  appearance: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  vertical-align: middle;
}

input[type="file"] {
  min-height: 40px;
  padding: 5px 8px;
  line-height: 28px;
}

input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 13, 28, 0.74);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.48), rgba(139, 92, 246, 0.42));
  border: 2px solid rgba(8, 13, 28, 0.88);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.64), rgba(129, 140, 248, 0.58));
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  margin-top: 2px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-tabs button {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-strong);
  box-shadow: 0 1px 5px rgba(20, 32, 42, 0.08);
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, rgba(22, 28, 48, 0.80) 0%, var(--sidebar) 100%);
  border-right: 1px solid rgba(148, 163, 255, 0.14);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 24px 18px;
  backdrop-filter: blur(14px) saturate(1.1);
}

.sidebar .brand {
  flex: 0 0 auto;
  padding: 0 4px 10px;
  margin: 0;
}

.sidebar .brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.96), rgba(99, 102, 241, 0.92));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 255, 0.22), 0 14px 32px rgba(59, 130, 246, 0.20);
}

.sidebar .brand-subtitle {
  color: #9fb1c2;
}

.nav {
  padding: 6px 0 12px;
  display: grid;
  flex: 1 1 0;
  align-content: start;
  gap: 16px;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-group {
  display: grid;
  gap: 7px;
}

.nav-group-title {
  padding: 0 6px;
  color: #9fb1c2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 255, 0.16);
  border-radius: 10px;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.nav button:hover,
.nav button.active {
  background: var(--sidebar-soft);
  border-color: rgba(99, 140, 255, 0.38);
}

.nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #dbe7ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 255, 0.08);
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav button:hover .nav-icon,
.nav button.active .nav-icon {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(99, 102, 241, 0.26));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 255, 0.22), 0 10px 24px rgba(59, 130, 246, 0.16);
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
  min-height: 62px;
  background: rgba(18, 24, 42, 0.52);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
}

.user-menu {
  position: relative;
  flex: 0 0 auto;
}

.user-menu-trigger {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(20, 32, 42, 0.05);
}

.avatar {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.chevron {
  color: var(--muted);
  font-size: 13px;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 168px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(20, 32, 42, 0.18);
  z-index: 30;
}

.user-dropdown.open {
  display: grid;
}

.user-dropdown button {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.user-dropdown button:hover {
  background: var(--panel-soft);
}

.page {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  min-width: 0;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.page-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar-spacer {
  flex: 1;
}

.market-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.toolbar-search {
  min-width: min(320px, 100%);
  flex: 0 1 360px;
}

.account-actions {
  margin: 16px 0 0;
}

.inline-sync-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.inline-box-select {
  min-height: var(--control-compact-height);
  max-width: 168px;
  width: auto;
  padding-top: 4px;
  padding-bottom: 4px;
}

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

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.algorithm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.algorithm-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.08);
}

.algorithm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.algorithm-card h2,
.empty-state h2 {
  margin: 0;
  font-size: 18px;
}

.algorithm-card p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.algorithm-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.algorithm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.algorithm-deps {
  min-height: 34px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.34);
  color: #c8d5f0;
}

.algorithm-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.algorithm-sync-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.34);
}

.algorithm-sync-summary > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.algorithm-sync-summary strong {
  color: var(--success);
}

.algorithm-sync-summary.error strong {
  color: var(--danger);
}

.algorithm-sync-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.sync-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.sync-history-item.success {
  border-color: rgba(52, 211, 153, 0.24);
}

.sync-history-item.error {
  border-color: rgba(251, 113, 133, 0.30);
}

.sync-history-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.sync-history-title strong {
  color: var(--success);
}

.sync-history-item.error .sync-history-title strong {
  color: var(--danger);
}

.algorithm-creative-section,
.algorithm-usage-section {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.compact-toolbar {
  margin-bottom: 0;
}

.market-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.market-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.market-filter-panel {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 0;
}

.market-results-panel {
  min-width: 0;
}

.market-filter-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.market-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-filter-card h3 {
  margin: 0;
  font-size: 13px;
  color: #dbe7ff;
}

.market-filter-more {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.10);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.market-filter-more:hover {
  background: rgba(56, 189, 248, 0.18);
}

.market-filter-options {
  display: grid;
  gap: 8px;
}

.market-filter-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 255, 0.14);
  border-radius: 7px;
  background: rgba(148, 163, 255, 0.08);
  color: var(--text);
  text-align: left;
}

.market-filter-option:hover {
  background: rgba(148, 163, 255, 0.15);
}

.market-filter-option.active {
  border-color: rgba(56, 189, 248, 0.52);
  background: rgba(56, 189, 248, 0.16);
  color: var(--primary-strong);
}

.market-filter-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-filter-option span {
  min-width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(148, 163, 255, 0.14);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-filter-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.market-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.market-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.market-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.market-card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.market-card p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.market-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.market-card-section {
  display: grid;
  gap: 7px;
}

.market-card-section label {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.model-class-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.market-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel,
.stat,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.08);
}

.panel {
  padding: 20px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
}

.stat {
  padding: 16px;
}

.stat-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.stat-label {
  margin-top: 8px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
}

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

th {
  color: #dbe7ff;
  font-weight: 700;
  background: var(--panel-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.col-actions {
  width: 230px;
  text-align: right;
}

.actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.review-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  min-width: 360px;
}

.actions .btn,
.review-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.list-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.list-filter-field {
  min-width: 160px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.list-filter-field.grow {
  min-width: 240px;
  flex: 1 1 280px;
}

.list-filter-field input,
.list-filter-field select {
  width: 100%;
  min-height: var(--control-height);
}

.list-filter-field label,
.list-filter-field span {
  line-height: 1.35;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: nowrap;
}

.param-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.param-group-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.strong {
  font-weight: 700;
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.badge.gray {
  background: rgba(148, 163, 255, 0.12);
  color: #c8d5f0;
}

.badge.warning {
  background: rgba(251, 191, 36, 0.16);
  color: var(--warning);
}

.badge.danger {
  background: rgba(251, 113, 133, 0.15);
  color: var(--danger);
}

.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 255, 0.16);
  border-radius: 6px;
  background: rgba(148, 163, 255, 0.10);
  color: var(--text);
  text-decoration: none;
}

.btn.mini {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.btn:hover {
  background: rgba(148, 163, 255, 0.18);
}

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

.btn.loading,
.btn[aria-busy="true"] {
  position: relative;
  gap: 8px;
}

.btn.loading::before,
.btn[aria-busy="true"]::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.75s linear infinite;
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.96), rgba(99, 102, 241, 0.88));
  border-color: rgba(125, 211, 252, 0.38);
  color: #fff;
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.96), rgba(129, 140, 248, 0.90));
}

.btn.ghost {
  background: transparent;
  color: var(--primary-strong);
}

.btn.danger {
  background: rgba(251, 113, 133, 0.15);
  border-color: rgba(251, 113, 133, 0.25);
  color: var(--danger);
}

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

.operation-status {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.10);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.operation-status[hidden] {
  display: none;
}

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

.form-row > .field {
  min-width: 0;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field label {
  color: #dbe7ff;
  font-weight: 700;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  width: 100%;
}

.input-like {
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.30);
  color: var(--text);
  line-height: 1.4;
}

.validation.warning {
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.upload-progress {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  transition: width 0.16s ease;
}

.yolo-verify-layout {
  display: grid;
  gap: 18px;
}

.yolo-verify-section {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.22);
}

.yolo-verify-section .segmented button.active {
  background: #edf5f6;
  color: #0d555c;
  box-shadow: inset 0 0 0 1px rgba(20, 106, 114, 0.18);
}

.section-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-subhead h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.section-subhead p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.yolo-verify-model-row {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.9fr);
  align-items: end;
}

.yolo-verify-upload-form {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  align-items: end;
}

.yolo-verify-upload-form .field {
  min-width: 0;
}

.yolo-verify-upload-form .wide {
  grid-column: 1 / -1;
}

.yolo-verify-model-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.yolo-verify-model-summary > div {
  min-width: 0;
}

.yolo-verify-model-summary strong,
.yolo-verify-model-summary .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yolo-verify-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.yolo-verify-spec {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.yolo-verify-spec > strong {
  font-size: 13px;
}

.compact-spec-table table {
  min-width: 420px;
}

.compact-spec-table th,
.compact-spec-table td {
  padding: 8px 10px;
  font-size: 12px;
}

.quick-run-options.yolo-verify-options {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.quick-run-options.yolo-verify-options .wide {
  grid-column: 1 / -1;
}

.model-import-specs {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.doc-editor-section {
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 13, 28, 0.20);
}

.doc-editor-field {
  gap: 6px;
}

.doc-editor-field label {
  font-size: 15px;
}

.doc-editor-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.doc-editor-textarea {
  min-height: 160px;
  overflow: hidden;
  resize: none;
  line-height: 1.72;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.045);
  border-left: 3px solid rgba(56, 189, 248, 0.55);
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.34);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbe7ff;
  font-weight: 700;
  line-height: 1.35;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 22px;
}

.modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: var(--panel-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

.modal.run-modal {
  width: min(1180px, 100%);
}

.modal.large-modal {
  width: min(1280px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
}

.modal-header,
.modal-footer {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  border-top: 1px solid var(--line);
}

.modal-body {
  padding: 20px;
}

.modal-body > .form,
.modal-body > form {
  min-width: 0;
}

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

.detail-grid label {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 5px;
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.detail-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-hero h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.detail-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}

.detail-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.detail-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.sync-result-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.36);
}

.sync-result-hero.success {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(16, 185, 129, 0.10);
}

.sync-result-hero.error {
  border-color: rgba(251, 113, 133, 0.36);
  background: rgba(251, 113, 133, 0.10);
}

.sync-result-state {
  min-width: 86px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 800;
}

.sync-result-hero.success .sync-result-state {
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
}

.sync-result-hero.error .sync-result-state {
  background: rgba(251, 113, 133, 0.16);
  color: var(--danger);
}

.sync-result-hero h3 {
  margin: 0;
  font-size: 20px;
}

.sync-result-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.sync-result-grid {
  margin-bottom: 16px;
}

.sync-result-steps {
  display: grid;
  gap: 10px;
}

.sync-result-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.26);
}

.sync-result-step-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.sync-result-messages strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.sync-result-messages ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.sync-result-messages.error li,
.sync-result-error-text {
  color: var(--danger);
}

.sync-result-messages.warning li {
  color: var(--warning);
}

.sync-result-json {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.28);
  overflow: hidden;
}

.sync-result-json summary {
  padding: 11px 13px;
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 800;
}

.sync-result-json pre {
  max-height: 280px;
  margin: 0;
  padding: 12px 13px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: #dbe7ff;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.spec-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.spec-table table {
  min-width: 620px;
}

.spec-table th,
.spec-table td {
  padding: 10px 12px;
}

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

.run-output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}

.run-preview-panel,
.run-log-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.run-panel-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.run-modal .form + .validation,
.run-modal .validation + .run-output-grid,
.run-modal .validation + .test-run-dependency,
.run-modal .test-run-dependency + .run-output-grid {
  margin-top: 14px;
}

.test-run-dependency {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.test-run-dependency.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.07);
}

.test-run-dependency.bad {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.07);
}

.test-run-dependency-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.test-run-dependency-head span {
  flex: 0 0 auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.test-run-dependency-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.test-run-dependency-grid div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.test-run-dependency-grid b {
  color: var(--muted);
  font-size: 12px;
}

.test-run-dependency-grid span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-run-dependency-alert,
.test-run-dependency-warnings {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.test-run-dependency-warnings {
  color: var(--muted);
}

.run-preview-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.run-preview-stage {
  position: relative;
  height: 390px;
  flex: 0 0 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #05070a;
  border: 1px solid #111827;
}

.run-preview-notice {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.78);
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(6px);
}

.run-preview-notice[hidden] {
  display: none;
}

.run-preview-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.run-preview-stream {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070a;
}

.run-preview-loader {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.run-log {
  height: 390px;
  max-height: 390px;
  min-height: 0;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

.designer-layout {
  display: grid;
  grid-template-columns: 280px minmax(620px, 1fr) 360px;
  gap: 18px;
  height: calc(100vh - 194px);
  min-height: 620px;
  align-items: stretch;
  overflow: hidden;
}

.palette,
.properties {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.designer-topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.designer-topbar select {
  width: auto;
  min-width: 220px;
}

.designer-algorithm-tag {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, 100%);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.designer-algorithm-tag span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.designer-algorithm-tag strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.designer-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.designer-command-actions .muted {
  white-space: nowrap;
}

.enhanced-designer {
  --designer-border: var(--line);
  --designer-border-strong: var(--line-strong);
  --designer-glass-soft: #eef7f8;
  --designer-canvas-bg: #f7fbfc;
  --designer-canvas-grid: #dfe9ef;
  --designer-input-bg: #ffffff;
}

.designer-sidebar,
.designer-properties,
.designer-canvas-card {
  min-height: 0;
}

.designer-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.designer-panel-head {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.palette-search {
  width: 100%;
}

.component-palette {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.canvas {
  background: rgba(8, 13, 28, 0.38);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
}

.notice,
.validation {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 42, 0.74);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.notice {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary-strong);
}

.validation.ok {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.12);
}

.validation.bad {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.12);
}

.hint {
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  line-height: 1.55;
}

.palette {
  max-height: calc(100vh - 132px);
  overflow: auto;
}

.enhanced-designer .palette {
  max-height: none;
  overflow: hidden;
}

.designer-properties {
  max-height: calc(100vh - 168px);
  overflow: auto;
}

.palette-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.palette-group-title {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.component-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.42);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.component-btn.dragging {
  opacity: 0.72;
}

.component-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
  opacity: 0.9;
}

.component-btn-main {
  min-width: 0;
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
}

.component-btn-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-btn-main span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.component-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.component-source-badge,
.component-price-badge {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.component-source-badge.official {
  background: rgba(45, 212, 191, 0.15);
  color: #7ddbd0;
}

.component-source-badge.market {
  background: rgba(96, 165, 250, 0.15);
  color: #a7c8ff;
}

.component-source-badge.own {
  background: rgba(251, 191, 36, 0.16);
  color: #f8d37a;
}

.component-source-badge.box {
  background: rgba(167, 139, 250, 0.16);
  color: #c4b5fd;
}

.component-price-badge {
  background: rgba(148, 163, 184, 0.14);
  color: #d4dfef;
}

.component-info-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--primary-strong);
  padding: 0 9px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.component-info-btn:hover {
  border-color: var(--line-strong);
  background: var(--primary-soft);
}

.component-card-info {
  flex: 0 0 auto;
  min-height: 28px;
}

.graph-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 620px;
  height: 100%;
  overflow: hidden;
}

.graph-board {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 540px;
  overflow: hidden;
  background-color: var(--designer-canvas-bg);
  background:
    linear-gradient(var(--designer-canvas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--designer-canvas-grid) 1px, transparent 1px),
    var(--designer-canvas-bg);
  background-size: 24px 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.canvas-bottom-actions {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 14;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: calc(100% - 32px);
  overflow-x: auto;
  pointer-events: none;
}

.canvas-bottom-actions .btn {
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 10px 22px rgba(20, 32, 42, 0.16);
}

.graph-scaled,
.graph-nodes,
.graph-links,
.graph-link-actions {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.graph-links,
.graph-link-actions {
  pointer-events: none;
}

.graph-scaled {
  will-change: transform;
}

.graph-nodes {
  z-index: 4;
}

.graph-links {
  z-index: 8;
}

.graph-link-actions {
  z-index: 11;
}

.graph-link {
  fill: none;
  stroke: rgba(20, 106, 114, 0.78);
  stroke-width: 2.5;
  pointer-events: none;
}

.graph-link-draft {
  stroke: var(--primary-strong);
  stroke-width: 3;
  stroke-dasharray: 7 6;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35));
}

.graph-link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
  cursor: pointer;
}

.graph-link-label {
  fill: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.graph-link-delete {
  position: absolute;
  z-index: 6;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--danger);
  line-height: 20px;
  padding: 0;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.12s ease;
}

.graph-board:hover .graph-link-delete,
.graph-link-delete:hover {
  opacity: 1;
}

.graph-zoom-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 12;
  width: 42px;
  display: grid;
  gap: 4px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 32, 42, 0.12);
}

.graph-zoom-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
}

.graph-node {
  position: absolute;
  z-index: 1;
  width: 230px;
  min-height: 126px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(20, 32, 42, 0.14);
  overflow: hidden;
  cursor: pointer;
}

.graph-node.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.graph-node-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  cursor: move;
}

.node-info-btn {
  min-height: 26px;
  padding: 0 7px;
}

.pin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 8px;
  padding: 10px;
}

.pin-column {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 6px;
}

.pin-column.align-right {
  justify-items: end;
}

.pin {
  position: relative;
  min-height: 38px;
  height: 38px;
  width: 100%;
  max-width: none;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin span,
.pin small {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin small {
  font-size: 10px;
  opacity: 0.86;
}

.pin-mark-label {
  position: absolute;
  top: 2px;
  right: 4px;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 14px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.pin.input {
  background: #60758a;
}

.pin.output {
  background: var(--primary);
}

.pin.pending,
.pin.connectable {
  box-shadow: 0 0 0 3px rgba(20, 106, 114, 0.16);
}

.pin.pending {
  outline: 2px solid rgba(125, 211, 252, 0.7);
}

.pin.connectable {
  transform: translateX(-2px);
  background: var(--success);
}

.pin.blocked {
  opacity: 0.45;
  cursor: not-allowed;
}

.pin-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.edge-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.panel-title.small {
  font-size: 13px;
  margin-bottom: 8px;
}

.edge-list {
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
}

.edge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(8, 13, 28, 0.42);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.inline-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.inline-inputs > * {
  min-width: 0;
}

.pin-summary {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.code-editor {
  min-height: 190px;
}

.node-property-panel {
  display: grid;
  gap: 12px;
}

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

.param-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.designer-properties input:not([type="checkbox"]):not([type="radio"]),
.designer-properties select,
.designer-properties textarea,
.param-editor input:not([type="checkbox"]):not([type="radio"]),
.param-editor select,
.param-editor textarea,
.run-modal input:not([type="checkbox"]):not([type="radio"]),
.run-modal select,
.run-modal textarea,
.designer-topbar select,
.toolbar-search {
  min-height: var(--control-height);
}

.param-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.param-fx-btn {
  width: 30px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  line-height: 22px;
  cursor: pointer;
}

.param-fx-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.param-fx-btn.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, #fff);
  color: var(--brand);
}

.param-expression-form {
  display: grid;
  gap: 14px;
}

.param-expression-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.param-expression-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.param-expression-summary code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.param-expression-enable {
  justify-content: flex-start;
}

.param-expression-form .lua-code-textarea {
  min-height: 260px;
}

.param-editor-head code,
.param-editor code {
  color: var(--muted);
  font-size: 11px;
}

.designer-properties input[type="checkbox"],
.designer-properties input[type="radio"],
.param-editor input[type="checkbox"],
.param-editor input[type="radio"],
.run-modal input[type="checkbox"],
.run-modal input[type="radio"] {
  box-shadow: none;
}

.designer-properties input[type="radio"],
.param-editor input[type="radio"],
.run-modal input[type="radio"] {
  border-radius: 999px;
}

.param-stepper {
  display: grid;
  grid-template-columns: 34px minmax(72px, 1fr) 34px;
  gap: 6px;
  align-items: center;
  max-width: 180px;
}

.param-stepper .btn.mini {
  width: 34px;
  min-width: 34px;
  height: var(--control-height);
  padding: 0;
}

.param-stepper input {
  text-align: center;
}

.param-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.param-textarea-wrap {
  display: grid;
  gap: 8px;
}

.lua-pin-editor {
  display: grid;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.lua-pin-summary-card {
  gap: 10px;
}

.lua-pin-summary-grid {
  display: grid;
  gap: 8px;
}

.lua-pin-summary-block {
  display: grid;
  gap: 6px;
}

.lua-pin-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lua-pin-manager {
  display: grid;
  gap: 14px;
}

.lua-pin-section {
  display: grid;
  gap: 8px;
}

.lua-pin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lua-pin-row {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(104px, 0.9fr) minmax(92px, 1fr) 54px;
  gap: 8px;
  align-items: center;
}

.lua-pin-row input,
.lua-pin-row select {
  width: 100%;
  min-width: 0;
}

.lua-pin-row .btn {
  width: 54px;
  min-width: 54px;
  padding-inline: 0;
  white-space: nowrap;
}

.lua-pin-row-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lua-editor-modal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 14px;
  min-height: min(66vh, 680px);
}

.lua-editor-modal.single {
  grid-template-columns: minmax(0, 1fr);
}

.lua-code-textarea {
  min-height: 430px;
  font-family: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  line-height: 1.55;
  tab-size: 2;
  background: #0b1220 !important;
  color: #dbeafe !important;
  border-color: #1f2a44 !important;
}

.lua-code-textarea.compact {
  min-height: 260px;
}

.lua-inline-editor .btn {
  justify-self: start;
}

.lua-highlight-preview {
  min-height: 430px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #1f2a44;
  border-radius: 8px;
  background: #0b1220;
  color: #dbeafe;
  font-family: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.lua-token-keyword {
  color: #7dd3fc;
  font-weight: 800;
}

.lua-token-string {
  color: #86efac;
}

.lua-token-comment {
  color: #94a3b8;
}

.lua-token-number {
  color: #fbbf24;
}

.roi-editor {
  display: grid;
  gap: 12px;
}

.roi-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.roi-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.roi-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 12px;
  align-items: stretch;
}

.roi-stage {
  height: clamp(360px, 62vh, 620px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
}

.roi-editor-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.roi-bg {
  fill: #162235;
}

.roi-reference-image {
  opacity: 0.92;
}

.roi-grid-line {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.roi-polygon {
  fill: rgba(20, 106, 114, 0.28);
  stroke: #67e8f9;
  stroke-width: 3;
}

.roi-draft-line {
  fill: none;
  stroke: #fbbf24;
  stroke-width: 3;
  stroke-dasharray: 10 8;
}

.roi-point {
  fill: #ffffff;
  stroke: #146a72;
  stroke-width: 2;
}

.roi-point.draft {
  stroke: #f59e0b;
}

.roi-label {
  fill: #ffffff;
  font-size: 18px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(15, 23, 42, 0.8);
  stroke-width: 4;
}

.roi-region-list {
  display: grid;
  align-content: start;
  gap: 8px;
  height: clamp(360px, 62vh, 620px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.roi-region-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.roi-region-name {
  grid-column: 1 / -1;
  width: 100%;
}

.roi-region-points {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.roi-region-row .btn {
  justify-self: end;
  min-width: 52px;
  white-space: nowrap;
}

.mini-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  min-height: 34px;
}

.mini-check small {
  grid-column: 2 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.mini-check .param-binding-row {
  grid-column: 1 / -1;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 1px 4px rgba(20, 32, 42, 0.10);
}

.designer-commandbar {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.designer-contracts,
.designer-user-inputs {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.designer-contract-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contract-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 24px;
}

.user-input-list {
  display: grid;
  gap: 8px;
}

.user-input-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.user-input-row input,
.user-input-row select {
  min-width: 0;
}

.user-input-row input:not([type="checkbox"]):not([type="radio"]),
.user-input-row select,
.param-binding-row input:not([type="checkbox"]):not([type="radio"]) {
  min-height: var(--control-compact-height);
  padding-top: 5px;
  padding-bottom: 5px;
}

.user-input-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px 8px;
}

.user-input-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.user-input-row code,
.binding-key {
  color: var(--muted);
  font-size: 11px;
}

.test-run-user-inputs {
  margin-top: 4px;
}

.quick-run-options {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(120px, 160px) minmax(240px, 1fr);
  gap: 14px;
  align-items: end;
}

.quick-run-options .wide {
  min-width: 0;
}

.input-mode-tabs {
  width: fit-content;
}

.param-binding-row {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  min-width: 0;
}

.param-binding-row .binding-key {
  min-width: 0;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.inline-check input[type="checkbox"],
.inline-check input[type="radio"],
.mini-check input[type="checkbox"],
.mini-check input[type="radio"] {
  align-self: center;
}

.pin.selected {
  outline: 2px solid rgba(15, 23, 42, 0.86);
  box-shadow: 0 0 0 4px rgba(20, 106, 114, 0.20);
}

.pin.marked-output {
  background: #146a72;
  outline: 2px solid rgba(20, 106, 114, 0.46);
  box-shadow: 0 0 0 4px rgba(20, 106, 114, 0.14), inset 0 -3px 0 rgba(255, 255, 255, 0.32);
}

.pin.marked-alarm {
  background: var(--warning);
  outline: 2px solid rgba(245, 158, 11, 0.52);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), inset 0 -3px 0 rgba(255, 255, 255, 0.34);
}

.pin.marked-snapshot {
  background: #7c3aed;
  outline: 2px solid rgba(124, 58, 237, 0.48);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16), inset 0 -3px 0 rgba(255, 255, 255, 0.30);
}

.graph-canvas.panning {
  cursor: grabbing;
}

.pipeline-json-preview {
  max-height: calc(100vh - 180px);
  overflow: auto;
  font-size: 12px;
}

.designer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.sync-design-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.sync-design-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.sync-design-card h3 {
  margin: 0;
  font-size: 16px;
}

.sync-design-card p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

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

.node {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.42);
  padding: 12px;
}

.node.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.node-type {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

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

.flow-node {
  min-width: 132px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.42);
  padding: 12px;
  cursor: pointer;
}

.flow-node.active {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
}

.flow-arrow {
  color: var(--muted);
  font-weight: 700;
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.empty.compact {
  padding: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  z-index: 1200;
  min-width: 260px;
  max-width: min(560px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 8px;
  background: #12202c;
  color: #fff;
  text-align: center;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.toast.ok {
  background: #67C23A;
  color: #fff;
}

.toast.danger,
.toast.warn {
  background: #F56C6C;
  color: #fff;
}

/* Light open-platform theme */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f7f9fc;
  --text: #17202a;
  --muted: #667382;
  --line: #dbe2ea;
  --line-strong: #c7d1dc;
  --primary: #146a72;
  --primary-strong: #0d555c;
  --primary-soft: #e2f2f3;
  --danger: #b42318;
  --warning: #a15c07;
  --success: #177245;
  --sidebar: #ffffff;
  --sidebar-soft: #eef7f8;
  --sidebar-text: #263341;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(20, 32, 42, 0.08);
  --input-bg: #ffffff;
  --control-bg: #ffffff;
  --control-text: var(--text);
  --control-border: #c7d1dc;
  --control-border-hover: #8fb7bd;
  --control-radius: 7px;
  --control-height: 36px;
  --control-compact-height: 30px;
  --control-padding-x: 10px;
  --control-focus: rgba(20, 106, 114, 0.13);
  --control-disabled-bg: #f2f5f8;
  --control-placeholder: #8a96a3;
}

body {
  background:
    linear-gradient(180deg, rgba(231, 246, 248, 0.72) 0%, rgba(244, 247, 251, 0.92) 34%, #f4f7fb 100%),
    radial-gradient(90% 60% at 85% 8%, rgba(20, 106, 114, 0.10), transparent 52%);
  color: var(--text);
}

::-webkit-scrollbar-track {
  background: #edf2f7;
}

::-webkit-scrollbar-thumb {
  background: #8aa0b5;
  border-color: #edf2f7;
}

::-webkit-scrollbar-thumb:hover {
  background: #667d95;
}

.login-box,
.panel,
.stat,
.table-wrap,
.market-card,
.palette,
.properties,
.modal,
.validation,
.run-preview-panel,
.run-log-panel {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.app-shell {
  background: transparent;
}

.sidebar {
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
  color: var(--sidebar-text);
  box-shadow: 10px 0 30px rgba(20, 32, 42, 0.04);
  backdrop-filter: blur(12px);
}

.sidebar .brand-mark {
  background: linear-gradient(135deg, #146a72, #2b858d);
  box-shadow: 0 12px 28px rgba(20, 106, 114, 0.18);
}

.sidebar .brand-subtitle {
  color: var(--muted);
}

.nav button {
  color: var(--sidebar-text);
  background: #ffffff;
  border-color: #dfe7ef;
  box-shadow: 0 8px 18px rgba(20, 32, 42, 0.04);
}

.nav button:hover,
.nav button.active {
  background: var(--sidebar-soft);
  border-color: rgba(20, 106, 114, 0.24);
  color: var(--primary-strong);
}

.nav-icon {
  color: var(--primary-strong);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(20, 106, 114, 0.08);
}

.nav button:hover .nav-icon,
.nav button.active .nav-icon {
  color: #ffffff;
  background: linear-gradient(135deg, #146a72, #2b858d);
  box-shadow: 0 10px 22px rgba(20, 106, 114, 0.16);
}

.topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px);
}

.toolbar-search,
.field input,
.field select,
.field textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  background-color: var(--control-bg);
  color: var(--text);
  border-color: var(--control-border);
}

.field label,
th {
  color: #4d5d6d;
}

.field .doc-editor-textarea {
  background: rgba(255, 255, 255, 0.72);
  border-left-color: #2f8f98;
  line-height: 1.72;
}

th {
  background: var(--panel-soft);
}

.badge.gray {
  background: #eef1f4;
  color: #52606f;
}

.badge.warning {
  background: #fff4de;
  color: var(--warning);
}

.btn {
  background: #e8edf2;
  border-color: #d7e0e9;
  color: var(--text);
}

.btn:hover {
  background: #dce4ec;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.btn.ghost {
  color: var(--primary);
}

.btn.danger {
  background: #fde8e5;
  border-color: #f5c7c1;
  color: var(--danger);
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.36);
}

.detail-section,
.detail-hero {
  background: var(--panel-soft);
}

.canvas {
  background: #f8fafb;
}

.component-btn,
.edge-row,
.node,
.flow-node {
  background: #ffffff;
  color: var(--text);
}

.graph-board {
  background-color: var(--designer-canvas-bg);
  background:
    linear-gradient(#eef3f7 1px, transparent 1px),
    linear-gradient(90deg, #eef3f7 1px, transparent 1px),
    var(--designer-canvas-bg);
  background-size: 24px 24px;
}

.graph-node {
  background: #ffffff;
}

.notice {
  border-color: #9ec7cc;
  background: #edf8f9;
  color: var(--primary-strong);
}

.validation.ok {
  border-color: #9fd6ba;
  background: #effaf4;
}

.validation.bad {
  border-color: #f0b0a8;
  background: #fff2f0;
}

.hint,
.pin-summary,
.designer-contracts,
.designer-user-inputs,
.user-input-row {
  background: var(--panel-soft);
}

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

.list-heading {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.list-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  color: var(--text);
}

.list-heading span {
  color: var(--muted);
  font-size: 13px;
}

.personal-center {
  display: grid;
  gap: 16px;
}

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

.personal-head h2 {
  margin: 0;
  font-size: 20px;
}

.personal-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.personal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 32, 42, 0.04);
}

.personal-tabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.personal-tabs button:hover,
.personal-tabs button.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.personal-tabs strong {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef1f4;
  color: #52606f;
  font-size: 12px;
}

.personal-tabs button.active strong {
  background: #ffffff;
  color: var(--primary-strong);
}

.account-panel {
  display: grid;
  gap: 16px;
}

@media (max-width: 1100px) {
  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    flex: none;
    overflow: visible;
  }

  .content {
    height: auto;
    overflow: visible;
  }

  .page {
    overflow: visible;
  }

  .nav-group {
    min-width: min(240px, 100%);
    flex: 1 1 220px;
  }

  .stats-grid,
  .grid.two,
  .market-layout,
  .designer-layout,
  .yolo-verify-model-row,
  .yolo-verify-model-grid,
  .yolo-verify-upload-form,
  .quick-run-options,
  .quick-run-options.yolo-verify-options,
  .run-output-grid,
  .lua-editor-modal,
  .roi-toolbar,
  .roi-workspace,
  .detail-grid,
  .detail-hero,
  .personal-head {
    grid-template-columns: 1fr;
  }

  .detail-hero-meta {
    justify-content: flex-start;
    max-width: none;
  }

  .personal-head {
    align-items: flex-start;
  }

  .lua-pin-row {
    grid-template-columns: 1fr;
  }

  .lua-pin-row-head {
    display: none;
  }

  .lua-pin-row .btn {
    width: auto;
    min-width: 0;
    justify-self: start;
    padding-inline: 10px;
  }

  .empty-state {
    align-items: flex-start;
    flex-direction: column;
  }
}
