:root {
  color-scheme: light;
  --ink: #17232f;
  --muted: #5b6875;
  --line: #cbd6df;
  --soft: #eef4f7;
  --panel: #ffffff;
  --blue: #123b5d;
  --blue-2: #1f658a;
  --yellow: #ffd228;
  --green: #16715f;
  --red: #9b2f2f;
  --amber: #8a5b12;
  --shadow: 0 12px 28px rgba(18, 59, 93, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #dfe8ed;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--blue);
  color: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 84px;
  height: 54px;
  background: var(--yellow);
  color: #15466b;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

h1,
h2,
p,
dl {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.08;
}

h2 {
  font-size: 19px;
  line-height: 1.15;
}

.topbar p {
  margin-top: 6px;
  color: #d8e7ef;
  line-height: 1.35;
}

.install-button,
.ghost-button,
.primary-button {
  min-height: 42px;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  padding: 8px 12px;
  touch-action: manipulation;
}

.install-button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: #fff;
  color: var(--blue);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #f7fafc;
  color: var(--ink);
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.danger-button {
  color: var(--red);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.status-strip div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.status-strip span,
.status-strip strong {
  display: block;
}

.status-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-strip strong {
  margin-top: 4px;
  font-size: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: 14px;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #b6c4cf;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  padding: 9px 10px;
  touch-action: manipulation;
}

textarea {
  resize: vertical;
  line-height: 1.35;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid rgba(31, 101, 138, 0.28);
  outline-offset: 2px;
}

.weather-field {
  margin-bottom: 14px;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.check-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(240px, 1fr) minmax(170px, 0.8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfe;
}

.check-title {
  font-weight: 800;
  line-height: 1.25;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.segmented label {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.segmented label + label {
  border-left: 1px solid var(--line);
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--blue-2);
  color: #fff;
}

.segmented input[value="Issue"]:checked + span {
  background: var(--red);
}

.segmented input[value="N/A"]:checked + span {
  background: #637381;
}

.check-note input {
  min-height: 42px;
  font-size: 16px;
}

.command-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.form-status {
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.form-status.success {
  color: var(--green);
}

.form-status.warning {
  color: var(--amber);
}

.defect-list {
  display: grid;
  gap: 10px;
}

.defect-list div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.defect-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.defect-list dd {
  margin: 4px 0 0;
  line-height: 1.35;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 15px;
}

.checkbox-line input {
  width: 22px;
  height: 22px;
  min-height: 22px;
}

.saved-records {
  display: grid;
  gap: 10px;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  padding: 10px;
}

.record-card strong,
.record-card span {
  display: block;
}

.record-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.empty-records {
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .brand-mark {
    width: 66px;
    height: 48px;
    font-size: 22px;
  }

  h1 {
    font-size: 25px;
  }

  .topbar p {
    font-size: 14px;
  }

  .status-strip,
  .workspace,
  .grid.two,
  .grid.three,
  .check-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 12px;
  }

  .check-row {
    gap: 8px;
  }

  .command-row {
    justify-content: stretch;
  }

  .command-row button {
    flex: 1 1 145px;
  }
}
