:root {
  --brand: #d6092f;
  --brand-dark: #a30016;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe3ea;
  --panel: #ffffff;
  --page: #f5f7fb;
  --soft-red: #fff1f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.bg {
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
}

.top img {
  width: auto;
  height: 48px;
  object-fit: contain;
}

.top b {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.top span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.progress {
  height: 8px;
  margin: 0 0 18px;
  overflow: hidden;
  background: #e8ecf3;
  border-radius: 999px;
}

.progress b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width 0.2s ease;
}

.card {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.stepHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.stepHeader span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  color: var(--ink);
}

label {
  display: block;
  margin: 18px 0 7px;
  color: #2d3748;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd6e1;
  border-radius: 8px;
  font: inherit;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(214, 9, 47, 0.16);
  border-color: var(--brand);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn.secondary,
button.secondary {
  color: var(--brand-dark);
  background: #fff;
  border-color: rgba(214, 9, 47, 0.28);
}

.btn.secondary:hover,
button.secondary:hover {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.muted {
  color: var(--muted);
}

.hide {
  display: none !important;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.choiceGrid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 18px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.tile input {
  width: auto;
  min-height: 0;
}

.tile:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
}

.dangerTile {
  background: var(--soft-red);
}

.scriptBox,
.banner,
.lookupBox,
.selectedLocationBox,
.summaryBox {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scriptBox {
  font-size: 17px;
}

.banner {
  margin: 16px 0;
}

.banner.info {
  background: #eef6ff;
  border-color: #bdd7f5;
}

.banner.warn {
  background: #fff7e6;
  border-color: #f3d19c;
}

.banner.ok {
  background: #edf9f1;
  border-color: #b7e2c2;
}

.banner.danger,
.modal.critical .box {
  background: var(--soft-red);
  border-color: rgba(214, 9, 47, 0.25);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  background: #eef1f6;
  border-radius: 8px;
}

.segmented button {
  min-height: 38px;
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

.segmented button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.counter {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 8px;
}

.counter input {
  text-align: center;
}

.counter button {
  padding: 0;
}

.vrn,
.miniVrn {
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.locationMap {
  display: grid;
  min-height: 240px;
  margin: 16px 0;
  place-items: center;
  background: #eef1f6;
  border: 1px dashed #b8c0cc;
  border-radius: 8px;
}

.mapPlaceholder {
  color: var(--muted);
  text-align: center;
}

.livePanel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 16px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.damageStencil {
  min-height: 180px;
  margin: 12px 0;
  background: #f8fafc;
  border: 1px dashed #b8c0cc;
  border-radius: 8px;
}

.smallCard {
  margin-top: 16px;
  box-shadow: none;
}

.emailBig {
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 800;
}

.actionRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.actionRow button {
  min-width: 126px;
}

.actionRow button:not(.secondary) {
  margin-left: auto;
  min-width: 150px;
}

.actionRow button:only-child {
  margin-left: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
}

.modal .box {
  width: min(620px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
}

.modal.critical .box {
  background: var(--soft-red);
  border-color: rgba(214, 9, 47, 0.25);
}

@media (max-width: 760px) {
  .top,
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .card {
    padding: 20px;
  }

  .stepHeader,
  .livePanel {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .actionRow {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actionRow button,
  .actionRow button:not(.secondary),
  .actionRow button:only-child {
    width: 100%;
    margin-left: 0;
  }
}
