/* The dog map on /dogs/ (portal/_dog_map.html, js/dog_map.js) */
.dm { margin: 8px 0 30px; }
.dm-head { display: flex; justify-content: space-between; align-items: end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.dm-head h2 { margin: 0 0 4px; font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.dm-head p { margin: 0; max-width: 44em; }
.dm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .dm-wrap { grid-template-columns: minmax(0, 1fr); } }

.dm-map { position: relative; border-radius: var(--radius); border: 1px solid var(--stroke); overflow: hidden;
  background: radial-gradient(120% 90% at 30% 10%, rgba(182,111,221,.16), transparent 60%), radial-gradient(90% 80% at 85% 90%, rgba(95,212,255,.10), transparent 60%), var(--bg2); }
.dm-map svg { display: block; width: 100%; height: auto; padding: 10px; box-sizing: border-box; overflow: visible; }

/* states */
.dm-st0 { fill: rgba(255,255,255,.035); stroke: rgba(255,255,255,.16); stroke-width: .8; stroke-linejoin: round; }
.dm-st path { stroke: rgba(255,255,255,.28); stroke-width: .9; stroke-linejoin: round; transition: fill .25s ease, stroke .25s ease; cursor: pointer; }
.dm-st.lv1 path { fill: rgba(182,111,221,.20); }
.dm-st.lv2 path { fill: rgba(182,111,221,.32); }
.dm-st.lv3 path { fill: rgba(182,111,221,.46); }
.dm-st.lv4 path { fill: rgba(182,111,221,.62); }
.dm-st:hover path, .dm-st:focus-visible path, .dm-st.hot path { fill: rgba(95,212,255,.42); stroke: rgba(255,255,255,.7); }
.dm-st.on path { stroke: #5fd4ff; stroke-width: 1.6; }
.dm-st:focus-visible { outline: none; }
.dm-st:focus-visible path { stroke: #fff; stroke-width: 2; }
/* the "lifted" copy of the state under the pointer */
#dm-lift { fill: rgba(95,212,255,.5); stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; pointer-events: none; opacity: 0;
  filter: url(#dm-shadow); transform: translateY(0); transition: opacity .2s ease, transform .25s cubic-bezier(.2,.9,.3,1.3); }
#dm-lift.up { opacity: 1; transform: translateY(-5px); }

/* circles */
.dm-c { cursor: pointer; outline: none; }
.dm-c .dm-area { fill: url(#dm-glow); stroke: rgba(127,224,255,.85); stroke-width: 1.1; stroke-dasharray: 3 2.5; transition: stroke .2s, fill-opacity .2s; }
.dm-c .dm-dot { fill: url(#dm-dot); stroke: #0b1220; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; transition: transform .25s cubic-bezier(.2,.9,.3,1.4); }
.dm-c text { fill: #0b1020; font: 800 10.5px var(--font); text-anchor: middle; pointer-events: none; transform-box: fill-box; transform-origin: center; transition: transform .25s cubic-bezier(.2,.9,.3,1.4); }
.dm-c .dm-ring { fill: none; stroke: #7fe0ff; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.dm-c:hover .dm-dot, .dm-c:focus-visible .dm-dot, .dm-c.sel .dm-dot, .dm-c:hover text, .dm-c:focus-visible text, .dm-c.sel text { transform: scale(1.3); }
.dm-c:hover .dm-area, .dm-c:focus-visible .dm-area, .dm-c.sel .dm-area { stroke: #fff; stroke-dasharray: none; }
.dm-c:hover .dm-ring, .dm-c:focus-visible .dm-ring, .dm-c.sel .dm-ring { animation: dm-pulse 1.8s ease-out infinite; }
.dm-c:focus-visible .dm-area { stroke-width: 2.4; }
.dm-c.dim { opacity: .35; }
.dm-c { animation: dm-pop .55s cubic-bezier(.2,.9,.3,1.3) backwards; animation-delay: calc(min(var(--d), 60) * 14ms + 150ms); transform-box: fill-box; transform-origin: center; }
@keyframes dm-pop { from { opacity: 0; transform: scale(.2); } }
@keyframes dm-pulse { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }

.dm-tip { position: absolute; pointer-events: none; z-index: 3; padding: 6px 11px; border-radius: 10px; font-size: 13px; font-weight: 650; white-space: nowrap;
  background: rgba(11,18,32,.92); border: 1px solid var(--stroke2); box-shadow: 0 10px 30px rgba(0,0,0,.4); transform: translate(-50%, calc(-100% - 12px)); }

/* panel */
.dm-panel { padding: 18px; max-height: 620px; overflow: auto; }
.dm-panel h3 { margin: 0 0 4px; font-size: 1.15rem; }
.dm-panel h3:focus { outline: none; }
.dm-states-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.dm-states-list a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); transition: background .15s; }
.dm-states-list a:hover, .dm-states-list a.hot, .dm-states-list a[aria-current] { background: var(--glass2); text-decoration: none; }
.dm-states-list b { color: var(--cyan); }
.dm-dogs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.dm-dog { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; color: var(--ink);
  border: 1px solid var(--stroke); background: rgba(255,255,255,.03); transition: transform .2s ease, border-color .2s, background .2s; animation: dm-in .35s ease backwards; }
.dm-dog:hover, .dm-dog:focus-visible { text-decoration: none; transform: translateX(3px); border-color: rgba(182,111,221,.6); background: rgba(182,111,221,.1); }
.dm-dog img, .dm-dog .ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #1a2340; display: grid; place-items: center; font-size: 24px; }
.dm-dog b { display: block; font-size: 15.5px; }
.dm-dog small { color: var(--muted); font-size: 13px; }
.dm-dog .go { color: var(--cyan); font-size: 18px; }
@keyframes dm-in { from { opacity: 0; transform: translateY(6px); } }
.dm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .dm-c, .dm-dog { animation: none; }
  .dm-c:hover .dm-ring, .dm-c:focus-visible .dm-ring, .dm-c.sel .dm-ring { animation: none; opacity: .6; transform: scale(1.3); }
  #dm-lift, .dm-c .dm-dot, .dm-c text, .dm-dog { transition: none; }
}
@media (forced-colors: active) {
  .dm-st path, .dm-st0 { stroke: CanvasText; } .dm-c .dm-area { stroke: LinkText; } .dm-c .dm-dot { fill: LinkText; } .dm-c text { fill: Canvas; }
}
.dm .small { font-size: 13.5px; }
@media (max-width: 980px) { .dm-panel { max-height: 440px; } }
.dm-hint-touch { display: none; }
@media (hover: none) { .dm-hint-touch { display: inline; } .dm-hint-mouse { display: none; } }
/* List / Map switch on /dogs/ */
.dg-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: -8px 0 16px; }
.dg-bar:focus { outline: none; }
.dg-bar, .dm-head h2 { scroll-margin-top: 90px; }
.seg-view { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--stroke); }
.seg-view a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-weight: 650; font-size: 14.5px; transition: background .2s, color .2s; }
.seg-view a:hover { color: var(--ink); text-decoration: none; background: var(--glass2); }
.seg-view a.on { color: #fff; background: var(--grad); box-shadow: 0 6px 18px rgba(182,111,221,.35); }

/* Homepage teaser (portal/_dog_map_teaser.html) */
.dmt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 28px; align-items: center; margin: 44px 0 8px; padding: 28px 30px;
  border-radius: var(--radius); border: 1px solid var(--stroke); color: var(--ink); overflow: hidden; position: relative;
  background: radial-gradient(90% 120% at 100% 0%, rgba(95,212,255,.12), transparent 60%), radial-gradient(80% 100% at 0% 100%, rgba(182,111,221,.18), transparent 60%), var(--bg2);
  transition: border-color .3s ease, box-shadow .3s ease; }
.dmt:hover, .dmt:focus-visible { text-decoration: none; border-color: rgba(182,111,221,.55); box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.dmt h2 { margin: 4px 0 8px; font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
.dmt p { margin: 0 0 18px; max-width: 30em; }
.dmt-map svg { display: block; width: 100%; height: auto; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.dmt:hover .dmt-map svg, .dmt:focus-visible .dmt-map svg { transform: scale(1.035) translateY(-4px); }
.dm-st-t { stroke: rgba(255,255,255,.26); stroke-width: .9; stroke-linejoin: round; }
.dm-st-t.lv1 { fill: rgba(182,111,221,.20); } .dm-st-t.lv2 { fill: rgba(182,111,221,.32); }
.dm-st-t.lv3 { fill: rgba(182,111,221,.46); } .dm-st-t.lv4 { fill: rgba(182,111,221,.62); }
.dmt-dot { fill: #7fe0ff; stroke: rgba(11,18,32,.9); stroke-width: 1.5; transform-box: fill-box; transform-origin: center;
  animation: dmt-twinkle 3.2s ease-in-out infinite; animation-delay: calc(mod(var(--d), 17) * -190ms); }
@keyframes dmt-twinkle { 0%, 100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
@media (max-width: 860px) { .dmt { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; gap: 16px; } .dmt-map { order: -1; } }
@media (prefers-reduced-motion: reduce) { .dmt-dot { animation: none; opacity: .9; } .dmt-map svg { transition: none; } .dmt:hover .dmt-map svg { transform: none; } }
