/* LINGORA — Teahouse theme (design/teahouse). Loaded last.
   Cream paper panels over a photographed teahouse; each section of the site has its own scene.
   Tea-leaf green replaces the old blue; gold-brown is the money colour. */

:root {
  --wv-bg: #EDEBD9;
  --wv-surface: #FFFCF0;
  --wv-surface-2: #F3F1DE;
  --wv-line: #CFCFB3;
  --wv-text: #1B371D;
  --wv-muted: #556149;
  --wv-primary: #24471E;
  --wv-primary-hover: #1A3816;
  --wv-primary-soft: #E2E8CC;
  --wv-link: #2B5A26;
  --wv-accent: #B9822E;
  --wv-accent-ink: #7A4E10;
  --wv-accent-soft: #F6ECD3;
  --wv-ok: #2A6B3E;
  --wv-ok-soft: #E3EED9;
  --wv-err: #A8362E;
  --wv-err-soft: #F7E5DF;
  --wv-shadow: 0 6px 24px rgba(23, 36, 14, 0.18);
  --wv-font: 'Sukhumvit Set', 'Noto Sans Thai', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  --tea-serif: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  --tea-panel: rgba(255, 250, 234, 0.94);
  --tea-rule: #A6AF8D;
  --wv-rail: 252px;
  --tea-scene: url('/assets/teahouse/bg-learn.jpg');
}

html[data-theme='dark'] {
  --wv-bg: #141A12;
  --wv-surface: #1D2519;
  --wv-surface-2: #26301F;
  --wv-line: #36422D;
  --wv-text: #EEF0DE;
  --wv-muted: #B4BC9F;
  --wv-primary: #8DB36B;
  --wv-primary-hover: #A0C47F;
  --wv-primary-soft: #2C3A24;
  --wv-link: #B5D392;
  --wv-accent: #D9A54E;
  --wv-accent-ink: #E9C27E;
  --wv-accent-soft: #3A3020;
  --wv-ok: #8CCB98;
  --wv-ok-soft: #22331F;
  --wv-err: #EE8F83;
  --wv-err-soft: #3A221E;
  --wv-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --tea-panel: rgba(24, 31, 21, 0.93);
  --tea-rule: #4A5640;
}

/* One photographed scene per section. Sections without their own photo yet use the tea table. */
.lingora-platform-shell[data-section='review'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }
.lingora-platform-shell[data-section='compete'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }
.lingora-platform-shell[data-section='rewards'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }
.lingora-platform-shell[data-section='people'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }
.lingora-platform-shell[data-section='study'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }
.lingora-platform-shell[data-section='account'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }
.lingora-platform-shell[data-section='entrance'] { --tea-scene: url('/assets/teahouse/bg-learn.jpg'); }

