/* JsxposedX Script Hub — design tokens follow the logo's blue → violet → orange gradient. */
:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #faf9fe;
  --ink: #1c1930;
  --ink-2: #47435f;
  --muted: #7a7692;
  --line: #e7e5f1;
  --line-strong: #d7d3e8;
  --primary: #6b4cf6;
  --primary-600: #5935e8;
  --primary-soft: #f0ecff;
  --primary-ring: #6b4cf633;
  --blue: #2f86ea;
  --blue-soft: #e8f2fe;
  --orange: #e9772c;
  --orange-soft: #fff1e6;
  --green: #15935a;
  --green-soft: #e6f7ee;
  --red: #dc3d43;
  --red-soft: #fff0f0;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --grad: linear-gradient(120deg, #4ea6f6 0%, #7b5cf6 52%, #f4994a 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px #1c19300a, 0 1px 1px #1c193006;
  --shadow: 0 10px 30px -12px #2a1f6a26, 0 2px 6px #1c19300a;
  --shadow-lg: 0 30px 80px -20px #2a1f6a40;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); display: flex; flex-direction: column; }
h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -.02em; }
code { font-family: var(--mono); font-size: .92em; }
a { color: var(--primary); }
::selection { background: #6b4cf633; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.shell { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.eyebrow { color: var(--primary); font-size: 11px; letter-spacing: .16em; font-weight: 800; margin: 0 0 8px; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Slowly drifting colour fields behind every page. */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .42; animation: drift 26s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: #4ea6f6; top: -22vmax; left: -14vmax; }
.aurora span:nth-child(2) { background: #8b6cf8; top: -24vmax; right: -16vmax; animation-duration: 32s; animation-delay: -8s; }
.aurora span:nth-child(3) { background: #f4994a; bottom: -34vmax; left: 30%; opacity: .2; animation-duration: 38s; animation-delay: -16s; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } 100% { transform: translate3d(-4vmax, 7vmax, 0) scale(.95); } }

/* ---------- Controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s var(--ease);
}
button svg, .button svg { width: 17px; height: 17px; flex: none; }
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.99); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.busy { cursor: progress; }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px #6b4cf699, inset 0 1px 0 #ffffff26; background-image: linear-gradient(180deg, #ffffff14, transparent); }
.primary:hover:not(:disabled) { background-color: var(--primary-600); box-shadow: 0 12px 24px -8px #6b4cf6aa, inset 0 1px 0 #ffffff26; transform: translateY(-1px); }
.secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.secondary:hover:not(:disabled) { border-color: #bfb8e4; color: var(--primary-600); background: var(--surface-2); }
.danger { background: var(--surface); color: var(--red); border-color: #f1c4c6; }
.danger:hover:not(:disabled) { background: var(--red-soft); }
.danger-solid { background: var(--red); color: #fff; }
.danger-solid:hover:not(:disabled) { background: #c3323a; }
.compact { min-height: 34px; padding: 0 12px; font-size: 13px; }
.full { width: 100%; }
.icon-button {
  width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 10px; flex: none;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.icon-button:hover { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.danger-icon:hover { background: var(--red-soft); color: var(--red); }
.link-button { min-height: 30px; padding: 0 10px; background: transparent; color: var(--primary); font-size: 13px; }
.link-button:hover { background: var(--primary-soft); }

label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: 0; font-weight: 400; font-size: 14px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #a8a5bd; }
input:hover, textarea:hover, select:hover { border-color: #c4bfdc; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px #dc3d4322; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--primary); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 46px; }
.password-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; min-height: 0; padding: 0; background: transparent; color: #8f8ba8; border-radius: 8px;
}
.password-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.password-toggle:active:not(:disabled) { transform: translateY(-50%); }
.form-error { color: var(--red); font-size: 13px; margin: 0; font-weight: 500; padding: 9px 12px; border-radius: 9px; background: var(--red-soft); border: 1px solid #f4cdd0; }
.form-error:empty { display: none; }
.field-error { color: var(--red); font-weight: 500; font-size: 12px; }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #f6f5fbc2; backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid #e7e5f1b0;
}
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 12px -4px #6b4cf666; transition: transform .4s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.05); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tabs { position: relative; display: flex; gap: 4px; padding: 4px; background: #ffffffb3; border: 1px solid var(--line); border-radius: 13px; }
.tab-indicator { position: absolute; top: 4px; left: 0; bottom: 4px; width: 0; border-radius: 9px; background: var(--surface); box-shadow: 0 2px 8px #2a1f6a1f, 0 0 0 1px #6b4cf61f; pointer-events: none; }
.tab { position: relative; z-index: 1; min-height: 36px; padding: 0 14px; background: transparent; color: var(--ink-2); border-radius: 9px; font-weight: 600; }
.tab svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.tab:hover { color: var(--primary); }
.tab:hover svg { transform: translateY(-1px) scale(1.1); }
.tab.active { color: var(--primary); }
.account-chip {
  margin-left: auto; min-height: 40px; padding: 0 14px 0 4px; gap: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 13px;
  max-width: 220px;
}
.account-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.account-chip:hover { border-color: #c9c2ea; box-shadow: var(--shadow-sm); }
.avatar {
  display: grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 700; text-transform: uppercase;
  width: 40px; height: 40px; font-size: 15px;
}
.avatar svg { width: 55%; height: 55%; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.xl { width: 80px; height: 80px; font-size: 32px; box-shadow: 0 12px 30px -10px #6b4cf680; }
.app-main { flex: 1; width: min(1200px, calc(100% - 40px)); }
.view { padding: 40px 0 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h1 { font-size: 32px; line-height: 1.2; margin: 0 0 6px; }
.section-head p:not(.eyebrow) { color: var(--muted); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid h2 { font-size: 17px; margin: 0; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 0 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f0f7; color: var(--ink-2); white-space: nowrap; justify-self: start; }
.badge.admin { background: var(--primary-soft); color: var(--primary-600); }

/* ---------- Toasts ---------- */
body[data-page="admin"] .toast-stack, body[data-page="install"] .toast-stack { top: 20px; }
.toast-stack { position: fixed; top: 82px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px 10px 13px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; color: var(--ink); transition: opacity .2s, transform .2s;
}
.toast > svg { width: 19px; height: 19px; flex: none; margin-top: 1px; color: var(--green); }
.toast.error > svg { color: var(--red); }
.toast > span { flex: 1; overflow-wrap: anywhere; }
.toast-close { min-height: 0; width: 24px; height: 24px; padding: 0; background: transparent; color: var(--muted); border-radius: 6px; }
.toast-close svg { width: 15px; height: 15px; }
.toast-close:hover { background: #f1f0f7; }
.toast.leaving { opacity: 0; transform: translateX(14px); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; gap: 40px; padding: 18px 0 60px; }
.hero-copy { min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 999px;
  background: #ffffffd9; border: 1px solid var(--line); color: var(--primary-600); font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green); opacity: 0; animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.hero h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.12; margin: 0 0 18px; font-weight: 800; letter-spacing: -.035em; }
.hero h1 .line { display: block; }
.lead { color: var(--ink-2); font-size: 16.5px; margin: 0 0 30px; max-width: 520px; opacity: .85; }
.search-bar {
  display: flex; gap: 8px; padding: 7px; max-width: 560px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); transition: box-shadow .25s, border-color .25s, transform .25s var(--ease);
}
.search-bar:focus-within { border-color: #c9c0f5; box-shadow: var(--shadow), 0 0 0 5px var(--primary-ring); transform: translateY(-2px); }
.search-input { flex: 1; flex-direction: row; align-items: center; gap: 0; position: relative; }
.search-input svg { position: absolute; left: 13px; width: 19px; height: 19px; color: #9b97b3; pointer-events: none; }
.search-input input { border: 0; box-shadow: none !important; padding-left: 42px; min-height: 46px; font-size: 15px; background: transparent; }
.search-bar .primary { min-height: 46px; padding: 0 26px; border-radius: 11px; }
.hero-stats { display: flex; gap: 34px; margin-top: 32px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats div + div { padding-left: 34px; border-left: 1px solid var(--line); }
.hero-stats strong { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stats span { color: var(--muted); font-size: 13px; }
.hero-art { position: relative; height: 430px; }
.float-card { position: absolute; border-radius: 18px; box-shadow: var(--shadow-lg); will-change: transform; }
.fc-code { top: 16px; right: 0; width: min(430px, 100%); background: #16122d; border: 1px solid #2c2650; rotate: 2deg; overflow: hidden; }
.fc-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #ffffff12; }
.fc-head span { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.fc-head span:nth-child(2) { background: #ffc94d; }
.fc-head span:nth-child(3) { background: #4ed38a; }
.fc-head small { margin-left: auto; color: #8d86bb; font: 12px var(--mono); }
.fc-code pre { margin: 0; padding: 18px 20px 24px; font: 13px/1.85 var(--mono); color: #ddd8ff; white-space: pre; overflow: hidden; }
.fc-code b { color: #8fc8ff; font-weight: 600; }
.fc-code em { color: #ffc68a; font-style: normal; }
.fc-code i { color: #c4a8ff; font-style: normal; }
.fc-code u { color: #7ee0d0; text-decoration: none; }
.fc-code strong { color: #6ee7b7; font-weight: 600; }
.fc-script { left: 0; bottom: 34px; width: 264px; padding: 18px; background: #fffffff2; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; rotate: -4deg; }
.fc-script > strong { font-size: 16px; }
.fc-script code { color: var(--primary-600); font-size: 12.5px; }
.fc-script .type-badge { align-self: flex-start; }
.fc-foot { display: flex; align-items: center; gap: 7px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fc-foot small { margin-left: auto; color: var(--muted); font-weight: 400; }
.fc-check { right: 26px; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); rotate: -1deg; }
.fc-check > svg { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.fc-check strong { display: block; font-size: 14px; }
.fc-check small { color: var(--muted); font: 12px var(--mono); }

/* ---------- Script list ---------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 18px; scroll-margin-top: 90px; }
.list-head h2 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: #ecebf4; border-radius: 12px; }
.segmented label { flex-direction: row; gap: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { padding: 6px 18px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background-color .2s, color .2s, box-shadow .2s; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #1c193018; }
.segmented input:focus-visible + span { outline: 3px solid var(--primary-ring); }
.script-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 26px; }
.script-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding: 20px;
  text-align: left; white-space: normal; font-weight: 400;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.script-card:hover { transform: translateY(-4px); border-color: #d2c9fa; box-shadow: var(--shadow); }
.script-card:active:not(:disabled) { transform: translateY(-1px); }
/* Cursor-following highlight; client.js sets --mx/--my. */
.spot { position: relative; isolation: isolate; overflow: hidden; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), #7b5cf61f, transparent 60%); }
.spot:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-size { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.script-card h3 { font-size: 16.5px; line-height: 1.35; margin: 0 0 6px; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.card-package { display: block; color: var(--primary-600); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 10px; }
.card-desc { color: var(--ink-2); font-size: 13.5px; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-desc.empty-desc { color: #a8a5bd; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13px; }
.card-author { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.card-author > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--primary-soft); color: var(--primary-600); white-space: nowrap; justify-self: start; }
.type-badge.frida { background: var(--orange-soft); color: #c45d17; }
.type-badge.xposed { background: var(--blue-soft); color: #1f6fcf; }
.skeleton { pointer-events: none; gap: 12px; }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, #f0eff6 25%, #f8f7fc 37%, #f0eff6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.sk-badge { width: 64px; height: 20px; border-radius: 999px; }
.sk-title { width: 70%; height: 20px; }
.sk-line { width: 100%; height: 13px; }
.sk-line.short { width: 55%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 56px 20px; background: #ffffffb3; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty strong { font-size: 16px; }
.empty p { margin: 0 0 12px; max-width: 420px; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); margin-bottom: 10px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty.compact { padding: 26px 16px; gap: 10px; }
.load-more { display: flex; margin: 0 auto; min-width: 160px; }

/* ---------- Publish ---------- */
.publish-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
#publish-form.disabled { opacity: .5; pointer-events: none; filter: grayscale(.4); }
.locked { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding: 20px 22px; border-color: #ddd4ff; background: linear-gradient(120deg, #f4f0ff, #ffffff); }
.locked .empty-icon { margin: 0; flex: none; }
.locked > div { flex: 1; }
.locked p { margin: 2px 0 0; }
.type-picker { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.type-picker legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 7px; float: left; width: 100%; }
.type-picker label { flex: 1; flex-direction: row; cursor: pointer; }
.type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.type-picker span {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-2); transition: all .2s;
}
.type-picker span svg { width: 16px; height: 16px; }
.type-picker input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-ring); }
.type-picker input:focus-visible + span { outline: 3px solid var(--primary-ring); }
.dropzone {
  flex-direction: row; align-items: center; gap: 16px; padding: 22px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); transition: all .2s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.dragging { transform: scale(1.01); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone:focus-within { box-shadow: 0 0 0 4px var(--primary-ring); border-color: var(--primary); }
.dropzone-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); flex: none; transition: transform .3s var(--ease); }
.dropzone:hover .dropzone-icon { transform: translateY(-3px) rotate(-4deg); }
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dropzone-text strong { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.dropzone-text small { color: var(--muted); font-weight: 400; }
.dropzone.has-file { border-style: solid; border-color: #b9e3cb; background: var(--green-soft); }
.dropzone.has-file .dropzone-icon { color: var(--green); }
.dropzone.invalid { border-color: #f1c4c6; background: var(--red-soft); }
.dropzone.invalid .dropzone-icon, .dropzone.invalid small { color: var(--red); }
.publish-side { position: sticky; top: 90px; display: grid; gap: 14px; }
.side-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.preview-card { pointer-events: none; box-shadow: var(--shadow); border-color: #ddd4ff; }
.tips { padding: 22px; }
.tips h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 12px; }
.tips h2 svg { width: 18px; height: 18px; color: var(--amber); }
.tips ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 9px; }
.tips code { background: #f1f0f7; padding: 1px 5px; border-radius: 5px; }

/* ---------- Account ---------- */
.account-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 50px 24px 24px; }
.profile-cover { position: absolute; inset: 0 0 auto; height: 90px; background: var(--grad); }
.profile-card .avatar.xl { position: relative; border: 4px solid var(--surface); margin-bottom: 8px; }
.profile-name { font-weight: 800; font-size: 19px; margin: 0; overflow-wrap: anywhere; }
.profile-card .muted { margin: 0 0 6px; }
.profile-card .full { margin-top: 18px; }
.account-forms { display: grid; gap: 20px; }

.auth-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr); min-height: 560px; max-width: 1000px; margin: 8px auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.auth-aside { position: relative; display: flex; flex-direction: column; gap: 30px; padding: 36px; color: #fff; overflow: hidden; background: #191433; }
.auth-aside::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(closest-side at 20% 30%, #4ea6f655, transparent), radial-gradient(closest-side at 70% 60%, #7b5cf670, transparent), radial-gradient(closest-side at 90% 10%, #f4994a40, transparent); animation: drift 22s ease-in-out infinite alternate; pointer-events: none; }
.auth-aside::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#ffffff0a 1px, transparent 1px), linear-gradient(90deg, #ffffff0a 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(160deg, #000, transparent 75%); -webkit-mask-image: linear-gradient(160deg, #000, transparent 75%); pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 40px; height: 40px; border-radius: 11px; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 16px; }
.auth-brand span { font-size: 11px; letter-spacing: .14em; opacity: .7; margin-top: 2px; }
.auth-pitch h2 { font-size: 28px; line-height: 1.25; margin: 0 0 18px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.auth-pitch li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: #e7e3ff; }
.auth-pitch li svg { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: #ffffff17; color: #c9bcff; flex: none; }
.auth-code { margin-top: auto; border: 1px solid #ffffff1f; border-radius: 12px; background: #0e0b22b3; overflow: hidden; box-shadow: 0 20px 50px #0007; }
.auth-code-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #ffffff14; }
.auth-code-head > span { width: 9px; height: 9px; border-radius: 50%; background: #ff6b6b; }
.auth-code-head > span:nth-child(2) { background: #ffc94d; }
.auth-code-head > span:nth-child(3) { background: #4ed38a; }
.auth-code-head small { margin-left: auto; font: 11px var(--mono); color: #a7a1cf; }
.auth-code pre { margin: 0; padding: 16px 18px; font: 12.5px/1.75 var(--mono); color: #ddd8ff; white-space: pre; overflow: hidden; }
.auth-code b { color: #8fc8ff; font-weight: 600; }
.auth-code em { color: #ffc68a; font-style: normal; }
.auth-code i { color: #c4a8ff; font-style: normal; }
.auth-code strong { color: #6ee7b7; font-weight: 600; }
.auth-shell { align-self: center; width: 100%; max-width: 440px; margin: 0 auto; padding: 40px; }
.auth-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 28px; background: #f1f0f7; border-radius: 12px; }
.auth-indicator { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--surface); box-shadow: 0 2px 8px #2a1f6a1f; transition: transform .4s var(--ease); }
.auth-switch.second .auth-indicator { transform: translateX(100%); }
.auth-tab { position: relative; z-index: 1; min-height: 38px; background: transparent; color: var(--muted); border-radius: 9px; }
.auth-tab.active { color: var(--ink); }
.auth-form { display: flex; flex-direction: column; gap: 17px; }
.auth-form h2, .auth-form h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
.auth-form .muted { margin: 0; font-size: 14px; }
.auth-form input { min-height: 48px; }
.auth-form .full { min-height: 48px; margin-top: 4px; font-size: 15px; }

/* ---------- Dialogs ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: #1c19304d; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.sheet {
  width: min(860px, calc(100% - 32px)); max-height: min(88vh, 900px); padding: 0; margin: auto;
  border: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden;
}
.sheet[open] { display: flex; }
.sheet-inner { display: flex; flex-direction: column; width: 100%; max-height: inherit; min-height: 0; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.sheet-title { min-width: 0; }
.sheet-title h2 { font-size: 22px; line-height: 1.3; margin: 10px 0 4px; overflow-wrap: anywhere; }
.sheet-title p { margin: 0; }
.sheet-body { padding: 22px 26px 26px; overflow: auto; overscroll-behavior: contain; }
.detail-description { color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 20px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0 0 20px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts div { background: var(--surface-2); padding: 12px 14px; min-width: 0; }
.facts div:last-child { grid-column: 1 / -1; }
.facts dt { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.facts dd { margin: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.facts dd.mono { font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.edit-form { display: grid; gap: 14px; margin-bottom: 20px; padding: 20px; box-shadow: none; background: var(--surface-2); }
.code-block { border-radius: 14px; overflow: hidden; background: #15122b; border: 1px solid #262145; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: #1d1938; color: #cfc9f5; font: 12.5px var(--mono); border-bottom: 1px solid #2a2550; }
.code-head .muted { color: #8d86bb; font-size: 12px; }
.code-head .secondary { background: #2a2550; border-color: #3a3470; color: #ddd8ff; }
.code-preview { margin: 0; padding: 16px 18px; max-height: 420px; overflow: auto; color: #e4e0ff; font: 12.5px/1.7 var(--mono); white-space: pre; tab-size: 2; }
.confirm-dialog { width: min(400px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.confirm-dialog form { padding: 26px; }
.confirm-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--red-soft); color: var(--red); margin-bottom: 16px; }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-dialog h2 { font-size: 18px; margin-bottom: 6px; }
.confirm-dialog p { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------- Admin: sign in ---------- */
.admin-login-screen { flex: 1; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 36px; background: #ffffffeb; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand img { border-radius: 12px; box-shadow: 0 8px 20px -8px #6b4cf699; }
.login-brand strong, .login-brand span { display: block; }
.login-brand span { font-size: 12px; color: var(--muted); }
.login-back { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.login-back:hover { color: var(--primary); }
.login-back svg { width: 15px; height: 15px; }

/* ---------- Admin: console ---------- */
.console { flex: 1; display: grid; grid-template-columns: 250px minmax(0, 1fr); width: 100%; min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 22px 16px; background: #ffffffc2; border-right: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.sidebar .brand { padding: 0 8px; }
.side-nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
.side-indicator { position: absolute; top: 0; left: 0; width: 0; height: 0; border-radius: 11px; background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); pointer-events: none; }
.side-link { position: relative; z-index: 1; display: flex; align-items: center; font-size: 14px; justify-content: flex-start; gap: 11px; width: 100%; min-height: 42px; padding: 0 14px; background: transparent; color: var(--ink-2); border-radius: 11px; font-weight: 600; text-decoration: none; }
.side-link svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.side-link:hover { color: var(--primary); }
.side-link:hover svg { transform: scale(1.1); }
.side-nav .side-link.active { color: var(--primary-600); }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-foot .side-link:hover { background: #f6f4ff; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; min-width: 0; }
.side-user > span:last-child { min-width: 0; }
.side-user strong, .side-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--muted); font-size: 12px; }
.console-main { min-width: 0; padding: 30px 36px 56px; }
.console-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.console-head h1 { font-size: 28px; margin: 0; }
.console-section { display: grid; gap: 20px; }
.console-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.console-grid.wide-left { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow-sm); min-width: 0; transition: transform .3s var(--ease), box-shadow .3s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-icon svg { width: 17px; height: 17px; }
.stat.orange .stat-icon { background: var(--orange-soft); color: var(--orange); }
.stat.blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat.green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat strong { display: block; font-size: 30px; line-height: 1.2; margin-top: 12px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 3px; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--primary); }
.card-head p { margin: 0; }
.split-bar { display: flex; gap: 4px; height: 14px; border-radius: 999px; overflow: hidden; background: #eeedf5; }
.split-bar .seg { flex: 1 1 0; min-width: 0; border-radius: 999px; }
.split-bar .seg.frida { background: linear-gradient(90deg, #f4994a, #f07a3a); }
.split-bar .seg.xposed { background: linear-gradient(90deg, #4ea6f6, #6b4cf6); }
.split-bar.empty-bar .seg { background: #e4e2ef; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.legend-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.legend-item .dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-item.frida .dot { background: var(--orange); }
.legend-item.xposed .dot { background: var(--blue); }
.legend-item strong { font-size: 18px; grid-row: span 2; grid-column: 3; }
.legend-item small { grid-column: 2; }
.latest-release { display: grid; gap: 14px; }
.release-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.release-head > div { min-width: 0; }
.release-head .muted { display: block; }
.release-version { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.release-notes { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; white-space: pre-wrap; max-height: 160px; overflow: auto; }
.progress { height: 8px; border-radius: 999px; background: #eeedf5; overflow: hidden; }
.progress-bar { height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); transition: transform .2s; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .2s, background-color .2s, transform .25s var(--ease); }
.admin-row:hover { border-color: #ddd4ff; background: #fbfaff; transform: translateX(2px); }
.cell-main { flex: 1; min-width: 0; }
.cell-main.with-avatar { display: flex; align-items: center; gap: 11px; }
.cell-main.with-avatar > div { min-width: 0; }
.cell-main strong, .cell-main span:not(.avatar) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main span:not(.avatar) { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.cell-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sha { font-size: 12px; color: var(--muted); background: #f1f0f7; padding: 3px 7px; border-radius: 6px; justify-self: start; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select { width: 150px; min-height: 40px; }
.toolbar .secondary { min-height: 40px; }
.mini-search { position: relative; flex: 1; min-width: 200px; }
.mini-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #9b97b3; }
.mini-search input { min-height: 40px; padding-left: 36px; }
.table-head, .table-row { display: grid; align-items: center; gap: 14px; padding-inline: 14px; }
.table-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.table-row { padding-block: 12px; border-bottom: 1px solid var(--line); transition: background-color .2s; overflow: hidden; }
.table-row:hover { background: var(--surface-2); }
.table-body { margin-bottom: 16px; }
.table-body .empty { margin-top: 16px; }
.scripts-cols { grid-template-columns: minmax(0, 2.4fr) 90px minmax(0, 1fr) 100px 40px; }
.users-cols { grid-template-columns: minmax(0, 2fr) 90px 70px 110px; }
.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding-bottom: 18px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline-dot { width: 22px; height: 22px; border-radius: 50%; border: 4px solid var(--surface); background: #d7d3e8; box-shadow: 0 0 0 1px var(--line); }
.timeline-item.current .timeline-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.timeline-body { display: grid; gap: 4px; min-width: 0; }
.timeline-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline-title strong { font-size: 15px; }

/* ---------- Installer ---------- */
.install-wrap { flex: 1; display: grid; place-items: center; padding: 40px 20px; }
.install-card { display: grid; grid-template-columns: 280px minmax(0, 1fr); width: min(1000px, 100%); min-height: 600px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; }
.install-rail { position: relative; display: flex; flex-direction: column; gap: 36px; padding: 32px 26px; background: #191433; color: #fff; overflow: hidden; }
.install-rail::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(closest-side at 20% 20%, #4ea6f640, transparent), radial-gradient(closest-side at 80% 70%, #7b5cf666, transparent), radial-gradient(closest-side at 30% 100%, #f4994a33, transparent); animation: drift 22s ease-in-out infinite alternate; pointer-events: none; }
.install-rail > * { position: relative; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps li { position: relative; display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 12px; color: #b5afd9; transition: background-color .25s, color .25s; }
.steps li strong { display: block; font-size: 14px; color: inherit; }
.steps li small { display: block; font-size: 12px; opacity: .75; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 28px; top: 44px; height: 14px; width: 2px; background: #ffffff1f; border-radius: 2px; }
.step-dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #ffffff38; font-size: 13px; font-weight: 700; flex: none; transition: background-color .25s, border-color .25s, color .25s, box-shadow .25s; }
.steps li.active { background: #ffffff14; color: #fff; }
.steps li.active .step-dot { background: #fff; color: var(--primary-600); border-color: #fff; box-shadow: 0 0 0 5px #ffffff1f; }
.steps li.done { color: #e3defc; }
.steps li.done .step-dot { background: #6ee7b7; border-color: #6ee7b7; color: #0f3d2a; font-size: 0; }
.steps li.done .step-dot::before { content: "✓"; font-size: 14px; }
.rail-foot { margin: auto 0 0; font-size: 12px; color: #a7a1cf; line-height: 1.6; }
.rail-foot code { color: #ddd8ff; }
.install-body { padding: 40px 44px; display: flex; flex-direction: column; min-width: 0; }
.install-step { display: flex; flex-direction: column; gap: 22px; flex: 1; }
.install-step header h1 { font-size: 26px; margin: 0 0 6px; }
.install-step header p { margin: 0; font-size: 14px; }
.install-step header code { background: #f1f0f7; padding: 1px 6px; border-radius: 6px; }
.install-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); }
.install-actions .primary { margin-left: auto; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.check > span:nth-child(2) { flex: 1; min-width: 0; }
.check strong { display: block; font-size: 14px; }
.check small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.check-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; background: #eeedf5; color: var(--muted); }
.check-icon svg { width: 15px; height: 15px; stroke-width: 3; }
.check.ok .check-icon { background: var(--green-soft); color: var(--green); }
.check.fail { border-color: #f4cdd0; background: var(--red-soft); }
.check.fail .check-icon { background: #fde0e1; color: var(--red); }
.check.warn .check-icon { background: var(--amber-soft); color: var(--amber); }
.check.loading .check-icon { border: 2px solid #dcd8ee; border-top-color: var(--primary); background: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eeedf5; color: var(--muted); }
.check.ok .check-tag { background: var(--green-soft); color: var(--green); }
.check.fail .check-tag { background: #fde0e1; color: var(--red); }
.check.warn .check-tag { background: var(--amber-soft); color: var(--amber); }
.advanced { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; background: var(--surface-2); }
.advanced summary { cursor: pointer; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.advanced[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.advanced .form-grid { padding-bottom: 16px; }
label.checkbox { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
label.checkbox input { width: 17px; height: 17px; }
.callout { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; background: var(--primary-soft); color: var(--primary-600); border: 1px solid #ddd4ff; overflow-wrap: anywhere; }
.callout.ok { background: var(--green-soft); color: #0f6d42; border-color: #bfe8d2; }
.callout.error { background: var(--red-soft); color: #b3262d; border-color: #f4cdd0; }
.callout.warn { background: var(--amber-soft); color: #8a5a10; border-color: #f4dfb5; }
.callout code { font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; margin-top: 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.strength { height: 5px; border-radius: 999px; background: #eeedf5; overflow: hidden; margin-top: -6px; }
.strength span { display: block; height: 100%; transform: scaleX(0); transform-origin: left; transition: transform .25s, background-color .25s; background: var(--red); }
.strength span[data-level="fair"] { background: var(--amber); }
.strength span[data-level="strong"] { background: var(--green); }
.done-hero { text-align: center; padding: 16px 0 4px; }
.done-hero h1 { font-size: 30px; margin: 0 0 6px; }
.done-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--grad); color: #fff; margin-bottom: 18px; box-shadow: 0 18px 40px -14px #6b4cf6aa; }
.done-icon svg { width: 34px; height: 34px; }
#manual-config { display: grid; gap: 12px; }
#manual-config.hidden { display: none !important; }
.next-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.next-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.next-steps svg { width: 18px; height: 18px; color: var(--primary); flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .console-grid, .console-grid.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 36px; }
  .hero-art { display: none; }
  .console { grid-template-columns: 1fr; min-height: 0; }
  .sidebar { z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar .brand-text { display: none; }
  .side-nav { flex-direction: row; }
  .side-indicator { box-shadow: inset 0 -3px 0 var(--primary); }
  .side-link { width: auto; padding: 0 12px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; }
  .side-user, .side-foot .side-link span { display: none; }
  .console-main { padding: 22px 18px 48px; }
}
@media (max-width: 900px) {
  .publish-layout, .account-grid { grid-template-columns: 1fr; }
  .publish-side { position: static; }
  .auth-stage { grid-template-columns: 1fr; max-width: 520px; min-height: 0; }
  .auth-aside { padding: 26px; gap: 18px; }
  .auth-pitch ul, .auth-code { display: none; }
  .auth-pitch h2 { font-size: 22px; margin: 0; }
  .auth-shell { padding: 30px 28px 34px; }
  .install-card { grid-template-columns: 1fr; min-height: 0; }
  .install-rail { padding: 22px; gap: 18px; }
  .steps { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .steps li { flex-direction: column; text-align: center; gap: 6px; padding: 8px 4px; }
  .steps li small, .steps li::after, .rail-foot { display: none !important; }
  .steps li strong { font-size: 12px; }
  .install-body { padding: 28px 24px; }
}
@media (max-width: 740px) {
  .shell, .app-main { width: calc(100% - 28px); }
  .topbar-inner { min-height: 60px; gap: 12px; }
  .brand img { width: 32px; height: 32px; }
  /* The community navigation becomes an app-style bottom bar. */
  body[data-page="community"] { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  /* backdrop-filter would make the header the containing block of the fixed bottom bar. */
  body[data-page="community"] .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #f6f5fbf5; }
  body[data-page="community"] .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-radius: 0; border: 0; border-top: 1px solid var(--line);
    background: #ffffffeb; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  body[data-page="community"] .tab-indicator { display: none; }
  body[data-page="community"] .tab { flex: 1; flex-direction: column; gap: 3px; min-height: 52px; padding: 0; font-size: 11px; }
  body[data-page="community"] .tab svg { width: 21px; height: 21px; }
  .account-chip { padding-right: 4px; }
  .account-chip > span:last-child { display: none; }
  .view { padding: 26px 0 48px; }
  .hero { padding: 8px 0 28px; gap: 0; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 15px; margin-bottom: 22px; }
  .hero-stats { gap: 18px; margin-top: 22px; }
  .hero-stats div + div { padding-left: 18px; }
  .hero-stats strong { font-size: 22px; }
  .search-bar .primary { padding: 0 16px; }
  .list-head { flex-direction: column; align-items: flex-start; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head h1 { font-size: 25px; }
  .locked { flex-direction: column; text-align: center; }
  .script-list { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .sheet { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .sheet-head { padding: 20px 18px 14px; }
  .sheet-body { padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:first-child { grid-column: 1 / -1; }
  .detail-actions > button { flex: 1 1 calc(50% - 10px); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 24px; }
  .console-head h1 { font-size: 23px; }
  .scripts-cols { grid-template-columns: minmax(0, 1fr) auto 38px; }
  .scripts-cols > :nth-child(3), .scripts-cols > :nth-child(4) { display: none; }
  .users-cols { grid-template-columns: minmax(0, 1fr) auto auto; }
  .users-cols > :nth-child(4) { display: none; }
  .toast-stack { top: 70px; right: 14px; }
  .install-wrap { padding: 14px; }
  .install-body { padding: 24px 18px; }
  .install-actions { flex-wrap: wrap; }
  .install-actions > * { flex: 1; }
  .footer { padding-bottom: 20px; }
}
@media (max-width: 420px) {
  .auth-shell { padding: 24px 18px 28px; }
  .steps li strong { font-size: 11px; }
  .hero-stats span { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .script-card:hover, .stat:hover, .admin-row:hover { transform: none; }
}
