:root {
  --navy: #12356a;
  --navy-2: #0d274d;
  --blue: #1e4f8c;
  --blue-mid: #2a63ad;
  --sky: #e7eef8;
  --sky-2: #f3f6fb;
  --line: #c9d3e3;
  --ink: #152033;
  --muted: #5c6b82;
  --paper: #f7f4ec;
  --white: #ffffff;
  --ok: #157a45;
  --ot: #b45309;
  --dt: #9f1239;
  --danger: #b42318;
  --shadow: 0 8px 24px rgba(18, 53, 106, 0.08);
  --radius: 16px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--sky-2);
  line-height: 1.35;
  min-height: 100dvh;
}

img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
  padding: calc(14px + var(--safe-top)) 18px 14px;
  box-shadow: 0 2px 10px rgba(13, 39, 77, 0.28);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: #000;
  padding: 4px 8px;
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.06em;
  font-weight: 800;
}
.brand-text span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.82;
  text-transform: uppercase;
}
.header-title {
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

main { padding: 16px 14px calc(28px + var(--safe-bot)); max-width: 720px; margin: 0 auto; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

.crew-grid {
  display: grid;
  gap: 10px;
}
.crew-btn {
  min-height: var(--tap);
  border: 1.5px solid var(--line);
  background: var(--sky-2);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  font-size: 17px;
  font-weight: 650;
  color: var(--navy);
  transition: 0.15s ease;
}
.crew-btn.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 6px 16px rgba(18, 53, 106, 0.25);
}

.period {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
label.field input, label.field select {
  min-height: var(--tap);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font-size: 16px;
}

.week-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.day {
  margin-bottom: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.day-head {
  width: 100%;
  min-height: 56px;
  border: 0;
  background: var(--sky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  text-align: left;
}
.day-head strong { font-size: 17px; color: var(--navy); display: block; }
.day-head em { font-style: normal; font-size: 13px; color: var(--muted); }
.day-head .hours-chip {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--line);
}
.day-body { padding: 12px; display: none; }
.day.open .day-body { display: block; }
.day.open .day-head { background: #d9e5f5; }

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.time-grid.full { grid-template-columns: 1fr; margin-top: 10px; }

input[type="time"], input[type="text"], input[type="date"] {
  min-height: var(--tap);
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  font-size: 16px;
}
input[type="time"] { min-height: 52px; }

.hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.hint button, .linkish {
  background: none;
  border: 0;
  color: var(--blue-mid);
  font-size: 13px;
  font-weight: 650;
  padding: 8px 0;
  min-height: 36px;
}

.pay-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.pay-box {
  background: var(--sky-2);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--line);
}
.pay-box b { display: block; font-size: 18px; }
.pay-box span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.pay-box.reg b { color: var(--ok); }
.pay-box.ot b { color: var(--ot); }
.pay-box.dt b { color: var(--dt); }

.totals {
  position: sticky;
  bottom: calc(8px + var(--safe-bot));
  z-index: 15;
  background: var(--navy);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  box-shadow: 0 10px 24px rgba(13, 39, 77, 0.28);
}
.totals div { text-align: center; }
.totals b { display: block; font-size: 17px; }
.totals span { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.8; }

.cert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}
.cert:first-of-type { border-top: 0; }
.cert input {
  width: 26px;
  height: 26px;
  margin-top: 2px;
  flex: 0 0 26px;
  accent-color: var(--navy);
}
.cert p { margin: 0; font-size: 15px; }
.cert small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }

.sign-wrap {
  border: 1.5px dashed var(--blue-mid);
  border-radius: 12px;
  background: repeating-linear-gradient(0deg, #fff, #fff 27px, #edf2f8 28px);
  overflow: hidden;
}
#sig {
  width: 100%;
  height: 160px;
  display: block;
  touch-action: none;
}
.sign-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.ghost {
  min-height: 44px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 650;
  color: var(--navy);
}

.req {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4f2;
  color: var(--danger);
  font-size: 14px;
  border: 1px solid #f0c7c1;
}
.req.ok { background: #eef8f2; color: var(--ok); border-color: #b9e0c8; }

.submit {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 18px;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(18, 53, 106, 0.25);
}
.submit:disabled { opacity: 0.45; box-shadow: none; }

.sheet-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #d8d2c4;
  border-radius: 12px;
  padding: 10px;
}
.sheet {
  width: 980px;
  min-height: 680px;
  background: #fff;
  color: #111;
  padding: 22px 24px 18px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}
.sheet-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet-top .logo { height: 44px; width: auto; max-width: 240px; background:#000; padding:4px 8px; }
.sheet-co { font-size: 18px; font-weight: 800; color: var(--navy); letter-spacing: 0.02em; line-height: 1.1; }
.sheet-co small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }
.sheet h1 {
  font-size: 20px;
  margin: 6px 0 12px;
  text-decoration: underline;
}
.meta-box {
  width: 320px;
  border: 1.5px solid #222;
  margin-bottom: 12px;
}
.meta-box div {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid #222;
  min-height: 28px;
}
.meta-box div:first-child { border-top: 0; }
.meta-box b { width: 132px; flex: 0 0 132px; }
.grid {
  width: 100%;
  border-collapse: collapse;
}
.grid th, .grid td {
  border: 1.5px solid #222;
  padding: 5px 4px;
  text-align: center;
  height: 32px;
}
.grid th { background: #f3f6fb; font-size: 11px; }
.grid td.dayname { text-align: left; padding-left: 8px; font-weight: 700; width: 92px; }
.certs-print { margin-top: 16px; }
.certs-print p { margin: 0 0 8px; }
.certs-print small { color: #444; }
.sig-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 24px;
  margin-top: 22px;
}
.sig-line { border-bottom: 1.5px solid #222; min-height: 54px; display: flex; align-items: flex-end; }
.sig-line img { max-height: 50px; width: auto; }
.sig-lab { margin-top: 4px; font-size: 11px; }

.toolbar { display: flex; gap: 10px; margin: 12px 0; }
.toolbar button { flex: 1; }

.status {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}
.status.warn { background: #fff7e8; border: 1px solid #ecd7a6; color: #8a5a00; }
.status.good { background: #eef8f2; border: 1px solid #b9e0c8; color: var(--ok); }

.past { font-size: 14px; }
.past button {
  width: 100%;
  text-align: left;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--sky-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.pdf-actions { margin-bottom: 12px; }
.pdf-actions .submit { flex: 1.2; }

.totals { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) {
  .totals { grid-template-columns: repeat(6, 1fr); }
}
.agree-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7e8;
  border: 1.5px solid #ecd7a6;
  color: #5c3b00;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.35;
}
.agree-banner.ok { background: #eef8f2; border-color: #b9e0c8; color: #157a45; }
.agree-banner.warn { background: #fff4f2; border-color: #f0c7c1; color: #9f1239; }
.agree-banner.hybrid {
  background: #fff7e8;
  border-color: #e8c36a;
  color: #8a5a00;
}
.hint.hybrid-expired { color: #8a5a00; font-weight: 650; }
.stub-body { font-size: 14px; }
.stub-body table { width: 100%; border-collapse: collapse; }
.stub-body td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.stub-body td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 650;
}
.check-row input { width: 22px; height: 22px; accent-color: var(--navy); }
.travel-box {
  margin-top: 12px;
  padding: 10px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--sky-2);
}
.travel-box h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

.no-travel-btn {
  width: 100%;
  min-height: 56px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.no-travel-btn.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  box-shadow: 0 6px 16px rgba(21, 122, 69, 0.25);
}
.no-travel-btn .sub {
  display: block;
  font-size: 12px;
  font-weight: 650;
  opacity: 0.9;
  margin-top: 2px;
  letter-spacing: 0;
}
.dest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 10px;
}
.dest-btn {
  min-height: 48px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: left;
  line-height: 1.2;
}
.dest-btn small {
  display: block;
  font-weight: 550;
  color: var(--muted);
  font-size: 11px;
}
.dest-btn.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.dest-btn.selected small { color: rgba(255,255,255,0.85); }
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0 10px;
}
.mode-btn {
  min-height: 44px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
}
.maps-route {
  margin: 8px 0 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
.maps-route b { color: var(--navy); }
.maps-route .route-job { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.fromjob-wrap { margin-top: 8px; }

.ride-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 4px;
}
.ride-grid .dest-btn {
  min-height: 48px;
  padding: 8px 6px;
  font-size: 12px;
  text-align: center;
}


/* Live-away / per diem */
.away-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #f7fafc;
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
}
.away-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--navy);
}
.day.away .day-head {
  background: #efe6c8;
}
.day.away .hours-chip {
  border-color: #c9a227;
}
#subsistence-mode .crew-btn small {
  margin-top: 2px;
}
.totals > div:last-child b {
  font-size: 15px;
}

.stub-section {
  padding-top: 12px !important;
  font-weight: 800;
  color: var(--navy);
  border-bottom: none !important;
}
#home-return-warn .edit-lunch-btn {
  width: 100%;
  max-width: 320px;
}
.office-contact a { color: var(--navy); text-decoration: underline; }

