:root {
  --bg: #050505;
  --surface: #0b0b0b;
  --surface2: #141414;
  --surface3: #1c1c1c;
  --border: #2a2a2a;
  --border2: #3a3a3a;
  --text: #f4f4f5;
  --muted: #a3a3a3;
  --check-accent: #737373;
  --inset: #080808;
  --accent: #ffffff;
  --accent-dim: #d1d5db;
  --primary: #f4f4f5;
  --primary-fg: #0a0a0b;
  --danger: #f87171;
  --ok: #86efac;
  --warn: #fbbf24;
  --radius: 14px;
  --pc-panel-body-h: calc(100vh - 292px);
  --file-manager-h: min(520px, calc(100dvh - 320px));
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; font-size: 15px; }

.ambient-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(circle at 0% 0%, rgba(255,255,255,.03), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(60,60,60,.05), transparent 40%);
}
.orb {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(80px); opacity: .15; animation: orbMove 18s ease-in-out infinite;
}
.orb-a { width: 400px; height: 400px; background: #fff; top: -120px; left: -80px; }
.orb-b { width: 340px; height: 340px; background: #3a3a3a; bottom: -120px; right: -60px; animation-delay: -9s; animation-direction: reverse; }
@keyframes orbMove {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, 40px); }
}

.view { display: none; min-height: 100vh; position: relative; z-index: 1; }
.view.active { display: flex; align-items: center; justify-content: center; padding: 24px; }

.entry-box { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 28px; animation: entryIn .5s ease; }
@keyframes entryIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.entry-logo { text-align: center; }
.entry-brand-lockup { display: inline-block; max-width: 100%; }
.entry-brand-title {
  position: relative;
  display: inline-block;
  margin: 22px 0 4px;
  padding-top: 34px;
  font-size: 2.2rem;
  letter-spacing: -.04em;
  line-height: 1.05;
}
.entry-brand-mark {
  position: absolute;
  left: 0.54em;
  top: 0;
  width: 58px;
  height: 58px;
  object-fit: contain;
  transform: translate(-46%, -5px);
  pointer-events: none;
  user-select: none;
}
.entry-logo p { margin: 0; color: var(--muted); font-size: .9rem; }
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
  box-shadow: none;
  background: transparent;
  display: block;
}
.brand-logo.lg { width: 72px; height: 72px; border-radius: 0; margin-bottom: 4px; }
.entry-card {
  width: 100%;
  background: rgba(11, 11, 11, .94);
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 8px 8px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  backdrop-filter: blur(12px);
}
.entry-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: #141414; border-radius: 12px; border: 1px solid #2a2a2a; }
.entry-tab { flex: 1; border: none; background: transparent; color: #9a9a9a; padding: 10px; border-radius: 9px; font: inherit; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
.entry-tab.active { background: #1c1c1c; color: var(--text); box-shadow: inset 0 0 0 1px #333; }
.entry-body { display: flex; flex-direction: column; gap: 0; padding: 0 12px; }
.entry-body > .entry-field,
.entry-body > .entry-register .entry-field,
#entry-login-main .entry-field,
#entry-login-main .entry-register .entry-field,
.entry-2fa-panel .entry-field { margin-bottom: 16px; }
#entry-login-main .entry-register { margin-bottom: 8px; }
.entry-field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.entry-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #9a9a9a; }
.entry-body input {
  background: #141414;
  border-color: #333;
  color: var(--text);
}
.entry-body input:focus { border-color: #4a4a4a; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.server-row { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.server-row .server-label { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.server-row #server-display { color: var(--text); font-family: var(--mono); font-size: .78rem; }
.text-link { background: none; border: none; color: var(--muted); font: inherit; font-size: .75rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.text-link:hover { color: var(--text); }

.server-page-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 960px) {
  .server-page-grid { grid-template-columns: 1fr; }
}
.server-hint { margin: 0 0 14px; font-size: .85rem; line-height: 1.45; }
.server-connect-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.server-status-card {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.server-status-card > div { display: flex; flex-direction: column; gap: 2px; }
.server-status-card strong { font-family: var(--mono); font-size: .82rem; font-weight: 500; word-break: break-all; }
.server-full-logs { min-height: 280px; max-height: 52vh; }
.server-build-logs { display: flex; flex-direction: column; gap: 10px; }
.server-build-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
}
.server-build-item summary {
  cursor: pointer;
  padding: 10px 12px;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: .85rem;
}
.server-build-item summary::-webkit-details-marker { display: none; }
.server-build-item pre {
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--border);
  max-height: 220px;
  overflow: auto;
  background: var(--inset);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  white-space: pre-wrap;
}
.server-build-meta { color: var(--muted); font-size: .75rem; }

input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text); font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border2); box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
input::placeholder,
textarea::placeholder {
  color: #9a9a9a;
  opacity: 1;
}
.alert-form-card input::placeholder {
  color: #a8a8a8;
}

