/* Home/Map. Colors follow Home/Index: --gray (blue tint of the tree rows), --blue (UMich navy), --maize (selection). */

:root {
    --gray: 57, 127, 247;
    --blue: 0, 39, 76;
    --maize: 255, 203, 5;
    --o3m-bg: #EEF2F7;
    --o3m-dot: #CBD5E1;
    --o3m-panel: #FFFFFF;
    --o3m-ink: #17222C;
    --o3m-muted: #5A6A77;
    --o3m-faint: #8696A2;
    --o3m-line: #D3DCE2;
    --o3m-hover: rgba(var(--gray), 0.10);
    --o3m-shadow: 0 1px 2px rgba(23,34,44,.08), 0 4px 14px rgba(23,34,44,.06);
    --o3m-mono: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* this page uses the whole window below the navbar */
body.o3m-page { margin-bottom: 0; overflow: hidden; }
body.o3m-page header nav.navbar { margin-bottom: 0 !important; }
body.o3m-page #main_div { max-width: none; padding: 0; margin: 0; }
body.o3m-page main { padding-bottom: 0 !important; }
body.o3m-page footer { display: none; }

.o3m-app { display: grid; grid-template-columns: minmax(320px, 1fr) 2fr; height: 600px; color: var(--o3m-ink); font-size: 15px; line-height: 1.4; }

/* ---------- side panel ---------- */
.o3m-side { background: var(--o3m-panel); border-right: 1px solid var(--o3m-line); display: flex; flex-direction: column; min-height: 0; z-index: 5; }
.o3m-brand { padding: 14px 18px 10px; }
.o3m-brand h1 { margin: 0; font-size: 20px; font-weight: 700; color: rgb(var(--blue)); }
.o3m-brand p { margin: 2px 0 0; color: var(--o3m-muted); font-size: 13px; }
.o3m-search { display: block; margin: 0 18px 10px; position: relative; }
.o3m-search input { width: 100%; font-size: 14.5px; padding: 8px 12px 8px 34px; border: 1px solid var(--o3m-line); border-radius: 6px; background: #F7F9FB; color: var(--o3m-ink); }
.o3m-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--o3m-faint); }
.o3m-scroll { overflow: auto; flex: 1; min-height: 0; padding: 0 18px 18px; }
.o3m-sec { margin-top: 14px; }
.o3m-sec h2 { font-size: 13px; font-weight: 700; color: var(--o3m-muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.o3m-sec h3 { margin: 0; font-size: 18px; font-weight: 700; word-break: break-word; color: rgb(var(--blue)); }
.o3m-meta { color: var(--o3m-muted); font: 13px var(--o3m-mono); margin: 2px 0 10px; }
.o3m-guide { color: var(--o3m-muted); font-size: 14px; line-height: 1.5; }
.o3m-guide p { margin: 0 0 8px; }
.o3m-empty { color: var(--o3m-faint); font-size: 13.5px; margin: 0 0 12px; }
.o3m-notes summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--o3m-muted); }
.o3m-notes ul { padding-left: 18px; font-size: 13px; }
.o3m-notes li { margin-top: 6px; }
.o3m-notes li span { color: var(--o3m-muted); }

/* key/value detail blocks, like the keyElementInfo and details boxes on Home/Index */
.o3m-kv { padding: 8px 10px; border-radius: 4px; font-size: 13.5px; }
.o3m-kv-elem { background: rgba(var(--gray), 0.2); }
.o3m-kv-attr { background: rgba(var(--maize), 0.2); }
.o3m-kv-attr .o3m-kv-row:nth-child(2n) { background: rgba(var(--maize), 0.16); }
.o3m-kv-row { display: grid; grid-template-columns: 40% 60%; padding: 2px 0; }
.o3m-kv-k { font-weight: 700; padding-right: 8px; overflow-wrap: anywhere; }
.o3m-kv-v { overflow-wrap: anywhere; }

