:root {
  --ink: #14241f;
  --muted: #66736d;
  --paper: #f7f6f0;
  --panel: #ffffff;
  --line: #dfe3de;
  --green: #1d6a50;
  --green-soft: #dff1e7;
  --amber: #a05a16;
  --amber-soft: #fff0d9;
  --gray: #6f7774;
  --gray-soft: #ecefed;
  --coral: #ec6b4f;
  --navy: #18342b;
  --shadow: 0 18px 50px rgba(27, 50, 42, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.topbar {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 36, 31, .10);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy);
  color: white;
  font-family: Georgia, serif;
  font-size: 13px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.private-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  color: #46534e;
  font-size: 12px;
  font-weight: 650;
}
.private-pill span { color: var(--green); font-size: 10px; }
.icon-button, .dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  font-family: Georgia, serif;
  font-weight: 700;
}

main { padding: 0 clamp(18px, 4vw, 64px) 40px; }
.intro {
  max-width: 1540px;
  margin: 0 auto;
  padding: 38px 0 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.eyebrow, .map-kicker {
  margin: 0 0 9px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: .98;
}
.lede {
  max-width: 680px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.55;
}
.freshness-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}
.freshness-card strong, .freshness-card span { display: block; }
.freshness-card strong { font-size: 12px; }
.freshness-card div > span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }

