/* ============================================================================
   Keystone Ops — app.css

   Same palette and type as keystonetechutah.com, retuned for a tool rather
   than a showcase: denser, higher contrast, and sized for a thumb on a phone
   in daylight. Mobile is the base; wider screens are the enhancement.
   ========================================================================= */

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/static/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/static/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink:       #070f13;
  --ground:    #0b181e;
  --surface:   #102630;
  --surface-2: #16323d;
  --line:      #1c3a47;
  --line-soft: #142c36;

  --paper:   #eaf2f4;
  --fog:     #93acb6;
  --fog-dim: #6b8792;

  --signal:      #3fb3be;
  --signal-hi:   #6bd3dc;
  --signal-deep: #247885;
  --tungsten:    #d2a05f;

  --go:    #4ec98a;
  --warn:  #e8964f;
  --stop:  #e2685f;

  --body:  "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "Plex Mono", ui-monospace, Consolas, monospace;

  --r:    10px;
  --r-sm: 6px;
  --gap:  1rem;
  --pad:  clamp(0.9rem, 2.5vw, 1.35rem);  /* one padding value, everywhere */
  --shell: 1240px;
  --tap:  46px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  /* Room for the fixed bottom bar on phones, plus the home indicator. */
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) {
  body { padding-bottom: 3rem; }
}

h1, h2, h3 { font-stretch: 112%; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--signal); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--signal-hi);
  outline-offset: 2px;
}

code, .code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--fog);
  background: var(--ink);
  padding: 0.1em 0.4em;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--signal); color: var(--ink);
  padding: 0.75rem 1rem; z-index: 100; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; top: 0; }

/* ------------------------------------------------------------------ chrome */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0.6rem clamp(0.9rem, 3vw, 2rem);
  display: flex; align-items: center; gap: 1rem;
}

.brand {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--paper); text-decoration: none; font-weight: 700;
  font-stretch: 112%; flex-shrink: 0;
}
.brand__mark { width: 26px; height: 26px; color: var(--signal); }
.brand__name { font-size: 0.95rem; letter-spacing: 0.01em; }
@media (max-width: 520px) { .brand__name { display: none; } }

.nav { display: none; gap: 0.25rem; margin-left: auto; }
@media (min-width: 760px) { .nav { display: flex; } }

.nav__link {
  color: var(--fog); text-decoration: none;
  padding: 0.5rem 0.8rem; border-radius: var(--r-sm);
  font-size: 0.92rem; font-weight: 500;
}
.nav__link:hover { color: var(--paper); background: var(--surface); }
.nav__link.is-on { color: var(--signal); background: color-mix(in srgb, var(--signal) 12%, transparent); }

.menu { position: relative; margin-left: auto; }
@media (min-width: 760px) { .menu { margin-left: 0; } }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }

.avatar {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--signal-deep); color: var(--paper);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.avatar--sm { width: 24px; height: 24px; font-size: 0.62rem; margin-right: 0.4rem; vertical-align: middle; }

.menu__panel {
  position: absolute; right: 0; top: calc(100% + 0.5rem);
  min-width: 220px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0.4rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.menu__panel--wide { min-width: 320px; }
.menu--left .menu__panel { right: 0; }
.menu__who { padding: 0.5rem 0.6rem; margin: 0; display: grid; }
.menu__item {
  display: block; width: 100%; text-align: left;
  padding: 0.6rem; border-radius: var(--r-sm);
  color: var(--paper); text-decoration: none; font-size: 0.92rem;
}
.menu__item:hover { background: var(--surface-2); }
.menu__item--button {
  background: none; border: 0; font: inherit; color: var(--stop); cursor: pointer;
}
.menu__item .meta { display: block; }

/* Bottom bar — the only navigation that matters on a phone. */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  display: flex;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 760px) { .tabbar { display: none; } }

.tabbar__link {
  flex: 1; display: grid; place-items: center; gap: 0.15rem;
  padding: 0.5rem 0 0.45rem;
  color: var(--fog-dim); text-decoration: none;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
}
.tabbar__link svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar__link.is-on { color: var(--signal); }

/* ------------------------------------------------------------------ layout */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.9rem, 3vw, 2rem) 3rem;
}

.narrow { max-width: 640px; margin: 0 auto; display: grid; gap: var(--gap); }
.narrow--center { text-align: center; padding-top: 3rem; }

