:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #526070;
  --subtle: #6b7684;
  --line: #ccd6e0;
  --line-strong: #9baabd;
  --panel: #ffffff;
  --page: #eef4f8;
  --wash: #f7fafc;
  --navy: #16345b;
  --blue: #245f9f;
  --blue-dark: #174977;
  --red: #b91c1c;
  --green: #177245;
  --amber: #b7791f;
  --shadow: 0 16px 40px rgba(22, 52, 91, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--page) 360px),
    var(--page);
  color: var(--ink);
  font-family:
    Atkinson Hyperlegible, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-160%);
  border-radius: 4px;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--amber);
}

.app-header {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 5px solid var(--red);
}

.app-header__inner,
.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
}

.brand-lockup,
.header-actions,
.panel-heading,
.upload-box,
.empty-state {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 14px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--red);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  line-height: 1.15;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-chip,
.panel-meta {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip--draft {
  background: var(--red);
  border-color: var(--red);
}

.workspace {
  padding: 24px 0 52px;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro-copy {
  align-self: center;
  max-width: 700px;
}

.intro-copy h2 {
  max-width: 680px;
  margin-bottom: 10px;
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 3.35rem);
  line-height: 1.02;
}

.intro-copy p:last-child {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.street-snapshot {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dbe9f2;
}

.street-snapshot__skyline {
  position: absolute;
  inset: 0 0 auto;
  height: 40%;
  background:
    linear-gradient(90deg, transparent 0 10%, #244f7a 10% 20%, transparent 20% 28%, #587d9c 28% 38%, transparent 38% 48%, #1f3d5c 48% 61%, transparent 61% 72%, #6c8aa5 72% 84%, transparent 84%),
    #c8dfed;
  opacity: 0.9;
}

.street-snapshot__map {
  position: absolute;
  inset: 35% 0 0;
  background: #f6f0df;
}

.street-line {
  position: absolute;
  left: -24px;
  right: -24px;
  height: 18px;
  border: 2px solid #d4c18e;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: center;
}

.street-line--one {
  top: 36px;
  transform: rotate(-12deg);
}

.street-line--two {
  top: 78px;
  transform: rotate(14deg);
}

.street-line--three {
  top: 62px;
  transform: rotate(92deg);
}

.street-pin {
  position: absolute;
  left: 57%;
  top: 45%;
  width: 28px;
  height: 28px;
  border: 5px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.25);
  transform: rotate(-45deg);
}

.request-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 22px;
  align-items: start;
}

.form-panel,
.report-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-panel,
.report-panel {
  padding: 22px;
}

.report-panel {
  position: sticky;
  top: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading .eyebrow {
  color: var(--blue);
}

.panel-meta {
  flex: 0 0 auto;
  border-color: var(--line);
  color: var(--muted);
  background: var(--wash);
}

.request-form,
.form-section,
.field,
.field-grid,
.report-output {
  display: grid;
}

.request-form {
  gap: 18px;
}

.form-section {
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.form-section legend {
  padding: 0 8px;
  color: var(--navy);
  font-weight: 900;
}

.field-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: 14px;
}

.field {
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 500;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #7a8695;
}

.field input:focus,
.field textarea:focus,
.upload-box:focus-within,
.primary-action:focus {
  outline: 3px solid rgba(183, 121, 31, 0.38);
  outline-offset: 2px;
  border-color: var(--blue);
}

.upload-box {
  min-height: 86px;
  gap: 14px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  background: var(--wash);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.upload-box:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.upload-icon,
.empty-state__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e2edf7;
  color: var(--blue);
}

.upload-icon svg,
.empty-state__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.upload-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-copy strong {
  color: var(--navy);
}

.upload-copy span {
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.image-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(36, 95, 159, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 95, 159, 0.05) 1px, transparent 1px),
    #f8fafc;
  background-size: 18px 18px;
  color: var(--muted);
  font-weight: 800;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.field-error {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 800;
}

.character-count {
  justify-self: end;
  color: var(--subtle);
  font-size: 0.86rem;
  font-weight: 700;
}

.error-summary {
  margin-bottom: 18px;
  border: 2px solid var(--red);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff5f5;
}

.error-summary h3 {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 1rem;
}

.error-summary ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.error-summary a {
  color: var(--navy);
  font-weight: 800;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.primary-action:hover {
  background: var(--blue-dark);
}

.primary-action:active {
  transform: translateY(1px);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.message {
  margin: 0 0 16px;
  border-left: 5px solid var(--blue);
  border-radius: 6px;
  padding: 12px 14px;
  background: #eef6ff;
  font-weight: 800;
}

.message--success {
  border-color: var(--green);
  background: #effaf3;
  color: #14532d;
}

.message--error {
  border-color: var(--red);
  background: #fff1f2;
  color: #7f1d1d;
}

.report-output {
  gap: 13px;
}

.report-output--empty {
  min-height: 360px;
  place-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 24px;
  background: var(--wash);
  color: var(--muted);
  text-align: center;
}

.empty-state {
  flex-direction: column;
  gap: 12px;
  max-width: 310px;
}

.empty-title {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
}

.empty-copy {
  margin-bottom: 0;
  line-height: 1.45;
}

.request-record {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.request-record__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  background: #f5f8fb;
  border-bottom: 1px solid var(--line);
}

.request-record__title {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.15;
}

.request-record__id {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #fef3c7;
  color: #7c2d12;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.request-record__body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.report-field {
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}

.report-field:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.report-field h3 {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.report-field p {
  margin-bottom: 0;
  line-height: 1.55;
}

dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 0.65fr);
  gap: 9px 14px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-weight: 900;
}

dd {
  min-width: 0;
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .intro-band,
  .request-grid {
    grid-template-columns: 1fr;
  }

  .report-panel {
    position: static;
  }

  .street-snapshot {
    min-height: 170px;
  }
}

@media (max-width: 640px) {
  .app-header__inner,
  .workspace {
    width: min(100% - 20px, 1180px);
  }

  .app-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-record__header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .intro-band,
  .form-panel,
  .report-panel {
    padding: 16px;
  }

  .field-grid,
  dl {
    grid-template-columns: 1fr;
  }
}
