:root,
html[data-theme="dark"] {
  --bg: #1e4566;
  --card: #2f5a82;
  --text: #ffffff;
  --muted: #e8f1fa;
  --border: #8fb0cc;
  --accent: #b8e7ff;
  --btn: #2563eb;
  --danger: #dc2626;
  --ok: #059669;
  --vision: #9333ea;
  --maps: #ea580c;
  --header: #16324f;
  --input: #f8fafc;
  --chrome-text: #ffffff;
  --chrome-muted: #d5e4f5;
  --tap: 48px;
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}
body { padding-left: var(--safe-left); padding-right: var(--safe-right); }
.skip-link {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--btn);
  color: #fff;
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; color: #fff; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
body.nav-open { overflow: hidden; }
a { color: var(--accent); }
button, a, input, select, textarea, label { touch-action: manipulation; }
.shell { display: flex; min-height: 100dvh; position: relative; }

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 80;
}
.scrim.show { display: block !important; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: min(78vw, 300px);
  height: 100dvh;
  background: var(--header);
  color: var(--chrome-text);
  border-right: 1px solid var(--border);
  padding: calc(18px + var(--safe-top)) 14px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}
.sidebar.open { transform: translateX(0); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 4px; color: var(--chrome-text); }
.portal-mark { width: 36px; height: 36px; border-radius: 8px; display: block; flex: 0 0 auto; }
.install-card img { width: 72px; height: 72px; border-radius: 16px; }
.install-card ol { margin: 0 0 8px 18px; padding: 0; }
.sidebar .brand-sub, .topbar-title span { color: var(--chrome-muted); }
.brand-sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.nav-group { margin: 0 0 10px; }
.nav-group + .nav-group {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chrome-muted);
  padding: 4px 12px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--chrome-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 4px;
}
.nav a.active { background: #2a4d73; }
.nav a.vision-link { color: #e9d5ff; }
.nav a:active { background: #1e293b; }
.nav a.nav-signout {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  border-radius: 10px;
  color: #fecaca;
}

.main { flex: 1; min-width: 0; padding: 0 0 calc(28px + var(--safe-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(52px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: var(--header);
  color: var(--chrome-text);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 800; font-size: 16px; flex: 1; min-width: 0; color: var(--chrome-text); }
.topbar-title span { display: block; color: var(--chrome-muted); font-size: 11px; font-weight: 600; }
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  cursor: pointer;
}
.container { max-width: 920px; margin: 0 auto; padding: 12px 14px 0; }
.public-shell { max-width: 480px; margin: 0 auto; padding: calc(16px + var(--safe-top)) 14px calc(28px + var(--safe-bottom)); }
.public-shell .brand { font-size: 32px; letter-spacing: 0.12em; margin-bottom: 0; }
.public-shell .portal-mark { width: 72px; height: 72px; border-radius: 16px; }
.public-shell .brand-sub { margin-bottom: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card.emergency-card { border-color: #7f1d1d; background: #1a1018; }
.card.emergency-card h2 { color: #fca5a5; }
.unit-row + .unit-row {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}
.unit-row h3 { font-size: 16px; }

.check-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 600;
  color: var(--text);
  min-height: var(--tap);
  padding: 8px 0;
}
.check-line input { width: auto; margin: 4px 0 0; min-width: 24px; min-height: 24px; }
.emergency-card .check-line { color: #fecaca; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  background: var(--btn);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border-radius: 10px;
  margin-top: 10px;
  border: 0;
  cursor: pointer;
}
.btn.secondary { background: #475569; }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.vision { background: var(--vision); }
.btn.maps { background: var(--maps); }
.btn.narrow { width: auto; min-width: var(--tap); padding: 10px 14px; margin: 0; font-size: 15px; }
.btn.jump { margin-top: 0; margin-bottom: 12px; background: #334155; }

.chip-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}
.chips-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  padding: 2px 0 10px;
  margin: 0 0 8px;
}
.chips-scroll .chip {
  flex: 0 0 auto;
  white-space: nowrap;
}
a.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #334155;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
a.chip.active { background: var(--btn); }
.hour-stack { display: flex; flex-direction: column; gap: 16px; margin: 10px 0 12px; }
.hour-field { margin: 0; }
.hour-stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.hour-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 56px;
  min-width: 56px;
  min-height: 56px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #334155;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.hour-btn:disabled { opacity: 0.4; }
.hour-stepper strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font-size: 28px;
  font-weight: 800;
}
.hour-wheel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: 8px 2px 12px;
  margin-top: 4px;
}
.hour-stack { overflow-anchor: none; }
.hour-tick { position: relative; flex: 0 0 auto; scroll-snap-align: center; margin: 0; }
.hour-tick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  clip: rect(0, 0, 0, 0);
}
.hour-tick span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 999px;
  background: #334155;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}
.hour-tick input:checked + span { background: var(--btn); }
.hour-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hour-jump {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  min-width: 72px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #1e3a8a;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}
.hour-jump:disabled { opacity: 0.4; }
.leave-unit { border: 1px solid var(--border); border-radius: 10px; margin: 12px 0; padding: 8px 12px 4px; }
.leave-unit legend { font-weight: 800; padding: 0 6px; }
.photo-add { display: inline-flex; align-items: center; justify-content: center; }
.part-group h4 {
  margin: 16px 0 8px;
  font-size: 15px;
  color: var(--accent);
}
.supplier-card .phone {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px;
  margin-top: 6px;
  margin-bottom: 8px;
  background: var(--input, var(--bg));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
}
.file-clip {
  position: fixed !important;
  left: -120vw !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
.password-field { position: relative; }
.password-field input { padding-right: 92px; }
.password-toggle {
  position: absolute;
  right: 4px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: var(--tap);
  min-height: var(--tap);
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.password-toggle[aria-pressed="true"] { color: var(--accent); }
.password-toggle-eye { font-size: 20px; line-height: 1; }
.login-paper .password-toggle { color: #334155; }
.login-paper .password-toggle[aria-pressed="true"] { color: #1e3a8a; }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 32px; }

.row { display: grid; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.stats strong { font-size: 22px; }

.file-hit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  margin: 12px 0;
  padding: 16px 12px;
  border-radius: 12px;
  background: var(--vision);
  color: #fff;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button.file-hit {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 0;
  font: inherit;
}
.file-hit.gallery { background: #334155; }
.file-hit input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font-size: 16px;
}
.file-hit-title { font-weight: 800; font-size: 17px; pointer-events: none; }
.file-hit-sub { color: #e9d5ff; font-size: 13px; margin-top: 4px; pointer-events: none; font-weight: 500; }
.fp-vision {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: rgba(7, 17, 31, 0.94);
}
.fp-vision[hidden] { display: none !important; }
body.fp-vision-open { overflow: hidden; }
.fp-vision-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c4b5fd;
}
.fp-vision-name {
  margin: 6px 0 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #e9d5ff;
}
@supports (-webkit-background-clip: text) {
  .fp-vision-name {
    background: linear-gradient(90deg, #e9d5ff, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
.fp-vision-sub { color: #cbd5e1; font-weight: 600; margin: 0 0 16px; }
.fp-vision-frame {
  position: relative;
  width: min(94vw, 420px);
  height: min(58vh, 420px);
  overflow: hidden;
  border: 2px solid #a855f7;
  border-radius: 14px;
  background: #07111f;
  box-shadow: 0 0 36px rgba(147, 51, 234, 0.4);
}
.fp-vision-frame img,
.fp-vision-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b192c;
}
.fp-vision-frame video {
  object-fit: cover;
}
.fp-vision #fp-vision-shutter {
  margin-top: 16px;
  min-width: min(94vw, 420px);
  min-height: 52px;
}
.fp-vision-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #c084fc, #38bdf8, transparent);
  box-shadow: 0 0 18px #c084fc;
  animation: fp-scan 1.35s linear infinite;
}
.fp-vision-corners {
  pointer-events: none;
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(233, 213, 255, 0.35);
  border-radius: 8px;
}
@keyframes fp-scan {
  0% { top: 8px; }
  100% { top: calc(100% - 10px); }
}
.fp-vision-steps {
  list-style: none;
  width: min(92vw, 360px);
  margin: 18px 0 0;
  padding: 0;
}
.fp-vision-steps li {
  min-height: 34px;
  color: #64748b;
  font-weight: 700;
  font-size: 15px;
}
.fp-vision-steps li.on { color: #e9d5ff; }
.fp-vision-steps li.done { color: #6ee7b7; }
.fp-vision #fp-vision-cancel {
  margin-top: 22px;
  min-width: min(92vw, 360px);
  min-height: 48px;
}
.fp-vision-matched {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c084fc;
}
.file-hit.gallery .file-hit-sub { color: #cbd5e1; }

.flash { background: #082f1b; border: 1px solid #16a34a; color: #86efac; padding: 10px 12px; border-radius: 10px; margin: 12px 0; }
.flash.bad { background: #3f1010; border-color: #dc2626; color: #fca5a5; }
.muted { color: var(--muted); font-size: 13px; }
.phone-link { color: var(--accent); font-weight: 700; text-decoration: none; }

.ticket { background: var(--bg); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.dispatch-card { overflow: visible; }
.clear-dispatch { margin: 10px 0 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.clear-dispatch select { margin-bottom: 8px; min-height: 48px; }
.clear-dispatch .actions { display: flex; flex-direction: column; gap: 8px; }
.clear-dispatch .actions .btn { width: 100%; min-height: 48px; }
@media (min-width: 840px) {
  .clear-dispatch .actions { flex-direction: row; flex-wrap: wrap; }
  .clear-dispatch .actions .btn { width: auto; }
}
.part-group-title { margin: 14px 0 8px; font-size: 1rem; }
a.part-index { display: block; text-decoration: none; color: inherit; }
.ticket details { margin-top: 8px; }
.ticket summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.ticket.emergency { border-left-color: var(--danger); }
.module-heading {
  margin: 16px 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 12px;
  margin-bottom: 8px;
}
.inline-form { display: inline-block; margin-top: 10px; }
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  margin: 0;
}
.check-line input { margin-top: 4px; flex: 0 0 auto; }
.vision-job { border-color: #38bdf8; }
.vision-job h2 { margin: 4px 0 8px; font-size: 22px; }
.tag-ids {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0;
}
.tag-id {
  background: var(--input);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.tag-id span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e3a8a;
  margin-bottom: 4px;
}
.tag-id strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #0b192c;
  word-break: break-word;
}
.tag-id em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
  color: #334155;
}
@media (min-width: 700px) {
  .tag-ids { grid-template-columns: 1fr 1fr 1fr; }
}
.paper { background: #fff; color: #0f172a; border: 2px solid #1e3a8a; border-radius: 10px; padding: 14px; margin-top: 10px; }
.paper h3 { color: #1e3a8a; margin: 0 0 8px; }
.paper input, .paper select, .paper textarea { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }
.login-paper {
  background: #fff;
  color: #0b192c;
  border: 2px solid #1e3a8a;
  border-radius: 12px;
  padding: 18px;
}
.login-paper h2 { color: #1e3a8a; margin: 0 0 8px; }
.login-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1e3a8a;
}
.login-note {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}
.office-steps {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}
.office-steps li { margin: 6px 0; }
.login-paper .btn { margin-top: 12px; }
.login-paper .muted { color: #475569; }
.login-paper label { color: #1e3a8a; }
.login-paper input,
.login-paper select,
.login-paper textarea {
  background: #f8fafc;
  color: #0b192c;
  border-color: #cbd5e1;
  color-scheme: light;
}
.login-paper select option { color: #0b192c; background: #fff; }
.login-paper .check-line { color: #0b192c; }
.login-paper .btn.danger { margin-top: 14px; }
.login-paper + .login-paper { margin-top: 14px; }
.login-paper.occupant-box { border-color: #b91c1c; }
.login-paper.occupant-box h2 { color: #b91c1c; }
.login-paper.occupant-box .btn { margin-top: 12px; }
.theme-toggle { margin-top: 14px; }

html[data-theme="dim"] {
  --bg: #e8eef6;
  --card: #ffffff;
  --text: #0b192c;
  --muted: #334155;
  --border: #94a3b8;
  --accent: #1d4ed8;
  --btn: #1e3a8a;
  --header: #0b192c;
  --chrome-text: #ffffff;
  --chrome-muted: #94a3b8;
  --input: #ffffff;
}
html[data-theme="dim"] body { color-scheme: light; }
html[data-theme="dim"] .sidebar,
html[data-theme="dim"] .topbar {
  color: var(--chrome-text);
  background: var(--header);
}
html[data-theme="dim"] .sidebar .brand,
html[data-theme="dim"] .topbar-title,
html[data-theme="dim"] .nav a {
  color: var(--chrome-text);
}
html[data-theme="dim"] .nav a.active {
  background: #1e3a8a;
  color: #fff;
}
html[data-theme="dim"] .sidebar .brand-sub,
html[data-theme="dim"] .topbar-title span,
html[data-theme="dim"] .nav-group-label {
  color: var(--chrome-muted);
}
html[data-theme="dim"] .paper, html[data-theme="dim"] .login-paper {
  background: #fff;
  color: #0b192c;
  border-color: #1e3a8a;
}
html[data-theme="dim"] .ticket { background: #fff; color: #0b192c; }
html[data-theme="dim"] input,
html[data-theme="dim"] select,
html[data-theme="dim"] textarea {
  background: #fff;
  color: #0b192c;
}
html[data-theme="dim"] .flash { background: #ecfdf5; border-color: #059669; color: #065f46; }
html[data-theme="dim"] .flash.bad { background: #fef2f2; border-color: #dc2626; color: #991b1b; }
html[data-theme="dim"] .badge { background: #dbeafe; color: #1e3a8a; }
html[data-theme="dim"] .badge.ok { background: #d1fae5; color: #065f46; }
html[data-theme="dim"] .file-hit.gallery { background: #1e3a8a; }
html[data-theme="dim"] .tab {
  background: #e2e8f0;
  color: #0b192c;
  border-color: #94a3b8;
}
html[data-theme="dim"] .tab.on {
  background: var(--btn);
  color: #fff;
  border-color: var(--btn);
}
html[data-theme="dim"] .btn.secondary { background: #1e3a8a; color: #fff; }
html[data-theme="dim"] .btn.jump { background: #1e3a8a; color: #fff; }
html[data-theme="dim"] a.chip { background: #e2e8f0; color: #0b192c; }
html[data-theme="dim"] a.chip.active { background: var(--btn); color: #fff; }
html[data-theme="dim"] .hour-btn,
html[data-theme="dim"] .hour-tick span { background: #e2e8f0; color: #0b192c; }
html[data-theme="dim"] .hour-tick input:checked + span { background: var(--btn); color: #fff; }
html[data-theme="dim"] .day-card { background: #fff; color: #0b192c; }
html[data-theme="dim"] .tag-id {
  background: #f8fafc;
  border-color: #1e3a8a;
}
html[data-theme="dim"] .tag-id span { color: #1e3a8a; }
html[data-theme="dim"] .tag-id strong { color: #0b192c; }
html[data-theme="dim"] .tag-id em { color: #334155; }
html[data-theme="dark"] body { color-scheme: dark; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #f8fafc;
  color: #0b192c;
  border-color: #cbd5e1;
}
html[data-theme="dark"] .ticket { background: #3a6890; color: #fff; }
html[data-theme="dark"] .forum-card {
  background: #3a6890;
  border-color: #8fb0cc;
  color: #fff;
}
html[data-theme="dark"] .flash { background: #064e3b; border-color: #34d399; color: #ecfdf5; }
html[data-theme="dark"] .flash.bad { background: #7f1d1d; border-color: #fca5a5; color: #fef2f2; }
html[data-theme="dark"] .hour-btn,
html[data-theme="dark"] .hour-tick span { background: #3a6890; color: #fff; }
html[data-theme="dark"] .hour-tick input:checked + span { background: var(--btn); color: #fff; }
html[data-theme="dark"] .sticky-submit {
  background: linear-gradient(to top, var(--card) 72%, rgba(47, 90, 130, 0.94));
}
html[data-theme="dark"] .tag-id {
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme="dark"] .password-toggle { color: #334155; }
body:has(.login-paper) {
  background: #0b192c;
  color: #fff;
  color-scheme: dark;
}
body:has(.login-paper) .public-shell .brand { color: #fff; }
body:has(.login-paper) .public-shell .brand-sub { color: #94a3b8; }
body:has(.login-paper) .public-shell .flash:not(.bad) {
  background: #052e16;
  border: 2px solid #22c55e;
  color: #bbf7d0;
  font-weight: 600;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.badge { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #12233a; color: var(--accent); }
.badge.ok { background: #064e3b; color: #6ee7b7; }
.badge.warn { background: #3f1010; color: #fca5a5; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-top: 10px; }
.actions form { margin: 0; flex: 1 1 auto; }
.actions .btn.narrow { width: 100%; }
.ticket-share .btn { flex: 1 1 140px; }

.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 10px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  min-height: var(--tap);
  min-width: 4.8rem;
  background: #12233a;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.tab.on { background: var(--btn); border-color: var(--btn); }

.map-frame { width: 100%; min-height: 240px; height: 42vh; border: 1px solid var(--border); border-radius: 10px; margin-top: 12px; }
.chart-panel h3 { margin-top: 16px; }
#ticket-charts {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.bldg-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; display: block; margin: 0 0 6px; background: #dbe7f3; }
.job-block-main { display: block; color: inherit; text-decoration: none; }
.job-block-main .btn { margin-top: 8px; }
.cancel-contract { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line, #c5d4e4); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px -4px; }
.table-wrap table { min-width: 520px; }

.week-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 14px;
  align-items: center;
}
.week-nav strong {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 15px;
}
.week-nav .btn { margin-top: 0; }

.payroll-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 14px;
}
.payroll-totals div {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.payroll-totals span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.payroll-totals strong { font-size: 20px; }
.payroll-hours {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.payroll-hours span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.payroll-hours strong { font-size: 16px; color: var(--text); }
.paper.payroll-person.quiet { opacity: 0.72; }

.day-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.day-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.day-hours { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.sticky-submit {
  position: fixed;
  left: max(12px, var(--safe-left));
  right: max(12px, var(--safe-right));
  bottom: 0;
  z-index: 65;
  margin: 0;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
.sticky-submit .btn { margin-top: 0; width: 100%; min-height: 56px; font-size: 18px; position: relative; z-index: 2; }
.sticky-submit .btn + .btn { margin-top: 8px; }
.sticky-submit .muted { margin: 8px 0 0; }
@media (max-width: 839px) {
  /* Room below the last field so it can sit under the top bar when the keyboard is open. */
  body:has(#ticket-form) .main { padding-bottom: calc(100vh + 80px); }
  #ticket-top input,
  #ticket-top textarea,
  #ticket-top select {
    scroll-margin-top: 76px;
  }
}

.access-block { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.access-block h3 { color: var(--accent); font-size: 16px; margin: 0 0 8px; }

@media (min-width: 700px) {
  .row.cols-2 { grid-template-columns: 1fr 1fr; }
  .row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .actions { align-items: center; }
  .actions .btn.narrow, .actions form { width: auto; flex: 0 0 auto; }
}

@media (min-width: 840px) {
  .scrim, .scrim.show { display: none !important; }
  .menu-btn { display: none; }
  .topbar { display: none; }
  .shell { flex-direction: row; }
  .sidebar {
    position: sticky;
    top: 0;
    transform: none;
    width: 252px;
    flex-shrink: 0;
    height: 100dvh;
  }
  .main { padding: 18px 20px 48px; }
  .container { padding: 0; }
  .public-shell { max-width: 560px; padding-top: 32px; }
  .table-wrap table { min-width: 0; }
  .map-frame { min-height: 320px; }
  .day-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .day-card { margin-bottom: 0; }
  .payroll-totals { grid-template-columns: repeat(3, 1fr); }
  .payroll-totals.mine { grid-template-columns: repeat(4, 1fr); }
  .sticky-submit {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 16px 0 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

#sig-fields[hidden] { display: none !important; }
.sig-opt-in {
  padding: 10px 12px;
  margin: 12px 0 8px;
  border: 2px solid #93c5fd;
  border-radius: 10px;
  background: #12233a;
  color: #fff;
}
.sig-opt-in input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 2px 0 0;
  border: 2px solid #93c5fd;
  border-radius: 6px;
  background: #fff;
  color-scheme: light;
  flex-shrink: 0;
}
.sig-opt-in input[type="checkbox"]:checked {
  background: #2563eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' d='M3 8.2 6.4 12 13 4'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  border-color: #93c5fd;
}
html[data-theme="dim"] .sig-opt-in {
  background: #fff;
  color: #0b192c;
  border-color: #1e3a8a;
}
html[data-theme="dim"] .sig-opt-in input[type="checkbox"] {
  border-color: #1e3a8a;
}
.sig-wrap {
  background: #fff;
  border: 2px solid #1e3a8a;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
  color-scheme: light;
  min-height: 168px;
}
#sig-pad {
  display: block;
  width: 100%;
  height: 168px;
  touch-action: none;
  background: #fff;
  color-scheme: light;
}
.sig-img {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 2px solid #1e3a8a;
  border-radius: 8px;
  margin-top: 8px;
  color-scheme: light;
}
.ticket-doc table { width: 100%; }
.ticket-doc th, .ticket-doc td { color: inherit; }
.ticket-print-sheet { padding: 4px 2px 0; max-width: 7.5in; }
.ticket-print-sheet .letterhead { gap: 8px; padding-bottom: 6px; margin-bottom: 6px; border-bottom-width: 2px; }
.ticket-print-sheet .letterhead-mark { padding: 5px 7px; font-size: 12px; border-radius: 4px; }
.ticket-print-sheet .letterhead-copy h1 { font-size: 15px; }
.ticket-print-sheet .letterhead-copy p { margin: 0; font-size: 10px; }
.ticket-print-title { font-size: 12px; margin: 0 0 6px; }
.ticket-print-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  border: 1px solid #1e3a8a;
}
.ticket-print-rows > div {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  border-bottom: 1px solid #93c5fd;
  min-height: 0;
}
.ticket-print-rows > div:nth-last-child(-n+2):not(.span):not(.trio) { border-bottom: 0; }
.ticket-print-rows > .span { grid-column: 1 / -1; border-bottom: 1px solid #93c5fd; }
.ticket-print-rows > .span:last-child { border-bottom: 0; }
.ticket-print-rows > .trio {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid #93c5fd;
}
.ticket-print-rows > .trio:last-child { border-bottom: 0; }
.ticket-print-rows > .trio > div {
  display: grid;
  grid-template-columns: auto 1fr;
  border-right: 1px solid #93c5fd;
  border-bottom: 0;
  min-height: 0;
}
.ticket-print-rows > .trio > div:last-child { border-right: 0; }
@media (max-width: 640px) {
  .ticket-print-rows > .trio { grid-template-columns: 1fr; }
  .ticket-print-rows > .trio > div {
    border-right: 0;
    border-bottom: 1px solid #93c5fd;
  }
  .ticket-print-rows > .trio > div:last-child { border-bottom: 0; }
}
.ticket-print-rows dt {
  margin: 0;
  padding: 3px 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ticket-print-rows dd {
  margin: 0;
  padding: 3px 6px;
  color: #0b192c;
  font-size: 11px;
  line-height: 1.25;
}
.ticket-print-sig {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  font-size: 11px;
  color: #0b192c;
}
.ticket-print-sig .sig-img { max-height: 36px; width: auto; margin: 0; border-width: 1px; }
.ticket-print-sig .sig-line {
  flex: 1;
  border-bottom: 1px solid #1e3a8a;
  min-height: 18px;
}
.print-only { display: none; }
.unit-row { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.unit-row:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.form-sheet { padding: 18px; }
.cust-ticket { padding: 22px 22px 18px; }
.cust-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.cust-kicker {
  margin: 0 0 4px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cust-ticket-head h2 {
  margin: 0;
  color: #0b192c;
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
}
.cust-address { margin: 4px 0 0; color: #334155; font-size: 15px; }
.cust-facts { margin: 0 0 18px; }
.pdf-frame {
  width: 100%;
  min-height: 520px;
  margin: 10px 0 16px;
  border: 2px solid #1e3a8a;
  border-radius: 10px;
  background: #fff;
}
.cust-meta {
  text-align: right;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
  white-space: nowrap;
}
.cust-block {
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid #dbe4f0;
}
.cust-block h3 {
  margin: 0 0 6px;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cust-block p {
  margin: 0;
  color: #0b192c;
  font-size: 16px;
  line-height: 1.45;
}
.cust-sign {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 2px solid #1e3a8a;
}
.cust-sign-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e3a8a;
}
.cust-sign-name { margin: 0 0 6px; color: #0b192c; font-weight: 700; }
.cust-sign-line {
  min-height: 40px;
  border-bottom: 1px solid #94a3b8;
}
.cust-sign-form h3 { margin-top: 0; }
@media (max-width: 640px) {
  .cust-ticket-head { flex-direction: column; }
  .cust-meta { text-align: left; white-space: normal; }
}
.letterhead {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 3px solid #1e3a8a;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.letterhead-mark {
  flex: 0 0 auto;
  background: #1e3a8a;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 16px;
}
.letterhead-copy h1 { margin: 0; color: #1e3a8a; font-size: 20px; }
.letterhead-copy p { margin: 4px 0 0; color: #334155; font-size: 13px; }
.letterhead-meta { color: #475569; }
.form-title {
  color: #1e3a8a;
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-photo {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 0 0 14px;
  border: 2px solid #1e3a8a;
  border-radius: 8px;
  background: #fff;
}
.form-list-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.form-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: 0 0 auto;
  background: #fff;
}
.form-original {
  white-space: pre-wrap;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.35);
  color: var(--text);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 2px solid #1e3a8a;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.form-cell {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  border-bottom: 1px solid #93c5fd;
  min-height: 48px;
}
.form-cell:last-child { border-bottom: 0; }
.form-label {
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 800;
  padding: 10px 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-value { padding: 10px 12px; color: #0b192c; font-size: 16px; }
.form-views { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.form-views .btn { width: auto; margin-top: 0; }
.form-sig {
  margin-top: 14px;
  padding: 12px;
  border: 2px dashed #1e3a8a;
  border-radius: 8px;
  background: #fff;
}
@media (min-width: 700px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-cell[style*="grid-column"] { grid-column: 1 / -1; }
}

.ai-assistant, .ai-reply { border-color: #0f766e; }
.ai-assistant > .muted:first-child { color: #5eead4; }
.ai-steps { margin: 8px 0 12px 1.2em; padding: 0; color: var(--text); }
.ai-steps li { margin: 4px 0; }
.ai-ask { margin-top: 12px; min-width: 0; }
.ai-ask-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}
.ai-ask-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
}
.ai-ask-row .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 4.5rem;
  margin-top: 0;
}
.crumbs { margin: 0 0 12px; font-size: 14px; }
.unit-jump { margin: 0 0 8px; }
.forum-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.forum-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--border, #1e3a5f);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: rgba(15, 23, 42, 0.25);
}
.forum-card strong { font-size: 15px; }
.forum-card span { font-size: 13px; }
html[data-theme="dim"] .forum-card {
  background: #fff;
  border-color: #cbd5e1;
  color: #0b192c;
}
.property-hit {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
}
.property-hit strong { display: block; font-size: 16px; margin-bottom: 4px; }
.property-hit > .muted { display: block; }
.unit-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.unit-pick {
  min-height: var(--tap);
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--btn);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.property-picked {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: var(--bg);
  border-radius: 0 10px 10px 0;
}
.property-picked strong { display: block; font-size: 16px; }
.property-picked span { display: block; margin-top: 2px; }
html[data-theme="dim"] .property-hit,
html[data-theme="dim"] .property-picked,
html[data-theme="dim"] .job-find-hit,
html[data-theme="dim"] .job-find-picked,
html[data-theme="dim"] .contract-pick { background: #fff; color: #0b192c; }
html[data-theme="dark"] .property-hit,
html[data-theme="dark"] .property-picked,
html[data-theme="dark"] .job-find-hit,
html[data-theme="dark"] .job-find-picked,
html[data-theme="dark"] .contract-pick { background: #3a6890; color: #fff; }
.job-finder { margin: 8px 0 16px; }
.job-find-group { margin: 12px 0; }
.job-find-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.job-find-group-head strong { font-size: 16px; }
.job-find-group-head .btn { width: auto; margin: 0; }
.job-find-hit {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px 10px;
  align-items: start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
}
.job-find-hit input[type="checkbox"] {
  width: 28px;
  height: 28px;
  margin-top: 2px;
}
.job-find-hit label { display: block; }
.job-find-hit strong { display: block; font-size: 16px; }
.job-find-hit .btn { width: auto; margin-top: 8px; }
.job-find-picked {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
}
.job-find-picked strong, .job-find-picked .muted { display: block; }
.job-find-picked .btn { width: auto; margin: 0; }
.contract-pick {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
}
.contract-pick strong { display: block; font-size: 16px; }
.contract-pick form { margin: 0; }
.contract-pick .btn { width: auto; margin-top: 8px; }
.desk-cat {
  margin: 12px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.desk-shortcuts .actions { margin-top: 0; }
.desk-shortcuts .actions .btn.narrow {
  width: auto;
  flex: 1 1 calc(50% - 8px);
}
html[data-theme="dim"] .ai-assistant,
html[data-theme="dim"] .ai-reply { border-color: #0f766e; background: #ecfdf5; color: #0b192c; }
html[data-theme="dim"] .ai-assistant > .muted:first-child { color: #0f766e; }

@page {
  size: letter portrait;
  margin: 0.35in;
}
@media print {
  html, body { background: #fff !important; color: #0f172a !important; height: auto; }
  body { font-size: 11px; line-height: 1.3; }
  .sidebar, .topbar, .scrim, .menu-btn, .no-print, .field-dock, .sticky-submit, nav, .btn.maps, #maps-link, .ai-assistant,
  .flash, .chips, .chip-group-label, .prior-calls, .hour-stack, .hour-field { display: none !important; }
  .print-only { display: block !important; }
  body:not(.print-photos) .note-media { display: none !important; }
  .has-ticket-print > :not(.print-only) { display: none !important; }
  .shell, .main, .container, .public-shell { display: block; padding: 0; margin: 0; max-width: none; }
  .card, .paper, .ticket-doc {
    background: #fff !important;
    color: #0f172a !important;
    border-color: #1e3a8a;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
  .letterhead { gap: 10px; padding-bottom: 8px; margin-bottom: 8px; border-bottom-width: 2px; }
  .letterhead-mark { padding: 6px 8px; font-size: 13px; border-radius: 6px; }
  .letterhead-copy h1 { font-size: 16px; }
  .letterhead-copy p { margin: 1px 0 0; font-size: 11px; }
  .form-title { font-size: 12px; margin: 0 0 4px; }
  .cust-ticket { padding: 8px !important; }
  .cust-ticket-head h2 { font-size: 16px; }
  .cust-block p { font-size: 12px; }
  .ticket-print-sheet { page-break-inside: avoid; break-inside: avoid; }
  .ticket-print-sheet .sig-block { margin-top: 6px; padding: 0; }
  .ticket-print-sheet .sig-img { max-height: 36px; width: auto; margin-top: 0; }
  a.btn { display: none; }
}

.field-dock {
  position: fixed;
  left: max(12px, var(--safe-left));
  right: max(12px, var(--safe-right));
  bottom: 0;
  z-index: 100;
  margin: 0;
  max-height: min(70dvh, 520px);
  overflow: auto;
  padding: 14px 14px calc(14px + var(--safe-bottom));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}
.field-dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#field-note { font-size: 18px; font-weight: 800; margin: 8px 0; line-height: 1.35; }
#field-say { font-size: 22px; font-weight: 800; line-height: 1.35; margin: 8px 0; }
.sidebar > .field-wake { margin: 8px 0 12px; }
.field-dock .btn.narrow { width: auto; }
.project-shot { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.marketing-thumb { display: block; width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.brochure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.brochure-grid figure { margin: 0; }
.brochure-grid img, .social-card img { width: 100%; border-radius: 8px; display: block; }
.brochure-grid figcaption { font-size: 13px; margin-top: 4px; }
.social-card { background: #fff; color: #0f172a; border-radius: 12px; overflow: hidden; margin: 12px 0; }
.social-card p { margin: 0; padding: 12px 14px; }
@media (max-width: 640px) { .brochure-grid { grid-template-columns: 1fr; } }
.paper-send { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.paper-send h3 { margin: 0 0 6px; }
.paper-pick h3 { margin: 16px 0 6px; }
body.paper-screen .container { display: flex; flex-direction: column; }
body.paper-screen .paper-screen-top { order: -1; }
body.paper-plain { background: #e7e5e4; }
body.paper-plain .container { display: flex; flex-direction: column; background: transparent; }
body.paper-plain .paper-screen-top { order: -1; }
body.paper-plain .ai-assistant,
body.paper-plain #shop-alert-banner,
body.paper-plain #swfl-install,
body.paper-plain .field-dock,
body.paper-plain #field-toggle,
body.paper-plain .topbar > a.btn { display: none !important; }
.time-paper { font-size: 18px; line-height: 1.4; color: #0b192c; }
.time-paper h2 { font-size: 28px; margin: 10px 0 4px; color: #1e3a8a; }
.time-paper h3 { font-size: 22px; margin: 16px 0 6px; color: #1e3a8a; }
.time-paper .time-kicker { font-size: 16px; margin-top: 0; }
.time-paper .letterhead-copy h1 { font-size: 22px; }
.time-paper .letterhead-copy p { font-size: 14px; }
.time-paper table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.time-paper th, .time-paper td { border: 1px solid #1e3a8a; padding: 8px 10px; text-align: left; font-size: 18px; vertical-align: top; }
.time-paper .time-total th, .time-paper .time-total td { background: #1e3a8a; color: #fff; font-weight: 800; }
.time-paper .time-week th, .time-paper .time-week td { font-size: 12px; padding: 4px; text-align: center; }
.time-paper .time-week tbody th, .time-paper .time-week tfoot th { text-align: left; }
.time-read p { margin: 0 0 8px; font-size: 18px; }
.time-paper .time-big { font-size: 22px; font-weight: 800; color: #1e3a8a; margin-top: 12px; }
.time-paper .receipt-shot { max-height: 180px; max-width: 100%; display: block; margin: 6px 0 12px; }
.time-paper .time-flags { color: #9a3412; font-size: 16px; }
.paper-toolbar { margin-bottom: 12px; }
.paper-toolbar .actions { flex-wrap: wrap; }
.paper-toolbar .btn.narrow { width: auto; }
.paper-per-on { background: #1e3a8a; color: #fff; }
.paper-preview {
  background: #d6d3d1;
  padding: 16px 12px 24px;
  border-radius: 8px;
}
.paper-fit {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 18px;
}
.paper-sheet {
  background: #fff;
  color: #0b192c;
  width: 8.5in;
  min-height: 11in;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.32in 0.38in;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  box-sizing: border-box;
}
.paper-sheet:last-child { margin-bottom: 0; }
.paper-sheet.per-1 { min-height: 10.4in; }
.paper-slip {
  overflow: hidden;
  border-bottom: 1px dashed #64748b;
  margin: 0 0 0.12in;
  padding: 0 0 0.08in;
}
.paper-sheet .paper-slip:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.paper-sheet .paper { margin-top: 0; box-shadow: none; }
.paper-sheet.per-1 .paper-slip { max-height: none; }
.paper-sheet.per-2 .paper-slip { max-height: 4.85in; }
.paper-sheet.per-3 .paper-slip { max-height: 3.15in; }
.paper-sheet.per-3 .paper { padding: 6px; border-width: 1px; }
.paper-sheet.per-3 .ticket-print-sheet { padding: 0; }
.paper-sheet.per-3 .letterhead { gap: 6px; padding-bottom: 3px; margin-bottom: 3px; }
.paper-sheet.per-3 .letterhead-mark { padding: 3px 5px; font-size: 10px; }
.paper-sheet.per-3 .letterhead-copy h1 { font-size: 12px; }
.paper-sheet.per-3 .letterhead-copy p { font-size: 8px; }
.paper-sheet.per-3 .ticket-print-title { font-size: 10px; margin: 0 0 2px; }
.paper-sheet.per-3 .ticket-print-rows dt,
.paper-sheet.per-3 .ticket-print-rows dd { font-size: 8px; padding: 1px 4px; line-height: 1.15; }
.paper-sheet.per-3 .ticket-print-sig { margin-top: 2px; gap: 6px; font-size: 8px; }
.paper-sheet.per-3 .sig-img { max-height: 22px; }
.paper-sheet.per-2 .paper { padding: 8px; }
.paper-sheet.per-2 .letterhead-copy h1 { font-size: 14px; }
.paper-sheet.per-2 .ticket-print-rows dt,
.paper-sheet.per-2 .ticket-print-rows dd { font-size: 10px; padding: 2px 5px; }
.paper-sheet .ticket-print-rows > .trio { grid-template-columns: 1fr 1fr 1fr; }
.paper-sheet .ticket-print-rows > .trio > div { border-right: 1px solid #93c5fd; border-bottom: 0; }
.paper-sheet .ticket-print-rows > .trio > div:last-child { border-right: 0; }
@media print {
  .paper-preview { background: #fff !important; padding: 0; }
  .paper-fit { display: block; height: auto !important; overflow: visible; margin: 0; }
  .paper-sheet {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    transform: none !important;
    page-break-after: always;
    break-after: page;
  }
  .paper-sheet:last-child { page-break-after: auto; break-after: auto; }
  .paper-slip { break-inside: avoid; page-break-inside: avoid; }
  .paper-sheet.per-3 .paper-slip { max-height: 3.15in; }
  .paper-sheet.per-2 .paper-slip { max-height: 4.85in; }
  .paper-sheet.per-3 .letterhead-copy h1 { font-size: 12px !important; }
  .paper-sheet.per-3 .letterhead-copy p,
  .paper-sheet.per-3 .ticket-print-rows dt,
  .paper-sheet.per-3 .ticket-print-rows dd { font-size: 8px !important; }
  body.paper-plain { font-size: 16px; }
  .time-paper, .time-paper p, .time-read p { font-size: 16px !important; }
  .time-paper h2, .time-paper .time-big { font-size: 22px !important; }
  .time-paper h3 { font-size: 18px !important; }
  .time-paper th, .time-paper td { font-size: 16px !important; }
  .time-paper .time-week th, .time-paper .time-week td { font-size: 11px !important; }
  .time-paper .letterhead-copy h1 { font-size: 18px !important; }
  .time-paper .receipt-shot { max-height: 180px; }
}
.car-memory { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid #1d4ed8; border-radius: var(--radius); background: var(--card); }
.car-memory h3, .car-memory h4 { margin: 0 0 4px; }
.car-memory h4 { margin-top: 10px; font-size: 14px; }
.car-memory p { margin: 0 0 4px; }
.car-memory .memory-kicker { color: var(--muted, #64748b); }
.memory-list { margin: 0; padding-left: 18px; }
.memory-list li { margin: 2px 0; }
.time-look { margin-top: 12px; }
.time-show { border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; padding: 8px 12px; }
.time-show legend { padding: 0 6px; font-size: 13px; }
.week-key { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; font-size: 12px; }
.week-key i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.week-key .reg, .week-bar .reg { background: #1d4ed8; }
.week-key .ot, .week-bar .ot { background: #d97706; }
.week-key .tr, .week-bar .tr { background: #0f766e; }
.week-flags { margin: 8px 0; padding-left: 18px; color: #9a3412; }
.week-glance { display: grid; gap: 6px; margin: 10px 0 14px; }
.week-day { background: #fff; color: #0b192c; border: 1px solid #93c5fd; border-radius: 8px; padding: 6px 4px 8px; text-align: center; min-width: 0; }
.week-day.warn { border: 2px solid #d97706; background: #fffbeb; }
.week-day-name { font-size: 11px; font-weight: 800; color: #1e3a8a; }
.week-bar { display: flex; height: 28px; margin: 4px 2px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.week-bar span { display: block; height: 100%; }
.week-total { font-size: 18px; font-weight: 800; color: #1e3a8a; line-height: 1.1; }
.week-job { font-size: 10px; line-height: 1.2; min-height: 2.4em; overflow: hidden; }
.week-day img, .week-item img { width: 100%; max-height: 72px; object-fit: cover; border-radius: 4px; margin-top: 4px; display: block; background: #f8fafc; }
.week-missing { margin-top: 4px; font-size: 10px; font-weight: 800; color: #9a3412; }
.week-sheet-wrap { overflow: hidden; margin-top: 12px; }
.week-sheet { min-width: 760px; background: #fff; color: #0b192c; border: 2px solid #1e3a8a; }
.week-sheet th, .week-sheet td { border: 1px solid #93c5fd; text-align: right; padding: 6px 8px; font-size: 13px; white-space: nowrap; }
.week-sheet thead th { background: #eff6ff; color: #1e3a8a; text-align: center; }
.week-sheet tbody th, .week-sheet tfoot th { text-align: left; background: #eff6ff; color: #1e3a8a; position: sticky; left: 0; }
.week-sheet tfoot td, .week-sheet tfoot th { font-weight: 800; background: #1e3a8a; color: #fff; }
.week-sheet .week-items td { text-align: left; white-space: normal; font-weight: 500; vertical-align: top; min-width: 7.5rem; }
.week-item { margin-bottom: 8px; }
.week-item .muted { display: block; }
.note-media { display: grid; gap: 12px; margin: 8px 0 14px; }
.note-clip { margin: 0; }
.note-clip img, .note-clip video {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #0b192c;
  border-radius: 8px;
  display: block;
}
.note-clip button { margin-top: 6px; }
@media print {
  .week-sheet-wrap { overflow: visible; height: auto !important; }
  .week-sheet { min-width: 0; font-size: 10px; transform: none !important; }
  .week-sheet th, .week-sheet td { font-size: 10px; padding: 3px 4px; }
}