body { background: var(--wv-bg); }
::selection { background: #D5DFB6; color: #1B371D; }

html .lingora-platform-shell,
html[data-theme='dark'] .lingora-platform-shell {
  background: #CED2B9 var(--tea-scene) center / cover fixed no-repeat;
  color: var(--wv-text);
  font-family: var(--wv-font);
}
html[data-theme='dark'] .lingora-platform-shell {
  background-image: linear-gradient(rgba(8, 12, 6, 0.62), rgba(8, 12, 6, 0.62)), var(--tea-scene);
}

/* Paper panel that holds every page */
html .lingora-platform-main,
html[data-theme='dark'] .lingora-platform-main {
  margin: 8px 8px 0;
  padding: 16px 14px calc(var(--wv-tabbar) + 32px + env(safe-area-inset-bottom));
  min-height: calc(100dvh - var(--wv-topbar) - 8px);
  background: var(--tea-panel);
  border: 1px solid rgba(250, 245, 211, 0.9);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 3px 24px rgba(23, 36, 14, 0.27);
}
html[data-theme='dark'] .lingora-platform-main { border-color: rgba(120, 140, 100, 0.25); }

/* Top bar: glass over the scene */
.wv-topbar {
  background: rgba(255, 250, 234, 0.78);
  border-bottom: 1px solid rgba(166, 175, 141, 0.55);
}
html[data-theme='dark'] .wv-topbar { background: rgba(20, 26, 18, 0.82); }
.wv-search { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--wv-line); }
html[data-theme='dark'] .wv-search { background: var(--wv-surface-2); }
.wv-coin-chip { background: var(--wv-accent-soft); color: var(--wv-accent-ink); border: 1px solid #E2CFA2; }

/* Side menu: green paper with tea leaves */
.wv-menu {
  background: #DCE1C8 url('/assets/teahouse/sidebar-bg.jpg') center top / cover no-repeat;
  border-right: 1px solid #919F7E;
  box-shadow: inset -3px 0 6px rgba(82, 100, 64, 0.07);
  color: #233C28;
  font-weight: 600;
}
html[data-theme='dark'] .wv-menu {
  background-image: linear-gradient(rgba(14, 20, 11, 0.8), rgba(14, 20, 11, 0.8)), url('/assets/teahouse/sidebar-bg.jpg');
  color: var(--wv-text);
}
.wv-menu-heading { color: #5B6A4A; letter-spacing: 0.02em; }
html[data-theme='dark'] .wv-menu-heading { color: var(--wv-muted); }
.wv-menu-item {
  color: inherit;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 650;
}
.wv-menu-item .wv-icon { color: #2D4A2A; }
html[data-theme='dark'] .wv-menu-item .wv-icon { color: var(--wv-primary); }
.wv-menu-item:hover { background: rgba(255, 255, 255, 0.42); }
.wv-menu-item.is-active {
  background: #F4F5E6;
  border-color: #A8B398;
  color: #1B371D;
  box-shadow: 0 1px 3px rgba(53, 72, 50, 0.08);
}
html[data-theme='dark'] .wv-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme='dark'] .wv-menu-item.is-active { background: var(--wv-primary-soft); border-color: var(--tea-rule); color: var(--wv-text); }

.tea-brand {
  display: none;
  position: relative;
  padding: 26px 6px 12px;
  border-bottom: 1px solid var(--tea-rule);
  color: #233C28;
  text-decoration: none;
  font: 600 40px/1.05 var(--tea-serif);
  letter-spacing: -0.045em;
}
.tea-brand img { position: absolute; top: 0; left: 26px; }
html[data-theme='dark'] .tea-brand { color: var(--wv-text); }

.tea-pool {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 10px 8px 6px;
  border: 1px solid rgba(166, 175, 141, 0.7);
  border-radius: 12px;
  background: rgba(255, 252, 238, 0.62);
  color: #233C28;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tea-pool:hover .tea-pool-amount { text-decoration: underline; text-underline-offset: 4px; }
.tea-pool-text { display: grid; gap: 1px; min-width: 0; }
.tea-pool-amount.is-pending { font-size: 19px; }
.tea-pouch { flex: none; width: 64px; height: auto; filter: drop-shadow(0 4px 6px rgba(50, 40, 20, 0.2)); }
.tea-pool-caption, .tea-pool-time { font-size: 13px; font-weight: 650; }
.tea-pool-time { display: inline-flex; align-items: center; gap: 3px; }
.tea-pool-amount { font: 600 27px/1.15 var(--tea-serif); color: #5B3B0D; font-variant-numeric: tabular-nums; }
html[data-theme='dark'] .tea-pool { background: rgba(36, 46, 30, 0.8); color: var(--wv-text); }
html[data-theme='dark'] .tea-pool-amount { color: var(--wv-accent-ink); }

.tea-account { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--tea-rule); }
.tea-account-name { display: flex; align-items: center; gap: 10px; padding: 2px; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; text-align: left; }
.tea-account-name strong { font: 700 21px/1.2 var(--tea-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tea-account-name:hover { background: rgba(255, 255, 255, 0.4); }
.tea-account-name .human-avatar-frame { border: 2px solid #FFFBE9; border-radius: 50%; }
.tea-stats { display: grid; gap: 2px; padding-left: 4px; font-size: 14px; }
.tea-stats span { display: flex; align-items: center; gap: 7px; }

/* Bottom tabs on phones */
.wv-tabbar { background: rgba(250, 247, 230, 0.96); border-top: 1px solid var(--tea-rule); }
html[data-theme='dark'] .wv-tabbar { background: rgba(20, 26, 18, 0.96); }
.wv-tab.is-active { color: var(--wv-primary); }

/* Shared pieces used by every page */
.wv-page h1, .wv-page .heading-4 { font-weight: 700; letter-spacing: -0.01em; }
.wv-btn-primary, .btn-lingora-primary {
  background: var(--wv-primary);
  border-color: var(--wv-primary);
  color: #FFFBEA;
  border-radius: 9999px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.27);
}
.wv-btn-primary:hover, .btn-lingora-primary:hover { background: var(--wv-primary-hover); }
html[data-theme='dark'] .wv-btn-primary, html[data-theme='dark'] .btn-lingora-primary { color: #142010; }

@media (min-width: 1024px) {
  .tea-brand { display: block; }
  .wv-menu {
    top: 0;
    z-index: 45;
    gap: 14px;
    padding: 20px 14px 18px;
  }
  .wv-topbar { margin-left: var(--wv-rail); background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  html[data-theme='dark'] .wv-topbar { background: transparent; }
  .wv-topbar .wv-brand, .wv-topbar .wv-coin-chip { display: none; }
  .wv-topbar .wv-search { margin-left: 0; }
  .wv-topbar .wv-icon-btn, .wv-topbar .wv-avatar-btn { background: rgba(255, 250, 234, 0.82); }
  html[data-theme='dark'] .wv-topbar :is(.wv-icon-btn, .wv-avatar-btn) { background: rgba(29, 37, 25, 0.9); }
  html .lingora-platform-main,
  html[data-theme='dark'] .lingora-platform-main {
    margin: 4px 24px 24px calc(var(--wv-rail) + 24px);
    padding: 22px 26px 32px;
    min-height: calc(100dvh - var(--wv-topbar) - 28px);
    border-radius: 15px;
  }
  /* Signed-out pages have no rail */
  #platform-top-nav:not(:has(#global-search-input)) .wv-topbar { margin-left: 0; }
  #platform-top-nav:not(:has(#global-search-input)) .wv-topbar .wv-brand { display: flex; }
  #platform-top-nav:not(:has(#global-search-input)) ~ .lingora-platform-body .lingora-platform-main { margin-left: 24px; }
}

@media (max-width: 1023px) {
  .tea-pool, .tea-account { display: none; }
  .wv-menu.is-open .tea-pool { display: grid; }
}

.tea-fold > summary { display: flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; }
.tea-fold > summary::-webkit-details-marker { display: none; }
.tea-fold[open] > summary .wv-icon { transform: rotate(180deg); }

@media (min-width: 1024px) {
  .wv-menu { overflow: hidden; }
  .wv-menu-groups { flex: 1 1 auto; min-height: 0; overflow-y: auto; gap: 10px; scrollbar-width: thin; }
  .wv-menu-item { min-height: 38px; padding-block: 7px; }
  .tea-pool, .tea-account { flex: none; }
  .wv-lang-row { justify-content: space-between; }
  .wv-menu-foot { margin-top: 0; }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .tea-brand { padding-top: 18px; font-size: 34px; }
}
@media (min-width: 1024px) { .wv-lang-row { display: none; } }

/* Long header cards: one look everywhere, the same as the learning path header.
   Cream paper over the teahouse scene, dark ink text, tea-green buttons. */
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(250, 245, 228, 0.55) !important;
  border: 1px solid #B7BEA1 !important;
  box-shadow: none !important;
  color: var(--wv-text) !important;
}
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card)::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 249, 232, 0.55), rgba(255, 249, 232, 0.55)),
    var(--tea-scene) center / cover fixed no-repeat;
}
html[data-theme='dark'] :is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) { background: rgba(22, 29, 19, 0.6) !important; border-color: var(--wv-line) !important; }
html[data-theme='dark'] :is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card)::after {
  background:
    linear-gradient(rgba(22, 29, 19, 0.7), rgba(22, 29, 19, 0.7)),
    var(--tea-scene) center / cover fixed no-repeat;
}
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) > * {
  position: relative;
  z-index: 1;
}
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :where(h1, h2, h3, h4, p, span, small, strong, em, b, label, div) {
  color: inherit !important;
  text-shadow: none !important;
}
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :where(p, small, .wv-next-kicker, [class*='sub'], [class*='desc'], [class*='eyebrow'], [class*='kicker']) {
  color: var(--wv-muted) !important;
}
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :is(button, a.btn, a[class*='btn'], a[class*='button'], .wv-btn) {
  background: var(--wv-primary) !important;
  border-color: var(--wv-primary) !important;
  color: #FFFBEA !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.27) !important;
}
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :is(button, a.btn, a[class*='btn'], a[class*='button'], .wv-btn) :where(*) { color: inherit !important; }
html[data-theme='dark'] :is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :is(button, a.btn, a[class*='btn'], a[class*='button'], .wv-btn) { color: #142010 !important; }

/* Small labels inside header cards: outlined ink tags, not filled green pills. */
:is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :is([class*='badge'], [class*='pill'], [class*='tag']) {
  background: rgba(255, 253, 242, 0.7) !important;
  border: 1px solid #B7BEA1 !important;
  color: var(--wv-primary) !important;
}
html[data-theme='dark'] :is(.wv-next, .page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner,
    .speech-hero-banner, .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner,
    .career-hero-banner, .arena-hero-banner, .analytics-hero-banner, .profile-hero-card, .course-hero-card) :is([class*='badge'], [class*='pill'], [class*='tag']) { background: transparent !important; border-color: var(--wv-line) !important; }

/* Line icons that replaced the colour emoji. They sit in the text like a character. */
.tea-glyph { display: inline-flex; align-items: center; vertical-align: -0.18em; margin-right: 0.3em; color: inherit; }
.tea-glyph:last-child { margin-right: 0; }
.tea-glyph .wv-icon { display: block; }

/* Icons stand on the paper by themselves: no tinted tiles behind them. */
.wv-row-icon, .wv-row-icon.is-done, .srs-stat-icon, .due-stat .srs-stat-icon, .learning-stat .srs-stat-icon,
.reviewing-stat .srs-stat-icon, .mastered-stat .srs-stat-icon, .kpi-icon, .dqc-icon-wrap {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--wv-text);
}
.wv-row-icon.is-done { color: var(--wv-ok); }
:is(.srs-stat-icon, .kpi-icon, .dqc-icon-wrap) .tea-glyph { margin: 0; font-size: 28px; }

