.content.categories-open .sidebar {
  display: flex;
  flex-direction: column;
  min-height: min(700px, calc(100vh - 112px));
  max-height: calc(100vh - 32px);
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.sidebar-tree-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--accent-2);
  cursor: pointer;
  text-align: left;
  transition: filter 180ms ease, transform 180ms ease;
}

.sidebar-account:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.sidebar-account:focus-visible,
.auth-close:focus-visible,
.auth-tab:focus-visible,
.auth-primary:focus-visible,
.auth-recovery-link:focus-visible,
.account-button:focus-visible,
.account-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.sidebar-account-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.sidebar-account-avatar svg {
  width: 20px;
  height: 20px;
}

.sidebar-account-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.sidebar-account-copy strong,
.sidebar-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-copy strong { font-size: 13px; }
.sidebar-account-copy small { color: rgba(255, 255, 255, .76); font-size: 10.5px; }
.sidebar-account-arrow { flex: 0 0 auto; font-size: 22px; line-height: 1; opacity: .78; }

.auth-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: min(720px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--text);
  background: var(--bg-soft);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .32);
  overflow: auto;
}

.auth-dialog::backdrop {
  background: rgba(1, 4, 9, .66);
  backdrop-filter: blur(4px);
}

.auth-dialog-shell { display: grid; }

.auth-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
}

.auth-dialog-header h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.02em;
}

.auth-dialog-header p {
  max-width: 38ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.auth-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: var(--panel);
  cursor: pointer;
  font-size: 20px;
}

.auth-close:hover { color: var(--text); background: var(--panel-strong); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 22px;
  padding: 3px;
  border-radius: 11px;
  background: var(--panel);
}

.auth-tabs[hidden] { display: none; }

.auth-tab {
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--text);
  background: var(--panel-strong);
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 18px 22px 20px;
}

.auth-field { display: grid; gap: 7px; }
.auth-field[hidden] { display: none; }
.auth-field label { font-size: 12px; font-weight: 750; }
.auth-field small { color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.auth-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: var(--panel-strong);
  font-size: 14px;
}

.auth-field input::placeholder { color: var(--muted); opacity: 1; }
.auth-field input:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 16%, transparent); }

.auth-turnstile {
  min-height: 65px;
  overflow: hidden;
}

.auth-turnstile[data-state="loading"],
.auth-turnstile[data-state="error"] {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-turnstile[data-state="error"] {
  border-color: color-mix(in srgb, #f85149 45%, var(--border));
  color: #c93c37;
}

.auth-message {
  min-height: 19px;
  margin: -2px 0 0;
  color: #f85149;
  font-size: 12px;
  line-height: 1.55;
}

.auth-message[data-tone="success"] { color: #3fb950; }

.auth-primary,
.account-button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent-2);
  cursor: pointer;
  font-weight: 750;
}

.auth-primary:hover,
.account-button:hover { filter: brightness(1.08); }
.auth-primary:disabled,
.account-button:disabled { cursor: wait; opacity: .62; }

.auth-recovery-link {
  justify-self: center;
  padding: 5px 8px;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.auth-verification {
  padding: 12px 28px 24px;
  text-align: center;
}

.auth-verification[hidden] { display: none; }
.auth-verification-icon { display: block; margin-bottom: 10px; font-size: 34px; }
.auth-verification h3 { margin: 0; font-size: 18px; }
.auth-verification p { margin: 10px 0 18px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.auth-verification strong { color: var(--text); overflow-wrap: anywhere; }
.auth-verification .auth-primary { width: 100%; }

.auth-dialog-footer {
  padding: 13px 22px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

.account-page {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.account-shell { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }
.account-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.account-link { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 700; }
.account-heading { margin: 36px 0 28px; }
.account-heading h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.account-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.account-layout { display: grid; gap: 28px; }
.account-section { padding-top: 20px; border-top: 1px solid var(--line); }
.account-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.account-section h2 { margin: 0; font-size: 17px; }
.account-section-note { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.account-count { color: var(--muted); font-size: 12px; }
.account-list { display: grid; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 66px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.account-row-copy { min-width: 0; }
.account-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-row p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.account-row a { color: var(--accent); text-decoration: none; font-size: 12px; }
.account-status { padding: 5px 8px; border-radius: 999px; color: #9a6700; background: color-mix(in srgb, #d4a72c 12%, var(--panel)); font-size: 10.5px; font-weight: 750; }
.account-status[data-status="approved"] { color: #238636; background: color-mix(in srgb, #238636 10%, var(--panel)); }
.account-status[data-status="rejected"] { color: #b4232f; background: color-mix(in srgb, #d73a49 9%, var(--panel)); }
.account-empty { padding: 22px 2px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.account-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.account-button.secondary { border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.account-security-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; max-width: 520px; }
.account-security-form input { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--panel-strong); }
.account-message { min-height: 18px; color: var(--muted); font-size: 11.5px; }
.account-message[data-tone="error"] { color: #f85149; }
.account-message[data-tone="success"] { color: #3fb950; }
.account-skeleton { height: 12px; margin: 13px 0; border-radius: 6px; background: var(--panel-strong); animation: account-pulse 1.2s ease-in-out infinite alternate; }
@keyframes account-pulse { to { opacity: .45; } }

.auth-confirm-main { display: grid; min-height: 100vh; place-items: center; padding: 24px; color: var(--text); background: var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
.auth-confirm-panel { width: min(460px, 100%); text-align: center; }
.auth-confirm-panel h1 { margin: 0; font-size: 24px; }
.auth-confirm-panel p { margin: 12px auto 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-confirm-panel .account-button { display: inline-flex; align-items: center; text-decoration: none; }

@media (max-width: 930px) {
  .content.categories-open .sidebar {
    position: static;
    min-height: 360px;
    max-height: min(560px, calc(100vh - 96px));
  }
}

@media (max-width: 560px) {
  .auth-dialog { width: calc(100% - 12px); max-height: calc(100vh - 12px); border-radius: 14px; }
  .auth-dialog-header { padding: 18px 16px 14px; }
  .auth-tabs { margin-inline: 16px; }
  .auth-form { padding: 16px; }
  .account-shell { width: min(100% - 24px, 960px); padding-top: 14px; }
  .account-heading { margin-top: 26px; }
  .account-security-form { grid-template-columns: 1fr; }
  .account-security-form .account-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-account { transition: none; }
  .account-skeleton { animation: none; }
}