.premium-hint {
  margin: 6px 0 0;
  color: var(--dt, #9b1c3a);
  font-weight: 700;
  font-size: 12px;
}
.premium-hint[hidden] { display: none !important; }

.shift-row {
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shift-seg {
  display: inline-flex;
  border: 1.5px solid var(--navy, #0b2a4a);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.shift-btn {
  appearance: none;
  border: 0;
  background: #fff;
  color: var(--navy, #0b2a4a);
  font: inherit;
  font-weight: 700;
  padding: 8px 18px;
  cursor: pointer;
  min-width: 72px;
}
.shift-btn + .shift-btn {
  border-left: 1.5px solid var(--navy, #0b2a4a);
}
.shift-btn.selected {
  background: var(--navy, #0b2a4a);
  color: #fff;
}
.shift-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
}
.shift-notice input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.shift-hint {
  margin: 0;
  color: var(--muted, #555);
  font-size: 12px;
}
.shift-nudge {
  margin: 0;
  color: var(--dt, #9b1c3a);
  font-weight: 700;
  font-size: 12px;
}
.day.night-shift .hours-chip {
  box-shadow: inset 0 0 0 1.5px var(--navy, #0b2a4a);
}


/* Off-hours hall notify (Master Art. 11 §4) */
.offhours-notify { margin-top: 10px; }
.offhours-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a4a7a;
  background: #e8f0ff;
  color: #152033;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.offhours-btn:disabled,
.offhours-btn.sent {
  opacity: 0.75;
  cursor: default;
  background: #e6f6ea;
  border-color: #2f6b45;
}

.day-off-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 750;
  color: var(--navy);
}
.day-off-btn.on {
  background: #5b6b7c;
  border-color: #5b6b7c;
  color: #fff;
}
.time-grid.day-off {
  opacity: 0.45;
}
