/* 智算云 — shared design system (modern-minimal / Linear + Vercel) */
:root {
  --bg: oklch(99% 0.002 240);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(97.5% 0.004 240);
  --fg: oklch(18% 0.012 250);
  --muted: oklch(54% 0.012 250);
  --border: oklch(92% 0.005 250);
  --accent: oklch(58% 0.18 255);
  --accent-hover: oklch(52% 0.18 255);
  --accent-subtle: oklch(96% 0.04 255);
  --success: oklch(58% 0.14 145);
  --success-bg: oklch(96% 0.04 145);
  --warn: oklch(72% 0.16 75);
  --warn-bg: oklch(97% 0.04 75);
  --danger: oklch(58% 0.18 25);
  --danger-bg: oklch(97% 0.04 25);

  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --sidebar-w: 240px;
  --header-h: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.04);
  --shadow-md: 0 4px 16px oklch(0% 0 0 / 0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--fg);
  display: grid;
  place-items: center;
  color: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.sidebar-workspace {
  padding: 12px 10px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav { flex: 1; padding: 4px 8px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.usage-mini {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 12px;
}

.usage-mini-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 6px;
}

.usage-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Main area */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-toggle { display: none; padding: 6px; border-radius: var(--radius); color: var(--muted); }
.menu-toggle:hover { background: var(--surface-2); color: var(--fg); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.breadcrumb-current { color: var(--fg); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 220px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(58% 0.18 255 / 0.12);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--fg);
}

.search-box input::placeholder { color: var(--muted); }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
  position: relative;
  transition: background 0.12s, color 0.12s;
}

.icon-btn:hover { background: var(--surface-2); color: var(--fg); }

.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(70% 0.12 255), oklch(55% 0.16 280));
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  display: grid;
  place-items: center;
}

.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
}

.btn-secondary:hover { background: var(--surface-2); border-color: oklch(88% 0.005 250); }

.btn-ghost { color: var(--muted); padding: 7px 10px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: box-shadow 0.15s;
}

.kpi-card:hover { box-shadow: var(--shadow-sm); }

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.kpi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }

/* Panels */
.panel-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-body { padding: 18px; }

.panel-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.panel-link:hover { text-decoration: underline; }

/* GPU monitor */
.gpu-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.gpu-big {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.gpu-big span { font-size: 18px; color: var(--muted); font-weight: 500; }

.gpu-list { display: flex; flex-direction: column; gap: 12px; }

.gpu-row {
  display: grid;
  grid-template-columns: 100px 1fr 48px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.gpu-row-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.gpu-row-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.gpu-row-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

.gpu-row-fill.high { background: var(--danger); }
.gpu-row-fill.mid { background: var(--warn); }
.gpu-row-fill.low { background: var(--accent); }

.gpu-row-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

/* Sparkline */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  margin-top: 16px;
}

.spark-bar {
  flex: 1;
  background: var(--accent-subtle);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: background 0.12s;
}

.spark-bar:hover { background: var(--accent); }

/* Tables */
.data-table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: oklch(99% 0.002 240); }

.cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill-running { background: var(--success-bg); color: var(--success); }
.pill-pending { background: var(--warn-bg); color: oklch(55% 0.12 75); }
.pill-stopped { background: var(--surface-2); color: var(--muted); }
.pill-training { background: var(--accent-subtle); color: var(--accent); }
.pill-starting { background: var(--warn-bg); color: oklch(55% 0.12 75); }
.pill-starting::before { animation: pulse-dot 1.2s ease infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Instance management */
.module-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius);
  width: fit-content;
}

.module-tab {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

.module-tab:hover { color: var(--fg); }
.module-tab.active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

.instance-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.instance-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.instance-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.instance-stat-label {
  font-size: 12px;
  color: var(--muted);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-select {
  width: auto;
  min-width: 120px;
  padding: 6px 10px;
  font-size: 12px;
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.filter-chip:hover { color: var(--fg); background: var(--surface-2); }
.filter-chip.active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: oklch(58% 0.18 255 / 0.2);
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--accent-subtle);
  border-bottom: 1px solid oklch(58% 0.18 255 / 0.15);
  font-size: 13px;
}

.bulk-count strong { color: var(--accent); }

.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.row-action {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}

.row-action:hover:not(:disabled) { background: var(--surface-2); color: var(--fg); }
.row-action.primary { color: var(--accent); }
.row-action.primary:hover:not(:disabled) { background: var(--accent-subtle); }
.row-action:disabled { opacity: 0.5; cursor: not-allowed; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-current {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Instance card grid */
.instance-panel-body {
  padding: 0;
}

.instance-grid-toolbar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.select-all-label input { flex-shrink: 0; }

.instance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 18px;
}

.instance-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.instance-card:hover {
  border-color: oklch(85% 0.005 250);
  box-shadow: var(--shadow-sm);
}

.instance-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--accent-subtle);
}

