:root {
  color-scheme: dark;
  --background: #111417;
  --surface: #1b2025;
  --surface-raised: #21272d;
  --border: #30383f;
  --text: #f0f3f5;
  --muted: #a1abb4;
  --faint: #7e8992;
  --cyan: #6fd3dd;
  --orange: #f5a36f;
  --orange-hover: #ffb581;
  --error: #ffb0a9;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 0%, #1d2b2f 0, transparent 46%), var(--background);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
p, h1, h2, dl, dd { margin: 0; }
button, a, input { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.page-shell { width: min(100% - 64px, 1040px); margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; min-height: 118px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; font-size: 19px; font-weight: 650; letter-spacing: -0.3px; }
.brand-caption { display: block; color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0; line-height: 1.4; margin-top: 1px; }
.brand-mark { width: 39px; height: 39px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid #3c535b; border-radius: 12px; background: #23383e; }
.brand-mark span { display: block; width: 4px; border-radius: 2px; background: var(--cyan); transform: skew(-12deg); }
.brand-mark span:nth-child(1) { height: 12px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 15px; }
.quiet-button { min-height: 44px; padding: 8px 17px; border: 1px solid var(--border); background: transparent; border-radius: 10px; color: var(--muted); font-size: 13px; transition: background .16s, color .16s; }
.quiet-button:hover { background: var(--surface-raised); color: var(--text); }

.dashboard { width: min(100%, 730px); margin: 36px auto 60px; }
.server-card { padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 22px 70px #0002; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 21px; }
.eyebrow { color: var(--faint); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 1.6px; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 10px; border-radius: 7px; background: #a1abb410; color: var(--muted); font-size: 12px; line-height: 1.5; }
.status-dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; flex-shrink: 0; }
.status-badge[data-state="running"] { color: #86d9bd; background: #86d9bd10; }
.status-badge[data-state="restarting"] { color: var(--orange); background: #f5a36f10; }
.status-badge[data-state="unavailable"] { color: var(--orange); background: #f5a36f10; }
.status-badge[data-state="stopped"] { color: var(--muted); }
.status-badge[data-state="connection-error"] { color: var(--error); background: #ffb0a910; }
h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 650; letter-spacing: -1px; line-height: 1.2; overflow-wrap: anywhere; }
.card-description { color: var(--muted); font-size: 14px; margin-top: 12px; }
.server-details { display: grid; grid-template-columns: 1.45fr 1fr; gap: 25px; padding: 27px 0; margin-top: 28px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-item dt { color: var(--faint); font-size: 12px; margin-bottom: 8px; }
.detail-item dd { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.server-address { color: var(--cyan); font-family: "Cascadia Code", Consolas, monospace; font-size: 15px; letter-spacing: -0.25px; overflow-wrap: anywhere; }
.uptime-item { padding-left: 27px; border-left: 1px solid var(--border); }
.restart-section { margin-top: 30px; }
.restart-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; border: 1px solid transparent; border-radius: 12px; padding: 15px 18px; background: var(--orange); color: #2b201b; font-size: 16px; font-weight: 650; transition: background .16s, transform .16s, border-color .16s; }
.restart-button:hover:enabled { background: var(--orange-hover); }
.restart-button:active:enabled { transform: translateY(1px); }
.restart-button:disabled { background: #32393f; color: #a4adb5; }
.restart-button[aria-busy="true"] { border-color: #f5a36f55; background: #f5a36f13; color: var(--orange); }
.restart-hint { color: var(--faint); font-size: 12px; text-align: center; margin-top: 12px; }
.feedback { border-radius: 9px; background: #6fd3dd0a; border: 1px solid #6fd3dd26; color: var(--cyan); padding: 11px 13px; margin-top: 18px; font-size: 13px; }
.feedback[data-tone="error"] { background: #ffb0a90a; border-color: #ffb0a92b; color: var(--error); }
.activity-card { display: flex; gap: 15px; margin-top: 16px; padding: 22px 26px; border: 1px solid var(--border); border-radius: 16px; background: #1b202580; }
.activity-icon { width: 29px; height: 29px; margin-top: 3px; border: 1px solid #48535d; border-radius: 50%; position: relative; flex-shrink: 0; }
.activity-icon::before { content: ""; position: absolute; left: 13px; top: 6px; width: 1px; height: 9px; background: #89949d; }
.activity-icon::after { content: ""; position: absolute; left: 13px; top: 14px; width: 6px; height: 1px; background: #89949d; transform: rotate(24deg); transform-origin: left center; }
.activity-content { min-width: 0; }
.activity-card h2 { color: var(--faint); font-size: 12px; font-weight: 400; }
.activity-card p { font-size: 14px; margin-top: 5px; overflow-wrap: anywhere; }
.activity-card time { display: block; color: var(--faint); font-size: 12px; margin-top: 5px; }
.dashboard-footer { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 22px; color: var(--faint); font-size: 11px; text-align: center; }
.connection-indicator { width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #65717b; }
.connection-indicator[data-state="connected"] { background: #86d9bd; }
.connection-indicator[data-state="error"] { background: var(--error); }
.noscript-note { color: var(--error); text-align: center; margin-top: 20px; font-size: 13px; }

.login-main { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 200px); padding: 30px 0 90px; }
.login-card { width: min(100%, 430px); padding: 36px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 22px 70px #0002; }
.login-card h1 { font-size: 29px; margin-top: 16px; letter-spacing: -.7px; }
.login-description { color: var(--muted); margin-top: 12px; font-size: 14px; }
.login-form { margin-top: 28px; }
.login-form label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.login-form input[type="password"] { display: block; width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid #46515a; border-radius: 10px; background: #14191d; color: var(--text); font-size: 16px; }
.login-form input[aria-invalid="true"] { border-color: #ffb0a97a; }
.login-error { color: var(--error); margin-top: 11px; font-size: 13px; }
.login-button { width: 100%; min-height: 49px; padding: 11px 13px; border: 0; border-radius: 10px; background: var(--cyan); color: #11282c; font-weight: 650; margin-top: 20px; transition: background .16s; }
.login-button:hover { background: #8ae5ed; }
.login-footnote { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--faint); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; text-align: center; }

@media (max-width: 600px) {
  .page-shell { width: calc(100% - 32px); }
  .page-header { min-height: 92px; }
  .brand { font-size: 18px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .quiet-button { padding: 8px 13px; }
  .dashboard { margin-top: 20px; }
  .server-card { padding: 24px 21px; border-radius: 18px; }
  .card-heading { gap: 11px; margin-bottom: 22px; }
  .eyebrow { font-size: 10px; letter-spacing: 1.2px; }
  .card-description { max-width: 270px; line-height: 1.6; }
  .server-details { grid-template-columns: 1fr; gap: 21px; padding: 24px 0; margin-top: 24px; }
  .uptime-item { border-left: 0; padding-left: 0; }
  .detail-item dt { margin-bottom: 5px; }
  .restart-section { margin-top: 25px; }
  .restart-button { min-height: 58px; font-size: 15px; }
  .restart-hint { max-width: 260px; margin-right: auto; margin-left: auto; line-height: 1.6; }
  .activity-card { padding: 20px 21px; gap: 13px; }
  .login-main { min-height: calc(100vh - 150px); padding-top: 18px; padding-bottom: 75px; }
  .login-card { padding: 29px 24px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