/* ==========================================================================
   Teahouse pages (path, stage, Ranked, quests, prize admin)
   ========================================================================== */
.th-page { display: grid; gap: 16px; color: var(--wv-text); }
.th-page h1, .th-page h2, .th-page h3, .th-page p { margin: 0; }
.th-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 0 2px 10px; border-bottom: 1px solid var(--wv-line); }
.th-title h1 { font-size: clamp(30px, 3vw, 40px); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.th-sub { color: var(--wv-muted); font-size: 15px; }
.th-title-link { margin-left: auto; }
.th-muted { color: var(--wv-muted); font-size: 13px; }
.th-eyebrow { color: var(--wv-muted); font-size: 14px; }
.th-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.th-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--wv-primary); border-radius: 9999px; background: var(--wv-primary); color: #FFFBEA;
  font: 700 15px/1 var(--wv-font); cursor: pointer; box-shadow: inset 0 1px rgba(255, 255, 255, 0.27); white-space: nowrap;
  transition: background-color 160ms ease;
}
.th-btn:hover { background: var(--wv-primary-hover); }
.th-btn.ghost { background: transparent; color: var(--wv-primary); box-shadow: none; }
.th-btn.ghost:hover { background: var(--wv-primary-soft); }
.th-btn:disabled, .th-btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
html[data-theme='dark'] .th-btn { color: #142010; }
html[data-theme='dark'] .th-btn.ghost { color: var(--wv-primary); }
.th-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--wv-link); font: 700 15px var(--wv-font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.th-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--wv-muted); cursor: pointer; }
.th-icon-btn:hover { background: var(--wv-surface-2); color: var(--wv-err); }
.th-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

.th-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px;
  min-height: 150px; padding: 22px 26px; border: 1px solid #B7BEA1; border-radius: 10px;
  background: rgba(250, 245, 228, 0.55);
}
.th-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--tea-scene) center / cover fixed no-repeat; opacity: 0.5; }
.th-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(255, 249, 232, 0.45); }
html[data-theme='dark'] .th-hero { border-color: var(--wv-line); }
html[data-theme='dark'] .th-hero::before { background: rgba(22, 29, 19, 0.7); }
.th-hero h2 { font-size: clamp(24px, 2.3vw, 31px); line-height: 1.3; font-weight: 700; }
.th-hero p { margin-top: 4px; }

