:root {
  --navy: #17364b;
  --navy-deep: #102737;
  --teal: #176b5a;
  --teal-light: #e7f3ee;
  --ink: #223c4b;
  --muted: #617782;
  --line: #dce5e8;
  --bg: #f2f6f7;
  --amber: #906323;
  --amber-bg: #fff3db;
  --red: #a53e40;
  --red-bg: #fceeee;
  --shadow: 0 12px 32px #152f4210;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 "Segoe UI",
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 15px;
  background: var(--teal);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  filter: brightness(0.95);
}
button:focus-visible,
a:focus-visible,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #72a9c7;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.quiet {
  background: white;
  color: var(--navy);
  border-color: #bfcfd5;
}
button.light {
  background: transparent;
  color: white;
  border-color: #ffffff50;
}
button.danger {
  background: var(--red);
}
button.icon-button {
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  padding: 0 6px;
}
.topbar {
  padding: 20px max(4vw, 24px);
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #75ac98;
  border-radius: 13px;
  background: #ffffff09;
  color: #c1e6d3;
  letter-spacing: 1px;
  font-weight: 700;
}
.brand strong {
  display: block;
  font-size: 19px;
}
.brand div > span {
  display: block;
  color: #b3c5cf;
  font-size: 12px;
  letter-spacing: 0.7px;
}
#operator-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 30px max(3vw, 22px) 50px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 22px;
  margin-bottom: 5px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
