:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --panel: #ffffff;
  --text: #13201f;
  --muted: #657372;
  --line: #d7dfdd;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --accent: #b42318;
  --warm: #d97706;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(680px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
}

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

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.ok {
  border-color: #99d5c9;
  color: var(--primary-strong);
}

.status-pill.warn {
  border-color: #f2c27b;
  color: var(--warm);
}

.status-pill.error {
  border-color: #f4aaa4;
  color: var(--accent);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(10, 20, 20, 0.04);
}

.status-panel {
  display: grid;
  gap: 8px;
}

.status-panel strong {
  font-size: 17px;
  line-height: 1.35;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 12px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

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

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

button.ghost {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-panel {
  display: grid;
  gap: 12px;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
}

.search-form label {
  min-width: 0;
}

.search-form button {
  min-width: 82px;
}

.search-form button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.search-results {
  display: grid;
  gap: 8px;
}

.result-item {
  display: grid;
  min-height: auto;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.result-item strong,
.result-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.map-canvas {
  width: 100%;
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8efed;
}

.selected-point {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.selected-point strong {
  font-size: 15px;
  line-height: 1.35;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-row {
  grid-column: 1 / -1;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.guide-panel {
  display: grid;
  gap: 10px;
}

.guide-panel h3 {
  margin: 2px 0 0;
  font-size: 15px;
  letter-spacing: 0;
}

.guide-panel ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.guide-panel code {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.notice {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (min-width: 560px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
    align-items: end;
  }

  .map-canvas {
    height: 360px;
  }
}
