:root {
  --bg: #0b0c12; --bg2: #11131c; --panel: rgba(22, 24, 36, .72); --card: rgba(255, 255, 255, .035); --card-h: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .14);
  --text: #eceef6; --mut: #9096ad; --dim: #60657c;
  --acc: #8b6cff; --acc2: #22d3ee; --grad: linear-gradient(135deg, #8b6cff 0%, #5b8cff 50%, #22d3ee 100%);
  --ok: #34d399; --warn: #fbbf24; --err: #f87171; --claude: #e0875f; --codex: #19c39c;
  --r: 16px; --r-s: 10px; --sh: 0 10px 40px -10px rgba(0, 0, 0, .6);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --app-h: 100dvh;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: var(--app-h, 100%); background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(139, 108, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .16); }
.ic { width: 18px; height: 18px; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* background */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-blobs i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .16; animation: float 26s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(1) { background: #8b6cff; top: -25vmax; left: -15vmax; }
.bg-blobs i:nth-child(2) { background: #22d3ee; bottom: -30vmax; right: -20vmax; animation-delay: -9s; opacity: .1; }
.bg-blobs i:nth-child(3) { background: #e0875f; top: 40%; left: 45%; width: 30vmax; height: 30vmax; opacity: .06; animation-delay: -15s; }
@keyframes float { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

#root { position: relative; z-index: 1; height: 100%; }
.boot { height: 100%; display: grid; place-items: center; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); position: relative; box-shadow: 0 6px 24px -6px rgba(139, 108, 255, .7); flex: none; }
.logo-mark::after { content: '›_'; position: absolute; inset: 0; display: grid; place-items: center; font: 700 15px var(--mono); color: #fff; letter-spacing: -1px; }
.logo-mark.big { width: 64px; height: 64px; border-radius: 18px; animation: pulse 1.6s ease-in-out infinite; }
.logo-mark.big::after { font-size: 26px; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* layout */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100%; }
.side { display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-right: 1px solid var(--line); background: rgba(12, 13, 20, .6); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--mut); letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--mut); font-weight: 500; transition: .18s var(--ease); position: relative; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, rgba(139, 108, 255, .18), rgba(139, 108, 255, .04)); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.nav .badge { margin-left: auto; }
.side-sec { margin: 16px 12px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.side-vps a { font-size: 13px; padding: 7px 12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

/* hard reload: fixed icon button, top-right on every page */
.hard-reload-fab {
  position: fixed; top: calc(14px + var(--safe-t)); right: 16px; z-index: 40;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(12, 13, 20, .7);
  backdrop-filter: blur(20px); color: var(--mut); cursor: pointer; overflow: hidden;
  transition: color .22s var(--ease), background .22s var(--ease), border-color .22s var(--ease),
    transform .32s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s var(--ease);
}
.hard-reload-fab::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; padding: 1px;
  background: var(--grad); opacity: 0; transition: opacity .22s var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.hard-reload-fab:hover {
  color: var(--text); background: var(--card); transform: rotate(150deg) scale(1.08);
  box-shadow: 0 4px 18px rgba(139, 108, 255, .28);
}
.hard-reload-fab:hover::before { opacity: 1; }
.hard-reload-fab:active { transform: rotate(150deg) scale(.92); }
.hard-reload-fab .ic { width: 18px; height: 18px; transition: transform .22s var(--ease); position: relative; }
.hard-reload-fab.spin { pointer-events: none; }
.hard-reload-fab.spin .ic { animation: reload-spin .7s linear infinite; }
.hard-reload-fab.spin { color: var(--acc2); border-color: var(--acc2); box-shadow: 0 0 0 6px rgba(139, 108, 255, .12); }
@keyframes reload-spin { to { transform: rotate(360deg); } }
@keyframes reload-pop {
  0% { transform: scale(1); }
  35% { transform: scale(.82); }
  100% { transform: scale(1); }
}
.hard-reload-fab.spin { animation: reload-pop .32s var(--ease); }

/* server health: fixed icon button, left of the hard-reload fab */
.vps-health-fab {
  position: fixed; top: calc(14px + var(--safe-t)); right: 62px; z-index: 40;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(12, 13, 20, .7);
  backdrop-filter: blur(20px); color: var(--mut); cursor: pointer; overflow: hidden;
  transition: color .22s var(--ease), background .22s var(--ease), border-color .22s var(--ease),
    transform .22s var(--ease), box-shadow .22s var(--ease);
}
.vps-health-fab:hover { color: var(--text); background: var(--card); transform: scale(1.08); box-shadow: 0 4px 18px rgba(139, 108, 255, .28); }
.vps-health-fab:active { transform: scale(.92); }
.vps-health-fab .ic { width: 18px; height: 18px; }
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px clamp(16px, 3vw, 40px) 40px; scroll-behavior: smooth; }
.view.full { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.tabbar { display: none; }

/* stagger in */
.anim > * { animation: up .45s var(--ease) both; }
.anim > *:nth-child(2) { animation-delay: .04s; } .anim > *:nth-child(3) { animation-delay: .08s; } .anim > *:nth-child(4) { animation-delay: .12s; }
.anim > *:nth-child(5) { animation-delay: .16s; } .anim > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }

/* headings */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-h h1 { margin: 0; font-size: 26px; letter-spacing: -.6px; font-weight: 800; line-height: 1.2; }
.page-h p { margin: 4px 0 0; color: var(--mut); }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--mut); font-size: 13px; margin-bottom: 6px; }
.crumb a:hover { color: var(--text); }
.grad-t { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 30px 0 12px; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec-h h2 .count { color: var(--dim); font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mut { color: var(--mut); } .dim { color: var(--dim); } .mono { font-family: var(--mono); }
.small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: .15s var(--ease); user-select: none; }
.btn:hover { background: var(--card-h); border-color: rgba(255, 255, 255, .22); }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 20px -8px rgba(139, 108, 255, .9); }
.btn.pri:hover { filter: brightness(1.1); box-shadow: 0 8px 26px -8px rgba(139, 108, 255, 1); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mut); }
.btn.ghost:hover { background: var(--card); color: var(--text); }
.btn.danger:hover { color: var(--err); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { pointer-events: none; }
.btn.loading::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* cards */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; transition: .2s var(--ease); backdrop-filter: blur(10px); }
a.card:hover, .card.hov:hover { background: var(--card-h); border-color: var(--line2); transform: translateY(-2px); box-shadow: var(--sh); }
.card h3 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.card-top { display: flex; align-items: flex-start; gap: 12px; }
.av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(139, 108, 255, .14); color: #b9a8ff; }
.av.claude { background: rgba(224, 135, 95, .14); color: var(--claude); }
.av.codex { background: rgba(25, 195, 156, .14); color: var(--codex); }
.av.cyan { background: rgba(34, 211, 238, .12); color: var(--acc2); }
.av img { width: 100%; height: 100%; border-radius: inherit; }
.av.proj-logo { position: relative; }
.av.proj-logo img { position: absolute; inset: 0; object-fit: contain; padding: 5px; background: #fff; }
.proj-top h1 .av { width: 28px; height: 28px; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { padding: 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; }
.stat span { color: var(--mut); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--grad); opacity: .08; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.metric { background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.metric small { display: block; color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.metric div { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* health gauges */
.gauges { display: flex; gap: 10px; justify-content: space-around; margin-top: 14px; }
.gauge { position: relative; flex: none; width: 74px; height: 74px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gauge circle { fill: none; stroke-width: 6; }
.gauge .g-trk { stroke: rgba(255, 255, 255, .08); }
.gauge .g-bar { stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease), stroke .3s; }
.gauge.g-ok .g-bar { stroke: var(--ok); filter: drop-shadow(0 0 4px rgba(52, 211, 153, .5)); }
.gauge.g-warn .g-bar { stroke: var(--warn); filter: drop-shadow(0 0 5px rgba(251, 191, 36, .55)); }
.gauge.g-err .g-bar { stroke: var(--err); filter: drop-shadow(0 0 6px rgba(248, 113, 113, .65)); animation: gcrit 1.3s ease-in-out infinite; }
@keyframes gcrit { 50% { stroke-width: 7.5; } }
.g-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; pointer-events: none; }
.g-txt b { font-size: 12.5px; font-weight: 700; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-txt small { font-size: 8.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; margin-top: 1px; }
.gauge.lg { width: 112px; height: 112px; }
.gauge.lg .g-txt b { font-size: 18px; max-width: 90px; }
.gauge.lg .g-txt small { font-size: 11px; }
.health-card { position: relative; overflow: hidden; }
.health-card::before { content: ''; position: absolute; inset: -60%; background: conic-gradient(from 0deg, transparent, rgba(139, 108, 255, .12), transparent 30%); animation: spin 9s linear infinite; pointer-events: none; }
.health-card > * { position: relative; }
.pulse-live { width: 7px; height: 7px; border-radius: 50%; background: var(--acc2); display: inline-block; box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); animation: ring 1.6s infinite; }
.empty { text-align: center; padding: 42px 20px; border: 1.5px dashed var(--line2); border-radius: var(--r); color: var(--mut); }
.empty .av { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 16px; }
.empty h3 { color: var(--text); margin: 0 0 4px; }
.empty .btn { margin-top: 14px; }

/* badges & dots */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--card-h); color: var(--mut); white-space: nowrap; }
.badge.ok { background: rgba(52, 211, 153, .12); color: var(--ok); }
.badge.warn { background: rgba(251, 191, 36, .12); color: var(--warn); }
.badge.err { background: rgba(248, 113, 113, .12); color: var(--err); }
.badge.acc { background: rgba(139, 108, 255, .15); color: #b9a8ff; }
.badge.claude { background: rgba(224, 135, 95, .14); color: var(--claude); }
.badge.codex { background: rgba(25, 195, 156, .14); color: var(--codex); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; display: inline-block; }
.dot.online, .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
.dot.connecting, .dot.warn { background: var(--warn); animation: blink 1s infinite; }
.dot.offline, .dot.err { background: var(--err); }
.dot.run { background: var(--acc2); box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); animation: ring 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
@keyframes ring { 70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); } }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; flex: none; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--mut); }
.field > small { color: var(--dim); font-size: 12px; }
.inp { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); outline: none; transition: .15s; }
.inp:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(139, 108, 255, .2); }
textarea.inp { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: 12.5px; }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239096ad' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
select.inp option, select.inp optgroup { background: #151722; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.f2 > * { min-width: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; color: var(--mut); font-weight: 600; font-size: 13px; transition: .15s; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card-h); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }
.switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 22px; background: var(--line2); transition: .2s; }
.switch i::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s var(--ease); }
.switch input:checked + i { background: var(--acc); }
.switch input:checked + i::after { transform: translateX(16px); }
label.tog { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); cursor: pointer; }

