:root {
  color-scheme: light;
  --canvas: #f7f8fc;
  --surface: #fff;
  --text: #1d2338;
  --muted: #606980;
  --line: #e4e8f0;
  --primary: #3355a3;
  --primary-weak: #edf2fb;
  --rail: #171a32;
  --rail-text: #bdc4db;
  --good: #1a694a;
  --bad: #a23e3e;
  --radius: 9px;
  --header-height: 66px;
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(23px, 3vw, 31px); line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
a { color: inherit; }
:focus-visible { outline: 2px solid #5276c4; outline-offset: 3px; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon.small { width: 16px; height: 16px; }
.svg-library, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.subtle, .table-secondary { color: var(--muted); font-size: 12px; }
.table-secondary { display: block; margin-top: 3px; overflow-wrap: anywhere; }

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 23px);
  min-height: var(--header-height);
  padding: 0 clamp(15px, 3vw, 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 760; line-height: 1; letter-spacing: -.055em; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--rail); color: white; border-radius: 7px; font-size: 17px; letter-spacing: -1px; padding-right: 1px; }
.header-divider { width: 1px; height: 24px; background: var(--line); }
.header-clock { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clock-time { color: var(--text); font-weight: 650; }
#dashboard-toolbar { flex: 1; min-width: 0; justify-content: space-between; flex-wrap: nowrap; gap: 12px; }
.top-navigation { display: flex; align-self: stretch; align-items: stretch; white-space: nowrap; min-width: 0; }
.top-navigation a { display: flex; align-items: center; padding: 0 clamp(7px, 1.1vw, 16px); min-height: calc(var(--header-height) - 1px); border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.top-navigation a:hover, .top-navigation a[aria-current] { color: var(--primary); }
.top-navigation a[aria-current] { border-bottom-color: var(--primary); }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; padding: 0; width: 35px; height: 35px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 7px; }
.icon-button:hover { background: var(--primary-weak); }
.account-menu { margin-left: auto; position: relative; flex-shrink: 0; }
.account-menu summary { display: flex; align-items: center; list-style: none; gap: 8px; font-weight: 650; max-width: 205px; }
.account-menu summary::-webkit-details-marker { display: none; }
#owner-name { max-width: 138px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 31px; height: 31px; flex: 0 0 auto; background: #edf0fa; color: #39446d; font-size: 13px; font-weight: 700; }
.account-actions { position: absolute; right: 0; top: calc(100% + 12px); width: max-content; min-width: 190px; padding: 5px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px #1a223417; }
.account-actions button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 9px 11px; color: var(--text); border-radius: 5px; }
.account-actions button:hover { background: var(--primary-weak); }

.dashboard-layout { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: calc(100dvh - var(--header-height)); }
.dashboard-layout.sidebar-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--header-height); height: calc(100dvh - var(--header-height)); align-self: start; background: var(--rail); color: var(--rail-text); padding: 19px 13px; overflow-y: auto; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar a { min-height: 41px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; font-weight: 550; border-radius: 7px; text-decoration: none; white-space: nowrap; font-size: 13px; }
.sidebar a:hover { background: #242a47; color: #fff; }
.sidebar a[aria-current] { background: #303859; color: #fff; }
.sidebar a[aria-current] .icon { color: #d2defa; }
.sidebar-divider { border-top: 1px solid #323750; margin: 12px 7px 8px; }
.quick-access { border-top: 1px solid #323750; margin: 21px 7px 0; padding: 14px 4px; min-height: 70px; }
.quick-access h2 { color: #a4aec9; font-size: 12px; font-weight: 650; white-space: nowrap; }
.sidebar-collapsed .sidebar { padding-inline: 9px; }
.sidebar-collapsed .sidebar a { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .sidebar a span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.sidebar-collapsed .quick-access { display: none; }
.sidebar-overlay { display: none; }
.workspace { min-width: 0; width: 100%; max-width: 1610px; margin: 0 auto; padding: 27px clamp(16px, 3vw, 36px) 48px; background: #fff; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#view-summary { color: var(--muted); font-size: 13px; margin-top: 6px; }
#page-status .status:not(:empty) { margin: 0 0 12px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 21px; }
.metric { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; background: white; }
.metric-top { display: flex; gap: 3px 8px; min-height: 32px; align-items: center; justify-content: space-between; }
.metric-top h2 { min-width: 0; font-size: 12.5px; font-weight: 650; line-height: 1.3; color: #434d65; letter-spacing: 0; }
.metric-icon, .server-icon { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; background: #eff3fa; color: #44608e; border-radius: 7px; }
.metric-icon .icon { width: 15px; height: 15px; }
.metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 9px; min-height: 29px; margin: 3px 0 1px; font-size: clamp(19px, 2.08vw, 27px); font-weight: 740; line-height: 1.18; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-caption { color: var(--muted); font-size: 11.5px; }

.panel { margin-bottom: 19px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px 14px; margin-bottom: 13px; }
.panel-head .subtle { margin-top: 3px; }
.server-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.server-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #fcfdff; overflow-wrap: anywhere; }
.server-top { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin-bottom: 7px; }
.server-icon { width: 26px; height: 26px; }
.server-icon .icon { width: 15px; height: 15px; }
.server-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 3px 6px; margin-top: 7px; color: var(--muted); font-size: 10.5px; }
.server-actions { display: inline-flex; gap: 9px; }
.server-snapshot:not(:empty) { margin-top: 5px; }
.telemetry-resources, .telemetry-workloads { display: grid; gap: 12px; }
.telemetry-resources { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.telemetry-workloads { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.telemetry-workloads section { min-width: 0; }
.telemetry-workloads section > .subtle { margin: 3px 0 7px; }
.telemetry-box { padding: 12px; border-radius: 7px; border: 1px solid var(--line); min-width: 0; }
.telemetry-box h3 { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.telemetry-box .icon { width: 16px; height: 16px; }
.telemetry-box progress { display: block; width: 100%; margin-top: 6px; height: 8px; accent-color: var(--primary); }
.telemetry-value { font-size: 19px; font-variant-numeric: tabular-nums; }
.disk-row { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 8px; margin-top: 6px; font-size: 12px; }
.disk-row progress { grid-column: 1 / -1; }
.disk-row > span { overflow-wrap: anywhere; }
.network-values { display: grid; grid-template-columns: 1fr 1fr; margin: 4px 0; gap: 1px; font-variant-numeric: tabular-nums; }
.network-values dd { margin: 0; text-align: right; font-weight: 650; }
.telemetry-table { max-height: 24rem; }
.telemetry-table th { position: sticky; top: 0; }
.telemetry-table td:first-child { overflow-wrap: anywhere; }
.capacity-warning { color: #9d382a; }
.disk-row.capacity-warning progress { accent-color: #b34232; }
.disk-row small { grid-column: 1 / -1; }
#server-detail { scroll-margin-top: 108px; }
.state { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 650; line-height: 1.35; max-width: 100%; }
.state i { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.state.online { color: var(--good); background: #eaf5ef; }
.state.offline { color: var(--bad); background: #fbeeee; }
.state.pending { color: #59657b; background: #eff1f6; }
.empty-state { color: var(--muted); font-size: 13px; padding: 10px 0; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dce1eb; border-radius: 7px; min-height: 35px; padding: 7px 11px; background: white; color: var(--text); font-size: 12.5px; font-weight: 630; white-space: nowrap; }
.button:hover { border-color: #a3afc6; background: #f7f9fd; }
.button.primary { border-color: #2e4d8d; background: #2e4d8d; color: white; }
.button.primary:hover { background: #273f72; }
.text-link, .project-link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; text-decoration: none; font-weight: 640; text-align: left; }
.text-link:hover, .project-link:hover { text-decoration: underline; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.table-wrap { position: relative; width: 100%; min-width: 0; max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
th { color: #4d5a74; font-size: 11px; white-space: nowrap; background: #f5f7fb; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
.numeric { text-align: center; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; background: var(--primary-weak); color: #354f82; border-radius: 5px; padding: 2px 6px; font-size: 11px; font-weight: 700; }
.project-link { color: #253450; max-width: 100%; }
.project-link { text-decoration: none; }
.project-detail { display: grid; gap: 14px; min-width: 0; }
.project-back { justify-self: start; }
.project-heading, .project-section { overflow-wrap: anywhere; min-width: 0; }
.project-heading .panel-head { align-items: flex-start; }
#detail-title { font-size: 23px; }
#detail-description:empty, #detail-assignment:empty { display: none; }
.project-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.project-wide { grid-column: 1 / -1; }
.project-section h3 { display: flex; align-items: center; gap: 7px; }
.project-section h3 .icon { width: 16px; height: 16px; color: var(--primary); }
.project-section h4 { font-size: 12.5px; margin: 9px 0 6px; }
.project-facts { display: grid; grid-template-columns: minmax(104px, 39%) minmax(0, 1fr); gap: 5px 13px; margin: 0; font-size: 13px; }
.project-facts > div { display: contents; }
.project-facts dt { color: var(--muted); font-size: 12px; }
.project-facts dd { margin: 0; min-width: 0; }
.project-heading .project-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.project-heading .project-facts > div { display: grid; align-content: start; gap: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.project-items { display: grid; margin: 0; padding: 0; list-style: none; }
.project-items > li { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.project-items > li:last-child { border-bottom: 0; }
.project-item-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.project-caption { margin-bottom: 6px; white-space: pre-wrap; }
.project-history { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 9px; }
.project-history summary { font-size: 12.5px; font-weight: 650; color: var(--primary); }
.project-handoff .project-facts { margin-top: 7px; }
.project-handoff dd { white-space: pre-wrap; }
.project-handoff > a { display: inline-block; margin-top: 7px; }
#project-test-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 8px; }
#project-test-form label { display: grid; gap: 4px; min-width: 0; flex: 1 1 180px; }
#project-ai-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 12px; }
#project-ai-form label { display: grid; gap: 4px; min-width: 0; flex: 1 1 180px; }
#project-ai-form .ai-instructions { flex-basis: 100%; }
#project-ai-panel { scroll-margin-top: calc(var(--header-height) + 12px); }
#project-test-output { margin-top: 12px; }
#project-test-output .panel-head { margin-bottom: 3px; }
#project-test-selected { overflow-wrap: anywhere; }
#project-test-log { white-space: pre-wrap; }
.task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task, .event { padding: 11px 0; border-bottom: 1px solid var(--line); }
.task:last-child,.event:last-child { border-bottom: 0; }
.task-title { font-weight: 650; margin-bottom: 4px; }
.task-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.event { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 13px; font-size: 13px; }
.event time { color: var(--muted); font-size: 12px; }
.job-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.job-row span, #github-tracking-list { overflow-wrap: anywhere; }
.job-output { background: var(--canvas); padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; overflow: auto; }
.status { color: var(--muted); font-size: 12px; }
.status.error, .form-error { color: #a63737; }
.status:empty { display: none; }

input, select, textarea { border: 1px solid #dce1eb; border-radius: 7px; padding: 8px 10px; width: 100%; min-width: 0; color: var(--text); background: white; }
textarea { resize: vertical; }
label { font-size: 13px; }
.access-panel { width: min(420px, calc(100% - 30px)); margin: clamp(43px, 12vh, 125px) auto; padding: 25px; display: grid; gap: 15px; justify-items: start; }
.access-panel .primary { width: 100%; min-height: 42px; }
.access-panel details { width: 100%; }
.access-panel summary, .profile-passkeys summary { color: var(--primary); font-weight: 620; font-size: 13px; }
.access-fields { display: grid; gap: 7px; margin: 10px 0 0; }
.access-fields ul:empty { display: none; }
.access-fields ul { padding-inline-start: 18px; margin: 0; }
.access-fields li { margin: 6px 0; overflow-wrap: anywhere; }
.access-fields li button { margin-left: 6px; }
dialog { border: 1px solid var(--line); border-radius: 11px; padding: 0; width: min(450px, calc(100vw - 26px)); max-height: calc(100dvh - 24px); color: var(--text); box-shadow: 0 18px 46px #10182823; }
dialog::backdrop { background: #13172db0; }
dialog form { padding: 19px; display: grid; gap: 11px; }
dialog label { display: grid; gap: 5px; font-weight: 620; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 4px; }
.form-error:empty { display: none; }
.profile-passkeys { padding: 0 19px 17px; }

#ai-costs > summary { font-weight: 700; cursor: pointer; }
#ai-costs h3 { margin: 14px 0 8px; }
.ai-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 12px 0; }
.ai-controls label,.ai-fields label { display: grid; gap: 4px; }
.ai-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 190px),1fr)); gap: 10px; align-items: end; margin: 8px 0 12px; }
.ai-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 220px),1fr)); gap: 12px; }
.ai-summary ul { margin-top: 0; padding-left: 20px; }
.ai-summary li { margin-bottom: 4px; overflow-wrap: anywhere; }
.ai-entry-panel { margin: 10px 0; }
.ai-entry-panel summary { color: var(--primary); cursor: pointer; }

@media (max-width: 1030px) {
  .topbar { gap: 10px; padding-inline: 14px; }
  .header-divider { display: none; }
  .header-clock { flex-direction: column; align-items: flex-start; gap: 0; }
  .metrics, .server-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: 190px minmax(0, 1fr); }
  #owner-name { max-width: 90px; }
}
@media (max-width: 760px) {
  :root { --header-height: 56px; }
  .topbar { flex-wrap: wrap; gap: 0 10px; min-height: 56px; }
  .topbar > .brand, #sidebar-toggle, .header-clock, .account-menu { align-self: center; }
  #sidebar-toggle { width: 32px; height: 32px; }
  .brand { font-size: 18px; height: 55px; }
  .brand-mark { width: 27px; height: 27px; font-size: 14px; }
  .header-clock { margin-left: auto; margin-right: 50px; font-size: 10px; }
  #dashboard-toolbar { flex: 0 0 100%; position: relative; height: 37px; }
  .top-navigation { overflow-x: auto; scrollbar-width: none; }
  .top-navigation a { min-height: 35px; padding-inline: 9px; font-size: 11px; }
  .account-menu { position: absolute; top: -43px; right: 0; }
  .account-menu summary { min-width: 36px; min-height: 32px; justify-content: end; gap: 3px; }
  #owner-name { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .avatar { width: 26px; height: 26px; }
  .account-menu .icon { width: 12px; }
  .dashboard-layout, .dashboard-layout.sidebar-collapsed { display: block; }
  .sidebar { display: none; position: fixed; z-index: 4; top: 93px; left: 0; width: min(78vw, 235px); height: calc(100dvh - 93px); }
  .mobile-menu-open .sidebar { display: block; }
  .mobile-menu-open .sidebar-overlay { display: block; position: fixed; inset: 93px 0 0; z-index: 3; border: 0; background: #171a327f; }
  .workspace { padding: 17px 13px 28px; }
  .page-heading { gap: 9px; align-items: flex-start; }
  .page-heading:has(#open-project-ai:not([hidden])) { flex-direction: column; }
  #project-ai-panel { scroll-margin-top: calc(var(--header-height) + 49px); }
  #view-summary { font-size: 12px; }
  .metrics, .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 8px 9px; }
  .metric-top { min-height: 31px; }
  .metric-top h2 { font-size: 11.5px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-caption { font-size: 10.5px; }
  .metric-value { min-height: 22px; }
  .panel { padding: 12px; }
  .project-sections, .event, .telemetry-resources, .telemetry-workloads { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .project-heading .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
