:root {
    --bg0: #070D11;
    --bg1: #0B151B;
    --panel: #0F1E26;
    --panel-glass: rgba(15, 30, 38, 0.88);
    --panel-hi: #15303C;
    --border: #24485A;
    --border-hi: #4FA9CF;
    --accent: #46B4E6;
    --accent-dim: #1A4559;
    --text: #DCE8EE;
    --text-dim: #8EA6B2;
    --text-faint: #5D7682;
    --orange: #F0A030;
    --red: #E5534B;
    --green: #5BC07A;
    --row-line: #14303C;
    --header: "Bahnschrift SemiCondensed", "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif;
    --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --cut: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg0);
    color: var(--text);
    font-family: var(--body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }

button, input, select { font: inherit; color: inherit; }

.num { font-variant-numeric: tabular-nums; }
.hdr { font-family: var(--header); }
.dim { color: var(--text-dim); font-size: 12.5px; }
.faint { color: var(--text-faint); }
.t-ok { color: var(--green); }
.t-warn { color: var(--orange); }
.t-over { color: var(--red); }
.t-neutral { color: var(--text-faint); }
.t-accent { color: var(--accent); }

.shell { display: grid; grid-template-rows: 58px 1fr 28px; height: 100vh; border: 1px solid var(--border); }

.topbar {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 0 12px;
    background: var(--bg0);
    border-bottom: 1px solid var(--border);
}

.slant {
    --o: 12px;
    clip-path: polygon(var(--o) 0, 100% 0, calc(100% - var(--o)) 100%, 0 100%);
    background: var(--border);
    padding: 1px;
}
.slant > .slant-in {
    clip-path: polygon(var(--o) 0, 100% 0, calc(100% - var(--o)) 100%, 0 100%);
    background: #0C1C24;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 calc(var(--o) + 10px);
}

.logo { --o: 14px; height: 40px; background: var(--border-hi); }
.logo > .slant-in { background: #0E2430; gap: 10px; padding-right: 30px; }
.logo img { width: 26px; height: 26px; }
.logo .l1 { font-family: var(--header); font-weight: 700; font-size: 15px; line-height: 15px; }
.logo .l2 { font-family: var(--header); font-size: 11.5px; color: var(--accent); }

.tabs { display: flex; height: 34px; }
.tab { height: 34px; margin-right: -4px; cursor: pointer; border: 0; background: none; padding: 0; }
.tab .slant-in {
    font-family: var(--header);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dim);
    gap: 9px;
    transition: background .12s, color .12s;
}
.tab:hover .slant-in { background: #12303C; color: var(--text); }
.tab.on { background: var(--accent); }
.tab.on .slant-in { background: var(--accent-dim); color: #fff; }
.tab svg { width: 14px; height: 14px; }
.tab.on svg { stroke: #fff; }

.content {
    position: relative;
    overflow: hidden;
    background-color: var(--bg1);
    background-image:
        linear-gradient(rgba(14, 42, 56, .7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 42, 56, .7) 1px, transparent 1px);
    background-size: 32px 32px;
}

.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-top: 1px solid var(--border);
    background: var(--bg0);
    color: var(--text-dim);
    font-size: 12.5px;
}
.statusbar .right { display: flex; gap: 8px; align-items: center; font-family: var(--header); font-size: 12px; }

.frame {
    --c: var(--cut);
    position: relative;
    background: var(--border);
    padding: 1px;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.frame > .frame-in {
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: var(--panel-glass);
    padding: 16px;
    height: 100%;
}
.frame.hi { background: var(--border-hi); }
.frame.accent::before {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 100px; height: 2px;
    background: var(--accent);
    z-index: 2;
}
.brackets { position: relative; }
.brackets::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    --b: var(--bc, var(--accent));
    background:
        linear-gradient(var(--b), var(--b)) top right / 14px 2px no-repeat,
        linear-gradient(var(--b), var(--b)) top right / 2px 14px no-repeat,
        linear-gradient(var(--b), var(--b)) bottom left / 14px 2px no-repeat,
        linear-gradient(var(--b), var(--b)) bottom left / 2px 14px no-repeat;
}

.btn {
    --c: 6px;
    display: inline-flex;
    border: 0;
    padding: 1px;
    cursor: pointer;
    background: var(--border);
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    font-family: var(--header);
    font-size: 14px;
}
.btn > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--panel);
    color: var(--text);
    clip-path: inherit;
    transition: background .12s;
}
.btn:hover { background: var(--border-hi); }
.btn:hover > span { background: var(--panel-hi); }
.btn:active > span { background: var(--accent-dim); }
.btn.primary { background: var(--accent); }
.btn.primary > span { background: var(--accent-dim); color: #fff; }
.btn.small > span { padding: 3px 10px; }
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: .45; cursor: default; }