.btn { font: inherit; cursor: pointer; border: none; border-radius: 10px; padding: 11px 16px; transition: transform .1s, filter .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-fg); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,.04); color: var(--text); }
.btn-ghost.danger { color: var(--danger); border-color: rgba(248,113,113,.3); }
.btn-ghost.danger:hover { background: rgba(248,113,113,.08); color: #fca5a5; }
.btn-full { width: 100%; margin-top: 4px; }
.btn-sm { padding: 7px 12px; font-size: .8rem; }

.form-error { color: var(--danger); font-size: .84rem; margin: 2px 0 0; }
.hidden { display: none !important; }

.entry-footer { font-size: .75rem; color: var(--muted); opacity: .8; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.app-shell.hidden { display: none; }
.app-topbar {
  height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,6,.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-left { justify-self: start; }
.topbar-nav { display: flex; align-items: center; gap: 6px; justify-self: center; }
.topbar-right { justify-self: end; }
.brand-text { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.nav-pill { padding: 7px 16px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; transition: all .2s; }
.nav-pill:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-pill.active { background: var(--surface2); color: var(--text); border-color: var(--border); }
.nav-pill-wrap { position: relative; display: inline-flex; }
.nav-badge.hidden { display: none; }
.nav-notify-dot {
  position: absolute;
  top: 3px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(5, 5, 6, .92);
  pointer-events: none;
}
.nav-notify-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, .45);
  animation: notifyPulse 1.6s ease-out infinite;
}
@keyframes notifyPulse {
  0% { transform: scale(0.85); opacity: .9; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.15); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.spin { opacity: .65; cursor: not-allowed; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chip { font-size: .74rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); }
.chip.muted { color: var(--muted); }

.app-main { flex: 1; padding: 22px 20px 10px; max-width: 1300px; width: 100%; margin: 0 auto; }
.app-main:has(#route-admin.active) {
  max-width: min(1540px, calc(100vw - 32px));
}
.route { display: none; }
.route.active { display: block; animation: routeIn .35s ease; }
@keyframes routeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-title { margin: 0 0 14px; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 14px; }
.panel h3 { margin: 0 0 14px; font-size: 1rem; font-weight: 600; }
.panel h3.sub-section-title { margin: 24px 0 14px; border-top: 1px solid var(--border); padding-top: 18px; }
.panel .field-row { margin-bottom: 14px; }
.panel .field-row:last-of-type { margin-bottom: 18px; }
.panel .field-row > label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 6px; }
.panel .field-row .pill-group { margin-top: 2px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
label.field-label, .field-row > label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 6px; }
.field-hint { display: block; font-size: .72rem; color: var(--muted); margin-top: 4px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; animation: statIn .4s ease backwards; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }
.stat-card .num { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; }
.stat-card .desc { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.stat-card.accent-online .num { color: var(--ok); }
.stat-card.accent-offline .num { color: #a3a3a3; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.dash-head .section-title { margin-bottom: 0; }
.dash-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
.dash-sub { margin: 0; font-size: .84rem; line-height: 1.3; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-grid .panel { margin-top: 0; }
.dashboard-grid .panel.wide { grid-column: 1 / -1; }
.dash-chart-panel h3 { margin-bottom: 12px; }
.dash-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dash-donut {
  width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.dash-donut::before {
  content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--surface);
}
.dash-donut-center { position: relative; z-index: 1; text-align: center; font-size: .72rem; color: var(--muted); line-height: 1.3; }
.dash-donut-center strong { display: block; font-size: 1.35rem; color: var(--text); font-weight: 700; }
.dash-donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: .8rem; color: var(--muted); }
.dash-donut-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dash-donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dash-bars { display: flex; align-items: flex-end; gap: 8px; min-height: 140px; padding-top: 8px; }
.dash-bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dash-bar-stack { width: 100%; max-width: 42px; display: flex; flex-direction: column-reverse; gap: 3px; min-height: 100px; justify-content: flex-start; }
.dash-bar-seg { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .25s ease; }
.dash-bar-seg.joined { background: rgba(134, 239, 172, .85); }
.dash-bar-seg.left { background: rgba(251, 191, 36, .85); }
.dash-bar-seg.deleted { background: rgba(248, 113, 113, .85); }
.dash-bar-label { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 0; font-size: .72rem; }
.dash-chart-legend .leg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.dash-chart-legend .joined::before { background: rgba(134, 239, 172, .85); }
.dash-chart-legend .left::before { background: rgba(251, 191, 36, .85); }
.dash-chart-legend .deleted::before { background: rgba(248, 113, 113, .85); }
.dash-spark { width: 100%; overflow: hidden; }
.dash-spark svg { width: 100%; height: 88px; display: block; }
.dash-spark-line { fill: none; stroke: #86efac; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dash-spark-area { fill: rgba(134, 239, 172, .12); }
.dash-spark-labels { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); margin-top: 6px; }
.dash-activity-panel,
.dash-quick-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dash-activity-panel h3,
.dash-quick-panel h3 { margin-bottom: 10px; flex-shrink: 0; }
.dash-quick-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.dash-quick-foot {
  margin: 12px 0 0;
  font-size: .8rem;
  line-height: 1.45;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dash-activity {
  list-style: none; margin: 0; padding: 0 4px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
  min-height: 0;
  max-height: 132px;
  overflow-y: auto; overflow-x: hidden;
}
.panel-scroll::-webkit-scrollbar,
.dash-scroll::-webkit-scrollbar { width: 7px; }
.panel-scroll::-webkit-scrollbar-track,
.dash-scroll::-webkit-scrollbar-track { background: #0a0a0a; border-radius: 8px; }
.panel-scroll::-webkit-scrollbar-thumb,
.dash-scroll::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 8px; border: 1px solid #2a2a2a; }
.panel-scroll::-webkit-scrollbar-thumb:hover,
.dash-scroll::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
.panel-scroll,
.dash-scroll { scrollbar-width: thin; scrollbar-color: #3a3a3a #0a0a0a; }
.dash-activity li {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); font-size: .76rem;
}
.dash-activity .act-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.dash-activity .act-dot.joined { background: var(--ok); }
.dash-activity .act-dot.left { background: var(--warn); }
.dash-activity .act-dot.deleted { background: var(--danger); }
.dash-activity .act-body { flex: 1; min-width: 0; }
.dash-activity .act-time { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.dash-activity-empty { color: var(--muted); font-size: .84rem; padding: 8px 0; }
.quick-list { color: var(--muted); line-height: 1.8; padding-left: 18px; margin: 0; }
.quick-list strong { color: var(--text); font-weight: 500; }

#route-builder {
  min-height: 0;
  overflow: hidden;
}
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 0;
  min-height: 0;
  max-height: calc(100vh - 128px);
  overflow: hidden;
}
.builder-layout > .panel { margin-top: 0; min-height: 0; }
.builder-form-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.builder-history-panel {
  grid-column: 2;
  grid-row: 1;
}
.build-logs-panel {
  grid-column: 2;
  grid-row: 2;
}
@media (max-width: 920px) {
  .builder-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    max-height: none;
    height: auto;
    overflow: visible;
  }
  #route-builder { overflow: visible; }
  .builder-form-panel,
  .builder-history-panel,
  .build-logs-panel {
    grid-column: 1;
    grid-row: auto;
    max-height: none;
    overflow: visible;
  }
  .builder-form-body { overflow: visible; }
  .build-logs-panel .build-logs.flush {
    height: auto;
    min-height: 200px;
    max-height: min(360px, 50dvh);
    flex: none;
  }
  .builder-history-body {
    max-height: min(320px, 45dvh);
    height: auto;
  }
}
.builder-form-panel { display: flex; flex-direction: column; min-height: 0; }
.builder-form-panel .builder-form-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.builder-history-panel,
.build-logs-panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
}
.builder-form-panel .builder-form-body,
.builder-history-panel .builder-history-body { padding: 14px 18px 12px; }
.builder-form-body .field-row { margin-bottom: 12px; }
.builder-form-body .field-row:last-of-type { margin-bottom: 16px; }
.builder-history-panel .action-hero.compact,
.build-logs-panel .action-hero.compact {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.build-logs-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.build-logs-head > div:first-child { flex: 1; min-width: 0; }
.build-logs-head #btn-cancel-build { flex-shrink: 0; margin-top: 2px; }
.builder-history-body {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 18px !important;
}
.icon-pump-row.jar-artifact #icon-label-exe,
.icon-pump-row.jar-artifact #icon-file-row {
  display: none;
}
.icon-pump-row.jar-artifact #icon-pump-head {
  justify-content: flex-end;
  margin-bottom: 0;
}
.icon-pump-row.jar-artifact {
  margin-bottom: 12px;
}
.builder-history-body .simple-list { margin: 0; padding-top: 2px; }
.builder-history-body .simple-list li:first-child { margin-top: 0; }
.simple-list li.build-empty { text-align: center; color: var(--muted); border-style: dashed; }
.builder-form-panel .pill.active {
  background: #e8e8e8;
  color: #141414;
  border-color: #d0d0d0;
}
.builder-form-panel .btn-build-accent {
  background: #e8e8e8;
  color: #141414;
  border: 1px solid #d0d0d0;
}
.builder-form-panel .btn-build-accent:hover {
  background: #f0f0f0;
  filter: none;
}
.stream-hint { font-size: .78rem; color: var(--danger); margin: 4px 0 0; }
.build-ready-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.btn-artifact-dl {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 12px; border-radius: 8px; font-size: .72rem; font-weight: 600;
  background: #fafafa; color: #0a0a0a; border: 1px solid #e4e4e4; cursor: pointer;
}
.btn-artifact-dl:hover { background: #ffffff; }
.btn-artifact-dl:disabled { opacity: .45; cursor: not-allowed; }
.build-logs-panel .build-logs.flush {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  contain: layout style;
}
.action-hero.compact { padding: 12px 18px; }
.pill-group { display: flex; gap: 8px; }
.pill { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); font: inherit; cursor: pointer; }
.pill.active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); font-weight: 600; }
.builder-form-body .field-row-features { margin-bottom: 12px; }
.builder-form-body .btn-build-accent { margin-top: 2px; }
.feature-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.icon-pump-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.icon-pump-head > label { margin: 0; }
.btn-pump-chip {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #3d3d3d;
  background: #1e1e1e;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-pump-chip:hover { border-color: #555; color: var(--text); }
.btn-pump-chip.active {
  border-color: #22c55e;
  color: #bbf7d0;
  background: #142819;
}
.btn-pump-chip.hidden { display: none; }
.pump-modal-enable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
  font-size: 0.9rem;
}
.pump-modal-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.pump-modal-slider.disabled { opacity: 0.45; pointer-events: none; }
.pump-mb-value {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--text);
  min-width: 3.5rem;
  text-align: right;
}
.pump-range {
  flex: 1;
  min-width: 0;
  height: 4px;
  margin: 0;
  accent-color: #22c55e;
}
.pump-modal-slider:not(.disabled) .pump-mb-value {
  color: #86efac;
}
#pump-lowsize-hint {
  color: #facc15;
}
#pump-lowsize-hint strong {
  color: #fde047;
}
.btn-primary.danger {
  background: #b91c1c;
  border-color: #991b1b;
}
.btn-primary.danger:hover { background: #991b1b; }
.feature-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  cursor: pointer;
  font-size: .86rem;
  user-select: none;
}
.feature-box-text { flex: 1; min-width: 0; line-height: 1.25; }
.feature-box:has(input:checked) { border-color: #454545; background: #1a1a1a; }
.feature-box:has(input:checked) .feature-box-text { color: var(--text); }
.feat-switch {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  display: inline-flex;
  align-items: center;
}
.feat-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.feat-switch-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #262626;
  border: 1px solid #3a3a3a;
  transition: background .18s ease, border-color .18s ease;
  pointer-events: none;
}
.feat-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8a8a8a;
  transition: transform .18s ease, background .18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.feat-switch input:checked + .feat-switch-track {
  background: rgba(134, 239, 172, .14);
  border-color: rgba(134, 239, 172, .35);
}
.feat-switch input:checked + .feat-switch-track::after {
  transform: translateX(16px);
  background: #86efac;
}
.feat-switch input:focus-visible + .feat-switch-track {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--check-accent);
  cursor: pointer;
}
.mini-toggle input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--check-accent); }
.status-text { min-height: 1.2em; font-size: .86rem; color: var(--muted); margin-top: 6px; margin-bottom: 0; }
.status-text.is-error { color: var(--danger); font-weight: 500; }
.btn-build-accent:disabled,
.btn-build-accent.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); margin-bottom: 8px; font-size: .9rem; }
.build-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.build-meta { min-width: 0; flex: 1; }
.build-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.3;
}
.build-title-line strong { font-weight: 600; }
.build-title-line .build-type { color: var(--muted); font-size: .82rem; }
.build-date { display: block; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.build-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  align-self: center;
}
.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.file-pick-name {
  font-size: .8rem;
  flex: 1;
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid #3a3a3a;
  background: linear-gradient(180deg, #2c2c2c 0%, #222 100%);
  color: #f0f0f0;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset;
  transition: border-color .15s, background .15s;
}
.btn-browse:hover { border-color: #5a5a5a; background: linear-gradient(180deg, #353535 0%, #282828 100%); }
.btn-browse.subtle {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-browse.subtle:hover { color: var(--text); border-color: var(--border); }
.build-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.build-icon-btn:hover:not(:disabled) {
  background: #1a1a1a;
  color: var(--text);
  border-color: #454545;
}
.build-icon-btn.danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
}
.build-icon-btn.danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}
.build-icon-btn:disabled,
.build-icon-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.build-logs { background: var(--inset); padding: 12px 14px; font-family: var(--mono); font-size: .72rem; color: var(--muted); white-space: pre-wrap; line-height: 1.55; }
.build-logs.build-logs-advanced { white-space: normal; line-height: 1.45; font-size: .68rem; }
.build-logs-advanced .blog { padding: 1px 0; word-break: break-word; }
.build-logs-advanced .blog.dim { color: #6b6b6b; }
.build-logs-advanced .blog.trace { color: #737373; font-size: .64rem; }
.build-logs-advanced .blog.run { color: #d4d4d4; }
.build-logs-advanced .blog.ok { color: #86efac; }
.build-logs-advanced .blog.err { color: #f87171; }
.build-logs-advanced .blog-lvl { color: #a3a3a3; font-weight: 500; }
.build-logs .log-ok { color: #86efac; }
.build-logs .log-wait { color: var(--text); }

.pc-route-head { margin-bottom: 10px; }
.pc-route-head .section-title { margin: 0; }
.pc-route-title-block { flex: 1; min-width: 0; }
.pc-route-desc { margin: 4px 0 0; font-size: .84rem; max-width: 520px; }
.pc-list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pc-list-toolbar input { flex: 1; min-width: 200px; margin: 0; }
.pc-refresh-btn { flex-shrink: 0; white-space: nowrap; }
.pc-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pc-summary-pill {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted);
}
.pc-summary-pill.on { color: var(--ok); border-color: rgba(134,239,172,.3); background: rgba(134,239,172,.08); }
.pc-list-panel { padding: 18px; }
.pc-list-toolbar { margin-bottom: 14px; }
.pc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-content: start; }
.pc-list.is-empty {
  display: flex; align-items: center; justify-content: center;
  padding: 36px 12px; grid-template-columns: unset;
}
.pc-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pc-pagination.hidden { display: none; }
.pc-page-btn.active { background: var(--surface3); color: var(--text); border-color: var(--border2); font-weight: 600; }
.pc-page-ellipsis { color: var(--muted); font-size: .85rem; padding: 0 4px; user-select: none; }
.pc-page-meta { width: 100%; text-align: center; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.pc-empty {
  color: var(--muted); text-align: center; padding: 24px 20px; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  max-width: 360px;
}
.pc-empty-title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); }
.pc-empty-sub { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--muted); }
.pc-item {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 16px 14px; background: var(--surface2); cursor: pointer;
  transition: transform .15s, border-color .2s, box-shadow .2s, background .2s; position: relative; overflow: hidden;
}
.pc-item.pc-item-enter { animation: routeIn .32s ease backwards; }
.pc-item:hover {
  transform: translateY(-2px);
  border-color: #454545;
  background: var(--surface3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.pc-item.online { box-shadow: inset 0 0 0 1px rgba(134,239,172,.08); }
.pc-item.online::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ok); border-radius: 14px 0 0 14px;
}
.pc-item.offline::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #555; border-radius: 14px 0 0 14px;
}
.pc-row-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.pc-row-top .admin-pc-purge { flex-shrink: 0; margin-left: auto; }
.pc-status { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.pc-status.on { background: rgba(134,239,172,.12); color: var(--ok); }
.pc-status.off { background: rgba(120,120,120,.12); color: var(--muted); }
.pc-build { font-size: .72rem; font-family: var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.pc-item h4 { margin: 0 0 8px; font-size: 1.08rem; font-weight: 600; letter-spacing: -.02em; padding-right: 48px; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .76rem; color: var(--muted); margin-bottom: 14px; }
.pc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pc-meta span::before { content: "·"; color: #555; margin-right: 2px; }
.pc-meta span:first-child::before { content: none; }
.pc-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.pc-open-hint { font-size: .72rem; font-weight: 600; color: var(--muted); transition: color .15s; }
.pc-item:hover .pc-open-hint { color: var(--text); }
.pc-item .pc-actions { display: flex; gap: 6px; flex-wrap: wrap; opacity: 0; transition: opacity .2s; }
.pc-item:hover .pc-actions { opacity: 1; }
.pc-actions .btn { padding: 5px 10px; font-size: .72rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(134,239,172,.45); }
.status-dot.off { background: #555; }

.pc-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pc-title-wrap { flex: 1; }
.pc-title-wrap .section-title { margin: 0; }
.pc-sub { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }

.pc-layout { display: grid; grid-template-columns: 232px 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .pc-layout { grid-template-columns: 1fr; } }
.pc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: auto;
  position: sticky;
  top: 72px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px 12px;
}
.files-panel-fill {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
.files-panel-fill .file-mode-tabs-wrap {
  flex-shrink: 0;
}
.files-panel-fill .file-manager.flush {
  flex: 1;
  min-height: 0;
  height: var(--file-manager-h);
  max-height: var(--file-manager-h);
}
.side-cat { margin-bottom: 2px; }
.side-cat.hidden { display: none; }
.side-cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.side-cat-head:hover { background: rgba(255,255,255,.04); color: var(--text); }
.side-cat-chevron {
  font-size: .65rem;
  opacity: .75;
  transition: transform .2s ease;
  line-height: 1;
}
.side-cat.collapsed .side-cat-chevron { transform: rotate(-90deg); }
.side-cat.collapsed .side-cat-body { display: none; }
.side-cat-body { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px; }
.side-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.side-tab-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .78; }
.side-tab span:last-child { flex: 1; min-width: 0; line-height: 1.25; }
.side-tab:hover { background: rgba(255,255,255,.04); color: var(--text); }
.side-tab:hover .side-tab-icon { opacity: .95; }
.side-tab.active {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}
.side-tab.active .side-tab-icon { opacity: 1; }
.side-tab.hidden { display: none; }

.pc-content { display: flex; flex-direction: column; gap: 10px; }
.pc-content > .pc-tab > * { margin-top: 0; }
.pc-content > .pc-tab > .panel { margin-top: 0; }
.tab-body-pad { padding: 14px 18px 18px; }
#tab-info .tab-body-pad {
  box-sizing: border-box;
  height: var(--pc-panel-body-h);
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tab-info .info-card {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 12px;
  padding: 14px;
  box-sizing: border-box;
}
#tab-info .info-card.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.info-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1;
}
.info-loading .spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  vertical-align: middle;
}
.flush { border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
.pc-tab { display: none; }
.pc-tab.active { display: block; animation: routeIn .25s ease; }

.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.info-card .info-group { background: var(--surface); }
.info-group { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.info-group h4 { margin: 0 0 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); display: flex; align-items: center; gap: 8px; }
.info-group h4::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.info-rows { display: flex; flex-direction: column; gap: 2px; }
.info-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; font-size: .82rem; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04); align-items: start; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--muted); }
.info-row span:last-child { color: var(--text); word-break: break-word; text-align: left; }
.info-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; background: var(--surface3); border: 1px solid var(--border); color: var(--text); }
.info-badge.ok { background: rgba(134,239,172,.12); border-color: rgba(134,239,172,.25); color: var(--ok); }
.info-badge.bad { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.25); color: var(--danger); }
.info-badge.neutral { background: rgba(255,255,255,.05); border-color: var(--border); color: var(--accent-dim); }

