:root {
  --ink: #1a2332;
  --muted: #5a6a7e;
  --line: rgba(26, 35, 50, 0.12);
  --surface: rgba(255, 255, 255, 0.22);
  --accent: #0d7a6f;
  --accent-deep: #085a52;
  --accent-soft: rgba(13, 122, 111, 0.12);
  --glow: rgba(13, 122, 111, 0.18);
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #0f766e;
  --code: #0b3d38;
  --input-shell: #eef1f4;
  --input-border: #d5dbe3;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(26, 35, 50, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 56px;
  --wrap: min(520px, calc(100% - 2rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.55;
  background: url("cleaned.png") center / cover no-repeat fixed;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(247, 248, 250, 0.28);
}

.page-bg {
  display: none;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  background: rgba(255, 255, 255, 0.30);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.nav.is-scrolled {
  border-bottom-color: rgba(26, 35, 50, 0.08);
  background: rgba(255, 255, 255, 0.30);
}

.nav-inner {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-count {
  margin: 0;
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.avatar-btn {
  appearance: none;
  border: 2px solid rgba(13, 122, 111, 0.25);
  background: #fff;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.avatar-btn:hover,
.avatar-btn.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.avatar-btn:active {
  transform: scale(0.96);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 700;
}

.user-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 10.5rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.15rem;
  z-index: 40;
  animation: rise 0.2s ease-out both;
}

.user-menu-item {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.user-menu-danger {
  color: var(--danger);
}

.user-menu-danger:hover {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
}

.account-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  min-height: 0;
  box-shadow: 0 24px 60px rgba(26, 35, 50, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.account-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.2rem;
  background: linear-gradient(180deg, rgba(13, 122, 111, 0.1), rgba(255, 255, 255, 0.35));
  border-right: 1px solid rgba(26, 35, 50, 0.08);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.account-sidebar-head {
  display: grid;
  gap: 1.15rem;
  flex-shrink: 0;
}

.account-brand-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.account-home-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 122, 111, 0.18);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.account-home-btn:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.account-home-btn:active {
  transform: scale(0.96);
}

.account-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-avatar-btn {
  position: relative;
  appearance: none;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 0;
}

.account-avatar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.account-avatar,
.account-avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-avatar {
  object-fit: cover;
  border: 2px solid rgba(13, 122, 111, 0.28);
  box-shadow: 0 8px 20px rgba(13, 122, 111, 0.16);
  display: block;
}

.account-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}

.account-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent-deep);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(13, 122, 111, 0.28);
  pointer-events: none;
}

.account-avatar-btn:hover .account-avatar,
.account-avatar-btn:hover .account-avatar-fallback {
  filter: brightness(0.92);
}

.account-meta {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.account-name {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.account-email {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-all;
  line-height: 1.35;
}

.account-role-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.15rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(13, 122, 111, 0.14);
  color: var(--accent-deep);
}

.account-role-badge.is-admin {
  background: rgba(17, 24, 39, 0.12);
  color: #111827;
}

.account-nav {
  display: grid;
  gap: 0.32rem;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.account-nav-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.account-nav-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: block;
  opacity: 0.85;
}

.account-nav-item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.account-nav-item.is-active {
  background: #fff;
  color: var(--accent-deep);
  box-shadow: 0 6px 16px rgba(13, 122, 111, 0.1);
}

.account-main {
  padding: 1.6rem 1.6rem 1.7rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.28);
}

.account-panel-view:not([hidden]):not(.is-hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  gap: 1rem;
}

.account-panel-head {
  margin-bottom: 0;
  flex-shrink: 0;
}

.account-panel-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.account-panel-head p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.account-ok {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.1);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.account-stat-card {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(26, 35, 50, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.84));
  box-shadow: 0 10px 24px rgba(26, 35, 50, 0.05);
}

.account-stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.account-stat-value {
  margin: 0.4rem 0 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.account-stat-role {
  font-size: 1.15rem;
}

.account-info-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.account-info-list > div {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(26, 35, 50, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.account-info-list dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-info-list dd {
  margin: 0.3rem 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  word-break: break-all;
}

.account-email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.account-copy-btn {
  appearance: none;
  border: 1px solid rgba(13, 122, 111, 0.22);
  background: rgba(13, 122, 111, 0.08);
  color: var(--accent-deep);
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.account-copy-btn:hover {
  background: rgba(13, 122, 111, 0.14);
}

.account-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
}

.account-tip-card {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(26, 35, 50, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.account-tip-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.account-tip-secure {
  background: linear-gradient(180deg, rgba(255, 250, 235, 0.92), rgba(255, 255, 255, 0.82));
  margin-top: auto;
}

.account-tip-list {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.account-form {
  max-width: 420px;
  display: grid;
  gap: 0.85rem;
}

.account-form .btn {
  width: fit-content;
  min-width: 8rem;
}

.history-list {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 122, 111, 0.35) transparent;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(13, 122, 111, 0.28);
  border-radius: 999px;
}

.history-empty {
  margin: 0;
  padding: 0.85rem 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.history-item {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(26, 35, 50, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.78));
  display: grid;
  gap: 0.4rem;
  box-shadow: 0 8px 18px rgba(26, 35, 50, 0.04);
}

.history-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-status {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.history-item.is-error .history-status {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

.history-item.is-expired .history-status {
  background: rgba(90, 106, 126, 0.12);
  color: var(--muted);
}

.history-meta,
.history-error,
.history-expired {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.history-error {
  color: var(--danger);
}

.history-download {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  width: fit-content;
}

.history-download:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

body.account-page .wrap.account-wrap {
  width: min(1080px, calc(100% - 2rem));
  justify-content: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: calc(100vh - var(--nav-h));
  max-height: calc(100vh - var(--nav-h));
  overflow: hidden;
  box-sizing: border-box;
}

body.account-page .account-shell.panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  flex: 1 1 auto;
  height: auto;
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.nav-profile {
  display: none;
}

@media (max-width: 760px) {
  body.account-page .wrap.account-wrap {
    max-height: none;
    overflow: visible;
  }

  body.account-page .account-shell.panel,
  .account-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: auto;
    max-height: none;
  }

  .account-sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .account-nav-item {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.58rem 0.7rem;
  }

  .account-main {
    padding: 1.25rem 1.15rem 1.4rem;
    height: auto;
    overflow: visible;
  }

  .account-panel-view:not([hidden]):not(.is-hidden) {
    overflow: visible;
  }

  .account-stats,
  .account-info-list {
    grid-template-columns: 1fr;
  }

  .history-list {
    flex: none;
    max-height: min(60vh, 520px);
  }
}

.wrap {
  position: relative;
  z-index: 1;
  width: var(--wrap);
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 3rem;
  animation: rise 0.7s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-block {
  margin-bottom: 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}

.brand-sub {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 18px 48px rgba(26, 35, 50, 0.08);
}

.account-shell.panel {
  box-shadow: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.panel-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(26, 35, 50, 0.06);
  color: var(--muted);
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status.idle {
  color: var(--muted);
}

.status.running {
  color: var(--accent);
  background: var(--accent-soft);
}

.status.done {
  color: var(--ok);
  background: rgba(15, 118, 110, 0.12);
}

.status.error {
  color: var(--danger);
  background: rgba(185, 28, 28, 0.1);
}

.uploader {
  display: grid;
  gap: 1.1rem;
}

.field,
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field > span,
.auth-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field em,
.auth-field em {
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.35rem;
  color: #8b97a8;
}

.field input,
.auth-field input,
.input-shell input {
  width: 100%;
  border: 1px solid var(--input-border);
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#cfxKey {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.field input:focus,
.auth-field input:focus {
  border-color: rgba(13, 122, 111, 0.45);
  box-shadow: 0 0 0 3px var(--glow);
}

.field input::placeholder,
.auth-field input::placeholder {
  color: #9aa8b8;
  font-family: var(--font-body);
}

.field-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.field-check > span {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  line-height: 1.45;
}

.field-check input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.12rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.dropzone {
  position: relative;
  border: 1.5px dashed rgba(13, 122, 111, 0.35);
  border-radius: 14px;
  background: rgba(238, 241, 244, 0.65);
  padding: 1.35rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(13, 122, 111, 0.08);
  box-shadow: 0 0 0 3px var(--glow);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(13, 122, 111, 0.28);
  background: rgba(255, 255, 255, 0.55);
}

.dropzone-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.dropzone-hint {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.dropzone-file {
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--code);
  word-break: break-all;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.upload-progress {
  display: grid;
  gap: 0.45rem;
}

.upload-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-progress-meta span {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 122, 111, 0.12);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width 0.15s linear;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.65rem 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.btn-ghost {
  background: #fff;
  border-color: var(--input-border);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(13, 122, 111, 0.4);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.btn-nav {
  min-height: 2.15rem;
  height: 2.15rem;
  padding: 0 0.9rem;
  font-size: 0.82rem;
}

.btn-lg {
  min-height: 2.7rem;
  width: 100%;
  font-size: 0.92rem;
}

.auth-gate-hint,
.job-message {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
}

.auth-gate-hint {
  color: var(--muted);
}

.job-message.is-error {
  color: var(--danger);
}

.job-message.is-ok {
  color: var(--ok);
}

.job-message.is-warn {
  color: var(--warn);
}

.output-line {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.output-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.uploader.is-locked .field input,
.uploader.is-locked .form-actions,
.uploader.is-locked .dropzone {
  pointer-events: none;
  opacity: 0.72;
}

.dropzone.is-locked {
  pointer-events: none;
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

body.auth-page .wrap {
  min-height: 100vh;
}

.auth-panel-head {
  margin-bottom: 1.25rem;
}

.auth-panel-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

.auth-panel-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.auth-error {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--danger);
}

.auth-switch {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.auth-back {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.auth-back:hover {
  color: var(--ink);
}

[hidden],
.is-hidden {
  display: none !important;
}

.btn.btn-nav[hidden],
a.btn[hidden],
button.btn[hidden],
.nav-actions[hidden],
.nav-actions.is-hidden,
.nav-menu-wrap[hidden],
.nav-menu-wrap.is-hidden,
.user-menu[hidden],
.user-menu.is-hidden,
.avatar-img[hidden],
.avatar-img.is-hidden,
.avatar-fallback[hidden],
.avatar-fallback.is-hidden,
.account-avatar[hidden],
.account-avatar-fallback[hidden],
.avatar-modal-preview[hidden],
.avatar-modal-preview-fallback[hidden],
.output-line[hidden],
.output-line.is-hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .nav-user-count {
    font-size: 0.7rem;
  }

  .nav-profile span {
    max-width: 5.5rem;
  }
}

.nav-inner-wide {
  width: min(1280px, calc(100% - 2rem));
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.nav-link.is-active {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.wrap-wide {
  --wrap: min(1280px, calc(100% - 2rem));
  width: var(--wrap);
}

.brand-block-wide {
  text-align: left;
}

.lua-cleanup-page .wrap-wide {
  --wrap: min(1520px, calc(100% - 1.25rem));
  padding-bottom: 1rem;
  padding-top: 0.75rem;
}

.lua-cleanup-panel {
  padding: 1rem;
}

.lua-tool-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  width: fit-content;
}

.lua-tool-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lua-tool-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.lua-tool-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.lua-tool-tab.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 122, 111, 0.12);
}

.btn-stop {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.btn-stop:hover:not(:disabled) {
  background: #a93226;
  border-color: #a93226;
}

.job-message.is-warn {
  color: #9a6700;
}

.lua-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
}

.lua-tab-pane[hidden] {
  display: none !important;
}

.lua-cleanup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: calc(100vh - var(--nav-h) - 2.5rem);
  max-height: calc(100vh - var(--nav-h) - 2.5rem);
}

.lua-pane {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
}

.lua-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lua-file-name {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropzone-compact {
  min-height: 72px;
  padding: 0.75rem 1rem;
}

.lua-editor {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  overflow: auto;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.95rem 1.05rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--code);
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 122, 111, 0.45) rgba(13, 122, 111, 0.08);
}

.lua-editor::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  display: block;
}

.lua-editor::-webkit-scrollbar-track {
  background: rgba(13, 122, 111, 0.08);
  border-radius: 999px;
  margin: 4px 0;
}

.lua-editor::-webkit-scrollbar-thumb {
  background: rgba(13, 122, 111, 0.38);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.lua-editor::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 122, 111, 0.58);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.lua-editor:focus {
  outline: 2px solid var(--glow);
  border-color: var(--accent);
}

.lua-actions-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.lua-actions-card select {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

.lua-status {
  margin: 0;
  align-self: center;
}

.lua-output-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .lua-cleanup-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
  }

  .lua-actions-card {
    order: 2;
  }

  .lua-pane-output {
    order: 3;
  }

  .lua-editor {
    min-height: 360px;
    resize: vertical;
  }

  .nav-links {
    display: none;
  }
}

.corner-widget {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 70;
  width: max-content;
  max-width: calc(100vw - 2rem);
}

.corner-widget-actions {
  position: relative;
  display: grid;
  gap: 0.45rem;
  width: max-content;
}

.corner-pill-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 35, 50, 0.12);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(26, 35, 50, 0.1);
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.corner-pill-btn:hover {
  background: #f7f9fb;
  border-color: rgba(26, 35, 50, 0.18);
  box-shadow: 0 12px 30px rgba(26, 35, 50, 0.12);
}

.corner-pill-btn:active {
  transform: scale(0.98);
}

.corner-pill-btn.is-open .corner-pill-chevron {
  transform: rotate(180deg);
}

.corner-pill-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  overflow: hidden;
  background: #eef1f4;
  flex: 0 0 auto;
  line-height: 0;
}

.corner-pill-flag-img,
.locale-option-flag-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.locale-option-flag-img {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
}

.corner-pill-label {
  flex: 0 1 auto;
  text-align: left;
  white-space: nowrap;
}

.corner-pill-chevron,
.corner-pill-icon {
  flex: 0 0 auto;
  opacity: 0.72;
  color: var(--muted);
}

.corner-pill-chevron {
  transition: transform 0.2s;
}

.locale-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.55rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: min(280px, calc(100vw - 2rem));
  max-height: min(56vh, 380px);
  padding: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(26, 35, 50, 0.1);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(26, 35, 50, 0.14);
  overflow: hidden;
}

.locale-menu[hidden],
.locale-menu.is-hidden {
  display: none !important;
}

.locale-menu-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.2rem 0.35rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}

.locale-menu-icon {
  color: var(--accent);
  flex: 0 0 auto;
}

.locale-options {
  display: grid;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
}

.locale-option {
  appearance: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.locale-option:hover {
  background: rgba(13, 122, 111, 0.08);
}

.locale-option.is-active {
  background: rgba(13, 122, 111, 0.12);
  box-shadow: inset 2px 0 0 var(--accent);
}

.locale-option-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.locale-option-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.locale-option-region {
  font-size: 0.72rem;
  color: var(--muted);
}

.locale-option-check {
  width: 1rem;
  text-align: center;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .corner-widget {
    left: 0.75rem;
    bottom: 0.75rem;
  }

  body {
    padding-bottom: 5.5rem;
  }
}

/* Welcome gate */
.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: url("cleaned.png") center / cover no-repeat fixed;
}

.welcome-gate[hidden],
.welcome-gate.is-hidden {
  display: none !important;
}

.welcome-gate-inner {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  text-align: center;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  font-style: italic;
  color: #111;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.65);
}

.welcome-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.65rem;
  font-weight: 700;
  color: #111;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.65);
}

.welcome-subtitle {
  margin: 0 0 0.5rem;
  color: rgba(17, 17, 17, 0.72);
  font-size: 0.95rem;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.55);
}

.welcome-btn {
  appearance: none;
  width: 100%;
  min-height: 3.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  color: #111;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 24px rgba(0, 0, 0, 0.14),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.welcome-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 12px 30px rgba(0, 0, 0, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.welcome-btn:active {
  transform: scale(0.98);
}

.welcome-btn-primary {
  color: #fff;
  background: rgba(20, 24, 30, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.welcome-btn-primary:hover {
  color: #fff;
  background: rgba(20, 24, 30, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 32px rgba(0, 0, 0, 0.24),
    0 2px 6px rgba(0, 0, 0, 0.12);
}

.welcome-btn-secondary,
.welcome-btn-ghost {
  background: rgba(255, 255, 255, 0.58);
}

.welcome-btn-secondary:hover,
.welcome-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.72);
}

body.welcome-locked .nav,
body.welcome-locked #app {
  visibility: hidden;
  pointer-events: none;
}

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  pointer-events: none;
}

.boot-splash-inner {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.boot-splash-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 14px;
  background: #111;
  color: #fff;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.55rem;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.22);
}

.boot-splash-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Avatar upload modal */
.avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.avatar-modal[hidden],
.avatar-modal.is-hidden {
  display: none !important;
}

.avatar-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.avatar-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.45rem 1.35rem 1.3rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px rgba(26, 35, 50, 0.22);
  display: grid;
  gap: 0.9rem;
}

.avatar-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(26, 35, 50, 0.06);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.avatar-modal-close:hover {
  background: rgba(26, 35, 50, 0.1);
}

.avatar-modal-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  padding-right: 2rem;
}

.avatar-modal-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.avatar-modal-preview-wrap {
  display: grid;
  place-items: center;
  margin: 0.15rem 0 0.2rem;
}

.avatar-modal-preview,
.avatar-modal-preview-fallback {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}

.avatar-modal-preview {
  object-fit: cover;
  border: 3px solid rgba(13, 122, 111, 0.25);
  box-shadow: 0 10px 24px rgba(13, 122, 111, 0.16);
  display: block;
}

.avatar-modal-preview-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
}

.avatar-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.2rem;
}