input.field, select.field {
    width: 100%;
    background: var(--bg1);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    outline: none;
    font-size: 14px;
}
input.field::placeholder { color: var(--text-faint); }
input.field:hover, select.field:hover { border-color: var(--border-hi); }
input.field:focus, select.field:focus { border-color: var(--accent); }
select.field { appearance: none; cursor: pointer; padding-right: 28px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
    background-size: 5px 5px; background-repeat: no-repeat; }
select.field option { background: var(--panel); color: var(--text); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); stroke: var(--text-dim); }
.search input { padding-left: 30px; }

.label { font-family: var(--header); font-size: 12.5px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .02em; }
.section { font-family: var(--header); font-weight: 700; color: var(--accent); margin: 0 0 8px; text-transform: uppercase; }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.split { display: grid; grid-template-columns: 420px 1fr; gap: 10px; height: 100%; padding: 14px 16px 12px; }

.list-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.list-panel > .frame-in { display: flex; flex-direction: column; padding: 0; min-height: 0; }
.list-head { padding: 14px 14px 10px; display: grid; gap: 8px; }
.list-head .title { display: flex; align-items: center; gap: 10px; }
.list-head .title h2 { margin: 0; font-family: var(--header); font-size: 18px; font-weight: 700; }
.list-head .row3 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }
.imports { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.imports .btn { width: 100%; }
.imports .btn > span { width: 100%; justify-content: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.rows { overflow-y: auto; flex: 1; min-height: 0; }
.row {
    display: grid;
    grid-template-columns: 4px auto 1fr auto;
    align-items: center;
    height: 62px;
    border-bottom: 1px solid var(--row-line);
    cursor: pointer;
}
.row:hover { background: #0F2A36; }
.row.sel { background: #16404F; }
.row .edge { height: 100%; }
.thumb {
    width: 46px; height: 46px; margin: 0 10px;
    background: #0A1A22 center / cover no-repeat;
    border: 1px solid var(--border);
    display: grid; place-items: center;
    color: #2E5A6E;
}
.thumb svg { width: 20px; height: 20px; }
.row .name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12px; margin-top: 3px; color: var(--text-dim); }
.row .meta b { color: var(--accent); }
.row .meta .mod { color: var(--orange); font-weight: 600; }
.row .val { text-align: right; margin: 0 14px 0 10px; }
.row .val .pcu { font-family: var(--header); font-size: 17px; font-weight: 600; }
.row .val .st { font-family: var(--header); font-size: 11.5px; }

.drop {
    border: 1px dashed var(--border-hi);
    margin: 14px;
    padding: 26px 16px;
    text-align: center;
    color: var(--text-dim);
}
.drop.over { background: rgba(70, 180, 230, .08); border-color: var(--accent); }
.drop .big { font-family: var(--header); font-size: 17px; color: var(--text); margin: 10px 0 4px; }

.detail { overflow-y: auto; height: 100%; padding-right: 8px; min-width: 0; }
.empty { height: 100%; display: grid; place-items: center; text-align: center; }
.empty .big { font-family: var(--header); font-size: 18px; margin-top: 12px; }

.hero { --c: 18px; height: 196px; background: var(--border-hi); }
.hero > .frame-in { padding: 0; position: relative; background: #0A1A22; }
.hero .bg { position: absolute; inset: 0; background: right center / cover no-repeat; opacity: .85; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,26,34,.94) 0%, rgba(10,26,34,.88) 45%, rgba(10,26,34,.2) 100%); }
.hero .grid { position: absolute; inset: 0; opacity: .35;
    background-image: linear-gradient(rgba(14,42,56,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(14,42,56,.7) 1px, transparent 1px);
    background-size: 32px 32px; }
.hero .body { position: absolute; inset: 22px 22px 20px 26px; display: flex; justify-content: space-between; gap: 20px; }
.hero .left { align-self: flex-end; min-width: 0; }
.hero h1 { margin: 0; font-family: var(--header); font-size: 34px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .sub { color: var(--text-dim); font-size: 13.5px; }
.hero .right { width: 250px; flex: none; }
.chips { display: flex; gap: 4px; margin-bottom: 6px; }
.chip { --o: 8px; height: 22px; }
.chip .slant-in { font-family: var(--header); font-weight: 700; font-size: 12px; padding: 0 14px; }
.chip.badge { background: var(--accent-dim); }
.chip.badge .slant-in { background: var(--accent-dim); color: #fff; }
.chip.ok { background: var(--green); } .chip.ok .slant-in { color: var(--green); background: #0A1A22; }
.chip.warn { background: var(--orange); } .chip.warn .slant-in { color: var(--orange); background: #0A1A22; }
.chip.over { background: var(--red); } .chip.over .slant-in { color: var(--red); background: #0A1A22; }
.chip.neutral { background: var(--text-faint); } .chip.neutral .slant-in { color: var(--text-faint); background: #0A1A22; }

.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.readout > .frame-in { padding: 12px 16px 14px; }
.readout .v { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 8px; }
.readout .v b { font-family: var(--header); font-size: 30px; font-weight: 600; }
.readout .v span { font-family: var(--header); font-size: 15px; color: var(--text-dim); }
.readout .sub { margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segs { display: flex; gap: 2px; height: 7px; }
.segs i { flex: 1; background: var(--row-line); }

.strip > .frame-in { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 10px 18px; }
.strip b { display: block; font-family: var(--header); font-size: 19px; font-weight: 600; }

.checks .line { display: grid; grid-template-columns: 1fr auto 60px; padding: 6px 0; border-bottom: 1px solid var(--row-line); align-items: center; }
.checks .line .st { text-align: right; font-family: var(--header); font-weight: 700; }

.warnbox > .frame-in { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.warnbox { background: var(--orange); --bc: var(--orange); }

.cost-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; gap: 10px; flex-wrap: wrap; }
.cost-head h3 { margin: 0; font-family: var(--header); font-size: 18px; font-weight: 700; }
.cost-head .opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cost-head select.field { width: auto; min-width: 70px; }
.cost { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: start; }
.cost-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 2px 0; }
.cost-row .ic {
    width: 30px; height: 30px; background: #0A1A22; border: 1px solid var(--border);
    display: grid; place-items: center; font-family: var(--header); font-size: 12px; color: var(--accent);
}
.cost-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-row .a { font-family: var(--header); font-size: 15px; font-weight: 600; }

.mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; }

.page { padding: 22px 28px 28px; overflow-y: auto; height: 100%; }
.page h1 { margin: 0; font-family: var(--header); font-size: 30px; font-weight: 600; }
.page .lead { color: var(--text-dim); margin: 4px 0 14px; font-size: 13.5px; }
.page h2 { font-family: var(--header); font-size: 15px; font-weight: 700; color: var(--accent); text-transform: uppercase; margin: 22px 0 8px; }

.profiles { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; max-width: 1150px; }
.plist > .frame-in { padding: 8px 0 12px; }
.pitem { padding: 9px 12px; cursor: pointer; font-weight: 600; border-left: 3px solid transparent; }
.pitem:hover { background: #0F2A36; }
.pitem.sel { background: #143846; border-left-color: var(--accent); }
.pitem small { display: block; font-weight: 400; color: var(--text-faint); font-size: 11.5px; }
.pbtns { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; }
.form { display: grid; grid-template-columns: 220px 1fr; gap: 8px 12px; align-items: center; }
.limits-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.limits-table th { text-align: left; font-family: var(--header); font-size: 13px; color: var(--accent); padding: 8px; border-bottom: 1px solid var(--border); background: var(--panel); }
.limits-table td { padding: 4px 8px; border-bottom: 1px solid var(--row-line); }
.limits-table input.field { padding: 4px 8px; }

.info { max-width: 820px; }
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.links p { margin: 4px 0 10px; }

.toast { position: absolute; right: 26px; bottom: 22px; width: 400px; z-index: 10; animation: slideup .32s cubic-bezier(.2,.8,.2,1); }
.toast > .frame-in { background: rgba(14, 34, 48, .96); padding: 16px 20px 18px; }
.toast .t { display: flex; align-items: center; gap: 10px; font-family: var(--header); font-weight: 700; font-size: 16px; }
.toast .x { margin-left: auto; background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 16px; }
.toast p { color: var(--text-dim); margin: 10px 0 14px; }
.toast .b { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes slideup { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.errorbar { position: absolute; left: 24px; right: 24px; bottom: 16px; z-index: 11; background: var(--red); }
.errorbar > .frame-in { background: rgba(52, 20, 20, .95); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }

.note { background: var(--accent); }
.note > .frame-in { display: flex; gap: 12px; align-items: flex-start; color: var(--text-dim); padding: 10px 14px; }

.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--bg0); }
.boot-title { font-family: var(--header); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.boot-title span { color: var(--accent); font-weight: 400; }
.boot-bar { display: flex; gap: 2px; width: 180px; height: 6px; }
.boot-bar i { flex: 1; background: var(--row-line); animation: seg 1.2s infinite; }
.boot-bar i:nth-child(n) { animation-delay: calc(var(--i, 0) * 1s); }
.boot-bar i:nth-child(1) { animation-delay: 0s; } .boot-bar i:nth-child(2) { animation-delay: .1s; } .boot-bar i:nth-child(3) { animation-delay: .2s; }
.boot-bar i:nth-child(4) { animation-delay: .3s; } .boot-bar i:nth-child(5) { animation-delay: .4s; } .boot-bar i:nth-child(6) { animation-delay: .5s; }
.boot-bar i:nth-child(7) { animation-delay: .6s; } .boot-bar i:nth-child(8) { animation-delay: .7s; } .boot-bar i:nth-child(9) { animation-delay: .8s; }
.boot-bar i:nth-child(10) { animation-delay: .9s; } .boot-bar i:nth-child(11) { animation-delay: 1s; } .boot-bar i:nth-child(12) { animation-delay: 1.1s; }
@keyframes seg { 0%, 100% { background: var(--row-line); } 30% { background: var(--accent); } }
.boot-text { color: var(--text-dim); font-size: 12.5px; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: #341414; color: var(--text); z-index: 100; }
#blazor-error-ui a { color: var(--accent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2A5366; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--border-hi); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1000px) {
    .split { grid-template-columns: 1fr; grid-template-rows: 46% 1fr; }
    .cost { grid-template-columns: 1fr; }
    .strip > .frame-in { grid-template-columns: repeat(3, 1fr); }
    .profiles { grid-template-columns: 1fr; }
    .links { grid-template-columns: 1fr; }
    .topbar { gap: 10px; overflow-x: auto; }
    .hero .right { width: 180px; }
}

.empty .icon, .drop .icon { width: 44px; height: 44px; }
.cost-row .ic img { width: 28px; height: 28px; image-rendering: auto; }

.tab { text-decoration: none; display: inline-block; }

.boot-about { max-width: 640px; margin-top: 18px; text-align: center; color: var(--text-dim); font-size: 13.5px; }
.boot-about h1 { font-family: var(--header); font-size: 18px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.boot-about a { color: var(--accent); }
.welcome { max-width: 760px; margin: 0 auto; padding: 24px 8px; }
.welcome h1 { font-family: var(--header); font-size: 28px; font-weight: 700; margin: 10px 0 6px; }
.welcome h2 { font-family: var(--header); font-size: 15px; font-weight: 700; color: var(--accent); text-transform: uppercase; margin: 18px 0 6px; }
.welcome p, .welcome li { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.welcome ul { padding-left: 18px; margin: 6px 0; }
.welcome a { color: var(--accent); }
.cost-row .ic .item-icon { width: 26px; height: 26px; }
.cost-row .ic .item-icon * { stroke-width: 1.2; stroke-linejoin: round; }
.cost-row .ic { position: relative; }
.cost-row .ic img.over { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; background: #0A1A22; }