/* modal */
.ov { position: fixed; inset: 0; z-index: 50; background: rgba(4, 5, 10, .6); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.ov.closing { animation: fade .15s reverse forwards; }
.modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(30, 32, 48, .96), rgba(20, 22, 33, .97)); border: 1px solid var(--line2); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); animation: pop .28s var(--ease); overflow: hidden; }
.modal.wide { width: min(980px, 100%); }
.modal.fullscreen { width: min(1400px, 100%); height: calc(100dvh - 32px); }
.ov.closing .modal { animation: pop .15s reverse forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; min-width: 0; }
.modal-b { padding: 18px; overflow-y: auto; overflow-wrap: anywhere; flex: 1; min-height: 0; }
.modal-b.flush { padding: 0; display: flex; flex-direction: column; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }

/* toasts */
#toasts { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: rgba(30, 32, 48, .96); border: 1px solid var(--line2); box-shadow: var(--sh); animation: tin .3s var(--ease); font-weight: 500; }
.toast.out { animation: tin .2s reverse forwards; }
.toast.ok .ic { color: var(--ok); } .toast.err .ic { color: var(--err); } .toast.info .ic { color: var(--acc2); }
@keyframes tin { from { opacity: 0; transform: translateX(20px); } }

/* login */
.login { height: 100%; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 34px 30px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line2); backdrop-filter: blur(24px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); animation: pop .5s var(--ease); }
.login-card .logo-mark { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 20px; }
.login-card .logo-mark::after { font-size: 22px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.5px; }
.login-card p { margin: 0 0 24px; color: var(--mut); }
.login-card .btn { width: 100%; height: 44px; margin-top: 6px; }
.err-t { color: var(--err); font-size: 13px; min-height: 20px; margin-top: 10px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* project page */
.proj-top { padding: 18px clamp(16px, 3vw, 32px) 0; border-bottom: 1px solid var(--line); background: rgba(12, 13, 20, .35); }
.proj-top h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--mut); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; transition: .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--acc); }
.pane { display: none; flex: 1; min-height: 0; }
.pane.on { display: flex; flex-direction: column; animation: fade .25s; }
.pane-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px clamp(16px, 3vw, 32px) 40px; }

