/* Shared visual layer, loaded after the original console styles. */
:root {
  --bg:#f3f6fb;
  --surface:#fff;
  --surface-2:#f7f9fc;
  --ink:#17263a;
  --ink-2:#53647a;
  --ink-3:#687b92;
  --line:#dce4ef;
  --line-2:#eaf0f6;
  --accent:#1767d6;
  --accent-2:#eaf2ff;
  --accent-ink:#fff;
  --f-display:var(--f-body);
  --page-gutter:clamp(16px,1.7vw,36px);
  --panel-shadow:0 3px 14px #16365c06;
  --brand-wordmark-filter:brightness(0);
  --mono:var(--f-mono);
  color-scheme:light;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg:#0d1420;--surface:#141f2e;--surface-2:#192638;
    --ink:#e8eef7;--ink-2:#afbdd0;--ink-3:#8c9fb8;
    --line:#2d3d53;--line-2:#223247;
    --accent:#80b9ff;--accent-2:#1c3554;--accent-ink:#0c2039;
    --panel-shadow:0 3px 18px #0000000d;--brand-wordmark-filter:none;
    color-scheme:dark;
  }
}
:root[data-theme="dark"] {
  --bg:#0d1420;--surface:#141f2e;--surface-2:#192638;
  --ink:#e8eef7;--ink-2:#afbdd0;--ink-3:#8c9fb8;
  --line:#2d3d53;--line-2:#223247;
  --accent:#80b9ff;--accent-2:#1c3554;--accent-ink:#0c2039;
  --panel-shadow:0 3px 18px #0000000d;--brand-wordmark-filter:none;
  color-scheme:dark;
}
html {scroll-padding-top:230px;scrollbar-color:var(--line) transparent;}
body {min-width:0;min-height:100dvh;line-height:1.55;-webkit-font-smoothing:antialiased;}
a {color:var(--accent);}
button,input,select,textarea {transition:border-color .15s,background-color .15s,box-shadow .15s;}
:focus-visible {outline:3px solid var(--accent);outline-offset:3px;}
.skip-link {position:fixed;top:8px;left:16px;z-index:100;padding:10px 16px;background:var(--surface);border-radius:8px;transform:translateY(-160%);}
.skip-link:focus {transform:none;}