.terminal-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--inset); display: flex; flex-direction: column; }
.action-panel .terminal-card.flush {
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--inset);
}
.action-panel .terminal-output {
  border-radius: 0;
  min-height: 340px;
}
.action-panel .terminal-input {
  border-radius: 0;
}
.action-hero .shell-toggle { flex-shrink: 0; }
.shell-toggle { display: flex; gap: 4px; }
.shell-pill { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.shell-pill.active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.terminal-output { flex: 1; min-height: 320px; max-height: 520px; margin: 0; padding: 14px; overflow: auto; font-family: var(--mono); font-size: .78rem; line-height: 1.45; color: #e4e4e7; white-space: pre-wrap; word-break: break-word; }
.terminal-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface2); }
.prompt { font-family: var(--mono); font-size: .78rem; color: var(--ok); flex-shrink: 0; }
.terminal-input input { flex: 1; margin: 0; }

.file-manager { display: grid; grid-template-columns: 260px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); height: var(--file-manager-h); max-height: var(--file-manager-h); }
.file-manager.flush { border-radius: 0; border-left: none; border-right: none; border-bottom: none; height: var(--file-manager-h); max-height: var(--file-manager-h); }
.file-mode-tabs-wrap {
  padding: 10px 18px 0;
}
.file-mode-tabs {
  display: inline-flex;
  flex: none;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  width: auto;
  max-width: 100%;
}
.file-mode-tabs .pill {
  flex: 0 0 auto;
  padding: 6px 18px;
  font-size: 0.78rem;
  min-height: 0;
  line-height: 1.2;
  border-radius: 8px;
}
.crypto-panel-body { padding: 14px 18px 16px; }
.crypto-panel-body .crypto-scan-status { margin: 0 0 12px; padding-top: 4px; font-size: 0.8rem; }
.control-btns-inline-size { flex-wrap: nowrap; align-items: center; }
.control-size-input {
  width: 76px;
  min-width: 76px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  line-height: 1.2;
  -moz-appearance: textfield;
  appearance: textfield;
}
.control-size-input::-webkit-outer-spin-button,
.control-size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.control-btns-inline-size.control-btns-inline-pass {
  width: 100%;
  max-width: 100%;
}
.control-size-input.control-size-input-pass {
  flex: 1 1 160px;
  width: 0;
  min-width: 90px;
  max-width: 100%;
  box-sizing: border-box;
}
.control-jumpscare-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  width: 100%;
}
.control-jumpscare-row > span {
  font-size: .78rem;
  color: var(--muted);
  align-self: flex-start;
  text-align: left;
}
.control-jumpscare-row input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  -moz-appearance: textfield;
  appearance: textfield;
}
.control-jumpscare-row input[type="number"]::-webkit-outer-spin-button,
.control-jumpscare-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.control-notepad-text {
  resize: none;
  min-height: 52px;
  max-height: 52px;
}
.crypto-wallet-list.file-items {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-height: min(420px, var(--file-manager-h));
  overflow: auto;
}
.crypto-wallet-list .file-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  cursor: default;
}
.crypto-wallet-list .file-row .crypto-path {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}
.crypto-wallet-list .file-row:hover { background: rgba(255, 255, 255, 0.04); }
@media (max-width: 900px) { .file-manager { grid-template-columns: 1fr; height: auto; } }
.file-tree { padding: 10px; overflow-y: auto; min-height: 0; height: 100%; border-right: 1px solid var(--border); background: var(--surface2); }
.file-main { padding: 10px; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.file-path { font-family: var(--mono); font-size: .78rem; color: var(--muted); word-break: break-all; margin-bottom: 8px; flex-shrink: 0; }
.file-items { flex: 1; overflow-y: auto; min-height: 0; }
.file-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; font-size: .86rem; }
.file-row:hover { background: rgba(255,255,255,.04); }
.file-row.dir { font-weight: 500; }
.file-row .badge { font-size: .7rem; color: var(--muted); }
.file-row .dl-mini { opacity: 0; transition: opacity .15s; background: var(--text); color: var(--primary-fg); border: none; border-radius: 6px; padding: 3px 8px; font-size: .7rem; font-weight: 600; cursor: pointer; }
.file-row:hover .dl-mini { opacity: 1; }
.file-view { margin-top: 10px; max-height: 220px; overflow-y: auto; padding: 10px; font-family: var(--mono); font-size: .75rem; background: var(--inset); border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.tree-node { margin-left: 2px; }
.tree-item { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: .84rem; user-select: none; }
.tree-item:hover { background: rgba(255,255,255,.05); }
.tree-item.active { background: rgba(255,255,255,.08); }
.tree-chev { width: 14px; text-align: center; color: var(--muted); font-size: .7rem; }
.tree-children { margin-left: 12px; border-left: 1px solid var(--border); padding-left: 4px; }

.vhost-panel-wrap .action-hero { flex-shrink: 0; }
.vhost-shell {
  height: var(--pc-panel-body-h);
  box-sizing: border-box;
  border-top: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.vhost-shell.flush { border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
.vhost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  width: 100%;
}
@media (max-width: 960px) {
  .vhost-shell { height: auto; min-height: var(--pc-panel-body-h); }
  .vhost-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
.vhost-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  padding: 12px 16px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface2);
  gap: 6px;
  box-sizing: border-box;
  overflow: hidden;
}
.vhost-staging-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.vhost-staging-title { min-width: 0; flex: 1; }
.vhost-staging-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.vhost-staging-actions .btn { margin: 0; }
.vhost-run-toggle { margin: 0; white-space: nowrap; font-size: .78rem; }
.vhost-col:last-child { border-right: none; }
.vhost-col-head h4 { margin: 0 0 4px; font-size: .92rem; }
.vhost-col-head p { margin: 0; font-size: .78rem; line-height: 1.35; }
.vhost-path { font-family: var(--mono); font-size: .7rem; word-break: break-all; margin-top: 4px !important; margin-bottom: 0 !important; }
.vhost-file-pick { margin-top: 8px; margin-bottom: 0; }
.vhost-staging-head { margin-bottom: 0; padding-bottom: 0; }
.vhost-pull-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-shrink: 0; }
.vhost-path-input { flex: 1; min-width: 160px; margin: 0; font-size: .82rem; }
.vhost-list {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
  background: var(--surface);
  overflow-y: auto;
}
.vhost-list .vhost-empty-msg {
  margin: 0;
  padding: 16px 8px;
  font-size: .82rem;
  text-align: center;
}
.file-items .file-back-row { font-weight: 500; }
.file-main .file-items .file-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.file-main .file-items .file-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vhost-browser-zone {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.vhost-pull-list {
  flex: 1;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--surface);
  overflow-y: auto;
}
.vhost-browser-idle { padding: 12px 8px; margin: 0; font-size: .82rem; text-align: center; }
.vhost-msg { min-height: 0; margin: 0; font-size: .78rem; line-height: 1.3; }
.vhost-msg:empty { display: none; }
.vhost-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vhost-actions .btn { padding: 3px 8px; font-size: .72rem; }
.vhost-col .file-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.vhost-pull-list .file-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.vhost-pull-list .file-row > span:first-child,
.vhost-list .file-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.stream-left { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.stream-left label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.stream-left select { width: auto; min-width: 90px; padding: 6px 10px; font-size: .85rem; }
.stream-left input[type=range] { width: 130px; }
.stream-left #fps-label { font-family: var(--mono); font-size: .8rem; color: var(--text); margin-left: 4px; }
.stream-left select:disabled { opacity: .55; cursor: not-allowed; min-width: 52px; }
.tooltip-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.tooltip-wrap .tooltip-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(280px, 70vw);
  padding: 8px 10px;
  font-size: .75rem;
  line-height: 1.35;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #f87171;
  background: var(--surface2);
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  pointer-events: none;
  z-index: 30;
  transition: opacity .15s ease, visibility .15s ease;
}
.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble { visibility: visible; opacity: 1; }
.tooltip-wrap.tooltip-down .tooltip-bubble {
  bottom: auto;
  top: calc(100% + 8px);
}
.feature-mode-tag {
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-left: 4px;
}
.feature-mode-tag.is-auto { color: #f87171; }
.dgrab-modal {
  width: min(420px, calc(100dvw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.dgrab-modal-body {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dgrab-modal-body h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.dgrab-modal-lead {
  margin: 0;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--muted);
}
.dgrab-modal-warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .08);
  color: #fca5a5;
  font-size: .84rem;
  line-height: 1.45;
}
.dgrab-modal-btns {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.dgrab-modal-btns--split {
  grid-template-columns: 1fr 1fr;
}
.dgrab-modal-btns .btn {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  font-size: .86rem;
}
.dgrab-modal-cancel {
  width: 100%;
  justify-content: center;
  min-height: 38px;
  margin-top: 2px;
  color: var(--muted);
  border-color: transparent;
}
.dgrab-modal-cancel:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface2);
}
.discord-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.stream-inline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-left: 2px;
}
.stream-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stream-ctrl-title {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.stream-ctrl-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.stream-ctrl-mouse {
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}
.stream-ctrl-mouse > .stream-ctrl-title {
  align-self: center;
  padding-left: 0;
  margin-left: 2px;
  margin-right: 2px;
  margin-bottom: 1px;
}
.stream-ctrl-mouse-row {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.screen-toggles { display: flex; gap: 10px; }
.mini-toggle { display: flex; align-items: center; gap: 5px; font-size: .72rem; color: var(--muted); cursor: pointer; }
.mini-toggle-pill {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .74rem;
}
.mini-toggle input { width: auto; }
.stream-hint { padding: 8px 18px 0; font-size: .72rem; color: var(--muted); }
.stream-stage {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--inset);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.action-panel .stream-stage.flush {
  border-radius: 0;
  background: var(--inset);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.stream-stage .muted { color: var(--muted); }
.stream-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 300px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  animation: routeIn .15s ease;
  cursor: crosshair;
}
.keyboard-row { display: flex; gap: 8px; padding: 12px 18px 16px; background: var(--surface2); }
.keyboard-row.flush { border-radius: 0; }
.alerts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; padding: 14px 18px 18px; }
.alert-form-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.alert-form-card h4 { margin: 0 0 4px; font-size: .95rem; }
.alert-form-card .small { margin: 0 0 14px; font-size: .78rem; }
.alert-form-card .field-row:last-of-type { margin-bottom: 14px; }
.btn-full { width: 100%; }
.task-panel.flush { padding: 0 18px 14px; border: none; background: transparent; max-height: calc(100vh - 280px); }
.task-count-footer { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.action-hero .task-search-wrap { display: flex; gap: 8px; align-items: center; }
.action-hero .task-search-wrap input { width: min(220px, 40vw); margin: 0; }
.keyboard-row input { flex: 1; margin: 0; }

.clipboard-output { min-height: 120px; max-height: 260px; overflow: auto; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: .78rem; color: var(--muted); white-space: pre-wrap; margin-top: 12px; }

/* Status pill reused */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  border: 1px solid var(--border);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}
.status-pill.on { background: rgba(134,239,172,.12); color: var(--ok); border-color: rgba(134,239,172,.25); }
.status-pill.off { background: rgba(120,120,120,.12); color: var(--muted); }

/* Power & Control */
.action-panel { padding: 0; overflow: hidden; }
.action-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
.action-hero h3 { margin: 0 0 6px; font-size: 1.05rem; }
.action-hero p { margin: 0; font-size: .82rem; max-width: 520px; }
.action-badge {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  flex-shrink: 0;
}
.action-badge.warn { color: #fca5a5; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.1); }
.action-section-head { padding: 16px 18px 0; }
.action-section-head h3 { margin: 0 0 4px; font-size: .95rem; }
.action-section-head p { margin: 0 0 12px; font-size: .8rem; }
.action-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
}
.action-card-grid.two-col { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
button.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}
button.action-card:hover {
  border-color: #454545;
  background: var(--surface3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transform: translateY(-1px);
}
button.action-card:active {
  transform: translateY(0);
  background: #181818;
  box-shadow: none;
}
button.action-card:focus-visible {
  outline: none;
  border-color: #525252;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
button.action-card.danger { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.06); }
button.action-card.danger:hover {
  border-color: rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
button.action-card.danger:active { background: rgba(248, 113, 113, .08); }
button.action-card.danger .action-icon { color: #f87171; }
.pc-delete-modal {
  width: min(460px, calc(100dvw - 28px));
  border-color: rgba(255, 255, 255, .08);
}
.pc-delete-body { gap: 14px; }
.pc-delete-body.is-offline { gap: 12px; }
.pc-delete-body.is-offline .pc-delete-meta { margin-bottom: 0; }
.pc-delete-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.pc-delete-main .pc-delete-note {
  margin: 0;
}
.pc-delete-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.pc-delete-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(248, 113, 113, .18), rgba(248, 113, 113, .06));
  border: 1px solid rgba(248, 113, 113, .28);
  color: #fca5a5;
}
.pc-delete-icon svg { width: 26px; height: 26px; }
.pc-delete-hero-text { flex: 1; min-width: 0; }
.pc-delete-kicker {
  margin: 0 0 4px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.pc-delete-hero-text h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.25;
  word-break: break-word;
}
.pc-delete-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
}
.pc-delete-status.online {
  border-color: rgba(134, 239, 172, .35);
  background: rgba(134, 239, 172, .1);
  color: #86efac;
}
.pc-delete-status.offline {
  border-color: rgba(113, 113, 122, .45);
  background: rgba(63, 63, 70, .35);
  color: #a1a1aa;
}
.pc-delete-status .status-dot { width: 7px; height: 7px; }
.pc-delete-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .22);
  margin-bottom: 2px;
}
#pc-delete-online-extra {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
#pc-delete-offline-block:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
#pc-delete-offline-block .dgrab-modal-lead {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
}
#pc-delete-offline-block .pc-delete-note {
  margin: 0;
}
.pc-delete-meta-wide { grid-column: 1 / -1; }
.pc-delete-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.pc-delete-meta-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.pc-delete-meta-value {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}
.pc-delete-meta-value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  color: #d4d4d8;
}
.pc-delete-lead {
  margin: 0;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--muted);
}
.pc-delete-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.pc-delete-option:hover {
  border-color: rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .04);
}
.pc-delete-option:has(.pc-delete-option-input:checked) {
  border-color: rgba(248, 113, 113, .55);
  background: rgba(248, 113, 113, .1);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, .15);
}
.pc-delete-option-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.pc-delete-option-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  border: 2px solid #52525b;
  background: rgba(0, 0, 0, .25);
  position: relative;
  transition: border-color .15s, background .15s;
}
.pc-delete-option:has(.pc-delete-option-input:checked) .pc-delete-option-box {
  border-color: #f87171;
  background: rgba(248, 113, 113, .25);
}
.pc-delete-option:has(.pc-delete-option-input:checked) .pc-delete-option-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fecaca;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pc-delete-option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .86rem;
  line-height: 1.45;
}
.pc-delete-option-text strong { font-weight: 600; color: var(--text); }
.pc-delete-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, .28);
  background: rgba(251, 191, 36, .07);
  color: #fcd34d;
  font-size: .82rem;
  line-height: 1.5;
}
.pc-delete-note svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  opacity: .9;
}
.pc-delete-actions { margin-top: 2px; }
@media (max-width: 520px) {
  .pc-delete-hero { flex-wrap: wrap; }
  .pc-delete-status { margin-left: 62px; }
  .pc-delete-meta { grid-template-columns: 1fr; }
}
.action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  color: var(--text);
  opacity: .92;
}
.action-icon svg { width: 22px; height: 22px; display: block; }
.action-title { font-size: .92rem; font-weight: 600; }
.action-desc { font-size: .74rem; color: var(--muted); line-height: 1.35; }