.avatar-modal-actions .btn {
  min-width: 6.5rem;
}

/* Auth solo modal (login / register) */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: url("cleaned.png") center / cover no-repeat fixed;
}

.auth-modal[hidden],
.auth-modal.is-hidden {
  display: none !important;
}

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #111;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.1);
}

.auth-solo-card {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92vh, 820px);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.auth-solo-glass {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 22px;
  border: 1px solid rgba(26, 35, 50, 0.12);
  background-color: transparent;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
    url("cleaned.png");
  background-position: center center, center center;
  background-size: auto, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: scroll, fixed;
  box-shadow:
    0 18px 40px rgba(26, 35, 50, 0.18),
    0 6px 14px rgba(26, 35, 50, 0.1);
}

.auth-solo-body {
  position: relative;
  z-index: 1;
  padding: 2rem 1.75rem 1.6rem;
  max-height: min(92vh, 820px);
  overflow: auto;
}

.auth-solo-card[hidden] {
  display: none !important;
}

.auth-solo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-solo-mark {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.auth-solo-card h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  font-weight: 700;
  color: #111;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-modal-sub {
  margin: 0.45rem 0 1.35rem;
  color: #4b5563;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-modal-form {
  display: grid;
  gap: 0.95rem;
}

.auth-solo-card .auth-field span {
  color: #111;
  font-weight: 700;
  font-size: 0.86rem;
}

