:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #e4e7ed;
  --text: #4d5a98;
  --muted: #68759c;
  --accent: #0050d7;
  --hover: #f1f6ff;
  --selection: rgba(0, 80, 215, .08);
  --shadow: 0 3px 14px rgba(16, 40, 110, .10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; overflow-x: clip; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topbar { height: 64px; padding: 0 max(24px, calc((100vw - 1880px) / 2)); border-bottom: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: 0 2px 8px rgba(16, 40, 110, .08); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: #08246f; text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--selection); color: var(--accent); }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions form { margin: 0; }
.account-name { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { min-height: 36px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.logout-button:hover { border-color: var(--accent); color: var(--accent); }
.refresh-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.live-dot, .running-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d39b51; }
.connected .live-dot, .running-dot { background: #55bc88; box-shadow: 0 0 0 3px rgba(85, 188, 136, .12); }
main { width: min(100% - 48px, 1760px); margin: 0 auto; padding: 32px 0 28px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 14px; font-weight: 750; letter-spacing: .11em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; color: #08246f; font-size: clamp(30px, 2.8vw, 40px); line-height: 1.18; letter-spacing: -.03em; font-weight: 650; }
h2 { margin: 0; color: #08246f; font-size: clamp(21px, 1.8vw, 25px); font-weight: 700; letter-spacing: -.02em; }
.muted, small { color: var(--muted); }
.page-intro .muted { margin: 0; font-size: 14px; }
.updated { flex-shrink: 0; margin: 0 0 5px; color: var(--muted); font-size: 14px; }
.updated time { color: var(--text); font-variant-numeric: tabular-nums; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.metric-card { padding: 22px 26px 20px; }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.metric-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; background: var(--selection); color: var(--accent); }
.metric-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.metric-label { color: var(--muted); font-size: 16px; font-weight: 650; }
.metric-value { display: flex; align-items: baseline; gap: 8px; min-height: 54px; margin-bottom: 12px; font-size: clamp(34px, 3.1vw, 44px); font-weight: 680; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 16px; font-weight: 550; letter-spacing: 0; }
.meter { height: 8px; overflow: hidden; border-radius: 99px; background: var(--line); }
.meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0050d7, #4c94f3); transition: width .35s ease; }
.core-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin-top: 13px; }
.core-usage { display: grid; gap: 4px; min-width: 0; }
.core-usage-heading { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.core-usage-heading strong { color: var(--text); font-weight: 600; }
.core-meter { height: 6px; }
.metric-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.section-panel { padding: 23px 26px; margin-bottom: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-count { flex: 0 0 auto; padding: 6px 13px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 14px; }
.disk-list { display: grid; gap: 2px; }
.disk-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(180px, 1fr) minmax(260px, 1.2fr); align-items: center; gap: 22px; padding: 16px 0; border-top: 1px solid var(--line); }
.disk-details { min-width: 0; }
.disk-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.disk-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; }
.disk-type { flex: 0 0 auto; padding: 3px 9px; border-radius: 7px; background: var(--hover); color: var(--muted); font-size: 13px; }
.disk-device { display: block; overflow: hidden; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.disk-meter { height: 8px; }
.disk-meter > span.warning { background: #d39b51; }
.disk-meter > span.critical { background: #d76c6c; }
.disk-totals { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.disk-totals strong { flex: 0 0 auto; color: var(--text); font-size: 14px; font-weight: 650; }
.table-note { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.container-table { width: 100%; min-width: 1080px; table-layout: fixed; border-collapse: collapse; text-align: left; }
.container-table .name-column { width: 22%; }
.container-table .ports-column { width: 22%; }
.container-table .cpu-column { width: 10%; }
.container-table .memory-column { width: 28%; }
.container-table .actions-column { width: 18%; }
.container-table th { padding: 0 16px; border-bottom: 1px solid var(--line); color: #344783; font-size: 13px; font-weight: 700; letter-spacing: .055em; text-align: left; text-transform: uppercase; }
.sort-button { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort-button:hover, .sort-button.active { color: var(--accent); }
.sort-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.container-table th:first-child, .container-table td:first-child { padding-left: 2px; }
.container-table td { height: 58px; padding: 10px 16px; border-bottom: 1px solid var(--line); overflow: hidden; color: var(--text); font-size: 14px; text-align: left; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
.container-table tbody tr:last-child td { border-bottom: 0; }
.container-table td.empty { height: 72px; color: var(--muted); text-align: center; }
.container-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.container-status-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #74838d; }
.container-status-dot.running { background: #55bc88; box-shadow: 0 0 0 3px rgba(85, 188, 136, .12); }
.container-status-dot.paused, .container-status-dot.restarting { background: #d39b51; box-shadow: 0 0 0 3px rgba(211, 155, 81, .12); }
.container-name strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; }
.container-ports { overflow: hidden; color: var(--muted) !important; font-size: 12px !important; text-overflow: ellipsis; white-space: nowrap; }
.container-memory { display: grid; gap: 7px; white-space: normal; }
.container-memory-value { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.container-memory-meter { height: 7px; }
.container-actions { display: flex; align-items: center; justify-content: flex-start; gap: 6px; }
.container-action { display: inline-grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; }
.container-action:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.container-action.stop { color: #d9b27b; }
.container-action.restart { color: var(--accent); }
.container-action-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.container-action:disabled { opacity: .55; cursor: wait; }
.container-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.container-action-unavailable { color: var(--muted); }
.action-message { padding: 8px 11px; margin: 0 0 10px; border: 1px solid rgba(85, 188, 136, .3); border-radius: 8px; background: rgba(85, 188, 136, .08); color: #65c895; font-size: 12px; }
.action-message.error { border-color: rgba(215, 108, 108, .35); background: rgba(215, 108, 108, .08); color: #e59898; }
.state-tag { flex: 0 0 auto; padding: 2px 7px; border-radius: 99px; background: var(--hover); color: var(--muted); font-size: 10px; line-height: 1.5; }
.state-tag.running { background: rgba(85, 188, 136, .12); color: #65c895; }
.state-tag.paused, .state-tag.restarting { background: rgba(211, 155, 81, .12); color: #d9b27b; }
.empty { padding: 18px 0 8px; margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.alert, .inline-warning { padding: 10px 13px; border: 1px solid rgba(215, 108, 108, .35); border-radius: 9px; background: rgba(215, 108, 108, .08); color: #e59898; font-size: 13px; }
.alert { margin: -6px 0 18px; }
.inline-warning { margin: 0 0 10px; border-color: rgba(211, 155, 81, .35); background: rgba(211, 155, 81, .08); color: #d9b27b; }
.auth-main { display: flex; justify-content: center; padding-top: clamp(48px, 12vh, 120px); }
.auth-panel { width: min(100%, 400px); padding: 20px; border-radius: 12px; }
.auth-panel h1 { margin-bottom: 8px; font-size: 24px; }
.auth-description { margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.auth-form, .account-form { display: grid; gap: 9px; }
.auth-form label, .account-form label { margin-top: 5px; color: var(--text); font-size: 13px; font-weight: 550; }
.auth-form label span, .account-form label span { color: var(--muted); font-weight: 400; }
.auth-form input, .account-form input { width: 100%; min-height: 46px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.auth-form input:focus, .account-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-hint { margin: -5px 0 2px; color: var(--muted); font-size: 11px; }
.primary-button { min-height: 46px; padding: 10px 14px; margin-top: 10px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.primary-button:hover { filter: brightness(1.08); }
.primary-button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.auth-error { margin: 12px 0; }
.account-panel { padding: 14px 18px; margin-bottom: 18px; }
.account-panel > summary { color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.account-panel-content { padding-top: 15px; }
.account-form { max-width: 520px; }
.account-message, .account-error { padding: 8px 10px; margin: 0 0 12px; border-radius: 7px; font-size: 12px; }
.account-message { background: rgba(85, 188, 136, .08); color: #65c895; }
.account-error { background: rgba(215, 108, 108, .08); color: #e59898; }
.invite-management { max-width: 620px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.invite-management h2 { margin-bottom: 6px; }
.invite-management .field-hint { font-size: 13px; }
.invite-create { width: auto; }
.invite-result { display: grid; gap: 7px; margin-top: 14px; }
.invite-result label { color: var(--text); font-size: 13px; font-weight: 550; }
.invite-copy-row { display: flex; gap: 8px; }
.invite-copy-row input { min-width: 0; min-height: 42px; flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.invitation-list { display: grid; gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; }
.invitation-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 4px 2px; color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 16px; }
  main { width: min(100% - 28px, 900px); padding-top: 25px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 18px; }
  .updated { margin: 0; }
  .overview-grid { gap: 11px; }
  .metric-card { padding: 20px; }
  .section-panel { padding: 20px 16px; }
  .disk-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px 14px; padding: 16px 0; }
  .disk-meter { grid-column: 1 / -1; grid-row: 2; }
  .disk-totals { justify-content: space-between; }
  .container-table { min-width: 1080px; }
}
@media (max-width: 460px) {
  .topbar { padding: 0 12px; }
  .brand { font-size: 19px; }
  .header-actions { gap: 5px; }
  .refresh-status { gap: 6px; font-size: 11px; }
  .account-name { display: none; }
  .logout-button { min-height: 40px; padding: 4px 7px; font-size: 11px; }
  main { width: calc(100% - 24px); padding-top: 20px; }
  .overview-grid { grid-template-columns: 1fr; }
  .invite-copy-row { align-items: stretch; flex-direction: column; }
  .metric-card { padding: 18px 17px; }
  .card-heading { margin-bottom: 10px; }
  .metric-value { min-height: 48px; margin-bottom: 10px; font-size: clamp(32px, 8vw, 38px); }
  .metric-foot { font-size: 12px; }
  .section-panel { padding: 18px 13px; }
  .section-heading { margin-bottom: 16px; }
  .disk-totals { font-size: 12px; }
  footer { flex-direction: column; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
