:root {
  color-scheme: dark;
  --bg: #071433;
  --surface: #10244f;
  --line: rgba(140, 190, 255, .22);
  --text: #f4f8ff;
  --muted: #a9b8d0;
  --accent: #2ec8ff;
  --accent-2: #7a5cff;
  --danger: #ff5a7d;
  --ok: #3ee0a2;
  font-family: "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 500px at 10% -10%, rgba(46, 200, 255, .18), transparent 50%), var(--bg); color: var(--text); }
header, main { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
header img { height: 54px; width: auto; max-width: min(420px, 70vw); object-fit: contain; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
#providerName { font-size: .95rem; font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; margin: 12px 0; }
.metric { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: rgba(8, 18, 40, .45); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 4px 0; font-size: 1.35rem; }
.metric small { font-size: .75rem; line-height: 1.3; }
.metrics.is-stale { outline: 1px dashed rgba(255, 196, 87, .85); border-radius: 14px; }
.badge-online { background: rgba(62, 224, 162, .18); }
.badge-offline, .badge-stale { background: rgba(255, 196, 87, .16); }
.badge-pending, .badge-revoked { background: rgba(255, 90, 125, .16); }
.devices-wrap { overflow-x: auto; }
.devices-table td, .devices-table th { white-space: nowrap; }
.devices-table td.wrap, .devices-table th.wrap { white-space: normal; }
nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
a, button, input, select { font: inherit; }
nav a, header button { width: auto; flex: 0 0 auto; white-space: nowrap; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 8px 14px; min-height: 44px; text-decoration: none; }
button { border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 8px 14px; min-height: 44px; width: auto; }
button { cursor: pointer; }
button.primary, a.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #071433; border: 0; font-weight: 700; }
button:focus, a:focus, input:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { background: rgba(16, 36, 79, .92); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
h1, h2 { margin: 0 0 8px; }
p, .muted { color: var(--muted); }
label { display: grid; gap: 6px; margin: 10px 0; }
input, select { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #091833; color: var(--text); padding: 12px; }
.error { color: #ffd0da; background: rgba(255, 90, 125, .15); padding: 10px 12px; border-radius: 12px; }
.banner { border: 1px solid rgba(255, 196, 87, .5); background: rgba(255, 196, 87, .1); color: #ffe7b0; padding: 12px; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.tabs button[aria-selected="true"] { border-color: var(--accent); }
.lang { display: inline-flex; align-items: center; gap: 8px; width: auto; flex: 0 0 auto; min-width: 0; color: var(--muted); }
.lang select { width: auto; min-width: 9.2rem; max-width: 12rem; margin: 0; color-scheme: dark; }
.row button, .tabs button { width: auto; flex: 0 0 auto; }
.notice { margin: 28px 0 40px; }
.notice h2 { font-size: 1.15rem; letter-spacing: .02em; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 10, 24, .72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.modal h2 { font-size: 1.2rem; }
.site-foot { width: min(1100px, calc(100% - 32px)); margin: 12px auto 32px; }
.list { display: grid; gap: 12px; }
.list article { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(46, 200, 255, .15); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; justify-content: flex-end; }
.zion-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(4, 10, 24, .72); padding: 24px; }
.zion-modal-card { width: min(560px, 100%); background: #10244f; color: #f4f8ff; border: 1px solid rgba(46, 200, 255, .35); border-radius: 18px; padding: 22px; }
.zion-modal-card h2 { margin-top: 0; }
.drawer { width: min(440px, 100%); height: 100%; overflow: auto; background: #0d1d40; padding: 22px; box-shadow: -20px 0 50px rgba(0, 0, 0, .35); }
.field-error { color: #ffd0da; font-size: .92rem; }
button:disabled { opacity: .6; cursor: progress; }
@media (max-width: 720px) {
  header { align-items: flex-start; flex-direction: column; }
  nav a { white-space: normal; }
  table { display: block; overflow-x: auto; }
  .drawer { width: 100%; }
  .plan-card { flex-basis: 100%; }
}
.plan-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.plan-card { min-width: 180px; flex: 1 0 180px; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 14px; background: rgba(8,16,20,.72); }
.plan-card.is-current { outline: 2px solid #7d5cff; }
.plan-price { font-size: 1.2rem; font-weight: 700; }
.device-row { border-top: 1px solid rgba(255,255,255,.08); padding: 8px 0; }