.control-panel {
  display: flex;
  flex-direction: column;
  max-height: var(--pc-panel-body-h);
  min-height: 320px;
}
.control-panel .action-hero {
  flex-shrink: 0;
}
.control-panel .tab-body-pad.control-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  margin-top: 0;
  border-top: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.control-scroll::-webkit-scrollbar { width: 8px; }
.control-scroll::-webkit-scrollbar-track { background: transparent; }
.control-scroll::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.control-section { margin-bottom: 16px; }
.control-section:last-child { margin-bottom: 4px; }
.control-section-title {
  margin: 0 0 10px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.control-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.control-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  min-height: 118px;
}
.control-card-compact {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.control-card-compact .control-card-desc {
  min-height: 2.7em;
}
.control-card-compact .control-btns {
  margin-top: auto;
}
.control-field-inline input {
  padding: 6px 8px;
  font-size: .78rem;
}
.control-card-compact .control-field { gap: 4px; }
.control-card-compact .control-btns { margin-top: auto; }
.control-card-text { display: flex; flex-direction: column; gap: 4px; }
.control-card-title { font-size: .92rem; font-weight: 600; }
.control-card-desc { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.control-card-wide,
.control-card-span2 { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .control-card-grid { grid-template-columns: 1fr; }
  .control-card-span2 { grid-column: 1; }
}
.control-field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.control-field input[type="text"],
.control-field input[type="url"],
.control-field textarea,
.control-field select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--inset); color: var(--text); font: inherit; font-size: .82rem;
}
.control-field-row { flex-direction: row; align-items: center; gap: 10px; }
.control-field-row input[type="range"] { flex: 1; }
.control-audio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; width: 100%; }
.control-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.control-btns .btn {
  padding: 7px 12px;
  font-size: .78rem;
  transition: border-color .12s ease, color .12s ease, background .12s ease, box-shadow .12s ease;
}
.control-btns .btn.ok-flash {
  opacity: 1;
  cursor: pointer;
  animation: controlBtnOk .22s ease-out both;
}
.control-btns .btn.err-flash {
  opacity: 1;
  cursor: pointer;
  animation: controlBtnErr .22s ease-out both;
}
.control-btns .btn.pending-flash {
  opacity: 1;
  cursor: wait;
  animation: controlBtnPending .35s ease-in-out infinite alternate;
}
@keyframes controlBtnPending {
  from { border-color: var(--border); background: transparent; }
  to { border-color: #525252; background: rgba(255, 255, 255, .04); }
}
@keyframes controlBtnOk {
  0% {
    border-color: var(--border);
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    transform: scale(1);
  }
  18% {
    border-color: rgba(134, 239, 172, .65);
    color: #86efac;
    background: rgba(134, 239, 172, .14);
    box-shadow: 0 0 0 2px rgba(134, 239, 172, .22);
    transform: scale(0.97);
  }
  45% {
    border-color: rgba(134, 239, 172, .55);
    color: #86efac;
    background: rgba(134, 239, 172, .1);
    box-shadow: 0 0 10px rgba(134, 239, 172, .12);
    transform: scale(1);
  }
  100% {
    border-color: var(--border);
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    transform: scale(1);
  }
}
@keyframes controlBtnErr {
  0% {
    border-color: var(--border);
    color: var(--muted);
    background: transparent;
    box-shadow: none;
  }
  20% {
    border-color: rgba(248, 113, 113, .55);
    color: #fca5a5;
    background: rgba(248, 113, 113, .1);
    box-shadow: 0 0 0 2px rgba(248, 113, 113, .18);
  }
  100% {
    border-color: var(--border);
    color: var(--muted);
    background: transparent;
    box-shadow: none;
  }
}

/* Task Manager compact */
.task-panel { padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 200px); }
.task-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.task-title { display: flex; align-items: center; gap: 10px; }
.task-title h3 { margin: 0; font-size: 1rem; }
.task-search-wrap { display: flex; align-items: center; gap: 8px; }
.task-search-wrap input { width: 180px; margin: 0; padding: 8px 10px; }
.task-table-header { display: grid; grid-template-columns: 1fr 70px 55px 60px; gap: 8px; padding: 6px 10px; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.task-list.compact { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 310px); overflow: auto; }
.task-list.compact .task-row { display: grid; grid-template-columns: 1fr 70px 55px 60px; gap: 8px; align-items: center; padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,.03); font-size: .82rem; }
.task-list.compact .task-row:hover { background: rgba(255,255,255,.04); }
.task-list.compact .col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-list.compact .col-pid, .task-list.compact .col-cpu { font-family: var(--mono); color: var(--muted); }
.task-list.compact .col-action { text-align: right; }
.task-list.compact .btn { padding: 3px 8px; font-size: .68rem; }
.empty-tasks { padding: 12px; font-size: .8rem; }