p {
  margin-bottom: 14px;
}
.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.8px;
  margin-bottom: 8px;
}
.workspace-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 8px 0 25px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: normal;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.5;
}
.badge.amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.badge.green {
  background: var(--teal-light);
  color: var(--teal);
}
.badge.red {
  background: var(--red-bg);
  color: var(--red);
}
.badge.neutral {
  background: #edf1f4;
  color: #536976;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
  gap: 4px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px #17364b05;
}
.tabs button {
  padding: 14px 10px;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
}
.tabs button span {
  font-size: 10px;
  margin-right: 7px;
  opacity: 0.65;
}
.tabs button[aria-selected="true"] {
  background: var(--navy);
  color: white;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.section-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.section-heading.compact {
  margin: 25px 0 14px;
}
.health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 14px;
  margin-bottom: 22px;
}
.health-card,
.card,
.detail {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.health-card h3 {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.health-card strong {
  font-size: 15px;
}
.health-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #84969f;
  flex-shrink: 0;
  margin-right: 7px;
}
.dot.green {
  background: #2d8b6d;
}
.dot.amber {
  background: #ce9632;
}
.stack {
  display: grid;
  gap: 13px;
}
.group-card {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto;
  gap: 15px;
  align-items: center;
}
.group-card h3 {
  margin-bottom: 5px;
}
.meta-line {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.group-info {
  color: var(--muted);
  font-size: 12px;
  margin: 9px 0 0;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.actions button {
  padding: 8px 11px;
  font-size: 12px;
}
.muted {
  font-size: 12px;
  color: var(--muted);
}
.filters {
  background: #eaf0f2;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 18px;
}
.filters label {
  min-width: 130px;
  flex: 1;
}
.filters button {
  height: 40px;
}
.filters .wide {
  flex: 2;
}
.filters input,
.filters select {
  background: white;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: #506875;
  margin: 8px 0;
}
input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #bccdd4;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  min-height: 40px;
}
textarea {
  resize: vertical;
  min-height: 85px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.report-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 20px;
  align-items: start;
}
.report-list-pane {
  min-width: 0;
}
#more-reports {
  margin-top: 15px;
  width: 100%;
}
.report-item {
  background: white;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 8px;
  width: 100%;
  font-weight: 400;
}
.report-item.selected {
  border: 1px solid var(--teal);
  box-shadow: inset 3px 0 var(--teal);
}
.report-item h3 {
  font-size: 15px;
  margin: 8px 0;
}
.report-item p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0;
}
.detail {
  padding: 24px;
  min-height: 380px;
  overflow: hidden;
}
.detail h3 {
  margin-top: 22px;
}
.detail > .meta-line {
  margin-bottom: 12px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.field-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.field-item strong {
  font-size: 13px;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.original {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f8f9;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
  max-height: 440px;
  overflow: auto;
  font:
    13px/1.65 Consolas,
    monospace;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.photo-frame {
  margin: 0;
  min-width: 0;
  background: #f2f5f6;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #e7ecee;
}
.photo-frame figcaption {
  padding: 8px;
  font-size: 11px;
  color: var(--muted);
}
.photo-frame a {
  color: var(--teal);
  display: block;
  margin-top: 4px;
}
.empty {
  padding: 35px 20px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  margin-top: 0;
  color: var(--ink);
}
.access-note {
  background: #f5f7ee;
  border: 1px solid #e0e6cd;
  border-radius: 7px;
  padding: 13px 14px;
  font-size: 12px;
  margin: 14px 0;
  display: flex;
  gap: 7px;
  align-items: center;
}
.review-box {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #d2e2da;
  background: #f5faf7;
  border-radius: 8px;
}
.review-box .actions {
  margin-top: 10px;
}
.review-box .check {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}
.check input {
  width: auto;
  min-height: 0;
}
.subtabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}
.subtabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 13px;
}
.subtabs button.selected {
  background: var(--teal-light);
  color: var(--teal);
  border-color: #c0d9cb;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.duplicate-box {
  padding: 14px;
  border-radius: 7px;
  background: #f5f8f9;
  border: 1px solid var(--line);
}
.duplicate-box p {
  font-size: 13px;
}
.download-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  align-items: center;
}
.download-card code {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-top: 8px;
}
.download-card p {
  font-size: 12px;
  margin: 4px 0;
  color: var(--muted);
}
progress {
  display: block;
  width: 100%;
  height: 9px;
  margin: 12px 0;
  accent-color: var(--teal);
}
.audit-card {
  margin-top: 26px;
  border: 1px solid var(--line);
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
}
.audit-card summary {
  cursor: pointer;
  font-weight: 600;
}
.audit-event {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.audit-event p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0;
}
.notice {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 700px;
  width: calc(100% - 40px);
  padding: 15px 20px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 30px #0003;
  z-index: 30;
  font-size: 14px;
}
.notice.error {
  background: #8b373b;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  max-width: 620px;
  width: calc(100% - 30px);
  box-shadow: 0 22px 100px #0003;
  color: var(--ink);
}
dialog::backdrop {
  background: #10273790;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.login-card {
  max-width: 690px;
  margin: 55px auto;
  padding: 45px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  font-size: 37px;
  margin: 15px 0 20px;
  line-height: 1.22;
}
.login-card > p {
  color: var(--muted);
  max-width: 520px;
}
#google-sign-in {
  margin: 25px 0 12px;
}
footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 3vw;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
}
@media (max-width: 1000px) {
  .tabs button span {
    display: none;
  }
  .group-card {
    grid-template-columns: 1fr;
  }
  .report-layout {
    grid-template-columns: 260px 1fr;
  }
  .health-grid {
    grid-template-columns: 1fr 1fr;
  }
  .health-grid > :last-child {
    grid-column: 1/-1;
  }
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 15px 18px;
  }
  .brand strong {
    font-size: 15px;
  }
  .brand div > span {
    font-size: 10px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .topbar #operator-name {
    display: none;
  }
  main {
    padding: 22px 16px 35px;
  }
  .workspace-intro {
    display: block;
  }
  .workspace-intro .badge {
    margin-top: 10px;
  }
  h1 {
    font-size: 24px;
  }
  .tabs {
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
  }
  .tabs button {
    font-size: 12px;
    padding: 12px 5px;
  }
  .section-heading {
    align-items: start;
    flex-wrap: wrap;
  }
  .section-heading > button {
    flex-shrink: 0;
  }
  .report-layout {
    grid-template-columns: 1fr;
  }
  .report-list-pane {
    max-height: 350px;
    overflow: auto;
  }
  .detail {
    padding: 17px;
  }
  .filters label {
    min-width: 125px;
  }
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .download-card {
    grid-template-columns: 1fr;
  }
  .login-card {
    margin: 25px auto;
    padding: 28px;
  }
  .login-card h1 {
    font-size: 29px;
  }
  .health-card {
    padding: 14px;
  }
  .subtabs {
    gap: 6px;
  }
  .subtabs button {
    font-size: 11px;
  }
  .photo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .actions button {
    flex: 1;
  }
  dialog {
    padding: 20px;
  }
}

#export-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}
#export-form > .form-grid,
#export-form > .actions,
#export-form > p {
  grid-column: 1/-1;
}
@media (max-width: 760px) {
  #export-form {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 450px) {
  #export-form {
    grid-template-columns: 1fr;
  }
}