.o3m-links { list-style: none; margin: 0 0 12px; padding: 0; }
.o3m-links li button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; padding: 5px 8px; border-radius: 4px; border-left: 3px solid var(--c, var(--o3m-line)); font-size: 13.5px; color: inherit; }
.o3m-links li button { cursor: pointer; }
.o3m-links li button:hover { background: var(--o3m-hover); }
.o3m-links .t { font-weight: 500; overflow-wrap: anywhere; }
.o3m-links .v { font: 12.5px var(--o3m-mono); color: var(--o3m-muted); overflow-wrap: anywhere; }
.o3m-res .v mark { background: rgba(var(--maize), 0.45); color: inherit; padding: 0; border-radius: 2px; }

/* relationships of the selected element: one row each, columns aligned */
.o3m-rel-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.o3m-rel-table th { font-size: 12px; font-weight: 700; color: var(--o3m-muted); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--o3m-line); }
.o3m-rel-table td { padding: 4px 6px; vertical-align: top; border-bottom: 1px solid rgba(var(--gray), 0.12); overflow-wrap: anywhere; }
.o3m-rel-table tr[data-go] { cursor: pointer; }
.o3m-rel-table tbody tr:hover { background: var(--o3m-hover); }
.o3m-rel-table .o3m-cat { color: var(--o3m-muted); font-style: italic; }
.o3m-rel-table .o3m-cat svg { margin-right: 5px; vertical-align: middle; }
.o3m-rel-table .o3m-card { font: 12px var(--o3m-mono); color: var(--o3m-muted); white-space: nowrap; }

/* keyboard key in the guide text: outlined instead of Bootstrap's dark <kbd> */
.o3m-key { background: none; color: inherit; border: 1px solid var(--o3m-faint); border-radius: 3px; box-shadow: none; padding: 0 5px; font-size: 90%; }

/* comments, same look as Home/Index */
.comment { border: 1px solid rgba(var(--blue), 1); margin: 10px 0; border-radius: 5px; padding: 0 10px; font-size: 14px; }
.comment_owner { border-bottom: 1px solid lightgray; color: cadetblue; }
.comment_text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment_status { color: dodgerblue; text-align: end; font-size: 0.8em; }
.o3m-comment-form { margin-top: 10px; }