/* Credentials */
.cred-panel { padding: 0; overflow: hidden; }
.cred-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
.cred-hero h3 { margin: 0 0 6px; font-size: 1.05rem; }
.cred-hero-desc { margin: 0 0 12px; font-size: .82rem; max-width: 420px; }
.cred-last-grab { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cred-last-meta { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cred-last-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  line-height: 1;
}
.cred-last-meta strong { font-size: .95rem; font-weight: 600; font-family: var(--mono); line-height: 1.2; }
.cred-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.credentials-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px; }

.discord-panel-wrap {
  height: auto;
  max-height: var(--pc-panel-body-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}
.discord-panel-wrap.action-panel { overflow: hidden; }
.discord-panel-wrap .action-hero {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border-radius: var(--radius) var(--radius) 0 0;
}
.discord-top .tooltip-wrap.tooltip-down .tooltip-bubble { z-index: 40; }
.discord-shell {
  flex: 0 1 auto;
  height: auto;
  max-height: calc(var(--pc-panel-body-h) - 96px);
  box-sizing: border-box;
  border-top: 1px solid var(--border);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
  background: var(--surface2);
}
.discord-shell.flush {
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}
.discord-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.discord-clients { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 200px; }
.discord-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .78rem;
}
.discord-client-chip .name { font-weight: 600; }
.discord-client-chip .state { font-size: .72rem; color: var(--muted); }
.discord-client-chip.state-open .state { color: var(--ok); }
.discord-client-chip.state-closed .state { color: var(--muted); }
.discord-client-chip.state-missing .state { color: var(--danger); }
.discord-run-status {
  margin: 0;
  min-height: 0;
  font-size: .78rem;
  line-height: 1.25;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.discord-run-status .spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
  flex-shrink: 0;
  margin: 0;
  vertical-align: middle;
}
.discord-run-status.is-error { color: var(--danger); font-weight: 500; }
.discord-account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  margin-top: -2px;
  padding-top: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.discord-account-tabs .tab-pill {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.discord-account-tabs .tab-pill.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  font-weight: 600;
}
.discord-account-panel {
  flex: 0 1 auto;
  max-height: min(460px, calc(var(--pc-panel-body-h) - 168px));
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}
.discord-placeholder {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  margin-top: 2px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: .86rem;
}
.discord-profile { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.discord-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--inset); flex-shrink: 0; }
.discord-profile-text h4 { margin: 0 0 4px; font-size: 1rem; }
.discord-profile-text .sub { margin: 0; font-size: .78rem; color: var(--muted); }
.discord-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.discord-badge {
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(88, 101, 242, .15);
  border: 1px solid rgba(88, 101, 242, .35);
  color: #c7ceff;
}
.discord-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-size: .82rem; margin-bottom: 14px; }
.discord-fields .label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 2px; }
.discord-fields .value { word-break: break-word; }
.discord-token-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.discord-token-field {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--inset);
  border: 1px solid var(--border);
}
.discord-token-eye {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  flex-shrink: 0;
}
.discord-token-eye:hover { border-color: #555; }
.discord-guilds { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.discord-guilds h5 { margin: 0 0 8px; font-size: .82rem; font-weight: 600; }
.discord-guild-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; }
.discord-guild-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .78rem;
}
.discord-guild-list .members { color: var(--muted); font-family: var(--mono); font-size: .72rem; flex-shrink: 0; }
.cred-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cred-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.cred-head-main { flex: 1; min-width: 0; }
.cred-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 4px;
}
.cred-head strong { font-size: .95rem; }
.cred-title-row .status-pill {
  position: relative;
  top: 2px;
}
.cred-title-row .cred-err-pill {
  flex-shrink: 1;
  min-width: 0;
  max-width: min(100%, 14rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cred-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cred-stat {
  font-size: .68rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--muted);
}
.cred-stat em { font-style: normal; color: var(--text); font-weight: 600; }
.cred-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cred-btns .btn { padding: 6px 10px; font-size: .72rem; }
.cred-body { border-top: 1px solid var(--border); padding: 12px; background: var(--inset); }
.cred-section { margin-bottom: 14px; }
.cred-section h5 { margin: 0 0 8px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cred-export-pre {
  margin: 0;
  padding: 14px 16px;
  max-height: 320px;
  overflow: auto;
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.55;
  letter-spacing: .01em;
  white-space: pre-wrap;
  word-break: break-word;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.stream-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.screen-popout-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  width: min(520px, calc(100dvw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.screen-popout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
}
.screen-popout-stage { min-height: 200px; max-height: min(42vh, 360px); }
.media-section-gap { margin-top: 14px; }
.mic-status-line {
  width: min(100%, 520px);
  margin: 0 0 16px;
  padding: 0 6px;
  font-size: .78rem;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}
.mic-stage-inner {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 18px 20px;
}
.mic-visual {
  width: min(100%, 520px);
  padding: 8px 4px 4px;
}
.mic-visual-hint {
  margin: 10px 0 0;
  font-size: .78rem;
  text-align: center;
}
.mic-level-wrap {
  height: 12px;
  border-radius: 999px;
  background: var(--inset);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.mic-level-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96, 165, 250, .75), rgba(52, 211, 153, .95));
  transition: width .08s ease-out;
}
.alert-form-card textarea {
  min-height: 88px;
  resize: vertical;
  font-family: inherit;
}
.cred-rows { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.cred-row { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.cred-row pre { margin: 0; font-family: var(--mono); font-size: .72rem; white-space: pre-wrap; word-break: break-word; }

.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
.overlay.hidden { display: none; }
.overlay-card { width: min(340px, 90%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.overlay-card h3 { margin: 0 0 14px; }
.overlay-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.app-footer { text-align: center; padding: 14px; font-size: .74rem; color: var(--muted); border-top: 1px solid var(--border); opacity: .9; }

.entry-ban { text-align: center; padding: 8px 4px 4px; }
.entry-ban.hidden { display: none; }
.entry-ban-icon { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--danger); opacity: .95; }
.entry-ban-icon svg { width: 56px; height: 56px; }
.entry-ban-title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.entry-ban-lead { margin: 0 0 16px; font-size: .86rem; }
.entry-ban-reason-box { text-align: left; background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.28); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.entry-ban-reason-label { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--danger); margin-bottom: 6px; font-weight: 600; }
.entry-ban-reason { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--text); word-break: break-word; }
.entry-access { text-align: center; font-size: .82rem; margin: 14px 0 0; }
.entry-access a { color: var(--accent-dim); text-decoration: none; font-weight: 500; }
.entry-access a:hover { color: var(--text); text-decoration: underline; }
.entry-register { display: flex; flex-direction: column; gap: 0; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.entry-submit { margin-top: 8px; margin-bottom: 4px; }

.entry-2fa-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0 0;
  animation: entryIn .35s ease;
}
.entry-2fa-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  color: var(--text);
  opacity: .9;
}
.entry-2fa-icon svg { width: 52px; height: 52px; display: block; }
.entry-2fa-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-align: center;
}
.entry-2fa-lead {
  margin: 0 0 6px;
  font-size: .88rem;
  line-height: 1.45;
  text-align: center;
}
.entry-2fa-user {
  margin: 0 0 18px;
  font-size: .82rem;
  text-align: center;
}
.entry-2fa-user strong { color: var(--text); font-weight: 600; }
.entry-2fa-panel .entry-field { margin-bottom: 14px; }
.entry-2fa-panel #login-totp {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.35rem;
  letter-spacing: .28em;
  padding: 14px 12px;
}
.entry-2fa-back { margin-top: 6px; }

