:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f6fa;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
main { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 60px; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 6px; color: #2463eb; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.035em; }
.muted, small { color: #687386; }
.login-card { width: min(430px, 100%); margin: 12vh auto 0; padding: 32px; border: 1px solid #dce3ed; border-radius: 22px; background: #fff; box-shadow: 0 18px 60px rgba(24, 39, 75, .11); }
.login-card form { display: grid; gap: 10px; margin-top: 24px; }
label, legend { font-size: 13px; font-weight: 750; color: #39445a; }
input, select, button { font: inherit; }
input, select { width: 100%; border: 1px solid #cbd4e2; border-radius: 10px; padding: 10px 12px; color: inherit; background: #fff; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(36, 99, 235, .25); outline-offset: 1px; border-color: #2463eb; }
button { border: 0; border-radius: 10px; padding: 10px 15px; background: #2463eb; color: #fff; font-weight: 750; cursor: pointer; }
button:hover { filter: brightness(.96); }
button:disabled { opacity: .5; cursor: wait; }
button.secondary { color: #334158; background: #e8edf5; }
button.danger { color: #9c2230; background: #fee8eb; }
.error { min-height: 1.4em; color: #b42335; font-weight: 650; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.status-card { padding: 18px; border: 1px solid #dce3ed; border-radius: 16px; background: #fff; }
.status-card span { display: block; margin-bottom: 7px; color: #687386; font-size: 13px; }
.status-card strong { font-size: 20px; }
.status-card small { display: block; margin-top: 4px; }
.ok { color: #087a55; }
.bad { color: #b42335; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.message { color: #47536a; font-size: 14px; font-weight: 650; }
.warning { margin: 14px 0; padding: 13px 16px; border: 1px solid #f5c76d; border-radius: 12px; color: #7d4d05; background: #fff4d9; }
.sim-list { display: grid; gap: 14px; }
.sim-card { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(210px, 1.25fr) minmax(250px, 1.4fr) minmax(170px, 1fr); gap: 22px; align-items: start; padding: 20px; border: 1px solid #dce3ed; border-radius: 16px; background: #fff; }
.sim-card > * { min-width: 0; }
.sim-name { margin-top: 14px; }
.sim-name-trigger { display: block; padding: 0; border: 0; border-radius: 3px; background: none; color: inherit; font-weight: 650; text-align: left; line-height: 1.45; overflow-wrap: anywhere; text-decoration: underline dotted; text-underline-offset: 4px; }
.sim-name-trigger:hover { background: none; filter: none; text-decoration-style: solid; }
.internet-settings .check { margin-bottom: 12px; }
.internet-settings select { max-width: 320px; font-size: 14px; }
.sim-id strong { display: block; margin-top: 3px; font: 750 18px ui-monospace, SFMono-Regular, Menlo, monospace; }
.sim-id .active-mode { display: inline-block; margin-top: 10px; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #e9f7f1; color: #087a55; }
.sim-id .active-mode.off { background: #fbeaec; color: #a12837; }
.field { display: grid; gap: 7px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.subnet-details { min-width: 0; }
.subnet-details summary { cursor: pointer; list-style: none; color: #39445a; font-size: 13px; font-weight: 750; }
.subnet-details summary::-webkit-details-marker { display: none; }
.subnet-details summary::before { content: '▸'; display: inline-block; width: 18px; color: #2463eb; }
.subnet-details[open] summary::before { content: '▾'; }
.subnet-details summary:focus-visible { outline: 3px solid rgba(36, 99, 235, .25); outline-offset: 3px; border-radius: 4px; }
.subnets { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 7px; min-width: 0; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.check input { width: 15px; height: 15px; margin: 0; }
.schedule { display: grid; grid-template-columns: repeat(2, minmax(0, 116px)); width: max-content; max-width: 100%; gap: 12px; margin-top: 12px; }
.schedule input { min-width: 0; padding: 9px 7px; font-size: 14px; }
.sim-traffic { overflow-wrap: anywhere; }
.weekdays { display: flex; flex-wrap: wrap; gap: 4px; grid-column: 1 / -1; }
.weekday { position: relative; }
.weekday input { position: absolute; opacity: 0; pointer-events: none; }
.weekday span { display: grid; place-items: center; width: 31px; height: 29px; border: 1px solid #cbd4e2; border-radius: 8px; color: #566177; font-size: 12px; font-weight: 800; }
.weekday input:checked + span { border-color: #2463eb; color: #fff; background: #2463eb; }
.sim-traffic { display: grid; gap: 5px; color: #5c677c; font-size: 13px; }
.sim-traffic strong { color: #172033; font-size: 17px; }
.save-row { display: grid; gap: 8px; margin-top: 12px; }
.save-result { min-height: 18px; color: #087a55; font-size: 12px; font-weight: 700; }
.audit-card { min-width: 0; padding: 20px; margin-bottom: 18px; border: 1px solid #dce3ed; border-radius: 16px; background: #fff; }
.audit-card h2 { margin: 0 0 16px; font-size: 22px; }
.audit-card h3 { font-size: 16px; margin: 24px 0 10px; }
.audit-card p { font-size: 13px; line-height: 1.5; }
.audit-card summary { cursor: pointer; font-weight: 700; }
.audit-filters { display: grid; grid-template-columns: minmax(180px, 2fr) 1fr 1fr auto; align-items: end; gap: 12px; }
.audit-presets { display: flex; gap: 8px; margin-top: 12px; }
.audit-presets button { font-size: 12px; padding: 7px 12px; }
.audit-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.audit-metrics article { padding: 16px; border-radius: 12px; background: #f3f6fa; min-width: 0; }
.audit-metrics strong { display: block; font-size: clamp(19px, 3vw, 27px); margin: 6px 0; }
.audit-metrics span { display: block; font-size: 12px; color: #687386; }
.audit-bars { display: grid; gap: 12px; margin: 14px 0; }
.audit-bar { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(70px, 3fr) minmax(100px, 1fr); gap: 12px; align-items: center; font-size: 13px; }
.audit-bar span { overflow-wrap: anywhere; }
.audit-bar meter { width: 100%; height: 16px; }
.audit-bar small { text-align: right; }
.audit-table-scroll { width: 100%; overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.audit-table th, .audit-table td { padding: 12px 10px; border-bottom: 1px solid #dce3ed; vertical-align: top; }
.audit-table th:not(:first-child), .audit-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.audit-table td:first-child { min-width: 220px; overflow-wrap: anywhere; }
.audit-table td small { display: block; margin-top: 4px; }
.audit-table meter { display: block; width: 100%; min-width: 90px; height: 12px; }
.audit-source { margin-top: 18px; font-size: 13px; }
#passkey-login { width: 100%; margin-top: 18px; }
.personal-payments { grid-column: 1 / -1; min-width: 0; border-top: 1px solid #dce3ed; padding-top: 16px; font-size: 13px; }
.personal-payments h2 { margin: 0 0 6px; font-size: 16px; }
.personal-payments p { margin: 9px 0 0; }
.payments-number { font-weight: 650; }
.payments-scroll { overflow-x: auto; margin-top: 12px; }
.personal-payments table { width: 100%; border-collapse: collapse; text-align: left; }
.personal-payments th, .personal-payments td { padding: 9px 12px; border-bottom: 1px solid #dce3ed; }
.personal-payments th:first-child, .personal-payments td:first-child { padding-left: 0; white-space: nowrap; }
.personal-payments th:nth-child(2), .personal-payments td:nth-child(2) { white-space: nowrap; text-align: right; }
@media (max-width: 1180px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .sim-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .audit-filters { grid-template-columns: 1fr 1fr; }
  .audit-filters label:first-child { grid-column: 1 / -1; }
  .audit-filters button { grid-column: 1 / -1; }
  .audit-metrics { grid-template-columns: 1fr; gap: 8px; }
  .audit-bar { grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .audit-bar meter { grid-row: 2; grid-column: 1 / -1; }
  .audit-card { padding: 16px; }
  main { width: min(100% - 20px, 620px); padding-top: 18px; }
  .topbar { align-items: flex-start; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .sim-card { grid-template-columns: 1fr; }
  .sim-card > * { grid-column: auto !important; }
  .subnets { grid-template-columns: 1fr; }
}
@media (prefers-color-scheme: dark) {
  .audit-card { border-color: #303a4d; background: #181f2d; }
  .audit-metrics article { background: #111826; }
  .audit-table th, .audit-table td { border-color: #303a4d; }
  :root { color: #e7ebf3; background: #101521; }
  .login-card, .status-card, .sim-card { border-color: #303a4d; background: #181f2d; box-shadow: none; }
  input, select { color: #edf1f7; border-color: #435069; background: #111826; }
  label, legend { color: #c7cede; }
  .subnet-details summary { color: #c7cede; }
  .muted, small, .status-card span, .sim-traffic { color: #9da8bb; }
  button.secondary { color: #dbe2ee; background: #303a4d; }
  .sim-traffic strong { color: #edf1f7; }
  .weekday span { border-color: #46526a; color: #b8c1d2; }
  .personal-payments, .personal-payments th, .personal-payments td { border-color: #303a4d; }
}