/* ---------- canvas ---------- */
.o3m-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.o3m-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--o3m-panel); border-bottom: 1px solid var(--o3m-line); overflow-x: auto; z-index: 4; }
.o3m-bar .o3m-gap { flex: 1; min-width: 8px; }
.o3m-bar .btn { white-space: nowrap; }
.o3m-menu { display: none; }
.o3m-zoomv { font: 12.5px var(--o3m-mono); color: var(--o3m-muted); min-width: 42px; text-align: center; }
.o3m-vp { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; background-color: var(--o3m-bg); background-image: radial-gradient(var(--o3m-dot) 1.1px, transparent 1.2px); }
.o3m-vp.panning { cursor: grabbing; }
.o3m-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
svg.o3m-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.o3m-e { fill: none; stroke-width: 1.4; opacity: .6; vector-effect: non-scaling-stroke; transition: opacity .15s; }
.o3m-e.hi { stroke-width: 2.6; opacity: 1; }
.o3m-e.dim { opacity: .07; }
.o3m-eh { fill: none; stroke: transparent; stroke-width: 12; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.o3m-tip { position: absolute; pointer-events: none; background: rgb(var(--blue)); color: #fff; font: 12.5px var(--o3m-mono); padding: 5px 8px; border-radius: 4px; white-space: nowrap; z-index: 10; opacity: 0; transition: opacity .1s; }
.o3m-tip.on { opacity: 1; }
.o3m-hint { position: absolute; left: 12px; bottom: 12px; background: var(--o3m-panel); border: 1px solid var(--o3m-line); border-radius: 6px; padding: 7px 11px; font-size: 13px; color: var(--o3m-muted); box-shadow: var(--o3m-shadow); z-index: 3; max-width: calc(100% - 260px); }
.o3m-legend { position: absolute; right: 12px; bottom: 12px; background: var(--o3m-panel); border: 1px solid var(--o3m-line); border-radius: 6px; padding: 8px 12px; font-size: 13px; color: var(--o3m-ink); box-shadow: var(--o3m-shadow); z-index: 3; cursor: default; }
.o3m-legend > div { display: flex; align-items: center; gap: 8px; }
.o3m-legend > div + div { margin-top: 3px; }
.o3m-legend-card { color: var(--o3m-muted); }

/* ---------- key element boxes ---------- */
.o3m-node { position: absolute; left: 0; top: 0; width: 272px; background: var(--o3m-panel); border: 1px solid var(--o3m-line); border-radius: 6px; box-shadow: var(--o3m-shadow); transition: opacity .15s, box-shadow .15s; }
.o3m-node.open { z-index: 2; }
.o3m-node.sel { z-index: 3; box-shadow: 0 0 0 2.5px rgb(var(--blue)), var(--o3m-shadow); }
.o3m-node.nb { box-shadow: 0 0 0 2px rgba(var(--gray), 0.85), var(--o3m-shadow); }
.o3m-node.dim { opacity: .22; }
.o3m-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; cursor: pointer; user-select: none; -webkit-user-select: none; border-radius: 6px; background: rgba(var(--gray), 0.2); }
.o3m-head:hover { background: rgba(var(--gray), 0.35); }
.o3m-node.sel .o3m-head { background: rgba(var(--maize), 0.45); }
.o3m-node.open .o3m-head { border-bottom: 1px solid var(--o3m-line); border-radius: 6px 6px 0 0; }
.o3m-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.o3m-count { font: 12px var(--o3m-mono); color: var(--o3m-muted); }
.o3m-hit { font: 11.5px var(--o3m-mono); background: rgba(var(--maize), 0.6); border-radius: 4px; padding: 1px 5px; display: none; }
.o3m-node.match .o3m-hit { display: inline; }
.o3m-chev { flex: none; color: var(--o3m-muted); transition: transform .18s; }
.o3m-node.open .o3m-chev { transform: rotate(90deg); }
.o3m-body { display: none; position: relative; max-height: 330px; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 4px 0 6px; }
.o3m-node.open .o3m-body { display: block; }
.o3m-rows { list-style: none; margin: 0; padding: 0; }
.o3m-row { display: flex; align-items: center; gap: 7px; height: 25px; padding: 0 10px 0 12px; font-size: 13px; cursor: pointer; }
.o3m-row:hover { background: rgba(var(--maize), 0.3); }
.o3m-row .o3m-k { flex: none; width: 16px; font: 10.5px/16px var(--o3m-mono); text-align: center; border-radius: 3px; color: var(--o3m-muted); }
.o3m-row .o3m-k:not(:empty) { box-shadow: inset 0 0 0 1.2px var(--o3m-faint); }
.o3m-row .o3m-cn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o3m-row .o3m-ty { flex: none; font: 11.5px var(--o3m-mono); color: var(--o3m-faint); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o3m-row.hit { background: rgba(var(--maize), 0.45); }
.o3m-row.lit { background: rgba(var(--gray), 0.2); }
.o3m-row.sel { background: rgba(var(--maize), 0.6); font-weight: 600; }

@media (max-width: 760px) {
    .o3m-app { grid-template-columns: 1fr; }
    .o3m-side { position: fixed; top: 0; bottom: 0; left: 0; width: min(85vw, 400px); transform: translateX(-102%); transition: transform .22s; box-shadow: var(--o3m-shadow); z-index: 1040; }
    .o3m-side.on { transform: none; }
    .o3m-menu { display: inline-block; }
    .o3m-hide-sm { display: none; }
    .o3m-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) { .o3m-app * { transition: none !important; } }