.th-split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.th-stack { display: grid; gap: 16px; }
.th-card { padding: 18px; border: 1px solid var(--wv-line); border-radius: 9px; background: rgba(255, 253, 242, 0.8); }
html[data-theme='dark'] .th-card { background: rgba(29, 37, 25, 0.8); }
.th-card h2 { font-size: 19px; font-weight: 700; }
.th-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--wv-line); margin-bottom: 4px; }
.th-section-head h2 { font-size: 19px; font-weight: 700; }
.th-section-head span { color: var(--wv-muted); font-size: 13px; }
.th-foot { padding-top: 10px; border-top: 1px solid var(--wv-line); color: var(--wv-muted); font-size: 13px; display: grid; gap: 4px; }
.th-bar { display: block; height: 4px; border-radius: 4px; background: #D9DAC2; overflow: hidden; }
.th-bar i { display: block; height: 100%; background: var(--wv-primary); border-radius: inherit; }
html[data-theme='dark'] .th-bar { background: var(--wv-line); }

.th-stars { display: inline-flex; gap: 1px; color: #B9B79A; letter-spacing: 0; }
.th-stars .on { color: var(--wv-primary); }
.th-lock { color: var(--wv-muted); }

/* Money */
.th-money { display: grid; gap: 14px; }
.th-money > div + div { padding-top: 14px; border-top: 1px solid var(--wv-line); }
.th-money-big, .th-cash { font: 700 clamp(26px, 2.2vw, 32px)/1.2 var(--tea-serif); color: #24471E; font-variant-numeric: tabular-nums; }
html[data-theme='dark'] :is(.th-money-big, .th-cash) { color: var(--wv-accent-ink); }

/* Path matrix */
.th-table-wrap { overflow-x: auto; }
.th-matrix { width: 100%; border-collapse: collapse; min-width: 620px; }
.th-matrix tr { border-bottom: 1px solid var(--wv-line); }
.th-matrix tr.is-current { background: rgba(214, 226, 188, 0.75); }
html[data-theme='dark'] .th-matrix tr.is-current { background: var(--wv-primary-soft); }
.th-matrix th { text-align: left; font-weight: 400; padding: 8px 6px; width: 32%; }
.th-matrix th > * { vertical-align: middle; }
.th-num { display: inline-block; width: 28px; font: 700 23px var(--tea-serif); }
.th-chapter { display: inline-grid; line-height: 1.3; }
.th-chapter strong { font-size: 14px; }
.th-chapter small { color: var(--wv-muted); font-size: 12px; }
.th-matrix td { padding: 4px; text-align: center; }
.th-stage { display: grid; justify-items: center; gap: 2px; width: 100%; min-height: 52px; padding: 6px 4px; border: 1px solid transparent; border-radius: 4px; background: none; color: inherit; font: 600 13px var(--wv-font); }
button.th-stage { cursor: pointer; }
button.th-stage:hover { border-color: var(--wv-line); background: rgba(255, 255, 255, 0.5); }
.th-stage.is-here { border-color: #1B371D; background: #FFFDF2; }
html[data-theme='dark'] .th-stage.is-here { border-color: var(--wv-primary); background: var(--wv-surface); }
.is-locked .th-stage { color: var(--wv-muted); }

/* Stage play */
.th-question, .th-result { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--wv-line); border-radius: 10px; background: rgba(255, 253, 242, 0.85); }
html[data-theme='dark'] :is(.th-question, .th-result) { background: rgba(29, 37, 25, 0.85); }
.th-q-progress { display: grid; gap: 6px; color: var(--wv-muted); font-size: 14px; }
.th-question h2 { font-size: 22px; font-weight: 700; }
.th-q-text { font-size: clamp(40px, 5vw, 64px); line-height: 1.2; color: #1B371D; text-align: center; }
html[data-theme='dark'] .th-q-text { color: var(--wv-text); }
.th-q-reading { text-align: center; font: 24px var(--tea-serif); color: var(--wv-muted); }
.th-q-meaning { text-align: center; color: var(--wv-muted); }
.th-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.th-option { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 52px; padding: 10px 14px; border: 1px solid var(--wv-line); border-radius: 12px; background: #F6F4E2; color: inherit; font: 600 16px var(--wv-font); text-align: center; cursor: pointer; }
.th-option:hover:not(:disabled) { border-color: var(--wv-primary); }
.th-option.is-picked { border-color: var(--wv-primary); background: var(--wv-primary-soft); box-shadow: inset 0 0 0 1px var(--wv-primary); }
.th-option.is-paired { background: #EEF1DD; }
.th-option.is-used { opacity: 0.5; }
.th-option em { flex-basis: 100%; font-style: normal; font-size: 13px; color: var(--wv-link); }
.th-option:disabled { cursor: default; }
html[data-theme='dark'] .th-option { background: var(--wv-surface-2); }
.th-match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.th-match > div { display: grid; gap: 8px; align-content: start; }
.th-fill input { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--wv-line); border-radius: 12px; background: #FFFDF5; color: inherit; font: 22px var(--wv-font); text-align: center; }
html[data-theme='dark'] .th-fill input { background: var(--wv-surface-2); }
.th-words ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.th-words li { display: grid; grid-template-columns: minmax(64px, max-content) 1fr; gap: 0 10px; padding: 7px 0; border-bottom: 1px solid var(--wv-line); }
.th-words li .zh-text { grid-row: span 2; font-size: 24px; white-space: nowrap; }
.th-words li small { color: var(--wv-muted); font: 14px var(--tea-serif); }
.th-words li span:last-child { font-size: 14px; }
.th-words p { margin-top: 8px; }
.th-result { justify-items: start; }
.th-result h2 { font-size: 32px; font-weight: 700; }
.th-result-stars .th-stars { font-size: 34px; }
.th-result-score { font-size: 17px; }
.th-earn { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.th-earn li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border: 1px solid var(--wv-line); border-radius: 9999px; font-weight: 600; }
.th-result h3 { font-size: 16px; margin-top: 6px; }
.th-review { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; width: 100%; }
.th-review li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--wv-line); font-size: 14px; }
.th-review li.ok .wv-icon { color: var(--wv-ok); }
.th-review li.miss .wv-icon { color: var(--wv-err); }

/* Ranked */
.th-rank-hero > div { display: grid; gap: 6px; }
.th-rating { font-size: 22px; }
.th-rating strong { font: 700 30px var(--tea-serif); }
.th-qualify dl { margin: 8px 0; display: grid; }
.th-qualify dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--wv-line); }
.th-qualify dd { margin: 0; font-weight: 700; color: var(--wv-ok); font-variant-numeric: tabular-nums; }
.th-tiers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.th-tiers li { display: grid; justify-items: center; padding: 10px 4px; border-right: 1px solid var(--wv-line); }
.th-tiers li:last-child { border-right: 0; }
.th-tiers li.is-me { background: rgba(214, 226, 188, 0.75); }
html[data-theme='dark'] .th-tiers li.is-me { background: var(--wv-primary-soft); }
.th-tiers strong { font-variant-numeric: tabular-nums; }
.th-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.th-table th { text-align: left; font-size: 12px; color: var(--wv-muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--wv-line); }
.th-table td { padding: 8px 6px; border-bottom: 1px solid var(--wv-line); }
.th-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.th-table tr.is-me td { background: rgba(214, 226, 188, 0.75); font-weight: 700; }
html[data-theme='dark'] .th-table tr.is-me td { background: var(--wv-primary-soft); }
.th-table tr.is-click { cursor: pointer; }
.th-table tr.is-click:hover td { background: rgba(255, 255, 255, 0.5); }
.th-plain { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; display: grid; gap: 4px; }
.th-duel { display: grid; gap: 16px; }
.th-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.th-vs > div { display: grid; justify-items: center; gap: 4px; text-align: center; }
.th-vs span { color: var(--wv-muted); font-size: 14px; }
.th-vs-mark { font: 700 30px var(--tea-serif); color: var(--wv-primary) !important; }
.th-duel-q, .th-duel-end { display: grid; gap: 12px; justify-items: center; text-align: center; }
.th-duel-q h2 { font-size: 30px; }
.th-duel-q .th-options { width: 100%; }

/* Quests */
.th-quest-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.th-quests { list-style: none; margin: 0; padding: 0; }
.th-quests li { border-bottom: 1px solid var(--wv-line); }
.th-quests button { display: grid; gap: 6px; width: 100%; padding: 10px 6px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.th-quests button:hover { background: rgba(255, 255, 255, 0.45); }
.th-quests li.is-picked button { background: rgba(214, 226, 188, 0.75); }
html[data-theme='dark'] .th-quests li.is-picked button { background: var(--wv-primary-soft); }
.th-quest-top { display: flex; justify-content: space-between; gap: 10px; }
.th-quest-top strong { font-size: 15px; }
.th-quest-top span { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.th-quests small { color: var(--wv-muted); font-size: 12px; }
.th-quests li.is-done .th-quest-top span { color: var(--wv-ok); }
.th-picked { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.th-picked h2 { font-size: 20px; }

/* Prize admin */
.th-band { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 14px; background: rgba(214, 226, 188, 0.75); border: 1px solid var(--wv-line); font-weight: 700; font-size: 14px; }
html[data-theme='dark'] .th-band { background: var(--wv-primary-soft); }
.th-form-head, .th-form-row { display: grid; grid-template-columns: 92px 72px minmax(0, 1fr) 96px 36px; gap: 6px; align-items: center; }
.th-form-head { color: var(--wv-muted); font-size: 12px; margin-top: 8px; }
.th-form-row { margin-top: 6px; }
.th-form-row :is(input, select) { min-width: 0; height: 38px; padding: 0 8px; border: 1px solid var(--wv-line); border-radius: 4px; background: #FFFDF5; color: inherit; font: 15px var(--wv-font); }
.th-form-row input.num { text-align: right; }
html[data-theme='dark'] .th-form-row :is(input, select) { background: var(--wv-surface-2); }
.th-total { display: flex; justify-content: space-between; margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--wv-line); }
.th-total strong { font: 700 18px var(--tea-serif); }
.th-admin .th-card .th-actions { margin-bottom: 8px; }
.th-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.th-chip { min-height: 34px; padding: 0 12px; border: 1px solid var(--wv-line); border-radius: 9999px; background: #F2F0DC; color: inherit; font: 700 13px var(--wv-font); cursor: pointer; }
.th-chip.is-on { border-color: #1B371D; background: #FFFDF2; }
html[data-theme='dark'] .th-chip { background: var(--wv-surface-2); }
.th-status { font-size: 12px; font-weight: 700; }
.th-status.paid { color: var(--wv-ok); }
.th-status.void { color: var(--wv-muted); text-decoration: line-through; }
.th-status.pending { color: var(--wv-accent-ink); }

@media (min-width: 900px) {
  .th-split { grid-template-columns: minmax(0, 2.6fr) minmax(260px, 1fr); }
  .th-split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .th-ranked .th-split:last-of-type { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
  .th-quest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .th-hero { padding: 18px; }
  .th-tiers { grid-template-columns: repeat(3, 1fr); }
  .th-tiers li:nth-child(3) { border-right: 0; }
  .th-match { grid-template-columns: 1fr; }
  .th-form-head { display: none; }
  .th-form-row { grid-template-columns: 1fr 1fr; }
}

/* Arena: mode switch, language step, Solo pages (design C) */
.th-seg { display: inline-flex; margin-left: auto; border: 1px solid var(--wv-primary); border-radius: 9999px; overflow: hidden; }
.th-seg button { min-height: 40px; padding: 0 18px; border: 0; border-right: 1px solid var(--wv-primary); background: transparent; color: var(--wv-primary); font: 700 14px var(--wv-font); cursor: pointer; }
.th-seg button:last-child { border-right: 0; }
.th-seg button.is-on { background: var(--wv-primary); color: #FFFBEA; }
html[data-theme='dark'] .th-seg button.is-on { color: #142010; }
.th-arena-setup { display: grid; gap: 14px; padding: 22px; }
.th-arena-setup h2 { font-size: 24px; }
.th-lang-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.th-lang { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--wv-line); border-radius: 10px; background: rgba(255, 253, 245, 0.7); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.th-lang strong { font-size: 18px; }
.th-lang small { color: var(--wv-muted); font-size: 13px; }
.th-lang:hover { border-color: var(--wv-primary); }
.th-lang.is-on { border: 2px solid var(--wv-primary); padding: 13px 15px; background: rgba(214, 226, 188, 0.6); }
html[data-theme='dark'] .th-lang { background: var(--wv-surface-2); }
html[data-theme='dark'] .th-lang.is-on { background: var(--wv-primary-soft); }
.th-arena-start { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--wv-line); }
.th-solo { display: grid; gap: 14px; }
.th-solo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.th-solo-head h2 { font-size: 22px; }
.th-solo-sticky { position: sticky; top: 8px; z-index: 3; display: grid; gap: 8px; }
.th-solo-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border: 1px solid var(--wv-line); border-radius: 10px; background: rgba(255, 252, 240, 0.97); font-weight: 700; box-shadow: 0 6px 14px -10px rgba(36, 71, 30, 0.4); }
html[data-theme='dark'] .th-solo-count { background: rgba(29, 37, 25, 0.97); }
.th-solo-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.th-solo-dots i { width: 20px; height: 6px; border: 1px solid var(--wv-primary); border-radius: 3px; }
.th-solo-dots i.ok { background: var(--wv-primary); }
.th-solo-list { display: grid; gap: 14px; }
.th-solo-q { border: 1px solid var(--wv-line); border-radius: 10px; overflow: hidden; background: rgba(255, 253, 242, 0.88); }
html[data-theme='dark'] .th-solo-q { background: rgba(29, 37, 25, 0.88); }
.th-solo-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; background: var(--wv-primary); color: #FFFBEA; font-size: 14px; font-weight: 700; }
.th-solo-bar span { display: inline-flex; align-items: center; gap: 4px; }
html[data-theme='dark'] .th-solo-bar { color: #142010; }
.th-solo-body { padding: 16px 18px 18px; }
.th-solo-body h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.45; }
.th-solo-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--wv-line); border-radius: 8px; background: rgba(255, 255, 250, 0.75); color: inherit; font: 500 16px var(--wv-font); text-align: left; cursor: pointer; }
.th-solo-opt:hover { border-color: var(--wv-primary); }
.th-solo-opt.is-on { border: 2px solid var(--wv-primary); padding: 9px 13px; background: rgba(214, 226, 188, 0.6); font-weight: 700; }
.th-solo-opt .wv-icon { color: var(--wv-primary); }
html[data-theme='dark'] .th-solo-opt { background: var(--wv-surface-2); }
html[data-theme='dark'] .th-solo-opt.is-on { background: var(--wv-primary-soft); }
.th-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--wv-line); }
.th-pager-mid { display: grid; text-align: center; font-variant-numeric: tabular-nums; }
.th-pager-mid small { color: var(--wv-muted); font-size: 13px; }
.th-round { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--wv-primary); border-radius: 9999px; background: transparent; color: var(--wv-primary); cursor: pointer; }
.th-round:hover:not(:disabled) { background: var(--wv-primary-soft); }
.th-round:disabled { opacity: 0.35; cursor: not-allowed; }
.th-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 2px solid var(--wv-primary); border-radius: 10px; background: rgba(255, 252, 240, 0.95); }
html[data-theme='dark'] .th-confirm { background: var(--wv-surface); }
.th-solo-result .th-review li span { line-height: 1.5; }
.th-lines { list-style: none; margin: 0; padding: 0; }
.th-lines li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--wv-line); font-size: 14px; }
.th-lines li:last-child { border-bottom: 0; }
.th-lines li.is-done span { color: var(--wv-ok); }
@media (max-width: 900px) { .th-lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .th-seg { margin-left: 0; } }

