/* Exercise KG explorer — MIT licence */
:root { --bg: #11151c; --bg2: #171c25; --bg3: #202734; --fg: #e3e7ee; --muted: #8a94a6; --accent: #4fc3f7; --border: #2a3242; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
a { color: var(--accent); }
header { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--bg2); border-bottom: 1px solid var(--border); z-index: 10; }
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; } .brand span { color: var(--accent); font-weight: 400; }
.stats { margin-left: auto; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.search { position: relative; flex: 1; max-width: 620px; }
.search input { width: 100%; padding: 8px 11px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg3); color: var(--fg); font-size: 14px; outline: none; }
.search input:focus { border-color: var(--accent); }
.search.small input { padding: 5px 8px; font-size: 12.5px; margin-bottom: 5px; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; max-height: 420px; overflow-y: auto; z-index: 30; box-shadow: 0 8px 24px #0008; }
.suggest li { padding: 5px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.suggest li.active, .suggest li:hover { background: var(--bg3); }
.suggest .lab { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .lab mark { background: none; color: var(--accent); font-weight: 600; }
.suggest .tag { color: var(--muted); font-size: 11px; white-space: nowrap; }
.suggest .to { font-size: 11px; color: var(--muted); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
#left { position: fixed; top: 52px; bottom: 0; left: 0; width: 290px; overflow-y: auto; background: var(--bg2); border-right: 1px solid var(--border); padding: 4px 12px 12px; z-index: 5; }
#left section { border-bottom: 1px solid var(--border); padding: 10px 0; }
#left h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
#left h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
#left footer { color: var(--muted); font-size: 11px; padding-top: 10px; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
button { background: var(--bg3); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
button:hover:not(:disabled) { border-color: var(--accent); } button:disabled { opacity: .45; cursor: default; }
button.primary { background: #1d4f6e; border-color: #2b6f99; }
.row.small button { padding: 2px 8px; font-size: 11.5px; }
.check { display: flex; gap: 6px; align-items: center; margin: 3px 0; color: var(--fg); }
.field { display: block; margin: 5px 0; color: var(--muted); font-size: 12px; }
.field select { display: block; width: 100%; margin-top: 2px; padding: 4px; background: var(--bg3); color: var(--fg); border: 1px solid var(--border); border-radius: 5px; }
.field.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
.hint { color: var(--muted); font-size: 11.5px; margin: 4px 0; }
.legend .item { display: flex; align-items: center; gap: 7px; padding: 2px 4px; border-radius: 5px; cursor: pointer; user-select: none; }
.legend .item:hover { background: var(--bg3); }
.legend .item.off { opacity: .35; }
.legend .item .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.legend .line { display: inline-block; width: 18px; height: 3px; border-radius: 2px; flex: none; }
#stage { position: fixed; top: 52px; left: 290px; right: 0; bottom: 0; }
body.panel-open #stage { right: 400px; }
#sigma { position: absolute; inset: 0; background: radial-gradient(ellipse at center, #161c27 0%, #0d1117 100%); }
#toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: #000c; padding: 7px 14px; border-radius: 7px; border: 1px solid var(--border); pointer-events: none; }
#mode-banner { position: absolute; left: 12px; top: 12px; background: #1d4f6ecc; border: 1px solid #2b6f99; padding: 6px 12px; border-radius: 7px; }
#panel { position: fixed; top: 52px; right: 0; bottom: 0; width: 400px; overflow-y: auto; background: var(--bg2); border-left: 1px solid var(--border); padding: 14px 16px 30px; z-index: 6; }
#panel-close { position: absolute; top: 8px; right: 10px; font-size: 18px; line-height: 1; padding: 2px 8px; }
#panel h2 { margin: 0 30px 2px 0; font-size: 19px; }
#panel h4 { margin: 16px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 3px; }
#panel .sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
#panel .badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; margin-right: 4px; color: #111; font-weight: 600; }
#panel .props { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 12.5px; }
#panel .props dt { color: var(--muted); } #panel .props dd { margin: 0; }
#panel .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-size: 12px; max-width: 100%; }
.chip:hover { border-color: var(--accent); }
.chip small { color: var(--muted); }
#panel .actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
#panel .actions button { font-size: 12px; padding: 3px 8px; }
#panel table { width: 100%; border-collapse: collapse; font-size: 12px; }
#panel td, #panel th { text-align: left; padding: 2px 4px; vertical-align: top; border-bottom: 1px solid #222a37; }
#panel th { color: var(--muted); font-weight: 500; }
#panel .names .lang { color: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; margin-right: 4px; }
#panel details { margin: 4px 0; } #panel summary { cursor: pointer; color: var(--fg); }
#panel .txt { white-space: pre-wrap; font-size: 12.5px; background: var(--bg3); padding: 6px 8px; border-radius: 6px; margin: 4px 0; }
#panel .credit { color: var(--muted); font-size: 11px; }
#panel .media { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
#panel .media figure { margin: 0; background: var(--bg3); border-radius: 6px; overflow: hidden; }
#panel .media img { width: 100%; height: 100px; object-fit: contain; background: #fff; display: block; }
#panel .media .vid { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: #000; color: #fff; text-decoration: none; }
#panel .media figcaption { font-size: 10.5px; color: var(--muted); padding: 3px 5px; line-height: 1.3; }
#panel .more { color: var(--accent); cursor: pointer; font-size: 12px; }
#path-result { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
#path-result li { margin: 2px 0; } #path-result .rel { color: var(--muted); font-size: 11px; }