.chip-btn { cursor: pointer; border: 1px solid var(--border); background: var(--surface2); font: inherit; border-radius: 999px; padding: 6px 12px; transition: background .15s, border-color .15s; }
.chip-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }

.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; min-height: calc(100vh - 160px); }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side { position: sticky; top: 72px; padding: 14px 10px; }
.admin-side-head { padding: 4px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.admin-side-head .section-title.sm { font-size: 1rem; margin: 0; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-btn { display: flex; align-items: center; gap: 10px; text-align: left; border: none; background: transparent; color: var(--muted); font: inherit; font-size: .86rem; padding: 9px 12px; border-radius: 8px; cursor: pointer; width: 100%; }
.admin-nav-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.admin-nav-btn.active { background: rgba(255,255,255,.08); color: var(--text); font-weight: 500; }
.admin-nav-ico { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; display: inline-flex; }
.admin-nav-ico svg { width: 18px; height: 18px; }
.admin-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 8px; }
.admin-chart-panel { padding: 16px 18px; min-height: 200px; }
.admin-chart-panel h3 { margin: 0 0 12px; font-size: .88rem; }
.admin-chart-donut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.admin-mini-legend { font-size: .75rem; }
.admin-bars { display: flex; flex-direction: column; gap: 10px; }
.admin-bar-row { display: grid; grid-template-columns: 72px 1fr 28px; gap: 10px; align-items: center; font-size: .78rem; }
.admin-bar-track { height: 8px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.admin-bar-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.admin-bar-num { text-align: right; font-family: var(--mono); color: var(--muted); }
.admin-toolbar { padding: 12px 14px; margin-bottom: 12px; }
.admin-toolbar input[type=search] { width: 100%; margin: 0; max-width: 420px; }
.admin-keys-board {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(360px, 46vh);
}
.admin-keys-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.admin-keys-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-keys-filters .btn.active { background: rgba(255,255,255,.1); color: var(--text); }
.admin-keys-scroll {
  flex: 1 1 auto;
  height: min(300px, 38vh);
  min-height: min(300px, 38vh);
  max-height: min(300px, 38vh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px 12px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #0a0a0a;
}
.admin-keys-scroll::-webkit-scrollbar { width: 7px; }
.admin-keys-scroll::-webkit-scrollbar-track { background: #0a0a0a; border-radius: 8px; }
.admin-keys-scroll::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
}
.admin-keys-scroll::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
.admin-key-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.05); }
.admin-key-row:last-child { border-bottom: none; }
.admin-key-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 1 / -1; }
.admin-key-code { font-family: var(--mono); font-size: .72rem; word-break: break-all; background: var(--inset); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); }
.admin-key-meta { grid-column: 1; }
.admin-keys-empty { padding: 16px; margin: 0; }
.admin-ip-card { width: min(520px, 92vw); max-height: min(80vh, 640px); display: flex; flex-direction: column; }
.admin-ip-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.admin-ip-head h3 { margin: 0; font-size: 1rem; }
.admin-ip-toolbar { display: flex; justify-content: flex-end; margin-top: 8px; flex-shrink: 0; }
.admin-ip-toolbar .btn.danger { color: var(--danger); border-color: rgba(248,113,113,.35); }
.admin-ip-list { overflow-y: auto; max-height: min(52vh, 480px); display: flex; flex-direction: column; gap: 8px; margin-top: 10px; flex: 1; min-height: 0; }
.admin-ip-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.admin-ip-row-main { flex: 1; min-width: 0; }
.admin-ip-row-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.admin-ip-addr { word-break: break-all; font-family: var(--mono); font-size: .82rem; }
.admin-ip-remove { flex-shrink: 0; align-self: center; }
.admin-ip-ua { margin-top: 6px; word-break: break-word; font-size: .7rem; opacity: .85; }
.admin-main { min-width: 0; }
.admin-view { display: none; }
.admin-view.active { display: block; }
.admin-head { margin-bottom: 16px; }
.admin-head .section-title { margin: 0 0 6px; }
.admin-table-wrap { padding: 0; overflow: hidden; }
.admin-table-scroll { overflow-x: auto; }
#admin-view-users .admin-table-scroll { overflow-x: hidden; }
.admin-users-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-users-table th, .admin-users-table td { padding: 10px 11px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.admin-users-table th:last-child,
.admin-users-table td:last-child { padding-right: 16px; white-space: nowrap; }
.admin-users-table th { color: var(--muted); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-users-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600; border: 1px solid var(--border); }
.admin-tag.admin { background: rgba(134,239,172,.1); color: var(--ok); border-color: rgba(134,239,172,.25); }
.admin-tag.active {
  background: rgba(134,239,172,.12);
  color: #86efac;
  border-color: rgba(134,239,172,.35);
}
.admin-tag.banned {
  background: rgba(248,113,113,.12);
  color: var(--danger);
  border-color: rgba(248,113,113,.35);
}
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: none; border-radius: 8px;
  background: rgba(255,255,255,.04); cursor: pointer; transition: background .15s, transform .1s;
}
.admin-icon-btn:hover { background: rgba(255,255,255,.1); }
.admin-icon-btn:active { transform: scale(.96); }
.admin-icon-btn svg { width: 18px; height: 18px; }
.admin-icon-btn.ban { color: #f87171; }
.admin-icon-btn.ban:hover { background: rgba(248,113,113,.12); }
.admin-icon-btn.delete { color: #f87171; }
.admin-icon-btn.delete:hover { background: rgba(248,113,113,.12); }
.admin-icon-btn.unban { color: #fafafa; }
.admin-icon-btn.unban:hover { background: rgba(255,255,255,.12); }
.admin-unban-card { max-width: 420px; }
.admin-unban-reason-box {
  text-align: left; background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.28);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0;
}
.admin-unban-reason { margin: 0; font-size: .88rem; line-height: 1.45; word-break: break-word; }
.admin-unban-actions { margin-top: 8px; justify-content: flex-end; }
.admin-tag.auto { background: rgba(251,191,36,.12); color: #fbbf24; }
.admin-pc-grid {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-content: start;
}
.admin-keygen-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .admin-keygen-layout { grid-template-columns: 1fr; } }
.admin-key-gen-card { padding: 18px 20px; }
.admin-key-gen-card h3, .admin-key-hints h3 { margin: 0 0 8px; font-size: .92rem; }
.admin-key-gen-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; }
.admin-key-count-field { margin: 0; min-width: 100px; }
.admin-key-count-field input { width: 88px; margin: 0; }
.admin-key-plan-field { margin: 0; min-width: 140px; }
.admin-key-plan-field select { width: 100%; margin: 0; }
.settings-sub-plan { margin: 0 0 6px; font-size: .92rem; }
.settings-redeem-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.settings-redeem-hint { margin: 6px 0 0; }
.settings-sub-remaining.expired { color: var(--danger, #e55); }
#login-renewal-wrap.entry-renewal-highlight,
#login-renewal-wrap.entry-renewal-highlight:focus-within {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 8px;
  margin-top: 4px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, .04);
}
#login-renewal-wrap.entry-renewal-highlight input,
#login-renewal-wrap.entry-renewal-highlight input:focus,
#login-renewal-wrap.entry-renewal-highlight input:focus-visible {
  background: #161616 !important;
  border-color: #333 !important;
  box-shadow: none !important;
  outline: none !important;
}
.admin-extend-card { max-width: 360px; }
button.admin-remain-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  margin: 0;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: none;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
button.admin-remain-btn:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .18);
}
button.admin-remain-btn:active { transform: scale(0.98); }
button.admin-remain-btn:focus { outline: none; }
button.admin-remain-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}
.admin-remain-btn.muted-expired { opacity: .85; }
.topbar-sound-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.topbar-sound-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .12);
}
.topbar-sound-btn:focus { outline: none; }
.topbar-sound-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .1);
}
.notify-sound-overlay {
  align-items: flex-start;
  justify-content: center;
  padding-top: max(72px, calc(52px + env(safe-area-inset-top)));
}
.notify-sound-card {
  width: min(360px, 92vw);
  padding: 16px 18px 18px;
  margin: 0 auto;
}
.notify-sound-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.notify-sound-head h3 { margin: 0; font-size: .95rem; }
.notify-sound-card .settings-toggle { margin-bottom: 12px; }
.notify-sound-card .settings-sound-field { margin-bottom: 10px; }
.admin-tag.no-key {
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  border: 1px solid var(--border);
}
.settings-sub-remaining { margin: 0; font-size: .84rem; }
.settings-sub-remaining.expired { color: var(--danger); }
.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) { white-space: nowrap; }
.admin-key-hints { padding: 18px 20px; }
.admin-key-hint-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.admin-key-hint-list code { font-size: .75rem; }
.admin-key-created { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: rgba(134,239,172,.08); border: 1px solid rgba(134,239,172,.22); }
.admin-key-created.hidden { display: none; }
.admin-key-created-line { font-size: .82rem; margin: 6px 0; word-break: break-all; }
.admin-key-created-line code { font-family: var(--mono); font-size: .78rem; color: var(--text); }
.admin-key-created-label { color: var(--ok); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.pc-item.pc-demo { opacity: .92; border-style: dashed; }
.admin-key-panel { padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; max-width: 520px; }
.admin-key-panel input[type=number] { width: 80px; }
.admin-keys-out { width: 100%; margin: 0; padding: 12px; background: var(--inset); border-radius: 8px; border: 1px solid var(--border); font-family: var(--mono); font-size: .78rem; white-space: pre-wrap; min-height: 48px; }
.admin-log-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 14px; margin-bottom: 12px; align-items: center; }
.admin-log-filters input[type=search] { flex: 1; min-width: 160px; margin: 0; }
.admin-log-filters select { width: auto; min-width: 140px; margin: 0; }
.admin-logs-panel { padding: 0; overflow: hidden; }
.admin-logs-out { margin: 0; padding: 14px; max-height: min(70vh, 640px); overflow: auto; font-family: var(--mono); font-size: .72rem; line-height: 1.45; color: #d4d4d8; white-space: pre-wrap; }

.build-dl-modal {
  width: min(400px, calc(100dvw - 32px));
  padding: 26px 22px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface2) 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.build-dl-modal h3 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -0.02em; }