/* tasks */
.task-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 20px; align-items: start; min-width: 0; }
.task-layout > * { min-width: 0; }
.task-form { position: sticky; top: 0; }
.drop-zone { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 10px; padding: 12px; border: 1.5px dashed var(--line2); border-radius: 12px; color: var(--dim); font-size: 12.5px; pointer-events: none; transition: .15s var(--ease); }
.drop-zone.on { border-color: var(--acc, #22d3ee); color: var(--text); background: var(--card-h); }
#tf-files-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#tf-files-list .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; background: var(--card-h); border: 1px solid var(--line2); font-size: 12px; color: var(--text); max-width: 100%; }
#tf-files-list .chip-rm { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: none; border-radius: 50%; background: transparent; color: #ef4444; cursor: pointer; flex: none; }
#tf-files-list .chip-rm svg { width: 11px; height: 11px; }
#tf-files-list .chip-rm:hover { background: rgba(239, 68, 68, .15); }
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); transition: .2s var(--ease); cursor: pointer; animation: up .3s var(--ease); }
.task:hover { background: var(--card-h); border-color: var(--line2); }
.task.running { border-color: rgba(34, 211, 238, .35); background: linear-gradient(90deg, rgba(34, 211, 238, .07), transparent 60%); }
.task .st { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--card-h); color: var(--mut); }
.task.running .st { color: var(--acc2); background: rgba(34, 211, 238, .12); }
.task.done .st { color: var(--ok); background: rgba(52, 211, 153, .12); }
.task.failed .st { color: var(--err); background: rgba(248, 113, 113, .12); }
.task.cancelled { opacity: .6; }
.task h4 { margin: 0; font-size: 14px; font-weight: 600; }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; align-items: center; }
.task .acts { display: flex; gap: 2px; opacity: .55; transition: .15s; }
.task:hover .acts { opacity: 1; }
.progress { height: 2px; border-radius: 2px; overflow: hidden; background: rgba(34, 211, 238, .12); margin-top: 8px; position: relative; }
.progress::after { content: ''; position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, var(--acc2), transparent); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* terminal area */
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px clamp(12px, 2vw, 20px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.term-bar::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: .15s var(--ease); flex: none; }
.chip:hover { background: var(--card-h); transform: translateY(-1px); }
.chip.claude { border-color: rgba(224, 135, 95, .35); } .chip.claude:hover { background: rgba(224, 135, 95, .1); }
.chip.codex { border-color: rgba(25, 195, 156, .35); } .chip.codex:hover { background: rgba(25, 195, 156, .1); }
.chip.off { opacity: .45; }
.term-tabs { display: flex; gap: 4px; padding: 6px 10px 0; flex: none; overflow-x: auto; scrollbar-width: none; background: #07080d; }
.term-tabs::-webkit-scrollbar { display: none; }
.ttab { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 9px 9px 0 0; background: transparent; color: var(--mut); cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ttab.on { background: #0d0e15; color: var(--text); }
.ttab button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 2px; border-radius: 5px; display: grid; }
.ttab button:hover { background: var(--card-h); color: var(--text); }
.term-host { flex: 1; min-height: 0; position: relative; background: #0d0e15; }
.term-host .xt { position: absolute; inset: 0; padding: 8px 0 4px 10px; display: none; }
.term-host .xt.on { display: block; }
.xterm { height: 100%; }
.xterm .xterm-viewport { background: transparent !important; }
.term-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--mut); padding: 20px; }
.term-empty .av { margin: 0 auto 14px; width: 60px; height: 60px; border-radius: 18px; }
.keybar { display: none; gap: 6px; padding: 8px 10px calc(8px + var(--safe-b)); background: #0a0b11; border-top: 1px solid var(--line); overflow-x: auto; flex: none; scrollbar-width: none; }
.keybar button { flex: none; min-width: 44px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--card-h); font: 600 12.5px var(--mono); cursor: pointer; }
.keybar button:active { background: var(--acc); transform: scale(.94); }
.logterm { height: min(70dvh, 640px); background: #0d0e15; padding: 10px 0 6px 12px; }

/* question popup */
.qp-ov { position: fixed; inset: 0; z-index: 80; background: rgba(4, 5, 10, .55); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.qp { width: min(620px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, rgba(34, 34, 54, .98), rgba(20, 21, 32, .98)); border: 1px solid rgba(139, 108, 255, .4); box-shadow: 0 0 0 1px rgba(139, 108, 255, .15), 0 30px 90px -20px rgba(139, 108, 255, .45); animation: pop .3s var(--ease); }
.qp-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.qp-h .av { width: 32px; height: 32px; border-radius: 10px; }
.qp-q { padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-y: auto; max-height: 40dvh; color: #d7d9e6; }
.qp-opts { padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.qp-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: .12s var(--ease); width: 100%; }
.qp-opt .n { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--card-h); font: 700 12px var(--mono); flex: none; }
.qp-opt.on { border-color: var(--acc); background: rgba(139, 108, 255, .14); transform: translateX(4px); }
.qp-opt.on .n { background: var(--grad); color: #fff; }
.qp-opt small { display: block; color: var(--mut); margin-top: 2px; }
.qp-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line2); border-bottom-width: 2px; font: 600 11px var(--mono); color: var(--mut); }
.qp-f .hint { display: flex; gap: 6px; align-items: center; color: var(--dim); font-size: 12px; flex: 1; flex-wrap: wrap; }
.qp-mini { position: fixed; z-index: 70; right: 18px; bottom: 80px; animation: pop .3s var(--ease); }

/* palette */
.pal-ov { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 10, .55); backdrop-filter: blur(6px); display: flex; justify-content: center; padding: 12vh 16px 16px; animation: fade .15s; }
.pal { width: min(600px, 100%); align-self: flex-start; border-radius: 18px; overflow: hidden; background: rgba(26, 28, 42, .98); border: 1px solid var(--line2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); animation: pop .22s var(--ease); }
.pal input { width: 100%; height: 54px; border: 0; outline: 0; background: transparent; padding: 0 18px; font-size: 16px; border-bottom: 1px solid var(--line); }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-item.on { background: rgba(139, 108, 255, .16); }
.pal-item .av { width: 30px; height: 30px; border-radius: 9px; }

/* lists */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; }
a.li:hover, .li.hov:hover { background: var(--card-h); }
.repo-list { max-height: 340px; overflow-y: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
.repo { padding: 10px 12px; border-top: 1px solid var(--line); cursor: pointer; transition: .12s; }
.repo:first-child { border-top: 0; }
.repo:hover { background: var(--card-h); }
.repo.on { background: rgba(139, 108, 255, .14); }
pre.out { margin: 0; padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; color: #cfd2e0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; min-width: 0; }
.two > * { min-width: 0; }
.mem-ed { min-height: 55vh !important; font-family: var(--mono); font-size: 12.5px; }

/* responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { display: none; }
  .tabbar { display: flex; justify-content: space-around; padding: 6px 6px calc(6px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(12, 13, 20, .88); backdrop-filter: blur(20px); z-index: 5; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 10.5px; font-weight: 600; color: var(--dim); border-radius: 10px; transition: .15s; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .ic { color: var(--acc); transform: translateY(-1px); }
  .app.hide-tabbar .tabbar { display: none; }
  .view { padding-top: calc(18px + var(--safe-t)); }
  .view.full { padding-top: var(--safe-t); }
  .task-layout, .two { grid-template-columns: 1fr; }
  .task-form { position: static; }
  .keybar { display: flex; }
  .page-h h1 { font-size: 22px; }
  #toasts { left: 12px; right: 12px; bottom: calc(76px + var(--safe-b)); align-items: center; }
  .modal.fullscreen { height: 100dvh; border-radius: 0; }
  .ov:has(.fullscreen) { padding: 0; }
  .qp-ov { place-items: end center; padding: 0; }
  .qp { border-radius: 22px 22px 0 0; width: 100%; max-height: 88dvh; animation: sheet .32s var(--ease); }
  @keyframes sheet { from { transform: translateY(100%); } }
  .f2 { grid-template-columns: 1fr; gap: 0; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (hover: none) { .task .acts { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ----- boot loader (orbit) ----- */
#boot{position:fixed;inset:0;z-index:2147483647;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;background:radial-gradient(700px 500px at 50% 42%,#1a236099,transparent 70%),radial-gradient(500px 400px at 85% 90%,#2a166077,transparent 65%),rgba(4,6,14,.95);backdrop-filter:blur(5px);color:var(--mut)}
.orb{position:relative;width:190px;height:190px;display:grid;place-items:center}
.orb::before{content:"";position:absolute;inset:-30px;border-radius:50%;background:radial-gradient(circle,#7c6cff55,#3b9cff22 45%,transparent 70%);animation:glow 2.4s ease-in-out infinite}
@keyframes glow{50%{transform:scale(1.18);opacity:.65}}
.ring{position:absolute;border-radius:50%;border:1.5px solid #8b7bff40;animation:spin linear infinite}
.ring i{position:absolute;top:-6px;left:50%;width:12px;height:12px;margin-left:-6px;border-radius:50%}
.r1{inset:0;animation-duration:6s;border-style:dashed}
.r1 i{background:#8b7bff;box-shadow:0 0 16px 4px #8b7bffaa}
.r2{inset:26px;animation-duration:4s;animation-direction:reverse;border-color:#4da3ff45}
.r2 i{background:#4da3ff;box-shadow:0 0 16px 4px #4da3ffaa}
.r3{inset:52px;animation-duration:2.6s;border-color:#a3e63550}
.r3 i{background:var(--acc2);box-shadow:0 0 16px 4px #22d3eeaa}
.core{position:relative;display:grid;place-items:center;width:62px;height:62px;border-radius:20px;background:var(--grad);box-shadow:0 0 40px 6px #7c6cff88,inset 0 0 0 1px #ffffff40;animation:corepulse 2.4s ease-in-out infinite}
.core svg{animation:twinkle 2.4s ease-in-out infinite}
@keyframes corepulse{50%{transform:scale(1.1) rotate(8deg);box-shadow:0 0 56px 12px #7c6cffaa,inset 0 0 0 1px #ffffff55}}
@keyframes twinkle{50%{transform:scale(.82) rotate(-12deg);opacity:.85}}
.boot-title{margin:0;font-size:26px;font-weight:800;letter-spacing:-.6px;background:linear-gradient(90deg,#fff 30%,#a99cff,#7fd0ff 55%,#fff 80%);background-size:250% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:shimmer 3s linear infinite}
@keyframes shimmer{to{background-position:-250% 0}}
.boot-msgs{position:relative;height:20px;width:min(86vw,320px);text-align:center;font-size:13.5px;font-weight:600;letter-spacing:.2px}
.boot-msgs span{position:absolute;inset:0;opacity:0;animation:msg 6s infinite}
.boot-msgs span:nth-child(2){animation-delay:2s}.boot-msgs span:nth-child(3){animation-delay:4s}
@keyframes msg{0%{opacity:0;transform:translateY(6px)}6%,30%{opacity:1;transform:none}36%,100%{opacity:0;transform:translateY(-6px)}}
.boot-bar{width:min(60vw,220px);height:5px;border-radius:99px;background:#ffffff14;overflow:hidden}
.boot-bar i{display:block;width:40%;height:100%;border-radius:99px;background:linear-gradient(90deg,transparent,#8b7bff,#4da3ff,var(--acc2));animation:slide-boot 1.3s cubic-bezier(.5,0,.5,1) infinite}
@keyframes slide-boot{from{transform:translateX(-110%)}to{transform:translateX(280%)}}
@media(max-width:700px){.orb{width:150px;height:150px}.r2{inset:20px}.r3{inset:40px}.core{width:52px;height:52px;border-radius:17px}.boot-title{font-size:22px}}
