/* Account themes and additional AniLib views. */
:root {
  --accent: var(--character-accent, #ff9852);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --button-ink: #17171d;
  --header-bg: var(--bg);
}
html {
  touch-action: pan-x pan-y;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f8;
  --panel: #fff;
  --panel-light: #e9ebf2;
  --ink: #20212d;
  --muted: #626477;
  --line: #dce0e9;
  --accent: var(--character-accent-light, #ad4800);
  --green: #21734c;
  --button-ink: #fff;
  --header-bg: #fff;
}
input,
select,
textarea {
  color: var(--ink);
}
.btn-primary {
  color: var(--button-ink);
}
.site-header {
  background: var(--header-bg);
}
.main-nav a {
  color: var(--muted);
}
.main-nav a.active,
.main-nav a:hover {
  color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}
.user-avatar {
  background-image: var(--character-image);
  background-size: 340%;
  background-position: 80% 25%;
}
html[data-character="ichigo"] .user-avatar {
  background-position: 82% 12%;
}
.user-dropdown {
  z-index: 40;
  background: var(--panel);
  border-color: var(--line);
}
.bottom-nav {
  display: none;
}
.back-row {
  margin: 14px 0 20px;
}
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 0;
}
.back-button:hover {
  color: var(--accent);
}
.hero-art {
  width: auto;
  height: 100%;
  right: 0;
  max-width: none;
  object-fit: contain;
  object-position: right top;
}
.hero,
.auth-art {
  color: #f2f0ed;
}
.hero em,
.hero-kicker,
.hero-signature,
.auth-copy em {
  color: var(--character-accent);
}
.hero .btn-primary {
  background: var(--character-accent);
  color: #17171d;
}
.hero .btn-ghost {
  color: #f2f0ed;
}
.hero-content h1 {
  color: #f2f0ed;
}
.advanced-search-link {
  margin: 0 0 20px;
  display: inline-flex;
}
.search-filter-panel {
  background: var(--panel);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.search-filter-panel .catalogue-search {
  margin: 0;
  background: var(--bg);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.filter-grid select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  font-size: 14px;
}
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.filter-actions button {
  background: none;
  padding: 8px 0;
}
.advanced-result {
  align-items: flex-start;
  gap: 12px;
}
.advanced-result-copy {
  min-width: 0;
  flex: 1;
}
.advanced-result h3 {
  white-space: normal;
  line-height: 1.4;
}
.advanced-result p {
  font-size: 10px;
  margin: 5px 0 0;
}
.saved-label {
  color: var(--accent);
  font-size: 10px;
}
.result-chevron {
  font-size: 22px;
  color: var(--muted);
}
.mode-picker,
.character-picker {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.mode-picker legend {
  font-size: 17px;
  font-weight: 650;
  margin-bottom: 14px;
}
.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.mode-picker label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 17px;
  border-radius: 8px;
  cursor: pointer;
}
.mode-picker input,
.character-choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mode-picker label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mode-picker label:has(input:focus-visible),
.character-choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.mode-picker strong,
.mode-picker small {
  display: block;
}
.mode-picker small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.mode-picker svg {
  margin-left: auto;
  color: var(--accent);
  opacity: 0;
  flex-shrink: 0;
}
.mode-picker label:has(input:checked) svg {
  opacity: 1;
}
.character-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.character-choice {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.character-choice:hover {
  transform: translateY(-3px);
}
.character-choice:has(input:checked) {
  border-color: var(--accent);
}
.character-preview {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #17171d;
}
.character-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% top;
  transition: transform 0.2s;
}
.character-choice:hover img {
  transform: scale(1.025);
}
.choice-check {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: var(--button-ink);
  padding: 5px;
  border-radius: 50%;
  display: none;
}
.character-choice:has(input:checked) .choice-check {
  display: flex;
}
.character-info {
  padding: 14px 15px;
  position: relative;
}
.character-info strong,
.character-info small {
  display: block;
}
.character-info strong {
  font-size: 13px;
  padding-right: 18px;
}
.character-info small {
  color: var(--muted);
  font-size: 11px;
}
.character-swatch {
  position: absolute;
  right: 16px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--choice-accent);
}
.appearance-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0;
  gap: 20px;
}
.download-search {
  margin-bottom: 24px;
}
.download-anime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.download-anime {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.download-anime > a {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.download-anime .poster-box {
  width: 75px;
  height: 110px;
  flex-shrink: 0;
}
.download-anime h2,
.download-episode h2 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 8px;
}
.download-anime p,
.download-episode p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
}
.download-anime .text-link {
  font-size: 11px;
}
.download-episodes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.download-episode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--panel);
  padding: 20px;
  border-radius: 8px;
}
.download-episode-info,
.download-episode-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.download-episode-icon {
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.download-episode p {
  margin: 0;
}
.feature-empty {
  text-align: center;
  max-width: 620px;
  margin: 55px auto;
  padding: 24px;
}
.feature-empty > svg {
  width: 40px;
  height: 40px;
  color: var(--accent);
}
.feature-empty p {
  color: var(--muted);
  margin-bottom: 25px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0 30px;
}
.admin-stats > div {
  background: var(--panel);
  padding: 20px 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.admin-stats strong {
  font-size: 28px;
  display: block;
  color: var(--accent);
}
.admin-stats span {
  color: var(--muted);
  font-size: 12px;
}
.admin-tabs {
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  margin-bottom: 30px;
}
.admin-leaderboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.admin-leaderboard-heading h2 {
  margin: 0 0 5px;
}
.admin-leaderboard-heading p {
  margin: 0;
}
.admin-leaderboard-heading .catalogue-search {
  width: 260px;
  flex-shrink: 0;
  margin: 0;
}
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  width: 100%;
  color: var(--ink);
}
.admin-user:hover,
.admin-user.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.admin-rank {
  font-size: 25px;
  font-weight: 700;
  color: var(--accent);
}
.admin-user-copy {
  flex: 1;
  min-width: 0;
}
.admin-user-copy strong {
  font-size: 16px;
}
.admin-user-copy small,
.admin-user-metrics small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.admin-user-metrics {
  text-align: right;
}
.admin-user-metrics span {
  font-size: 11px;
  color: var(--muted);
  display: block;
}
.admin-user-metrics strong {
  font-size: 16px;
}
.admin-detail {
  margin-top: 38px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  scroll-margin-top: 100px;
}
.admin-detail-section {
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.admin-detail-section h3 {
  margin: 0 0 8px;
}
.admin-detail-section > a {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 6px 12px;
  margin: 5px;
  border-radius: 4px;
}
.admin-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.admin-history-row a {
  display: block;
}
.admin-history-row a:first-child {
  font-weight: 650;
}
.admin-history-row a + a {
  font-size: 11px;
  color: var(--accent);
}
.admin-history-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.admin-history-time {
  text-align: right;
  flex-shrink: 0;
}
.admin-history-time strong {
  font-size: 12px;
}
.admin-history-row time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.activity-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 9px;
  height: 180px;
  margin: 25px 0 0;
}
.chart-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-width: 0;
  height: 100%;
}
.chart-column small {
  font-size: 9px;
  white-space: nowrap;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}
