:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #6c7773;
  --line: #d8ddda;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --alluvial: #e86b35;
  --alluvial-soft: #f4b690;
  --diluvial: #196d68;
  --diluvial-soft: #8bbab2;
  --water: #247db0;
  --sand: #d7af67;
  --silt: #bfaa88;
  --clay: #8d7d67;
  font-family: Inter, "Segoe UI", "Yu Gothic UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.topbar { height: 62px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); gap: 24px; position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; font: 800 15px/1 Inter, sans-serif; letter-spacing: .04em; }
.brand > span:last-child > span { color: var(--alluvial); }
.brand-mark { width: 28px; height: 28px; border-radius: 4px; background: var(--ink); display: flex; flex-direction: column; gap: 3px; padding: 6px 5px; transform: skewY(-5deg); }
.brand-mark i { display: block; height: 3px; background: white; border-radius: 2px; }
.brand-mark i:nth-child(2) { background: var(--alluvial); width: 75%; }
.scope-pill { font-size: 11px; letter-spacing: .12em; font-weight: 700; border-left: 1px solid var(--line); padding-left: 22px; color: #53605c; }
.scope-pill span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #70a13d; margin-right: 8px; box-shadow: 0 0 0 3px #e4efda; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.icon-button, .import-button { border: 1px solid var(--line); background: white; height: 36px; border-radius: 4px; cursor: pointer; }
.icon-button { width: 36px; font-weight: 800; }
.import-button { background: var(--ink); color: white; padding: 0 16px; border-color: var(--ink); font-size: 13px; font-weight: 700; }
.workspace { display: grid; grid-template-columns: 290px minmax(420px, 1fr) 350px; height: calc(100vh - 62px); }
.sidebar, .detail { background: var(--panel); overflow: auto; position: relative; z-index: 2; }
.sidebar { border-right: 1px solid var(--line); }
.detail { border-left: 1px solid var(--line); }
.panel { padding: 22px; border-bottom: 1px solid var(--line); }
.eyebrow, .search-label, .filter-heading, .list-heading, .detail-head span, .profile-title, .interpretation > span, .drawer-head span { font-size: 10px; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
.intro-panel h1 { margin: 10px 0 10px; font-family: Georgia, "Yu Mincho", serif; font-size: 30px; line-height: 1.04; font-weight: 500; letter-spacing: -.03em; }
.intro-panel > p { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 0; }
.demo-note { margin-top: 16px; border: 1px solid #ead6aa; background: #fff9e9; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; }
.demo-note strong { font-size: 10px; letter-spacing: .12em; color: #95630c; }
.demo-note span { font-size: 11px; color: #725e37; }
.search-wrap { display: flex; align-items: center; margin: 8px 0 20px; border: 1px solid var(--line); background: var(--paper); height: 38px; padding: 0 10px; gap: 8px; }
.search-wrap input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; font-size: 13px; }
.filter-heading, .list-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.filter-heading button { border: 0; background: none; font-size: 11px; text-decoration: underline; cursor: pointer; color: var(--muted); }
.check-row { display: grid; grid-template-columns: 15px 9px 1fr auto; gap: 9px; align-items: center; padding: 9px 0; cursor: pointer; }
.check-row input { accent-color: var(--ink); }
.check-row .swatch { width: 8px; height: 26px; border-radius: 2px; }
.alluvial .swatch { background: var(--alluvial); }
.diluvial .swatch { background: var(--diluvial); }
.water .swatch { height: 3px; background: var(--water); }
.check-row b { display: block; font-size: 13px; }
.check-row small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.check-row em { font-style: normal; font: 700 11px/1 monospace; color: var(--muted); }
.list-panel { padding-bottom: 0; }
.list-heading strong { color: var(--diluvial); }
.borehole-list { margin: 0 -22px; }
.borehole-item { width: 100%; padding: 12px 22px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; border: 0; border-top: 1px solid #ebeeec; background: white; cursor: pointer; text-align: left; }
.borehole-item:hover { background: #f4f7f5; }
.borehole-item.active { background: #edf4f2; box-shadow: inset 3px 0 var(--diluvial); }
.borehole-icon { width: 25px; height: 25px; border: 2px solid var(--diluvial); border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.borehole-item b { display: block; font-size: 13px; }
.borehole-item small { color: var(--muted); font-size: 10px; }
.borehole-item em { font: 700 11px/1 monospace; color: var(--muted); font-style: normal; }
.map-stage { position: relative; overflow: hidden; background: #e8ede9; }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#mapCanvas:active { cursor: grabbing; }
.map-label { position: absolute; pointer-events: none; font-weight: 800; letter-spacing: .15em; color: rgba(26,45,40,.55); text-shadow: 0 1px white; }
.map-label.tokyo { left: 33%; top: 29%; font-size: 14px; }
.map-label.bay { right: 13%; bottom: 22%; color: rgba(34,106,140,.55); transform: rotate(-18deg); }
.map-label.river { left: 55%; top: 43%; font-size: 9px; transform: rotate(68deg); color: rgba(34,106,140,.65); }
.map-tools { position: absolute; top: 18px; right: 18px; display: flex; flex-direction: column; box-shadow: 0 3px 12px #263b3530; }
.map-tools button { width: 36px; height: 36px; background: white; border: 1px solid var(--line); border-bottom: 0; cursor: pointer; font-size: 18px; font-weight: 500; }
.map-tools button:last-child { border-bottom: 1px solid var(--line); font-size: 15px; }
.map-key { position: absolute; left: 18px; bottom: 28px; background: rgba(255,255,255,.92); border: 1px solid var(--line); padding: 9px 11px; display: flex; gap: 14px; font-size: 10px; box-shadow: 0 3px 14px #263b3520; }
.map-key span { display: flex; gap: 6px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: white; border: 2px solid var(--ink); }
.dot.selected { background: var(--alluvial); border-color: var(--alluvial); }
.halo { width: 12px; height: 12px; border-radius: 50%; background: #e86b3533; border: 1px solid #e86b3588; }
.attribution { position: absolute; right: 7px; bottom: 5px; font-size: 9px; color: #52615c; background: #ffffffaa; padding: 2px 4px; }
.detail-head { padding: 20px 22px 15px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 5px 0 0; font: 500 29px/1 Georgia, serif; }
.detail-head .status { color: #397a3d; background: #e7f3e4; padding: 6px 7px; }
.location-block { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.location-block h3 { margin: 0 0 3px; font-size: 15px; }
.location-block > p { margin: 0 0 15px; color: var(--muted); font: 11px/1.3 monospace; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.metrics div { border-left: 2px solid #cbd2ce; padding-left: 7px; }
.metrics span { display: block; font-size: 8px; letter-spacing: .08em; color: var(--muted); }
.metrics b { font: 700 11px/1.4 monospace; }
.profile-title { padding: 14px 22px 9px; display: flex; justify-content: space-between; }
.profile { margin: 0 22px; position: relative; border: 1px solid var(--line); min-height: 290px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, #e3e7e4 40px); }
.layer { position: absolute; left: 34px; right: 50px; border-bottom: 1px solid #ffffff90; display: flex; align-items: center; padding: 0 8px; min-height: 18px; overflow: hidden; }
.layer span { font-size: 10px; font-weight: 700; text-shadow: 0 1px #ffffff88; }
.layer.alluvial { background: repeating-linear-gradient(135deg, var(--alluvial-soft), var(--alluvial-soft) 6px, #ef9a6f 6px, #ef9a6f 8px); }
.layer.diluvial { background: repeating-linear-gradient(45deg, var(--diluvial-soft), var(--diluvial-soft) 7px, #71a89f 7px, #71a89f 9px); }
.layer.sand { background-color: var(--sand); }
.depth-tick { position: absolute; left: 0; width: 31px; padding-right: 5px; text-align: right; font: 9px/1 monospace; color: var(--muted); transform: translateY(-4px); }
.nbar { position: absolute; right: 5px; width: 38px; height: 5px; background: var(--ink); min-width: 2px; transform-origin: right; }
.boundary { position: absolute; left: 30px; right: 0; border-top: 2px dashed #fff; z-index: 2; filter: drop-shadow(0 1px #5c3c2c); }
.boundary span { position: absolute; right: 3px; top: -17px; font-size: 8px; color: #593724; background: #fff4ea; padding: 2px 3px; }
.water-marker { position: absolute; left: 28px; right: 0; border-top: 2px solid var(--water); z-index: 3; }
.water-marker::before { content: "▽"; position: absolute; color: var(--water); left: -15px; top: -10px; font-size: 11px; }
.interpretation { margin: 15px 22px; padding: 12px 13px; background: #f1f5f3; border-left: 3px solid var(--diluvial); }
.interpretation p { margin: 5px 0 0; font-size: 12px; line-height: 1.45; color: #52615c; }
.section-button { margin: 0 22px 22px; width: calc(100% - 44px); height: 42px; border: 0; background: var(--alluvial); color: white; font-weight: 800; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.drawer { position: fixed; z-index: 10; left: 290px; right: 350px; bottom: 0; height: 48vh; min-height: 340px; background: white; border-top: 3px solid var(--ink); box-shadow: 0 -15px 40px #1e2c2830; transform: translateY(105%); transition: transform .28s ease; padding: 18px 24px; }
.drawer.open { transform: translateY(0); }
.drawer-head { display: flex; justify-content: space-between; }
.drawer-head h2 { margin: 4px 0 0; font: 500 23px/1 Georgia, serif; }
.drawer-head button, .dialog-close { border: 1px solid var(--line); background: white; font-size: 22px; width: 34px; height: 34px; cursor: pointer; }
.section-legend { display: flex; justify-content: flex-end; gap: 15px; font-size: 10px; margin-top: -20px; }
.section-legend span { display: flex; align-items: center; gap: 5px; }
.fill { width: 18px; height: 8px; }
.alluvial-fill { background: var(--alluvial-soft); }
.diluvial-fill { background: var(--diluvial-soft); }
.water-line { width: 18px; border-top: 2px solid var(--water); }
#sectionCanvas { width: 100%; height: calc(100% - 85px); margin-top: 12px; }
.drawer > p { margin: 2px 0 0; font-size: 9px; color: var(--muted); }
dialog { width: min(560px, calc(100vw - 30px)); border: 0; padding: 30px; box-shadow: 0 20px 60px #13231e55; color: var(--ink); }
dialog::backdrop { background: #10231d99; backdrop-filter: blur(3px); }
dialog h2 { font: 500 28px/1.1 Georgia, serif; margin: 7px 0 12px; }
dialog h3 { font-size: 13px; margin-top: 20px; }
dialog p, dialog li { font-size: 13px; line-height: 1.55; color: #52615c; }
dialog a { color: var(--diluvial); }
.dialog-close { float: right; }
.caution { background: #fff4e9; border-left: 3px solid var(--alluvial); padding: 10px 12px; }
#toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 90px); background: var(--ink); color: white; padding: 11px 16px; border-radius: 4px; font-size: 12px; opacity: 0; transition: .25s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 260px 1fr 320px; }
  .drawer { left: 260px; right: 320px; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .scope-pill { display: none; }
  .topbar { position: sticky; top: 0; }
  .workspace { height: auto; grid-template-columns: 1fr; }
  .sidebar { max-height: none; border-right: 0; }
  .intro-panel { padding-bottom: 15px; }
  .controls-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; }
  .search-label, .search-wrap, .filter-heading { grid-column: 1 / -1; }
  .list-panel { display: none; }
  .map-stage { min-height: 55vh; }
  .detail { border: 0; }
  .drawer { left: 0; right: 0; height: 70vh; }
}
@media (max-width: 560px) {
  .brand { font-size: 13px; }
  .import-button { padding: 0 10px; font-size: 11px; }
  .controls-panel { grid-template-columns: 1fr; }
  .check-row, .search-label, .search-wrap, .filter-heading { grid-column: 1; }
}
