:root {
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #172033;
  background: #f4f6f9;
  font-synthesis: none;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-raised: #ffffff;
  --border: #dfe4ec;
  --border-strong: #cdd5e1;
  --text: #172033;
  --text-secondary: #5e6b7f;
  --text-muted: #8b96a8;
  --accent: #176b87;
  --accent-strong: #0d5670;
  --accent-soft: #e4f3f7;
  --success: #147d64;
  --success-soft: #e7f6f1;
  --warning: #aa6708;
  --warning-soft: #fff4dc;
  --danger: #c33a42;
  --danger-soft: #fdebed;
  --sidebar: #101722;
  --sidebar-border: #253041;
  --shadow: 0 8px 28px rgba(34, 46, 63, .08);
}

:root[data-theme="dark"] {
  color: #e7ebf2;
  background: #0e131c;
  --bg: #0e131c;
  --surface: #151c27;
  --surface-muted: #111823;
  --surface-raised: #1a2230;
  --border: #293446;
  --border-strong: #37445a;
  --text: #e7ebf2;
  --text-secondary: #a6b0c0;
  --text-muted: #768297;
  --accent: #63b9d1;
  --accent-strong: #88d1e4;
  --accent-soft: #183846;
  --success: #66c7aa;
  --success-soft: #17392f;
  --warning: #e3ad58;
  --warning-soft: #3b2e19;
  --danger: #ef7d84;
  --danger-soft: #432126;
  --sidebar: #090e16;
  --sidebar-border: #202a3a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html, body, #root { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.app-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; background: #0d141e; color: #b8c3d3; }
.loading-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #2c4053; border-radius: 6px; color: #7ed0e4; font-size: 22px; font-weight: 800; }
.app-loading p { font-size: 13px; }
.route-loading { min-height: 240px; display: grid; place-items: center; }
.route-loading span { width: 26px; height: 26px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 240px; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--sidebar-border); background: var(--sidebar); color: #dce4ef; transition: width .2s ease, transform .2s ease; }
.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { width: 72px; }
.sidebar-brand { height: 68px; display: flex; align-items: center; gap: 11px; flex: 0 0 auto; padding: 0 16px; border-bottom: 1px solid var(--sidebar-border); }
.control-mark { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border: 1px solid #355469; border-radius: 6px; color: #7ed0e4; background: #13222f; }
.brand-copy { display: grid; min-width: 0; gap: 2px; white-space: nowrap; }
.brand-copy strong { font-size: 15px; color: #f7f9fc; }
.brand-copy small { font-size: 9px; color: #6f8096; letter-spacing: 1.2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; scrollbar-width: thin; }
.nav-group { margin-bottom: 16px; }
.nav-group-label { padding: 0 10px 7px; color: #65758b; font-size: 10px; font-weight: 700; }
.nav-item { position: relative; min-height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border-radius: 5px; color: #9eabba; font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
.nav-item + .nav-item { margin-top: 3px; }
.nav-item:hover { color: #eef3f8; background: #182230; }
.nav-item.active { color: #f2fbfd; background: #1b3441; }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 2px; height: 20px; border-radius: 2px; background: #63c1d8; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .nav-group { margin-bottom: 8px; }
.sidebar-collapse { height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; border: 0; border-top: 1px solid var(--sidebar-border); background: transparent; color: #738297; cursor: pointer; font-size: 12px; }
.sidebar-collapse:hover { color: #dce4ef; background: #151e2b; }
.workspace { min-width: 0; grid-column: 2; }
.topbar { position: sticky; z-index: 20; top: 0; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 26px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title p { margin-bottom: 2px; color: var(--text-muted); font-size: 10px; }
.topbar-title h1 { font-size: 17px; letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.icon-button:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-muted); }
.mobile-menu, .mobile-close { display: none; }
.account-menu { position: relative; }
.account-trigger { min-width: 176px; height: 42px; display: grid; grid-template-columns: 30px minmax(0, 1fr) 15px; align-items: center; gap: 9px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; }
.account-trigger:hover { border-color: var(--border); background: var(--surface-muted); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.account-copy { display: grid; min-width: 0; gap: 1px; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.account-copy small { color: var(--text-muted); font-size: 10px; }
.account-popover { position: absolute; top: calc(100% + 7px); right: 0; width: 208px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-raised); box-shadow: var(--shadow); }
.account-summary { display: grid; gap: 3px; padding: 9px 10px 10px; border-bottom: 1px solid var(--border); }
.account-summary strong { font-size: 12px; }
.account-summary span { color: var(--text-muted); font-size: 11px; }
.account-popover button { width: 100%; height: 36px; display: flex; align-items: center; gap: 9px; margin-top: 5px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--danger); cursor: pointer; font-size: 12px; }
.account-popover button:hover { background: var(--danger-soft); }
.content { min-height: calc(100vh - 68px); padding: 24px 26px 36px; }

.page-stack { display: grid; gap: 18px; max-width: 1580px; margin: 0 auto; }
.page-heading { min-height: 50px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-heading p { margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 700; }
.page-heading h2 { font-size: 22px; line-height: 1.25; letter-spacing: 0; }
.page-heading span { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 700; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-strong); }
.button.secondary { border-color: var(--border); background: var(--surface); color: var(--text-secondary); }
.button.secondary:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.alert-banner { min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid #edcd94; border-radius: 5px; background: var(--warning-soft); color: var(--warning); font-size: 12px; }
.alert-banner.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.alert-banner.success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); background: var(--success-soft); color: var(--success); }
.data-freshness { min-height: 36px; display: flex; align-items: center; gap: 11px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-secondary); font-size: 10px; }
.data-freshness strong { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--text); font-size: 10px; }
.data-freshness > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-freshness-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--text-muted); }
.data-freshness.tone-live { border-color: color-mix(in srgb, var(--success) 28%, var(--border)); background: var(--success-soft); }.data-freshness.tone-live .data-freshness-dot { background: var(--success); }
.data-freshness.tone-refreshing { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); background: var(--accent-soft); }.data-freshness.tone-refreshing .data-freshness-dot { background: var(--accent); animation: data-pulse 1.4s ease-in-out infinite; }
@keyframes data-pulse { 50% { opacity: .35; } }
.data-freshness.tone-cache { background: var(--surface-muted); }.data-freshness.tone-cache .data-freshness-dot { background: var(--text-muted); }
.data-freshness.tone-stale { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: var(--warning-soft); }.data-freshness.tone-stale .data-freshness-dot { background: var(--warning); }
.data-freshness.tone-error { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); color: var(--danger); }.data-freshness.tone-error .data-freshness-dot { background: var(--danger); }
.data-freshness.compact { min-height: 30px; gap: 8px; padding: 5px 8px; border-radius: 4px; font-size: 9px; }.data-freshness.compact strong { font-size: 9px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 112px; display: flex; align-items: flex-start; gap: 13px; padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: 0 1px 2px rgba(25, 35, 50, .025); }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 6px; background: var(--surface-muted); color: var(--text-secondary); }
.metric-icon.blue { background: var(--accent-soft); color: var(--accent); }
.metric-icon.green { background: var(--success-soft); color: var(--success); }
.metric-icon.amber { background: var(--warning-soft); color: var(--warning); }
.metric > div { display: grid; min-width: 0; }
.metric p { color: var(--text-secondary); font-size: 11px; }
.metric strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; font-size: 21px; white-space: nowrap; }
.metric small { margin-top: 5px; color: var(--text-muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr); gap: 14px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: 0 1px 2px rgba(25, 35, 50, .02); }
.panel-heading { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); }
.panel-heading h3 { font-size: 14px; }
.panel-heading a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 11px; }
.recent-projects { grid-row: span 2; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th { height: 38px; padding: 0 13px; border-bottom: 1px solid var(--border); background: var(--surface-muted); color: var(--text-muted); font-size: 10px; font-weight: 700; text-align: left; white-space: nowrap; }
td { min-height: 50px; padding: 10px 13px; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-muted) 65%, transparent); }
td strong { display: block; max-width: 220px; overflow: hidden; color: var(--text); text-overflow: ellipsis; font-size: 11px; }
td > span:not(.status-badge) { display: block; max-width: 170px; margin-top: 3px; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; font-size: 9px; }
.task-failure-preview { max-width: 220px !important; color: var(--danger) !important; }
.contract-omission { display: inline-block !important; margin: 0 !important; color: var(--text-muted); font-size: 9px; }
.status-badge { min-width: 54px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; border-radius: 4px; background: var(--surface-muted); color: var(--text-secondary); font-size: 9px; white-space: nowrap; }
.status-active, .status-succeeded { background: var(--success-soft); color: var(--success); }
.status-running, .status-persisting { background: var(--accent-soft); color: var(--accent); }
.status-queued { background: var(--warning-soft); color: var(--warning); }
.status-failed, .status-deleted { background: var(--danger-soft); color: var(--danger); }
.status-frozen, .status-cancelled, .status-archived { background: var(--surface-muted); color: var(--text-muted); }
.danger-text { color: var(--danger); }
.task-list { display: grid; }
.task-row { min-height: 55px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 58px; align-items: center; gap: 9px; padding: 7px 14px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-muted); }
.task-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.task-dot.running, .task-dot.persisting { background: var(--accent); }
.task-dot.succeeded { background: var(--success); }
.task-dot.failed { background: var(--danger); }
.task-dot.queued { background: var(--warning); }
.task-main { display: grid; min-width: 0; gap: 2px; }
.task-main strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.task-main small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; font-size: 9px; white-space: nowrap; }
.task-row time { color: var(--text-muted); font-size: 9px; text-align: right; }
.generation-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 14px; }
.generation-stats > div { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 4px 8px; border-right: 1px solid var(--border); }
.generation-stats > div:last-child { border-right: 0; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 5px; background: var(--surface-muted); color: var(--accent); }
.generation-stats p { display: grid; gap: 2px; }
.generation-stats strong { font-size: 16px; }
.generation-stats small { color: var(--text-muted); font-size: 9px; }
.empty-state { min-height: 170px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-muted); font-size: 11px; }
.empty-state.tall { min-height: 330px; }
.skeleton-list { display: grid; gap: 10px; padding: 16px; }
.skeleton-list span { height: 34px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-muted), var(--border), var(--surface-muted)); background-size: 220% 100%; animation: skeleton 1.2s linear infinite; }
@keyframes skeleton { to { background-position: -220% 0; } }
.module-panel { min-height: 460px; }
.module-toolbar { min-height: 58px; display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.filter-toolbar { display: flex; align-items: center; gap: 8px; }
.search-box { width: min(320px, 100%); height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-muted); color: var(--text-muted); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.compact-select { height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface); color: var(--text-secondary); font-size: 11px; }
.compact-input { width: 150px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface); color: var(--text-secondary); font-size: 11px; }
.compact-input:focus { border-color: var(--accent); }
.compact-button { min-height: 34px; padding: 0 10px; }
.compact-button.has-filter { border-color: var(--accent); color: var(--accent); }
.inline-check { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 10px; cursor: pointer; white-space: nowrap; }
.inline-check input { width: 14px; height: 14px; accent-color: var(--accent); }
.segmented-tabs { width: max-content; display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.segmented-tabs button { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 10px; }
.segmented-tabs button.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.actions-column { width: 130px; text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.table-icon-button { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.table-icon-button:hover { border-color: var(--border-strong); background: var(--surface-muted); color: var(--text); }
.table-icon-button.danger { color: var(--danger); }
.table-icon-button.danger:hover { border-color: color-mix(in srgb, var(--danger) 38%, var(--border)); background: var(--danger-soft); }
.table-icon-button.success { color: var(--success); }
.table-action { min-height: 30px; padding: 0 9px; font-weight: 600; }
.role-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 9px; }
.muted-text { color: var(--text-muted); }
.warning-text { color: var(--warning) !important; }
.mono-cell { display: inline-block !important; max-width: 260px !important; overflow: hidden; color: var(--text-secondary) !important; font-family: Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.secret-mask { color: var(--text); font-family: Consolas, monospace; font-size: 11px; letter-spacing: .6px; }
.code-area { width: 100%; min-height: 130px; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface-muted); color: var(--text); font: 10px/1.6 Consolas, monospace; }
.code-area:focus { border-color: var(--accent); }
.pricing-history { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
.pricing-history > div { min-width: 170px; display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-muted); }
.pricing-history strong { font-size: 10px; }.pricing-history span { color: var(--text-secondary); font-size: 10px; }.pricing-history small { color: var(--text-muted); font-size: 8px; }
.danger-button { background: var(--danger) !important; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--accent-soft); }
.source-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-muted); color: var(--text-secondary); font-size: 9px; font-weight: 700; }
.permission-state { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; color: var(--text-muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.permission-state.allowed { color: var(--success); }
.permission-state.denied { color: var(--text-muted); }
.filter-count { margin-left: auto; color: var(--text-muted); font-size: 10px; }
.modal-panel.skill-detail-panel { width: min(980px, 100%); max-height: min(880px, calc(100vh - 36px)); overflow: auto; }
.skill-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.skill-summary-grid > div { min-height: 70px; display: grid; align-content: center; gap: 4px; padding: 10px 13px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.skill-summary-grid > div:last-child { border-right: 0; }
.skill-summary-grid span { color: var(--text-muted); font-size: 9px; }
.skill-summary-grid strong { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.skill-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 12px; }
.skill-detail-grid > section { padding: 14px; border: 1px solid var(--border); border-radius: 5px; }
.skill-detail-grid h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 12px; }
.version-list { display: grid; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.version-list article { min-height: 62px; display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.version-list article:last-child { border-bottom: 0; }
.version-index, .version-copy { display: grid; gap: 4px; }
.version-index { grid-template-columns: 30px auto; align-items: center; }
.version-index strong { font-size: 12px; }
.version-copy strong { overflow: hidden; color: var(--text-secondary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.version-copy span { color: var(--text-muted); font-family: Consolas, monospace; font-size: 8px; }
.release-title { margin-top: 20px; }
.release-list { display: grid; gap: 9px; }
.release-list > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 8px; align-items: center; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.release-list p { color: var(--text-secondary); font-size: 9px; }
.release-list time { grid-column: 2; color: var(--text-muted); font-size: 8px; }
.prompt-editor, .prompt-content-area { width: 100%; min-height: 340px; resize: vertical; padding: 13px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface-muted); color: var(--text); font: 10px/1.65 Consolas, monospace; }
.prompt-editor:focus { border-color: var(--accent); }
.modal-panel.prompt-viewer { width: min(780px, 100%); }
.prompt-content-area { min-height: min(58vh, 520px); resize: none; }
.sensitive-note { display: flex; align-items: center; gap: 6px; color: var(--warning); font-size: 9px; }
.grant-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; max-height: 210px; overflow: auto; padding: 10px; border: 1px solid var(--border); border-radius: 5px; }
.grant-picker legend { padding: 0 5px; color: var(--text-muted); font-size: 9px; }
.grant-picker label { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; background: var(--surface-muted); cursor: pointer; }
.grant-picker input { width: 14px; height: 14px; accent-color: var(--accent); }
.grant-picker span { min-width: 0; display: grid; gap: 2px; }
.grant-picker strong, .grant-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grant-picker strong { font-size: 10px; }
.grant-picker small { color: var(--text-muted); font-size: 8px; }
.pagination-bar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 9px; }
.pagination-bar > div { display: flex; gap: 6px; }
.pagination-bar button:disabled { cursor: not-allowed; opacity: .35; }
.modal-panel.task-detail-panel { width: min(1040px, 100%); max-height: min(900px, calc(100vh - 36px)); overflow: auto; }
.task-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.task-summary-grid > div { min-height: 72px; display: grid; align-content: center; gap: 4px; padding: 10px 12px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.task-summary-grid > div:last-child { border-right: 0; }
.task-summary-grid span { color: var(--text-muted); font-size: 9px; }
.task-summary-grid strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.task-summary-grid small { overflow: hidden; color: var(--text-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.task-error-box { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); border-radius: 5px; background: var(--danger-soft); color: var(--danger); }
.task-error-box div { display: grid; gap: 3px; }.task-error-box strong { font-size: 10px; }.task-error-box p { color: var(--text-secondary); font-size: 9px; }
.task-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 12px; }
.task-detail-grid.snapshot-only { grid-template-columns: 1fr; }
.task-detail-grid > section, .task-events { padding: 14px; border: 1px solid var(--border); border-radius: 5px; }
.task-detail-grid h3, .task-events h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 12px; }
.attempt-list { display: grid; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.attempt-list article { min-height: 58px; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto 130px; align-items: center; gap: 9px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.attempt-list article:last-child { border-bottom: 0; }
.attempt-list article > div { min-width: 0; display: grid; gap: 3px; }.attempt-list article strong { font-size: 10px; }.attempt-list article small { overflow: hidden; color: var(--text-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.attempt-list article time { color: var(--text-muted); font-size: 8px; text-align: right; }.attempt-list article > p { grid-column: 2 / -1; color: var(--danger); font-size: 9px; }
.task-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }.task-dot.status-succeeded { background: var(--success); }.task-dot.status-failed { background: var(--danger); }.task-dot.status-running, .task-dot.status-queued { background: var(--accent); }
.task-subheading { margin-top: 18px; }
.task-events > div { display: grid; gap: 8px; }
.task-events article { display: grid; grid-template-columns: 110px 130px minmax(0, 1fr) 150px; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 4px; background: var(--surface-muted); }
.task-events article span { color: var(--accent); font-size: 9px; font-weight: 700; }.task-events article strong { font-size: 9px; }.task-events article p { color: var(--text-secondary); font-size: 9px; }.task-events article time { color: var(--text-muted); font-size: 8px; text-align: right; }
.modal-panel.file-detail-panel { width: min(1000px, 100%); max-height: min(880px, calc(100vh - 36px)); overflow: auto; }
.danger-text-button { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)) !important; color: var(--danger) !important; }
.file-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.file-summary-grid > div { min-height: 70px; display: grid; align-content: center; gap: 4px; padding: 10px 12px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.file-summary-grid > div:last-child { border-right: 0; }.file-summary-grid span { color: var(--text-muted); font-size: 9px; }.file-summary-grid strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.file-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 12px; }
.file-detail-grid > section, .file-events { padding: 14px; border: 1px solid var(--border); border-radius: 5px; }
.file-detail-grid h3, .file-events h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 12px; }
.mono-value { overflow: hidden; font-family: Consolas, monospace; font-size: 9px !important; text-overflow: ellipsis; white-space: nowrap; }
.reference-list { display: grid; gap: 7px; }
.reference-list article { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 3px 8px; padding: 8px 9px; border-radius: 4px; background: var(--surface-muted); }
.reference-list article strong { color: var(--accent); font-size: 9px; }.reference-list article span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.reference-list article small { grid-column: 2; color: var(--text-muted); font-size: 8px; }
.file-events > div { display: grid; gap: 7px; }
.file-events article { display: grid; grid-template-columns: 110px minmax(0, 1fr) 150px; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 4px; background: var(--surface-muted); }
.file-events article strong { color: var(--accent); font-size: 9px; }.file-events article span { overflow: hidden; color: var(--text-secondary); font-family: Consolas, monospace; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.file-events article time { color: var(--text-muted); font-size: 8px; text-align: right; }
.billing-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.billing-summary-grid > div { min-height: 88px; display: grid; align-content: center; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--border); background: var(--surface-raised); }
.billing-summary-grid > div:last-child { border-right: 0; }.billing-summary-grid span { color: var(--text-muted); font-size: 9px; }.billing-summary-grid strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }.billing-summary-grid small { color: var(--text-secondary); font-size: 8px; }
.filter-currency { color: var(--text-secondary); font-size: 10px; font-weight: 700; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.15fr) minmax(440px, .85fr); background: #0a111a; }
.login-visual { position: relative; min-height: 100vh; overflow: hidden; padding: 42px clamp(42px, 6vw, 92px); border-right: 1px solid #243043; color: #f4f7fa; background: linear-gradient(155deg, #0d1722 0%, #0a111a 60%, #101a25 100%); }
.login-visual::before { content: ""; position: absolute; inset: 0; opacity: .34; background-image: linear-gradient(rgba(111, 160, 179, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(111, 160, 179, .08) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(to bottom right, black, transparent 76%); }
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.login-brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #315469; border-radius: 7px; background: #132534; color: #80d0e3; }
.login-brand > span:last-child { display: grid; gap: 3px; }
.login-brand strong { font-size: 17px; }
.login-brand small { color: #72889b; font-size: 9px; letter-spacing: 1.5px; }
.circuit-stage { position: absolute; top: 17%; left: 50%; width: min(58vh, 560px); aspect-ratio: 1; transform: translateX(-42%); border: 1px solid rgba(112, 180, 202, .16); border-radius: 50%; }
.circuit-stage::before, .circuit-stage::after { content: ""; position: absolute; inset: 14%; border: 1px solid rgba(112, 180, 202, .12); border-radius: 50%; animation: circuit-spin 18s linear infinite; }
.circuit-stage::after { inset: 29%; border-style: dashed; animation-direction: reverse; animation-duration: 13s; }
@keyframes circuit-spin { to { transform: rotate(360deg); } }
.circuit-core { position: absolute; inset: 37%; display: grid; place-items: center; border: 1px solid #2c6073; border-radius: 10px; color: #71c9de; background: #102431; box-shadow: 0 0 40px rgba(82, 184, 208, .14); }
.circuit-node { position: absolute; z-index: 2; width: 9px; height: 9px; border: 2px solid #9cd9e6; border-radius: 50%; background: #0b141e; box-shadow: 0 0 13px rgba(112, 211, 232, .65); }
.node-a { top: 19%; left: 15%; }.node-b { top: 35%; right: 10%; }.node-c { bottom: 16%; left: 32%; }
.circuit-line { position: absolute; height: 1px; transform-origin: left center; background: linear-gradient(90deg, #4bb2c9, transparent); }
.line-a { top: 20%; left: 17%; width: 33%; transform: rotate(17deg); }.line-b { top: 36%; right: 11%; width: 29%; transform: rotate(158deg); }.line-c { bottom: 17%; left: 33%; width: 30%; transform: rotate(-58deg); }
.login-visual-copy { position: absolute; z-index: 2; left: clamp(42px, 6vw, 92px); right: 42px; bottom: 11%; }
.login-visual-copy p { margin-bottom: 13px; color: #6ec4d9; font-size: 11px; font-weight: 700; }
.login-visual-copy h1 { max-width: 680px; font-size: clamp(27px, 3vw, 42px); line-height: 1.35; letter-spacing: 0; }
.login-visual-copy span { display: block; margin-top: 18px; color: #8190a2; font-size: 11px; }
.login-pane { min-height: 100vh; display: grid; place-items: center; padding: 48px; background: #fff; color: #182234; }
.login-form { width: min(390px, 100%); display: grid; gap: 18px; }
.login-heading { margin-bottom: 12px; }
.login-heading p { margin-bottom: 7px; color: #176b87; font-size: 11px; font-weight: 800; }
.login-heading h2 { font-size: 27px; letter-spacing: 0; }
.login-heading > span:last-child { display: block; margin-top: 8px; color: #7a8699; font-size: 12px; }
.login-mobile-mark { display: none; }
.field-label { display: grid; gap: 7px; color: inherit; font-size: 11px; font-weight: 700; }
.input-shell { height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #d8dee8; border-radius: 5px; background: #fff; color: #8691a2; transition: border .15s, box-shadow .15s; }
.input-shell:focus-within { border-color: #4b91a8; box-shadow: 0 0 0 3px rgba(50, 128, 153, .1); }
.input-shell input { min-width: 0; flex: 1; border: 0; outline: 0; color: #182234; background: transparent; font-size: 12px; }
.input-shell input::placeholder { color: #a1aab8; }
.input-icon-button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #8390a2; cursor: pointer; }
.remember-row { width: max-content; display: inline-flex; align-items: center; gap: 7px; color: #626e81; cursor: pointer; font-size: 11px; }
.remember-row input { appearance: none; width: 15px; height: 15px; margin: 0; border: 1px solid #bcc5d2; border-radius: 3px; background: #fff; cursor: pointer; }
.remember-row input:checked { border-color: #176b87; background: #176b87; box-shadow: inset 0 0 0 3px #fff; }
.human-check { width: 100%; min-height: 44px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 20px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #d8dee8; border-radius: 5px; background: #f8fafc; color: #526073; cursor: pointer; font-size: 11px; text-align: left; }
.human-check.is-verified { border-color: #6fb8a3; background: #edf8f4; color: #147d64; }
.human-check-error { grid-template-columns: 1fr; color: #c33a42; cursor: default; }
.human-box { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #b9c3d0; border-radius: 3px; }
.is-verified .human-box { border-color: #147d64; background: #147d64; color: #fff; }
.turnstile-host { min-height: 65px; }
.form-error { padding: 9px 10px; border-radius: 4px; background: #fdebed; color: #b52d36; font-size: 11px; }
.login-submit { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px 0 19px; border: 0; border-radius: 5px; background: #176b87; color: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.login-submit:hover:not(:disabled) { background: #0d5670; }
.login-submit:disabled { cursor: not-allowed; opacity: .55; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 6px; color: #8b96a8; font-size: 10px; }
.setup-password-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #eef3f7; color: #182234; }
.setup-password-card { width: min(440px, 100%); display: grid; gap: 28px; padding: 34px; border: 1px solid #dbe3ec; border-radius: 7px; background: #fff; box-shadow: 0 18px 55px rgba(23, 44, 64, .12); }
.setup-password-card form { display: grid; gap: 17px; }
.setup-password-brand { display: flex; align-items: center; gap: 10px; color: #173448; }
.setup-password-brand > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #bcd1db; border-radius: 6px; color: #176b87; background: #f1f8fa; }
.setup-password-brand strong { font-size: 15px; }
.setup-password-card .login-heading h1 { font-size: 25px; letter-spacing: 0; }
.field-hint { margin-top: -10px; font-size: 10px; }
.password-requirements { display: flex; flex-wrap: wrap; gap: 7px; margin-top: -9px; }
.password-requirements span { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border: 1px solid #d7e0e9; border-radius: 4px; color: #7b899b; background: #f7f9fb; font-size: 11px; }
.password-requirements span::before { content: ""; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: #a9b5c2; }
.password-requirements span.is-valid { border-color: #95d6bd; color: #16745c; background: #eef9f5; }
.password-requirements span.is-valid::before { background: #15946f; }
.setup-complete { display: grid; justify-items: center; gap: 12px; padding: 12px 0 4px; text-align: center; }
.setup-complete > svg { color: #16836b; }
.setup-complete h1 { font-size: 24px; letter-spacing: 0; }
.setup-complete p { max-width: 320px; color: #6d7889; font-size: 12px; line-height: 1.7; }
.setup-complete .login-submit { width: 100%; justify-content: center; margin-top: 8px; text-decoration: none; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(7, 11, 18, .62); backdrop-filter: blur(4px); }
.modal-panel { width: min(430px, 100%); display: grid; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-raised); box-shadow: 0 22px 70px rgba(0, 0, 0, .3); }
.modal-panel.wide { width: min(600px, 100%); }
.members-panel { width: min(820px, 100%); max-height: min(760px, calc(100vh - 36px)); overflow: auto; }
.project-detail-panel { width: min(940px, 100%); max-height: min(860px, calc(100vh - 36px)); overflow: auto; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-heading h2 { font-size: 17px; }
.modal-heading p { margin-top: 5px; color: var(--text-secondary); font-size: 11px; }
.text-input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface); color: var(--text); }
.text-input:focus { border-color: var(--accent); }
.team-required-notice { min-height: 94px; padding: 10px 11px; border: 1px dashed var(--border-strong); border-radius: 5px; background: var(--surface-muted); }
.team-required-notice > span { font-size: 11px; font-weight: 600; }
.team-required-notice strong { margin-top: 5px; color: var(--text); font-size: 12px; }
.team-required-notice small { margin-top: 3px; }
.team-required-notice .button { width: max-content; min-height: 30px; margin-top: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.token-box { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-muted); }
.token-box code { overflow-wrap: anywhere; color: var(--text); font-size: 11px; }
.setup-link-box code { max-height: 72px; overflow: auto; }
.software-role-tag { border: 1px solid rgba(82, 108, 235, 0.25); background: rgba(82, 108, 235, 0.08); color: #526ceb; }
.setup-link-section { display: grid; gap: 7px; margin-top: 16px; }
.setup-link-section > strong { font-size: 14px; }
.setup-link-section > span { color: var(--text-muted); font-size: 12px; }
.field-label > small { color: var(--text-muted); font-size: 9px; font-weight: 500; line-height: 1.55; }
.token-expiry { color: var(--warning); font-size: 10px; }
.member-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.member-list { display: grid; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.member-row { min-height: 54px; display: grid; grid-template-columns: 30px minmax(120px, 1fr) 126px 100px 30px 30px; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }
.member-identity { display: grid; min-width: 0; gap: 2px; }
.member-identity strong, .member-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-identity strong { font-size: 11px; }.member-identity small { color: var(--text-muted); font-size: 9px; }
.member-row select { height: 30px; min-width: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text-secondary); font-size: 10px; }
.detail-eyebrow { margin-bottom: 5px !important; color: var(--accent) !important; font-size: 10px !important; font-weight: 700; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 2px; }
.project-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.project-metrics > div { min-height: 76px; display: grid; align-content: center; gap: 3px; padding: 10px 12px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.project-metrics > div:last-child { border-right: 0; }
.project-metrics span { color: var(--text-muted); font-size: 9px; }
.project-metrics strong { overflow: hidden; text-overflow: ellipsis; font-size: 17px; white-space: nowrap; }
.project-metrics small { color: var(--text-secondary); font-size: 8px; white-space: nowrap; }
.project-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 12px; }
.project-detail-grid > section, .detail-tasks { padding: 14px; border: 1px solid var(--border); border-radius: 5px; }
.project-detail-grid h3, .detail-tasks h3 { margin-bottom: 12px; font-size: 12px; }
.detail-list { display: grid; gap: 8px; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 24px; }
.detail-list dt { color: var(--text-muted); font-size: 9px; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 10px; }
.collaborator-list { display: flex; flex-wrap: wrap; gap: 7px; }
.collaborator-list > span { display: grid; gap: 2px; min-width: 86px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-muted); font-size: 10px; }
.collaborator-list small { color: var(--text-muted); font-size: 8px; }
.task-list.compact { margin: 0 -14px -14px; }
.empty-state.small { min-height: 90px; }
.business-link-panel { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }
.business-link-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.business-link-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; }
.business-link-heading h3 svg { color: var(--accent); }
.business-link-heading p { margin-top: 4px; color: var(--text-muted); font-size: 9px; }
.business-link-heading .row-actions { flex-wrap: wrap; justify-content: flex-end; }
.inline-sync-state { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 10px; }
.inline-sync-state.error { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.inline-sync-state.success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); background: var(--success-soft); color: var(--success); }
.business-link-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.business-link-metrics > div { min-height: 66px; display: grid; align-content: center; gap: 3px; padding: 9px 11px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.business-link-metrics > div:last-child { border-right: 0; }
.business-link-metrics span, .business-link-metrics small { color: var(--text-muted); font-size: 8px; }
.business-link-metrics strong { overflow: hidden; text-overflow: ellipsis; font-size: 15px; white-space: nowrap; }
.business-sync-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.business-sync-summary > article { min-width: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-muted); }
.business-sync-summary > article > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.business-sync-summary > article > div:first-child span { color: var(--text-secondary); font-size: 9px; font-weight: 700; }
.business-sync-summary > article > div:first-child strong { color: var(--text); font-size: 18px; }
.business-sync-summary > article > small { overflow: hidden; color: var(--text-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.automatic-sync-state { min-height: 38px; display: grid; grid-template-columns: 64px 92px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; }
.automatic-sync-state span { color: var(--text-muted); font-size: 9px; }.automatic-sync-state strong { font-size: 10px; }.automatic-sync-state small { overflow: hidden; color: var(--text-secondary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.business-link-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.business-link-lists > div { min-width: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.business-link-lists h4 { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 10px; }
.business-link-lists article { min-height: 46px; display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.business-link-lists article:last-child { border-bottom: 0; }
.business-link-lists article > div { display: grid; min-width: 0; gap: 2px; }
.business-link-lists article strong, .business-link-lists article small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-link-lists article strong { font-size: 9px; }.business-link-lists article small { color: var(--text-muted); font-size: 8px; }
.business-link-lists .muted-text { min-height: 70px; display: grid; place-items: center; margin: 0; }
.text-area { width: 100%; min-height: 90px; resize: vertical; padding: 9px 11px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface); color: var(--text); font-size: 11px; }
.text-area:focus { border-color: var(--accent); }
.required-note { margin-left: 6px; color: var(--danger); font-size: 9px; }
.collaborator-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 230px; margin: 0; overflow: auto; padding: 10px; border: 1px solid var(--border); border-radius: 5px; }
.collaborator-picker legend { padding: 0 5px; color: var(--text-muted); font-size: 9px; }
.collaborator-picker label { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; background: var(--surface-muted); cursor: pointer; }
.collaborator-picker input { width: 14px; height: 14px; accent-color: var(--accent); }
.collaborator-picker span { display: grid; gap: 2px; font-size: 10px; }.collaborator-picker small { color: var(--text-muted); font-size: 8px; }
.mobile-scrim { display: none; }

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .recent-projects { grid-row: auto; }
  .login-screen { grid-template-columns: minmax(380px, .9fr) minmax(420px, 1.1fr); }
  .login-visual-copy h1 { font-size: 27px; }
}

@media (max-width: 760px) {
  .admin-shell, .sidebar-collapsed { display: block; }
  .sidebar, .sidebar-collapsed .sidebar { width: 250px; transform: translateX(-100%); box-shadow: 12px 0 40px rgba(0, 0, 0, .28); }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 25; inset: 0; display: block; border: 0; background: rgba(4, 8, 14, .58); }
  .mobile-close { display: grid; margin-left: auto; border-color: var(--sidebar-border); background: transparent; color: #a9b5c4; }
  .sidebar-collapse { display: none; }
  .workspace { min-width: 0; }
  .topbar { height: 60px; padding: 0 14px; }
  .mobile-menu { display: grid; }
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 15px; }
  .account-trigger { min-width: 0; grid-template-columns: 30px 15px; padding: 4px 6px; }
  .account-copy { display: none; }
  .content { min-height: calc(100vh - 60px); padding: 17px 14px 28px; }
  .page-heading { align-items: center; }
  .page-heading h2 { font-size: 19px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric { min-height: 96px; }
  .generation-stats { grid-template-columns: 1fr; gap: 10px; }
  .generation-stats > div { justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .generation-stats > div:last-child { border-bottom: 0; }
  .heading-actions .button span { display: none; }
  .filter-toolbar { align-items: stretch; flex-wrap: wrap; }
  .filter-toolbar .search-box { width: 100%; }
  .filter-toolbar .compact-select { flex: 1; }
  .filter-toolbar .compact-input { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .member-row { grid-template-columns: 30px minmax(130px, 1fr) 30px 30px; }
  .member-row select { grid-column: span 2; }
  .project-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-metrics > div { border-bottom: 1px solid var(--border); }
  .project-metrics > div:nth-child(2n) { border-right: 0; }
  .project-detail-grid { grid-template-columns: 1fr; }
  .business-link-heading { align-items: stretch; flex-direction: column; }
  .business-link-heading .row-actions { justify-content: stretch; }
  .business-link-heading .row-actions .button { flex: 1; }
  .business-link-lists { grid-template-columns: 1fr; }
  .business-sync-summary { grid-template-columns: 1fr; }
  .automatic-sync-state { grid-template-columns: 58px minmax(0, 1fr); }
  .automatic-sync-state small { grid-column: 2; white-space: normal; }
  .skill-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-summary-grid > div { border-bottom: 1px solid var(--border); }
  .skill-summary-grid > div:nth-child(2n) { border-right: 0; }
  .skill-detail-grid { grid-template-columns: 1fr; }
  .grant-picker { grid-template-columns: 1fr; }
  .version-list article { grid-template-columns: 74px minmax(0, 1fr); }
  .version-list article .row-actions { grid-column: 2; justify-content: flex-start; }
  .task-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-summary-grid > div { border-bottom: 1px solid var(--border); }
  .task-summary-grid > div:nth-child(2n) { border-right: 0; }
  .task-detail-grid { grid-template-columns: 1fr; }
  .attempt-list article { grid-template-columns: 9px minmax(0, 1fr) auto; }
  .attempt-list article time { display: none; }
  .task-events article { grid-template-columns: 90px minmax(0, 1fr); }
  .task-events article p, .task-events article time { grid-column: 2; text-align: left; }
  .file-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-summary-grid > div { border-bottom: 1px solid var(--border); }
  .file-summary-grid > div:nth-child(2n) { border-right: 0; }
  .file-detail-grid { grid-template-columns: 1fr; }
  .file-events article { grid-template-columns: 90px minmax(0, 1fr); }
  .file-events article time { grid-column: 2; text-align: left; }
  .billing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-summary-grid > div { border-bottom: 1px solid var(--border); }
  .billing-summary-grid > div:nth-child(2n) { border-right: 0; }
  .collaborator-picker { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .task-row time { display: none; }
  .login-screen { display: block; background: #fff; }
  .login-visual { display: none; }
  .login-pane { min-height: 100vh; padding: 30px 22px; }
  .login-mobile-mark { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 6px; background: #132534; color: #77cce0; }
  .login-form { max-width: 420px; }
}

.guide-page { max-width: 1180px; }
.guide-link-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); background: var(--surface); }
.guide-link-band > div { display: grid; min-height: 112px; align-content: center; gap: 7px; padding: 20px 24px; border-right: 1px solid var(--border); }
.guide-link-band > div:last-child { border-right: 0; }
.guide-link-band strong { font-size: 15px; }
.guide-link-band span { color: var(--text-muted); font-size: 12px; }
.guide-link-band a, .guide-link-band i { display: inline-flex; width: fit-content; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-style: normal; font-weight: 700; text-decoration: none; }
.guide-section { padding: 0; overflow: hidden; }
.guide-section > header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.guide-section > header > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid var(--border); color: var(--accent); }
.guide-section > header h3 { margin: 0 0 4px; font-size: 15px; }
.guide-section > header p { margin: 0; color: var(--text-muted); font-size: 11px; }
.guide-steps { display: grid; margin: 0; padding: 10px 22px 20px; list-style: none; }
.guide-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--border); }
.guide-steps li:last-child { border-bottom: 0; }
.guide-steps b { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.guide-steps span { font-size: 12px; }
.guide-callout { display: flex; align-items: flex-start; gap: 9px; margin: 0 22px 22px; padding: 13px 15px; border: 1px solid rgba(54, 144, 162, 0.24); background: rgba(54, 144, 162, 0.07); color: var(--text); }
.guide-callout.warning { border-color: rgba(221, 145, 50, 0.28); background: rgba(221, 145, 50, 0.08); }
.guide-callout svg { flex: 0 0 auto; margin-top: 1px; color: var(--accent); }
.guide-callout p { margin: 0; font-size: 12px; line-height: 1.65; }
.guide-role-table { display: grid; }
.guide-role-table > div { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(180px, .9fr) minmax(280px, 1.8fr); min-height: 48px; align-items: center; border-bottom: 1px solid var(--border); }
.guide-role-table > div:last-child { border-bottom: 0; }
.guide-role-table > div > * { padding: 11px 22px; font-size: 12px; }
.guide-role-table > div > span { color: var(--text-muted); }
.guide-role-head { background: var(--surface-muted); font-weight: 700; }
.guide-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-field-grid > div { display: grid; gap: 5px; min-height: 84px; align-content: center; padding: 16px 22px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.guide-field-grid > div:nth-child(2n) { border-right: 0; }
.guide-field-grid strong { font-size: 12px; }
.guide-field-grid span { color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.guide-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 22px 22px; }
.guide-check-grid > div { display: flex; min-height: 42px; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.guide-check-grid svg { color: #2c9d75; }
.guide-footer-note { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border: 1px solid var(--border); color: var(--text-muted); }
.guide-footer-note p { margin: 0; font-size: 11px; }
.guide-footer-note code { color: var(--text); }

.provider-wizard-backdrop { z-index: 80; padding: 24px; }
.provider-wizard { width: min(920px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); box-shadow: 0 24px 70px rgba(12, 22, 35, .24); }
.provider-wizard-heading { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.provider-wizard-heading > div { display: flex; align-items: center; gap: 12px; }
.provider-wizard-heading > div > span { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border)); background: var(--accent-soft); color: var(--accent); }
.provider-wizard-heading p { margin-bottom: 3px; color: var(--accent); font-size: 10px; font-weight: 800; }
.provider-wizard-heading h2 { font-size: 18px; }
.provider-wizard-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.provider-wizard-progress > div { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; border-right: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.provider-wizard-progress > div:last-child { border-right: 0; }
.provider-wizard-progress b { width: 23px; height: 23px; display: grid; flex: 0 0 23px; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 10px; }
.provider-wizard-progress .active { color: var(--text); background: var(--surface); font-weight: 800; }
.provider-wizard-progress .active b { border-color: var(--accent); background: var(--accent); color: #fff; }
.provider-wizard-progress .done { color: var(--success); }
.provider-wizard-progress .done b { border-color: var(--success); background: var(--success-soft); }
.provider-wizard-body { min-height: 420px; overflow-y: auto; padding: 24px; }
.provider-purpose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.provider-purpose-grid button { position: relative; min-height: 190px; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 20px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; text-align: center; }
.provider-purpose-grid button:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.provider-purpose-grid button.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.provider-purpose-grid button > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.provider-purpose-grid strong { font-size: 14px; }
.provider-purpose-grid small { max-width: 180px; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.provider-purpose-grid i { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; }
.provider-wizard-form { max-width: 680px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 auto; }
.provider-wizard-form > .field-label:nth-of-type(2), .provider-wizard-form > .field-label:nth-of-type(4) { grid-column: 1 / -1; }
.provider-wizard-form .field-label small { margin-top: 5px; color: var(--text-muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.wizard-help { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid rgba(44, 157, 117, .24); background: var(--success-soft); color: var(--success); }
.wizard-help p { font-size: 11px; line-height: 1.55; }
.wizard-secret-input { position: relative; }
.wizard-secret-input .text-input { padding-right: 42px; }
.wizard-secret-input button { position: absolute; top: 1px; right: 1px; width: 38px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.advanced-toggle { grid-column: 1 / -1; justify-self: start; padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 700; }
.advanced-provider-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; border: 1px solid var(--border); background: var(--surface-muted); }
.provider-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); }
.provider-review > div:not(.provider-review-note) { min-height: 76px; display: grid; align-content: center; gap: 6px; padding: 14px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.provider-review > div:nth-child(2n):not(.provider-review-note) { border-right: 0; }
.provider-review span { color: var(--text-muted); font-size: 10px; }
.provider-review strong { min-width: 0; overflow: hidden; color: var(--text); text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.provider-review-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; padding: 14px 18px; color: var(--warning); background: var(--warning-soft); }
.provider-review-note p { font-size: 11px; line-height: 1.55; }
.provider-model-step { display: grid; gap: 16px; }
.provider-check-result { min-height: 70px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid var(--border); }
.provider-check-result.healthy { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); background: var(--success-soft); color: var(--success); }
.provider-check-result.degraded { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: var(--warning-soft); color: var(--warning); }
.provider-check-result.failed { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.provider-check-result > div { display: grid; gap: 4px; }
.provider-check-result strong { font-size: 12px; }
.provider-check-result span { font-size: 10px; }
.provider-check-result button { min-height: 31px; padding: 0 10px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; font-size: 10px; font-weight: 700; }

.release-count { color: var(--text-muted); font-size: 10px; }
.release-health-value { max-width: 250px; font-size: 12px !important; }
.release-history .actions-column { width: 90px; }
.release-action-panel { width: min(520px, 100%); }
.release-dry-run { padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-muted); }
.modal-panel.release-detail-panel { width: min(820px, 100%); max-height: min(820px, calc(100vh - 36px)); overflow: auto; }
.release-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.release-detail-summary > div { min-height: 68px; display: grid; align-content: center; gap: 4px; padding: 10px 12px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.release-detail-summary > div:last-child { border-right: 0; }
.release-detail-summary span { color: var(--text-muted); font-size: 9px; }
.release-detail-summary strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.release-log-section { padding: 14px; border: 1px solid var(--border); border-radius: 5px; }
.release-log-section h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 12px; }
.release-log-list { display: grid; gap: 7px; }
.release-log-list article { min-height: 54px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 140px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-muted); }
.release-log-list article > span { color: var(--success); }
.release-log-list article.log-warning > span { color: var(--warning); }
.release-log-list article.log-error > span { color: var(--danger); }
.release-log-list article > div { min-width: 0; display: grid; gap: 3px; }
.release-log-list strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.release-log-list small { color: var(--text-muted); font-family: Consolas, monospace; font-size: 8px; }
.release-log-list time { display: flex; align-items: center; justify-content: flex-end; gap: 5px; color: var(--text-muted); font-size: 8px; }
.provider-model-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.provider-model-heading h3 { margin-bottom: 4px; font-size: 14px; }
.provider-model-heading p, .provider-model-heading > span { color: var(--text-muted); font-size: 10px; }
.provider-model-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; }
.provider-model-list label { min-height: 42px; display: grid; grid-template-columns: 18px minmax(0, 1fr) 20px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.provider-model-list label.selected { border-color: var(--accent); background: var(--accent-soft); }
.provider-model-list input { width: 14px; height: 14px; accent-color: var(--accent); }
.provider-model-list span { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.provider-model-list svg { opacity: 0; color: var(--accent); }
.provider-model-list label.selected svg { opacity: 1; }
.provider-model-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.wizard-default-route { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface-muted); cursor: pointer; }
.wizard-default-route input { width: 15px; height: 15px; margin-top: 1px; accent-color: var(--accent); }
.wizard-default-route span { display: grid; gap: 4px; }
.wizard-default-route strong { font-size: 11px; }
.wizard-default-route small { color: var(--text-muted); font-size: 10px; }
.provider-wizard-actions { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-muted); }
.provider-wizard-actions .button { min-width: 112px; }

@media (max-width: 760px) {
  .guide-link-band, .guide-field-grid, .guide-check-grid { grid-template-columns: 1fr; }
  .guide-link-band > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .guide-link-band > div:last-child { border-bottom: 0; }
  .guide-field-grid > div { border-right: 0; }
  .guide-role-table { overflow-x: auto; }
  .guide-role-table > div { min-width: 700px; }
  .provider-wizard-backdrop { padding: 0; }
  .provider-wizard { width: 100%; height: 100vh; max-height: none; border: 0; border-radius: 0; }
  .provider-wizard-progress > div { min-height: 46px; }
  .provider-wizard-progress span { display: none; }
  .provider-wizard-body { min-height: 0; padding: 18px; }
  .provider-purpose-grid, .provider-wizard-form, .provider-review, .provider-model-list, .advanced-provider-fields { grid-template-columns: 1fr; }
  .provider-purpose-grid button { min-height: 126px; }
  .provider-wizard-form > .field-label, .provider-review-note, .advanced-provider-fields { grid-column: 1; }
  .provider-review > div:not(.provider-review-note) { border-right: 0; }
  .provider-check-result { grid-template-columns: 30px minmax(0, 1fr); }
  .provider-check-result button { grid-column: 2; justify-self: start; }
  .release-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-detail-summary > div { border-bottom: 1px solid var(--border); }
  .release-detail-summary > div:nth-child(2n) { border-right: 0; }
  .release-log-list article { grid-template-columns: 20px minmax(0, 1fr); }
  .release-log-list time { grid-column: 2; justify-content: flex-start; }
}

