* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 15px/1.5 var(--font-body);
}
.standalone-chrome {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4%;
  border-bottom: 1px solid var(--color-text);
  font: 11px var(--font-utility);
  letter-spacing: 0.05em;
}
a {
  color: inherit;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 38px 4%;
}
.ground-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 35px;
}
.eyebrow {
  font: 11px var(--font-utility);
  letter-spacing: 0.13em;
}
h1 {
  font: 700 clamp(48px, 6vw, 88px)/1 var(--font-display);
  letter-spacing: -0.04em;
  margin: 10px 0;
}
h1 span {
  color: var(--color-accent);
}
.ground-stamp {
  border: 1px solid var(--color-text);
  padding: 18px;
  font: 11px/1.8 var(--font-utility);
  text-align: center;
  transform: none;
}
.ground-stamp strong {
  font-size: 18px;
}
.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  border: 1px solid var(--color-text);
}
form {
  border-right: 1px solid var(--color-text);
}
section {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
}
h2 {
  font: 700 23px var(--font-display);
  margin: 0 0 18px;
}
h2 span {
  font: 11px var(--font-utility);
  margin-right: 8px;
  color: var(--color-accent);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 12px 0;
}
input:not([type="checkbox"]),
select {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0;
  padding: 10px;
  margin-top: 5px;
  color: inherit;
  font: 14px var(--font-utility);
  min-height: 42px;
}
input[type="file"] {
  font: 12px var(--font-body);
  max-width: 100%;
}
.check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-weight: 400;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-text);
  flex: none;
}
.hint,
#fileInfo,
#resultInfo {
  font-size: 12px;
  color: var(--color-text-muted);
}
.fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 12px;
}
button {
  background: var(--color-text);
  color: #fff;
  border: 1px solid var(--color-text);
  padding: 12px 16px;
  min-height: 44px;
  font: 600 14px var(--font-body);
  cursor: pointer;
}
button:disabled {
  background: #d9dde0;
  color: #4b5868;
  border-color: #a4abb4;
  cursor: default;
}
button:hover:not(:disabled) {
  background: #263957;
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
#cancel {
  background: transparent;
  color: var(--color-text);
}
progress {
  width: 100%;
  accent-color: var(--navy);
  height: 5px;
  margin-top: 20px;
}
#status {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.sheethead {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
}
.sheethead label {
  margin: 0;
}
.sheethead select {
  min-width: 155px;
}
.canvaswrap {
  position: relative;
  min-height: 380px;
  border: 1px solid var(--color-border);
  background: repeating-linear-gradient(
    45deg,
    #eef0ed,
    #eef0ed 2px,
    #f7f8f5 2px,
    #f7f8f5 12px
  );
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  image-rendering: pixelated;
}
#empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 25px;
}
#empty strong {
  font: 28px var(--font-display);
}
#empty p {
  font-size: 13px;
}
.confidence-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font: 10px var(--font-utility);
  margin: 16px 0;
}
.confidence-legend i {
  height: 10px;
  width: 90px;
  background: linear-gradient(90deg, #c0341d, #dbb85a, #3f6b57);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.stats strong {
  display: block;
  font: 32px var(--font-display);
}
.stats span {
  font: 11px var(--font-utility);
}
details {
  padding: 24px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 24px;
}
details p {
  max-width: 75ch;
  font-size: 13px;
}
.standalone-footer {
  border-top: 1px solid var(--color-text);
  border-bottom: 0;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 10px;
  top: -100px;
  background: white;
  padding: 12px;
  z-index: 2;
}
.skip:focus {
  top: 10px;
}
@media (max-width: 800px) {
  main {
    padding: 24px 16px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  form {
    border-right: 0;
  }
  .ground-title {
    align-items: start;
  }
  .ground-stamp {
    display: none;
  }
  .standalone-chrome {
    font-size: 9px;
    flex-wrap: wrap;
  }
  .canvaswrap {
    min-height: 250px;
  }
  section {
    padding: 20px;
  }
  .stats strong {
    font-size: 26px;
  }
  .sheethead {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}

[hidden] {
  display: none !important;
}

textarea {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font: 14px var(--font-body);
  border-radius: 0;
}
.tableScroll {
  overflow-x: auto;
}
#descriptionMappings {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#descriptionMappings th,
#descriptionMappings td {
  padding: 8px;
  text-align: left;
  border: 1px solid var(--color-border);
}
#descriptionMappings select {
  min-width: 130px;
}
#descriptionMappings input {
  min-width: 110px;
}
.investigation {
  border-left: 3px solid var(--warn);
  padding-left: 12px;
  margin: 14px 0;
}

.workspace > *,
.fields > *,
#checkpointSection,
#checkpointConfig {
  min-width: 0;
}
.tableScroll {
  max-width: 100%;
  min-width: 0;
}
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
}
#checkpointSection p {
  overflow-wrap: anywhere;
}
@media (max-width: 500px) {
  .fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

#map {
  height: 380px;
  max-height: none;
  object-fit: fill;
  touch-action: none;
  cursor: grab;
}
#map:active {
  cursor: grabbing;
}
.mapControls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}
.mapControls button {
  min-width: 44px;
}
#markerIndex {
  width: 90px;
}
#markerDetail {
  overflow-wrap: anywhere;
}

.previewNotice {
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--warn);
  padding: 12px 16px;
  margin-bottom: 24px;
}
.previewNotice strong {
  font: 600 13px var(--font-utility);
}
.previewNotice p {
  margin: 6px 0 0;
  max-width: 100ch;
}
#groundPercent {
  display: block;
  font-size: 11px;
  line-height: 1.4;
}
#toleranceEquivalent {
  display: block;
  margin-top: 5px;
}

/* Site-owned shell; preserve functional review-map colors. */
.ground-page .strip { justify-content: initial; gap: 0; padding: 0; font: inherit; letter-spacing: normal; }
.ground-page .strip-toggle button { min-height: 52px; padding: 0 16px; border: 0; background: transparent; color: var(--navy); }
.ground-page .strip-toggle button:hover { background: var(--margin); color: var(--navy); }
.ground-page .ground-title { margin-bottom: 24px; }
.ground-page h1 { font: 700 40px/1 var(--f-title); letter-spacing: .01em; text-transform: uppercase; }
.ground-page .ground-docs { position: fixed; z-index: 10; top: 0; right: 0; bottom: 0; width: min(380px,100%); overflow: auto; border-left: var(--rule); background: var(--field); padding: 20px; box-shadow: -8px 0 24px #16233f22; }
.ground-page .docs-head h2 { font: 700 16px var(--f-ui); }
.ground-page .docs section { padding: 0; border: 0; }
.ground-page .docs .icon-btn { min-height: 32px; width: 32px; padding: 0; font-size: 22px; }
.ground-page .footer-strip { padding: 0; gap: 0; font: 400 12px var(--f-ui); }
.ground-page .stats strong { font-family: var(--f-mono); font-size: 26px; font-variant-numeric: tabular-nums; }
.ground-page #status { color: var(--ink2); }
@media(max-width:800px) { .ground-page .footer-strip { flex-wrap: wrap; } }

.ground-page .strip-toggle button[aria-expanded="true"] { background: var(--navy); color: var(--field); }
