:root {
  --ink: #171717;
  --muted: #6a6a6a;
  --paper: #eeeeee;
  --card: #ffffff;
  --line: #d9d9d9;
  --accent: #c83e49;
  --accent-soft: #fae9eb;
  --change: #1769aa;
  --danger: #a72f3a;
  --photo-mat: #e8e6e1;
  --shadow: 0 8px 28px rgba(0, 0, 0, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, input[type="checkbox"] { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(200, 62, 73, .28);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.center-card {
  position: relative;
  width: min(92vw, 520px);
  margin: 14vh auto;
  padding: 36px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}
#loading.center-card {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  width: auto;
  min-height: 100dvh;
  margin: 0;
  padding: 24px;
  place-content: center;
  justify-items: center;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}
#loading.center-card p { margin: 0; color: var(--muted); }
.center-language-toggle { position: absolute; top: 18px; right: 18px; }
.center-card h1 { margin: 4px 0 12px; font: 700 2rem/1.1 Georgia, serif; }
.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font: 700 18px/1 Georgia, serif;
  letter-spacing: .08em;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.muted, .optional { color: var(--muted); }
.optional { font-weight: 500; }

.site-header {
  padding: max(24px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 22px max(22px, env(safe-area-inset-left));
  border-top: 8px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: white;
}
.compact-header { display: none; }
.header-inner, .summary-row, .page-shell {
  width: min(980px, 100%);
  margin-inline: auto;
}
.header-inner { display: block; }
.punch-nav-row {
  position: relative;
  z-index: 5;
  display: grid;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #ebe8e2;
}
.punch-nav-leading { min-width: 0; }
.punch-nav-actions { justify-self: end; }
.project-copy { padding-top: 20px; }
.project-brand { margin-bottom: 7px; }
.site-header h1 { margin: 0; font: 700 clamp(2rem, 5vw, 3.2rem)/1.05 Georgia, serif; letter-spacing: -.025em; }
.builder-project-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-right: 8px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.builder-project-back:hover { color: var(--accent); }
.builder-project-back:focus-visible,
.compact-builder-project-back:focus-visible { outline: 3px solid rgba(200, 62, 73, .28); outline-offset: 3px; }
.subtitle { max-width: 600px; margin: 9px 0 0; color: var(--muted); }
.identity-wrap, .project-status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-status-line { margin-top: 18px; color: var(--muted); font-size: .88rem; }
.identity-button {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-weight: 750;
}
.sync-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; }
.sync-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sync-state[data-state="saving"]::before { background: #777; }
.sync-state[data-state="pending"]::before { background: #a56c00; }
.sync-state[data-state="review"]::before, .sync-state[data-state="offline"]::before { background: var(--danger); }
.last-synced { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.text-button { display: inline-flex; min-height: 44px; padding: 7px 2px; align-items: center; border: 0; color: var(--muted); background: transparent; text-decoration: underline; }
.language-toggle { display: inline-flex; min-height: 44px; padding: 7px 9px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-weight: 750; }
.language-toggle:hover { background: var(--accent-soft); }
.punch-more-wrap { position: relative; }
.punch-more-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #cbc7c0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  letter-spacing: .08em;
}
.punch-more-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.punch-more-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  width: 202px;
  overflow: hidden;
  border: 1px solid #cac6bf;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(41, 34, 30, .2);
}
.punch-menu-action {
  display: flex;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  align-items: center;
  border: 0;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}
.punch-menu-action + .punch-menu-action { border-top: 1px solid #ece9e4; }
.punch-menu-action:hover, .punch-menu-action:focus-visible { background: #faf1f2; }
.export-dialog-shell { display: grid; gap: 18px; padding: 24px; }
.export-dialog-shell .dialog-heading { margin: 0; }
.export-intro, .export-footnote { margin: 0; color: var(--muted); }
.export-intro { font-size: .95rem; }
.export-footnote { font-size: .78rem; }
.export-options { display: grid; gap: 11px; }
.export-option { display: grid; gap: 4px; min-height: 82px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; text-decoration: none; }
.export-option:hover, .export-option:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 62, 73, .12); outline: 0; }
.export-option-primary { color: white; border-color: var(--accent); background: var(--accent); }
.export-option-primary:hover, .export-option-primary:focus-visible { border-color: var(--danger); background: var(--danger); }
.export-option-title { font-weight: 850; }
.export-option-copy { color: var(--muted); font-size: .84rem; line-height: 1.42; }
.export-option-primary .export-option-copy { color: #fff; }
.language-toggle.is-translating::before { content: ""; width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: language-spin .7s linear infinite; }
.translation-status {
  display: inline-flex;
  min-height: 36px;
  max-width: 300px;
  padding: 7px 11px;
  align-items: center;
  gap: 7px;
  border: 1px solid #d5ad64;
  border-radius: 999px;
  color: #704700;
  background: #fff4d7;
  font-size: .76rem;
  font-weight: 750;
}
.translation-status::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: language-spin .7s linear infinite;
}
.translation-status[data-state="delayed"] { color: #842a22; border-color: #d9a39d; background: #fde9e6; }
.translation-status[data-state="delayed"]::before { content: "!"; display: grid; height: 17px; border: 0; place-items: center; animation: none; font-weight: 900; }
@keyframes language-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .language-toggle.is-translating::before,
  .translation-status::before,
  .detail-edit-status[data-state="saving"]::before { animation: none; border-right-color: currentColor; opacity: .55; }
}
.print-button { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 11px; border: 1px solid #bdbdbd; border-radius: 999px; color: var(--ink); background: white; font-weight: 750; text-decoration: none; }
.print-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.summary-row { margin-top: 22px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: .86rem; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e5e5e5; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }

.page-shell { padding: 26px 22px 110px; }
.list-filter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: min(520px, 100%); margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #eceae5; }
.list-filter.has-archive { width: min(650px, 100%); grid-template-columns: repeat(5, 1fr); }
.list-filter button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 800; }
.list-filter button.selected { color: white; background: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.16); }
.list-filter button span:last-child { margin-left: 4px; font-variant-numeric: tabular-nums; }
/* Ready-for-review work is quiet at zero and clearly perceptible above it. */
.list-filter button.has-ready { color: #7b4a12; background: #fdf1dc; }
.list-filter button.has-ready.selected { color: white; background: var(--accent); }
.trade-filter-section { margin: 0 0 28px; }
.trade-filter-label { margin: 0 0 7px 2px; color: var(--muted); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.trade-filter { display: flex; max-width: 100%; gap: 7px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 2px 2px 7px; scrollbar-width: none; }
.trade-filter::-webkit-scrollbar { display: none; }
.trade-filter button { display: inline-flex; min-height: 40px; flex: 0 0 auto; padding: 8px 12px; align-items: center; gap: 6px; border: 1px solid #c8c8c8; border-radius: 999px; color: #555; background: white; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.trade-filter button.selected { border-color: var(--accent); color: white; background: var(--accent); box-shadow: 0 2px 8px rgba(105, 27, 35, .18); }
.trade-filter [data-trade-count] { min-width: 1ch; font-variant-numeric: tabular-nums; }
.list-section + .list-section { margin-top: 38px; }
.list-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px 9px;
  border-bottom: 1px solid #c9c9c9;
}
.list-section-heading h2 { margin: 0; font: 700 1.55rem/1.2 Georgia, serif; }
.list-section-heading span { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.item-grid { display: grid; gap: 12px; }
.punch-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .04);
  cursor: pointer;
  transition: border-color .18s, opacity .18s, background .18s;
}
.punch-item:hover { border-color: #bfbfbf; }
.punch-item.pending-sync { border-color: #d6af64; box-shadow: inset 3px 0 #c68a1b; }
.punch-item.needs-review { border-color: #c87970; box-shadow: inset 3px 0 var(--danger); }
.punch-item.is-done { background: #f7f7f7; }
.punch-item.is-done h3 { text-decoration: line-through; text-decoration-color: #777; }
.punch-item.is-done.needs-review h3 { text-decoration: none; }
.punch-item.is-ready { border-color: #cfa96b; box-shadow: inset 3px 0 #b8801f, 0 3px 14px rgba(0, 0, 0, .04); }
.punch-item.is-archived { border-color: #d4d0ca; background: #f4f2ef; box-shadow: none; }
.punch-item.is-archived > :not(.item-heading) { opacity: .78; }
.dependency-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #dfbd79;
  border-left: 4px solid #b77912;
  border-radius: 11px;
  background: #fff7e6;
}
.punch-item > .dependency-banner { margin-top: 13px; }
.dependency-banner.dependency-received { border-color: #acd2c1; border-left-color: #2e8063; background: #edf8f3; }
.dependency-banner.dependency-empty { border-style: dashed; border-left-width: 1px; border-color: var(--line); background: #fafafa; }
.dependency-copy { display: grid; min-width: 0; gap: 2px; }
.dependency-title { overflow-wrap: anywhere; font-size: .84rem; line-height: 1.35; }
.dependency-subtitle { color: #72521c; font-size: .75rem; line-height: 1.35; }
.dependency-received .dependency-subtitle { color: #28644f; }
.dependency-empty .dependency-subtitle { color: var(--muted); }
.dependency-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.dependency-action { min-height: 38px; padding: 7px 10px; font-size: .78rem; white-space: nowrap; }
.dependency-copy .translation-disclosure { margin-top: 4px; }
.status-badge { display: inline-flex; margin-top: 7px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.status-badge.open { color: #4d4a45; background: #e8e5df; }
.status-badge.ready { color: #7b4a12; background: #fdf1dc; }
.status-badge.verified { color: #1c5c46; background: #e3f2ec; }
.status-badge.archived { color: #625b56; background: #e5e1dc; }
.trade-tag { display: inline-flex; min-height: 38px; margin: 10px 0 0; padding: 7px 11px; align-items: center; gap: 6px; border: 1px solid #bfc8c3; border-radius: 999px; color: #264b3e; background: #edf4f1; font-size: .76rem; font-weight: 800; line-height: 1.1; }
button.trade-tag:hover { border-color: #6d9183; background: #e2efea; }
.trade-tag.unassigned { border-style: dashed; color: #5f5b55; background: #f8f7f4; }
.trade-tag::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; opacity: .72; }
.trade-tag.unassigned::before { content: "+"; display: grid; width: 13px; height: 13px; place-items: center; background: transparent; opacity: 1; font-size: .9rem; }
.completion-review, .acceptance-evidence, .detail-completion-evidence { display: grid; gap: 10px; }
.punch-item > .completion-review { margin-top: 13px; }
.completion-request-summary {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.completion-request-summary.without-photo { grid-template-columns: minmax(0, 1fr); }
.completion-request-thumbnail { display: block; width: 54px; height: 48px; overflow: hidden; border-radius: 8px; background: var(--photo-mat); }
.completion-request-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--photo-mat); }
.completion-request-copy { display: grid; min-width: 0; gap: 2px; }
.completion-request-copy strong { font-size: .84rem; }
.completion-request-copy span { color: var(--muted); font-size: .74rem; }
.completion-evidence-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #faf9f6; }
.completion-evidence-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px; background: white; }
.completion-evidence-heading-copy { display: grid; min-width: 0; gap: 3px; }
.completion-evidence-heading h4 { margin: 0; font: 700 1rem/1.25 Georgia, serif; }
.completion-evidence-meta { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.completion-evidence-state { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: #1c6a4f; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.completion-evidence-state.verified { color: #1c5c46; }
.completion-evidence-photos { margin: 0; }
.completion-evidence-stage { position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #121212; }
.photo-button.completion-evidence-primary { display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #121212; }
.photo-button.completion-evidence-primary img { display: block; width: 100%; height: clamp(190px, 42vw, 360px); object-fit: contain; background: #121212; }
.completion-evidence-count { position: absolute; right: 9px; bottom: 9px; padding: 4px 7px; border-radius: 999px; color: white; background: rgba(18, 18, 18, .78); font-size: .7rem; font-weight: 800; pointer-events: none; }
.completion-evidence-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; color: var(--muted); background: white; font-size: .76rem; }
.completion-evidence-caption span:first-child { color: var(--ink); font-weight: 750; }
.completion-evidence-thumbnails { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; padding: 0 12px 12px; background: white; }
.photo-button.completion-evidence-thumbnail { min-height: 72px; border-radius: 9px; background: #121212; }
.photo-button.completion-evidence-thumbnail img { height: 76px; object-fit: contain; background: #121212; }
.completion-evidence-note { margin: 12px; padding: 10px 11px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.completion-evidence-note-label { display: block; margin-bottom: 4px; color: var(--accent); font-size: .72rem; }
.completion-evidence-note-text { margin: 0; white-space: pre-wrap; }
.completion-evidence-empty { margin: 12px; color: var(--muted); font-size: .82rem; }
.completion-compare-prompt { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0 2px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.completion-compare-icon { display: grid; flex: 0 0 20px; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #704700; background: #fff0c9; font-weight: 800; }
.acceptance-evidence { padding: 0; background: transparent; }
.detail-completion-evidence { padding-top: 2px; }
.detail-completion-evidence .completion-evidence-heading h4 { font-size: 1.08rem; }
.detail-completion-card { padding: 15px 17px; border: 1px solid #e0bec3; border-radius: 16px; background: #fff8f8; }
.detail-completion-kicker { display: block; margin-bottom: 4px; color: #9d303d; font-size: .66rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.detail-completion-title { margin: 0 0 7px; font: 700 1.12rem/1.25 Georgia, serif; }
.detail-completion-note, .detail-completion-empty { margin: 0; color: #514c47; font-size: .9rem; line-height: 1.48; white-space: pre-wrap; }
.detail-completion-meta-row { display: flex; min-width: 0; align-items: center; gap: 10px; margin-top: 12px; }
.detail-completion-photos { display: flex; flex: 0 1 auto; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.detail-completion-photos::-webkit-scrollbar { display: none; }
.photo-button.detail-completion-photo { flex: 0 0 68px; width: 68px; min-height: 52px; height: 52px; border-radius: 9px; background: var(--photo-mat); }
.photo-button.detail-completion-photo img { width: 100%; height: 100%; object-fit: contain; background: var(--photo-mat); }
.detail-completion-meta { min-width: 0; margin: 0; color: #77716b; font-size: .75rem; line-height: 1.35; }
.item-heading { display: flex; align-items: flex-start; gap: 12px; }
.state-indicator {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  place-items: center;
  border-radius: 50%;
  color: #5a5550;
  background: #efede9;
  font-size: .9rem;
  font-weight: 900;
}
.state-indicator.complete { color: #1c5c46; background: #e3f2ec; }
.state-indicator.pending { color: #704700; background: #fff0c9; }
.item-title-wrap { min-width: 0; flex: 1 1 auto; }
.item-detail-open {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -8px -8px -8px auto;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font: 800 1.55rem/1 Georgia, serif;
}
.item-detail-open:hover { border-color: var(--line); color: var(--ink); background: #f8f7f4; }
.item-detail-open:focus-visible { border-color: var(--accent); outline: 3px solid var(--accent-soft); color: var(--accent); background: white; }
.sync-badge { display: inline-flex; margin-top: 7px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.sync-badge.pending { color: #704700; background: #fff0c9; }
.sync-badge.review { color: #842a22; background: #fde3df; }
.review-action { display: block; margin-top: 7px; padding: 0; border: 0; color: #842a22; background: transparent; font-size: .72rem; font-weight: 750; text-decoration: underline; }
.item-number { display: block; margin-bottom: 2px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.item-title-wrap h3 { margin: 0; font: 700 1.2rem/1.28 Georgia, serif; }
.work-instructions { display: grid; gap: 5px; margin: 13px 0 0; color: #3e3e3e; }
.work-instructions-label { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.work-instructions-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.shared-note { margin: 13px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); }
.reopen-note { border-left-color: #a56c00; background: #fff4d7; }
.shared-note-text { margin: 0; }
.pending-translation { margin: 7px 0 0; color: #704700; font-size: .75rem; font-weight: 700; }
.translation-field-status { margin: 7px 0 0; color: #704700; font-size: .75rem; font-weight: 700; }
.translation-field-status.delayed { color: #842a22; }
.translation-disclosure { margin-top: 7px; color: #626262; font-size: .75rem; font-weight: 600; cursor: default; }
.translation-disclosure.indented-disclosure { margin-left: 0; }
.translation-disclosure summary { width: fit-content; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.translation-original { margin: 7px 0 0; padding: 8px 10px; border-radius: 7px; color: #333; background: #f2f2f2; white-space: pre-wrap; font-size: .82rem; font-weight: 500; }
.shared-note .translation-original { background: rgba(255, 255, 255, .72); }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 15px 0 0; }
.photo-button { min-height: 110px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--photo-mat); }
.photo-button img { display: block; width: 100%; height: 145px; object-fit: contain; background: var(--photo-mat); }
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 15px 0 0;
}
.punch-item.has-state-indicator .work-instructions,
.punch-item.has-state-indicator .shared-note,
.punch-item.has-state-indicator .photo-strip,
.punch-item.has-state-indicator .translation-disclosure.indented-disclosure { margin-left: 40px; }
.punch-item.has-state-indicator > .trade-tag { margin-left: 40px; }
.punch-item.has-state-indicator .item-actions { margin-left: 40px; }
.item-action {
  min-width: min(100%, 144px);
  min-height: 44px;
  white-space: normal;
  line-height: 1.2;
}
.empty-state { margin: 50px auto; padding: 34px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: white; }
.empty-state h2 { margin-top: 0; font-family: Georgia, serif; }

.add-button {
  position: fixed;
  z-index: 30;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: inline-flex;
  min-height: 54px;
  padding: 8px 18px 8px 10px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  box-shadow: 0 10px 30px rgba(105, 27, 35, .28);
  font-weight: 800;
}
.add-button:hover { background: #aa303c; }
.add-symbol { display: grid; width: 38px; height: 38px; place-items: center; font: 300 2rem/1 sans-serif; }

form label { display: grid; gap: 6px; color: #3f3f3f; font-size: .84rem; font-weight: 750; }
.floor-field { display: grid; gap: 7px; color: #3f3f3f; font-size: .84rem; font-weight: 750; }
.floor-field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.floor-options-viewport { position: relative; min-width: 0; overflow: hidden; }
.floor-options-viewport::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 6px;
  width: 24px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), white);
  content: "";
  pointer-events: none;
}
.detail-task-sheet .floor-options-viewport::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0), white); }
.floor-options {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 28px 6px 2px;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}
.floor-options::-webkit-scrollbar { display: none; }
.floor-option {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 44px;
  padding: 8px 7px;
  border: 1px solid #c4c4c4;
  border-radius: 10px;
  color: #3f3f3f;
  background: white;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.15;
  scroll-snap-align: start;
  touch-action: manipulation;
}
.floor-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.floor-option[aria-pressed="true"] { border-color: var(--accent); color: white; background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.floor-option[aria-pressed="true"]:hover { background: var(--danger); }
.field-help { color: var(--muted); font-size: .76rem; font-weight: 550; line-height: 1.4; }
.character-counter { justify-self: end; color: var(--muted); font-size: .7rem; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.character-counter[data-state="warning"] { color: #704700; }
.character-counter[data-state="reached"] { color: var(--danger); font-weight: 800; }
input:not([type="checkbox"]):not([type="file"]), textarea, select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #c4c4c4;
  border-radius: 10px;
  color: var(--ink);
  background: white;
}
textarea { resize: vertical; }
dialog {
  max-width: calc(100vw - 24px);
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .28);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.form-dialog { width: min(560px, calc(100vw - 24px)); padding: 0; }
.form-dialog form { display: grid; gap: 16px; padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 0; font: 700 1.65rem/1.15 Georgia, serif; }
.primary-button, .secondary-button, .icon-button {
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 750;
}
.primary-button { border: 1px solid var(--accent); color: white; background: var(--accent); }
.danger-button { border-color: #9d2935; background: #9d2935; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.icon-button { width: 44px; padding: 0; border: 1px solid var(--line); background: white; font-size: 1.5rem; }
button:disabled { cursor: wait; opacity: .58; }
button.awaiting-input:disabled { cursor: not-allowed; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.trade-dialog { width: min(560px, 100vw); max-width: 100vw; margin: auto auto 0; padding: 0; border-radius: 20px 20px 0 0; }
.trade-sheet { display: grid; gap: 16px; padding: 24px 24px max(24px, env(safe-area-inset-bottom)); }
.trade-item-title { margin: -4px 0 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
.trade-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.trade-options button { min-height: 50px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; font-weight: 800; text-align: left; }
.trade-options button:hover { border-color: #8aa99d; background: #f0f6f3; }
.trade-options button.selected { border-color: #497b68; color: #174c39; background: #e2f0ea; box-shadow: inset 0 0 0 1px #497b68; }
.trade-options button.selected::after { content: "✓"; float: right; }
.duplicate-dialog { width: min(560px, calc(100vw - 28px)); }
.duplicate-list { display: grid; gap: 9px; margin: 16px 0 20px; }
.duplicate-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #faf9f6; }
.duplicate-row:not(:has(img)) { grid-template-columns: 1fr; }
.duplicate-row img { width: 72px; height: 62px; border-radius: 8px; object-fit: contain; background: var(--photo-mat); }
.duplicate-copy { display: grid; gap: 4px; }
.duplicate-copy span { color: var(--muted); font-size: .82rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.task-field textarea { min-height: 96px; }
.instructions-field textarea, .notes-field textarea { min-height: 132px; font-weight: 500; line-height: 1.45; }
.completion-item-title { margin: -3px 0 0; padding: 11px 13px; border-radius: 10px; background: #f4f4f4; font-weight: 750; }
.completion-dialog {
  max-height: calc(var(--completion-viewport-height, 100dvh) - 24px);
}
.completion-dialog form {
  --completion-dialog-inline-padding: 24px;
  max-height: calc(var(--completion-viewport-height, 100dvh) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0;
}
.completion-dialog textarea { min-height: 92px; }
.reopen-reason-field {
  scroll-margin-top: 12px;
  padding: 14px;
  border: 2px solid #d5ad64;
  border-radius: 13px;
  background: #fff8e8;
}
.reopen-reason-field .field-help { color: #704700; font-size: .78rem; font-weight: 650; line-height: 1.4; }
.reopen-reason-field textarea { border-color: #ba8b35; }
.completion-dialog .dialog-actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  margin-inline: calc(-1 * var(--completion-dialog-inline-padding));
  padding: 12px var(--completion-dialog-inline-padding) max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
}
.detail-review-reason { margin: 0; }
.completion-photo-field { display: grid; gap: 7px; }
.completion-photo-label { font-size: .84rem; font-weight: 750; }
.completion-photo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 2px; }
.completion-photo-actions .photo-attach-button { justify-self: stretch; min-width: 0; padding-inline: 10px; text-align: center; }
.completion-photo-preview { grid-template-columns: minmax(0, 1fr); }
.photo-preview > div { display: grid; gap: 10px; min-width: 0; }
.selected-photo-summary { color: var(--ink); font-size: .82rem; font-weight: 800; }
.selected-photo-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.selected-photo-thumbnail { position: relative; width: 92px; height: 82px; overflow: hidden; border-radius: 9px; background: #262626; }
.photo-preview .selected-photo-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.selected-photo-markup { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.photo-preview-copy { display: grid; min-width: 0; align-content: start; gap: 7px; }
.selected-photo-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.selected-photo-label { color: var(--ink); font-size: .88rem; }
.photo-file-name { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.photo-preview-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.photo-preview-action {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #c8c8c8;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font-size: .78rem;
  font-weight: 750;
}
.photo-preview-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.photo-remove-button { color: var(--danger); }
.photo-marked-label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; color: #17372c; background: #e3f2ec; font-size: .68rem; font-weight: 800; }
.shared-note > .completion-evidence-photos { margin-top: 10px; }
.completion-evidence-label { display: block; margin-bottom: 8px; font-size: .8rem; }
form .photo-attach-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 750;
}
.item-photo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-attach-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.photo-attach-button .photo-attach-icon { color: var(--accent); font-size: 1.25rem; line-height: 1; }
.photo-camera-icon { position: relative; width: 20px; height: 15px; flex: 0 0 auto; border: 2px solid var(--accent); border-radius: 4px; }
.photo-camera-icon::before { position: absolute; top: -5px; left: 3px; width: 8px; height: 4px; border-radius: 2px 2px 0 0; background: var(--accent); content: ""; }
.photo-camera-icon::after { position: absolute; top: 3px; left: 6px; width: 5px; height: 5px; border: 2px solid var(--accent); border-radius: 50%; content: ""; }
.photo-attach-button .optional { color: var(--muted); font-size: .8rem; font-weight: 650; }
.visually-hidden:focus-visible + .photo-attach-button { outline: 3px solid rgba(200, 62, 73, .25); outline-offset: 2px; }
.photo-preview { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #faf9f6; font-size: .8rem; overflow-wrap: anywhere; }
.photo-preview img { width: 82px; height: 68px; border-radius: 7px; object-fit: contain; background: var(--photo-mat); }
.lightbox { width: min(1100px, calc(100vw - 20px)); padding: 14px; background: #101010; }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: auto; object-fit: contain; }
.lightbox p { margin: 10px 40px 0; color: white; text-align: center; }
.lightbox-close { position: absolute; z-index: 1; top: 12px; right: 12px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.65); font-size: 1.5rem; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: max(90px, calc(env(safe-area-inset-bottom) + 80px)); max-width: min(360px, calc(100vw - 44px)); padding: 12px 16px; border-radius: 11px; color: white; background: var(--accent); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #ededed; }
.mode-switch button { min-height: 44px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 800; }
.mode-switch button.selected { color: var(--ink); background: white; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.add-dialog { width: min(690px, calc(100vw - 24px)); }
.add-dialog form { max-height: calc(var(--add-viewport-height, 100dvh) - 32px); overflow-y: auto; }
#single-item-panel { display: grid; grid-auto-rows: max-content; align-content: start; gap: 16px; }
#single-item-panel .photo-attach-button { width: 100%; justify-self: stretch; }
.optional { color: var(--muted); font-weight: 600; }
.muted { margin: 0; color: var(--muted); }
.bulk-selection-status { min-height: 22px; color: var(--muted); font-size: .82rem; }
.bulk-actions, .bulk-draft-card-actions, .detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bulk-draft-list { display: grid; gap: 12px; }
.bulk-draft { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.bulk-draft.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.bulk-draft-heading { display: flex; align-items: center; gap: 10px; }
.bulk-draft-select { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.bulk-draft-heading input { width: 22px; height: 22px; }
.bulk-draft-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.bulk-draft-photo { position: relative; min-width: 0; }
.bulk-draft-photo img { display: block; width: 100%; height: 96px; border-radius: 8px; object-fit: contain; background: var(--photo-mat); }
.bulk-remove-photo { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; color: white; background: rgba(0,0,0,.7); }
.bulk-draft-card-actions { justify-content: space-between; }
.bulk-draft-card-actions label.text-button { cursor: pointer; font-size: .9rem; }
.bulk-publish-nudge { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid #d5ad64; border-radius: 12px; background: #fff8e8; }
.bulk-publish-nudge[hidden] { display: none; }
.bulk-publish-nudge p { margin: 0; color: #594016; font-size: .88rem; font-weight: 700; line-height: 1.4; }
.bulk-publish-nudge-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.detail-dialog { width: min(760px, 100vw); max-width: 100vw; height: min(900px, var(--detail-viewport-height, 100dvh)); max-height: var(--detail-viewport-height, 100dvh); padding: 0; overflow: hidden; border-radius: 14px; }
.detail-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; border-top: 6px solid var(--accent); background: var(--paper); }
.detail-header { position: relative; z-index: 10; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; min-height: 64px; padding: max(8px, env(safe-area-inset-top)) 14px 8px; isolation: isolate; border-bottom: 1px solid var(--line); background: #fff; transform: translateZ(0); }
.detail-header-copy { display: grid; min-width: 0; justify-items: center; text-align: center; pointer-events: none; }
.detail-header-copy .item-number { margin: 0; }
.detail-header-copy h2 { margin: 0; font: 700 1.18rem/1.2 Georgia, serif; }
.detail-nav-button { position: relative; z-index: 1; display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 0; border-radius: 12px; appearance: none; -webkit-appearance: none; color: var(--ink); background: transparent; font-weight: 800; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: rgba(200, 62, 73, .16); -webkit-user-select: none; user-select: none; }
.detail-nav-button:hover { background: #faf1f2; }
.detail-back-button { justify-self: start; font-size: 2rem; line-height: 1; }
.detail-more-wrap { position: relative; justify-self: end; }
.detail-more-button { font-size: 1rem; letter-spacing: .08em; }
.detail-more-menu { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; width: min(240px, calc(100vw - 28px)); overflow: hidden; border: 1px solid #cec9c2; border-radius: 13px; background: #fff; box-shadow: 0 14px 36px rgba(28, 23, 20, .18); }
.detail-menu-action { display: block; width: 100%; min-height: 48px; padding: 11px 14px; border: 0; color: var(--ink); background: #fff; font-weight: 750; text-align: left; }
.detail-menu-action + .detail-menu-action { border-top: 1px solid #e6e2dc; }
.detail-menu-action:hover, .detail-menu-action:focus-visible { background: #faf1f2; }
.detail-content { display: grid; min-height: 0; align-content: start; grid-auto-rows: max-content; gap: 16px; overflow-y: scroll; overscroll-behavior: contain; touch-action: pan-y; padding: 16px 18px 20px; }
.detail-content label { display: grid; gap: 6px; color: #3f3f3f; font-size: .84rem; font-weight: 750; }
.detail-status-panel { display: grid; padding: 1px 2px 0; }
.detail-status-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.detail-status-panel .status-badge { margin: 0; }
.detail-status-row .detail-trade { min-width: 0; margin-left: auto; }
.detail-status-row .trade-tag { min-height: 40px; max-width: min(62vw, 280px); margin: 0; padding: 6px 4px 6px 10px; overflow: hidden; border: 0; color: #8f2f3a; background: transparent; text-overflow: ellipsis; white-space: nowrap; }
.detail-dependency { display: block; }
.detail-dependency .dependency-banner { padding: 11px 13px; }
.detail-task-sheet { overflow: hidden; border: 1px solid #d0ccc5; border-radius: 18px; background: #fff; box-shadow: 0 5px 16px rgba(41, 34, 30, .05); }
.detail-task-field { display: grid; gap: 7px; padding: 15px 17px; }
.detail-task-field + .detail-task-field { border-top: 1px solid #e1ddd7; }
.detail-field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.detail-readonly-field { display: grid; gap: 6px; }
.detail-field-label { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.detail-task-sheet textarea, .detail-task-sheet input { display: block; width: 100%; padding: 7px; border: 1px solid transparent; border-radius: 9px; background: transparent; }
.detail-task-sheet textarea { resize: none; }
.detail-task-sheet textarea:focus, .detail-task-sheet input:focus { border-color: rgba(200, 62, 73, .42); background: #fff8f8; box-shadow: 0 0 0 2px rgba(200, 62, 73, .13); }
#detail-title { min-height: 64px; font: 700 1.24rem/1.22 Georgia, serif; }
.detail-floor-options .floor-option { min-height: 40px; }
#detail-notes { min-height: 102px; font-size: .875rem; font-weight: 500; line-height: 1.48; }
.detail-readonly-field p { margin: 0; padding: 7px; border: 0; background: transparent; font-size: 1rem; font-weight: 700; white-space: pre-wrap; }
#detail-floor-readonly p { font-size: .92rem; font-weight: 650; }
#detail-notes-readonly p { font-weight: 500; line-height: 1.48; }
.detail-photo-section { display: grid; gap: 11px; }
.detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.detail-section-heading h3 { margin: 0; font: 700 1rem/1.25 Georgia, serif; }
.detail-section-heading span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.detail-photo-stage { position: relative; display: grid; width: 100%; height: min(420px, 48vh); padding: 0; place-items: center; overflow: hidden; border: 0; border-radius: 12px; background: #121212; touch-action: pan-y; }
.detail-photo-stage[hidden] { display: none; }
.detail-photo-stage img { display: block; width: auto; height: auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.detail-photo-stage canvas, .markup-stage canvas { position: absolute; pointer-events: none; }
.detail-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.detail-gallery button { flex: 0 0 78px; height: 68px; padding: 2px; overflow: hidden; border: 2px solid transparent; border-radius: 9px; background: var(--photo-mat); }
.detail-gallery button.selected { border-color: var(--accent); }
.detail-gallery img { width: 100%; height: 100%; border-radius: 5px; object-fit: contain; background: var(--photo-mat); }
.detail-actions .photo-attach-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; font-weight: 750; }
.detail-actions .photo-attach-button.is-busy { opacity: .62; cursor: progress; }
.detail-photo-status { min-height: 22px; color: var(--muted); font-size: .82rem; }
.detail-photo-status:empty { display: none; }
.detail-footer { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.detail-edit-status { color: #105386; font-size: .8rem; font-weight: 800; }
.detail-save-button.has-unsaved-changes { border-color: var(--accent); color: white; background: var(--accent); box-shadow: 0 2px 8px rgba(105, 27, 35, .2); }
.detail-save-button.has-unsaved-changes:focus-visible { outline-color: rgba(200, 62, 73, .35); }
.detail-save-button:disabled:not(.has-unsaved-changes) { cursor: default; }
.detail-footer > button, .detail-lifecycle-actions > button { flex: 1 1 0; min-width: 0; }
.detail-lifecycle-actions { display: flex; flex: 1 1 0; flex-wrap: wrap; gap: 10px; }
.detail-footer .item-action { width: auto; min-width: 0; }

.archive-item-dialog { width: min(520px, calc(100vw - 24px)); }
.archive-item-sheet { display: grid; gap: 16px; padding: 24px; }
.archive-item-title { margin: -4px 0 0; font: 700 1.08rem/1.35 Georgia, serif; }
.archive-item-dialog .dialog-copy { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }

.markup-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-radius: 0; background: #111; }
.markup-dialog::backdrop { background: #111; }
.markup-shell { display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; color: white; background: #111; }
.markup-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
.markup-header > div { display: grid; text-align: center; }
.markup-header span { color: #bbb; font-size: .72rem; }
.markup-header button, .markup-tools button { min-height: 44px; border: 1px solid #555; border-radius: 9px; color: white; background: #242424; font-weight: 750; }
.markup-header #save-markup { color: white; background: var(--accent); border-color: var(--accent); }
.markup-stage { position: relative; display: grid; min-height: 0; place-items: center; overflow: hidden; touch-action: none; }
.markup-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.markup-stage canvas { z-index: 1; touch-action: none; pointer-events: auto; }
.markup-tools { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; padding: 10px 10px max(10px, env(safe-area-inset-bottom)); }
.markup-tools button.selected { border-color: #ff8c84; background: #6e211d; }
html.markup-open, html.markup-open body { overflow: hidden; }
html.detail-open, html.detail-open body { overflow: hidden; overscroll-behavior: none; }
html.add-open, html.add-open body { overflow: hidden; overscroll-behavior: none; }

@media (max-width: 650px), (pointer: coarse) and (max-height: 650px) {
  input, select, textarea { font-size: 16px; }
  .compact-header:not([hidden]) {
    position: fixed;
    z-index: 25;
    top: 0;
    right: 0;
    left: 0;
    display: block;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--line);
    background: white;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-100% - 1px));
    transition: transform 160ms ease-out, opacity 120ms ease-out, visibility 0s linear 160ms;
    visibility: hidden;
    will-change: transform;
  }
  .compact-header:not([hidden])::before {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: calc(128px + env(safe-area-inset-top));
    background: white;
    content: "";
    pointer-events: none;
  }
  .compact-header:not([hidden]).is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
    visibility: visible;
  }
  .compact-header-inner {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
  }
  .compact-header.has-builder-back .compact-header-inner {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: 8px;
  }
  .compact-header #compact-builder-project-back {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d2d2d2;
    border-radius: 999px;
    color: var(--accent);
    background: white;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
  }
  .compact-header #compact-project-name {
    min-width: 0;
    overflow: hidden;
    font: 700 1rem/1.2 Georgia, serif;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .compact-header #compact-progress-percent {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .compact-header #compact-filter-access {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 11px;
    border: 1px solid #bdbdbd;
    border-radius: 999px;
    color: var(--ink);
    background: white;
    font-weight: 800;
  }
  .site-header { padding: max(8px, env(safe-area-inset-top)) 16px 18px; }
  .punch-nav-row { min-height: 58px; }
  .project-copy { padding-top: 18px; }
  .site-header h1 { font-size: 2.2rem; }
  .punch-nav-actions { justify-content: flex-end; margin-top: 0; }
  .project-status-line { gap: 7px; margin-top: 16px; font-size: .84rem; }
  .summary-row { margin-top: 18px; }
  .page-shell { padding: 22px 12px max(104px, calc(env(safe-area-inset-bottom) + 92px)); }
  .list-section + .list-section { margin-top: 31px; }
  .list-section-heading { align-items: center; }
  .list-section-heading h2 { font-size: 1.32rem; }
  .punch-item { padding: 15px; }
  .dependency-banner { display: grid; }
  .dependency-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .dependency-actions:has(:only-child) { grid-template-columns: 1fr; }
  .dependency-action { width: 100%; }
  .work-instructions, .shared-note, .photo-strip, .item-actions,
  .punch-item.has-state-indicator .work-instructions,
  .punch-item.has-state-indicator .shared-note,
  .punch-item.has-state-indicator .photo-strip,
  .punch-item.has-state-indicator .translation-disclosure.indented-disclosure,
  .punch-item.has-state-indicator > .trade-tag,
  .punch-item.has-state-indicator .item-actions { margin-left: 0; }
  .item-actions { display: grid; grid-template-columns: 1fr; }
  .punch-item.is-ready .item-actions.has-multiple-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-action { width: 100%; }
  .photo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-button img { height: 118px; }
  .photo-button.completion-evidence-primary img { height: min(56vw, 250px); }
  .photo-button.completion-evidence-thumbnail img { height: 76px; }
  .add-button { position: fixed; right: max(14px, calc(env(safe-area-inset-right) + 14px)); bottom: max(14px, calc(env(safe-area-inset-bottom) + 14px)); width: 56px; height: 56px; min-height: 56px; margin: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .add-symbol { width: 32px; height: 32px; font-size: 1.8rem; }
  .add-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .detail-dialog { position: fixed; inset: var(--detail-viewport-offset-top, 0px) 0 auto; width: 100vw; max-width: none; height: var(--detail-viewport-height, 100dvh); max-height: none; margin: 0; border-radius: 0; background: var(--paper); box-shadow: none; }
  .detail-dialog::backdrop { background: var(--paper); backdrop-filter: none; }
  .detail-content { gap: 13px; }
  #detail-notes { font-size: 16px; }
  .detail-photo-stage { height: min(68vw, calc(var(--detail-viewport-height, 100dvh) * .36)); }
  .detail-footer { padding-inline: 16px; }
  .form-dialog { width: calc(100vw - 16px); }
  .form-dialog form { padding: 20px 16px; }
  .trade-dialog { width: 100vw; }
  .trade-sheet { padding: 20px 16px max(18px, env(safe-area-inset-bottom)); }
  .completion-dialog form { --completion-dialog-inline-padding: 16px; padding-bottom: 0; }
  .add-dialog {
    position: fixed;
    inset: var(--add-viewport-offset-top, 0px) 0 auto;
    width: 100vw;
    max-width: none;
    height: var(--add-viewport-height, 100dvh);
    max-height: none;
    margin: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }
  .add-dialog::backdrop { background: var(--paper); backdrop-filter: none; }
  .add-dialog form {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    height: 100%;
    max-height: none;
    gap: 0;
    overflow: hidden;
    padding: 0;
  }
  .add-dialog .dialog-heading {
    z-index: 2;
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    border-bottom: 1px solid var(--line);
    background: white;
  }
  .add-dialog .dialog-heading .eyebrow { display: none; }
  .add-dialog .dialog-heading h2 { font-size: 1.35rem; }
  .add-dialog .mode-switch { margin: 12px 16px 0; }
  .add-dialog #single-item-panel,
  .add-dialog #bulk-item-panel {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 16px;
  }
  .add-dialog .floor-options-viewport::after { background: linear-gradient(90deg, rgba(238, 238, 238, 0), var(--paper)); }
  .add-dialog .bulk-publish-nudge { margin: 0 16px 12px; }
  .add-dialog .bulk-publish-nudge-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-dialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: white;
  }
  .completion-dialog.keyboard-open {
    top: calc(var(--completion-viewport-offset-top, 0px) + 8px);
    bottom: auto;
    margin: 0 auto;
    max-height: calc(var(--completion-viewport-height, 100dvh) - 16px);
  }
  .completion-dialog.keyboard-open form {
    --completion-dialog-inline-padding: 16px;
    max-height: calc(var(--completion-viewport-height, 100dvh) - 16px);
    padding-bottom: 0;
  }
  .dialog-actions > button { flex: 1 1 45%; }
  .list-filter, .list-filter.has-archive { grid-template-columns: repeat(2, 1fr); }
  .list-filter.has-archive [data-filter="archived"] { grid-column: 1 / -1; }
  .list-filter button { padding: 8px 6px; font-size: .78rem; }
  .language-toggle { min-height: 44px; }
  .center-card { margin-top: 8vh; padding: 72px 20px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .compact-header:not([hidden]) { transition: none; }
}

@media (max-width: 350px) {
  .punch-item.is-ready .item-actions.has-multiple-actions { grid-template-columns: 1fr; }
}

@media print {
  @page { margin: .55in; }
  :root { --paper: white; --card: white; }
  body { background: white; font-size: 11px; }
      .compact-header, .punch-nav-row, .add-button, .toast, dialog, .photo-strip, .language-toggle, .trade-filter-section, .item-detail-open { display: none !important; }
  .site-header { padding: 18px 0; border-top: 0; border-bottom: 2px solid black; }
  .header-inner, .summary-row, .page-shell { width: 100%; }
  .page-shell { padding: 18px 0; }
  .list-section { margin-top: 22px; break-inside: auto; }
  .list-section-heading { break-after: avoid; }
  .item-grid { gap: 0; }
  .punch-item { padding: 9px 0; break-inside: avoid; border: 0; border-bottom: 1px solid #d0d0d0; border-radius: 0; box-shadow: none; }
  .punch-item.is-done { opacity: 1; }
  .state-indicator { width: 18px; height: 18px; font-size: .7rem; }
  .work-instructions, .shared-note { margin-left: 28px; }
  .work-instructions-text { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; }
  .shared-note { padding: 6px 8px; background: white; }
}