.auth-solo-card .auth-field input {
  min-height: 2.75rem;
  border-radius: 12px;
  border: 1px solid rgba(26, 35, 50, 0.16);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.7rem 0.9rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(26, 35, 50, 0.05);
}

.auth-solo-card .auth-field input:focus {
  outline: none;
  border-color: rgba(26, 35, 50, 0.35);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 0 3px rgba(26, 35, 50, 0.1);
}

.auth-solo-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: #4b5563;
  font-weight: 500;
}

.auth-solo-switch {
  appearance: none;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.auth-solo-switch:hover {
  text-decoration: underline;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: stretch;
}

.auth-code-row input {
  min-width: 0;
}

.auth-solo-options {
  display: flex;
  justify-content: flex-end;
  margin: -0.25rem 0 0.15rem;
}

.btn-auth-code {
  appearance: none;
  border: 0;
  background: #0d7a6f;
  color: #fff;
  border-radius: 12px;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(13, 122, 111, 0.28);
}

.btn-auth-code:hover:not(:disabled) {
  background: #0a635b;
}

.btn-auth-code:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-error.auth-hint {
  color: #0f766e;
}

.btn-auth-dark {
  border: 0;
  background: #1a2332;
  color: #fff;
  border-radius: 14px;
  min-height: 2.95rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(26, 35, 50, 0.28),
    0 2px 6px rgba(26, 35, 50, 0.16);
}

.btn-auth-dark:hover:not(:disabled) {
  background: #111827;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 28px rgba(26, 35, 50, 0.32),
    0 3px 8px rgba(26, 35, 50, 0.18);
}

.admin-login-modal .admin-login-card {
  width: min(420px, 100%);
  padding: 1.75rem 1.6rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 251, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.admin-login-card h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
}

.sponsor-pay-type {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.sponsor-type-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.sponsor-type-btn.is-active {
  color: var(--accent-deep);
  border-color: rgba(13, 122, 111, 0.28);
  background: rgba(13, 122, 111, 0.1);
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.sponsor-card {
  display: grid;
  gap: 0.55rem;
  padding: 1.1rem 1rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(26, 35, 50, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
  box-shadow: 0 10px 24px rgba(26, 35, 50, 0.05);
}

.sponsor-card-feature {
  border-color: rgba(13, 122, 111, 0.22);
  background: linear-gradient(180deg, rgba(236, 250, 247, 0.95), rgba(255, 255, 255, 0.92));
}

.sponsor-card-tag {
  margin: 0;
  width: fit-content;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: rgba(13, 122, 111, 0.12);
}

.sponsor-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.sponsor-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  min-height: 2.6em;
}

.sponsor-card-price {
  margin: 0.15rem 0 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
}

.sponsor-card-price span {
  font-size: 0.95rem;
  margin-right: 0.1rem;
}

.sponsor-unlocked {
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 700;
}

.sponsor-pay-btn {
  width: 100%;
  margin-top: 0.2rem;
}

.sponsor-orders {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.7rem;
}

.sponsor-orders h2 {
  margin: 0;
  font-size: 1.05rem;
}

.order-status {
  font-weight: 600;
}

.order-status-paid {
  color: #16a34a;
}

.order-status-expired {
  color: var(--danger);
}

.order-status-pending {
  color: var(--warn);
}

@media (max-width: 900px) {
  .sponsor-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin page */
.admin-wrap {
  width: min(1120px, calc(100% - 2rem));
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.admin-shell {
  display: grid;
  gap: 1.15rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.admin-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.admin-head-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-stat {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(13, 122, 111, 0.06);
  border: 1px solid var(--line);
}

.admin-stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-stat-value {
  margin: 0.3rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-tab {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(26, 35, 50, 0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-tab:hover {
  color: var(--ink);
  background: rgba(13, 122, 111, 0.08);
}

.admin-tab.is-active {
  color: var(--accent-deep);
  background: rgba(13, 122, 111, 0.14);
  border-color: rgba(13, 122, 111, 0.2);
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.admin-panel-toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-toolbar-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-search,
.admin-filter {
  min-width: 12rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
  color: var(--ink);
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table th {
  background: #f7f9fb;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  overflow-wrap: anywhere;
}

.admin-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(26, 35, 50, 0.08);
  color: #334155;
}

.admin-role-pill.is-admin {
  background: rgba(13, 122, 111, 0.14);
  color: var(--accent-deep);
}

.admin-lua-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(26, 35, 50, 0.08);
  color: #64748b;
}

.admin-lua-pill.is-on {
  background: rgba(13, 122, 111, 0.14);
  color: var(--accent-deep);
}

.admin-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-status.is-ok {
  background: rgba(13, 122, 111, 0.14);
  color: var(--accent-deep);
}

.admin-status.is-error {
  background: rgba(180, 50, 50, 0.12);
  color: #9f1239;
}

.admin-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-actions .btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  min-height: auto;
}

.admin-empty {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
}

@media (max-width: 960px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-search,
  .admin-filter {
    min-width: 0;
    width: 100%;
  }

  .admin-toolbar-right {
    width: 100%;
  }
}
