:root {
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #142740;
  background: #eef3f8;
  --navy: #101f36;
  --muted: #526680;
  --line: #dce5ee;
  --orange: #f88f2a;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.masthead {
  min-height: 76px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(18px,4vw,48px);
  border-bottom: 3px solid var(--orange);
}
.brand, #profile { display: flex; align-items: center; gap: 12px; }
.brand img { width: 47px; height: 47px; border-radius: 50%; object-fit: cover; }
.brand strong { font-size: 1.55rem; letter-spacing: -.035em; }
.brand strong span { color: #ffae5d; }
#profile { font-size: .85rem; line-height: 1.3; }
#profile small { display: block; color: #b7c9df; }
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #243a58;
  color: #ffb471;
  font-size: 1rem;
  text-transform: uppercase;
}
#workspace { max-width: 1500px; margin: auto; padding: 28px clamp(16px,4vw,48px); }
#workspace.signed-in { display: grid; grid-template-columns: 192px minmax(0,1fr); gap: 26px; }
.workspace-body { min-width: 0; }
nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.signed-in nav {
  flex-direction: column;
  flex-wrap: nowrap;
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 15px;
}
nav button { color: #334b65; background: #edf3f8; text-align: left; }
.signed-in nav button { background: #fff; }
nav button[aria-pressed=true] { background: #e4edf8; color: #0b3c72; box-shadow: inset 3px 0 #2566a3; }
nav button:not([aria-pressed=true]):hover { background: #eef3f8; }
.signed-in nav button[data-view=logout] { margin-top: 9px; border-top: 1px solid var(--line); }
h1, h2, h3, p { margin: 0 0 12px; }
h1 { font-size: clamp(1.55rem,2.6vw,2.1rem); font-weight: 750; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; }
h3 { font-size: 1.02rem; }
p, li { overflow-wrap: anywhere; }
#notice { color: #954312; margin: 0 0 12px; }
#notice:empty { display: none; }
section, article, .summary-card {
  background: white;
  border-radius: 15px;
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px #122c4d08;
  padding: 18px;
  margin-bottom: 14px;
}
.login-panel { max-width: 620px; padding: clamp(18px,4vw,34px); margin: 18px auto; }
.login-panel form { grid-template-columns: 1fr; }
#workspace:not(.signed-in) h1 { max-width: 620px; margin-inline: auto; }
.summary-grid, .grid { display: grid; gap: 12px; }
.summary-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.summary-card { border-top: 3px solid #f3a254; padding: 14px 16px; }
.summary-card small { color: var(--muted); display: block; }
.summary-card strong { font-size: 1.65rem; letter-spacing: -.04em; }
.grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); }
form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); align-items: end; }
label { display: grid; gap: 5px; font-size: .86rem; font-weight: 600; color: #3c536e; }
input, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #bacbdd;
  border-radius: 8px;
  background: #fdfefe;
  padding: 8px 10px;
  color: #162c47;
  font: inherit;
}
button {
  min-height: 40px;
  border-radius: 8px;
  padding: 8px 13px;
  background: #ff9d42;
  color: #1c2b3f;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: #ffae60; }
button:disabled { opacity: .58; cursor: wait; }
:where(button,a,input,select):focus-visible { outline: 3px solid #267abe; outline-offset: 2px; }
a { color: #195c94; }
.status { display: inline-block; background: #e5f0fb; border-radius: 20px; padding: 4px 10px; color: #225480; font-size: .8rem; font-weight: 700; }
article form, details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 650; color: #334e6b; }
.photo { max-width: 100%; max-height: 280px; }
.stack { display: grid; gap: 10px; }
.wide { grid-column: 1/-1; }
.table { overflow: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); }
th { background: #f1f5fa; color: #3d556e; font-size: .82rem; }
.route-stop { display: grid; grid-template-columns: minmax(125px,1fr) minmax(120px,1fr); align-items: center; gap: 8px; }
.route-stop input[type=checkbox] { width: auto; min-height: 0; margin-right: 8px; }
.route-stop label { display: block; }
canvas { max-width: 100%; image-rendering: pixelated; }
.secondary { background: #e5edf7; }
@media (max-width: 800px) {
  #workspace.signed-in { display: block; }
  .signed-in nav { flex-direction: row; flex-wrap: wrap; }
  .signed-in nav button[data-view=logout] { margin: 0; border: 0; }
}
@media (max-width: 520px) {
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #profile strong { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  form { grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); }
}
@media print {
  body.printing * { visibility: hidden; }
  body.printing .print-label, body.printing .print-label * { visibility: visible; }
  body.printing .print-label { position: absolute; left: 0; top: 0; }
}
