* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Hiragino Sans','Hiragino Kaku Gothic ProN','Noto Sans JP','Yu Gothic',sans-serif; background:#1a1a2e; color:#e0e0e0; }
/* === Header (hazardmap統一) === */
.app-header { position:relative; z-index:1200; height:52px; background:rgba(15,23,42,0.88); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); display:flex; align-items:center; justify-content:space-between; padding:0 14px; gap:12px; box-shadow:0 1px 8px rgba(0,0,0,0.25); flex-shrink:0; }
.app-header-left { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.app-header-logo { display:flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:8px; background:white; transition:opacity .2s; overflow:hidden; text-decoration:none; }
.app-header-logo img { width:32px; height:32px; object-fit:contain; }
.app-header-name { font-size:14px; font-weight:700; color:#fff; white-space:nowrap; letter-spacing:0.3px; margin:0; }
.app-header-sub { font-size:10px; color:rgba(255,255,255,.85); white-space:nowrap; margin-top:2px; }
.app-header-search { display:block; flex:1 1 0%; max-width:340px; position:relative; }
.app-header-search input { width:100%; height:34px; background:rgba(255,255,255,.1); border:none; border-radius:8px; color:#fff; font-size:13px; padding:0 36px 0 12px; outline:none; transition:background .2s; }
.app-header-search input::placeholder { color:rgba(255,255,255,.45); }
.app-header-search input:focus { background:rgba(255,255,255,.18); }
.app-header-search button { position:absolute; right:4px; top:50%; transform:translateY(-50%); background:none; border:none; color:rgba(255,255,255,.6); cursor:pointer; padding:4px; display:flex; align-items:center; }
.app-header-search button:hover { color:#fff; }
.header-map-link { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; color:#fff; background:rgba(255,255,255,.12); padding:6px 14px; border-radius:18px; text-decoration:none; white-space:nowrap; transition:background .2s; flex-shrink:0; }
.header-map-link:hover { background:rgba(255,255,255,.22); }
/* === Map action buttons (hazardmap統一) === */
.map-action-btns { position:absolute; top:64px; right:12px; z-index:1000; display:flex; flex-direction:column; gap:6px; align-items:center; }
.map-action-btn { width:44px; height:44px; border-radius:50%; background:#fff; border:none; cursor:pointer; box-shadow:0 2px 10px rgba(0,0,0,0.22); display:flex; flex-direction:column; align-items:center; justify-content:center; color:#1a3a6a; transition:all .15s ease; font-size:13px; gap:1px; }
.map-action-btn:hover { transform:scale(1.08); box-shadow:0 4px 14px rgba(0,0,0,0.28); }
.map-action-btn .btn-label { font-size:8px; font-weight:600; line-height:1; margin-top:1px; }
.map-action-tertiary { background:rgba(255,255,255,0.92); color:#446; box-shadow:0 1px 6px rgba(0,0,0,0.18); }
.map-action-btn.hazard-active { background:#ff9800; color:#fff; box-shadow:0 2px 12px rgba(255,152,0,.45); }
.map-action-btn.hazard-active:hover { background:#fb8c00; }
.map-action-btn.hazard-active .btn-label { color:#fff; }
.map-action-sep { width:24px; height:1px; background:rgba(0,0,0,0.12); margin:2px 0; }
/* === Zoom controls (hazardmap統一) === */
.leaflet-control-zoom { display:flex; flex-direction:column; gap:6px !important; border:none !important; box-shadow:none !important; background:transparent !important; }
.leaflet-control-zoom a { width:44px !important; height:44px !important; border-radius:50% !important; background:#fff !important; color:#1a3a6a !important; box-shadow:0 2px 10px rgba(0,0,0,0.22) !important; border:none !important; line-height:44px !important; font-size:20px !important; font-weight:bold !important; }
.leaflet-control-zoom a:hover { background:#f0f0f0 !important; }
#toolbar { display:flex; align-items:center; gap:8px; padding:8px 16px; background:#16213e; border-bottom:1px solid #0f3460; position:relative; z-index:999; flex-wrap:wrap; }
#toolbar .color-select { display:none; }
/* Mode pill buttons */
.mode-pills { display:flex; gap:6px; flex-shrink:0; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.mode-pills::-webkit-scrollbar { display:none; }
.mode-pill { display:inline-flex; align-items:center; gap:5px; padding:7px 14px; border-radius:20px; border:1.5px solid rgba(136,146,176,.25); background:rgba(15,52,96,.5); color:#8892b0; font-size:11.5px; font-weight:500; cursor:pointer; white-space:nowrap; transition:all .25s ease; min-height:36px; }
.mode-pill:hover { border-color:rgba(100,255,218,.35); color:#ccd6f6; }
.mode-pill.active { background:rgba(100,255,218,.12); border-color:#64ffda; color:#64ffda; font-weight:600; }
.mode-pill svg { width:14px; height:14px; flex-shrink:0; opacity:.7; transition:opacity .25s; }
.mode-pill.active svg { opacity:1; }
/* Nudge snackbar */
#mode-nudge { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(80px); z-index:2000; background:rgba(10,10,26,.92); border:1px solid rgba(100,255,218,.25); border-radius:14px; padding:12px 18px; box-shadow:0 4px 24px rgba(0,0,0,.5); display:flex; align-items:center; gap:10px; max-width:360px; backdrop-filter:blur(8px); transition:transform .4s cubic-bezier(.32,.72,.24,1.02), opacity .4s ease; opacity:0; pointer-events:none; }
#mode-nudge.show { transform:translateX(-50%) translateY(0); opacity:1; pointer-events:auto; }
#mode-nudge .nudge-text { color:#ccd6f6; font-size:12px; line-height:1.5; }
#mode-nudge .nudge-text b { color:#64ffda; }
#mode-nudge .nudge-btn { flex-shrink:0; background:#64ffda; color:#0f3460; border:none; padding:7px 14px; border-radius:8px; font-size:11.5px; font-weight:600; cursor:pointer; transition:all .2s; }
#mode-nudge .nudge-btn:hover { background:#4de8b4; }
#mode-nudge .nudge-close { position:absolute; top:4px; right:8px; background:none; border:none; color:#8892b0; font-size:14px; cursor:pointer; padding:4px; }
#tag-scroll { display:flex; align-items:center; gap:8px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; flex:1; min-width:0; position:relative; }
#tag-scroll::-webkit-scrollbar { display:none; }
#tag-scroll-wrap { position:relative; flex:1; min-width:0; }
#tag-scroll-wrap::after { content:''; position:absolute; right:0; top:0; bottom:0; width:28px; background:linear-gradient(to right, transparent, #16213e); pointer-events:none; z-index:1; }
.sep { width:1px; height:20px; background:#1a1a3e; }
.tag-btn { padding:8px 14px; border-radius:18px; border:1px solid #5a6578; background:transparent; color:#a0aec0; font-size:12px; cursor:pointer; transition:all .2s; white-space:nowrap; min-height:40px; display:inline-flex; align-items:center; }
.tag-btn:hover { border-color:#64ffda; color:#64ffda; }
.tag-btn:focus-visible { outline:2px solid #64ffda; outline-offset:2px; }
.tag-btn.active { background:#64ffda; color:#0f3460; border-color:#64ffda; font-weight:600; }
#map { width:100%; height:calc(100vh - 100px); min-height:400px; }
.leaflet-popup-content-wrapper { background:#16213e; color:#e0e0e0; border-radius:10px; box-shadow:0 4px 20px rgba(0,0,0,.5); max-width:360px; }
.leaflet-popup-tip { background:#16213e; }
.leaflet-popup-content { margin:0; padding:0; font-size:13px; line-height:1.6; max-height:60vh; overflow-y:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:rgba(100,255,218,.3) transparent; }
.leaflet-popup-content::-webkit-scrollbar { width:4px; }
.leaflet-popup-content::-webkit-scrollbar-thumb { background:rgba(100,255,218,.3); border-radius:4px; }
.popup-inner { padding:16px; min-width:280px; }
.popup-title { font-size:16px; font-weight:700; color:#64ffda; border-bottom:1px solid #1a1a3e; padding-bottom:8px; margin-bottom:10px; }
.popup-tags { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:10px; position:relative; }
.popup-tag { background:#0f3460; color:#64ffda; padding:2px 8px; border-radius:10px; font-size:10px; }
.popup-section { margin-bottom:10px; }
.popup-stat { display:flex; justify-content:space-between; align-items:baseline; padding:2px 0; }
.popup-stat .label { color:#a0aec0; font-size:12px; }
.popup-stat .value { font-weight:600; font-size:13px; }
.popup-stat .value.up { color:#64b5f6; }
.popup-stat .value.down { color:#ef5350; }
.popup-stat .value.flat { color:#b0bec5; }
.popup-comment { background:#0f3460; border-radius:8px; padding:10px 12px; margin:10px 0; font-size:12px; line-height:1.7; color:#ccd6f6; border-left:3px solid #64ffda; }
.popup-link { display:block; text-align:right; color:#64ffda; text-decoration:none; font-size:11px; margin-top:8px; }
.popup-link:hover { text-decoration:underline; }
.popup-cta-wrap { position:sticky; bottom:0; background:linear-gradient(to top, #16213e 70%, transparent); padding:10px 0 2px; margin-top:8px; z-index:1; }
.popup-cta { display:block; text-align:center; background:linear-gradient(135deg,#64ffda,#00bfa5); color:#0f3460; text-decoration:none; font-size:12px; font-weight:700; padding:10px 16px; border-radius:8px; transition:all .2s; box-shadow:0 2px 8px rgba(100,255,218,.25); }
.popup-cta:hover { transform:translateY(-1px); box-shadow:0 4px 14px rgba(100,255,218,.35); }
.popup-cta-sub { display:block; text-align:center; color:#a0aec0; text-decoration:none; font-size:11px; margin-top:6px; padding:6px 12px; border:1px solid #3d4a6e; border-radius:6px; transition:all .2s; }
.popup-cta-sub:hover { border-color:#64ffda; color:#64ffda; }
.popup-cta:focus-visible, .popup-cta-sub:focus-visible { outline:2px solid #64ffda; outline-offset:2px; }
.popup-tabs { display:flex; border-bottom:1px solid #1a1a3e; margin-bottom:10px; }
.popup-tab-btn { flex:1; padding:7px 0; text-align:center; font-size:11px; color:#a0aec0; background:transparent; border:none; cursor:pointer; border-bottom:2px solid transparent; transition:all .2s; }
.popup-tab-btn:hover { color:#ccd6f6; }
.popup-tab-btn:focus-visible { outline:2px solid #64ffda; outline-offset:-2px; }
.popup-tab-btn.active { color:#64ffda; border-bottom-color:#64ffda; font-weight:600; }
.popup-tab-content { display:none; }
.popup-tab-content.active { display:block; }
.popup-history { background:#0f3460; border-radius:8px; padding:12px 14px; font-size:12px; line-height:1.8; color:#ccd6f6; border-left:3px solid #ffd93d; }
.popup-history-label { font-size:10px; color:#ffd93d; margin-bottom:6px; display:flex; align-items:center; gap:4px; }
.spark-row { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid rgba(136,146,176,.15); }
.spark-row:last-child { border-bottom:none; }
.spark-label { font-size:11px; color:#a0aec0; min-width:50px; }
.spark-svg { flex-shrink:0; }
.pop-spark-row { display:flex; align-items:center; justify-content:space-between; margin-top:8px; padding-top:6px; border-top:1px solid rgba(136,146,176,.1); }
.pop-spark-label { font-size:10px; color:#a0aec0; }
.pop-spark-chart { margin-top:2px; }
.spark-summary { font-size:11px; font-weight:600; text-align:right; min-width:64px; }
.spark-summary.up { color:#64b5f6; }
.spark-summary.down { color:#ef5350; }
.spark-summary.flat { color:#b0bec5; }
#hazard-panel { position:absolute; top:64px; right:62px; z-index:999; background:rgba(22,33,62,.94); border-radius:8px; padding:0; box-shadow:0 2px 12px rgba(0,0,0,.5); font-size:11px; min-width:180px; backdrop-filter:blur(4px); overflow:hidden; }
#hazard-toggle { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; cursor:pointer; user-select:none; border-bottom:1px solid rgba(136,146,176,.15); }
#hazard-toggle span { color:#ff9800; font-weight:600; font-size:11px; }
#hazard-toggle .arrow { color:#8892b0; font-size:10px; transition:transform .2s; }
#hazard-toggle .arrow.open { transform:rotate(180deg); }
#hazard-list { padding:6px 10px; display:none; }
#hazard-list.open { display:block; }
.hazard-item { display:flex; align-items:center; gap:6px; padding:4px 0; cursor:pointer; }
.hazard-item input { accent-color:#ff9800; cursor:pointer; }
.hazard-item label { color:#ccd6f6; font-size:11px; cursor:pointer; white-space:nowrap; }
.hazard-item .hz-icon { width:14px; height:10px; border-radius:2px; flex-shrink:0; }
#legend { position:absolute; bottom:30px; left:10px; z-index:400; background:rgba(22,33,62,.92); border-radius:8px; padding:10px 12px; box-shadow:0 2px 10px rgba(0,0,0,.4); font-size:10px; min-width:120px; backdrop-filter:blur(4px); }
#legend h4 { font-size:11px; color:#64ffda; margin-bottom:5px; }
.legend-item { display:flex; align-items:center; gap:5px; margin:2px 0; }
.legend-color { width:16px; height:10px; border-radius:2px; }
#toast { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%) scale(0.8); background:rgba(22,33,62,.95); color:#64ffda; font-size:14px; font-weight:600; padding:12px 24px; border-radius:10px; box-shadow:0 4px 20px rgba(0,0,0,.5); z-index:2000; pointer-events:none; opacity:0; transition:opacity .25s, transform .25s; backdrop-filter:blur(6px); border:1px solid rgba(100,255,218,.2); }
#toast.show { opacity:1; transform:translate(-50%,-50%) scale(1); }
#filter-badge { display:none; position:absolute; top:8px; left:50%; transform:translateX(-50%); z-index:600; background:rgba(100,255,218,.15); color:#64ffda; font-size:11px; padding:5px 14px 5px 10px; border-radius:20px; border:1px solid rgba(100,255,218,.3); backdrop-filter:blur(4px); cursor:default; white-space:nowrap; }
#filter-badge.show { display:flex; align-items:center; gap:6px; }
#filter-badge .close { cursor:pointer; font-size:14px; line-height:1; opacity:.7; }
#filter-badge .close:hover { opacity:1; }
.popup-comment-label { font-size:10px; color:#64ffda; margin-bottom:4px; font-weight:600; }
.map-label { font-family:'Hiragino Sans','Noto Sans JP',sans-serif; text-align:center; pointer-events:none; text-shadow:0 1px 4px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.7), 0 0 2px rgba(0,0,0,1); line-height:1.3; white-space:nowrap; }
.map-label .ml-arrow { font-size:10px; font-weight:700; }
.map-label .ml-value { font-size:12px; font-weight:700; }
.map-label .ml-name { font-size:10px; color:#e0e0e0; display:block; }
.map-label .ml-up { color:#fff; }
.map-label .ml-down { color:#fff; }
.map-label .ml-flat { color:#ccc; }
.map-label .ml-price { color:#fff; }
.map-label .ml-lp-up { color:#fff; }
.map-label .ml-lp-down { color:#fff; }
.map-label .ml-lp-flat { color:#ccc; }
.map-label .ml-yr-note { font-size:9px;color:#bbb;margin-left:1px; }
.map-label .ml-qual { font-size:9px; color:#ddd; font-weight:400; }
.popup-hint { text-align:center; color:#7a8498; font-size:10px; margin-top:8px; padding-top:6px; border-top:1px solid rgba(136,146,176,.1); }
.popup-tag-edit-btn { background:none; border:1px solid #3d4a6e; color:#a0aec0; font-size:9px; padding:2px 8px; border-radius:8px; cursor:pointer; transition:all .2s; }
.popup-tag-edit-btn:hover { border-color:#64ffda; color:#64ffda; }
#tag-editor-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.7); z-index:4000; align-items:center; justify-content:center; }
#tag-editor-overlay.show { display:flex; }
.tag-editor { background:#16213e; border-radius:14px; padding:24px 28px; max-width:360px; width:90%; box-shadow:0 8px 40px rgba(0,0,0,.6); }
.tag-editor h3 { color:#64ffda; font-size:15px; margin:0 0 6px 0; }
.tag-editor .te-town { color:#ccd6f6; font-size:12px; margin-bottom:16px; }
.tag-editor .te-list { display:flex; flex-direction:column; gap:10px; margin-bottom:20px; }
.tag-editor .te-item { display:flex; align-items:center; gap:10px; cursor:pointer; }
.tag-editor .te-item input[type=checkbox] { accent-color:#64ffda; width:18px; height:18px; cursor:pointer; }
.tag-editor .te-item label { color:#ccd6f6; font-size:13px; cursor:pointer; user-select:none; }
.tag-editor .te-actions { display:flex; gap:10px; justify-content:flex-end; }
.tag-editor .te-btn { padding:8px 18px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; border:none; transition:all .2s; }
.tag-editor .te-save { background:#64ffda; color:#0f3460; }
.tag-editor .te-save:hover { background:#4de8b4; }
.tag-editor .te-cancel { background:transparent; color:#a0aec0; border:1px solid #3d4a6e; }
.tag-editor .te-cancel:hover { border-color:#64ffda; color:#64ffda; }
.tag-editor .te-btn:focus-visible { outline:2px solid #64ffda; outline-offset:2px; }
.tag-editor .te-export { display:block; text-align:center; margin-top:12px; color:#8892b0; font-size:10px; cursor:pointer; border:none; background:none; text-decoration:underline; }
.tag-editor .te-export:hover { color:#64ffda; }
.te-toast { position:fixed; bottom:80px; left:50%; transform:translateX(-50%); background:#64ffda; color:#0f3460; padding:8px 20px; border-radius:8px; font-size:12px; font-weight:600; z-index:4001; opacity:0; transition:opacity .3s; pointer-events:none; }
.te-toast.show { opacity:1; }
/* ===== ONBOARDING STEP CARDS ===== */
#onboarding { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.75); z-index:3000; display:none; align-items:center; justify-content:center; opacity:0; transition:opacity .35s ease; pointer-events:none; }
#onboarding.show { opacity:1; pointer-events:auto; }
#onboarding .ob-card { background:linear-gradient(165deg, #1a2744 0%, #16213e 50%, #0f1a30 100%); border-radius:18px; padding:0; max-width:380px; width:92%; box-shadow:0 12px 48px rgba(0,0,0,.65), 0 0 0 1px rgba(100,255,218,.08); overflow:hidden; transform:translateY(16px) scale(.97); transition:transform .35s cubic-bezier(.34,1.56,.64,1), opacity .35s ease; opacity:0; }
#onboarding.show .ob-card { transform:translateY(0) scale(1); opacity:1; }
/* Header area with icon */
.ob-header { padding:28px 28px 0; text-align:center; }
.ob-header-icon { width:56px; height:56px; background:rgba(100,255,218,.1); border-radius:16px; display:inline-flex; align-items:center; justify-content:center; margin-bottom:14px; }
.ob-header-icon svg { width:28px; height:28px; color:#64ffda; }
.ob-header h2 { color:#e6f1ff; font-size:17px; font-weight:700; margin:0 0 6px; letter-spacing:.02em; }
.ob-header p { color:#8892b0; font-size:12px; margin:0; line-height:1.5; }
/* Step content area */
.ob-body { padding:22px 28px 0; min-height:160px; }
.ob-slide { display:none; animation:obFadeIn .35s ease forwards; }
.ob-slide.active { display:block; }
@keyframes obFadeIn { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:translateX(0); } }
/* Illustrated explanation block */
.ob-explain { background:rgba(100,255,218,.05); border:1px solid rgba(100,255,218,.1); border-radius:12px; padding:16px; margin-bottom:14px; }
.ob-explain-title { display:flex; align-items:center; gap:8px; color:#64ffda; font-size:13px; font-weight:600; margin-bottom:8px; }
.ob-explain-title svg { width:18px; height:18px; flex-shrink:0; }
.ob-explain p { color:#ccd6f6; font-size:12px; line-height:1.7; margin:0; }
.ob-explain .ob-keyword { display:inline-block; background:rgba(100,255,218,.12); color:#64ffda; padding:1px 7px; border-radius:4px; font-size:11px; font-weight:600; margin:2px 1px; }
/* Color legend mini preview */
.ob-color-row { display:flex; align-items:center; gap:6px; margin:6px 0; font-size:11px; color:#a8b2d1; }
.ob-color-swatch { width:24px; height:12px; border-radius:3px; flex-shrink:0; }
/* Tip text */
.ob-tip { display:flex; align-items:flex-start; gap:8px; color:#8892b0; font-size:11px; line-height:1.6; margin-top:10px; padding:10px 12px; background:rgba(136,146,176,.06); border-radius:8px; }
.ob-tip svg { width:16px; height:16px; color:#ffd93d; flex-shrink:0; margin-top:1px; }
/* Footer: dots + buttons */
.ob-footer { padding:18px 28px 24px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ob-dots { display:flex; gap:6px; }
.ob-dot { width:8px; height:8px; border-radius:50%; background:rgba(136,146,176,.25); transition:all .3s; cursor:pointer; }
.ob-dot.active { background:#64ffda; width:20px; border-radius:4px; }
.ob-btns { display:flex; gap:8px; }
.ob-btn-skip { background:none; border:1px solid rgba(136,146,176,.2); color:#8892b0; padding:8px 16px; border-radius:8px; font-size:12px; cursor:pointer; transition:all .2s; }
.ob-btn-skip:hover { border-color:rgba(136,146,176,.4); color:#ccd6f6; }
.ob-btn-next { background:#64ffda; color:#0f3460; border:none; padding:8px 22px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; transition:all .2s; display:flex; align-items:center; gap:6px; }
.ob-btn-next:hover { background:#4de8b4; transform:translateY(-1px); }
.ob-btn-next svg { width:14px; height:14px; }
/* Help button in action bar */
.map-action-btn-help { width:44px; height:44px; border-radius:50%; background:rgba(100,255,218,.12); border:1.5px solid rgba(100,255,218,.25); color:#64ffda; box-shadow:0 2px 10px rgba(0,0,0,.18); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all .2s; }
.map-action-btn-help:hover { background:rgba(100,255,218,.2); border-color:#64ffda; transform:scale(1.08); }
/* Tap guide overlay after onboarding */
#tap-guide { position:fixed; top:0; left:0; width:100%; height:100%; z-index:3000; pointer-events:none; opacity:0; transition:opacity .4s ease; }
#tap-guide.show { opacity:1; }
#tap-guide .tg-overlay { position:absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.35); }
#tap-guide .tg-pulse { position:absolute; width:64px; height:64px; border-radius:50%; pointer-events:auto; cursor:pointer; }
#tap-guide .tg-pulse::before, #tap-guide .tg-pulse::after { content:''; position:absolute; top:0; left:0; width:100%; height:100%; border-radius:50%; border:2.5px solid #64ffda; animation:tgRipple 1.8s ease-out infinite; }
#tap-guide .tg-pulse::after { animation-delay:.6s; }
#tap-guide .tg-pulse-core { position:absolute; top:50%; left:50%; width:20px; height:20px; margin:-10px 0 0 -10px; border-radius:50%; background:#64ffda; opacity:.8; animation:tgBounce 1.8s ease-in-out infinite; }
@keyframes tgRipple { 0%{transform:scale(.5);opacity:.8;} 100%{transform:scale(2.2);opacity:0;} }
@keyframes tgBounce { 0%,100%{transform:scale(1);opacity:.8;} 50%{transform:scale(1.2);opacity:1;} }
#tap-guide .tg-label { position:absolute; pointer-events:auto; cursor:pointer; white-space:nowrap; background:rgba(10,10,26,.88); color:#ccd6f6; font-size:13px; font-weight:500; padding:10px 18px; border-radius:12px; border:1px solid rgba(100,255,218,.2); box-shadow:0 4px 20px rgba(0,0,0,.4); line-height:1.5; }
#tap-guide .tg-label b { color:#64ffda; }
#tap-guide .tg-label::before { content:''; position:absolute; top:-6px; left:50%; transform:translateX(-50%) rotate(45deg); width:12px; height:12px; background:rgba(10,10,26,.88); border-left:1px solid rgba(100,255,218,.2); border-top:1px solid rgba(100,255,218,.2); }
@media (max-width:380px) {
  #onboarding .ob-card { width:96%; }
  .ob-header { padding:22px 20px 0; }
  .ob-body { padding:18px 20px 0; }
  .ob-footer { padding:14px 20px 20px; }
}
/* ===== BOTTOM SHEET (mobile popup) ===== */
#bottom-sheet-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.5); z-index:2500; opacity:0; transition:opacity .3s ease; }
#bottom-sheet-overlay.show { opacity:1; }
#bottom-sheet { display:none; position:fixed; left:0; right:0; bottom:0; z-index:2600; background:#16213e; border-radius:18px 18px 0 0; box-shadow:0 -4px 30px rgba(0,0,0,.5); max-height:85dvh; transform:translateY(100%); transition:transform .35s cubic-bezier(.32,.72,.24,1.02); overflow:hidden; }
#bottom-sheet.show { transform:translateY(0); }
.bs-handle { display:flex; justify-content:center; padding:10px 0 6px; cursor:grab; }
.bs-handle span { width:36px; height:4px; border-radius:2px; background:rgba(136,146,176,.35); }
.bs-scroll { overflow-y:auto; -webkit-overflow-scrolling:touch; max-height:calc(85dvh - 24px); overscroll-behavior:contain; padding-bottom:env(safe-area-inset-bottom, 0); }
.bs-scroll::-webkit-scrollbar { width:3px; }
.bs-scroll::-webkit-scrollbar-thumb { background:rgba(100,255,218,.25); border-radius:3px; }
.bs-close { position:absolute; top:8px; right:12px; width:36px; height:36px; border-radius:50%; background:rgba(136,146,176,.12); border:none; color:#8892b0; font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center; z-index:1; transition:all .2s; }
.bs-close:hover { background:rgba(136,146,176,.25); color:#e0e0e0; }
/* ===== MOBILE HEADER: collapsible search ===== */
.mobile-search-toggle { display:none; width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,.1); border:none; color:rgba(255,255,255,.7); cursor:pointer; align-items:center; justify-content:center; flex-shrink:0; transition:all .2s; }
.mobile-search-toggle:hover { background:rgba(255,255,255,.2); color:#fff; }
/* ===== TAG SCROLL INDICATORS ===== */
.tag-scroll-arrow { display:none; position:absolute; top:50%; transform:translateY(-50%); z-index:2; width:26px; height:26px; border-radius:50%; background:rgba(22,33,62,.92); border:1px solid rgba(100,255,218,.2); color:#64ffda; font-size:12px; cursor:pointer; align-items:center; justify-content:center; box-shadow:0 1px 6px rgba(0,0,0,.3); transition:opacity .2s; }
.tag-scroll-arrow.right { right:0; }
.tag-scroll-arrow.left { left:0; }
.tag-scroll-arrow.visible { display:flex; }
/* ===== TOOLBAR COLLAPSE (mobile) ===== */
.toolbar-tag-toggle { display:none; background:none; border:1px solid #3d4a6e; color:#a0aec0; font-size:11px; padding:6px 12px; border-radius:18px; cursor:pointer; white-space:nowrap; transition:all .2s; align-items:center; gap:4px; }
.toolbar-tag-toggle:hover { border-color:#64ffda; color:#64ffda; }
.toolbar-tag-toggle.has-active { border-color:rgba(100,255,218,.5); color:#64ffda; background:rgba(100,255,218,.08); }
.toolbar-tag-toggle .tag-toggle-count { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; border-radius:8px; background:#64ffda; color:#0f3460; font-size:9px; font-weight:700; padding:0 4px; margin-left:2px; }
.toolbar-tag-toggle svg { width:12px; height:12px; transition:transform .3s; }
.toolbar-tag-toggle.open svg { transform:rotate(180deg); }
#tag-section { overflow:hidden; transition:max-height .35s ease; }
#tag-section.open { max-height:60px; }
#footer { background:#0a0a1a; padding:8px 16px; font-size:10px; color:#8a8aa0; line-height:1.6; }
#footer a { color:#64ffda; text-decoration:none; }
@media (max-width:768px) {
  /* Header: compact single row */
  .app-header { height:48px; min-height:48px; padding:6px 10px; flex-wrap:nowrap; gap:6px; }
  .app-header-name { font-size:12px; }
  .app-header-sub { display:none; }
  .app-header-search { display:none; max-width:100%; }
  .app-header-search.mobile-open { display:block; position:fixed; top:0; left:0; right:0; z-index:1300; padding:8px 10px; background:rgba(15,23,42,0.95); backdrop-filter:blur(12px); }
  .app-header-search.mobile-open input { height:42px; font-size:15px; border-radius:10px; padding:0 44px 0 14px; }
  .app-header-search.mobile-open button { right:8px; padding:8px; }
  .mobile-search-toggle { display:flex; }
  .header-map-link { font-size:10px; padding:5px 10px; }
  /* Toolbar: tags collapsible */
  #toolbar { gap:6px; padding:6px 10px; flex-wrap:wrap; }
  .mode-pills { gap:4px; flex-basis:100%; order:-1; }
  .mode-pill { padding:6px 10px; font-size:10.5px; min-height:32px; }
  .mode-pill svg { width:12px; height:12px; }
  .toolbar-tag-toggle { display:inline-flex; }
  #tag-section { flex-basis:100%; max-height:0; }
  #tag-section.open { max-height:60px; }
  #tag-scroll { gap:6px; padding:4px 0; }
  #tag-scroll-wrap::after { display:none; }
  /* Map: more vertical space */
  #map { height:calc(100dvh - 88px); }
  .map-action-btns { top:10px; right:8px; }
  .map-action-btn { width:40px; height:40px; }
  .map-action-btn .btn-label { font-size:8px; }
  .map-action-btn-help { width:40px; height:40px; }
  /* Leaflet popup hidden on mobile (use bottom sheet) */
  .leaflet-popup-pane { display:none !important; }
  #legend { bottom:20px; left:6px; padding:6px 8px; font-size:9px; min-width:100px; }
  #hazard-panel { top:8px; right:60px; min-width:160px; }
  #filter-badge { font-size:10px; padding:4px 12px 4px 8px; }
  .tag-btn { padding:8px 12px; font-size:11px; min-height:38px; }
  /* Tag scroll arrows */
  .tag-scroll-arrow { display:none; }
  .tag-scroll-arrow.visible { display:flex; }
}

/* ===== Persona selection (提案C) ===== */
.ob-persona-list { display:flex; flex-direction:column; gap:6px; }
.ob-persona-btn { display:flex; align-items:center; gap:10px; padding:10px 14px; background:rgba(100,255,218,.04); border:1px solid rgba(136,146,176,.18); border-radius:10px; cursor:pointer; color:#ccd6f6; font-size:12px; text-align:left; transition:all .2s; font-family:inherit; line-height:1.5; }
.ob-persona-btn:hover { border-color:rgba(100,255,218,.4); background:rgba(100,255,218,.08); }
.ob-persona-btn:active { transform:scale(0.98); }
.ob-persona-btn b { color:#64ffda; }
.ob-persona-icon { font-size:18px; flex-shrink:0; width:28px; text-align:center; }
.ob-persona-text { flex:1; }

/* ===== Context Bar (現在のモード常時表示) ===== */
.context-bar { display:flex; align-items:center; gap:8px; padding:6px 16px; background:rgba(15,23,42,.92); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); border-bottom:1px solid rgba(136,146,176,.1); font-size:12px; color:#a8b2d1; line-height:1.4; transition:opacity .3s ease; }
.ctx-icon { font-size:14px; flex-shrink:0; }
.ctx-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@media(max-width:768px) {
  .context-bar { padding:5px 12px; font-size:11px; gap:6px; }
}

/* ===== Share Modal (hazardmap統一) ===== */
.share-modal-overlay { position:fixed; inset:0; z-index:8000; display:flex; align-items:flex-end; justify-content:center; visibility:hidden; opacity:0; transition:visibility 0s .25s, opacity .25s ease; }
.share-modal-overlay.open { visibility:visible; opacity:1; transition:visibility 0s, opacity .2s ease; }
.share-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.45); backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px); }
.share-modal-card { position:relative; z-index:1; width:100%; max-width:420px; background:#fff; border-radius:16px 16px 0 0; box-shadow:0 -4px 32px rgba(0,0,0,.18); padding:20px 18px calc(20px + env(safe-area-inset-bottom)); transform:translateY(100%); transition:transform .3s cubic-bezier(.22,1,.36,1); }
.share-modal-overlay.open .share-modal-card { transform:translateY(0); }
.share-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.share-modal-header span { font-size:15px; font-weight:700; color:#1a1a2e; }
.share-modal-close { width:32px; height:32px; border-radius:50%; border:none; background:#f0f0f0; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:16px; color:#666; transition:background .15s; }
.share-modal-close:hover { background:#e0e0e0; }
.share-modal-body { display:flex; flex-direction:column; gap:8px; }
.share-modal-option { display:flex; align-items:center; gap:12px; padding:14px 16px; border:none; background:#f7f8fa; border-radius:14px; cursor:pointer; font-size:14px; font-weight:600; color:#1a1a2e; transition:background .15s, transform .1s; font-family:inherit; }
.share-modal-option:hover { background:#eef1f6; }
.share-modal-option:active { transform:scale(0.98); }
.share-opt-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.share-opt-icon.copy-icon { background:#e8f4fd; color:#2196f3; }
.share-opt-icon.line-icon { background:#e8fbe8; color:#06c755; }
.share-opt-icon.x-icon { background:#f0f0f0; color:#1a1a2e; }
.share-toast { position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px); background:#2196f3; color:#fff; padding:10px 22px; border-radius:24px; font-size:13px; font-weight:600; box-shadow:0 4px 16px rgba(33,150,243,.35); opacity:0; transition:opacity .25s, transform .25s; z-index:8500; pointer-events:none; white-space:nowrap; }
.share-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

@media(min-width:769px) {
  .share-modal-overlay { align-items:stretch; justify-content:flex-end; }
  .share-modal-backdrop { background:transparent; backdrop-filter:none; -webkit-backdrop-filter:none; }
  .share-modal-card { position:absolute; top:64px; right:60px; width:220px; max-width:none; border-radius:20px; padding:14px 10px; box-shadow:0 8px 32px rgba(0,0,0,.18); transform:scale(0.9); opacity:0; transition:transform .2s cubic-bezier(.22,1,.36,1), opacity .2s ease; }
  .share-modal-overlay.open .share-modal-card { transform:scale(1); opacity:1; }
  .share-modal-card::after { content:''; position:absolute; top:16px; right:-8px; width:0; height:0; border-top:8px solid transparent; border-bottom:8px solid transparent; border-left:8px solid #fff; }
  .share-modal-header { margin-bottom:10px; }
  .share-modal-header span { font-size:13px; }
  .share-modal-option { padding:10px 12px; font-size:13px; gap:10px; }
  .share-opt-icon { width:30px; height:30px; border-radius:8px; }
}