.stack { display: grid; gap: var(--gap); }

.cols { display: grid; gap: var(--gap); }
@media (min-width: 1000px) {
  .cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
}
.cols__main, .cols__side { display: grid; gap: var(--gap); min-width: 0; }

.page-head {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.page-head__actions { display: flex; gap: 0.5rem; }
.page-title { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2rem); }
.page-sub { color: var(--fog); font-size: 0.9rem; margin: 0.15rem 0 0; }
.page-foot { margin-top: 1.5rem; }

/* -------------------------------------------------------------------- card */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.card--pad { padding: clamp(0.9rem, 2.5vw, 1.35rem); display: grid; gap: 0.85rem; align-content: start; }
.card--danger { border-color: color-mix(in srgb, var(--stop) 35%, var(--line-soft)); }

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.85rem clamp(0.9rem, 2.5vw, 1.35rem);
  border-bottom: 1px solid var(--line-soft);
}
.card__title { font-size: 0.98rem; font-stretch: 100%; }
.card__note { color: var(--fog); font-size: 0.86rem; margin: 0; }

.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 0.5rem 0; }

/* ------------------------------------------------------------------ typography bits */

.meta { color: var(--fog-dim); font-size: 0.82rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--paper); }
.link { color: var(--signal); text-decoration: none; font-weight: 500; font-size: 0.88rem; }
.link:hover { text-decoration: underline; }
.req { color: var(--tungsten); }
.nowrap { white-space: nowrap; }
.is-late { color: var(--warn); }
.is-plus { color: var(--go); }
.is-minus { color: var(--stop); }

.empty {
  color: var(--fog-dim); font-size: 0.9rem;
  padding: clamp(0.9rem, 2.5vw, 1.35rem); margin: 0;
}
.empty--big { text-align: center; padding: 3rem 1rem; }

.error__code {
  font-family: var(--mono); font-size: 3rem; color: var(--signal-deep); margin: 0;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: var(--tap); padding: 0 1.1rem;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font: inherit; font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn--primary { background: var(--signal); color: var(--ink); }
.btn--primary:hover { background: var(--signal-hi); }
.btn--ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--stop); color: #1a0705; }
.btn--danger:hover { background: color-mix(in srgb, var(--stop) 85%, white); }
.btn--sm { min-height: 34px; padding: 0 0.7rem; font-size: 0.82rem; }
.btn--block { width: 100%; }
.btn--huge { width: 100%; min-height: 62px; font-size: 1.15rem; letter-spacing: 0.01em; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.55; pointer-events: none; }

.btn-icon {
  background: none; border: 0; cursor: pointer;
  color: var(--fog-dim); font-size: 1.15rem; line-height: 1;
  min-width: 34px; min-height: 34px; border-radius: var(--r-sm);
}
.btn-icon:hover { color: var(--stop); background: var(--surface-2); }

.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; }

/* ------------------------------------------------------------------- forms */

.field { display: grid; gap: 0.3rem; }
.field__label { font-size: 0.8rem; font-weight: 600; color: var(--fog); letter-spacing: 0.01em; }
.field__hint { font-size: 0.78rem; color: var(--fog-dim); }
.field__error { font-size: 0.8rem; color: var(--stop); font-weight: 500; }
.field--third { max-width: 260px; }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.75rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--paper);
  /* 16px keeps iOS from zooming the page when a field is focused. */
  font: inherit; font-size: 16px;
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--fog-dim); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--signal); }
.input--big, .select--big { min-height: 56px; font-size: 1.05rem; }
.select--sm { min-height: 34px; padding: 0.2rem 0.4rem; font-size: 0.82rem; }
.input[type="file"] { padding: 0.5rem; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2393acb6' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.25rem;
}

.grid { display: grid; gap: 0.85rem; }
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--quarter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--quarter > * { grid-column: span 1; }
}