.th-solo-dots { margin-left: auto; }
.th-giveup { min-height: 36px; padding: 0 14px; font-size: 14px; }
.th-solo-sticky .th-confirm { box-shadow: 0 8px 18px -12px rgba(36, 71, 30, 0.5); }

/* ---------- Profile and edit profile (design B: sticky left column) ---------- */
.pf-split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.pf-side { position: sticky; top: 16px; display: grid; gap: 14px; justify-items: center; text-align: center; padding: 22px; }
.pf-id h1 { font: 700 26px/1.15 var(--tea-serif); overflow-wrap: anywhere; }
.pf-handle { color: var(--wv-muted); font-size: 13px; overflow-wrap: anywhere; }
.pf-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.pf-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border: 1px solid var(--wv-line); border-radius: 999px; font-size: 12px; font-weight: 600; }
.pf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wv-primary); }
.pf-bio { font-size: 14px; color: var(--wv-text); }
.pf-stats { width: 100%; margin: 0; border-top: 1px solid var(--wv-line); text-align: left; }
.pf-stats div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--tea-rule); font-size: 14px; }
.pf-stats dt { color: var(--wv-muted); }
.pf-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-meta { width: 100%; list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; text-align: left; }
.pf-meta li { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.pf-actions { width: 100%; display: grid; gap: 8px; }
.pf-actions .th-btn { width: 100%; justify-content: center; }
.pf-minor { display: flex; justify-content: center; gap: 16px; }
.pf-link { border: 0; background: none; padding: 4px; color: var(--wv-muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.pf-badges { width: 100%; text-align: left; }
.pf-badges h2 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.pf-badges ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pf-badges li { display: grid; font-size: 13px; }
.pf-badges li span { color: var(--wv-muted); font-size: 12px; }
.pf-locked { display: flex; align-items: center; gap: 6px; font-size: 12px; }

.pf-main { display: grid; gap: 26px; min-width: 0; }
.pf-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--wv-line); }
.pf-sec-head h2 { font-size: 19px; font-weight: 700; }
.pf-sec-head span { color: var(--wv-muted); font-size: 13px; }
.pf-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-lang { display: grid; gap: 6px; padding: 14px 16px; }
.pf-lang-top { display: flex; align-items: center; gap: 8px; }
.pf-lang-top b { margin-left: auto; font-variant-numeric: tabular-nums; }
.pf-code { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 4px; border: 1px solid var(--wv-line); border-radius: 4px; font-size: 11px; font-weight: 700; }
.pf-bar { height: 6px; border: 1px solid var(--wv-line); border-radius: 99px; overflow: hidden; }
.pf-bar i { display: block; height: 100%; background: var(--wv-primary); }
.pf-posts, .pf-feed { list-style: none; margin: 0; padding: 0; }
.pf-posts li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--tea-rule); }
.pf-posts li:first-child { border-top: 0; padding-top: 0; }
.pf-posts small { color: var(--wv-muted); }
.pf-feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto 96px; gap: 14px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--tea-rule); font-size: 14px; }
.pf-feed li:first-child { border-top: 0; }
.pf-feed b { font-variant-numeric: tabular-nums; color: var(--wv-primary); }
.pf-feed time { color: var(--wv-muted); font-size: 12px; text-align: right; }
.pf-empty { display: grid; gap: 12px; justify-items: start; }