/* The application uses the whole viewport, with one consistent page gutter. */
.top {box-shadow:0 2px 12px #00000005;}
.topin,main,.nav,.sitefoot,body #tour,.workspace-banner {max-width:none;width:100%;}
.topin {flex-wrap:nowrap;gap:24px;padding:16px var(--page-gutter);min-height:78px;}
.brand {gap:16px;text-decoration:none;color:var(--ink);flex-shrink:0;}
.brand-logo {position:relative;display:block;width:122px;height:38px;flex:0 0 122px;}
.brand-logo img {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;}
.brand-logo .brand-wordmark {clip-path:inset(0 0 0 33%);filter:var(--brand-wordmark-filter);}
.brand-divider {width:1px;height:30px;background:var(--line);}
.brand b {font-family:var(--f-body);font-size:24px;letter-spacing:.035em;font-weight:600;line-height:1;}
.header-context {border-left:1px solid var(--line);padding-left:24px;min-width:0;display:flex;flex-direction:column;gap:2px;}
.header-company {font-size:12px;font-weight:600;overflow-wrap:anywhere;}
.header-context .period {display:block;padding:0;border:0;font:12px var(--f-body);color:var(--ink-3);}
#account-controls {margin-left:auto;min-width:0;}
#account-controls:empty,.workspace-toolbar:empty,.nav:empty {display:none;}
.account-identity {flex-wrap:nowrap;gap:12px;}
.account-avatar {width:36px;height:36px;flex-shrink:0;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:var(--accent-2);color:var(--accent);font-size:12px;font-weight:600;}
.account-person {display:flex;flex-direction:column;min-width:0;line-height:1.4;}
.account-person strong {max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;}
.account-role {font-size:11px;}
.account-actions {display:flex;gap:6px;margin-left:6px;flex-shrink:0;}
.account-actions .btn {font-size:12px;}
.workspace-toolbar {padding:12px var(--page-gutter);gap:12px 16px;align-items:flex-end;background:var(--surface-2);border-block:1px solid var(--line-2);}
.toolbar-field {display:flex;flex-direction:column;gap:5px;min-width:150px;max-width:100%;}
.toolbar-field label,.who label {display:block;font-size:10px;line-height:1.2;font-weight:600;letter-spacing:.08em;color:var(--ink-3);}
.toolbar-field select {width:100%;min-height:36px;padding:6px 30px 6px 10px;font-size:12px;border-radius:7px;}
.toolbar-role {min-width:210px;}
.toolbar-actions {display:flex;gap:8px;margin-left:auto;flex-wrap:wrap;}
.toolbar-actions .btn {min-height:36px;padding-inline:14px;}
.nav {flex-wrap:wrap;gap:3px;padding:8px var(--page-gutter);overflow:visible;}
.nav button {font-size:12px;line-height:1.4;min-height:35px;padding:8px 11px;border:0;border-radius:7px;}
.nav button:hover {background:var(--surface-2);}
.nav button[aria-current="page"] {color:var(--accent);background:var(--accent-2);box-shadow:inset 0 -2px var(--accent);}
.nav .badge {font-size:10px;line-height:16px;min-width:16px;padding-inline:4px;margin-left:5px;}
.navmore {font-size:11px!important;}
body #tour {padding:0 var(--page-gutter);}
.workspace-banner {margin:18px 0 0;padding:10px 14px;border-radius:8px;font-size:12px;line-height:1.6;color:var(--ink-2);background:var(--surface);border-color:var(--line-2);}
.workspace-banner::before {content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin:0 9px 1px 0;}
.workspace-banner.error {color:var(--block);border-color:var(--block);background:var(--block-bg);}
main {padding:26px var(--page-gutter) 48px;gap:22px;}
main:focus {outline:none;}
.sitefoot {padding:0 var(--page-gutter) 24px;justify-content:space-between;font-size:11px;gap:8px 20px;}
.sitefoot b {font-weight:600;color:var(--ink-2);}

/* Clear hierarchy and consistent working surfaces. */
h1 {font-size:clamp(25px,2vw,32px);font-weight:600;letter-spacing:-.035em;line-height:1.2;}
h2 {font-size:16px;line-height:1.4;letter-spacing:-.015em;text-transform:none;font-weight:600;}
h3 {font-size:14px;font-weight:600;letter-spacing:0;}
.eyebrow {font-size:10px;letter-spacing:.11em;margin-bottom:7px;}
.sub {font-size:13px;line-height:1.7;margin-top:8px;max-width:100ch;}
.user-heading {gap:18px 24px;align-items:center;margin-bottom:2px;}
.user-heading>div:first-child {flex:1;min-width:min(100%,320px);}
.panel,.stn {border-radius:12px;box-shadow:var(--panel-shadow);}
.ph {padding:16px 20px;gap:10px 16px;min-height:60px;}
.panel>.ph:first-child {border-radius:12px 12px 0 0;}
.pb {padding:20px;}
.pb>p:first-child {margin-top:0;}
.pb>p:last-child {margin-bottom:0;}
.panel>.tw:last-child {border-radius:0 0 12px 12px;}
.panel>.pb:last-child {border-radius:0 0 12px 12px;}
.grid2 {grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
.kpis {background:transparent;border:0;border-radius:0;gap:14px;overflow:visible;grid-template-columns:repeat(auto-fit,minmax(min(100%,165px),1fr));}
.kpis:has(>.kpi:nth-child(6):last-child) {grid-template-columns:repeat(6,minmax(0,1fr));}
.kpi {border:1px solid var(--line);border-radius:12px;padding:20px;box-shadow:var(--panel-shadow);}
.kpi .v {font-size:34px;letter-spacing:-.04em;line-height:1.15;font-weight:600;}
.kpi .k {font-size:12px;margin-top:8px;line-height:1.5;}
.panel>.kpis {gap:0;}
.panel>.kpis>.kpi {border:0;border-right:1px solid var(--line-2);border-radius:0;box-shadow:none;padding:18px 20px;}
.panel>.kpis>.kpi:last-child {border-right:0;}
.stations {gap:18px;}
.stations:has(>.stn:nth-child(4):last-child) {grid-template-columns:repeat(4,minmax(0,1fr));}
.stn {padding:20px;gap:16px;}
.stn .code {font-size:30px;letter-spacing:-.035em;line-height:1.1;}
.stn .meta b {font-size:23px;letter-spacing:-.025em;}
.stn .meta span {font-size:11px;}
.btn {min-height:36px;padding:8px 13px;border-radius:7px;justify-content:center;font-size:12px;font-weight:500;line-height:1.3;}
.btn:hover:not(:disabled) {border-color:var(--accent);box-shadow:0 2px 5px #00000008;}
.btn.sm {min-height:30px;padding:5px 10px;font-size:11px;}
.btn.pri {box-shadow:0 2px 4px #1259b214;}
.workspace-actions {gap:8px;min-width:0;}
.workspace-actions label {display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--ink-2);}
select,input:not([type="checkbox"]):not([type="radio"]),textarea {min-height:36px;border-radius:7px;padding:7px 10px;max-width:100%;}
select:focus,input:focus,textarea:focus {border-color:var(--accent);}
.workspace-actions select {min-width:120px;max-width:100%;font-size:12px;}
.account-form .fields {gap:18px;}
.account-form label,.user-filters label {font-size:12px;gap:7px;}
.account-form input,.account-form select,.user-filters input,.user-filters select {min-height:42px;border-radius:8px;padding:10px 12px;}
.account-form input[readonly] {color:var(--ink-2);}
.account-form .help,.help {font-size:12px;line-height:1.65;}
.workspace-form fieldset {border-radius:9px;padding:16px;}
#workspace-dialog,#account-dialog,.mbox {border-radius:16px;padding:28px;box-shadow:0 20px 70px #00000035;}
#workspace-dialog h2,#account-dialog h2 {font-size:23px;letter-spacing:-.03em;}
#workspace-dialog::backdrop,#account-dialog::backdrop {background:#08122199;backdrop-filter:blur(3px);}
#workspace-dialog textarea {border-radius:8px;}
.form-error {border:1px solid color-mix(in srgb,var(--block),transparent 65%);border-radius:8px;line-height:1.6;}
details>summary {cursor:pointer;font-size:12px;color:var(--ink-2);font-weight:500;}
details[open]>summary {margin-bottom:12px;}
.setup-issues {padding-top:4px;}
.note {border-radius:9px;padding:13px 16px;line-height:1.65;}
.pill {font-size:10px;padding:4px 8px;}
.sev {font-size:10px;line-height:1.5;padding:3px 7px;border-radius:5px;display:inline-block;}
.chip {font-size:10px;padding:3px 7px;border-radius:5px;}
.foot {font-size:11px;line-height:1.65;}
.seg {max-width:100%;overflow-x:auto;border-radius:8px;flex-shrink:0;}
.seg button {font:600 12px var(--f-body);padding:9px 14px;white-space:nowrap;min-height:36px;}
.steps {gap:6px;}
.steps li {padding:5px 12px 5px 7px;font-size:11px;}
.steps li::before {width:22px;height:22px;}

/* Data stays dense enough to scan; tables scroll within their own panel. */
.tw,.gw {max-width:100%;scrollbar-width:thin;scrollbar-color:var(--line) transparent;}
table.t {font-size:12px;line-height:1.6;}
table.t th {padding:11px 16px;font-size:10px;letter-spacing:.075em;background:var(--surface-2);color:var(--ink-2);}
table.t td {padding:12px 16px;vertical-align:middle;}
table.t tbody tr:hover>td {background:color-mix(in srgb,var(--accent-2),transparent 65%);}
table.t tr.sel>td {background:var(--accent-2);}
.user-table {min-width:880px;}
.user-table .user-actions {gap:6px;}
.user-filters {padding:18px 20px;gap:14px;}
.user-caption {padding:12px 20px;}
.gw {max-height:72vh;}
table.g {width:100%;min-width:calc(var(--roster-days,31)*35px + 400px);table-layout:fixed;}
table.g thead th {padding:8px 0;font-size:10px;min-width:34px;}
table.g .nm {width:220px;min-width:220px;max-width:220px;padding:7px 14px;}
table.g .nm .n {font-size:12px;}
table.g .nm .x {font-size:10px;}
table.g .tot {width:60px;min-width:60px;font-size:11px;}
.cell {width:100%;min-width:34px;height:36px;font-size:11px;}
.cv {width:100%;min-width:34px;height:30px;font-size:10px;}
.legend {padding:13px 20px;font-size:11px;gap:8px 16px;}
.legend i {width:14px;height:14px;}
.fl li {padding:14px 20px;gap:6px 12px;}
.fl .w {font-size:11px;}
.fl .m {font-size:12px;}
.crew li {padding:10px 18px;}
.empty {padding:36px 20px;}
#menu {border-radius:10px;padding:7px;box-shadow:0 12px 35px #00000026;}
#menu button {padding:9px 10px;border-radius:6px;}
#toast {border-radius:10px;padding:12px 18px;}

/* Engineer access is a responsive workspace rather than a fixed phone mock-up. */
.phone-wrap {align-items:stretch;gap:16px;}
.phone {width:100%;border:1px solid var(--line);border-radius:14px;box-shadow:var(--panel-shadow);background:var(--surface);}
.ph-head {padding:24px;background:var(--surface-2);color:var(--ink);border-bottom:1px solid var(--line-2);}
.ph-head b {font-size:24px;letter-spacing:-.025em;margin-top:6px;}
.ph-head span {color:var(--ink-2);opacity:1;font-size:12px;}
.ph-tabs {display:flex;gap:4px;padding:8px 16px;}
.ph-tabs button {padding:10px 24px;font-size:12px;border:0;border-radius:7px;}
.ph-tabs button[aria-current="page"] {background:var(--accent-2);box-shadow:inset 0 -2px var(--accent);}
.ph-body {padding:20px;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));align-items:start;gap:18px;height:auto;overflow:visible;}
.ph-body .card:only-child {grid-column:1/-1;}
.card {padding:20px;border-radius:10px;gap:10px;min-width:0;background:var(--surface);}
.card h3 {font-size:12px;letter-spacing:.03em;}
.big {font-size:30px;letter-spacing:-.035em;}
.phone-wrap>p.foot {max-width:none!important;text-align:left!important;margin:0;}
.dl {display:grid;grid-template-columns:repeat(auto-fit,minmax(225px,1fr));gap:0 24px;margin-top:6px;}
.dl li {grid-template-columns:56px 1fr auto;gap:8px;padding:12px 4px;}
.frm {gap:12px;}
.frm label {gap:6px;}
.nt li {padding:12px 0;}
.nt time {font-size:10px;margin-bottom:4px;}

/* The sign-in form stays readable while the surrounding layout fills the page. */
body[data-screen="auth"] .top {position:relative;}
body[data-screen="auth"] .header-context {display:none;}
body[data-screen="auth"] main {min-height:calc(100dvh - 142px);justify-content:center;}
.auth-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,460px);gap:clamp(40px,8vw,160px);align-items:center;width:100%;padding:36px clamp(0px,4vw,80px);}
.auth-story {max-width:660px;}
.auth-story .eyebrow {color:var(--accent);margin-bottom:20px;}
.auth-story h2 {font-size:clamp(34px,3.5vw,58px);font-weight:600;letter-spacing:-.055em;line-height:1.12;}
.auth-story h2 span {color:var(--accent);}
.auth-story>p {max-width:44ch;color:var(--ink-2);font-size:15px;line-height:1.75;margin:22px 0 28px;}
.auth-workflow {display:flex;flex-direction:column;gap:18px;list-style:none;margin:0;padding:0;}
.auth-workflow li {display:flex;align-items:center;gap:14px;}
.auth-workflow li>span {width:34px;height:34px;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;color:var(--accent);background:var(--surface);font:11px var(--f-mono);}
.auth-workflow b {font-size:12px;font-weight:600;display:block;}
.auth-workflow small {font-size:12px;color:var(--ink-3);display:block;margin-top:3px;}
.auth-panel {width:100%;max-width:460px;padding:34px;margin:32px auto;border-radius:16px;box-shadow:0 12px 45px #16365c09;}
.auth-layout .auth-panel {margin:0;}
.auth-panel h1 {font-size:27px;margin:10px 0;}
.auth-panel .sub {font-size:13px;margin-bottom:28px;}
.auth-panel .account-form {gap:20px;}
.auth-panel .account-form input {min-height:46px;}
.auth-panel .btn.pri {min-height:44px;font-size:13px;margin-top:4px;}
.auth-note {border-top:1px solid var(--line-2);margin-top:24px;padding-top:20px;text-align:center;color:var(--ink-3);font-size:11px;}

@media(min-width:1800px) {
  .kpis {gap:18px;}
  .kpi {padding:24px;}
  .nav button {padding-inline:14px;}
}
@media(max-width:1350px) {
  .stations:has(>.stn:nth-child(4):last-child) {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:1200px) {
  .kpis:has(>.kpi:nth-child(6):last-child) {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:1100px) {
  .header-context {display:none;}
  .topin {gap:18px;}
  .auth-layout {gap:44px;padding-inline:16px;}
  .grid2 {grid-template-columns:1fr;}
}
@media(max-width:760px) {
  html {scroll-padding-top:16px;}
  .top {position:relative;}
  .topin {flex-wrap:wrap;padding-block:16px;gap:16px;}
  #account-controls {width:100%;margin:0;}
  .account-identity {width:100%;gap:10px;}
  .account-person {flex:1;}
  .account-person strong {max-width:none;font-size:12px;white-space:normal;}
  .account-role {font-size:10px;}
  .account-actions {gap:6px;margin:0;}
  .account-actions .btn {font-size:10px;padding:7px 9px;min-height:36px;}
  .workspace-toolbar {gap:12px;padding-block:14px;}
  .toolbar-field,.toolbar-role {flex:1 1 140px;min-width:0;}
  .toolbar-field select {font-size:12px;min-height:40px;}
  .toolbar-actions {flex:1 1 100%;margin-left:0;}
  .toolbar-actions .btn {flex:1;min-height:40px;}
  .nav {flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;padding-block:8px;}
  .nav button {min-height:40px;font-size:12px;padding-inline:14px;flex-shrink:0;}
  .navmore {margin-left:4px;}
  main {padding-top:22px;gap:18px;}
  h1 {font-size:26px;}
  .user-heading {align-items:flex-start;}
  .user-heading>.workspace-actions {width:100%;}
  .kpis {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .kpis:has(>.kpi:nth-child(6):last-child) {grid-template-columns:repeat(2,minmax(0,1fr));}
  .stations:has(>.stn:nth-child(4):last-child) {grid-template-columns:1fr;}
  .kpi {padding:16px;}
  .kpi .v {font-size:28px;}
  .kpi .k {font-size:11px;}
  .ph {padding:15px 16px;}
  .pb,.stn {padding:16px;}
  .btn {min-height:40px;}
  .btn.sm {min-height:34px;}
  .workspace-actions {align-items:stretch;}
  .workspace-actions .btn {min-height:40px;white-space:normal;text-align:center;}
  .workspace-actions label {flex:1 1 140px;min-width:0;}
  .workspace-actions select {min-width:0;width:100%;}
  table.t td,table.t th {padding:11px 13px;}
  table.t th {font-size:9px;}
  table.g .nm {width:180px;min-width:180px;max-width:180px;}
  table.g {min-width:calc(var(--roster-days,31)*35px + 360px);}
  .ph-head {padding:20px;}
  .ph-tabs {padding:8px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));}
  .ph-tabs button {padding:10px 6px;min-height:42px;}
  .ph-body {padding:14px;grid-template-columns:1fr;}
  .card {padding:16px;}
  .dl {grid-template-columns:1fr;}
  .sitefoot {flex-direction:column;gap:5px;}
  body[data-screen="auth"] main {justify-content:flex-start;}
  .auth-layout {grid-template-columns:1fr;gap:28px;padding:12px 0 24px;}
  .auth-story {max-width:none;}
  .auth-story h2 {font-size:32px;}
  .auth-story h2 br {display:none;}
  .auth-story>p {font-size:13px;margin:14px 0 0;max-width:48ch;}
  .auth-story .eyebrow {margin-bottom:12px;}
  .auth-workflow {display:none;}
  .auth-layout .auth-panel {max-width:none;padding:24px;}
}
@media(max-width:400px) {
  .account-avatar {display:none;}
  .account-actions .btn {padding-inline:7px;}
  .account-role {max-width:145px;}
  .brand-logo {width:112px;height:35px;flex-basis:112px;}
  .brand {gap:14px;}
}
@media print {
  .skip-link,.auth-story {display:none!important;}
  .panel,.stn,.kpi {box-shadow:none;}
  main {width:100%;max-width:none;}
  table.g {min-width:0;font-size:9px;}
  table.g .nm {width:130px;min-width:130px;max-width:130px;}
  .cell,.cv {min-width:0;height:24px;font-size:9px;}
}