.check { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 0.15rem; accent-color: var(--signal); flex-shrink: 0; }
.check--inline { align-items: center; }
.checks {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-bottom: 1.25rem;
}
.filters .select, .filters .input { width: auto; min-width: 140px; flex: 0 1 auto; }
.filters__search { flex: 1 1 240px; min-width: 200px; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex; align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge--muted { background: var(--surface-2); color: var(--fog); }
.badge--info  { background: color-mix(in srgb, var(--signal) 18%, transparent); color: var(--signal-hi); }
.badge--go    { background: color-mix(in srgb, var(--go) 18%, transparent); color: var(--go); }
.badge--warn  { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.badge--done  { background: color-mix(in srgb, var(--signal-deep) 30%, transparent); color: var(--signal-hi); }

/* ----------------------------------------------------------------- flashes */

.flashes { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.flash, .callout {
  padding: 0.8rem 1rem;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--signal);
  background: var(--surface);
  font-size: 0.9rem;
  margin: 0;
}
.flash--ok   { border-left-color: var(--go); }
.flash--err  { border-left-color: var(--stop); }
.flash--warn { border-left-color: var(--warn); }
.callout--info { border-left-color: var(--signal); }
.callout--warn { border-left-color: var(--warn); }

/* ------------------------------------------------------------------- lists */

.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem clamp(0.9rem, 2.5vw, 1.35rem);
  border-bottom: 1px solid var(--line-soft);
}
.list__item:last-child { border-bottom: 0; }
.list--tight .list__item { padding-top: 0.55rem; padding-bottom: 0.55rem; }

.list__main {
  display: grid; gap: 0.1rem; flex: 1; min-width: 0;
  text-decoration: none; color: inherit;
}
a.list__main:hover .list__title { color: var(--signal); }
.list__title { font-weight: 600; font-size: 0.94rem; overflow-wrap: anywhere; }
.list__side { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.deflist { margin: 0; display: grid; gap: 0.5rem; }
.deflist > div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.deflist dt { color: var(--fog-dim); font-size: 0.82rem; flex-shrink: 0; }
.deflist dd { margin: 0; text-align: right; font-size: 0.9rem; overflow-wrap: anywhere; }

/* -------------------------------------------------------------------- feed */

.feed { list-style: none; margin: 0; padding: 0 clamp(0.9rem, 2.5vw, 1.35rem); display: grid; gap: 0.9rem; }
.card--pad .feed { padding: 0; }
.feed__item { position: relative; padding-left: 1rem; }
.feed__dot {
  position: absolute; left: 0; top: 0.45rem;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal-deep);
}
.feed__text { font-size: 0.88rem; margin: 0; overflow-wrap: anywhere; }
.feed__time { font-size: 0.75rem; color: var(--fog-dim); margin: 0.1rem 0 0; }

/* ------------------------------------------------------------------- stats */

.stats {
  display: grid; gap: 0.6rem; margin-bottom: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Equal height regardless of whether a tile has a footnote, so a row of them
   reads as one band rather than a ragged edge. */
.stat {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 0.85rem 1rem;
  display: flex; flex-direction: column; justify-content: flex-start;
  min-height: 92px;
}
.stat__value {
  font-size: 1.4rem; font-weight: 700; font-stretch: 112%; margin: 0;
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stat__label { font-size: 0.76rem; color: var(--fog-dim); margin: 0.1rem 0 0; }
.stat__foot {
  font-size: 0.72rem; color: var(--fog-dim); margin: auto 0 0;
  padding-top: 0.4rem; overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--fog-dim); font-weight: 700;
  padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); font-weight: 600; }
.table tr.is-flagged { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.table tr.is-off { opacity: 0.55; }
.table--punches { min-width: 900px; }

/* ---------------------------------------------------------------- job cards */

.cards {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.jobcard {
  display: grid; gap: 0.4rem; align-content: start;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 1rem;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.jobcard:hover { border-color: var(--signal-deep); transform: translateY(-2px); }
.jobcard__top { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.jobcard__name { font-size: 1.02rem; line-height: 1.25; }
.jobcard__client { font-size: 0.86rem; color: var(--fog); margin: 0; }
.jobcard__type {
  font-family: var(--mono); font-size: 0.72rem; color: var(--fog-dim);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0;
}
.jobcard__foot {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  font-size: 0.76rem; color: var(--fog-dim);
  border-top: 1px solid var(--line-soft); padding-top: 0.5rem; margin-top: 0.2rem;
}

.bar { height: 4px; background: var(--ink); border-radius: 999px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--signal-deep); }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

/* --------------------------------------------------------------- job header */

.jobhead { margin-bottom: 1.25rem; }
.jobhead__crumb { margin: 0 0 0.35rem; }
.jobhead__top { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.jobhead__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0 0; }

.tabs {
  display: flex; gap: 0.15rem; margin-top: 1rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 0.6rem 0.85rem;
  color: var(--fog); text-decoration: none;
  font-size: 0.88rem; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--paper); }
.tab.is-on { color: var(--signal); border-bottom-color: var(--signal); }
.tab__count {
  display: inline-block; padding: 0 0.35rem; margin-left: 0.15rem;
  background: var(--surface-2); border-radius: 999px;
  font-size: 0.72rem; color: var(--fog);
}

/* ------------------------------------------------------------------ entries */

.entry { display: grid; gap: 0.4rem; }
.entry__head { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.9rem; }
.entry__del { margin-left: auto; }

.co__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.co__title { font-size: 1rem; margin: 0.1rem 0 0; }
.co__figures { text-align: right; display: grid; gap: 0.2rem; justify-items: end; }
.co__cost { font-size: 1.1rem; font-weight: 700; margin: 0; font-family: var(--mono); }
.co__actions { display: flex; gap: 0.5rem; }

/* ------------------------------------------------------------------- to-do */

.todo { list-style: none; margin: 0; padding: 0; }
.todo__item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.8rem clamp(0.9rem, 2.5vw, 1.35rem);
  border-bottom: 1px solid var(--line-soft);
}
.todo__item:last-child { border-bottom: 0; }
.todo__item.is-done .todo__title { text-decoration: line-through; color: var(--fog-dim); }
.todo__body { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.todo__title { font-weight: 600; font-size: 0.94rem; margin: 0; overflow-wrap: anywhere; }
.todo__side { display: flex; gap: 0.2rem; align-items: flex-start; flex-shrink: 0; }

.tick {
  width: 28px; height: 28px; flex-shrink: 0;
  border: 2px solid var(--line); border-radius: 7px;
  background: var(--ink); cursor: pointer;
  display: grid; place-items: center; padding: 0;
  color: transparent;
}
.tick svg { width: 16px; height: 16px; }
.tick:hover { border-color: var(--signal-deep); }
.tick.is-on { background: var(--signal); border-color: var(--signal); color: var(--ink); }

.micro { position: relative; }
.micro summary { list-style: none; cursor: pointer; }
.micro summary::-webkit-details-marker { display: none; }
.micro__panel {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 30;
  width: min(360px, calc(100vw - 2.5rem));
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0.85rem;
  display: grid; gap: 0.6rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------------- punch */

.punch {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: clamp(1.1rem, 4vw, 1.75rem);
  text-align: center; margin-bottom: var(--gap);
  display: grid; gap: 0.5rem;
}
.punch--on { border-color: var(--go); background: color-mix(in srgb, var(--go) 6%, var(--surface)); }

.punch__label {
  font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--fog); margin: 0;
}
.punch__clock {
  font-size: clamp(2.6rem, 12vw, 4rem); font-weight: 700; font-stretch: 112%;
  font-variant-numeric: tabular-nums; margin: 0; line-height: 1; color: var(--go);
}
.punch__job { font-size: 1.05rem; font-weight: 600; margin: 0; }
.punch__since { color: var(--fog); font-size: 0.86rem; margin: 0; }
.punch__form { display: grid; gap: 0.85rem; text-align: left; margin-top: 0.5rem; }

.geo-status {
  font-size: 0.8rem; color: var(--fog-dim); text-align: center; margin: 0;
  min-height: 1.2em;
}
.geo-status.is-good { color: var(--go); }
.geo-status.is-warn { color: var(--warn); }

.clock-strip {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.25rem; margin-bottom: var(--gap);
}
.clock-strip.is-on { border-left-color: var(--go); }
.clock-strip__body { flex: 1; min-width: 200px; }
.clock-strip__label {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--fog-dim); margin: 0;
}
.clock-strip__job { font-size: 1.1rem; font-weight: 700; margin: 0.1rem 0; }
.clock-strip__since { color: var(--fog); font-size: 0.86rem; margin: 0; }

/* ------------------------------------------------------------------ photos */

.picker { display: block; cursor: pointer; }
.picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.picker__face {
  display: grid; place-items: center; gap: 0.5rem;
  padding: 2rem 1rem; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--r);
  color: var(--fog); font-size: 0.9rem;
}
.picker__face svg { width: 34px; height: 34px; color: var(--signal-deep); }
.picker:hover .picker__face { border-color: var(--signal-deep); color: var(--paper); }
.picker input:focus-visible + .picker__face { outline: 2px solid var(--signal-hi); outline-offset: 2px; }

.upload-status { display: grid; gap: 0.4rem; font-size: 0.85rem; }
.upload-row { display: flex; align-items: center; gap: 0.6rem; }
.upload-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row__state { color: var(--fog-dim); font-size: 0.8rem; flex-shrink: 0; }
.upload-row__state.is-done { color: var(--go); }
.upload-row__state.is-fail { color: var(--stop); }

.photo-grid {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.photo {
  position: relative; margin: 0;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); overflow: hidden;
}
.photo img {
  display: block; width: 100%; height: 150px; object-fit: cover; background: var(--ink);
}
.photo__cap { padding: 0.5rem 0.6rem; display: grid; gap: 0.1rem; }
.photo__text { font-size: 0.82rem; overflow-wrap: anywhere; }
.photo__del { position: absolute; top: 0.25rem; right: 0.25rem; }
.photo__del .btn-icon {
  background: color-mix(in srgb, var(--ink) 75%, transparent);
  color: var(--paper); border-radius: 50%;
}

/* ------------------------------------------------------------------ sign-in */

.signin { max-width: 380px; margin: clamp(2rem, 10vh, 5rem) auto 0; text-align: center; display: grid; gap: 0.6rem; }
.signin__mark { color: var(--signal); justify-self: center; }
.signin__mark svg { width: 48px; height: 48px; }
.signin__title { font-size: 1.6rem; }
.signin__sub { color: var(--fog); font-size: 0.9rem; margin: 0 0 0.75rem; }
.signin .card { text-align: left; }
.signin__note { color: var(--fog-dim); font-size: 0.8rem; margin-top: 0.5rem; }

/* ==========================================================================
   Additions: break stopwatch, permission nag, corrections, money, task photos
   ======================================================================== */

/* -------------------------------------------------------- navigation bits */

.nav__count, .tab__count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 0.3rem; margin-left: 0.3rem;
  background: var(--signal); color: var(--ink);
  border-radius: 999px; font-size: 0.68rem; font-weight: 700;
}
.nav__link.is-on .nav__count { background: var(--signal-hi); }

