* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #1f2328; }
#layout { display: grid; grid-template-columns: 1.6fr 1fr; height: 100vh; }
#map-pane { position: relative; background: #eef1f5; }
#map, #map-fallback { width: 100%; height: 100%; }
.origin-badge { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 10px; border-radius: 8px;
  background: #f3f6fb; color: #425466; font-size: 12px; border: 1px solid #dbe4f0; }
.origin-badge .text { flex: 1; min-width: 0; overflow: hidden; }
.origin-badge .place { font-size: 13px; font-weight: 600; color: #1f2328; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.origin-badge .sub-coords { font-size: 11px; color: #6b7785; margin-top: 1px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.origin-badge .locate-me { flex: none; padding: 3px 8px; border: 1px solid #c8d3e0; border-radius: 6px;
  background: #fff; color: #425466; font-size: 12px; cursor: pointer; }
#map-hint { position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .92); color: #57606a; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.map-search { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; gap: 8px; width: min(420px, 78%); padding: 8px; border-radius: 12px;
  background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .14); }
.map-search input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #d0d7de; border-radius: 8px; font-size: 14px; }
.map-search input:focus { outline: none; border-color: #1f2328; }
.map-search button { padding: 8px 16px; border: 0; border-radius: 8px; background: #1f2328; color: #fff; cursor: pointer; }
#panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: hidden; border-left: 1px solid #e5e7eb; }
#panel header h1 { font-size: 18px; margin: 0 0 8px; }
#search-form { display: flex; gap: 8px; }
#search-input { flex: 1; padding: 8px 10px; border: 1px solid #d0d7de; border-radius: 8px; }
#search-form button { padding: 8px 14px; border: 0; border-radius: 8px; background: #1f2328; color: #fff; cursor: pointer; }
#chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid #d0d7de; background: #fff; cursor: pointer; font-size: 13px; }
.chip.active { background: #1f2328; color: #fff; }
#daily-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; }
#daily-card .name { font-size: 20px; font-weight: 600; }
#daily-card .meta { color: #57606a; font-size: 13px; margin: 4px 0 10px; }
#daily-card .actions { display: flex; gap: 8px; }
.btn { padding: 8px 12px; border-radius: 8px; border: 1px solid #d0d7de; background: #fff; cursor: pointer;
  transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease; }
.btn:hover { border-color: #8c959f; }
.btn:active { transform: scale(.95); }
.btn.active { background: #1f2328; color: #fff; border-color: #1f2328; }
#list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.item { padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .08s ease; }
.item:hover { border-color: #8c959f; }
.item:active { transform: scale(.99); }
.item.active { border-color: #1f2328; background: #f6f8fa; }
.item .sub { color: #57606a; font-size: 12px; }
#panel footer { position: relative; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#radius-row { display: flex; gap: 6px; }
#radius-row.disabled { opacity: .45; pointer-events: none; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; display: flex; flex-direction: column; gap: 2px;
  min-width: 132px; padding: 6px; background: #fff; border: 1px solid #d0d7de; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); z-index: 60; }
.menu[hidden] { display: none; }
.map-menu { position: absolute; display: flex; flex-direction: column; gap: 2px; min-width: 180px;
  padding: 6px; background: #fff; border: 1px solid #d0d7de; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14); z-index: 70; }
.map-menu[hidden] { display: none; }
.map-menu button { text-align: left; padding: 7px 10px; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer; font-size: 13px; color: #1f2328; white-space: nowrap; }
.map-menu button:hover { background: #f3f4f6; }
.poi-popup { position: absolute; z-index: 75; width: 240px; padding: 12px 14px 10px;
  background: #fff; border: 1px solid #d0d7de; border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.16); }
.poi-popup[hidden] { display: none; }
.poi-close { position: absolute; right: 8px; top: 6px; width: 22px; height: 22px; border: 0; background: transparent;
  color: #8c959f; font-size: 16px; line-height: 1; cursor: pointer; }
.poi-close:hover { color: #1f2328; }
.poi-body .poi-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; padding-right: 18px; }
.poi-body .poi-line { font-size: 12px; color: #57606a; margin-bottom: 3px; }
.poi-body .poi-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.poi-body .poi-actions .btn { padding: 5px 9px; font-size: 12px; }
.dialog { position: absolute; z-index: 80; width: min(320px, calc(100% - 24px)); padding: 14px;
  background: #fff; border: 1px solid #d0d7de; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18);
  left: 50%; top: 50%; transform: translate(-50%, -50%); }
.dialog[hidden] { display: none; }
.dialog-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.dialog-sub { font-size: 12px; color: #6b7785; margin-bottom: 10px; word-break: break-all; }
.dialog-label { display: block; font-size: 12px; color: #6b7785; margin-bottom: 4px; }
.dialog input { width: 100%; padding: 8px 10px; border: 1px solid #d0d7de; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.dialog input:focus { outline: none; border-color: #1f2328; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.menu button { text-align: left; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent;
  cursor: pointer; font-size: 13px; color: #1f2328; }
.menu button:hover { background: #f3f4f6; }
.menu button.active { background: #1f2328; color: #fff; }
.notice { color: #9a6700; font-size: 12px; margin-top: 8px; }
.coord { color: #8c959f; font-size: 12px; }
.tel-row a.tel { color: #0b62d0; text-decoration: none; }
.tel-row a.tel:hover { text-decoration: underline; }
.origin-dot { width: 14px; height: 14px; border-radius: 50%; background: #2f6fed; border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(47, 111, 237, .35); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 8px 14px;
  border-radius: 8px; background: rgba(31, 35, 40, .92); color: #fff; font-size: 13px; opacity: 0;
  transition: opacity .2s ease; pointer-events: none; z-index: 99; }
#toast.show { opacity: 1; }
@media (max-width: 860px) {
  #layout { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
  #panel { border-left: 0; border-top: 1px solid #e5e7eb; }
  #map-hint { font-size: 11px; }
}
