:root {
  color-scheme: light;
  --bg: #F4F2EE;
  --surface: rgba(255, 255, 255, .86);
  --solid: #FFFFFF;
  --line: rgba(20, 16, 8, .09);
  --line-strong: rgba(20, 16, 8, .18);
  --ink: #0E0F12;
  --ink-2: #3A3832;
  --muted: #6E6A61;
  --accent: #FFB547;
  --accent-deep: #C77700;
  --good: #168A62;
  --bad: #C8423F;
  --live: #FF3B30;
  --shadow: 0 1px 2px rgba(20, 16, 8, .06), 0 16px 44px -16px rgba(20, 16, 8, .28);
  --blur: blur(18px) saturate(1.5);
  --sans: 'Epilogue', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --wide: 'Michroma', var(--sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; border-radius: 8px; }
.label { font-family: var(--wide); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.glass { background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* top bar */
.top { position: fixed; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; gap: 14px; pointer-events: none; z-index: 10; }
.top > * { pointer-events: auto; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 16px 0 12px; border-radius: 16px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); }
.brand img { width: 22px; height: 24px; }
.pill { font-family: var(--wide); font-size: 8.5px; letter-spacing: .16em; padding: 5px 7px 4px; border-radius: 99px; background: var(--ink); color: #fff; }
.task-pick { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 14px; border-radius: 16px; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); }
.task-pick select { border: 0; background: transparent; font-weight: 600; font-size: 14.5px; padding: 8px 6px; cursor: pointer; }
.king-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 16px; background: var(--ink); color: #F3F1EC; font-size: 13px; box-shadow: var(--shadow); }
.king-chip b { color: var(--accent); font-weight: 600; }
.king-chip .mono { color: #9E998F; font-size: 11.5px; }

/* side panel */
.panel { position: fixed; top: 74px; left: 14px; bottom: 14px; width: 318px; display: flex; flex-direction: column; border-radius: 22px; z-index: 9; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s; }
.panel.away { transform: translateX(calc(-100% - 20px)); opacity: 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.tabs button { text-align: left; padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 2px; transition: background .2s; }
.tabs button b { font-size: 14px; }
.tabs button span { font-size: 11.5px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.tabs button[aria-selected="true"] span { color: #B9B4AA; }
.scroll { overflow-y: auto; padding: 6px 16px 18px; scrollbar-width: thin; }
section { padding: 12px 0 4px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.sec-h .v { font-size: 12px; color: var(--ink-2); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--solid); font-size: 12px; font-weight: 500; text-transform: capitalize; }
.preset i { width: 20px; height: 20px; border-radius: 50%; background-size: cover; display: block; }
.preset[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sw { aspect-ratio: 1; border-radius: 10px; background-size: cover; background-position: center; border: 1px solid rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; }
.sw:hover { transform: scale(1.06); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.round .sw { border-radius: 50%; }
input[type=range] { width: 100%; accent-color: var(--ink); }
.link { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 2px 4px; border-radius: 6px; }
.link:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.objects { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.obj { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--solid); text-align: left; }
.obj b { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.obj small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.obj .lock { font-size: 10.5px; color: var(--muted); padding: 4px 8px; border-radius: 99px; background: rgba(0,0,0,.05); white-space: nowrap; }
.obj[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.obj.fixed { opacity: .65; cursor: default; }
.locked { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px; cursor: not-allowed; }
.locked em { font-style: normal; font-size: 10.5px; }

/* hints and bars */
.hint { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: var(--ink-2); padding: 8px 14px; border-radius: 99px; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); z-index: 5; white-space: nowrap; transition: opacity .4s; }
.sel-bar { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 14px; border-radius: 14px; background: var(--ink); color: #fff; z-index: 11; font-size: 13px; box-shadow: var(--shadow); }
.sel-bar span { font-weight: 600; margin-right: 8px; text-transform: capitalize; }
.sel-bar button { padding: 7px 12px; border-radius: 10px; font-size: 12.5px; color: #CFCAC0; }
.sel-bar button[aria-pressed="true"] { background: rgba(255,255,255,.14); color: #fff; }
.sel-bar #deselect { background: var(--accent); color: var(--ink); font-weight: 600; }
.cams { position: fixed; right: 14px; top: 74px; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 16px; z-index: 8; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cams button { font-size: 12.5px; padding: 8px 12px; border-radius: 11px; text-align: left; color: var(--ink-2); }
.cams button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.runbar { position: fixed; left: calc(14px + 318px + 16px); right: 14px; bottom: 14px; margin: 0 auto; max-width: 820px; display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 12px 12px 12px 20px; border-radius: 20px; background: var(--ink); color: #E9E6DF; z-index: 9; box-shadow: 0 20px 50px -18px rgba(0,0,0,.6); transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s; }
.runbar.away { transform: translateY(140%); opacity: 0; }
.runbar .sum { font-size: 13.5px; line-height: 1.45; }
.runbar .sum b { color: #fff; }
.runbar .sum small { color: #9E998F; font-size: 12px; }
.go { display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 24px; border-radius: 99px; background: var(--accent); color: var(--ink); font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .2s, box-shadow .2s; }
.go:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(255,181,71,.8); }

/* run hud */
.hud { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); width: min(760px, calc(100% - 28px)); padding: 14px 16px 12px; border-radius: 18px; z-index: 12; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pipeline { display: flex; gap: 6px; }
.pipe { flex: 1; }
.pipe .bar { height: 4px; border-radius: 4px; background: rgba(0,0,0,.08); overflow: hidden; }
.pipe .bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.pipe .pl { font-size: 11px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe.on .pl { color: var(--ink); font-weight: 600; }
.hud-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px; background: var(--solid); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.tag.mono { font-weight: 400; font-size: 11.5px; }
.tag.live { background: var(--live); color: #fff; border-color: transparent; }
.tag.live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tag.speed { margin-left: auto; cursor: pointer; }
.tag.speed[aria-pressed="true"] { background: var(--ink); color: #fff; }
.proto { font-size: 11px; color: var(--muted); margin-top: 8px; }
.verdict { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(720px, calc(100% - 28px)); display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 20px 22px; border-radius: 22px; z-index: 12; background: var(--solid); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.v-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--good); }
.verdict h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.verdict p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.v-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { height: 40px; padding: 0 16px; border-radius: 99px; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line); background: var(--solid); }
.btn.ink { background: var(--ink); color: #fff; border-color: var(--ink); }

.loading { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: var(--bg); z-index: 50; font-size: 14px; color: var(--ink-2); transition: opacity .6s; }
.loading.done { opacity: 0; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(0,0,0,.08); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 13px; opacity: 0; transition: .3s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* wallet */
.acct-chip { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 16px; font-weight: 600; font-size: 13.5px; background: #5865F2; color: #fff; box-shadow: var(--shadow); white-space: nowrap; }
.acct-chip img { width: 26px; height: 26px; border-radius: 50%; }
.acct-chip.on { color: var(--ink); padding-left: 10px; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.who img { width: 32px; height: 32px; border-radius: 50%; }
.who .link { margin-left: auto; }
.w-item.discord { background: #5865F2; color: #fff; border-color: #5865F2; }
.w-item.discord span { color: #DDE0FF; }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(14,15,18,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet { position: relative; width: min(440px, 100%); padding: 24px; border-radius: 22px; background: var(--solid); box-shadow: var(--shadow); }
.sheet h3 { margin: 6px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.sheet p { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 10px 0; }
.sheet .x { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); }
.w-note { font-size: 12.5px !important; color: var(--muted) !important; }
.w-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.w-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--solid); text-decoration: none; color: var(--ink); font-size: 14px; text-align: left; }
.w-item:hover { border-color: var(--ink); }
.w-item span { color: var(--muted); font-size: 12.5px; }
.w-status { min-height: 18px; font-size: 13px; color: var(--ink-2); }
.w-status.bad { color: var(--bad); }
.turnstile { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 65; }
.go:disabled { background: #3a3a3a; color: #9E998F; cursor: not-allowed; transform: none; box-shadow: none; }

@media (max-width: 900px) {
  .king-chip .mono, .pill { display: none; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 84px; width: auto; height: 42vh; }
  .panel.away { transform: translateY(calc(100% + 100px)); }
  .runbar { left: 8px; right: 8px; bottom: 8px; padding: 8px 8px 8px 14px; }
  .runbar .sum small { display: none; }
  .cams { top: auto; bottom: calc(42vh + 92px); right: 8px; flex-direction: row; flex-wrap: wrap; max-width: calc(100% - 16px); }
  .cams button { padding: 6px 9px; font-size: 11.5px; }
  .top { left: 8px; right: 8px; top: 8px; gap: 8px; }
  .brand { padding: 0 12px 0 10px; font-size: 0; gap: 0; }
  .task-pick .label { display: none; }
  .hint, .sel-bar, .hud { top: 62px; }
  .hint { display: none; }
}
@media (max-width: 600px) { .king-chip { display: none; } .acct-chip { padding: 0 12px; font-size: 12.5px; } .acct-chip:not(.on) span { display: none; } .task-pick { flex: 1; } .task-pick select { width: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
