:root {
  --ink: #17202E;
  --ink2: #3A4452;
  --muted: #556070;
  --line: #DCDFE3;
  --line2: #ECEEF0;
  --bg: #F3F4F1;
  --card: #fff;
  --accent: #F5B800;
  --nav: #17202E;
  --nav2: #243042;
  --ok-bg: #E3F1EE;
  --ok: #0E5E51;
  --warn-bg: #FCEFD6;
  --warn: #7A4200;
  --bad-bg: #FBE4E2;
  --bad: #9A1818;
  --info-bg: #E4ECF7;
  --info: #1F4E8C;
  --surface: #fff;
  --surface2: #E4E7E2;
  --surface3: #E9EBE7;
  --hover: #F8F9F7;
  --selected: #FFF6D6;
  --btn-border: #C5CAD1;
  --input-border: #8A93A0;
  --nav-muted: #C9CED6;
  --bad-text: #7E1414;
  --link-hover: #163a69;
  --calendar-bg: #F4F6F8;
  --calendar-l1: #CFE0F5;
  --calendar-l2: #7FA8DC;
  --calendar-l3: #1F4E8C;
  --check-border: #C9CED2;
  --signature-dash: #C5CAD1;
  --signature-placeholder: #6B7480;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #E9EDF3;
  --ink2: #C5CEDA;
  --muted: #A6B0BE;
  --line: #394555;
  --line2: #2C3745;
  --bg: #141B24;
  --card: #1D2733;
  --accent: #F5B800;
  --nav: #0B111A;
  --nav2: #182330;
  --ok-bg: #183A34;
  --ok: #8BD4C3;
  --warn-bg: #47371D;
  --warn: #FFD479;
  --bad-bg: #492526;
  --bad: #FFAAA5;
  --info-bg: #20364F;
  --info: #A8C9F3;
  --surface: #202B38;
  --surface2: #293441;
  --surface3: #222D39;
  --hover: #293441;
  --selected: #453A20;
  --btn-border: #536172;
  --input-border: #647184;
  --nav-muted: #C9CED6;
  --bad-text: #FFAAA5;
  --link-hover: #D0E2FA;
  --calendar-bg: #202B38;
  --calendar-l1: #344B64;
  --calendar-l2: #3A5E88;
  --calendar-l3: #1F4E8C;
  --check-border: #536172;
  --signature-dash: #647184;
  --signature-placeholder: #A6B0BE;
}

* {
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--info);
}

