/* ==========================================================================
   LKP CONSTRUCTION LTD | THE SITE OFFICE
   A back office layered on the existing brand system (css/style.css).
   All classes namespaced o- so nothing here can collide with the website.
   Phone first: 390px is the design width, desktop is the enhancement.
   ========================================================================== */

:root {
  --o-ok:      oklch(0.78 0.145 158);
  --o-ok-dim:  oklch(0.78 0.145 158 / 0.14);
  --o-bad:     oklch(0.70 0.180 25);
  --o-bad-dim: oklch(0.70 0.180 25 / 0.16);
  --o-warn:      var(--amber);
  --o-warn-dim:  var(--amber-glow);
  --o-info:     oklch(0.76 0.095 240);
  --o-info-dim: oklch(0.76 0.095 240 / 0.14);
  --o-bar: 0px;            /* height of the fixed bottom tab bar, set per breakpoint */
}

/* class-set display must not beat the hidden attribute */
[hidden] { display: none !important; }

/* ---- page frame ----------------------------------------------------------- */
.o-body { background: var(--bg-deep); }
.o-body main { display: block; }

.o-wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* skip link */
.o-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--amber);
  color: var(--amber-ink);
  padding: 0.7rem 1rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.o-skip:focus { left: 0; }

/* ==========================================================================
   APP BAR
   ========================================================================== */
.o-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in oklch, var(--bg-deep) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.o-bar__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding-block: 0.5rem;
}
.o-bar__mark {
  width: 44px; height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -5px;
}
.o-bar__mark svg { width: 34px; height: 34px; }
.o-bar__id { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.o-bar__id b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.o-bar__id span {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.o-bar__spacer { flex: 1 1 auto; }

.o-iconbtn {
  position: relative;
  width: 44px; height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: var(--surface);
  transition: color .25s ease, border-color .25s ease, background-color .25s ease;
}
.o-iconbtn:hover { color: var(--amber); border-color: var(--amber); }
.o-iconbtn svg { width: 20px; height: 20px; }
.o-iconbtn__count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 19px; height: 19px;
  padding-inline: 4px;
  border-radius: 10px;
  background: oklch(0.55 0.190 25);
  color: oklch(0.99 0 0);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-deep);
}
.o-iconbtn__count[hidden] { display: none; }

/* view switch: the money control */
.o-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.o-switch__btn {
  min-height: 44px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  transition: background-color .25s ease, color .25s ease;
}
.o-switch__btn svg { width: 16px; height: 16px; }
.o-switch__btn:hover { color: var(--ink); }
.o-switch__btn[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }

/* ==========================================================================
   STRIPS
   ========================================================================== */
.o-strip {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.o-strip p {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  padding-block: 0.6rem;
}
.o-strip b { color: var(--ink-soft); font-weight: 600; }

.o-strip--client {
  background: color-mix(in oklch, var(--amber) 12%, var(--bg-deep));
  border-bottom-color: color-mix(in oklch, var(--amber) 34%, transparent);
}
.o-strip--client p { color: var(--ink-soft); }
.o-strip--client b { color: var(--amber-bright); }
.o-asclient {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.8rem;
}
.o-asclient label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.o-asclient select {
  flex: 1 1 12rem;
  min-height: 44px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0 0.7rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   SHELL + TABS
   ========================================================================== */
.o-shell { padding-top: 1.1rem; padding-bottom: calc(var(--o-bar) + 1.5rem); }

.o-tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: color-mix(in oklch, var(--bg-deep) 96%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.o-tab {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0.35rem 0.2rem;
  color: var(--muted);
  position: relative;
  transition: color .2s ease;
}
.o-tab svg { width: 21px; height: 21px; }
.o-tab span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}
.o-tab[aria-selected="true"] { color: var(--amber); }
.o-tab[aria-selected="true"]::before {
  content: '';
  position: absolute;
  top: 0; left: 22%; right: 22%;
  height: 2px;
  background: var(--amber);
}
.o-tab[hidden] { display: none; }
.o-tab__dot {
  position: absolute;
  top: 7px;
  margin-left: 20px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--o-bad);
}

.o-panel:focus-visible { outline-offset: 6px; }
.o-panel[hidden] { display: none; }

/* ==========================================================================
   TYPE + SMALL PARTS
   ========================================================================== */
.o-h {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.o-h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.o-sub { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }
.o-viewhead { margin-bottom: 1.2rem; }
.o-block { margin-top: 2rem; }
.o-blockhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}
.o-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.o-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.o-sample {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  flex: none;
}

.o-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
.o-pill--ok   { color: var(--o-ok);   border-color: color-mix(in oklch, var(--o-ok) 45%, transparent);   background: var(--o-ok-dim); }
.o-pill--warn { color: var(--amber);  border-color: color-mix(in oklch, var(--amber) 45%, transparent);  background: var(--o-warn-dim); }
.o-pill--bad  { color: var(--o-bad);  border-color: color-mix(in oklch, var(--o-bad) 50%, transparent);  background: var(--o-bad-dim); }
.o-pill--info { color: var(--o-info); border-color: color-mix(in oklch, var(--o-info) 45%, transparent); background: var(--o-info-dim); }
.o-pill--mute { color: var(--muted); }

.o-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 2px 7px;
  white-space: nowrap;
}

