:root {
  --bg: #eef2f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0b5fff;
  --accent-soft: #e8f0ff;
  --accent-ink: #fff;
  --girls-accent: #c2185b;
  --girls-soft: #ffe8f2;
  --line: rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --sticky-h: 0px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(12px + var(--safe-b));
}

.wd-skip {
  position: absolute;
  left: -9999px;
}
.wd-skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: #000;
  color: #fff;
  border-radius: 8px;
}

.wd-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #0a2540 0%, #0f3a66 100%);
  color: #e8f0ff;
  padding: calc(12px + var(--safe-t)) 16px 14px;
  box-shadow: 0 6px 24px rgba(10, 37, 64, 0.35);
}

.wd-top h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 2px;
}

.wd-top .wd-sub {
  font-size: 0.8rem;
  opacity: 0.88;
  margin: 0 0 12px;
}

.wd-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.wd-nav a {
  color: #b8d4ff;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}
.wd-nav a:hover,
.wd-nav a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

body.wd-theme-girls .wd-top {
  background: linear-gradient(180deg, #7a1f4a 0%, #a33162 100%);
  box-shadow: 0 6px 24px rgba(122, 31, 74, 0.38);
}

body.wd-theme-girls .wd-nav a {
  color: #ffd6ea;
}

body.wd-theme-girls .wd-nav a:hover,
body.wd-theme-girls .wd-nav a:focus-visible {
  color: #fff;
}

/* Segmented boys | girls toggle (matches common_alt) */
.co-mode-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  margin: 0 16px 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
}

/* Stays visible: lives inside sticky .wd-top so it does not scroll away */
.wd-top .co-mode-card--in-header {
  margin: 14px -16px -14px;
  padding: 12px 16px 14px;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: none;
  box-shadow:
    0 -4px 18px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.wd-theme-girls .wd-top .co-mode-card--in-header {
  border-color: rgba(255, 255, 255, 0.28);
}

.co-mode-heading {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.02em;
}

.co-mode-bar {
  display: flex;
  gap: 0;
  padding: 5px;
  border-radius: 16px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.co-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #475569;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.co-mode-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.co-mode-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.co-mode-btn-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.co-mode-btn-sub {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.92;
  line-height: 1.2;
}

.co-mode-btn:not(.co-mode-btn--active) .co-mode-btn-sub {
  opacity: 0.85;
}

.co-mode-btn--active {
  background: var(--surface);
  color: var(--accent);
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.co-mode-btn--active .co-mode-btn-title {
  color: #0b5fff;
}

.co-mode-btn--active .co-mode-btn-sub {
  color: #3b82f6;
  opacity: 1;
}

.co-mode-btn--girls.co-mode-btn--active {
  color: #c2185b;
  box-shadow:
    0 2px 12px rgba(194, 24, 91, 0.28),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.co-mode-btn--girls.co-mode-btn--active .co-mode-btn-title {
  color: #9d174d;
}

.co-mode-btn--girls.co-mode-btn--active .co-mode-btn-sub {
  color: #db2777;
}

.wd-panel--girls {
  padding-top: 4px;
  border-top: 3px solid rgba(255, 79, 163, 0.38);
}

.wd-panel--girls .wd-wt {
  background: var(--girls-soft);
  color: var(--girls-accent);
}

.wd-panel--girls .wd-pill--accent {
  background: #fce7f3;
  color: #9d174d;
}

.wd-more--girls {
  background: linear-gradient(135deg, #c2185b 0%, #ff4fa3 100%);
  box-shadow: 0 6px 20px rgba(194, 24, 91, 0.35);
}

.wd-filters {
  margin: -8px 0 0;
  padding: 14px 16px 18px;
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--line);
  border-top: none;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.wd-panel .wd-filters {
  margin-top: 0;
  border-radius: var(--radius);
  border-top: 1px solid var(--line);
}

.wd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .wd-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.wd-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.wd-field input,
.wd-field select {
  width: 100%;
  font-size: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.wd-field--full {
  grid-column: 1 / -1;
}

.wd-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.wd-status {
  padding: 10px 16px 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}

.wd-skeleton-wrap {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Our `.wd-skeleton-wrap { display: flex }` can beat UA `[hidden]` in some browsers — force collapse */
.wd-skeleton-wrap[hidden] {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  gap: 0 !important;
}

.wd-skel {
  height: 88px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: wd-shimmer 1.1s ease infinite;
}

@keyframes wd-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.wd-list {
  padding: 4px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wd-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 14px 14px 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.wd-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.wd-wt {
  flex-shrink: 0;
  min-width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 4px;
}

.wd-card-title a {
  color: var(--text);
  text-decoration: none;
}
.wd-card-title a:hover,
.wd-card-title a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.wd-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.wd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.wd-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
}

.wd-pill--accent {
  background: #e0edff;
  color: #1e40af;
}

.wd-more {
  display: block;
  width: calc(100% - 32px);
  margin: 0 auto 24px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.wd-more:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wd-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.wd-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 0;
}
.wd-bar .wd-data-status {
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.wd-bar button {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
