:root {
  --ink: #1f2937;
  --muted: #7b8494;
  --line: #e7eaf0;
  --soft: #f6f8fb;
  --paper: #ffffff;
  --accent: #fb6f67;
  --accent-soft: #fff0ee;
  --shadow: 0 18px 60px rgba(35, 48, 72, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #f5f7fb;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 7% 0%, #fff 0, #f5f7fb 31rem); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1500px; margin: auto; padding: 24px clamp(16px, 4vw, 64px) 26px; }
.topbar, .intro-row, .workspace, .map-toolbar, .selected-heading, footer { display: flex; align-items: center; justify-content: space-between; }
.topbar { min-height: 46px; }
.brand { color: var(--ink); text-decoration: none; display: flex; gap: 11px; align-items: center; }
.brand span:last-child { display: grid; gap: 2px; }
.brand small, .eyebrow { color: #9aa2b1; font-weight: 750; font-size: 10px; letter-spacing: .16em; }
.brand strong { font-size: 17px; letter-spacing: -.04em; }
.brand-mark { width: 30px; height: 30px; position: relative; display: inline-grid; place-items: center; background: transparent; border-radius: 50%; overflow: visible; }
.brand-icon { width: 30px; height: 30px; display: block; }
.brand-arc { fill: none; stroke-width: 4.2; stroke-linecap: round; }
.brand-arc-coral { stroke: #fb6f67; }.brand-arc-yellow { stroke: #f5b84b; }.brand-arc-mint { stroke: #6bb7a5; }
.brand-center { fill: var(--ink); }.brand-center-dot { fill: #fff; }
.top-actions { display: flex; gap: 9px; }
.ghost-button, .reset-button, .mini-button { border: 1px solid var(--line); background: #fff; color: #667085; border-radius: 9px; padding: 9px 13px; font-size: 12px; font-weight: 700; }
.reset-button { color: var(--accent); border-color: #ffd5d1; background: #fff8f7; }
.ghost-button:hover, .mini-button:hover { border-color: #cbd2dd; color: var(--ink); }
.intro-row { margin: 34px 0 32px; gap: 30px; align-items: end; }
.eyebrow { margin: 0 0 10px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(29px, 4.2vw, 48px); letter-spacing: -.07em; line-height: 1.05; }
h1 em { color: var(--accent); font-style: normal; }
.intro-copy { color: var(--muted); margin: 0; font-size: 14px; }
.progress-card { width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 17px 14px; box-shadow: 0 8px 30px rgba(35,48,72,.04); }
.progress-card span { color: var(--muted); font-size: 11px; font-weight: 700; }.progress-card strong { display: block; font-size: 30px; line-height: 1.05; letter-spacing: -.07em; margin-top: 5px; }.progress-card strong span { color: #b0b7c3; font-size: 16px; margin-left: 3px; }.progress-track { height: 5px; background: #edf0f4; border-radius: 9px; margin-top: 13px; overflow: hidden; }.progress-track i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .35s ease; }
.workspace { align-items: stretch; gap: 18px; min-height: 690px; }
.control-panel { width: 310px; min-width: 270px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; background: #f3f5f8; padding: 4px; border-radius: 12px; gap: 4px; }.mode-tab { border: 0; background: transparent; color: #8b94a2; border-radius: 9px; padding: 11px 8px; font-weight: 750; font-size: 13px; }.mode-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(30,40,60,.08); }.mode-tab span { margin-right: 4px; }
.panel-section { padding: 19px 4px 17px; border-bottom: 1px solid var(--line); }.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 11px; }.section-heading span, .search-label { font-size: 12px; font-weight: 800; }.section-heading small { color: #a0a8b5; font-size: 10px; }.layer-list { display: grid; gap: 7px; }.layer-item { display: flex; align-items: center; gap: 8px; padding: 9px 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #697384; text-align: left; }.layer-item.active { background: var(--accent-soft); border-color: #ffdcd8; color: var(--ink); }.layer-item .layer-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.8), 0 0 0 4px currentColor; }.layer-item b { font-size: 12px; flex: 1; }.layer-item small { color: #a6aebb; font-size: 10px; }
.palette { display: flex; flex-wrap: wrap; gap: 9px; }.color-swatch { width: 25px; height: 25px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #e0e4ea; padding: 0; }.color-swatch.active { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.08); }.color-swatch[data-color="eraser"] { background: linear-gradient(135deg, #fff 43%, #d4dae4 44%, #d4dae4 56%, #fff 57%); position: relative; }.color-swatch[data-color="eraser"]::after { content: ""; position: absolute; inset: 5px; border: 1px solid #aab3c1; border-radius: 50%; }
.search-section { padding-bottom: 13px; }.search-label { display: block; margin: 0 0 8px; }.search-box { border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; padding: 0 9px; color: #a6aebb; }.search-box span { font-size: 20px; line-height: 1; transform: translateY(-1px); }.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; padding: 10px 7px; font-size: 12px; color: var(--ink); background: transparent; }.search-box button { border: 0; background: transparent; color: #a6aebb; font-size: 17px; padding: 0; display: none; }.search-box.has-value button { display: block; }
.area-list-heading { display: flex; justify-content: space-between; color: #9aa2b1; padding: 15px 4px 8px; font-size: 11px; font-weight: 750; }.area-list-heading strong { color: var(--accent); }.area-list { overflow: auto; flex: 1; min-height: 100px; padding-right: 3px; }.area-group { border-bottom: 1px solid #f0f2f5; }.region-heading { display: flex; align-items: center; gap: 7px; width: 100%; padding: 9px 7px; border: 0; background: #f8f9fb; color: #667184; text-align: left; border-radius: 7px; }.region-heading:hover { background: #f1f3f6; color: var(--ink); }.region-heading span { display: flex; align-items: center; gap: 7px; flex: 1; font-size: 11px; font-weight: 800; }.region-heading span i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }.region-heading small { color: #a6aebb; font-size: 10px; }.region-heading b { color: #a2aab6; font-size: 14px; font-weight: 500; transform: rotate(0); transition: transform .2s ease; }.area-group:not(.open) .region-heading b { transform: rotate(-90deg); }.region-items { padding: 3px 0 6px 2px; }.area-group:not(.open) .region-items { display: none; }.area-row { display: flex; align-items: center; width: 100%; gap: 9px; padding: 8px 8px; background: transparent; border: 0; border-radius: 8px; text-align: left; color: #596474; }.area-row:hover, .area-row.active { background: #f7f8fa; color: var(--ink); }.area-row .row-color { width: 9px; height: 9px; border-radius: 50%; background: #f1f3f6; box-shadow: inset 0 0 0 1px #dbe0e8; flex: 0 0 auto; }.area-row .row-color.filled { box-shadow: none; }.area-row span:nth-child(2) { font-size: 12px; flex: 1; }.area-row small { color: #a7afbb; font-size: 10px; }.empty-state { color: #a5adba; font-size: 12px; text-align: center; padding: 24px 6px; }
.map-section { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fbfcfd; box-shadow: var(--shadow); }.map-toolbar { padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; }.map-toolbar div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }.map-toolbar strong { font-size: 11px; letter-spacing: .1em; }.map-toolbar small { color: #a0a8b5; font-size: 11px; margin-left: 3px; }.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #75c6a6; box-shadow: 0 0 0 4px #e8f6f0; display: inline-block; }.map-wrap { position: relative; min-height: 580px; height: calc(100% - 57px); display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff 0, #f9fafc 58%, #f3f5f8 100%); }.map { width: 100%; height: 100%; max-height: 620px; overflow: visible; }.map path { vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .2s ease, stroke .2s ease, opacity .2s ease; }.map path.area { fill: #fff; stroke: #d4dbe5; stroke-width: 1.1; }.map path.area:hover, .map path.area.focus { stroke: var(--ink); stroke-width: 2.4; filter: drop-shadow(0 3px 5px rgba(55,66,90,.18)); }.map path.area.focus { animation: area-pulse 1.3s ease; }.map path.area.world-land { fill: #fff; stroke: #cfd6e1; stroke-width: .7; }.map path.graticule { fill: none; stroke: #e5e9ef; stroke-width: .5; pointer-events: none; }.map-hint { position: absolute; right: 18px; bottom: 16px; padding: 7px 10px; border-radius: 7px; background: rgba(255,255,255,.8); color: #a1a9b5; font-size: 10px; pointer-events: none; }.map-footer { display: flex; align-items: center; gap: 15px; padding: 10px 20px; background: #fff; border-top: 1px solid var(--line); color: #a0a8b5; font-size: 10px; }.map-footer span { display: inline-flex; align-items: center; gap: 5px; }.map-footer span:last-child { margin-left: auto; }.map-footer i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }.legend-empty { border: 1px solid #d5dce6; background: #fff; }.legend-selected { background: var(--accent); }.mini-button { padding: 7px 10px; font-size: 10px; }
.selected-section { margin: 58px 0 35px; }.selected-heading { align-items: end; margin-bottom: 17px; }.selected-heading h2 { font-size: 24px; letter-spacing: -.06em; margin: 0; }.selected-heading .eyebrow { margin-bottom: 7px; }.selected-heading > span { color: var(--accent); font-size: 12px; font-weight: 800; }.selected-list { display: flex; flex-wrap: wrap; gap: 9px; min-height: 42px; }.selected-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: #586375; border-radius: 9px; padding: 8px 10px; font-size: 11px; }.selected-chip i { width: 8px; height: 8px; border-radius: 50%; }.selected-chip small { color: #a1a9b4; }.selected-empty { color: #a6aebb; font-size: 12px; }
footer { color: #a0a8b5; font-size: 10px; padding-top: 9px; border-top: 1px solid var(--line); } footer span:last-child { color: #c0c6cf; }
@keyframes area-pulse { 0%, 100% { opacity: 1; } 45% { opacity: .55; } }
@media (max-width: 980px) { .workspace { flex-direction: column-reverse; }.control-panel { width: 100%; min-height: 420px; }.area-list { max-height: 260px; }.map-section { min-height: 540px; }.map-wrap { min-height: 480px; } }
@media (max-width: 590px) { .app-shell { padding: 15px 12px 22px; }.top-actions .ghost-button { display: none; }.intro-row { margin: 24px 0 22px; display: block; }.progress-card { margin-top: 22px; width: 100%; }.progress-card strong { display: inline; margin-right: 10px; }.progress-track { margin-top: 10px; }.workspace { gap: 11px; }.control-panel { border-radius: 14px; padding: 11px; }.map-section { border-radius: 14px; }.map-toolbar { padding: 13px 14px; }.map-toolbar small { flex-basis: 100%; margin-left: 16px; }.map-wrap { min-height: 365px; }.map-footer { padding: 9px 13px; gap: 9px; }.map-footer span:nth-child(2) { display: none; }.map-footer span:last-child { font-size: 9px; }.selected-section { margin-top: 39px; } footer { display: block; line-height: 1.8; } }

/* 日本の白地図は背景に埋もれないよう、未選択エリアにも薄い面を置く */
.map path.area:not(.world-land) { fill: #dbe5ef; stroke: #8795a7; stroke-width: 1.6; fill-rule: evenodd; }
.map.pannable, .map-svg.pannable { cursor: grab; touch-action: none; }
.map.pannable.panning, .map-svg.panning { cursor: grabbing; }

/* 参照アプリと同じ、Leaflet Canvasの簡略日本地図 */
#map.map { background: #f4f2ec; overflow: hidden; }
#map .leaflet-container { background: #f4f2ec; font: inherit; }
#map .leaflet-control-container, #map .leaflet-attribution-flag { display: none; }
#map .leaflet-interactive { transition: fill .18s ease, stroke .18s ease; }
#map .leaflet-tooltip.prefecture-tooltip { border: 1px solid rgba(17,27,43,.12); border-radius: 8px; background: rgba(255,253,248,.97); box-shadow: 0 4px 12px rgba(17,27,43,.16); color: var(--ink); font-size: 11px; font-weight: 700; padding: 5px 8px; }
#map .leaflet-tooltip-top:before { border-top-color: rgba(255,253,248,.97); }
.map-svg { width: 100%; height: 100%; max-height: 620px; overflow: visible; }
.world-hit-target { cursor: pointer; fill: none; stroke: rgba(0,0,0,.001); stroke-width: 12; vector-effect: non-scaling-stroke; }

/* 地域リストの開閉で地図の位置と大きさが変わらないよう固定する */
.workspace { align-items: flex-start; }
.control-panel { height: 690px; }
.map-section { align-self: flex-start; height: 690px; position: sticky; top: 16px; }
.map-wrap { height: 580px; min-height: 0; }

@media (max-width: 980px) {
  .workspace { flex-direction: column; align-items: stretch; }
  .map-section { order: -1; position: relative; top: auto; height: 520px; min-height: 520px; }
  .map-wrap { height: 410px; min-height: 0; }
  .control-panel { height: auto; min-height: 0; }
  .area-list { max-height: 340px; }
}

@media (max-width: 590px) {
  .map-section { height: 420px; min-height: 420px; }
  .map-wrap { height: 330px; min-height: 0; }
}

/* 1エリア1状態の記録UI */
.status-list { display: grid; gap: 7px; }
.status-item { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #697384; text-align: left; }
.status-item.active { background: var(--accent-soft); border-color: #ffdcd8; color: var(--ink); }
.status-item .status-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.8), 0 0 0 4px currentColor; }
.status-item b { font-size: 12px; flex: 1; }
.status-item small { color: #a6aebb; font-size: 10px; }