.workspace {
  max-width: 1540px;
  min-height: 690px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 310px minmax(440px, 1fr) 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.rail, .detail-panel { padding: 22px; background: #fff; }
.rail { border-right: 1px solid var(--line); }
.detail-panel { border-left: 1px solid var(--line); overflow-y: auto; max-height: 770px; }

.search-box {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbf9;
}
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,106,80,.11); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--muted); font-size: 10px; }
.region-row { margin-top: 16px; }
.region-row label, .intent-switcher > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.region-row select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-weight: 650; }
.intent-switcher { margin-top: 18px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 10px; background: #edf0ec; }
.segmented button { padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(20,36,31,.09); }
.result-summary { min-height: 42px; margin: 14px 0 7px; padding: 10px 11px; border-radius: 9px; background: #f7f8f5; color: var(--muted); font-size: 11px; line-height: 1.4; }
.result-summary strong { color: var(--ink); }

.location-list { display: grid; gap: 7px; }
.location-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  color: var(--ink);
}
.location-item:hover { background: #f7f8f5; }
.location-item.active { border-color: #c9d9d1; background: #edf6f1; }
.place-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #f0f2ee; font-size: 15px; }
.location-item.active .place-icon { background: white; }
.place-copy strong, .place-copy small { display: block; }
.place-copy strong { font-size: 13px; line-height: 1.2; }
.place-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mini-status { width: 9px; height: 9px; border-radius: 50%; }
.empty-result { padding: 22px 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.legend { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; }
.confirmed { background: var(--green); }
.verify { background: #d4882d; }
.unknown { background: var(--gray); }

.map-panel { min-width: 0; background: #eef0eb; }
.map-toolbar {
  height: 70px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20,36,31,.08);
  background: rgba(255,255,255,.45);
}
.map-toolbar span, .map-toolbar strong { display: block; }
.map-toolbar .map-kicker { margin: 0 0 3px; color: var(--muted); font-size: 9px; }
.map-toolbar strong { font-family: Georgia, serif; font-size: 19px; font-weight: 600; }
.map-control { padding: 8px 11px; border: 1px solid rgba(20,36,31,.14); border-radius: 8px; background: rgba(255,255,255,.8); color: var(--ink); font-size: 11px; font-weight: 700; }
.map-canvas { position: relative; height: 700px; overflow: hidden; }
.city-map { width: 100%; height: 100%; transition: transform .35s ease; }
.map-canvas.focused .city-map { transform: scale(1.035); }
.water { fill: none; stroke: #bddad4; stroke-width: 24; opacity: .75; }
.road { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; }
.road.major { stroke-width: 17; }
.road-label { fill: #9ba49f; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.road-label.vertical { transform: rotate(89deg); transform-origin: 350px 180px; }
.district { fill: #e3e7e0; stroke: #cbd2ca; stroke-width: 1; stroke-dasharray: 5 5; }
.district-label { fill: #969f99; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.marker { cursor: pointer; outline: none; }
.marker circle.outer { stroke: #fff; stroke-width: 4; filter: url(#markerShadow); transition: r .18s ease, fill .18s ease; }
.marker circle.inner { fill: #fff; pointer-events: none; }
.marker text { fill: var(--ink); font-size: 11px; font-weight: 800; paint-order: stroke; stroke: #eef0eb; stroke-width: 5px; stroke-linejoin: round; }
.marker:hover circle.outer, .marker:focus circle.outer { r: 14; }
.marker.active circle.outer { r: 16; stroke-width: 5; }
.marker.active circle.inner { r: 4.5; }
.map-note { position: absolute; left: 18px; bottom: 18px; padding: 10px 12px; border: 1px solid rgba(20,36,31,.12); border-radius: 9px; background: rgba(255,255,255,.9); color: var(--muted); font-size: 10px; box-shadow: 0 8px 30px rgba(20,36,31,.08); }
.map-note span { color: var(--coral); margin-right: 5px; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-head h2 { margin: 4px 0 5px; font-family: Georgia, serif; font-size: 29px; font-weight: 550; letter-spacing: -.03em; line-height: 1.05; }
.detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.status-badge { flex: 0 0 auto; padding: 7px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.status-badge.confirmed { background: var(--green-soft); color: var(--green); }
.status-badge.verify { background: var(--amber-soft); color: var(--amber); }
.status-badge.unknown { background: var(--gray-soft); color: var(--gray); }
.decision-card { margin: 20px 0; padding: 16px; border-radius: 14px; background: var(--navy); color: #fff; }
.decision-card span { display: block; margin-bottom: 6px; color: #bdd3c9; font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.decision-card strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; line-height: 1.35; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rule-card { min-height: 112px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.rule-card .rule-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.rule-card strong { display: block; margin: 9px 0 5px; font-size: 15px; line-height: 1.2; }
.rule-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.detail-section ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.detail-section li { position: relative; padding-left: 17px; color: #46534e; font-size: 12px; line-height: 1.45; }
.detail-section li::before { content: "→"; position: absolute; left: 0; color: var(--coral); font-weight: 800; }
.source-list { display: grid; gap: 8px; }
.source-link { display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .15s, transform .15s; }
.source-link:hover { border-color: #aebbb4; transform: translateY(-1px); }
.source-link strong { display: block; font-size: 11px; }
.source-link small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.source-link > span:last-child { color: var(--coral); }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.action-link { display: flex; justify-content: center; align-items: center; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-decoration: none; font-size: 11px; font-weight: 750; }
.action-link.primary { border-color: var(--coral); background: var(--coral); color: white; }
.legal-note { color: var(--muted); font-size: 11px; line-height: 1.5; }

.community-section { padding-top: 20px; border-top: 1px solid var(--line); }
.community-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.community-head h3 { margin-bottom: 5px; }
.community-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.share-experience-button, .experience-submit, .experience-cancel {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--green);
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 750;
}
.experience-form { margin-top: 14px; padding: 14px; border: 1px solid #bfd3c9; border-radius: 13px; background: #f4faf6; }
.experience-form[hidden] { display: none; }
.experience-field { display: grid; gap: 6px; margin-bottom: 11px; }
.experience-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.experience-field label { color: #34453f; font-size: 11px; font-weight: 750; }
.experience-field label span { color: var(--muted); font-weight: 500; }
.experience-field input, .experience-field select, .experience-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 13px;
}
.experience-field input, .experience-field select { min-height: 39px; padding: 8px 9px; }
.experience-field textarea { min-height: 92px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.experience-field input:focus, .experience-field select:focus, .experience-field textarea:focus {
  outline: 3px solid rgba(29,106,80,.14);
  border-color: var(--green);
}
.bot-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.safety-check { display: flex; align-items: flex-start; gap: 8px; color: #46534e; font-size: 11px; line-height: 1.4; }
.safety-check input { margin: 2px 0 0; }
.experience-signin-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.experience-form-actions { display: flex; gap: 8px; margin-top: 12px; }
.experience-cancel { border-color: var(--line); background: white; color: var(--ink); }
.experience-submit:disabled, .experience-delete:disabled { cursor: wait; opacity: .6; }
.experience-form-status { display: block; min-height: 16px; margin-top: 9px; color: var(--green); font-size: 11px; line-height: 1.4; }
.experience-form-status.error { color: #9b3527; }
.experience-form-status a { font-weight: 800; }
.experience-list { display: grid; gap: 9px; margin-top: 13px; }
.experience-loading, .experience-error, .experience-empty { padding: 13px; border-radius: 10px; background: #f6f7f4; color: var(--muted); font-size: 11px; line-height: 1.45; }
.experience-error { background: #fff1ed; color: #87382d; }
.experience-empty strong, .experience-empty span { display: block; }
.experience-empty strong { color: var(--ink); font-size: 12px; }
.experience-empty span { margin-top: 3px; }
.experience-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.experience-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.experience-card-head strong, .experience-card-head span { display: block; }
.experience-card-head strong { font-size: 12px; }
.experience-card-head div > span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.community-badge { flex: 0 0 auto; padding: 4px 6px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 8px !important; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.experience-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.experience-tags span { padding: 4px 6px; border-radius: 6px; background: #edf3ef; color: #3d554c; font-size: 9px; font-weight: 700; }
.experience-card > p { margin: 10px 0 0; color: #34453f; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.experience-advice { margin-top: 10px; padding: 9px 10px; border-left: 3px solid var(--coral); background: #fbf6f2; color: #46534e; font-size: 11px; line-height: 1.45; }
.experience-advice strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.experience-delete { margin-top: 10px; padding: 0; border: 0; background: transparent; color: #8a3d31; font-size: 10px; font-weight: 700; text-decoration: underline; }

dialog { width: min(540px, calc(100vw - 28px)); padding: 28px; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 28px 90px rgba(20,36,31,.28); }
dialog::backdrop { background: rgba(20,36,31,.55); backdrop-filter: blur(3px); }
dialog h2 { margin: 4px 0 12px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; letter-spacing: -.03em; }
dialog p { color: #4c5954; font-size: 13px; line-height: 1.6; }
.dialog-close { position: absolute; top: 14px; right: 14px; font-family: inherit; font-size: 20px; font-weight: 400; }

@media (max-width: 1280px) {
  .workspace { grid-template-columns: 280px 1fr; }
  .detail-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .map-canvas { height: 620px; }
  .detail-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .detail-head, .decision-card, .detail-actions { grid-column: 1; }
  .rule-grid, .detail-section { grid-column: 2; }
  .rule-grid { grid-row: 1 / span 2; margin-top: 0; }
  .community-section { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar { height: 62px; }
  .private-pill { display: none; }
  main { padding-inline: 12px; }
  .intro { align-items: flex-start; padding: 28px 7px 22px; }
  .freshness-card { display: none; }
  h1 { font-size: 46px; }
  .workspace { display: flex; flex-direction: column; border-radius: 16px; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .location-list { grid-template-columns: 1fr 1fr; }
  .location-item { grid-template-columns: 28px 1fr; }
  .location-item .mini-status { display: none; }
  .place-icon { width: 28px; height: 28px; }
  .map-canvas { height: 470px; }
  .detail-panel { display: block; border-top: 1px solid var(--line); }
  .rule-grid { margin-top: 0; }
}

@media (max-width: 460px) {
  .location-list { grid-template-columns: 1fr; }
  .map-canvas { height: 420px; }
  .rule-grid { grid-template-columns: 1fr; }
  .detail-actions { grid-template-columns: 1fr; }
  .community-head { display: grid; }
  .share-experience-button { justify-self: start; }
  .experience-field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
