:root { --bg: #1e1e1e; --panel: #2a2a2a; --fg: #f7f7f5; --acc: #fcb71e; --dark: #2e2e2e; --line: rgba(255,255,255,.12); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { display: flex; flex-direction: column; }
#topbar { flex: none; height: 54px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--dark); border-bottom: 2px solid var(--acc); }
#topbar .brand { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
#topbar .brand img { width: 34px; height: 34px; } #topbar .brand b { color: var(--acc); }
#topbar .nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
#topbar .nav > a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9px; color: var(--fg); font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
#topbar .nav > a:hover { background: rgba(255,255,255,.08); }
#topbar .nav > a.on { background: var(--acc); color: #1b1b1b; }
#edwrap { flex: 1; display: flex; min-height: 0; }
a { color: var(--acc); }
.dim { opacity: .65; } .small { font-size: 12.5px; }
#side { width: 360px; flex: none; height: 100%; overflow: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 16px 30px; }
header h1 { margin: 6px 0 2px; font-size: 20px; } header h1 span { color: var(--acc); }
.back { font-size: 13px; text-decoration: none; }
section { border-top: 1px solid var(--line); padding: 10px 0; }
h3 { margin: 2px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .65; }
label { display: block; margin: 6px 0; font-size: 13px; }
input, select { width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: #11151a; color: var(--fg); font: inherit; }
input[type=range] { padding: 0; accent-color: var(--acc); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row { display: flex; gap: 6px; align-items: center; margin: 6px 0; } .row.wrap { flex-wrap: wrap; }
.row select { flex: 1; }
button { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: #2a3039; color: var(--fg); font: inherit; cursor: pointer; }
button:hover { border-color: rgba(255,255,255,.3); }
button.acc, button.on { background: var(--acc); color: #1b1b1b; border-color: var(--acc); font-weight: 600; }
button.danger { color: #ff9a8a; }
button:disabled { opacity: .4; cursor: not-allowed; }
#segList { list-style: none; padding: 0; margin: 8px 0; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
#segList li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
#segList li:last-child { border-bottom: 0; }
#segList li.sel { background: rgba(242,182,50,.18); }
#segList li i { width: 10px; height: 22px; border-radius: 3px; flex: none; }
#segList li b { font-weight: 600; flex: 1; }
#segList li small { opacity: .7; font-variant-numeric: tabular-nums; }
#segProps, #zoneProps, #itemProps, #rampProps, #brakeProps { background: #161a20; border-radius: 8px; padding: 6px 10px; }
#segProps:empty, #zoneProps:empty, #itemProps:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chips button { padding: 3px 8px; font-size: 12.5px; }
.slopeval { float: right; font-weight: 700; font-variant-numeric: tabular-nums; }
#msg { min-height: 1.2em; } #msg.err { color: #ff9a8a; } #msg.ok { color: #8ad69a; }
main { flex: 1; position: relative; min-width: 0; }
#cv { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 130px); background: #23402b; cursor: crosshair; touch-action: none; }
#profile { position: absolute; left: 0; bottom: 0; width: 100%; height: 130px; background: #12161b; border-top: 1px solid var(--line); }
#legend { position: absolute; left: 12px; top: 10px; display: flex; gap: 10px; font-size: 12px; background: rgba(0,0,0,.45); padding: 5px 10px; border-radius: 8px; flex-wrap: wrap; }
#legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
#stats { position: absolute; right: 12px; top: 10px; font-size: 13px; background: rgba(0,0,0,.45); padding: 6px 10px; border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
#viewBtns { position: absolute; right: 12px; bottom: 142px; }
@media (max-width: 800px) {
  #topbar { height: 50px; gap: 6px; padding: 0 6px; } #topbar .brand span, #topbar .nav > a span { display: none; } #topbar .nav > a.on span { display: inline; }
  #edwrap { flex-direction: column; }
  #side { width: 100%; height: 50%; order: 2; border-right: 0; border-top: 1px solid var(--line); }
  main { height: 50%; flex: none; }
}

.chk { display: flex; gap: 8px; align-items: center; } .chk input { width: auto; }
#rampProps select { width: 100%; margin: 6px 0; }
#segList li[data-sp] { background: rgba(255,255,255,.03); }
#segList li[data-sp].sel { background: rgba(242,182,50,.18); }
.hide { display: none !important; }
