/* Compact management sections; existing forms retain their IDs and handlers. */
#admin-page > .admin-grid {
  display: contents;
}
.admin-search-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}
.admin-search-field {
  flex: 1;
  min-width: 0;
}
.admin-search-field label {
  display: block;
  margin: 0 0 9px;
  font-size: 13px;
  color: #dfdec3;
}
.admin-search-field > div {
  position: relative;
}
#admin-search {
  width: 100%;
  min-height: 46px;
  border: 1px solid #78956b80;
  background: #102f22;
  color: #f6f2dc;
  border-radius: 10px;
  padding: 12px 44px 12px 15px;
  font:
    14px Arial,
    sans-serif;
  text-transform: none;
}
#admin-search-clear {
  position: absolute;
  right: 9px;
  top: 7px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: #38523b;
  color: #f8e5bc;
  font-size: 22px;
}
.admin-search-result {
  font-size: 12px;
  color: #b5c7a9;
  margin-bottom: 20px;
}
#admin-page .admin-category {
  padding: 0;
  min-height: 0;
  border: 1px solid #9da87866;
  border-radius: 12px;
  background: linear-gradient(120deg, #22442f, #163629);
  margin: 0 0 12px;
  overflow: clip;
}
.admin-category > summary {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 15px 20px;
  font:
    700 15px/1.5 Arial,
    sans-serif;
  color: #f2e8ca;
}
.admin-category > summary::-webkit-details-marker {
  display: none;
}
.admin-category > summary:hover {
  background: #3b5a393d;
}
.admin-category > summary:focus-visible {
  outline: 2px solid #edd090;
  outline-offset: -4px;
}
.admin-category-arrow {
  font-size: 20px;
  color: #ddbf81;
  transition: transform 0.15s;
}
.admin-category[open] > .admin-category-arrow,
.admin-category[open] > summary > .admin-category-arrow {
  transform: rotate(180deg);
}
.admin-category[open] > summary {
  background: #682536;
  border-bottom: 1px solid #c3a16a77;
}
#admin-page .admin-category > .panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 24px;
  background: #102e23;
  box-shadow: none;
  min-width: 0;
}
#admin-page .admin-category > .panel::before,
#admin-page .admin-category > .panel::after {
  content: none;
}
.avatar-card {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 25px;
  margin-bottom: 26px;
}
.avatar-card h2 {
  font-size: 20px;
  margin: 0 0 10px;
  color: #f2e3c4;
}
.avatar-card p {
  font-size: 13px;
  color: #c2d2ba;
  line-height: 1.7;
  text-transform: none;
}
.avatar-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #d9b578;
  background: #355740;
  font-size: 35px;
  color: #f4d79d;
  overflow: hidden;
}
[data-avatar] {
  overflow: hidden;
}
[data-avatar] img,
.avatar-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar-upload-label {
  display: block;
  font-size: 13px;
  color: #f0d29b;
  margin: 12px 0 8px;
}
#avatar-file {
  max-width: 100%;
  font:
    13px Arial,
    sans-serif;
  color: #cfddc8;
}
#avatar-file::file-selector-button {
  font:
    700 12px Arial,
    sans-serif;
  padding: 10px 14px;
  margin-right: 10px;
  border: 1px solid #ddb577;
  border-radius: 7px;
  color: #fff0ce;
  background: #8d2e3a;
  cursor: pointer;
}
.site-logo .logo-mark,
.sidebar .logo-mark {
  display: block;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  width: 44px;
  height: 50px;
  flex-shrink: 0;
}
.site-logo .logo-mark::before,
.site-logo .logo-mark::after {
  content: none;
}
.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px #04190e40);
}
.sidebar-logo {
  gap: 7px;
}
.sidebar-logo .brand-name {
  font-size: 15px;
}
.sidebar-logo small {
  font-size: 10px;
}
@media (max-width: 1150px) and (min-width: 901px) {
  .sidebar-logo .brand-name {
    font-size: 13px;
  }
  .sidebar-logo small {
    font-size: 9px;
  }
  .sidebar .logo-mark {
    width: 36px;
    height: 44px;
  }
}
@media (max-width: 650px) {
  .admin-search-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .admin-category > summary {
    padding: 17px;
    font-size: 14px;
  }
  #admin-page .admin-category > .panel {
    padding: 18px;
  }
  .avatar-card {
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }
  .avatar-preview {
    width: 80px;
    height: 80px;
  }
  .sidebar .logo-mark {
    width: 38px;
    height: 43px;
  }
  .sidebar-logo .brand-name {
    font-size: 17px;
  }
  .sidebar-logo small {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .admin-category-arrow {
    transition: none;
  }
}