.chart-bar {
  position: relative;
  height: var(--bar-height);
  max-height: 150px;
  min-height: 3px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  width: 100%;
  padding: 0;
}
.chart-bar:hover,
.chart-bar:focus-visible {
  filter: brightness(1.2);
}
.chart-bar:hover:after,
.chart-bar:focus-visible:after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  white-space: nowrap;
  background: var(--ink);
  color: var(--bg);
  padding: 5px 8px;
  border-radius: 4px;
  z-index: 2;
}
.chart-caption {
  font-size: 11px;
  color: var(--muted);
}
.admin-log {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    11px/1.8 Consolas,
    monospace;
  max-height: 70vh;
  overflow: auto;
}
/* Login is a fixed viewport scene; both tab panels occupy the same form slot. */
body.login-page {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.login-page .site-header {
  flex-shrink: 0;
}
.login-page .main-container {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  padding-top: 20px;
  padding-bottom: 20px;
}
.login-page .site-footer {
  display: none;
}
.login-page .auth-layout {
  margin: 0;
  min-height: 0;
  height: 100%;
  max-height: 780px;
  width: 100%;
  align-self: center;
  grid-template-columns: 1.15fr 1fr;
}
.login-page .auth-panel {
  padding: 24px 42px;
  margin: auto;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 670px;
  min-height: 0;
}
.auth-intro h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin: 10px 0;
}
.auth-intro p {
  font-size: 11px;
  margin: 8px 0;
}
.login-page .auth-tabs {
  margin: 12px 0 0;
  flex-shrink: 0;
}
.auth-error-slot {
  height: 38px;
  min-height: 38px;
  font-size: 11px;
}
.auth-error-slot .form-error {
  margin: 4px 0;
  padding: 5px 8px;
  font-size: 10px;
  line-height: 1.25;
}
.auth-form-slot {
  position: relative;
  flex: 1;
  min-height: 280px;
  max-height: 350px;
}
.auth-form-slot form {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-form-slot form[hidden] {
  display: none;
}
.login-page .auth-field label {
  margin: 0 0 4px;
  font-size: 11px;
}
.login-page .form-input {
  padding: 9px 12px;
  font-size: 16px;
  height: 40px;
  background: var(--bg);
  color: var(--ink);
}
.login-page .auth-form-slot form > .btn {
  margin-top: auto;
  min-height: 43px;
  flex-shrink: 0;
}
.login-page .auth-note {
  margin: 10px 0;
}
.login-page .auth-bottom {
  margin-top: 18px;
  font-size: 9px;
  flex-shrink: 0;
}
html[data-theme="light"] .hero {
  background: #16161c;
}
html[data-theme="light"] .hero-shade {
  background:
    linear-gradient(
      90deg,
      #17171dfc 0%,
      #19191fdc 26%,
      #19191f75 43%,
      transparent 70%
    ),
    linear-gradient(0deg, #16161c, transparent 28%);
}
html[data-theme="light"] .card-meta p,
html[data-theme="light"] .card-meta h3,
html[data-theme="light"] .rank-meta h3,
html[data-theme="light"] .catalogue-item h3 {
  color: var(--ink);
}
html[data-theme="light"] .text-link,
html[data-theme="light"] .trending-side span,
html[data-theme="light"] .empty-state h3,
html[data-theme="light"] .breadcrumbs > span,
html[data-theme="light"] .synopsis {
  color: var(--ink);
}
html[data-theme="light"] .tag-accent {
  color: var(--accent);
  background: var(--accent-soft);
}
html[data-theme="light"] .alphabet button.active,
html[data-theme="light"] .alphabet button:hover {
  color: var(--button-ink);
}
html[data-theme="light"] .tag,
html[data-theme="light"] .btn-secondary {
  border-color: var(--line);
}
html[data-theme="light"] .form-error {
  color: #9d2620;
}
html[data-theme="light"] .video-container,
html[data-theme="light"] .player-idle,
html[data-theme="light"] .player-error {
  color: #f2f0ed;
}
html[data-theme="light"] .toolbar-button,
html[data-theme="light"] .toggle-control,
html[data-theme="light"] .hoster-buttons button,
html[data-theme="light"] .watch-detail p {
  color: var(--muted);
}
html[data-theme="light"] .hoster-buttons button.active,
html[data-theme="light"] .server-notice {
  color: var(--button-ink);
}
html[data-theme="light"] .watch-sidebar .episode-search {
  background: var(--bg);
}
html[data-theme="light"] .watch-episode {
  background: var(--panel);
}
html[data-theme="light"] .watch-episode:nth-child(even) {
  background: var(--panel-light);
}
html[data-theme="light"] .watch-episode.active,
html[data-theme="light"] .watch-episode:hover {
  background: var(--accent-soft);
}
html[data-theme="light"] .watch-detail {
  background: var(--panel);
}
.toggle-control input:checked + .switch,
.watch-episode.active,
.watch-episode:hover {
  background: var(--accent-soft);
}
.hoster-buttons button.active,
.server-notice {
  color: var(--button-ink);
}
@media (min-width: 801px) {
  .hero-art {
    mask-image: linear-gradient(90deg, transparent, #000 18%);
  }
}
@media (max-height: 400px) {
  .login-page .auth-form-slot {
    min-height: 200px;
  }
  .login-page .auth-field label {
    font-size: 9px;
    line-height: 1.2;
    margin-bottom: 2px;
  }
  .login-page .form-input {
    height: 30px;
  }
  .login-page .auth-form-slot form {
    gap: 4px;
  }
  .login-page .auth-tabs button {
    padding: 6px;
  }
  .login-page .main-container {
    padding: 8px;
  }
  .login-page .auth-note {
    display: none;
  }
}
html[data-theme="light"] .site-footer,
html[data-theme="light"] .welcome-strip,
html[data-theme="light"] .catalogue-search,
html[data-theme="light"] .episode-row,
html[data-theme="light"] .library-promo,
html[data-theme="light"] .continue-card,
html[data-theme="light"] .season-card,
html[data-theme="light"] .auth-panel {
  background: var(--panel);
}
html[data-theme="light"] .catalogue-item,
html[data-theme="light"] .sort-control select,
html[data-theme="light"] .form-input {
  background: var(--panel);
  color: var(--ink);
}
html[data-theme="light"] .auth-panel form label,
html[data-theme="light"] .anime-description,
html[data-theme="light"] .anime-info p,
html[data-theme="light"] .breadcrumb {
  color: var(--muted);
}
html[data-theme="light"] .anime-cover .poster-box,
html[data-theme="light"] .poster-fallback {
  background: #e3e6ee;
}
html[data-theme="light"] .poster-fallback {
  color: #6c6578;
}
html[data-theme="light"] .tag,
html[data-theme="light"] .btn-secondary {
  background: var(--panel-light);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="light"] .btn-ghost {
  color: var(--ink);
}
html[data-theme="light"] .hero .btn-ghost {
  color: #f2f0ed;
}
@media (min-width: 801px) {
  .header-inner {
    gap: 20px;
  }
  .main-nav {
    gap: 18px;
  }
  .username {
    display: none;
  }
}
@media (max-width: 1050px) {
  .character-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .download-anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login-page .auth-panel {
    padding: 24px;
  }
}
@media (max-width: 800px) {
  body:has(.bottom-nav) {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
  .main-nav,
  .mobile-menu-toggle {
    display: none !important;
  }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 25px #00000014;
  }
  .bottom-nav.has-admin {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    font-size: 10px;
    color: var(--muted);
    border-radius: 8px;
  }
  .bottom-nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
  }
  .bottom-nav svg {
    width: 22px;
    height: 22px;
  }
  .toast {
    bottom: calc(90px + env(safe-area-inset-bottom));
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .header-inner {
    justify-content: space-between;
  }
  .hero-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 75% top;
    right: 0;
  }
  .character-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
  }
  .character-preview {
    height: 160px;
  }
  .mode-picker {
    gap: 8px;
  }
  .mode-picker label {
    padding: 12px 10px;
  }
  .mode-picker small {
    font-size: 9px;
  }
  .mode-picker svg {
    width: 15px;
  }
  .appearance-save {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .appearance-save .btn {
    justify-content: center;
  }
  .download-episode {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }
  .download-episode-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .admin-leaderboard-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-leaderboard-heading .catalogue-search {
    width: 100%;
  }
  .admin-detail {
    padding: 20px;
  }
  .admin-history-row {
    gap: 12px;
  }
  .activity-chart {
    gap: 5px;
  }
  .chart-column small {
    font-size: 8px;
  }
  .login-page .auth-layout {
    grid-template-columns: 1fr;
    background: var(--panel);
    max-width: 520px;
    margin: auto;
  }
  .login-page .auth-art {
    display: none;
  }
  .login-page .auth-panel {
    padding: 24px 30px;
    max-height: 620px;
  }
  .login-page .main-container {
    padding: 18px;
  }
  .login-page .header-inner {
    height: 66px;
  }
  .login-page .header-tag {
    font-size: 8px;
  }
}
@media (max-width: 560px) {
  .page-heading {
    gap: 16px;
  }
  .search-filter-panel {
    padding: 16px;
  }
  .search-filter-panel .catalogue-search {
    gap: 8px;
  }
  .search-filter-panel .catalogue-search > .btn {
    padding: 10px 12px;
    font-size: 11px;
  }
  .filter-grid {
    gap: 12px;
  }
  .filter-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .filter-actions p {
    font-size: 10px;
  }
  .download-anime-grid {
    grid-template-columns: 1fr;
  }
  .download-anime > a {
    padding: 16px;
  }
  .download-episode-actions {
    gap: 8px;
  }
  .download-episode-actions .btn {
    font-size: 11px;
    padding: 11px 10px;
  }
  .admin-stats {
    gap: 8px;
    margin: 18px 0;
  }
  .admin-stats > div {
    padding: 12px;
  }
  .admin-stats strong {
    font-size: 23px;
  }
  .admin-stats span {
    font-size: 10px;
  }
  .admin-tabs {
    gap: 3px;
  }
  .admin-tabs button {
    font-size: 10px;
    padding: 9px 10px;
  }
  .admin-user {
    padding: 14px 12px;
    gap: 12px;
  }
  .admin-rank {
    font-size: 20px;
  }
  .admin-user-copy strong {
    font-size: 13px;
  }
  .admin-user-metrics strong {
    font-size: 12px;
  }
  .admin-user-metrics span {
    font-size: 9px;
    max-width: 115px;
  }
  .admin-user-metrics small {
    font-size: 8px;
  }
  .admin-user .result-chevron {
    display: none;
  }
  .admin-detail {
    padding: 16px;
  }
  .admin-detail .section-heading {
    align-items: flex-start;
    gap: 16px;
  }
  .admin-detail .section-heading h2 {
    font-size: 23px;
  }
  .admin-detail .section-heading .btn {
    font-size: 10px;
    padding: 10px;
  }
  .admin-history-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .admin-history-time {
    text-align: left;
  }
  .activity-chart {
    gap: 3px;
    height: 140px;
  }
  .chart-column small {
    writing-mode: vertical-rl;
    font-size: 8px;
    align-self: center;
  }
  .chart-bar {
    max-height: 108px;
  }
  .mode-picker small {
    display: none;
  }
  .mode-picker label {
    padding: 13px 9px;
    font-size: 12px;
    gap: 4px;
  }
  .character-preview {
    height: 145px;
  }
  .character-info {
    padding: 12px;
  }
  .character-info strong {
    font-size: 11px;
  }
  .character-info small {
    font-size: 10px;
  }
  .login-page .main-container {
    padding: 12px 14px;
  }
  .login-page .auth-panel {
    padding: 20px;
    max-height: 600px;
  }
  .auth-intro h2 {
    font-size: 23px;
  }
  .login-page .auth-form-slot {
    max-height: 335px;
  }
  .login-page .header-tag {
    display: none;
  }
  .login-page .auth-bottom {
    margin-top: 14px;
  }
}
@media (max-height: 700px) {
  .login-page .auth-panel {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .login-page .auth-intro h2 {
    font-size: 20px;
    margin: 7px 0;
  }
  .login-page .auth-intro p {
    display: none;
  }
  .login-page .auth-tabs {
    margin-top: 8px;
  }
  .login-page .auth-form-slot {
    max-height: 320px;
  }
  .login-page .auth-bottom {
    margin-top: 10px;
  }
  .login-page .main-container {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}
@media (max-height: 560px) {
  .login-page .auth-intro {
    display: none;
  }
  .login-page .site-header {
    display: none;
  }
  .login-page .auth-panel {
    padding: 10px 20px;
  }
  .login-page .auth-tabs {
    margin: 0;
  }
  .login-page .auth-error-slot {
    height: 28px;
    min-height: 28px;
  }
  .login-page .auth-bottom {
    display: none;
  }
  .login-page .auth-form-slot {
    min-height: 260px;
  }
  .login-page .auth-field label {
    font-size: 10px;
  }
  .login-page .auth-form-slot form {
    gap: 6px;
  }
  .login-page .form-input {
    height: 35px;
    padding: 6px 10px;
  }
  .login-page .auth-form-slot form > .btn {
    min-height: 35px;
    padding: 8px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .character-choice,
  .character-preview img {
    transition: none;
  }
}

/* Keep all four registration fields inside the same reserved form rectangle. */
body.login-page .auth-field label {
  line-height: 1.2;
}
body.login-page .auth-form-slot form {
  gap: 6px;
}
@media (max-height: 800px) {
  body.login-page .form-input {
    height: 38px;
  }
}
@media (max-height: 400px) {
  body.login-page .auth-form-slot {
    min-height: 230px;
  }
  body.login-page .auth-field label {
    font-size: 9px;
    margin-bottom: 2px;
  }
  body.login-page .form-input {
    height: 30px;
  }
  body.login-page .auth-form-slot form {
    gap: 4px;
  }
  body.login-page .auth-tabs button {
    padding: 6px;
  }
  body.login-page .main-container {
    padding: 8px;
  }
  body.login-page .auth-note {
    display: none;
  }
}
