/* The map of the software (map.js): the overview's cards and the section flow. */
/* The panel's page is a grid: the map stays as wide as it is, and scrolls inside. */
.map-panel { min-width: 0; display: grid; gap: 12px; }
.map-panel > * { min-width: 0; }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.map-find { position: relative; flex: 1 1 260px; min-width: 0; }
.map-find .search { display: block; }
.map-results { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; right: 0; max-height: 360px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 30px rgb(15 23 42 / .14); }
.map-hit { display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--ink); }
.map-hit:hover, .map-hit:focus-visible { background: var(--soft); }
.map-hit small { color: var(--muted); font-size: 12px; }
.map-hit .bad { color: var(--bad); }
.map-hit .warn { color: var(--warn); }
.map-legend { display: inline-flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.dot.warn { background: #f59e0b; }
.dot.bad { background: var(--bad); }
.map-key { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: 14px; color: var(--muted); font-size: 12px; }
.map-key .ln { display: inline-block; width: 22px; height: 0; border-top: 2px solid #94a3b8; vertical-align: middle; }
.map-key .ln.write { border-color: #7c3aed; }
.map-key .ln.read { border-top-style: dashed; border-color: #0d9488; }
.map-key .ln.link { border-color: #f59e0b; }
.map-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--soft); color: var(--text); font-size: 13px; }
.map-note ul { margin: 6px 0 0; padding-left: 18px; }
.map-note.bad { background: var(--bad-soft); color: #7f1d1d; }
.map-note.warn { background: var(--warn-soft); color: #78350f; }
.map-note.warn summary { cursor: pointer; }
.map-note.quiet { background: none; padding: 0; color: var(--muted); }
.map-made code, .map-note code { font-size: 12px; }

/* The overview */
.map-overview { position: relative; display: grid; gap: 18px; }
.map-wires { position: absolute; inset: 0; z-index: 0; pointer-events: auto; overflow: visible; }
.map-wires .wire { fill: none; stroke: #cbd5e1; opacity: .7; transition: stroke .12s, opacity .12s; }
.map-wires .wire.on { stroke: var(--brand); opacity: 1; }
.map-wires .wire.off { opacity: .15; }
.map-group { position: relative; z-index: 1; display: grid; gap: 8px; pointer-events: none; }
.map-group h3 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.map-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.map-card { pointer-events: auto; display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: var(--radius); background: var(--surface); text-align: left; color: var(--text); font: inherit; transition: box-shadow .12s, transform .12s, border-color .12s; }
.map-card:hover, .map-card:focus-visible { box-shadow: 0 8px 22px rgb(15 23 42 / .10); transform: translateY(-1px); }
.map-card.warn { border-left-color: #f59e0b; }
.map-card.bad { border-left-color: var(--bad); }
.map-card.near { border-color: #93c5fd; }
.map-card-head { display: flex; align-items: center; gap: 8px; }
.map-card-head strong { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; }
.map-card-counts { color: var(--muted); font-size: 12px; }
.map-card-note { color: var(--text); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.map-card.bad .map-card-note { color: var(--bad); }
.map-phone { display: inline-flex; color: var(--muted); }
.map-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.warn > .map-count, .map-node.warn .map-count { background: #f59e0b; }

/* A section */
.map-title { display: grid; gap: 1px; margin-right: auto; }
.map-title h2 { margin: 0; color: var(--ink); font-size: 18px; }
.map-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.map-zoom { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.map-zoom .btn { min-width: 32px; justify-content: center; }
.map-wrap { overflow: auto; max-height: calc(100vh - 230px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 1px 1px, #e2e8f0 1px, transparent 0) 0 0 / 18px 18px, var(--soft); }
.map-sizer { position: relative; }
.map-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.map-edges { position: absolute; inset: 0; overflow: visible; }
.map-edges .edge { fill: none; stroke: #94a3b8; stroke-width: 1.2; opacity: .22; transition: opacity .12s, stroke .12s; }
.map-edges .edge.write { stroke: #7c3aed; }
.map-edges .edge.read { stroke: #0d9488; stroke-dasharray: 4 4; opacity: 0; }
.map-edges .edge.link, .map-edges .edge.shared { opacity: 0; }
.map-edges .edge.link { stroke: #f59e0b; }
.map-edges .edge.opens { stroke: #059669; }
.map-edges marker path { fill: #f59e0b; }
.map-canvas.focusing .edge { opacity: .05; }
.map-canvas.focusing .edge.read, .map-canvas.focusing .edge.link, .map-canvas.focusing .edge.shared { opacity: 0; }
.map-canvas.focusing .edge.on { opacity: .95; stroke-width: 2; }
.map-canvas.focusing .edge.call.on { stroke: var(--brand); }
.map-colhead { position: absolute; top: 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.map-colhead.sub { top: auto; padding-top: 6px; border-top: 1px dashed #cbd5e1; }
.map-node { position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; font-size: 12.5px; line-height: 1.25; overflow: hidden; transition: opacity .12s, box-shadow .12s, border-color .12s; }
.map-node strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; }
.map-node small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.map-node code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.map-node.k-endpoint { flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; }
.map-node.k-table { justify-content: center; background: #f8fafc; border-style: dashed; }
.map-node.k-phone { background: #ecfdf5; border-color: #a7f3d0; }
.map-node.shared { opacity: .85; background: #f8fafc; }
.map-node.warn { border-color: #f59e0b; box-shadow: inset 3px 0 0 #f59e0b; }
.map-node.bad { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.map-node:hover { box-shadow: 0 4px 14px rgb(15 23 42 / .12); }
.map-node.dim { opacity: .22; }
.map-node.lit { border-color: #93c5fd; }
.map-node.chosen { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(37 99 235 / .18); }
.map-node .map-count { position: absolute; top: 4px; right: 4px; margin: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; }
.map-method { flex: none; padding: 1px 5px; border-radius: 5px; background: #e2e8f0; color: #334155; font: 700 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.map-method.get { background: #dbeafe; color: #1e40af; }
.map-method.post { background: #dcfce7; color: #166534; }
.map-method.put, .map-method.patch { background: #fef3c7; color: #92400e; }
.map-method.delete { background: #fee2e2; color: #991b1b; }

/* The details drawer */
.map-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.map-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.map-list a { color: var(--brand-dark); text-decoration: none; }
.map-list a:hover { text-decoration: underline; }
.map-list a.bad { color: var(--bad); font-weight: 600; }
.map-list a.warn { color: var(--warn); }
.map-list .map-count { margin: 0; }
.map-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.map-tags a { padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--ink); text-decoration: none; }
.map-tags a:hover { background: var(--brand-soft); }

@media (max-width: 560px) {
  .map-key { margin-left: 0; }
  .map-wrap { max-height: calc(100vh - 180px); }
  .map-cards { grid-template-columns: minmax(0, 1fr); }
}
