:root {
    color-scheme: light;
    font-family: "Inter", system-ui, sans-serif;
    color: #172537;
    background: #eef3f8;
    --ink: #172537;
    --muted: #53657b;
    --border: #dce5ee;
    --accent: #1558b2;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); }
h1 { margin: 0 0 .3rem; font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { margin: 0 0 1rem; font-size: 1.25rem; }
h3 { font-size: 1rem; }
.shell { width: min(1280px, calc(100% - 2rem)); margin: auto; }
main.shell { padding-block: 1.5rem 3rem; }
.topbar { background: #132d48; color: #fff; }
.topbar .shell { min-height: 3.5rem; }
.brand { font-weight: 700; color: #fff; text-decoration: none; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.page-heading { margin: 1rem 0; }
.muted { color: var(--muted); }
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .75rem;
    margin-block: 1rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
}
button, .button {
    display: inline-block;
    padding: .55rem .8rem;
    border: 1px solid var(--accent);
    border-radius: .4rem;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.secondary { border-color: var(--border); background: #f5f8fc; color: var(--ink); }
button:disabled { opacity: .45; cursor: default; }
a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
a:focus-visible, button:focus-visible, video:focus-visible { outline: 3px solid #4486e0; outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); }
th { background: #f4f7fb; color: var(--muted); font-size: .85rem; }
.actions, .range { white-space: nowrap; }
.range { display: flex; flex-wrap: wrap; gap: .5rem; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.chart { border: 1px solid var(--border); border-radius: .55rem; padding: .8rem; min-width: 0; }
.chart h3 { margin: 0 0 .25rem; }
.chart p { margin: .25rem 0; font-size: .85rem; }
.chart canvas { display: block; width: 100%; height: 190px; }
.history { border-top: 1px solid var(--border); padding: .8rem 0; }
.history summary { cursor: pointer; font-weight: 600; }
.history ul { padding-left: 1.25rem; }
.support-view { display: flex; flex-direction: column; min-height: 0; height: 100vh; height: 100dvh; }
.support-view:fullscreen { width: 100%; height: 100%; background: #eef3f8; }
.support-view:fullscreen .support-header { display: none; }
.support-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    min-height: 3.5rem;
    padding: .65rem .9rem;
    overflow-wrap: anywhere;
}
.support-device-name { text-align: right; }
.session-info { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .65rem; color: #dce9f5; font-size: .85rem; text-align: center; }
.support-shell { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: .75rem; gap: .65rem; }
.support-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
#support-fullscreen { margin-inline-start: auto; }
.touch-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-inline-start: auto; }
.touch-actions[hidden] { display: none; }
.touch-actions:not([hidden]) + #support-fullscreen { margin-inline-start: 0; }
.support-video-frame { position: relative; flex: 1; min-height: 0; }
#support-pointer {
    position: absolute; width: 18px; height: 18px; border: 2px solid #fff;
    border-radius: 50%; background: #1558b299; box-shadow: 0 0 0 1px #132d48;
    transform: translate(-50%, -50%); pointer-events: none;
}
#support-video.touch-control { touch-action: none; }
#support-fullscreen-error:empty, #support-transfer-status:empty { display: none; }
#support-video { display: block; height: 100%; width: 100%; object-fit: contain; background: #111b27; border-radius: .4rem; }
.enrollment-form { display: grid; gap: .95rem; margin-top: 1rem; }
.enrollment-form label { display: grid; gap: .25rem; }
.enrollment-form input, .enrollment-form select, #enrollment-code {
    font: inherit; padding: .5rem; border: 1px solid var(--border); border-radius: .35rem;
}
#enrollment-code { width: min(100%, 23rem); font-family: ui-monospace, monospace; }
.device-table td { white-space: nowrap; }
.presence-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: middle; }
.presence-dot.online { background: #15803d; }
.presence-dot.offline { background: #c8243a; }

.dashboard-heading { display: flex; align-items: center; gap: .75rem; }
.dashboard-heading h1 { margin: 0; }
.dashboard-heading > button { margin-left: auto; white-space: nowrap; }
.device-modal {
    width: min(32rem, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 1.35rem;
    border: 1px solid var(--border);
    border-radius: .85rem;
    color: var(--ink);
    box-shadow: 0 1.5rem 4rem #0e223950;
}
.device-modal::backdrop { background: #102236b8; backdrop-filter: blur(3px); }
.device-modal-heading { margin-bottom: 1rem; }
.device-modal-heading h2 { margin: 0; }
.device-modal-close { font-size: 1.25rem; line-height: 1; }
.device-modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.enrollment-form .enrollment-checkbox { display: flex; align-items: center; min-height: 2.2rem; }

.brand-lockup { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; }
.rs-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: .55rem;
    background: #b91f35;
    color: #fff;
    font-weight: 800;
    letter-spacing: -.05em;
}
.app-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.app-nav > a {
    border-radius: .4rem;
    padding: .55rem .75rem;
    color: #e3edf8;
    font-size: .9rem;
    text-decoration: none;
}
.app-nav > a[aria-current="page"], .app-nav > a:hover { background: #244866; color: #fff; }
.app-nav form { margin: 0 0 0 .35rem; }

.login-page {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 4rem);
    background: radial-gradient(ellipse at 15% 20%, #e1edf7, transparent 54%), #eef3f8;
}
.login-card {
    width: min(100%, 900px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.07fr);
    border: 1px solid #d7e2ec;
    border-radius: 1.1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1.25rem 4rem #132d4820;
}
.login-brand {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.6rem, 4vw, 2.8rem);
    overflow: hidden;
    background: linear-gradient(145deg, #132d48, #163a5d);
    color: #fff;
}
.login-brand .rs-mark { width: 2.3rem; height: 2.3rem; }
.login-intro p { margin: 0; }
.login-intro .login-heading {
    margin-bottom: .7rem;
    font-size: clamp(1.55rem, 2.65vw, 2.05rem);
    font-weight: 720;
    letter-spacing: -.045em;
    line-height: 1.12;
}
.login-intro p:last-child { color: #c1d5e8; }
.login-art { display: grid; place-items: center; flex: 1; min-height: 8rem; position: relative; }
.login-art span {
    position: absolute;
    width: min(65%, 15rem);
    height: 6.5rem;
    border-radius: .75rem;
    border: 1px solid #83a9ca65;
    background: #3f71973b;
    transform: rotate(-11deg) translate(-.8rem, -1rem);
}
.login-art span:nth-child(2) { transform: rotate(0) translateY(.2rem); }
.login-art span:nth-child(3) { transform: rotate(10deg) translate(1rem, 1rem); }
.login-form { padding: clamp(1.6rem, 5vw, 3.5rem); }
.login-form h1 { margin-bottom: .35rem; letter-spacing: -.04em; }
.login-form > p { margin: 0 0 1.75rem; }
.login-form form { display: grid; gap: .5rem; }
.login-form label { font-weight: 650; font-size: .9rem; }
.login-form input {
    width: 100%;
    min-height: 2.8rem;
    margin-bottom: .65rem;
    padding: .65rem .8rem;
    color: var(--ink);
    background: #fbfdff;
    border: 1px solid #c7d5e3;
    border-radius: .45rem;
    font: inherit;
}
.login-form input:focus-visible { outline: 3px solid #9bc3f3; outline-offset: 1px; }
.login-form button { margin-top: .5rem; min-height: 2.8rem; }
.login-errors {
    margin-bottom: 1rem;
    padding: .6rem .8rem;
    border: 1px solid #e9c2c8;
    border-radius: .45rem;
    background: #fff3f4;
    color: #8b1830;
}
.login-errors p { margin: .2rem 0; }

.downloads-page > p { margin-top: .45rem; }
.downloads-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.download-card { padding: 1.25rem; border: 1px solid var(--border); border-radius: .75rem; background: #fff; }
.download-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem; margin-bottom: .9rem; }
.download-heading h2 { margin: 0; }
.package-type { border-radius: 100px; padding: .3rem .55rem; font-size: .75rem; font-weight: 650; color: #184d89; background: #e5effb; }
.package-type.only { color: #19634d; background: #e0f3ea; }
.download-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .8rem 0; border-top: 1px solid var(--border); }
.download-row:last-child { padding-bottom: .2rem; }
.package-details { margin-top: .25rem; font-size: .84rem; }
.download-enroll { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.download-enroll h2 { margin-bottom: .35rem; }
.download-enroll p { margin: 0; }

@media (max-width: 660px) {
    .login-card, .downloads-grid { grid-template-columns: 1fr; }
    .login-brand { gap: .8rem; }
    .login-art { display: none; }
    .login-intro .login-heading { font-size: 1.35rem; margin-bottom: .4rem; }
    .login-intro .login-heading br { display: none; }
    .topbar .shell { padding-block: .55rem; }
}

.device-id { display: inline-flex; align-items: center; gap: .55rem; }
.os-icon { display: block; object-fit: contain; }
.site-form { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.site-form label { display: grid; gap: .25rem; flex: 0 1 22rem; }
.site-form input { font: inherit; padding: .5rem; border: 1px solid var(--border); border-radius: .35rem; }
.site-notice { border-color: #a7dac6; background: #effaf4; color: #19634d; }

.portal-footer {
    min-height: 2.5rem; display: flex; justify-content: center; align-items: center;
    gap: .75rem; padding: .35rem .75rem; color: var(--muted); font-size: .8rem;
}
body:has(.login-page) .login-page { min-height: calc(100svh - 2.5rem); }
