﻿:root {
  --bg: #f6efe5;
  --paper: #ffffff;
  --ink: #1f1a17;
  --muted: #6b5f55;
  --accent: #cc5c3b;
  --accent-2: #1b7f7a;
  --soft: #f2e5d6;
  --shadow: 0 18px 35px rgba(31, 26, 23, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: radial-gradient(circle at top left, #fff6ea, #f1e2cd 45%, #e8d3b7 100%);
  color: var(--ink);
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
}

.sidebar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  padding: 28px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.brand-mark {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 12px;
  letter-spacing: 0.08em;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tab {
  border: none;
  background: var(--soft);
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(204, 92, 59, 0.3);
}

.panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: panelIn 0.35s ease;
}

.panel.active {
  display: flex;
}

.section {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 18px rgba(31, 26, 23, 0.08);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.field span {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dccbb7;
  font-size: 14px;
}

.row {
  display: flex;
  align-items: center;
}

.row.gap {
  gap: 8px;
}

.btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(204, 92, 59, 0.3);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.btn.ghost:hover {
  box-shadow: 0 6px 14px rgba(204, 92, 59, 0.2);
}

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

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

.suggestions {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  border-radius: 12px;
  border: 1px solid #eadbca;
  max-height: 160px;
  overflow-y: auto;
  background: #fff;
  display: none;
}

.suggestions li {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0e6db;
}

.suggestions li:hover {
  background: #fff4e7;
}

.suggestions li:last-child {
  border-bottom: none;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.status-card {
  background: #fdf7f0;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.status-card .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.legend {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #eadbca;
}

.legend-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.legend-bar {
  height: 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fef1e1, #cc5c3b);
}

.legend-range {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.table-wrap {
  margin-top: 12px;
  max-height: 240px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #eadbca;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.report-table th,
.report-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0e6db;
  text-align: left;
}

.report-table thead {
  background: #f7ead9;
  position: sticky;
  top: 0;
}

.report-table .placeholder td {
  text-align: center;
  color: var(--muted);
}

.range-value {
  font-size: 12px;
  color: var(--muted);
}

.map-wrap {
  position: relative;
}

#map {
  width: 100%;
  height: 100vh;
}

.map-hint {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 6px 16px rgba(31, 26, 23, 0.15);
}

.property-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(340px, 90vw);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.property-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

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

.property-title {
  font-size: 16px;
  font-weight: 700;
}

.property-sub {
  font-size: 12px;
  color: var(--muted);
}

.property-body {
  overflow-y: auto;
  padding-right: 4px;
}

.property-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px 0;
}

.property-list div {
  background: #fdf7f0;
  border-radius: 12px;
  padding: 10px;
}

.property-list dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.property-list dd {
  margin: 0;
  font-weight: 600;
}

.property-section h4 {
  margin: 8px 0;
  font-size: 13px;
}

.property-section .ratio {
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 14, 8, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: #fff;
  border-radius: 20px;
  width: min(720px, 90vw);
  max-height: 80vh;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: panelIn 0.3s ease;
}

.overlay-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overlay-body {
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar {
    position: relative;
    z-index: 10;
  }

  #map {
    height: calc(100vh - 20px);
  }

  .property-panel {
    position: static;
    width: auto;
    margin: 12px 16px 24px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}
