:root { --ink: #eef0f4; --mut: rgba(238,240,244,.52); --line: rgba(238,240,244,.1); --glass: rgba(12,14,19,.72); --acc: #f0b44a; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #060709; color: var(--ink); font-family: Alexandria, sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 50% 40%, rgba(240,180,74,.08), transparent 70%), radial-gradient(80% 60% at 50% 120%, #12151c, transparent); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

header { position: fixed; top: 14px; right: 22px; left: 22px; z-index: 6; display: flex; align-items: center; gap: 16px; }
.back { font-size: .8rem; color: var(--mut); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; background: rgba(12,14,19,.6); }
.back:hover { color: var(--ink); }
.logo { font-weight: 900; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.logo i { width: 12px; height: 12px; border-radius: 3px; background: var(--acc); box-shadow: 0 0 16px var(--acc); transform: rotate(45deg); }
.logo span { font-weight: 300; font-size: .8rem; color: var(--mut); }
.prog { margin-inline-start: auto; display: grid; grid-template-columns: auto auto; gap: 2px 10px; align-items: baseline; }
.prog b { font-family: "JetBrains Mono"; font-size: 1.15rem; font-weight: 600; }
.prog span { font-size: .72rem; color: var(--mut); }
.prog i { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--line); width: 170px; overflow: hidden; }
.prog em { display: block; height: 100%; width: 0; background: var(--acc); transition: width .4s; }
.filters { position: fixed; top: 62px; right: 50%; transform: translateX(50%); z-index: 6; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(14,16,22,.75); border: 1px solid var(--line); backdrop-filter: blur(10px); max-width: 96vw; overflow-x: auto; scrollbar-width: none; }
.filters button { background: none; border: none; padding: 6px 12px; border-radius: 999px; font-size: .76rem; color: var(--mut); white-space: nowrap; }
.filters button i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-inline-end: 6px; }
.filters button.on { background: var(--ink); color: #07080b; font-weight: 700; }

.list { position: fixed; left: 18px; top: 112px; bottom: 96px; width: 250px; z-index: 5; overflow-y: auto; padding: 10px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); scrollbar-width: thin; }
.list h4 { font-size: .68rem; color: var(--mut); font-weight: 500; margin: 10px 6px 4px; display: flex; align-items: center; gap: 6px; }
.list h4 i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.list button { display: flex; width: 100%; align-items: center; gap: 8px; background: none; border: none; padding: 6px 8px; border-radius: 10px; font-size: .8rem; text-align: right; }
.list button:hover { background: rgba(255,255,255,.05); }
.list button.sel { background: rgba(240,180,74,.16); }
.list button em { margin-inline-start: auto; font-style: normal; font-size: .64rem; padding: 2px 7px; border-radius: 999px; background: rgba(91,227,155,.14); color: #8ff0bb; white-space: nowrap; }
.list button.off em { background: rgba(240,180,74,.16); color: var(--acc); }
.list button.off span { color: var(--mut); }

.card { position: fixed; right: 18px; top: 112px; width: 330px; z-index: 5; max-height: calc(100vh - 210px); overflow-y: auto; padding: 18px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.empty b { font-size: 1.05rem; } .empty p { color: var(--mut); font-size: .84rem; line-height: 1.85; margin-top: 6px; font-weight: 300; }
.sys { display: inline-block; font-size: .68rem; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.card small { display: block; font-family: "JetBrains Mono"; font-size: .66rem; letter-spacing: .14em; color: var(--mut); margin-top: 10px; }
.card h2 { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; margin: 2px 0 8px; }
.card p { color: var(--mut); line-height: 1.85; font-size: .86rem; font-weight: 300; }
.sensor { margin-top: 12px; border-radius: 14px; border: 1px solid rgba(255,77,141,.35); background: rgba(255,77,141,.07); padding: 10px 12px; display: grid; gap: 6px; }
.sensor div { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; }
.sensor span { color: var(--mut); } .sensor b { font-weight: 500; text-align: left; }
.sensor .read b { font-family: "JetBrains Mono"; color: #ff8ab3; font-size: .9rem; direction: ltr; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin-top: 12px; font-size: .78rem; }
.card dt { color: var(--mut); } .card dd { font-weight: 500; }
.blocked { margin-top: 12px; font-size: .78rem; line-height: 1.8; color: #ffb4a0; padding: 10px 12px; border-radius: 12px; background: rgba(255,106,61,.08); border: 1px dashed rgba(255,106,61,.45); }
.blocked button { background: none; border: none; color: var(--acc); text-decoration: underline; padding: 0 2px; font-size: .78rem; }
.act { margin-top: 14px; width: 100%; padding: 12px; border-radius: 14px; border: none; background: var(--acc); color: #120c02; font-weight: 800; font-size: .92rem; }
.act:disabled { opacity: .35; cursor: not-allowed; }
.act.in { background: #5be39b; }

.dock { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 6; width: min(1180px, 96vw); display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 20px; background: rgba(14,16,22,.82); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.btn { background: rgba(255,255,255,.06); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; font-size: .82rem; white-space: nowrap; }
.btn:hover { border-color: rgba(240,180,74,.5); }
.btn.run { background: #5be39b; color: #04120a; border: none; font-weight: 800; }
.btn.run.on { background: #ff5b5b; color: #fff; }
.sp { flex: 1; }
.tog { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--mut); cursor: pointer; white-space: nowrap; }
.tog input { display: none; }
.tog span { width: 34px; height: 20px; border-radius: 20px; background: var(--line); position: relative; transition: .2s; }
.tog span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--mut); transition: .2s; }
.tog input:checked + span { background: var(--acc); } .tog input:checked + span::after { right: 17px; background: #fff; }
.thr { width: 220px; }
.thr label { display: flex; justify-content: space-between; font-size: .72rem; color: var(--mut); margin-bottom: 6px; }
.thr b { font-family: "JetBrains Mono"; color: var(--ink); font-weight: 400; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(91,227,155,.3); cursor: pointer; }

.tip { position: fixed; z-index: 9; pointer-events: none; padding: 6px 11px; border-radius: 10px; background: rgba(10,12,16,.9); border: 1px solid var(--line); font-size: .76rem; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.tip.on { opacity: 1; }
#tags { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.tag { position: absolute; transform: translate(-50%, -120%); padding: 5px 10px; border-radius: 10px; background: rgba(10,12,16,.85); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); font-size: .72rem; white-space: nowrap; pointer-events: auto; cursor: pointer; }
.tag b { display: block; font-family: "JetBrains Mono"; font-size: .74rem; color: var(--c); direction: ltr; text-align: right; font-weight: 600; }
.tag::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 1px; height: 7px; background: var(--c); }
.toast { position: fixed; bottom: 92px; left: 50%; transform: translate(-50%, 20px); z-index: 8; padding: 10px 18px; border-radius: 14px; background: rgba(20,22,28,.95); border: 1px solid var(--line); font-size: .84rem; opacity: 0; transition: .25s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; align-content: center; gap: 16px; background: #060709; color: var(--mut); transition: opacity .6s; }
.loading i { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--acc); animation: spin 1s linear infinite; }
.loading.done { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  header { top: 10px; right: 10px; left: 10px; gap: 10px; } .logo span { display: none; } .logo { font-size: 1rem; } .prog i { width: 90px; } .back { padding: 6px 10px; font-size: .72rem; }
  .filters { top: 54px; }
  .list { display: none; }
  .card { right: 10px; left: 10px; width: auto; top: auto; bottom: 150px; max-height: 38vh; padding: 14px; }
  .card h2 { font-size: 1.3rem; } .empty p { display: none; }
  .dock { flex-wrap: wrap; gap: 8px; padding: 10px; bottom: 8px; } .sp { display: none; } .btn { flex: 1; padding: 9px 8px; font-size: .74rem; } .thr { width: 100%; order: 9; }
}

@media (max-width: 1000px) {
  .back { white-space: nowrap; } .prog span { display: none; } .prog b { white-space: nowrap; font-size: .95rem; } .logo { white-space: nowrap; }
  .card { max-height: 32vh; } .card p { font-size: .8rem; }
}

/* misfire */
.mf { display: flex; align-items: center; gap: 4px; font-size: .76rem; color: var(--mut); white-space: nowrap; }
.mf span { margin-inline-end: 4px; }
.mf button { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: .76rem; font-family: "JetBrains Mono", Alexandria; }
.mf button.on { background: #ff4d4d; border-color: #ff4d4d; color: #fff; font-weight: 700; animation: mfb .5s infinite alternate; }
.mf button.fix { color: #8ff0bb; }
@keyframes mfb { to { box-shadow: 0 0 14px rgba(255,77,77,.8); } }
.cel { position: fixed; top: 112px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 12px; background: rgba(40,22,4,.92); border: 1px solid #f0a020; color: #ffc65a; font-size: .82rem; font-family: "JetBrains Mono", Alexandria; white-space: nowrap; }
.cel i { width: 18px; height: 14px; border-radius: 3px; background: #f0a020; box-shadow: 0 0 12px #f0a020; animation: mfb .6s infinite alternate; }
@media (max-width: 1000px) { .mf { width: 100%; order: 8; justify-content: space-between; } .mf button { flex: 1; padding: 7px 4px; } .cel { top: 98px; font-size: .7rem; max-width: 94vw; white-space: normal; } }

/* car mode */
.views { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(14,16,22,.75); border: 1px solid var(--line); margin-inline-start: auto; }
.views button { background: none; border: none; padding: 6px 12px; border-radius: 999px; font-size: .76rem; color: var(--mut); white-space: nowrap; }
.views button:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.prog { margin-inline-start: 12px; }
.btn.out { border-color: rgba(240,180,74,.5); color: var(--acc); }
@media (max-width: 1000px) { .views { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); margin: 0; } .views button { padding: 5px 9px; font-size: .7rem; } .cel { top: 136px; } }

.credit { position: fixed; left: 14px; bottom: 4px; z-index: 5; font-size: .6rem; color: rgba(238,240,244,.35); direction: ltr; } .credit a { color: inherit; text-decoration: underline; }

.card dd.tools { display: flex; flex-wrap: wrap; gap: 4px; } .card dd.tools button { background: rgba(240,180,74,.12); border: 1px solid rgba(240,180,74,.35); color: var(--acc); border-radius: 8px; padding: 3px 8px; font-size: .72rem; }