.instance-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.instance-card-head .row-check {
  margin-top: 3px;
  flex-shrink: 0;
}

.instance-card-title {
  flex: 1;
  min-width: 0;
}

.instance-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instance-card-id {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instance-card-spec {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.instance-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.instance-card-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.instance-card-meta-row dt {
  color: var(--muted);
  flex-shrink: 0;
}

.instance-card-meta-row dd {
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instance-card-gpu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.instance-card-gpu-idle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.instance-card-gpu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.instance-card-gpu-label {
  font-size: 11px;
  color: var(--muted);
}

.instance-card-gpu-val {
  font-size: 12px;
  font-weight: 500;
}

.instance-card-gpu-bar {
  height: 5px;
}

.instance-card-gpu-bar .usage-bar-fill.high {
  background: var(--warn);
}

.instance-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.instance-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.instance-empty p {
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
}

.instance-empty a {
  color: var(--accent);
  font-weight: 500;
}

.instance-empty a:hover { text-decoration: underline; }

/* Form elements */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}

.form-label span { color: var(--muted); font-weight: 400; }

.form-input,
.form-select,
.form-textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(58% 0.18 255 / 0.12);
}

.form-input.error { border-color: var(--danger); }
.form-error { font-size: 11px; color: var(--danger); }

.form-hint { font-size: 11px; color: var(--muted); }

.form-textarea { min-height: 80px; resize: vertical; font-family: var(--font-mono); font-size: 12px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}

.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* GPU type cards */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.option-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  text-align: left;
}

.option-card:hover { border-color: oklch(85% 0.005 250); background: var(--surface-2); }
.option-card.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent);
}

.option-card-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.option-card-spec {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.option-card-price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Image picker */
.image-list { display: flex; flex-direction: column; gap: 8px; }

.image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.image-item:hover { background: var(--surface-2); }
.image-item.selected { border-color: var(--accent); background: var(--accent-subtle); }

.image-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.image-info { flex: 1; min-width: 0; }
.image-name { font-size: 13px; font-weight: 500; }
.image-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.image-radio {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.image-item.selected .image-radio {
  border-color: var(--accent);
}

.image-item.selected .image-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Custom image panel */
.custom-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.custom-panel-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pkg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pkg-tag {
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.pkg-tag button {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
}

.pkg-tag button:hover { color: var(--danger); }

/* Checkbox row */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}

.check-row:hover { background: var(--surface-2); }

.check-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: background 0.12s, border-color 0.12s;
}

.check-row.checked .check-box {
  background: var(--accent);
  border-color: var(--accent);
}

.check-row.checked .check-box::after {
  content: '';
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.check-label { font-size: 13px; font-weight: 500; }
.check-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Form footer */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.cost-estimate {
  font-size: 13px;
  color: var(--muted);
}

.cost-estimate strong {
  font-family: var(--font-mono);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  background: var(--fg);
  color: var(--surface);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Launcher page */
.launcher {
  min-height: 100vh;
  padding: 48px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.launcher-header {
  margin-bottom: 40px;
}

.launcher-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.launcher-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.launcher-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
}

.screen-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.screen-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-card:hover {
  border-color: oklch(85% 0.02 255);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.screen-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.screen-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.screen-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.screen-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 99px;
  font-size: 11px;
  color: var(--muted);
}

.screen-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
}

.screen-card-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0% 0 0 / 0.3);
    z-index: 45;
  }
  .sidebar-overlay.show { display: block; }
  .menu-toggle { display: grid; }
  .search-box { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .instance-stats { grid-template-columns: repeat(2, 1fr); }
  .instance-grid { grid-template-columns: repeat(2, 1fr); }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-toolbar-right { justify-content: flex-end; }
}

@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .screen-cards { grid-template-columns: 1fr; }
  .instance-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer .btn { width: 100%; }
  .instance-stats { grid-template-columns: 1fr 1fr; }
  .module-tabs { width: 100%; }
  .table-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}