a:hover {
  color: #163a69;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

.boot {
  padding: 48px;
  text-align: center;
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* pills, cards, buttons */
.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.info {
  background: var(--info-bg);
  color: var(--info);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pad {
  padding: 18px 20px;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #C5CAD1;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg);
  color: var(--ink);
}

.btn.dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn.dark:hover {
  background: #2A3545;
}

.btn.y {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.btn.y:hover {
  background: #E0A800;
}

.btn.danger {
  color: var(--bad);
}

.btn.block {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  border-radius: 12px;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.link {
  background: none;
  border: 0;
  padding: 0 4px;
  font: inherit;
  font-size: 14px;
  color: var(--info);
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.link:hover {
  text-decoration: underline;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.between {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 520px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* forms */
.inp {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #8A93A0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  width: 100%;
}

textarea.inp {
  padding: 10px 12px;
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}

select.inp {
  padding-right: 8px;
}

.fl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.fl .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.fl.notes-required {
  padding: 10px 12px;
  border: 1px solid var(--warn);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--warn-bg);
}

.fl.notes-required .hint {
  color: var(--warn);
  font-weight: 600;
}

.fl.notes-required .inp {
  border-color: var(--warn);
}

.lbl {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chk {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  background: #E4E7E2;
  border: 1px solid #C9CED2;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.chk input {
  width: 24px;
  height: 24px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}

.err {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bad-bg);
  color: #7E1414;
  font-size: 14px;
  font-weight: 600;
}

span.pill {
  padding: 2px 5px;
  border-radius: 5px;
  text-align: center;
}

/* tables & lists */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  font-size: 14px;
  vertical-align: middle;
}

.scrollx {
  overflow-x: auto;
}

.rowbtn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--line2);
  background: #fff;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.rowbtn:hover {
  background: #F8F9F7;
  color: var(--ink);
}

.rowbtn.on {
  background: #FFF6D6;
  box-shadow: inset 4px 0 0 var(--accent);
}

.rowbtn .t {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rowbtn .s {
  font-size: 13px;
  color: var(--muted);
}

.rowbtn .pill {
  min-width: 92px;
  justify-content: center;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #C5CAD1;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chip.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calhead {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.calday {
  min-height: 80px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calday.today {
  border: 2px solid var(--ink);
}

.calday.conflict {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: var(--bad);
}

.calday.caution {
  background: var(--warn-bg);
  border-color: var(--warn);
  color: var(--warn);
}

.calday.on {
  background: var(--ink);
  color: #fff;
}

.calbar {
  display: block;
  height: 15px;
  line-height: 15px;
  padding: 0 6px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calbar.over {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -9px;
}

.calbar.cont {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -9px;
}

.tl {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.tl-hours {
  display: flex;
  font-size: 11px;
  color: var(--muted);
}

.tl-hours span {
  flex: 1;
}

.tl-driver {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.tl-driver:hover {
  text-decoration: underline;
}

.tl-track {
  position: relative;
  height: 30px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line2) 0, var(--line2) 1px, transparent 1px, transparent calc(100% / 24));
}

.tlbar {
  position: absolute;
  top: 3px;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  font: inherit;
  font-size: 11px;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tlbar.bad {
  outline: 2px solid var(--bad);
  outline-offset: 1px;
}

.wk {
  display: grid;
  grid-template-columns: 150px repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.wkhead {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wkhead.today,
.wkcell.today {
  border: 2px solid var(--ink);
}

.wkhead.conflict {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: var(--bad);
}

.wkcell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.wkchip {
  display: block;
  height: 16px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wkchip.bad {
  outline: 2px solid var(--bad);
  outline-offset: 1px;
}

.yr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.ymonth {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ymonth>.link {
  align-self: flex-start;
  font-weight: 600;
}

.yhead,
.ygrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.yhead {
  font-size: 10px;
  color: var(--muted);
}

.yday {
  min-height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #F4F6F8;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.yday.l1 {
  background: #CFE0F5;
}

.yday.l2 {
  background: #7FA8DC;
}

.yday.l3 {
  background: #1F4E8C;
  color: #fff;
}

.yday.conflict {
  border-color: var(--bad);
  box-shadow: inset 0 0 0 1px var(--bad);
}

.yday.caution {
  border-color: var(--warn);
  box-shadow: inset 0 0 0 1px var(--warn);
}

.yday.today {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 44px;
  padding: 0 16px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  font: inherit;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}

.tab.on {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line2);
  overflow: hidden;
}

.bar>i {
  display: block;
  height: 100%;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px 20px;
}

.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.strip>div {
  background: #fff;
  padding: 12px 16px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.kpi {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.kpi b {
  font-size: 30px;
  letter-spacing: -.02em;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.col {
  background: #E9EBE7;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bcard {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.photos img,
.photos .ph {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--line);
}

.sigimg {
  width: 260px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: block;
}

.body-text {
  padding: 14px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink2);
  white-space: pre-line;
}

/* office shell */
.shell {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
}

.nav {
  flex: 1 1 220px;
  max-width: 100%;
  background: var(--nav);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.brand img {
  width: 36px;
  height: 36px;
}

.navb {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  color: #C9CED6;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  text-decoration: none;
}

.navb:hover {
  background: var(--nav2);
  color: #fff;
}

.navb.on {
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.who {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--nav2);
  color: #C9CED6;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.who b {
  color: #fff;
}

.who .link {
  color: #F5D36B;
  min-height: 36px;
  padding: 0;
  justify-content: flex-start;
}

@media (min-width: 801px) {
  .nav {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
  }
}

.main {
  flex: 999 1 560px;
  min-width: 0;
  padding: 28px 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

@media (max-width: 800px) {
  .nav {
    position: static;
    height: auto;
    align-self: auto;
    flex-basis: 100%;
    padding: 12px;
    gap: 10px;
  }

  .nav .navs {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  .nav .navb {
    width: auto;
  }

  .who {
    margin-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
  }

  .main {
    padding: 18px 16px 40px;
  }
}

.page-h {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-h h1 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: -.01em;
}

.page-h .sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.split>.a {
  flex: 3 1 440px;
  min-width: 0;
}

.split>.b {
  flex: 2 1 340px;
  min-width: 0;
}

/* driver */
.drv {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
}

.dhead {
  background: var(--nav);
  color: #fff;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.dhead .t {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dhead h1 {
  margin: 0;
  font-size: 20px;
}

.dhead .back {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
}

.dbody {
  flex: 1 1 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 96px;
}

.dfoot {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  z-index: 5;
}

.dtabs {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 4px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 5;
}

.dtabs a {
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 600;
  text-align: center;
}

.dtabs a.on {
  color: var(--ink);
  font-weight: 700;
}

.dhelp {
  margin-left: auto;
  color: #F5D36B;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.busbadge {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
}

.prog {
  height: 8px;
  border-radius: 999px;
  background: #34404F;
  overflow: hidden;
}

.prog>i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.seg2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.opt {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.opt.on {
  border-color: var(--ink);
  background: #FFF6D6;
}

.ilist {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.ihead {
  position: sticky;
  top: var(--dhead-h, 0px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 8px 14px;
  background: var(--bg);
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink2);
}

.irow {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 14px;
  border-bottom: 1px solid #F0F1F2;
}

.irow .l {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.tg3 {
  flex: none;
  width: 62px;
  min-height: 44px;
  padding: 0;
  border-radius: 8px;
  border: 0;
  background: var(--line2);
  color: var(--ink2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tg3.insp {
  background: var(--info);
  color: #fff;
}

.tg3.minor {
  background: #8A5200;
  color: #fff;
}

.tg3.major {
  background: #A61B1B;
  color: #fff;
}

.ihead span.c {
  width: 62px;
  text-align: center;
}

.sigpad {
  position: relative;
  border: 1px solid #8A93A0;
  border-radius: 10px;
  background: #fff;
}

.sigpad canvas {
  display: block;
  width: 100%;
  height: 150px;
  touch-action: none;
  cursor: crosshair;
  border-radius: 10px;
}

.sigpad .line {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 32px;
  border-bottom: 1px dashed #C5CAD1;
  pointer-events: none;
}

.sigpad .ph {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  text-align: center;
  color: #6B7480;
  font-size: 15px;
  pointer-events: none;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #D5D9DE;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(11, 17, 26, .75);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.addph {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px dashed #8A93A0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  text-align: center;
}

.alert-bad {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bad-bg);
  color: #7E1414;
  font-size: 14px;
  line-height: 1.45;
}

/* modal & toast */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 26, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}

.modal {
  width: 560px;
  max-width: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal h2 {
  margin: 0;
  font-size: 20px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-actions>.row {
  margin-left: auto;
}

.x {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--ink);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  max-width: calc(100% - 32px);
  z-index: 60;
  display: none;
}

#toast.show {
  display: block;
}

/* login */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login .card {
  width: 400px;
  max-width: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

:root[data-theme="dark"] a:hover {
  color: var(--link-hover);
}

:root[data-theme="dark"] .btn:not(.dark):not(.y),
:root[data-theme="dark"] .inp,
:root[data-theme="dark"] .rowbtn,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .calday,
:root[data-theme="dark"] .tl-track,
:root[data-theme="dark"] .wkhead,
:root[data-theme="dark"] .wkcell,
:root[data-theme="dark"] .strip>div,
:root[data-theme="dark"] .dfoot,
:root[data-theme="dark"] .dtabs,
:root[data-theme="dark"] .opt,
:root[data-theme="dark"] .ilist,
:root[data-theme="dark"] .sigpad,
:root[data-theme="dark"] .addph {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .btn:not(.dark):not(.y),
:root[data-theme="dark"] .chip {
  border-color: var(--btn-border);
}

:root[data-theme="dark"] .inp,
:root[data-theme="dark"] .sigpad,
:root[data-theme="dark"] .addph {
  border-color: var(--input-border);
}

:root[data-theme="dark"] .chk {
  background: var(--surface2);
  border-color: var(--check-border);
}

:root[data-theme="dark"] .col {
  background: var(--surface3);
}

:root[data-theme="dark"] .rowbtn:hover {
  background: var(--hover);
}

:root[data-theme="dark"] .rowbtn.on,
:root[data-theme="dark"] .opt.on {
  background: var(--selected);
}

:root[data-theme="dark"] .yday {
  background: var(--calendar-bg);
}

:root[data-theme="dark"] .yday.l1 {
  background: var(--calendar-l1);
}

:root[data-theme="dark"] .yday.l2 {
  background: var(--calendar-l2);
}

:root[data-theme="dark"] .yday.l3 {
  background: var(--calendar-l3);
}

:root[data-theme="dark"] .err,
:root[data-theme="dark"] .alert-bad {
  color: var(--bad-text);
}

:root[data-theme="dark"] .sigpad .line {
  border-bottom-color: var(--signature-dash);
}

:root[data-theme="dark"] .sigpad .ph {
  color: var(--signature-placeholder);
}

:root[data-theme="dark"] .irow {
  border-bottom-color: var(--line2);
}

.theme-toggle {
  min-height: 40px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.who .theme-toggle {
  min-height: 32px;
  width: fit-content;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--nav-muted);
  font-size: 13px;
  justify-content: flex-start;
}

.who .theme-toggle:hover {
  background: transparent;
  color: #fff;
  text-decoration: underline;
}

:root[data-theme="dark"] .btn.dark {
  background: var(--nav);
  border-color: var(--nav);
  color: #fff;
}

:root[data-theme="dark"] .btn.y {
  color: #17202E;
}

:root[data-theme="dark"] .chip.on,
:root[data-theme="dark"] .calday.on {
  background: var(--nav);
  color: #fff;
}

:root[data-theme="dark"] .tg3.insp {
  color: #17202E;
}

:root[data-theme="dark"] .yday.l2 {
  color: #fff;
}

.spare-bus {
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
}