:root {
  --teal: #006a7a; --teal-dark: #00525e; --teal-tint: #e6f2f4;
  --ink: #1f2328; --muted: #5f6b73; --line: #dde3e6; --bg: #f4f6f7; --card: #fff;
  --red: #b42318; --red-bg: #fdecea; --amber: #a15c07; --amber-bg: #fef3e2;
  --green: #067647; --green-bg: #e7f6ec; --gray-bg: #eef1f3;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.45; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .9rem; margin: 1rem 0 .4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
p { margin: .4rem 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.lead { color: var(--muted); max-width: 70ch; margin: -.3rem 0 1rem; }
kbd { font: inherit; font-size: .8em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }

/* top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; display: block; }
.brand span { font-weight: 700; color: #363435; border-left: 1px solid var(--line); padding-left: 10px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink); padding: 8px 11px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.on { background: var(--teal-tint); color: var(--teal-dark); }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.who form { margin: 0; }
main.wrap { padding-top: 24px; padding-bottom: 40px; }
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 30px; }

/* page header */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .92rem;
  padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: #b9c4c9; text-decoration: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--teal); }
.btn-quiet:hover { background: var(--teal-tint); }
.btn-danger-quiet { background: transparent; border-color: transparent; color: var(--red); }
.btn-danger-quiet:hover { background: var(--red-bg); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer; text-decoration: underline; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: .6rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-alert { border-color: #f1b8b2; background: #fffafa; }
.card-inner { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fbfcfc; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols > .card, .cols > form.card { margin-bottom: 0; }
.cols { margin-bottom: 18px; }
.cols > div > .card:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.empty { color: var(--muted); padding: 10px 0; }
.empty-state { text-align: center; padding: 40px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); display: flex; flex-direction: column; }
a.stat:hover { text-decoration: none; border-color: #b9c4c9; }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.25; }
.stat-sub { font-size: .82rem; color: var(--muted); }
.stat-ok { border-left-color: var(--green); }
.stat-warn { border-left-color: #e8a33d; }
.stat-bad { border-left-color: var(--red); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 8px; border-bottom: 1px solid #edf0f2; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { opacity: .6; }
.checklist td:first-child { width: 100%; }

/* tags */
.tag { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-gray { background: var(--gray-bg); color: var(--muted); }

/* flash */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; background: var(--green-bg); color: var(--green); border: 1px solid #b7e1c6; }
.flash-error { background: var(--red-bg); color: var(--red); border-color: #f1b8b2; }
.flash-warn { background: var(--amber-bg); color: var(--amber); border-color: #f5d39f; }

/* forms */
.form label, label { display: block; font-size: .85rem; font-weight: 600; color: #3d464c; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; font-size: .95rem; color: var(--ink);
  padding: 8px 10px; border: 1px solid #c9d2d6; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: -1px; border-color: var(--teal); }
input[type=checkbox], input[type=radio] { width: auto; display: inline; margin: 0; }
textarea { resize: vertical; }
input[readonly] { background: var(--bg); }
.grid { display: grid; gap: 0 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } }
.form h2 { margin-top: 1.2rem; }
.form h2:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.form-actions.bottom { align-self: end; margin-bottom: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline-label { display: flex; align-items: center; gap: 8px; margin: 0; }
.inline-label input { width: auto; margin: 0; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; margin: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.row-actions form { margin: 0; }

/* tri-state checklist */
.tri { text-align: right; }
.pill { display: inline-block; margin: 0 0 0 4px; font-weight: 600; font-size: .82rem; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 5px 11px; border: 1px solid #c9d2d6; border-radius: 999px; cursor: pointer; color: var(--muted); background: #fff; user-select: none; }
.pill input:focus-visible + span { outline: 2px solid var(--teal); }
.pill-ok input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.pill-problem input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.pill-na input:checked + span { background: #6b7378; border-color: #6b7378; color: #fff; }
.seg { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 6px; color: var(--ink); font-weight: 500; font-size: .9rem; }
.seg a.on { background: var(--teal); color: #fff; }
.seg a:hover { text-decoration: none; }

/* screenshots */
.dropzone { border: 2px dashed #b9c8ce; border-radius: 8px; padding: 16px; text-align: center; background: #fafcfc; color: var(--muted); font-size: .9rem; cursor: copy; }
.dropzone strong { display: block; color: var(--ink); margin-bottom: 2px; }
.dropzone.hot, .shots.active .dropzone { border-color: var(--teal); background: var(--teal-tint); }
.dropzone:focus { outline: none; }
.shot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.shot-item { border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.shot-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; display: block; background: var(--bg); }
.shot-item input[type=text] { font-size: .85rem; padding: 5px 7px; }
.shot-item .check { font-size: .8rem; margin: 6px 0 0; }
.shot-item .x { float: right; font-size: .8rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 14px; }
.shot { margin: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fff; }
.shot img { width: 100%; height: 150px; object-fit: cover; border-radius: 4px; display: block; background: var(--bg); }
.shot-form { margin-top: 6px; }
.shot-form input { font-size: .85rem; padding: 5px 7px; margin-bottom: 4px; }
.shot-form .check { font-size: .8rem; margin: 4px 0; }
.add-shots { margin-top: 6px; }
.add-shots .btn { margin-top: 10px; }
.mini-gallery { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-gallery img { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }

/* cameras */
.cams { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cam { border: 1px solid var(--line); border-radius: 6px; }
.cam summary { display: flex; align-items: center; gap: 12px; padding: 6px; cursor: pointer; list-style: none; }
.cam summary::-webkit-details-marker { display: none; }
.cam summary img, .noimg { width: 96px; height: 54px; object-fit: cover; border-radius: 4px; flex: none; }
.noimg { display: flex; align-items: center; justify-content: center; background: var(--gray-bg); color: var(--muted); font-size: .72rem; text-align: center; }
.cam-form { padding: 10px; border-top: 1px solid var(--line); }
.add-cam summary { list-style: none; display: inline-flex; }
.add-cam summary::-webkit-details-marker { display: none; }
.add-cam[open] summary { margin-bottom: 8px; }
.baseline-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.baseline-strip figure { margin: 0; }
.baseline-strip img, .baseline-strip .noimg { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; display: block; }
.baseline-strip figcaption { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* facts */
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0 0 10px; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; }

/* issues */
.issue-row .btn { margin-top: -4px; }

/* report */
.preview { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 6px; background: #e9edef; }

/* login */
.login { max-width: 440px; margin: 60px auto; text-align: center; padding: 34px; }
.login-logo { width: 280px; max-width: 100%; margin-bottom: 18px; }
.login h1 { font-size: 1.3rem; }
.login .btn { margin-top: 18px; }

/* overrides for labels used inline (must come after the generic label rule) */
[hidden] { display: none !important; }
label.pill { display: inline-block; margin: 0 0 0 4px; }
label.inline-label { display: flex; align-items: center; gap: 8px; margin: 0; }
label.linkish { display: inline; margin: 0; font-size: inherit; font-weight: 600; color: var(--teal); }
