:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-strong: #eef3eb;
  --text: #1d241c;
  --muted: #62705e;
  --line: #d7dfd2;
  --accent: #2f6b3f;
  --accent-dark: #245332;
  --danger: #a54032;
  --shadow: 0 18px 50px rgba(31, 45, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.map-panel,
.request-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-panel {
  min-height: calc(100vh - 36px);
  overflow: hidden;
}

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

h1 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.15;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
}

.map-surface {
  position: relative;
  width: 100%;
  height: calc(100vh - 123px);
  min-height: 430px;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.map-empty strong {
  color: var(--text);
}

.leaflet-container {
  font-family: inherit;
}

.request-form {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  font: 500 15px/1.3 inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(47, 107, 63, 0.18);
  border-color: var(--accent);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font: 750 14px/1.2 inherit;
}

.secondary-button:hover {
  border-color: var(--accent);
}

.route-status {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.notice {
  padding: 12px;
  border: 1px solid #ead7a4;
  border-radius: 8px;
  background: #fff8df;
  color: #765d1d;
  font-size: 13px;
}

.submit-button {
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: 750 15px/1.2 inherit;
}

.submit-button:hover {
  background: var(--accent-dark);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.debug {
  max-height: 180px;
  overflow: auto;
  border-radius: 8px;
  padding: 12px;
  background: #1d241c;
  color: #e5f2e2;
  font-size: 12px;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .map-panel {
    min-height: auto;
  }

  .map-surface {
    height: 42vh;
    min-height: 300px;
  }
}

@media (max-width: 520px) {
  .map-header,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .map-header {
    display: grid;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }
}
