:root {
  --ink: #16202b; --muted: #5d6876; --faint: #8a94a1; --paper: #f4f5f7; --card: #ffffff; --rule: #dfe3e8;
  --navy: #0b3a6e; --navy-soft: #e6eef8;
  --ok: #1f7a4d; --ok-soft: #e2f3e9; --bad: #b3261e; --bad-soft: #fbe5e3; --run: #a35b00; --run-soft: #fdf0dc; --wait: #3f5873; --wait-soft: #e8edf3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e8ecf0; --muted: #a2adba; --faint: #7b8693; --paper: #11161c; --card: #1a2129; --rule: #2c3540;
    --navy: #8fb9e8; --navy-soft: #172a40; --ok: #5fcf95; --ok-soft: #163225; --bad: #ff8a80; --bad-soft: #3a1714;
    --run: #f0a83a; --run-soft: #3a2a10; --wait: #a9bdd4; --wait-soft: #1d2836; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
a { color: var(--navy); }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--card); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.mark { font-weight: 800; letter-spacing: .14em; color: var(--navy); }
.who { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; background: var(--paper); border-radius: 12px; padding: 4px; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px; font-weight: 600; min-height: 40px; }
.tabs button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.link { border: 0; background: transparent; color: var(--navy); font-weight: 600; min-height: 40px; }

main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-width: 1280px; margin: 0 auto; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.rows > * + * { border-top: 1px solid var(--rule); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; background: transparent; border: 0; text-align: left; color: inherit; }
button.row:hover { background: var(--paper); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { color: var(--muted); font-size: 13px; }
.empty { padding: 22px 16px; color: var(--muted); text-align: center; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.run { background: var(--run-soft); color: var(--run); }
.chip.wait, .chip.muted { background: var(--wait-soft); color: var(--wait); }

.track { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .track { grid-template-columns: minmax(0, 1fr); } }
#map { height: 520px; border-radius: 14px; border: 1px solid var(--rule); background: var(--card); overflow: hidden; }
@media (max-width: 900px) { #map { height: 340px; } }
.nomap { display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); height: 100%; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0; font-size: 20px; }
.back { border: 0; background: transparent; color: var(--navy); font-weight: 600; padding: 0; min-height: 36px; }
.failed { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.failed li { margin: 4px 0; }
.fixed { color: var(--ok); }
.open { color: var(--run); }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--paper); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--paper); }
.tablebox { overflow-x: auto; }
dl.fields { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 6px 16px; margin: 12px 0; }
dl.fields dt { color: var(--muted); }
dl.fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.fields { grid-template-columns: minmax(0, 1fr); } dl.fields dd { margin-bottom: 8px; } }
.correction { border-left: 3px solid var(--run); background: var(--run-soft); padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 8px 0; font-size: 14px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; margin: 14px 0; }
input { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid #a1a1a6; background: var(--card); color: var(--ink); min-height: 46px; }
.primary { width: 100%; border: 0; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 700; min-height: 48px; margin-top: 6px; }
@media (prefers-color-scheme: dark) { .primary { color: #0b1724; } }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.note { color: var(--muted); font-size: 14px; }
@media print { .top, .noprint { display: none !important; } body { background: #fff; } .card { border: 0; } }

/* Phones: the name and Sign out on one row, the tabs full width below. */
@media (max-width: 600px) {
  .brand { order: 1; flex: 1 1 0; min-width: 0; }
  #signout { order: 2; }
  .tabs { order: 3; flex: 1 1 100%; }
  .tabs button { flex: 1; }
}

/* Sign-in, set-password and link screens: Live's sign-in page, value for value
   (admin/src/pages/Login.tsx and its theme in admin/src/index.css). */
:root { --l-page: #f9f9f9; --l-surface: #f7f7f7; --l-text: #1d1d1f; --l-text2: #86868b; --l-text3: #6e6e73;
  --l-border: rgba(0,0,0,0.06); --l-accent: #0071e3; --l-accent-hover: #0077ed; --l-accent-active: #006edb;
  --l-error: #ff3b30; --l-ok: #248a3d; }
@media (prefers-color-scheme: dark) {
  :root { --l-page: #000000; --l-surface: #1c1c1e; --l-text: #f5f5f7; --l-text2: #98989d; --l-text3: #98989d;
    --l-border: #38383a; --l-accent: #0a84ff; --l-accent-hover: #409cff; --l-accent-active: #0071e3; --l-ok: #30d158; }
}
body.authing { background: var(--l-page); }
body.authing main { padding: 0; max-width: none; }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--l-page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif; }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.login-box { width: 100%; max-width: 340px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.login-logo img { height: 44px; width: auto; }
.login-title { text-align: center; font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; color: var(--l-text); margin: 0 0 4px; text-wrap: balance; }
.login-sub { text-align: center; font-size: 14px; color: var(--l-text3); margin: 0 0 32px; text-wrap: balance; }
.login-fields { display: flex; flex-direction: column; gap: 12px; }
.login-input { width: 100%; height: 52px; min-height: 52px; padding: 0 16px; font-size: 17px; color: var(--l-text);
  background: var(--l-surface); border: 1px solid var(--l-border); border-radius: 12px; outline: none;
  transition: border-color .2s, box-shadow .2s; }
.login-input::placeholder { color: var(--l-text2); }
.login-input:focus { border-color: var(--l-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-accent) 20%, transparent); }
.login-pw { position: relative; }
.login-pw .login-input { padding-right: 44px; }
.login-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--l-text2); padding: 0; display: flex; }
.login-eye:hover { color: var(--l-text); }
.login-button { width: 100%; height: 52px; margin-top: 24px; border: 0; border-radius: 12px; background: var(--l-accent);
  color: #fff; font-size: 17px; font-weight: 500; transition: background .2s; }
.login-button:hover { background: var(--l-accent-hover); }
.login-button:active { background: var(--l-accent-active); }
.login-button:disabled { opacity: .4; cursor: not-allowed; }
.login-button:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-accent) 30%, transparent); }
.login-alt { text-align: center; margin: 16px 0 0; }
.login-link { border: 0; background: transparent; color: var(--l-accent); font-size: 14px; padding: 4px; }
.login-link:hover { text-decoration: underline; }
.login-error, .login-ok { margin-bottom: 20px; padding: 12px 16px; border-radius: 12px; font-size: 13px; text-align: center; }
.login-error { color: var(--l-error); background: color-mix(in srgb, var(--l-error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--l-error) 20%, transparent); }
.login-ok { margin: 20px 0 0; color: var(--l-ok); background: color-mix(in srgb, var(--l-ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--l-ok) 20%, transparent); }
.login-rule { height: 1px; background: var(--l-border); margin: 24px 0; }
.login-help { text-align: center; font-size: 12px; color: var(--l-text3); margin: 0; }
.login-help a, .login-foot a { color: var(--l-accent); text-decoration: none; }
.login-help a:hover, .login-foot a:hover { text-decoration: underline; }
.login-foot { padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 12px; color: var(--l-text3); }
.login-foot p { margin: 0; }
.login-foot div { margin-top: 4px; display: flex; justify-content: center; gap: 12px; }
.login-foot div a { color: var(--l-text3); }
.login-foot .sep { color: var(--l-border); }
