:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17243b;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #175cd3;
  --blue-dark: #1248a8;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(201, 222, 255, 0.42), transparent 34rem),
    #f5f7fb;
}

button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(23, 92, 211, 0.28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 24px; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
/* .brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  background: #e6efff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
} */

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: 0.12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 29px); letter-spacing: -0.035em; }
h2 { margin-bottom: 8px; font-size: 22px; letter-spacing: -0.025em; }
.account-bar { display: flex; align-items: center; gap: 14px; margin-left: auto; color: var(--muted); font-size: 14px; }

.panel {
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 40px rgba(28, 47, 81, 0.07);
}
.login-panel { width: min(100%, 480px); margin: 42px auto; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.55; }
form { display: grid; gap: 10px; margin-top: 24px; }
label { color: #34445d; font-size: 13px; font-weight: 650; }
input[type="email"], input[type="password"], select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #17243b;
}
input[type="password"] { margin-bottom: 8px; }
.button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease;
}
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-secondary { border-color: #b7c9e6; background: #f7faff; color: #184a92; white-space: nowrap; }
.button-secondary:hover:not(:disabled) { background: #edf4ff; }
.button-quiet { border-color: var(--line); background: white; color: #34445d; }
.button-quiet:hover:not(:disabled) { background: #f8fafc; }
.status { min-height: 21px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: pre-line; }
.status[data-kind="error"] { color: #b42318; }
.status[data-kind="success"] { color: #087443; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin-bottom: 0; }
.secure-note { color: var(--muted); font-size: 12px; }
.device-controls { display: flex; align-items: end; gap: 10px; margin-top: 24px; }
.port-label { margin: 0 0 12px 8px; white-space: nowrap; }
.device-controls select { flex: 1; min-width: 140px; }
.table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f8fafc; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: #52627a; font-size: 11px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:not(.empty-row):hover { background: #fbfdff; }
td:first-child, th:first-child { width: 52px; text-align: center; }
.table-select-label { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-size: inherit; font-weight: inherit; text-transform: inherit; }
th:last-child, td:last-child { width: 76px; text-align: center; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); vertical-align: middle; }
.empty-row td { padding: 30px 16px; color: var(--muted); text-align: center; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 16px; }
.table-footer .muted { margin: 0; font-size: 12px; }
.notice-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: inherit;
  box-shadow: 0 24px 70px rgba(18, 36, 67, 0.24);
}
.notice-dialog::backdrop { background: rgba(15, 23, 42, 0.42); }
.notice-dialog-content { display: grid; justify-items: center; padding: 30px; text-align: center; }
.notice-dialog-content h2 { margin: 14px 0 8px; }
.notice-dialog-content .muted { margin-bottom: 22px; }
.notice-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #e8f7ef;
  color: #087443;
  font-size: 22px;
  font-weight: 750;
}
.notice-dialog-content .button { min-width: 90px; }
footer { padding: 20px 4px; color: #8390a3; font-size: 11px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1120px); padding-top: 24px; }
  .page-header { flex-wrap: wrap; }
  .account-bar { width: 100%; justify-content: flex-end; }
  .panel { padding: 20px 16px; }
  .device-controls { align-items: stretch; flex-wrap: wrap; }
  .device-controls > * { flex: 1 1 45%; }
  .port-label { align-self: center; margin: 0; }
  .section-heading { align-items: start; flex-direction: column; }
  th, td { padding: 11px 9px; white-space: nowrap; }
}
