:root {
  color-scheme: light;
  --ink: #19362e;
  --muted: #52665e;
  --green: #173f35;
  --canvas: #f2f6f3;
  --paper: #fff;
  --line: #d3e1d9;
  --mint: #e5f2ea;
  --follow: #825313;
  font: 16px "Segoe UI", Tahoma, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #548e76; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
main { width: min(100%, 1000px); margin: auto; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) max(16px, calc((100% - 966px) / 2)) 14px; color: #fff; background: var(--green); }
.brand { display: block; margin-bottom: 3px; color: #bbded0; font-size: .79rem; }
.topbar h1 { font-size: clamp(1.05rem, 4.5vw, 1.45rem); }
.account { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 5px 12px; font-size: .85rem; }
.topbar .secondary { color: #fff; background: #ffffff16; border-color: #ffffff55; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.login { max-width: 440px; margin: 5vh auto 0; padding: 22px; }
.login form { display: grid; gap: 14px; margin-top: 18px; }
.login label { display: grid; gap: 6px; font-size: .9rem; }
.login input, .search input { width: 100%; min-width: 0; padding: 9px 11px; min-height: 46px; color: var(--ink); background: #fff; border: 1px solid #aebfb4; border-radius: 9px; }
.primary, .secondary { min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; font-weight: 650; color: var(--ink); background: var(--paper); }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.section-heading, .card-heading, .stage > div, .stage-tasks li, .detail-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.section-heading { margin-bottom: 12px; }
.section-heading h2, .login h2 { font-size: 1.2rem; }
.section-heading h3 { font-size: 1.05rem; }
.project-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; margin-top: 10px; }
.project-filters label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: .85rem; }
.project-filters select { width: 100%; min-height: 44px; padding: 5px 7px; border: 1px solid #aebfb4; border-radius: 9px; color: var(--ink); background: var(--paper); font: inherit; }
.message { margin-block: 12px; color: var(--muted); }
.message:empty { display: none; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.card { display: grid; gap: 6px; width: 100%; color: var(--ink); padding: 13px; text-align: start; overflow-wrap: anywhere; }
.card:hover { border-color: #689d88; }
.card-heading { align-items: start; }
.card-engineer { font-weight: 650; }
.card-meta, .card-ids, .muted { color: var(--muted); }
.card-meta, .card-ids { font-size: .85rem; }
.card-meta:empty { display: none; }
.card-ids { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.progress { color: var(--muted); background: var(--canvas); border-radius: 7px; padding: 3px 7px; font-size: .8rem; white-space: nowrap; }
.progress.done, .stage-status.done { color: var(--green); background: var(--mint); }
.more { display: block; margin: 16px auto 0; }
.detail-header { position: sticky; top: 0; z-index: 1; padding: 8px 0 0; background: var(--canvas); }
.detail-actions { margin-bottom: 10px; }
#detailTitle { font-size: 1.35rem; overflow-wrap: anywhere; }
#detailSubtitle { margin-top: 4px; font-size: .9rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 12px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.tabs button { min-width: 0; min-height: 46px; padding: 5px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: .94rem; font-weight: 700; }
.tabs button[aria-pressed="true"] { color: var(--green); border-color: var(--green); }
.tabs .follow { margin-inline-start: 4px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px; margin: 0 0 18px; overflow-wrap: anywhere; }
.facts dt { color: var(--muted); font-size: .82rem; }
.facts dd { margin: 4px 0 0; }
.facts > div:last-child { grid-column: 1 / -1; }
.stage-list, .stage-tasks { list-style: none; margin: 0; padding: 0; }
.stage-list { display: grid; gap: 8px; }
.stage { padding: 12px 14px; }
.stage > div, .stage-tasks li { overflow-wrap: anywhere; }
.stage-tasks { margin-top: 8px; }
.stage-tasks li { border-top: 1px solid var(--line); padding: 6px 0 6px 0; font-size: .9rem; }
.stage-status { flex: 0 0 auto; padding: 3px 6px; border-radius: 6px; color: var(--muted); background: var(--canvas); font-size: .78rem; }
.empty { padding: 16px; }
.inspection { padding: 12px; }
.inspection header { padding: 4px 4px 14px; }
.inspection h3 { font-size: 1.14rem; }
.inspection header p { margin-top: 5px; overflow-wrap: anywhere; }
.inspection-count { display: flex; flex-wrap: wrap; gap: 5px 14px; color: var(--muted); font-size: .9rem; }
.follow { color: var(--follow); font-weight: 750; }
.issue { color: #9f2732; font-weight: 700; }
.inspection table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.check-label { width: 46%; }
.check-answer { width: 24%; }
.inspection th, .inspection td { vertical-align: top; border: 1px solid var(--line); padding: 7px; text-align: start; overflow-wrap: anywhere; white-space: pre-line; }
.inspection tbody th[scope="row"] { font-weight: 500; }
.inspection thead th { color: #fff; background: var(--green); }
.check-group th { background: var(--mint); }
.quality-history { margin-top: 14px; padding: 14px; }
.quality-history ol { list-style: none; margin: 8px 0; padding: 0; }
.quality-history li { border-top: 1px solid var(--line); padding: 11px 0; overflow-wrap: anywhere; }
.history-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 0; color: var(--muted); font-size: .83rem; }
.quality-history dl { margin: 5px 0 0; }
.history-change { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 6px; padding: 3px 0; font-size: .88rem; }
.history-change dd { display: grid; gap: 4px; margin: 0; white-space: pre-wrap; }
.history-change dt, .history-change small { color: var(--muted); }
.history-change small { margin-inline-end: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 580px) {
  .cards { grid-template-columns: 1fr; }
  .project-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-filters label:first-child { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection { padding: 8px; }
  .inspection th, .inspection td { padding: 5px; }
}
@media (max-width: 350px) {
  main { padding-inline: 10px; }
  .inspection table { font-size: .82rem; }
  .search input { font-size: .89rem; }
}