.pf-form section { display: grid; gap: 12px; }
.pf-form .pf-sec-head { margin-bottom: 2px; }
.pf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-upload { cursor: pointer; }
.pf-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.pf-field small { font-weight: 400; color: var(--wv-muted); }
.pf-field input[type='range'] { accent-color: var(--wv-primary); width: 100%; }
.pf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 14px; border: 1px solid var(--wv-line); border-radius: 999px; background: transparent; color: var(--wv-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pf-chip.on { background: var(--wv-primary); border-color: var(--wv-primary); color: #fff; }
.pf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pf-tile { display: grid; gap: 2px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--wv-line); border-radius: 8px; background: transparent; color: var(--wv-text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.pf-tile small { font-weight: 400; color: var(--wv-muted); }
.pf-tile.on { border: 2px solid var(--wv-primary); padding: 9px 11px; }
.pf-tile:disabled { opacity: 0.5; cursor: not-allowed; }
.pf-badge-list { list-style: none; margin: 0; padding: 0; }
.pf-badge-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--tea-rule); font-weight: 400; }
.pf-badge-list li:first-child { border-top: 0; }
.pf-badge-list li > div:first-child { display: grid; font-size: 14px; }
.pf-badge-list li span { color: var(--wv-muted); font-size: 12px; }
.pf-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.pf-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.pf-check input { width: 17px; height: 17px; accent-color: var(--wv-primary); }
.pf-feedback { padding: 10px 14px; border: 1px solid var(--wv-line); border-radius: 8px; font-weight: 600; }
.pf-feedback.err { border-color: #A3412E; color: #A3412E; }

@media (max-width: 900px) {
  .pf-split { grid-template-columns: 1fr; }
  .pf-side { position: static; }
}
@media (max-width: 600px) {
  .pf-langs, .pf-grid2, .pf-grid3, .pf-checks { grid-template-columns: 1fr; }
  .pf-feed li { grid-template-columns: minmax(0, 1fr) auto; }
  .pf-feed time { grid-column: 1 / -1; text-align: left; }
  .pf-badge-list li { flex-wrap: wrap; }
}
.pf-locked { white-space: nowrap; }

/* ---------- SRS review: calm the bright greens to the tea palette ---------- */
.srs-character-display { color: var(--wv-text); font-weight: 700; }
.srs-tts-circle-btn { background: transparent !important; border: 1px solid var(--wv-line) !important; color: var(--wv-text) !important; }
.srs-tts-circle-btn:hover { background: var(--wv-primary-soft) !important; color: var(--wv-text) !important; border-color: var(--wv-primary) !important; }
.srs-reveal-btn, html[data-theme='dark'] .srs-reveal-btn { background: var(--wv-primary) !important; background-image: none !important; box-shadow: none !important; color: #fff !important; }
.srs-reveal-btn:hover, html[data-theme='dark'] .srs-reveal-btn:hover { background: var(--wv-primary-hover) !important; }
.srs-state-badge.state-reviewing, .srs-state-badge.state-mastered { background: transparent; border: 1px solid var(--wv-line); color: var(--wv-text); }
.mcp-painted-note { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--wv-line); border-radius: 8px; font-size: 14px; color: var(--wv-text); }

/* Duel surrender sits under the question; Solo counter stays on one line on phones. */
.th-duel-forfeit { display: flex; justify-content: center; }
.th-duel > .th-confirm { justify-self: stretch; }
.th-solo-count > span[role='status'] { white-space: nowrap; }
.th-solo-head .th-link { white-space: nowrap; }
@media (max-width: 600px) {
  .th-solo-count { gap: 8px; padding: 10px 12px; }
  .th-solo-dots { flex-wrap: nowrap; gap: 2px; min-width: 0; flex: 1; }
  .th-solo-dots i { width: auto; flex: 1; min-width: 3px; height: 5px; }
  .th-solo-head { align-items: flex-start; }
  .th-solo-head h2 { font-size: 19px; }
}

/* ---------- Phone spacing pass ----------
   Plain page headers had a border but no padding, so text touched the frame. */
.page-top-banner { padding: 20px 22px !important; border-radius: 14px; }
.privacy-toggles-grid { display: grid; gap: 10px; }
.checkbox-inline { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.checkbox-inline input { flex: none; margin-top: 4px; }

/* Creator hub number tiles had no styling at all. */
.creator-metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.creator-metric-card { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; }
.cmc-label { font-size: 13px; color: var(--wv-muted); line-height: 1.4; }
.cmc-val { font-size: 22px; font-weight: 700; color: var(--wv-text); }

@media (max-width: 600px) {
  .creator-metrics-grid { gap: 8px; }
  .creator-metric-card { padding: 12px; }
  .cmc-label { font-size: 11.5px; }
  .cmc-val { font-size: 18px; }

  /* Headers: smaller titles, less frame. */
  :is(.page-top-banner, .srs-header-banner, .weakness-hero-banner, .stroke-hero-banner, .speech-hero-banner,
      .shop-hero-banner, .quotes-slang-hero-banner, .quest-hero-banner, .career-hero-banner, .arena-hero-banner,
      .analytics-hero-banner) { padding: 18px 16px !important; gap: 12px !important; }
  :is(.page-heading, .srs-page-title, .weakness-page-title, .stroke-page-title, .speech-page-title, .analytics-page-title,
      .ahb-title) { font-size: 21px !important; line-height: 1.35 !important; }
  :is(.page-subheading, .srs-page-subtitle, .weakness-page-subtitle, .stroke-page-subtitle, .speech-page-subtitle,
      .analytics-page-subtitle, .ahb-sub) { font-size: 13.5px !important; line-height: 1.55 !important; }

  /* One layer of padding is enough on a phone; nested cards get less. */
  :is(.dash-section-card, .weakness-section-card, .chart-card, .speech-studio-card, .speech-info-card, .stroke-board-section,
      .stroke-char-picker, .srs-flashcard, .srs-curve-card, .srs-tip-box, .community-post-card, .community-filter-bar,
      .shop-item-card) { padding: 16px !important; }
  :is(.weakness-item-card, .skill-meter-card, .partner-card, .speech-target-box, .wic-solution-box, .wic-drill-wrap,
      .char-meta-card, .speech-empty-state, .cpc-comments-box) { padding: 12px !important; }

  /* Number tiles: two per row instead of a tall stack. */
  :is(.srs-stats-grid, .analytics-kpi-grid) { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  :is(.srs-stat-card, .kpi-card) { padding: 12px !important; gap: 10px !important; align-items: center; }
  :is(.srs-stat-icon, .kpi-icon) { width: 32px !important; height: 32px !important; flex: none; }
  :is(.srs-stat-icon, .kpi-icon) svg { width: 20px; height: 20px; }
  :is(.srs-stat-value, .kpi-val) { font-size: 19px !important; }
  :is(.srs-stat-label, .kpi-label) { font-size: 11.5px !important; line-height: 1.35; }

  /* Pronunciation: the five sentence tabs scroll sideways instead of widening the page. */
  .speech-main-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .speech-main-grid > * { min-width: 0; width: auto !important; }
  .speech-nav-tabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  .speech-tab-btn { flex: none !important; }
  .target-chinese-text { font-size: 26px !important; }
  .btn-mic-record { padding: 16px 18px !important; }

  /* Review card: tags stay on one line, the word fits the card. */
  .srs-card-header { flex-wrap: wrap; gap: 6px !important; }
  .srs-card-header > * { white-space: nowrap; }
  .srs-character-display { font-size: clamp(48px, 17vw, 72px) !important; line-height: 1.15 !important; }

  /* Stroke order: even buttons in two columns. */
  .sm-tab { padding: 10px 12px !important; font-size: 13px !important; }
  .stroke-controls-bar { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; }
  .btn-stroke-act { width: 100% !important; padding: 10px 8px !important; justify-content: center; }

  /* Community post: actions on their own row under the author. */
  .cpc-header { flex-wrap: wrap; gap: 10px !important; }
  .cpc-header > :not(.cpc-author) { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; flex-direction: row !important; }
  .cpc-comment-input-row button { white-space: nowrap; }

  /* Chat: header actions under the name; partner filters full width in two columns. */
  .caw-header { flex-wrap: wrap; gap: 10px !important; }
  .caw-actions { display: flex !important; flex-wrap: wrap; gap: 6px; width: 100%; flex-direction: row !important; }
  .ccs-search-box input { width: 100% !important; }
  .caw-input-bar input { flex: 1; min-width: 0; }
  .dash-section-header { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  .dash-section-header > div { width: 100% !important; }
  .partner-filters-row { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; width: 100% !important; }
  .partner-filters-row > * { width: 100% !important; min-width: 0; }
  .partner-filters-row > input { grid-column: 1 / -1; }

  /* Shop: the balance card sits under the title at its natural width. */
  .shop-balance-card { padding: 14px 16px !important; }
  .sbc-amount { font-size: 22px !important; }

  /* Song lines: the play button goes under the lyric so the lyric gets the full width. */
  :is(.song-stage-board, .song-line-box) { padding: 12px !important; }
  .slb-full-row { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }
  .slb-texts { width: 100%; }

  /* Small fixes: the level tag stays whole; list bullets sit inside the card. */
  .cpc-lvl-pill { white-space: nowrap; }
  .simple-bullet-list { padding-left: 20px !important; }

  /* Landing: the hero no longer reserves a full screen of empty space. */
  .wv-home .wv-hero { min-height: 0 !important; padding-top: 40px !important; padding-bottom: 40px !important; }
  .wv-home { gap: 44px !important; }
  .wv-home .wv-tagline { padding-top: 8px !important; padding-bottom: 8px !important; }
  .wv-tagline-text { font-size: 26px !important; line-height: 38px !important; }
}

/* Karnlearnlu logo: the red brush circle stands on its own, no tile behind it. */
.lingora-logo-mark { background: none !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }
.lingora-logo-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-logo-img { background: none !important; box-shadow: none !important; border-radius: 0 !important; object-fit: contain; }
.tea-brand { display: none; align-items: center; gap: 10px; padding: 18px 6px 14px !important; font-size: 25px !important; letter-spacing: -0.02em; }
.tea-brand img { position: static !important; flex: none; width: 52px; height: 52px; object-fit: contain; }
@media (min-width: 1024px) { .tea-brand { display: flex !important; } }
