/* Facilities Reports. Quiet chrome, loud content: white page, near-black text, one gray scale.
   Status color (red) is used only for errors and the Urgent label, and always with words. */

:root {
  --bg: #FFFFFF;
  --text: #1A1A1A;
  --muted: #4D4D4D;
  --line: #D6D6D6;
  --line-strong: #8A8A8A;
  --fill: #F2F2F2;
  --primary: #1A1A1A;
  --on-primary: #FFFFFF;
  --danger: #B3261E;
  --radius-sm: 4px;
  --radius-md: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

a { color: var(--text); }

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.muted { color: var(--muted); }
.small { font-size: 15px; }
.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;
}

/* ---------- top bar ---------- */

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: max(env(safe-area-inset-top), 0px) 16px 0;
}
.top-inner {
  max-width: 880px; margin: 0 auto;
  min-height: 60px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px;
}
.brand { font-weight: 700; font-size: 18px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 12px;
  text-decoration: none; border-radius: var(--radius-sm);
}
.nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* ---------- page ---------- */

.page {
  max-width: 880px; margin: 0 auto;
  padding: 24px 16px calc(48px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 24px;
}
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0; font-size: 20px; line-height: 1.3; }
h3 { margin: 0; font-size: 17px; }
p { margin: 0; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section + .section { border-top: 1px solid var(--line); padding-top: 24px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-weight: 600; }
.hint { font-size: 15px; color: var(--muted); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 600; }

input[type="text"], input[type="password"], input[type="email"], input[type="url"], textarea, select {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input[aria-invalid="true"] { border: 2px solid var(--danger); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border: 1px solid var(--text);
  border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.big { min-height: 64px; font-size: 19px; width: 100%; }
.btn.wide { width: 100%; }
.btn.link {
  min-height: 44px; padding: 0 4px; border: 0; background: none;
  font-weight: 400; text-decoration: underline; text-underline-offset: 3px;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Pick-one button groups: the chosen one is filled black, and aria-pressed says so to screen readers. */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.choices.narrow { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.choice {
  min-height: 56px; padding: 6px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font: inherit; cursor: pointer;
}
.choice[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border: 2px solid var(--primary); font-weight: 700; }
.campus-label { font-size: 15px; color: var(--muted); margin: 4px 0 6px; }

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

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.photo {
  position: relative; aspect-ratio: 4 / 3;
  background: var(--fill); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .remove {
  position: absolute; right: 6px; bottom: 6px;
  min-height: 44px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--text); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.photo-add {
  display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px;
  aspect-ratio: 4 / 3; padding: 10px;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-md);
}
.photo-add label.btn { width: 100%; }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- messages ---------- */

.notice {
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: 14px 16px; background: var(--fill);
}
.error {
  border: 2px solid var(--danger); border-radius: var(--radius-md);
  padding: 12px 16px; color: var(--text);
}
.error strong { color: var(--danger); }
.error ul { margin: 6px 0 0; padding-left: 20px; }
.urgent {
  display: inline-block; padding: 1px 8px;
  border: 2px solid var(--danger); border-radius: var(--radius-sm);
  color: var(--danger); font-weight: 700; font-size: 14px; line-height: 1.6;
}
.status {
  display: inline-block; padding: 1px 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.status.new { border: 2px solid var(--text); }

.check {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  cursor: pointer;
}
.check input { width: 26px; height: 26px; margin: 0; flex-shrink: 0; accent-color: var(--danger); }

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

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list > li { border-bottom: 1px solid var(--line); }
.item {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px;
  padding: 14px 4px; text-decoration: none; color: var(--text);
}
.item.no-photo { grid-template-columns: minmax(0, 1fr); }
.thumb { aspect-ratio: 4 / 3; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.item-where { font-weight: 700; }
.item-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters .choice { min-height: 48px; padding: 0 14px; }

.big-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.big-photos a { display: block; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--fill); }
/* Capped so the decision buttons stay on screen; tapping a photo opens it full size. */
.big-photos img { width: 100%; max-height: 42vh; object-fit: contain; display: block; }

dl.facts { margin: 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; }
dl.facts dt { font-weight: 600; }
dl.facts dd { margin: 0; }

.decisions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.decisions .choice { min-height: 64px; font-size: 18px; font-weight: 600; }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.people li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}

@media (max-width: 560px) {
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item { grid-template-columns: 84px minmax(0, 1fr); }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
  .decisions { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
}