.tabbar__link { position: relative; }
.tabbar__dot {
  position: absolute; top: 0.35rem; left: 50%; margin-left: 0.55rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); border: 1.5px solid var(--ink);
}
/* The crew's clock tab: the one thing they open the app to do. */
.tabbar__link--hero { color: var(--signal); }
.tabbar__link--hero svg { width: 26px; height: 26px; }

.page-head--tight { margin-bottom: 0.85rem; }

/* ------------------------------------------------------- permission nag -- */

.nag {
  display: flex; gap: 0.85rem; align-items: flex-start; flex-wrap: wrap;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: var(--r); padding: var(--pad); margin-bottom: var(--gap);
}
.nag__body { flex: 1; min-width: 220px; }
.nag__title { font-weight: 700; margin: 0 0 0.2rem; color: var(--warn); font-size: 0.95rem; }
.nag__text { margin: 0; font-size: 0.88rem; }
.nag__help { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--fog); }
.nag__help:empty { display: none; }

/* ------------------------------------------------------------- modal ----- */

.modal {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 1.25rem;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(3px);
}
.modal__box {
  width: min(440px, 100%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: grid; gap: 0.75rem;
}
.modal__title { font-size: 1.05rem; margin: 0; }
.modal__body { margin: 0; font-size: 0.9rem; color: var(--paper); white-space: pre-line; }
.modal__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.modal__actions .btn { flex: 1 1 auto; }

/* --------------------------------------------------------- break + punch -- */

.btn--amber { background: var(--warn); color: #201004; }
.btn--amber:hover { background: color-mix(in srgb, var(--warn) 85%, white); }
.btn--go { background: var(--go); color: #042012; }
.btn--go:hover { background: color-mix(in srgb, var(--go) 85%, white); }
.btn--tall { min-height: 54px; font-size: 1rem; }

.punch--break {
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 7%, var(--surface));
}
.punch__clock.is-break { color: var(--warn); }
.punch__clock.is-idle { color: var(--fog-dim); }
.punch__breakform { margin-top: 0.35rem; }
.punch__rule {
  font-size: 0.82rem; color: var(--fog); margin: 0;
  max-width: 46ch; margin-inline: auto;
}

.breaklist {
  list-style: none; margin: 0.25rem 0 0; padding: 0;
  display: grid; gap: 0.3rem; text-align: left;
  max-width: 320px; margin-inline: auto; width: 100%;
}
.breaklist__item {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  font-size: 0.84rem; padding: 0.35rem 0.6rem;
  background: var(--ink); border-radius: var(--r-sm);
}

/* ------------------------------------------------------------ disclosure -- */

/* A <details> whose summary is styled as a button — used for the correction
   form so the red call to action is present without a dialog. */
.disclose summary { list-style: none; cursor: pointer; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose__panel {
  display: grid; gap: 0.85rem;
  margin-top: 0.85rem; padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
}
.disclose[open] summary { margin-bottom: 0; }

.correction__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }

/* ---------------------------------------------------- correction review -- */

.segmented {
  display: flex; gap: 0.25rem; margin-bottom: var(--gap);
  overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented__item {
  padding: 0.45rem 0.85rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-soft);
  color: var(--fog); text-decoration: none;
  font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.segmented__item:hover { color: var(--paper); }
.segmented__item.is-on { background: var(--signal); border-color: var(--signal); color: var(--ink); }

.compare {
  display: grid; gap: 0.6rem; align-items: center;
  grid-template-columns: 1fr auto 1fr;
  background: var(--ink); border-radius: var(--r); padding: 0.85rem;
}
.compare__col { min-width: 0; }
.compare__col--new .compare__value { color: var(--signal-hi); }
.compare__label {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--fog-dim); margin: 0 0 0.15rem;
}
.compare__value { font-size: 1rem; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.compare__value.is-muted { color: var(--fog-dim); font-weight: 500; }
.compare__arrow { color: var(--fog-dim); font-size: 1.2rem; }
@media (max-width: 480px) {
  .compare { grid-template-columns: 1fr; }
  .compare__arrow { transform: rotate(90deg); justify-self: center; }
}

.decide { display: grid; gap: 0.75rem; margin-top: 0.5rem; }

/* ------------------------------------------------------------------ money -- */

.capbar { display: grid; gap: 0.3rem; margin-bottom: 1rem; }
.capbar:last-child { margin-bottom: 0; }
.capbar__top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.capbar__name { font-weight: 600; font-size: 0.92rem; }
.capbar__figures { font-variant-numeric: tabular-nums; text-align: right; }
.capbar__note { font-size: 0.78rem; color: var(--fog-dim); margin: 0; }

.bar--tall { height: 10px; margin-bottom: var(--gap); }
.bar__fill.is-over { background: var(--stop); }
.bar__fill.is-go { background: var(--go); }

/* -------------------------------------------------------- task photos ---- */

.thumbs {
  list-style: none; margin: 0.35rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.thumbs__item img {
  display: block; width: 56px; height: 56px; object-fit: cover;
  border-radius: var(--r-sm); background: var(--ink);
  border: 1px solid var(--line-soft);
}
.thumbs__item a:hover img { border-color: var(--signal); }

.taskshot { margin-top: 0.4rem; }
.taskshot__label { display: inline-block; cursor: pointer; }
.taskshot__label input { position: absolute; opacity: 0; width: 0; height: 0; }
.taskshot__face {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; color: var(--fog-dim);
  padding: 0.25rem 0.5rem; border-radius: var(--r-sm);
  border: 1px dashed var(--line);
}
.taskshot__face svg { width: 15px; height: 15px; }
.taskshot__label:hover .taskshot__face { color: var(--signal); border-color: var(--signal-deep); }
.taskshot__label input:focus-visible + .taskshot__face {
  outline: 2px solid var(--signal-hi); outline-offset: 2px;
}
.taskshot .upload-status { margin-top: 0.35rem; }

/* ----------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .jobcard:hover { transform: none; }
}

@media print {
  .topbar, .tabbar, .filters, .form-actions, .btn { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { border: 1px solid #ccc; background: #fff; }
}
