@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/barlow-700.woff2?v=11") format("woff2");
}

@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("./fonts/barlow-800.woff2?v=11") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/inter.woff2?v=11") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/inter.woff2?v=11") format("woff2");
}

:root {
  --ink: #E8EAED;
  --muted: #C9CDD2;
  --bg: #121417;
  --card: #1B1E22;
  --header: #0D0F12;
  --orange: #F26B1D;
  --orange-btn: #C24F0E;
  --red: #B42318;
  --line: #2B2F35;
  --focus: #F26B1D;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  background: var(--header);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shell {
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--header);
  color: var(--ink);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup { min-width: 0; }

.brand {
  margin: 0;
  font-family: Barlow, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}

.brand-sub {
  margin: 3px 0 0;
  font-family: Barlow, Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--orange);
}

.top-line {
  margin: 2px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.pad,
.clock-screen,
.stack {
  padding: 12px;
}

.clock-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-heading,
.screen-title,
.question,
.who,
.entry h3 {
  font-family: Barlow, Arial, sans-serif;
}

.date-heading,
.screen-title,
.question {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 700;
}

.question { font-size: 1.375rem; }

.sub,
.hint,
.count,
.when,
.note,
.equip,
.gps-line,
.kicker {
  margin: 0;
  font-size: 1rem;
}

.kicker {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.875rem;
}

.btn-go,
.btn-wide,
.btn-row button,
.person,
.search,
.field input,
.field textarea {
  border: 2px solid var(--line);
  border-radius: 12px;
}

.btn-go,
.btn-wide,
.btn-row button {
  font-weight: 700;
  font-size: 1rem;
}

.btn-go {
  width: 100%;
  min-height: 4rem;
  color: #fff;
}

.btn-go:active { filter: brightness(0.92); }

.btn-in { background: var(--orange-btn); }

.btn-out { background: var(--red); }

.btn-wide {
  width: 100%;
  min-height: 3rem;
  background: var(--orange-btn);
  color: #fff;
}

.btn-wide.secondary {
  background: var(--card);
  color: var(--ink);
}

.btn-wide.danger,
.btn-row .danger {
  background: var(--red);
  color: #fff;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-row button {
  min-height: 3rem;
  background: var(--card);
  color: var(--ink);
}

.person {
  width: 100%;
  min-height: 3rem;
  padding: 8px 12px;
  background: var(--card);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.person:active,
.btn-wide.secondary:active { border-color: var(--orange); }

.btn-wide:active,
.btn-go:active { filter: brightness(1.08); }

.person-name {
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.person-detail {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 16px;
}

.sticky-tools {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search,
.field input,
.field textarea {
  width: 100%;
  max-width: 100%;
  background: var(--card);
  color: var(--ink);
  padding: 10px 12px;
  min-height: 3rem;
  font-size: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 0.875rem;
}

.field textarea { min-height: 4.5rem; resize: vertical; }

.field input[type="date"],
.field input[type="time"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 3rem;
  line-height: 1.4;
  color-scheme: dark;
  scroll-margin-top: 4.5rem;
  scroll-margin-bottom: 45vh;
}

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

.badge {
  align-self: flex-start;
  margin: 0;
  background: var(--orange);
  color: #121417;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.875rem;
  font-weight: 700;
}

.who {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.2;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.timer {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.week-hero {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.big-hours {
  margin: 2px 0;
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.day-head,
.week-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin: 12px 0 6px;
  font-weight: 700;
  font-size: 0.9375rem;
  scroll-margin-top: 8px;
}

.day-head span:first-child,
.week-head span:first-child { min-width: 0; }

.day-head span:last-child,
.week-head span:last-child { white-space: nowrap; }

.entry {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry h3 {
  margin: 0;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

.note,
.equip { overflow-wrap: anywhere; }

.equip { font-weight: 600; }

.tag {
  margin: 0;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.home-jobs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-row {
  width: 100%;
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  min-height: 3rem;
  color: var(--ink);
  padding: 0;
}

.job-row.is-current,
.job-row.is-selected { border-color: var(--orange); }

.job-row-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 8px 10px;
  min-height: 3rem;
}

.job-row-clear {
  width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  border-left: 2px solid var(--orange);
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
}

.job-check { color: var(--orange); font-weight: 700; }

.job-row-title,
.job-row-meta,
.job-row-action { display: block; }

.job-row-title { font-weight: 700; font-size: 1rem; }

.job-row-meta,
.job-row-action {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.job-row-action { color: var(--orange); font-weight: 700; margin-top: 2px; }

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

.filter-row button {
  min-height: 3rem;
  padding: 6px 4px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.75rem;
}

.filter-row button[aria-pressed="true"] {
  background: var(--orange-btn);
  color: #fff;
  border-color: var(--orange-btn);
}

.gps-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.map-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 4px 10px;
  background: var(--header);
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  border-radius: 999px;
  border: 2px solid var(--orange);
}

.banner {
  margin: 0;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
}

.banner.ok { background: #1E3A28; color: #D8F3E2; }
.banner.error { background: #3A1714; color: #FFD2CC; }

.form-error { margin: 0; color: #FFB4A8; font-weight: 700; }

.search::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: #9AA0A6; }

.dock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--header);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.dock.one { grid-template-columns: 1fr; }

.dock button {
  width: 100%;
  margin: 0;
  min-height: 3.25rem;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.15;
}

.dock button[aria-current="page"] {
  background: var(--card);
  color: var(--orange);
}

.overlay,
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 20, 14, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay { bottom: calc(3.25rem + env(safe-area-inset-bottom)); }

.overlay-card,
.modal {
  width: min(480px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
  border-radius: 16px 16px 0 0;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-back { z-index: 30; align-items: center; padding: 12px; }

.modal {
  border: 2px solid var(--line);
  border-radius: 16px;
}

button.job-row {
  text-align: left;
  gap: 4px;
}

.job-row-copy {
  flex: 1;
  min-width: 0;
  padding: 8px 4px 8px 10px;
}

.chevron {
  align-self: center;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding-right: 10px;
}

.job-card {
  width: 100%;
  flex-direction: row;
  align-items: center;
  text-align: left;
  color: inherit;
}

.job-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-page { padding-bottom: 5.5rem; }

.job-head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 8px 0;
}

.job-head-copy { flex: 1; min-width: 0; }

.job-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.icon-btn,
.text-btn {
  min-height: 2.75rem;
  background: transparent;
  border: 0;
  color: var(--orange);
  font-weight: 700;
  padding: 0 6px;
}

.icon-btn { min-width: 2.75rem; font-size: 1.25rem; }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 12px 0;
}

.seg button {
  min-height: 2.75rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
}

.seg button[aria-selected="true"] {
  border-color: var(--orange);
  color: var(--orange);
}

.total-big {
  margin: 0;
  font-family: Barlow, Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.btn-outline {
  width: 100%;
  min-height: 4rem;
  background: transparent;
  color: var(--orange);
  border: 2px solid var(--orange);
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
}

.punch {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.punch-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  min-height: 2.75rem;
}

.punch-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chip {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.chip.link { color: var(--orange); text-decoration: underline; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  border: 0;
  background: var(--orange-btn);
  color: #fff;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 0;
}

.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 25;
  height: 100dvh;
  max-height: 100dvh;
  background: rgba(8, 20, 14, 0.72);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.sheet,
.entry-editor {
  width: min(480px, 100%);
  min-width: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.entry-editor {
  height: auto;
  max-height: none;
  min-height: 100%;
  overflow: visible;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 2.75rem;
}

.nav-row .text-btn,
.nav-row .icon-btn {
  min-width: 2.75rem;
  padding: 0 8px;
}

.sheet-nav .nav-row { min-height: 0; }

.last-punch {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 8px 8px 10px;
}

.last-punch-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

.sheet-bar .screen-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.sheet-cancel,
.sheet-save {
  flex: 0 0 auto;
  min-height: 2.75rem;
  min-width: 4.75rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  padding: 0 12px;
}

.sheet-cancel {
  background: transparent;
  border: 0;
  color: var(--ink);
}

.sheet-save {
  background: var(--orange-btn);
  color: #fff;
  border: 0;
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px calc(32px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.boot { padding: 16px 12px; font-size: 1rem; font-weight: 600; }

.empty { padding: 4px 0 12px; }

.install {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

@media (min-width: 560px) {
  .shell { box-shadow: 0 0 0 1px #000; }
}