/* Mobile surfaces: inset cards expose every rounded corner on narrow screens. */
@media (max-width: 650px) {
  .auth-screen {
    padding: 32px 12px 22px;
    gap: 16px;
    background: transparent;
    min-height: 100svh;
  }
  .auth-story,
  .auth-form-side {
    min-width: 0;
    border: 1px solid #78936a66;
    border-radius: 28px;
    padding: 28px 20px;
    background-clip: padding-box;
    box-shadow: 0 12px 28px #041b1430;
  }
  .auth-story::after {
    border-radius: inherit;
  }
  .auth-story h1 br:nth-of-type(2) {
    display: initial;
  }
  .auth-story h1 em {
    margin-left: 0;
  }
  .auth-form-card {
    padding-top: 0;
    min-width: 0;
  }
  .auth-art.christmas-auth-art {
    height: auto;
    aspect-ratio: 5 / 3;
    margin-bottom: 0;
    border-radius: 24px;
    overflow: hidden;
    isolation: isolate;
  }
  .christmas-auth-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
  }
  .sidebar {
    width: calc(100% - 24px);
    margin: 28px 12px 12px;
    padding: 20px 14px 14px;
    border: 1px solid #99aa7670;
    border-radius: 25px;
    background-clip: padding-box;
    box-shadow: 0 8px 24px #061b1430;
  }
  .sidebar nav {
    gap: 6px;
  }
  .sidebar .nav-item {
    border-radius: 14px;
    padding: 11px 4px;
  }
  .sidebar .nav-item.active {
    border-radius: 14px;
  }
  .topbar {
    top: 8px;
    margin: 0 12px 12px;
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #d0ab7866;
    border-radius: 22px;
    background-clip: padding-box;
    box-shadow: 0 8px 22px #18071240;
  }
  .topbar .header-wallet-button {
    min-width: 0;
    border-radius: 16px;
  }
  .topbar-right {
    min-width: 0;
  }
  .panel,
  .quick-card,
  .stat-card,
  .home-note,
  .welcome-hero,
  .earn-task,
  .earn-cooldown,
  .earn-overview article,
  .earn-payment-grid > .panel,
  .community-row,
  .community-review,
  .community-empty,
  .referral-person,
  .referral-support,
  .help-winter-hero,
  .help-support-cta,
  .contact-hero,
  .contact-card,
  .guide-art-card,
  .tutorial-step,
  .support-thread-empty {
    border-radius: 23px;
    background-clip: padding-box;
  }
  #admin-page .admin-category {
    border-radius: 21px;
  }
  #admin-page .admin-category > .panel {
    border-radius: 0 0 20px 20px;
  }
  .admin-category > summary {
    border-radius: 20px;
  }
  .admin-category[open] > summary {
    border-radius: 20px 20px 0 0;
  }
  .panel .table-scroll {
    border-radius: 17px;
  }
  .community-dialog,
  .task-editor-dialog,
  .guide-preview-dialog {
    border-radius: 26px;
  }
  .notice-card,
  .payout-recipient,
  .community-message,
  .admin-message,
  .demo-note,
  .guide-tip,
  .deposit-result,
  .payment-method,
  .live-service {
    border-radius: 18px;
  }
  .auth-tabs,
  .earn-tabs,
  .guide-tabs {
    border-radius: 20px;
    padding: 5px;
  }
  .auth-tabs button,
  .auth-tabs button.selected,
  .earn-tabs button,
  .earn-tabs button.selected,
  .guide-tabs button,
  .guide-tabs button.selected {
    border-radius: 15px;
  }
  .button,
  .button.primary,
  .button.white,
  .dialog-close,
  .logout-button,
  .notice-bell,
  .snow-toggle,
  .amount-presets button {
    border-radius: 999px;
  }
  form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  form select,
  form textarea,
  .live-select,
  .community-card input:not([type="checkbox"]):not([type="file"]),
  .community-card select,
  .community-card textarea,
  .community-dialog input:not([type="checkbox"]),
  .community-dialog select,
  .community-dialog textarea,
  #admin-search,
  .catalog-search-control {
    border-radius: 16px;
  }
  /* Prevent iOS from zooming the page when a small form field receives focus. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea,
  form input,
  .live-select,
  .community-card input,
  .community-card select,
  .community-card textarea,
  #admin-search,
  #catalog-search {
    font-size: 16px;
  }
  #avatar-file::file-selector-button {
    border-radius: 999px;
  }
  .christmas-art,
  .christmas-art img {
    border-radius: inherit;
  }
}
@media (max-width: 380px) {
  .topbar-right > .avatar {
    display: none;
  }
  .topbar .header-wallet-button {
    flex: 1;
  }
  .topbar-right {
    width: 100%;
    gap: 6px;
  }
}

/* Soft snow and a shaded winter vignette replace the old vine garlands. */
.festive-lights {
  top: -9px;
  height: 26px;
  background: url("holiday-snow.svg") center top / 100% 100% no-repeat;
  opacity: 0.96;
  filter: drop-shadow(0 3px 3px #071c193b);
}
.content::before {
  content: none;
  background: none;
}
.holiday-pine-left {
  display: none;
}
.holiday-corner {
  top: 104px;
  right: 8px;
  bottom: auto;
  width: 185px;
  height: 165px;
  background: url("holiday-corner.svg?v=0.18.2") center / contain no-repeat;
  opacity: 0.88;
  transform: none;
}
.auth-art.christmas-auth-art {
  height: 265px;
  max-width: 460px;
  margin-top: 15px;
}
.auth-art.christmas-auth-art img {
  object-fit: contain;
  object-position: center;
  background: radial-gradient(ellipse at 50% 80%, #8abcb42b, transparent 65%);
  filter: none;
}
.support-floating::before {
  content: none;
}

/* Mobile navigation lives in a modal drawer, not a grid above the page. */
.mobile-menu-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid #bba57866;
  border-radius: 14px;
  background: #6b263880;
  color: #fff0ce;
  padding: 0;
}
.mobile-menu {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  width: min(330px, 86vw);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-right: 1px solid #acb18177;
  border-radius: 0 25px 25px 0;
  padding: 0;
  color: #f7ebd1;
  background: linear-gradient(160deg, #244a34, #102e24);
  box-shadow: 16px 0 60px #00170d60;
  overflow: hidden;
}
.mobile-menu[open] {
  display: flex;
  flex-direction: column;
  animation: menu-enter 0.2s ease-out;
}
.mobile-menu::backdrop {
  background: #06150faf;
  backdrop-filter: blur(5px);
}
html.mobile-menu-open,
html.mobile-menu-open body {
  overflow: hidden;
}
.mobile-menu-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 6px;
  padding-top: max(16px, env(safe-area-inset-top));
  flex-shrink: 0;
}
.mobile-menu-heading > span {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #c5ccaa;
}
#mobile-menu-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #b9ae7980;
  border-radius: 50%;
  background: #35543e;
  color: #f6e5c0;
  font:
    26px/1 Arial,
    sans-serif;
}
.mobile-menu-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6b8054 transparent;
}
.mobile-menu .sidebar {
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 12px 17px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mobile-menu .sidebar-logo {
  padding: 0;
  gap: 9px;
  align-self: flex-start;
}
.mobile-menu .sidebar-logo > .brand-wordmark {
  display: block;
}
.mobile-menu .sidebar-logo .brand-name {
  font-size: 16px;
}
.mobile-menu .sidebar-logo small {
  display: block;
  font-size: 10px;
}
.mobile-menu .sidebar .logo-mark {
  width: 39px;
  height: 45px;
}
.mobile-menu .workspace {
  display: flex;
  margin: 22px 0 20px;
}
.mobile-menu .nav-label {
  display: block;
  margin: 0 0 12px;
  padding: 0 10px;
  font-size: 10px;
}
.mobile-menu .sidebar nav,
.mobile-menu .sidebar nav:has(#admin-nav:not([hidden])) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.mobile-menu .sidebar .nav-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: 47px;
  height: auto;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  white-space: normal;
  text-align: left;
  border-radius: 13px;
  margin: 0;
}
.mobile-menu .sidebar .nav-item > span {
  width: 24px;
  font-size: 19px;
  flex-shrink: 0;
}
.mobile-menu .sidebar .nav-item b {
  display: inline-block;
  margin-left: auto;
}
.mobile-menu .sidebar-bottom {
  display: block;
  margin-top: 20px;
}
.mobile-menu .help-card {
  display: none;
}
.mobile-menu .profile {
  margin-top: 0;
  padding-top: 16px;
}
.mobile-menu-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 17px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid #7d946044;
  background: #102a22;
  flex-shrink: 0;
}
.mobile-menu .snow-toggle {
  width: auto;
  min-width: 0;
  height: 40px;
  padding: 8px 10px;
  gap: 6px;
  border-radius: 14px;
  font-size: 11px;
}
.mobile-menu .snow-toggle > span:last-child {
  display: inline;
}
.mobile-menu .logout-button {
  height: 40px;
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 14px;
}
@keyframes menu-enter {
  from {
    transform: translateX(-100%);
    opacity: 0.7;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@media (max-width: 900px) {
  #app-shell > main {
    margin-left: 0;
    width: 100%;
  }
  .topbar {
    margin: 12px 12px 0;
    top: 8px;
    height: 68px;
    padding: 0 10px;
    gap: 10px;
    border-radius: 20px;
    border: 1px solid #ceae7d66;
  }
  .topbar > div:not(.topbar-right) {
    display: none;
  }
  .topbar-right {
    flex: 1;
    width: auto;
    min-width: 0;
    gap: 9px;
    justify-content: flex-end;
  }
  .topbar-right > .demo-badge {
    display: none;
  }
  .topbar .header-wallet-button {
    min-width: 100px;
    margin: 0;
    padding: 7px 10px;
    border-radius: 15px;
    gap: 7px;
  }
  .topbar .header-wallet-button > span:first-child {
    display: none;
  }
  .topbar .header-wallet-button strong {
    font-size: 14px;
  }
  .topbar .header-wallet-button small {
    font-size: 10px;
  }
  .topbar .topbar-right > .avatar {
    display: grid;
    width: 31px;
    height: 31px;
    flex-shrink: 0;
  }
  .topbar .notice-bell {
    width: 35px;
    height: 37px;
  }
  .content {
    padding-top: 24px;
  }
  .holiday-corner {
    display: none;
  }
}
@media (max-width: 380px) {
  .topbar {
    gap: 7px;
  }
  .topbar-right {
    gap: 7px;
  }
  .topbar .header-wallet-button {
    flex: 0 1 auto;
    min-width: 94px;
    padding: 6px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu[open] {
    animation: none;
  }
}

/* Full-width snow caps: the cap follows the frame instead of a short patch. */
.quick-arrow {
  display: none;
}
.quick-card,
.home-note,
.stat-card,
.panel,
.auth-story,
.auth-form-side {
  position: relative;
}
.quick-card::before,
.home-note::before,
.stat-card::before,
.panel::before,
.welcome-hero::before,
.auth-story::before,
.auth-form-side::before,
.earn-overview article::before {
  content: "";
  position: absolute;
  inset: -9px -1px auto -1px;
  width: auto;
  height: 24px;
  border-radius: inherit;
  background: url("holiday-snow.svg") center top / 100% 100% no-repeat;
  opacity: 1;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 2px #13362c30);
}
.panel::before {
  top: 0;
  height: 18px;
}
.quick-card::before {
  left: -1px;
  right: -1px;
  width: auto;
}
.quick-grid {
  row-gap: 24px;
}
.home-note {
  margin-top: 28px;
}
#admin-page .admin-category::before {
  content: none;
}
@media (max-width: 650px) {
  .quick-card::before,
  .home-note::before,
  .stat-card::before,
  .welcome-hero::before,
  .earn-overview article::before {
    top: -7px;
    height: 20px;
  }
  .auth-story::before,
  .auth-form-side::before {
    top: 0;
    height: 20px;
  }
  .auth-form-side {
    overflow: hidden;
  }
}
@media (max-width: 1400px) {
  .holiday-corner {
    width: 128px;
    height: 117px;
    opacity: 0.7;
  }
}
@media (max-width: 650px) {
  .festive-lights {
    height: 21px;
    top: -8px;
  }
  .holiday-corner {
    display: none;
  }
  .auth-art.christmas-auth-art {
    height: auto;
    aspect-ratio: 5 / 4;
    max-width: 100%;
    margin-top: 14px;
    border-radius: 24px;
  }
  .content {
    padding-top: 25px;
  }
}