.o-dotm { color: var(--line); padding-inline: 0.15rem; }

/* filter chips */
.o-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.9rem;
  margin-inline: -1rem;
  padding-inline: 1rem;
  -webkit-overflow-scrolling: touch;
}
.o-chips::-webkit-scrollbar { display: none; }
.o-chip {
  flex: none;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.o-chip:hover { border-color: var(--amber); color: var(--amber); }
.o-chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
.o-chip b { font-family: var(--mono); font-size: 0.7rem; opacity: 0.75; }

/* ==========================================================================
   CARDS
   ========================================================================== */
.o-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.95rem;
  transition: border-color .25s ease, transform .25s var(--ease-out), background-color .25s ease;
}
button.o-card, a.o-card { cursor: pointer; }
button.o-card:hover, a.o-card:hover { border-color: color-mix(in oklch, var(--amber) 55%, transparent); background: var(--surface-2); }
.o-stack { display: flex; flex-direction: column; gap: 0.7rem; }

.o-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.o-ref {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.o-card__title {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.18;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: 0.3rem;
}
.o-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  margin-top: 0.55rem;
}
.o-card__line { display: block; font-size: 0.87rem; color: var(--ink-soft); margin-top: 0.55rem; }
.o-card__note {
  font-size: 0.8rem;
  color: var(--amber);
  margin-top: 0.55rem;
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
}
.o-card__note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* programme bar */
.o-prog { display: block; margin-top: 0.85rem; }
.o-prog__track {
  display: block;
  position: relative;
  height: 7px;
  border-radius: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.o-prog__fill {
  display: block;
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
  border-radius: 4px;
}
.o-prog__fill--ok  { background: linear-gradient(90deg, color-mix(in oklch, var(--o-ok) 70%, black), var(--o-ok)); }
.o-prog__fill--bad { background: linear-gradient(90deg, color-mix(in oklch, var(--o-bad) 70%, black), var(--o-bad)); }
.o-prog__plan {
  display: block;
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--ink);
  opacity: 0.85;
}
.o-prog__legend {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ==========================================================================
   TODAY: stat row + alerts
   ========================================================================== */
.o-statrow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.o-statbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.6rem;
  text-align: center;
}
.o-statbox b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
}
.o-statbox span {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.o-statbox--bad b { color: var(--o-bad); }
.o-statbox--warn b { color: var(--amber); }

.o-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}
.o-alert:hover { background: var(--surface-2); }
.o-alert__ico {
  width: 32px; height: 32px;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.o-alert__ico svg { width: 17px; height: 17px; }
.o-alert--bad  { border-color: color-mix(in oklch, var(--o-bad) 40%, transparent); }
.o-alert--bad  .o-alert__ico { background: var(--o-bad-dim); color: var(--o-bad); }
.o-alert--warn { border-color: color-mix(in oklch, var(--amber) 38%, transparent); }
.o-alert--warn .o-alert__ico { background: var(--o-warn-dim); color: var(--amber); }
.o-alert--info .o-alert__ico { background: var(--o-info-dim); color: var(--o-info); }
.o-alert__b { min-width: 0; flex: 1; }
.o-alert__t { display: block; font-weight: 600; color: var(--ink); font-size: 0.95rem; line-height: 1.3; }
.o-alert__s { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.o-alert__go { color: var(--muted); flex: none; align-self: center; }
.o-alert__go svg { width: 18px; height: 18px; }

/* ==========================================================================
   ROWS (documents, stages, definition lists)
   ========================================================================== */
.o-rows { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.o-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: none;
  transition: background-color .2s ease;
}
.o-row:last-child { border-bottom: 0; }
button.o-row { cursor: pointer; }
button.o-row:hover { background: var(--surface-2); }
.o-row__b { flex: 1; min-width: 0; }
.o-row__t { display: block; font-weight: 600; color: var(--ink); font-size: 0.93rem; line-height: 1.3; }
.o-row__s {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.22rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
}
.o-row__r { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.o-mark {
  width: 10px; height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
}
.o-mark--ok { background: var(--o-ok); }
.o-mark--warn { background: var(--amber); }
.o-mark--bad { background: var(--o-bad); }
.o-mark--none { background: none; border: 1.5px dashed var(--line); }

/* stage list */
.o-stage {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
}
.o-stage:last-child { border-bottom: 0; }
.o-stage__tick {
  width: 22px; height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  margin-top: 1px;
}
.o-stage__tick svg { width: 12px; height: 12px; }
.o-stage.is-done .o-stage__tick { background: var(--o-ok); border-color: var(--o-ok); color: var(--bg-deep); }
.o-stage.is-now .o-stage__tick { border-color: var(--amber); box-shadow: inset 0 0 0 3px var(--amber); }
.o-stage__b { flex: 1; min-width: 0; }
.o-stage__t { display: block; font-size: 0.92rem; color: var(--ink); line-height: 1.35; }
.o-stage.is-done .o-stage__t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.o-stage__d {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  display: block;
}
button.o-stage { cursor: pointer; }
button.o-stage:hover .o-stage__tick { border-color: var(--amber); }

/* definition list */
.o-dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.o-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.o-dl > div:last-child { border-bottom: 0; }
.o-dl dt {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
  padding-top: 3px;
}
.o-dl dd { text-align: right; color: var(--ink); font-size: 0.9rem; min-width: 0; overflow-wrap: anywhere; }

/* ==========================================================================
   SITE LOG
   ========================================================================== */
.o-log { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.95rem; }
.o-log__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.o-log__date {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.o-log__work { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.6rem; }
.o-log__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  margin-top: 0.65rem;
}
.o-held {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.78rem;
  color: var(--amber);
  border: 1px solid color-mix(in oklch, var(--amber) 34%, transparent);
  background: var(--o-warn-dim);
  border-radius: 3px;
  padding: 2px 8px;
}
.o-held svg { width: 13px; height: 13px; flex: none; }
.o-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.o-photo {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in oklch, var(--amber) 7%, transparent) 7px 14px),
    var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  padding: 4px;
}
.o-photo svg { width: 18px; height: 18px; opacity: 0.65; }
.o-photo span {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.o-photo__note {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ==========================================================================
   SHEET (bottom sheet on phone, side panel on desktop)
   ========================================================================== */
.o-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: oklch(0.10 0.008 255 / 0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  backdrop-filter: blur(2px);
}
.o-scrim.is-open { opacity: 1; pointer-events: auto; }

.o-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 95;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  transform: translateY(101%);
  transition: transform .38s var(--ease-out);
  visibility: hidden;
}
.o-sheet.is-open { transform: none; visibility: visible; }
.o-sheet__grip {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 0.6rem auto 0;
  flex: none;
}
.o-sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.o-sheet__head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.22rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.o-sheet__head .o-ref { display: block; margin-bottom: 0.25rem; }
.o-sheet__body {
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.o-sheet__foot {
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  display: flex;
  gap: 0.5rem;
  flex: none;
}
.o-sheet__foot .btn { flex: 1; }

.o-sec { margin-top: 1.5rem; }
.o-sec:first-child { margin-top: 0; }
.o-sec > h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* small action buttons */
.o-acts { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.o-mini {
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.o-mini svg { width: 15px; height: 15px; }
.o-mini:hover { border-color: var(--amber); color: var(--amber); }
.o-mini--on { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.o-mini--on:hover { color: var(--amber-ink); background: var(--amber-bright); }

/* forms inside sheets reuse .field from style.css */
.o-sheet .field { margin-bottom: 1rem; }
.o-sheet .field input,
.o-sheet .field select,
.o-sheet .field textarea { min-height: 46px; }
.o-sheet .field textarea { min-height: 92px; }

.o-checkline {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.o-checkline:last-of-type { border-bottom: 0; }
.o-checkline input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--amber); }
.o-checkline__b { flex: 1; min-width: 0; }
.o-checkline__t { display: block; font-size: 0.9rem; color: var(--ink); line-height: 1.35; }
.o-checkline__s { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }

.o-out {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   TOAST / EMPTY
   ========================================================================== */
.o-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--o-bar) + 14px);
  z-index: 120;
  transform: translate(-50%, 20px);
  max-width: min(90vw, 24rem);
  background: var(--ink);
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 14px 40px -12px oklch(0 0 0 / 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s var(--ease-out);
}
.o-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.o-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.o-foot {
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  margin-top: 2.5rem;
  padding-block: 1.6rem;
}
.o-foot__in { display: flex; flex-direction: column; gap: 0.8rem; }
.o-foot a { color: var(--ink-soft); }
.o-foot a:hover { color: var(--amber); }
.o-foot .credit { font-size: 0.82rem; color: var(--muted); }
.o-foot .credit a { color: var(--amber); font-weight: 500; }
.o-foot .datum { font-size: 0.62rem; }
.o-back { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; font-size: 0.9rem; min-height: 44px; }
.o-back svg { width: 16px; height: 16px; color: var(--amber); }

/* ==========================================================================
   BREAKPOINTS
   ========================================================================== */
@media (max-width: 899px) {
  :root { --o-bar: 59px; }
  .o-tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 480px) {
  .o-wrap { padding-inline: 1.5rem; }
  .o-chips { margin-inline: -1.5rem; padding-inline: 1.5rem; }
  .o-h { font-size: 2rem; }
  .o-statrow { gap: 0.7rem; }
}

@media (min-width: 900px) {
  :root { --o-bar: 0px; }

  .o-bar__row { min-height: 68px; }
  .o-bar__inner { display: flex; align-items: center; gap: 1.2rem; }
  .o-switch {
    margin-bottom: 0;
    grid-template-columns: auto auto;
    flex: none;
  }
  .o-switch__btn { padding-inline: 1rem; }
  .o-bar__wrap { display: flex; align-items: center; gap: 1rem; }

  .o-shell {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    padding-top: 2rem;
    padding-bottom: 3rem;
  }
  .o-tabs {
    position: sticky;
    top: 88px;
    left: auto; right: auto; bottom: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: none;
    backdrop-filter: none;
    border-top: 0;
    padding-bottom: 0;
  }
  .o-tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.7rem;
    min-height: 46px;
    padding: 0 0.8rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
  }
  .o-tab span { font-size: 0.7rem; letter-spacing: 0.1em; text-align: left; }
  .o-tab[aria-selected="true"] {
    background: var(--surface);
    border-color: color-mix(in oklch, var(--amber) 40%, transparent);
  }
  .o-tab[aria-selected="true"]::before { top: 8px; bottom: 8px; left: -1px; right: auto; width: 2px; height: auto; }
  .o-tab__dot { position: static; margin-left: auto; }

  .o-chips { margin-inline: 0; padding-inline: 0; }
  .o-statrow { grid-template-columns: repeat(3, 1fr); max-width: 34rem; }
  .o-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; align-items: start; }
  .o-h { font-size: 2.3rem; }

  .o-sheet {
    top: 0; bottom: 0;
    left: auto;
    width: min(560px, 100vw);
    max-height: none;
    border-radius: 0;
    border-left: 1px solid var(--line);
    border-top: 0;
    transform: translateX(101%);
    transition: transform .4s var(--ease-out);
  }
  .o-sheet__grip { display: none; }
  .o-sheet__head { padding-top: 1.2rem; }
  .o-sheet__body { padding: 1.4rem; }

  .o-foot__in { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
}

@media (min-width: 1120px) {
  .o-grid2 { gap: 1rem; }
}

/* ---- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .o-sheet, .o-scrim, .o-toast, .o-card, .o-chip, .o-mini, .o-row, .o-alert { transition-duration: 0.01ms !important; }
}

/* website nav in the office footer, so every page stays reachable */
.o-foot__nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-size: 0.85rem; }
.o-foot__nav a { white-space: nowrap; }