.build-dl-file { margin: 0 0 6px; font-family: var(--mono); font-size: .78rem; word-break: break-all; }
.build-dl-hint { margin: 0 0 18px; line-height: 1.45; font-size: .82rem; }
.build-dl-actions { display: flex; flex-direction: column; gap: 8px; }
.build-dl-actions .btn { width: 100%; min-height: 42px; }
.build-dl-actions .btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.build-dl-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: #e8e8e8;
  animation: buildDlSpin 0.85s linear infinite;
}
.build-dl-spinner.done {
  animation: none;
  border-color: rgba(134, 239, 172, 0.45);
  border-top-color: rgba(134, 239, 172, 0.45);
  background: rgba(134, 239, 172, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.build-dl-spinner.done::after {
  content: "";
  display: block;
  width: 9px;
  height: 15px;
  margin-top: -3px;
  border: solid var(--ok);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  box-sizing: border-box;
}
@keyframes buildDlSpin { to { transform: rotate(360deg); } }
#build-download-overlay.overlay { align-items: center; justify-content: center; padding: 16px; }

.settings-page { max-width: 960px; margin: 0 auto; padding-bottom: 40px; }
.settings-back { margin-bottom: 12px; }
.settings-lead { margin: -4px 0 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.settings-card { padding: 18px 20px; }
.settings-card h3 { margin: 0 0 14px; font-size: .95rem; }
.settings-block { display: flex; flex-direction: column; }
.settings-field { margin-bottom: 18px !important; }
.settings-field .entry-label { margin-top: 2px; }
.settings-actions { margin-top: 4px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.settings-toggle { display: flex; margin-bottom: 18px; }
.settings-sound-field { margin-bottom: 20px !important; }
.entry-hint { font-size: .72rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.settings-flash {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .84rem;
  border: 1px solid transparent;
}
#settings-msg.settings-flash {
  margin-top: 22px;
  margin-bottom: 0;
}
.settings-card .settings-flash {
  margin-top: 4px;
  margin-bottom: 12px;
}
.settings-flash.hidden { display: none; }
.settings-flash.ok {
  color: #a7f3d0;
  background: rgba(16, 185, 129, .1);
  border-color: rgba(16, 185, 129, .25);
}
.settings-flash.err {
  color: #fecaca;
  background: rgba(248, 113, 113, .08);
  border-color: rgba(248, 113, 113, .22);
}
.twofa-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.twofa-card-head h3 { margin: 0 0 6px; }
.twofa-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
}
.twofa-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, .2);
}
.twofa-status-pill.on {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .08);
}
.twofa-status-pill.on .twofa-status-dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .25);
}
.twofa-status-pill.off .twofa-status-dot {
  background: #9ca3af;
}
.twofa-lead { margin: 0; }
.twofa-setup { margin-top: 8px; }
.twofa-setup-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.twofa-setup-top p { margin: 0; flex: 1; }
.twofa-qr-wrap { display: flex; justify-content: center; margin-bottom: 16px; padding: 12px; background: #fff; border-radius: 12px; width: fit-content; margin-left: auto; margin-right: auto; }
.twofa-qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.twofa-secret { display: block; word-break: break-all; padding: 10px; background: var(--inset); border-radius: 8px; border: 1px solid var(--border); font-size: .75rem; margin-bottom: 16px; }

/* ========== Mobile & touch (panel stays fully usable) ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.btn,
.nav-pill,
.side-tab,
.side-cat-head,
.chip-btn,
.entry-tab,
.pc-item,
button.action-card {
  touch-action: manipulation;
}
@media (hover: none), (pointer: coarse) {
  .pc-item .pc-actions { opacity: 1; }
  .file-row .dl-mini { opacity: 1; }
  .pc-item:hover { transform: none; }
  .btn:active,
  button.admin-remain-btn:active,
  .admin-icon-btn:active {
    transform: none;
  }
}

/* iOS Safari zooms focused fields when font-size < 16px — keep touch fields at 16px+ */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px;
    line-height: 1.35;
  }
  .control-field input[type="text"],
  .control-field input[type="url"],
  .control-field textarea,
  .control-field select,
  .control-field-inline input,
  .vhost-path-input,
  .terminal-input input,
  .pc-list-toolbar input {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  :root {
    --pc-panel-body-h: min(560px, calc(100dvh - 240px));
  }
  html { overflow-x: clip; }
  body {
    font-size: 15px;
    line-height: 1.45;
    overflow-x: clip;
  }
  .app-main { overflow-x: clip; max-width: 100%; }
  .view.active { padding: 16px 12px; align-items: flex-start; }
  .entry-brand-title { font-size: 1.75rem; padding-top: 28px; }
  .entry-brand-mark { width: 48px; height: 48px; }
  .section-title { font-size: 1.35rem; }
  .app-main {
    padding: 14px 12px max(28px, calc(12px + env(safe-area-inset-bottom)));
    min-height: 0;
  }
  .app-topbar {
    height: auto;
    min-height: 52px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px calc(8px + env(safe-area-inset-top));
    gap: 8px 10px;
  }
  .topbar-left { flex: 1 1 auto; min-width: 0; }
  .topbar-nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 2px;
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .topbar-right {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 6px;
  }
  .nav-pill {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: .9rem;
    min-height: 44px;
  }
  #btn-logout { padding: 10px 14px; font-size: .88rem; min-height: 44px; }
  .chip.chip-btn { font-size: .88rem; padding: 8px 12px; min-height: 44px; }
  .brand-text { font-size: 1.1rem; }
  .brand-logo { width: 38px; height: 38px; }
  .dash-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .dash-title-row { flex-direction: column; gap: 6px; }
  .dash-head #btn-refresh-dashboard { width: 100%; min-height: 44px; }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-card { padding: 14px 16px; }
  .stat-card .num { font-size: 1.85rem; }
  .stat-card .desc { font-size: .8rem; }
  .entry-tab { min-height: 44px; font-size: .95rem; }
  .entry-label { font-size: .72rem; }
  .entry-body .btn-primary,
  .entry-body .btn-ghost.entry-submit { min-height: 48px; font-size: 1rem; }
  input, select, textarea { touch-action: manipulation; }
  .pc-list { grid-template-columns: 1fr; }
  .pc-list-toolbar input { min-width: 0; width: 100%; flex: 1 1 100%; }
  .pc-list-toolbar { flex-direction: column; align-items: stretch; }
  .pc-build { max-width: 100%; flex: 1 1 100%; }
  .pc-top { flex-wrap: wrap; }
  .pc-top .section-title { font-size: 1.2rem; word-break: break-word; }
  .builder-layout { gap: 12px; }
  .build-logs-head { flex-wrap: wrap; }
  .build-logs-head #btn-cancel-build { width: 100%; min-height: 42px; margin-top: 0; }
  .feature-boxes { grid-template-columns: 1fr; }
  .action-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 12px 12px;
    gap: 10px;
  }
  .action-hero > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .action-hero .btn { flex: 1 1 auto; min-height: 40px; }
  .shell-toggle { width: 100%; }
  .shell-toggle .shell-pill { flex: 1; text-align: center; min-height: 40px; }
  .action-card-grid,
  .action-card-grid.two-col {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .stream-toolbar { padding: 10px 12px; }
  .stream-left { gap: 10px; width: 100%; }
  .stream-left input[type=range] { width: min(120px, 35vw); }
  .stream-stage {
    min-height: min(52vw, 280px);
    padding: 8px 10px;
  }
  .stream-stage img {
    max-height: min(55dvh, 420px);
    touch-action: none;
  }
  .keyboard-row { flex-wrap: wrap; padding: 10px 12px; }
  .keyboard-row .btn { flex: 1 1 calc(50% - 4px); min-height: 42px; }
  .alerts-grid { grid-template-columns: 1fr; padding: 12px; }
  .terminal-output { min-height: 200px; max-height: 45dvh; }
  .action-panel .terminal-output { min-height: 200px; }
  .file-manager { height: auto; min-height: min(70dvh, 520px); }
  .file-tree { max-height: 220px; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .info-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; font-size: .88rem; }
  .info-row span:first-child { font-size: .78rem; font-weight: 600; color: var(--muted); }
  .task-search-wrap { width: 100%; }
  .task-search-wrap input { width: 100%; flex: 1; }
  .task-table-header,
  .task-list.compact .task-row {
    grid-template-columns: minmax(0, 1fr) 52px 48px 58px;
    gap: 8px;
    font-size: .8rem;
  }
  .task-panel { max-height: none; }
  .cred-hero { padding: 14px 12px; }
  .discord-fields { grid-template-columns: 1fr; }
  .dgrab-modal-btns--split { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav-btn { width: auto; flex: 1 1 calc(50% - 4px); min-height: 44px; }
  .admin-ip-card { width: 100%; max-height: min(88dvh, 640px); }
  .admin-ip-toolbar { justify-content: stretch; }
  .admin-ip-toolbar .btn { width: 100%; min-height: 44px; }
  .admin-ip-row { flex-direction: column; align-items: stretch; }
  .admin-ip-remove { width: 100%; min-height: 44px; align-self: stretch; margin-top: 4px; }
  .admin-ip-list { max-height: min(50dvh, 420px); }
  .overlay { padding: 12px; align-items: flex-end; }
  .overlay-card {
    width: 100%;
    max-width: 100%;
    max-height: min(90dvh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dash-donut-wrap { justify-content: center; }
  .dash-chart-panel h3 { font-size: 1.02rem; }
  .panel h3 { font-size: 1.05rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .twofa-setup-top { flex-direction: column; }
}

@media (max-width: 820px) {
  .pc-layout { min-height: 0; gap: 10px; }
  .pc-sidebar {
    position: sticky;
    top: calc(52px + env(safe-area-inset-top));
    z-index: 40;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding: 8px;
    gap: 6px;
  }
  .pc-sidebar::-webkit-scrollbar { display: none; }
  .side-cat {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    gap: 4px;
  }
  .side-cat-head { display: none; }
  .side-cat.collapsed .side-cat-body { display: flex; }
  .side-cat-body {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0;
  }
  .side-tab {
    flex-shrink: 0;
    width: auto;
    padding: 10px 12px;
    min-height: 44px;
    font-size: .8rem;
  }
  .side-tab span:last-child { white-space: nowrap; }
  .side-tab-icon { width: 16px; height: 16px; }
  .control-panel { max-height: none; min-height: 0; }
  .vhost-layout { grid-template-rows: auto auto; min-height: min(80dvh, 640px); }
  .vhost-col { min-height: 240px; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .vhost-col:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .entry-card { padding: 10px 8px 22px; }
  .entry-body { padding: 0 10px; }
  .entry-brand-title { font-size: 1.85rem; }
  .panel { padding: 16px 14px; }
  .tab-body-pad { padding: 14px; }
  .pc-item h4 { padding-right: 0; font-size: 1.05rem; }
  .pc-item-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .pc-actions { justify-content: stretch; gap: 8px; }
  .pc-actions .btn { min-height: 44px; flex: 1 1 auto; font-size: .85rem; }
  .section-title { font-size: 1.4rem; }
  .btn-sm { padding: 10px 14px; font-size: .88rem; min-height: 44px; }

  /* Builder: history + logs only (PC routes unchanged) */
  #route-builder .builder-history-body {
    height: auto;
    flex: none;
    min-height: min(440px, 52dvh);
    max-height: none;
  }
  #route-builder .build-logs-panel .build-logs.flush {
    height: auto;
    flex: none;
    min-height: min(300px, 42dvh);
    max-height: min(520px, 58dvh);
    font-size: .84rem;
    line-height: 1.5;
    padding: 14px 16px;
  }
  #route-builder .build-logs.build-logs-advanced { font-size: .8rem; }
  #route-builder .build-logs-advanced .blog.trace { font-size: .74rem; }
  #route-builder .builder-history-panel .action-hero.compact,
  #route-builder .build-logs-panel .action-hero.compact {
    padding: 16px 14px 12px;
  }
  #route-builder .simple-list li {
    font-size: .95rem;
    padding: 14px 14px;
    margin-bottom: 10px;
  }
  #route-builder .build-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  #route-builder .build-actions {
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
  }
  #route-builder .build-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }
  #route-builder .build-icon-btn svg {
    width: 22px;
    height: 22px;
  }
  #route-builder .build-title-line strong { font-size: 1rem; }
  #route-builder .build-date { font-size: .85rem; margin-top: 6px; }
  #route-builder .status-pill { font-size: .72rem; padding: 4px 10px; }
}
