@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  color-scheme: light;
  --ink: #1b1b1b;
  --muted: #5e6268;
  --panel: #ffffff;
  --panel-alt: #f6f1ea;
  --accent: #0f7a6f;
  --accent-strong: #0b5e55;
  --outline: #d7d1c9;
  --map-outline: rgba(27, 27, 27, 0.25);
  --bg: radial-gradient(circle at top, #f1ede7 0%, #f6f5f2 50%, #fbfaf7 100%);
  --shadow: 0 18px 40px rgba(15, 14, 10, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', 'Noto Sans JP', sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  letter-spacing: 1px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 20px;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
}

.status-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--outline);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 16px;
  align-items: stretch;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.panel-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--outline);
  font-size: 14px;
  font-family: inherit;
}

button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}

button.ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--outline);
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow: auto;
  padding-right: 4px;
}

.field-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: var(--panel-alt);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.field-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 14, 10, 0.08);
}

.field-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.field-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.map-wrap {
  position: relative;
  background: var(--panel);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map {
  width: 100%;
  height: 100%;
  min-height: 70vh;
}

.legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.field-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.detail {
  margin-top: -12px;
}

.detail-card {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.detail-card h3 {
  margin: 0 0 10px;
}

.detail-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.draw-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  display: none;
  gap: 10px;
  font-size: 12px;
}

.draw-panel.active {
  display: grid;
}

.draw-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.draw-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.draw-row select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--outline);
}

.draw-metrics {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .map {
    min-height: 60vh;
  }

  .detail {
    margin-top: 0;
  }
}
