@font-face {
  font-family: "Entfalta Segoe Print";
  src: url("segoepr.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --leaf: #3f6f45;
  --moss: #6f8f55;
  --orange: #d77d32;
  --clay: #8a5637;
  --ink: #2b241f;
  --paper: #fffaf0;
  --cream: #f7eedc;
  --line: rgba(63, 48, 37, 0.18);
  --soft-line: rgba(255, 255, 255, 0.42);
  --shadow: 0 16px 42px rgba(46, 35, 24, 0.13);
  --shadow-hover: 0 22px 52px rgba(46, 35, 24, 0.18);
  --radius: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --header-height: 72px;
  --clean-font: "Entfalta Segoe Print", cursive;
  --story-font: "Entfalta Segoe Print", cursive;
  --ios-readable-font: "Entfalta Segoe Print", cursive;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
}

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-corner {
  width: 0;
  height: 0;
  display: none;
  background: transparent;
}

.page-scroll-indicator {
  position: fixed;
  top: 12px;
  right: 5px;
  z-index: 180;
  width: 5px;
  min-height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--leaf), var(--clay));
  box-shadow: 0 6px 16px rgba(46, 35, 24, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.page-scroll-indicator.is-visible {
  opacity: 0.82;
}

body.has-modal-open .page-scroll-indicator,
body.has-cart-open .page-scroll-indicator {
  display: none;
}

#bookModal .modal-content {
  scrollbar-width: none;
}

#bookModal .modal-content::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--clean-font);
  background:
    radial-gradient(circle at 18% 8%, rgba(215, 125, 50, 0.18), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(63, 111, 69, 0.18), transparent 32%),
    linear-gradient(135deg, #fffaf0 0%, #f3e6d0 48%, #e9c9a6 100%);
  min-height: 100vh;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.design-modern {
  font-family: var(--story-font);
  font-weight: 600;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 14% 10%, rgba(215, 125, 50, 0.22), transparent 26%),
    radial-gradient(circle at 88% 16%, rgba(63, 111, 69, 0.2), transparent 30%),
    radial-gradient(circle at 62% 88%, rgba(138, 86, 55, 0.16), transparent 28%),
    linear-gradient(135deg, #fffaf0 0%, #f2dfc4 46%, #e8c197 100%);
}

body.design-modern::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 250, 240, 0.28) 19% 21%, transparent 22% 100%),
    radial-gradient(ellipse at 8% 42%, rgba(63, 111, 69, 0.09), transparent 34%),
    radial-gradient(ellipse at 92% 72%, rgba(215, 125, 50, 0.11), transparent 32%);
  opacity: 0.95;
  animation: watercolorDrift 16s ease-in-out infinite alternate;
}

body.design-modern::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 250, 240, 0.18), transparent),
    radial-gradient(circle at 50% 0%, rgba(255, 250, 240, 0.22), transparent 36%);
  mix-blend-mode: soft-light;
  opacity: 0.7;
  animation: paperShimmer 9s ease-in-out infinite;
}

body.theme-dark {
  --ink: #f8efe1;
  --paper: #1f241d;
  --cream: #2b3025;
  --line: rgba(255, 250, 240, 0.18);
  --soft-line: rgba(255, 250, 240, 0.18);
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 10%, rgba(215, 125, 50, 0.16), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(63, 111, 69, 0.24), transparent 30%),
    linear-gradient(135deg, #171b15 0%, #24281e 48%, #34271f 100%);
}

body.theme-dark .site-header,
body.theme-dark .panel,
body.theme-dark .modal-content,
body.theme-dark .cart-drawer,
body.theme-dark .book-card,
body.theme-dark .admin-item,
body.theme-dark .cart-item,
body.theme-dark .review-item,
body.theme-dark .newsletter-card,
body.theme-dark .auth-action-card {
  border-color: rgba(255, 250, 240, 0.16);
  background:
    linear-gradient(180deg, rgba(35, 40, 30, 0.96), rgba(43, 48, 37, 0.9));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  border-color: rgba(255, 250, 240, 0.18);
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.08);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder,
body.theme-dark .muted,
body.theme-dark .brand small {
  color: rgba(255, 250, 240, 0.68);
}

body.theme-dark .icon-button,
body.theme-dark .user-button,
body.theme-dark .secondary-link,
body.theme-dark .mini-link-button,
body.theme-dark .google-button {
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.1);
}

body.theme-dark .stock-pill,
body.theme-dark .role-pill {
  border-color: rgba(255, 250, 240, 0.18);
  color: #fffaf0;
  background: rgba(63, 111, 69, 0.22);
}

body.design-modern .brand strong,
body.design-modern .hero h1,
body.design-modern .newsletter-hero h1,
body.design-modern .account-page-heading h1,
body.design-modern .panel > h1 {
  font-family: var(--story-font);
  letter-spacing: 0;
}

body.design-modern h1,
body.design-modern h2,
body.design-modern h3,
body.design-modern .book-title,
body.design-modern .brand,
body.design-modern .main-nav,
body.design-modern button,
body.design-modern input,
body.design-modern select,
body.design-modern textarea,
body.design-modern .stock-pill,
body.design-modern .price,
body.design-modern .stars {
  font-family: var(--story-font);
  letter-spacing: 0;
}

body.design-modern p,
body.design-modern li,
body.design-modern label,
body.design-modern .muted,
body.design-modern .cart-summary,
body.design-modern .review-item,
body.design-modern .admin-item {
  font-family: var(--story-font);
  letter-spacing: 0;
}

body.design-modern .legal-document,
body.design-modern .legal-document *,
.legal-document,
.legal-document * {
  font-family: var(--clean-font);
  font-weight: 400;
  letter-spacing: 0;
}

body.design-modern .site-header {
  border-bottom-color: rgba(63, 111, 69, 0.2);
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.94), rgba(255, 247, 232, 0.82)),
    linear-gradient(135deg, rgba(63, 111, 69, 0.1), rgba(215, 125, 50, 0.08));
  box-shadow: 0 14px 36px rgba(46, 35, 24, 0.12);
}

body.design-modern .main-nav a,
body.design-modern .admin-header-link,
body.design-modern .icon-button {
  position: relative;
  overflow: hidden;
}

body.design-modern .main-nav a::after,
body.design-modern .admin-header-link::after,
body.design-modern .icon-button::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--leaf), var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

body.design-modern .main-nav a:hover::after,
body.design-modern .admin-header-link:hover::after,
body.design-modern .icon-button:hover::after {
  transform: scaleX(1);
}

body.design-modern .brand-mark {
  border-radius: 14px 18px 12px 18px;
  transform: rotate(-2deg);
  box-shadow: 0 10px 22px rgba(63, 111, 69, 0.16), inset 0 0 0 1px rgba(255, 250, 240, 0.5);
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}

body.design-modern .brand:hover .brand-mark {
  transform: rotate(2deg) scale(1.04);
  box-shadow: 0 14px 28px rgba(215, 125, 50, 0.18), inset 0 0 0 1px rgba(255, 250, 240, 0.58);
}

body.design-modern .book-card,
body.design-modern .panel,
body.design-modern .newsletter-card,
body.design-modern .admin-item,
body.design-modern .cart-item,
body.design-modern .review-item {
  animation: softRise 0.42s ease both;
}

body.design-modern .book-card,
body.design-modern .panel,
body.design-modern .modal-content,
body.design-modern .cart-drawer {
  box-shadow: 0 18px 48px rgba(46, 35, 24, 0.15);
}

body.design-modern .book-card {
  border-color: rgba(63, 111, 69, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.9)),
    radial-gradient(circle at 12% 8%, rgba(215, 125, 50, 0.13), transparent 34%);
  transform-style: preserve-3d;
}

body.design-modern .book-card::before {
  content: "";
  position: absolute;
  inset: 10px 10px auto auto;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 250, 240, 0.78), rgba(255, 250, 240, 0));
  pointer-events: none;
  z-index: 1;
}

body.design-modern .book-card:nth-child(3n + 1)::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 5px 0 rgba(63, 111, 69, 0.16);
}

body.design-modern .book-card:nth-child(3n + 2)::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 5px 0 rgba(215, 125, 50, 0.17);
}

body.design-modern .book-card:nth-child(3n + 3)::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 5px 0 rgba(138, 86, 55, 0.15);
}

body.design-modern .hero {
  box-shadow: inset 0 -90px 120px rgba(43, 36, 31, 0.16);
}

body.design-modern .hero-copy {
  animation: floatIn 0.7s ease both;
}

body.design-modern .panel {
  border-color: rgba(138, 86, 55, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 247, 232, 0.86)),
    radial-gradient(circle at 90% 10%, rgba(215, 125, 50, 0.12), transparent 26%);
}

body.design-modern .book-card img {
  transition: transform 0.28s ease, filter 0.28s ease;
}

body.design-modern .book-card:hover img {
  transform: scale(1.025);
  filter: saturate(1.08) contrast(1.03);
}

body.design-modern .book-card:hover {
  transform: translateY(-8px) rotate(-0.4deg);
}

body.design-modern .book-card:hover .book-title {
  color: #244b2b;
}

body.design-modern .book-card:hover .stock-pill {
  transform: translateY(-1px);
}

body.design-modern .book-title,
body.design-modern .stock-pill,
body.design-modern .price-sale {
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.design-modern .toolbar {
  border-color: rgba(63, 111, 69, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.86), rgba(255, 247, 232, 0.66)),
    radial-gradient(circle at 12% 18%, rgba(63, 111, 69, 0.1), transparent 30%),
    radial-gradient(circle at 94% 82%, rgba(215, 125, 50, 0.12), transparent 34%);
  position: relative;
  overflow: hidden;
}

body.design-modern .toolbar::after {
  content: "";
  position: absolute;
  inset: auto -8% -45% 20%;
  height: 80px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.26);
  transform: rotate(-4deg);
  pointer-events: none;
}

body.design-modern .toolbar label {
  position: relative;
}

body.design-modern .toolbar label::before {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--leaf), var(--orange));
  opacity: 0.72;
}

body.design-modern .primary-link,
body.design-modern button[type="submit"] {
  background-image: linear-gradient(135deg, var(--leaf), var(--orange));
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.3);
  box-shadow: 0 10px 22px rgba(63, 111, 69, 0.16);
}

body.design-modern .card-actions button,
body.design-modern .admin-actions button,
body.design-modern .quantity-row button,
body.design-modern .newsletter-hero button,
body.design-modern .account-tools button {
  position: relative;
  overflow: hidden;
}

body.design-modern .card-actions button::after,
body.design-modern .admin-actions button::after,
body.design-modern .quantity-row button::after,
body.design-modern .newsletter-hero button::after,
body.design-modern .account-tools button::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 240, 0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.38s ease;
}

body.design-modern .card-actions button:hover::after,
body.design-modern .admin-actions button:hover::after,
body.design-modern .quantity-row button:hover::after,
body.design-modern .newsletter-hero button:hover::after,
body.design-modern .account-tools button:hover::after {
  left: 120%;
}

body.design-modern .card-actions button:hover,
body.design-modern .admin-actions button:hover,
body.design-modern .quantity-row button:hover,
body.design-modern .newsletter-hero button:hover,
body.design-modern .account-tools button:hover {
  transform: translateY(-2px) scale(1.015);
}

body.design-modern .price-sale {
  border-color: rgba(215, 125, 50, 0.28);
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.1), rgba(215, 125, 50, 0.13));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 8px 18px rgba(46, 35, 24, 0.08);
  animation: priceGlow 3.8s ease-in-out infinite;
}

body.design-modern .price-sale em {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--orange), var(--clay));
  box-shadow: 0 6px 14px rgba(138, 86, 55, 0.18);
  animation: badgePulse 2.8s ease-in-out infinite;
}

body.design-modern .book-card .price {
  display: block;
  width: 100%;
  margin: 2px 0 0;
}

body.design-modern .book-card .price-sale {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  width: 100%;
  padding: 10px 11px 11px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.94), rgba(255, 244, 225, 0.74)),
    radial-gradient(circle at 10% 10%, rgba(63, 111, 69, 0.16), transparent 38%),
    radial-gradient(circle at 96% 88%, rgba(215, 125, 50, 0.18), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 24px rgba(46, 35, 24, 0.1);
}

body.design-modern .book-card .price-sale .sale-label {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  color: #fffaf0;
  box-shadow: 0 6px 14px rgba(63, 111, 69, 0.14);
}

body.design-modern .book-card .price-sale s {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: center;
  color: rgba(43, 36, 31, 0.54);
  font-size: 13px;
  line-height: 1.2;
}

body.design-modern .book-card .price-sale strong {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: start;
  color: #244b2b;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.12;
  min-width: 0;
  word-break: normal;
}

body.design-modern .book-card .price-sale em {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}

body.design-classic .price-sale .sale-label {
  display: none;
}

body.design-modern .stock-pill {
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.13), rgba(255, 250, 240, 0.52));
}

body.design-modern .stars {
  text-shadow: 0 2px 8px rgba(181, 95, 24, 0.18);
  animation: starWarmth 4.5s ease-in-out infinite;
}

body.design-modern .newsletter-hero {
  position: relative;
  overflow: hidden;
}

body.design-modern .newsletter-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% 35%;
  height: 160px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.18);
  transform: rotate(-8deg);
  animation: heroSweep 7s ease-in-out infinite alternate;
}

body.design-modern .modal {
  background:
    radial-gradient(circle at 18% 16%, rgba(215, 125, 50, 0.12), transparent 30%),
    rgba(43, 36, 31, 0.24);
}

body.design-modern .modal-content,
body.design-modern .cart-drawer {
  animation: softPop 0.24s ease both;
}

body.design-modern #bookModal .modal-content {
  border: 1px solid rgba(63, 111, 69, 0.2);
  background:
    radial-gradient(circle at 8% 12%, rgba(215, 125, 50, 0.13), transparent 28%),
    radial-gradient(circle at 94% 86%, rgba(63, 111, 69, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.94));
  box-shadow: 0 28px 80px rgba(46, 35, 24, 0.24);
}

body.design-modern #bookModal .modal-layout {
  align-items: start;
  gap: 24px;
}

body.design-modern #bookModal .modal-cover {
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 26px;
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.1), rgba(138, 86, 55, 0.13)),
    rgba(255, 250, 240, 0.86);
  box-shadow:
    0 22px 48px rgba(46, 35, 24, 0.2),
    0 0 0 10px rgba(255, 250, 240, 0.42);
  transform: rotate(-1.2deg);
  transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
}

body.design-modern #bookModal .modal-cover:hover {
  transform: rotate(0deg) scale(1.018);
  filter: saturate(1.08) contrast(1.03);
  box-shadow:
    0 28px 62px rgba(46, 35, 24, 0.24),
    0 0 0 12px rgba(255, 250, 240, 0.5);
}

body.design-modern #bookModal #modalTitle {
  margin: 0 0 10px;
  color: #244b2b;
  font-family: "Entfalta Segoe Print", cursive;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

body.design-modern #bookModal .price {
  width: fit-content;
  margin: 10px 0 14px;
}

body.design-modern #bookModal .published-date {
  padding: 6px 10px;
  border: 1px solid rgba(63, 111, 69, 0.14);
  border-radius: 999px;
  background: rgba(63, 111, 69, 0.08);
  color: #244b2b;
}

body.design-modern #bookModal .card-actions {
  margin: 18px 0;
  padding: 12px;
  border: 1px solid rgba(63, 111, 69, 0.14);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.5);
}

body.design-modern #bookModal .card-actions button {
  min-height: 44px;
}

body.design-modern #bookModal .card-actions button:first-child {
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.28);
}

body.design-modern #bookModal .modal-layout > div > p:not(.price):not(.stars) {
  color: rgba(43, 36, 31, 0.8);
  font-size: 16px;
}

body.design-modern #bookModal .stars {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(215, 125, 50, 0.12);
}

body.design-modern #bookModal #reviewForm {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(63, 111, 69, 0.14);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.56);
}

body.design-modern #bookModal .review-list {
  margin-top: 16px;
}

body.design-modern #bookModal .preview-section,
body.design-modern #bookModal .product-gallery {
  padding: 12px;
  border: 1px solid rgba(63, 111, 69, 0.13);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.7), rgba(255, 247, 232, 0.46));
}

body.design-modern #bookModal .preview-pages img,
body.design-modern #bookModal .product-gallery img {
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(46, 35, 24, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.design-modern #bookModal .preview-pages img:hover,
body.design-modern #bookModal .product-gallery img:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 32px rgba(46, 35, 24, 0.16);
}

body.design-modern .toast {
  animation: toastLift 0.28s ease both;
}

body.design-modern input:focus,
body.design-modern select:focus,
body.design-modern textarea:focus {
  outline: 2px solid rgba(215, 125, 50, 0.32);
  border-color: rgba(63, 111, 69, 0.42);
  box-shadow: 0 0 0 4px rgba(63, 111, 69, 0.08);
}

body.perf-light.design-modern::before,
body.perf-light.design-modern::after,
body.perf-light.design-modern .newsletter-hero::after {
  animation: none;
  opacity: 0.45;
}

body.perf-light.design-modern .book-card,
body.perf-light.design-modern .panel,
body.perf-light.design-modern .newsletter-card,
body.perf-light.design-modern .admin-item,
body.perf-light.design-modern .cart-item,
body.perf-light.design-modern .review-item,
body.perf-light.design-modern .hero-copy,
body.perf-light.design-modern .modal-content,
body.perf-light.design-modern .cart-drawer,
body.perf-light.design-modern .toast,
body.perf-light.design-modern .price-sale,
body.perf-light.design-modern .price-sale em,
body.perf-light.design-modern .stars {
  animation: none;
}

body.perf-light.design-modern .book-card,
body.perf-light.design-modern .panel,
body.perf-light.design-modern .modal-content,
body.perf-light.design-modern .cart-drawer {
  box-shadow: 0 10px 26px rgba(46, 35, 24, 0.11);
}

body.perf-light.design-modern .book-card,
body.perf-light.design-modern .book-card img,
body.perf-light.design-modern .brand-mark,
body.perf-light.design-modern button,
body.perf-light.design-modern input,
body.perf-light.design-modern select,
body.perf-light.design-modern textarea {
  transition-duration: 0.08s;
}

body.perf-light.design-modern .book-card:hover,
body.perf-light.design-modern .book-card:hover img,
body.perf-light.design-modern .card-actions button:hover,
body.perf-light.design-modern .admin-actions button:hover,
body.perf-light.design-modern .quantity-row button:hover,
body.perf-light.design-modern .newsletter-hero button:hover,
body.perf-light.design-modern .account-tools button:hover {
  transform: none;
}

body.perf-light.design-modern .card-actions button::after,
body.perf-light.design-modern .admin-actions button::after,
body.perf-light.design-modern .quantity-row button::after,
body.perf-light.design-modern .newsletter-hero button::after,
body.perf-light.design-modern .account-tools button::after {
  display: none;
}

body.design-classic .book-card,
body.design-classic .panel,
body.design-classic .newsletter-card,
body.design-classic .admin-item,
body.design-classic .cart-item,
body.design-classic .review-item {
  animation: none;
}

@keyframes softRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes watercolorDrift {
  from {
    transform: translate3d(-10px, -8px, 0) scale(1);
  }
  to {
    transform: translate3d(12px, 10px, 0) scale(1.025);
  }
}

@keyframes paperShimmer {
  0%, 100% {
    opacity: 0.45;
    transform: translateX(-1.5%);
  }
  50% {
    opacity: 0.82;
    transform: translateX(1.5%);
  }
}

@keyframes priceGlow {
  0%, 100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 8px 18px rgba(46, 35, 24, 0.08);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 12px 26px rgba(215, 125, 50, 0.16);
  }
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes starWarmth {
  0%, 100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.25);
  }
}

@keyframes heroSweep {
  from {
    transform: rotate(-8deg) translateX(-20px);
  }
  to {
    transform: rotate(-8deg) translateX(24px);
  }
}

@keyframes softPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastLift {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.design-modern .book-card,
  body.design-modern .panel,
  body.design-modern .newsletter-card,
  body.design-modern .admin-item,
  body.design-modern .cart-item,
  body.design-modern .review-item {
    animation: none;
  }

  body.design-modern .book-card img {
    transition: none;
  }

  body.design-modern .hero-copy {
    animation: none;
  }

  body.design-modern::before,
  body.design-modern::after,
  body.design-modern .price-sale,
  body.design-modern .price-sale em,
  body.design-modern .stars,
  body.design-modern .newsletter-hero::after,
  body.design-modern .modal-content,
  body.design-modern .cart-drawer,
  body.design-modern .toast {
    animation: none;
  }
}

::selection {
  color: #fffaf0;
  background: rgba(63, 111, 69, 0.82);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  min-height: 40px;
}

button,
.primary-link,
.secondary-link,
.secondary-button,
.mini-link-button,
.google-button,
.social-button,
.account-login-button,
.site-footer a,
.admin-bottom-actions .secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.15;
  text-align: center;
  vertical-align: middle;
}

.profile-file-button,
.score-row button,
.friend-row button,
.compact-form button,
.difficulty-control button,
.win-actions button,
.pump-button,
.cookie-consent-actions button,
.consent-actions button,
.support-widget-mode button,
.support-widget-chat-list button,
.support-widget-chat-entry button,
.support-widget-assign-box button,
.customer-support-actions button,
.wishlist-widget-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}

button {
  white-space: normal;
}

.site-header {
  --header-height: 72px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 44px);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(255, 250, 240, 0.78));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(46, 35, 24, 0.08);
  backdrop-filter: blur(16px);
  transition: transform 0.22s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong {
  font-size: 19px;
}

.brand small,
.muted {
  color: rgba(43, 36, 31, 0.68);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  font-weight: 800;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.42);
}

.admin-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(63, 111, 69, 0.24);
  border-radius: 8px;
  background: rgba(63, 111, 69, 0.1);
  color: #244b2b;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.admin-header-link:hover {
  background: rgba(63, 111, 69, 0.16);
  transform: translateY(-1px);
}

.main-nav,
.hero-actions,
.site-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.main-nav a,
.site-footer a,
.primary-link,
.secondary-link {
  color: inherit;
  text-decoration: none;
  padding: 10px 13px;
  border-radius: 999px;
  font-weight: 750;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.main-nav a,
.main-nav button {
  flex: 0 0 auto;
}

.main-nav a:hover,
.site-footer a:hover,
.main-nav a.active {
  background: rgba(63, 111, 69, 0.12);
}

.main-nav a:hover,
.site-footer a:hover,
.primary-link:hover,
.secondary-link:hover {
  transform: translateY(-1px);
}

.main-nav a[data-category] {
  border: 1px solid transparent;
}

.main-nav a[data-category].active {
  border-color: rgba(63, 111, 69, 0.28);
  color: #244b2b;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 247, 232, 0.92);
  border-radius: 999px;
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.user-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 247, 232, 0.94);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(46, 35, 24, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.icon-button:hover,
.user-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(46, 35, 24, 0.14);
}

.user-button span::before,
.user-button span::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--leaf);
}

.user-button span::before {
  top: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.user-button span::after {
  bottom: 8px;
  width: 24px;
  height: 15px;
  border-radius: 16px 16px 7px 7px;
}

.user-button.has-profile-photo {
  overflow: hidden;
  background:
    var(--profile-photo) center / cover no-repeat,
    rgba(255, 247, 232, 0.92);
}

.user-button.has-profile-photo span::before,
.user-button.has-profile-photo span::after {
  display: none;
}

.hero {
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 60px);
  background:
    linear-gradient(90deg, rgba(38, 29, 20, 0.52), rgba(38, 29, 20, 0.25) 58%, rgba(38, 29, 20, 0.38)),
    url("assets/icon.jpeg") center/cover;
  border-bottom: 1px solid rgba(63, 48, 37, 0.16);
}

.hero-copy {
  max-width: 760px;
  color: #fffaf0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.35;
}

.primary-link,
.secondary-link,
button[type="submit"],
.secondary-button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
}

.primary-link,
button[type="submit"] {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), #315b38);
  box-shadow: 0 12px 24px rgba(63, 111, 69, 0.18);
}

.secondary-link,
.secondary-button {
  color: var(--ink);
  background: rgba(255, 243, 221, 0.9);
  border: 1px solid var(--line);
}

button[type="submit"],
.primary-link,
.secondary-button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button[type="submit"]:hover,
.primary-link:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(46, 35, 24, 0.16);
}

main {
  padding-bottom: 40px;
}

.toolbar,
.account-admin-grid,
.sell-panel,
.book-grid,
.wishlist-panel,
.admin-main,
.legal-document {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.78), rgba(255, 247, 232, 0.58));
  box-shadow: 0 16px 38px rgba(46, 35, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: rgba(43, 36, 31, 0.88);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.9)),
    linear-gradient(135deg, rgba(63, 111, 69, 0.06), rgba(138, 86, 55, 0.05));
  color: var(--ink);
  padding: 13px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 5px 14px rgba(46, 35, 24, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

select {
  min-height: 48px;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--clay) 50%),
    linear-gradient(135deg, var(--clay) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

select[multiple] {
  min-height: 150px;
  padding-right: 13px;
  background-image: none;
  border-radius: var(--radius-sm);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(63, 111, 69, 0.34);
  transform: translateY(-1px);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(63, 111, 69, 0.52);
  background-color: #fffaf0;
  box-shadow: 0 0 0 4px rgba(63, 111, 69, 0.14), 0 12px 26px rgba(46, 35, 24, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

textarea {
  min-height: 96px;
  resize: vertical;
  border-radius: var(--radius-sm);
}

input[type="search"],
#searchInput {
  padding-left: 42px;
  background-image:
    radial-gradient(circle at 20px 50%, rgba(63, 111, 69, 0.26) 0 5px, transparent 6px),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.9));
  background-repeat: no-repeat;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.book-card,
.panel,
.modal-content,
.cart-drawer,
.legal-page {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(255, 247, 232, 0.91));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.book-card {
  overflow: hidden;
  display: grid;
  align-content: start;
  position: relative;
  isolation: isolate;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.18s ease;
}

.book-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 4px 0 rgba(63, 111, 69, 0.08);
}

.book-card:hover {
  transform: translateY(-5px);
  border-color: rgba(63, 111, 69, 0.28);
  box-shadow: var(--shadow-hover);
}

.book-card img,
.modal-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #d8c3a2;
}

#bookModal .modal-cover {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 720px);
  aspect-ratio: auto;
  object-fit: contain;
  justify-self: center;
  align-self: start;
}

.book-card img {
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}

.book-body {
  display: grid;
  gap: 12px;
  padding: 17px;
}

.book-body p {
  line-height: 1.45;
  color: rgba(43, 36, 31, 0.78);
}

.book-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.16;
  color: rgba(43, 36, 31, 0.96);
}

.price {
  font-weight: 800;
  color: var(--clay);
  font-size: 18px;
  line-height: 1.2;
}

.published-date {
  width: fit-content;
  margin: 0 0 10px;
  color: rgba(43, 36, 31, 0.66);
  font-size: 14px;
  font-weight: 800;
}

.price-sale {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 9px;
  border: 1px solid rgba(63, 111, 69, 0.16);
  border-radius: 999px;
  background: rgba(63, 111, 69, 0.07);
}

.price-sale .sale-label {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(63, 111, 69, 0.12);
  color: #315d37;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.price-sale s {
  color: rgba(43, 36, 31, 0.55);
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.price-sale strong {
  color: #244b2b;
  font-size: 1.12em;
}

.price-sale em {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(215, 125, 50, 0.2);
  color: #7b3f1f;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.stock-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(63, 111, 69, 0.12);
  border: 1px solid rgba(63, 111, 69, 0.18);
  color: #244b2b;
  font-size: 13px;
}

.stock-pill-soldout {
  border-color: rgba(174, 68, 48, 0.26);
  background: linear-gradient(135deg, rgba(174, 68, 48, 0.13), rgba(215, 125, 50, 0.08));
  color: #8f2e25;
}

.stock-pill-low {
  border-color: rgba(215, 125, 50, 0.28);
  background: rgba(215, 125, 50, 0.14);
  color: #7b3f1f;
}

.stock-pill-download {
  border-color: rgba(63, 111, 69, 0.18);
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.12), rgba(138, 86, 55, 0.08));
  color: #244b2b;
}

.account-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.legal-page {
  padding: 22px;
}

.panel > h1,
.panel > h2,
.admin-main h1,
.admin-main h2 {
  margin-top: 0;
}

.admin-main h2 {
  padding-top: 18px;
  border-top: 1px solid rgba(63, 48, 37, 0.12);
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-panel > h1,
.admin-panel > h2 {
  margin: 0 0 -4px;
  padding: 0;
  border: 0;
}

.admin-panel > p.muted {
  margin: -2px 0 2px;
}

.admin-panel > .stacked-form,
.admin-panel > .admin-list,
.admin-panel > .stats-panel,
.admin-panel > #adminOrderSummary {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(255, 247, 232, 0.91));
  box-shadow: 0 10px 26px rgba(46, 35, 24, 0.09);
  backdrop-filter: blur(8px);
}

.admin-panel > .stacked-form {
  margin-top: 0;
}

.admin-panel > #bookForm::before,
.admin-panel > #feeForm::before,
.admin-panel > #discountForm::before {
  display: block;
  margin: 0 0 6px;
  color: #244b2b;
  font-weight: 900;
}

.admin-panel > #bookForm::before {
  content: "Artikel erstellen / bearbeiten";
}

.admin-panel > #feeForm::before {
  content: "Zusatzkosten bearbeiten";
}

.admin-panel > #discountForm::before {
  content: "Shop-Rabatt einstellen";
}

.admin-panel > #adminBookList,
.admin-panel > #adminFeeList,
.admin-panel > #adminDiscountList,
.admin-panel > #adminOrderList {
  min-height: 70px;
}

.admin-panel > .admin-actions {
  width: fit-content;
}

.admin-panel > .admin-actions:has(#toggleArchivedOrders) {
  margin-top: -8px;
}

body.design-modern .admin-panel > .stacked-form,
body.design-modern .admin-panel > .admin-list,
body.design-modern .admin-panel > .stats-panel,
body.design-modern .admin-panel > #adminOrderSummary {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.9)),
    radial-gradient(circle at 12% 8%, rgba(215, 125, 50, 0.1), transparent 34%);
  box-shadow: 0 12px 30px rgba(46, 35, 24, 0.1);
}

.stacked-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

#variantPricesWrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  line-height: 1.25;
}

.checkbox-line input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 18px;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(63, 111, 69, 0.42);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.92));
  accent-color: var(--leaf);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 5px 12px rgba(46, 35, 24, 0.1);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.checkbox-line input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fffaf0;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(0.75);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.checkbox-line input[type="checkbox"]:checked {
  border-color: rgba(63, 111, 69, 0.72);
  background: linear-gradient(135deg, var(--leaf), var(--orange));
}

.checkbox-line input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.checkbox-line input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(215, 125, 50, 0.28);
  outline-offset: 3px;
}

.code-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.checkout-form .code-check-row {
  display: grid;
}

.checkout-consent {
  align-items: flex-start;
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.09), rgba(138, 86, 55, 0.08)),
    rgba(255, 250, 240, 0.82);
  font-size: 0.92rem;
  line-height: 1.4;
}

.checkout-consent input[type="checkbox"] {
  margin-top: 2px;
}

.checkout-consent a {
  color: #244b2b;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-color: rgba(215, 125, 50, 0.58);
  text-underline-offset: 2px;
}

#checkoutSubmitButton:disabled {
  color: rgba(43, 36, 31, 0.62);
  background: linear-gradient(135deg, rgba(111, 143, 85, 0.2), rgba(138, 86, 55, 0.16));
  box-shadow: none;
}

.code-check-row button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 247, 232, 0.94);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.gift-voucher-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.gift-voucher-presets button {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 78px;
  border: 1px solid rgba(63, 111, 69, 0.24);
  border-radius: 18px;
  padding: 13px 15px;
  color: #244b2b;
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.16), transparent 35%),
    linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(236, 228, 203, 0.82));
  box-shadow: 0 12px 24px rgba(46, 35, 24, 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.gift-voucher-presets button:hover,
.gift-voucher-presets button.is-active {
  transform: translateY(-1px);
  border-color: rgba(215, 125, 50, 0.5);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 250, 240, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(63, 111, 69, 0.86), rgba(215, 125, 50, 0.86));
  color: #fffaf0;
  box-shadow: 0 16px 28px rgba(46, 35, 24, 0.18);
}

.gift-voucher-presets strong {
  font-size: 1.08rem;
}

.gift-voucher-presets span {
  font-size: 0.88rem;
  opacity: 0.84;
}

.gift-voucher-template-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.google-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.current-user {
  padding: 12px;
  border-radius: 8px;
  background: rgba(215, 125, 50, 0.13);
}

.auth-warning {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(174, 68, 48, 0.28);
  border-radius: 14px;
  color: #7e2d24;
  background:
    linear-gradient(135deg, rgba(174, 68, 48, 0.12), rgba(215, 125, 50, 0.08));
  font-weight: 900;
}

body.theme-dark .auth-warning {
  border-color: rgba(255, 142, 112, 0.38);
  color: #ffd2c7;
  background: rgba(174, 68, 48, 0.2);
}

.auth-message {
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px solid rgba(155, 104, 68, 0.28);
  border-radius: 16px;
  color: #2b241f;
  background: rgba(255, 250, 240, 0.94);
  font-weight: 900;
  line-height: 1.35;
}

.auth-message.is-error {
  border-color: rgba(174, 68, 48, 0.42);
  color: #7e2d24;
  background: rgba(255, 238, 232, 0.96);
}

.auth-message.is-success {
  border-color: rgba(63, 111, 69, 0.36);
  color: #254f2c;
  background: rgba(238, 250, 232, 0.96);
}

body.theme-dark .auth-message {
  border-color: rgba(230, 218, 194, 0.22);
  color: #fff8eb;
  background: rgba(25, 31, 24, 0.96);
}

body.theme-dark .auth-message.is-error {
  border-color: rgba(255, 142, 112, 0.42);
  color: #ffd2c7;
  background: rgba(91, 35, 27, 0.94);
}

body.theme-dark .auth-message.is-success {
  border-color: rgba(150, 206, 138, 0.38);
  color: #daf5d2;
  background: rgba(32, 69, 38, 0.9);
}

.admin-list,
.review-list,
.cart-list,
.newsletter-list {
  display: grid;
  gap: 10px;
}

.order-group {
  display: grid;
  gap: 10px;
}

.order-group + .order-group {
  margin-top: 18px;
}

.order-group-collapsible {
  margin-top: 18px;
}

.order-group-collapsible summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: rgba(63, 111, 69, 0.08);
  color: #244b2b;
  font-weight: 900;
}

.order-group-collapsible summary::-webkit-details-marker {
  display: none;
}

.order-group-collapsible summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(215, 125, 50, 0.18);
  color: var(--clay);
  flex: 0 0 auto;
}

.order-group-collapsible[open] summary::before {
  content: "-";
}

.order-group-collapsible summary span {
  flex: 1;
}

.order-group-collapsible summary strong {
  min-width: 34px;
  border-radius: 999px;
  padding: 4px 9px;
  text-align: center;
  background: rgba(255, 250, 240, 0.8);
  color: var(--clay);
}

.order-group-content {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.order-group h3 {
  margin: 4px 0 2px;
  font-size: 18px;
  color: #244b2b;
}

.order-group h3 span {
  color: rgba(43, 36, 31, 0.62);
  font-size: 14px;
}

.order-card p {
  margin: 6px 0;
}

.order-card,
.customer-order-card {
  overflow: hidden;
}

.order-card summary,
.customer-order-card summary {
  cursor: pointer;
  list-style: none;
}

.order-card summary::-webkit-details-marker,
.customer-order-card summary::-webkit-details-marker {
  display: none;
}

.order-card-summary,
.customer-order-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-card-summary::before,
.customer-order-card summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(215, 125, 50, 0.18);
  color: var(--clay);
  flex: 0 0 auto;
  font-weight: 900;
}

.order-card[open] .order-card-summary::before,
.customer-order-card[open] summary::before {
  content: "-";
}

.order-card-summary span,
.customer-order-card summary span {
  display: grid;
  gap: 3px;
  flex: 1;
}

.order-card-summary small {
  color: rgba(43, 36, 31, 0.62);
  font-weight: 700;
}

.order-card-summary > b,
.customer-order-card summary > strong {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(63, 111, 69, 0.11);
  color: #244b2b;
  white-space: nowrap;
}

.order-card-content,
.customer-order-detail {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.order-shipping-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(63, 48, 37, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 240, 0.58);
}

.order-shipping-form button {
  grid-column: 1 / -1;
}

.customer-orders {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(63, 48, 37, 0.14);
}

.customer-order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 250, 240, 0.58);
}

.order-detail-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(63, 48, 37, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.56);
}

.order-detail-list p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.order-detail-list span {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(63, 111, 69, 0.1);
  color: #244b2b;
  font-size: 12px;
  font-weight: 800;
}

.admin-bottom-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 0;
  border-top: 0;
}

.admin-bottom-actions .secondary-link {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 14px;
}

.error-report-card {
  gap: 12px;
  border-left: 5px solid rgba(174, 68, 48, 0.58);
}

.error-report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.error-report-head strong {
  display: block;
  line-height: 1.25;
  color: #7e2d24;
}

.error-report-meta {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(63, 111, 69, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 240, 0.58);
}

.error-report-meta p {
  margin: 0;
}

.error-report-meta details {
  margin-top: 4px;
}

.error-report-meta pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(43, 36, 31, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

body.theme-dark .toast {
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.22);
  background:
    linear-gradient(135deg, #1d261b, #36422d);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.46);
}

body.theme-dark .toast.is-error {
  color: #fffaf0;
  border-color: rgba(255, 190, 174, 0.62);
  background:
    linear-gradient(135deg, #842f27, #b65b2e 58%, #6f3f2f);
  box-shadow: 0 24px 66px rgba(0, 0, 0, 0.54), 0 0 0 4px rgba(255, 116, 83, 0.18);
}

body.theme-dark .error-report-card {
  border-left-color: rgba(255, 142, 112, 0.72);
}

body.theme-dark .error-report-head strong {
  color: #ffd2c7;
}

body.theme-dark .error-report-meta {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(18, 22, 16, 0.58);
}

body.theme-dark .error-report-meta pre {
  color: #fff3e2;
  background: rgba(0, 0, 0, 0.24);
}

.management-details {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.62);
}

.management-details summary {
  cursor: pointer;
  font-weight: 800;
}

.account-header-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.mini-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(63, 111, 69, 0.24);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 247, 232, 0.88);
  color: #244b2b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.mini-link-button:hover {
  background: #fffaf0;
  box-shadow: 0 8px 18px rgba(46, 35, 24, 0.1);
}

.profile-manage-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.62);
}

.profile-manage-form h3 {
  margin: 0;
  font-size: 17px;
}

.account-main {
  width: min(760px, calc(100% - 28px));
  margin: 26px auto 42px;
}

.account-page-panel {
  display: grid;
  gap: 16px;
}

.account-page-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.account-page-heading h1 {
  margin: 0 0 6px;
}

.role-pill {
  border: 1px solid rgba(63, 111, 69, 0.24);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(63, 111, 69, 0.1);
  color: #244b2b;
  font-weight: 800;
  white-space: nowrap;
}

.account-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-tools button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255, 247, 232, 0.94);
  cursor: pointer;
  font-weight: 800;
}

.account-login-button {
  justify-self: start;
  min-height: 44px;
  border: 1px solid rgba(255, 250, 240, 0.46);
  border-radius: 999px;
  padding: 11px 17px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, var(--leaf), var(--clay));
  box-shadow: 0 14px 30px rgba(46, 35, 24, 0.18);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.account-login-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 38px rgba(46, 35, 24, 0.22);
}

.account-login-button:focus-visible {
  outline: 3px solid rgba(215, 125, 50, 0.32);
  outline-offset: 2px;
}

.auth-action-main {
  width: min(760px, calc(100% - 28px));
  min-height: 58vh;
  display: grid;
  place-items: center;
  margin: 28px auto 46px;
}

.auth-action-card {
  width: 100%;
  display: grid;
  justify-items: start;
  gap: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.14), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(215, 125, 50, 0.13), transparent 32%),
    linear-gradient(145deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.92));
}

.auth-action-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  box-shadow: 0 14px 30px rgba(46, 35, 24, 0.18);
  font-weight: 950;
}

.auth-action-card.is-error .auth-action-mark {
  background: linear-gradient(135deg, #b55f18, var(--clay));
}

.auth-action-card h1,
.auth-action-card p {
  margin: 0;
}

.auth-action-card .stacked-form {
  width: 100%;
}

.auth-action-card button[type="submit"] {
  justify-self: start;
  min-height: 44px;
  border: 1px solid rgba(255, 250, 240, 0.46);
  border-radius: 999px;
  padding: 11px 17px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  box-shadow: 0 14px 30px rgba(46, 35, 24, 0.18);
  cursor: pointer;
  font-weight: 900;
}

.auth-action-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.download-list {
  margin-top: 18px;
}

.admin-item,
.review-item,
.cart-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 250, 240, 0.84), rgba(255, 247, 232, 0.62)),
    radial-gradient(circle at 0 0, rgba(63, 111, 69, 0.09), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(138, 86, 55, 0.08), transparent 36%);
  box-shadow: inset 0 1px 0 var(--soft-line), 0 10px 24px rgba(46, 35, 24, 0.07);
}

.admin-panel .admin-item {
  border-radius: 10px;
  box-shadow: none;
  background: rgba(255, 250, 240, 0.54);
}

.admin-item strong,
.review-item strong,
.cart-item strong {
  color: rgba(43, 36, 31, 0.94);
}

.cart-summary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.13), rgba(138, 86, 55, 0.1)),
    rgba(255, 250, 240, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54), 0 12px 28px rgba(46, 35, 24, 0.08);
}

.cart-summary p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.cart-summary h3 {
  margin: 4px 0 0;
}

.cart-page-main {
  width: min(980px, calc(100% - 28px));
  margin: 24px auto 54px;
}

.cart-page-panel {
  display: grid;
  gap: 18px;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-full-link {
  min-height: 38px;
  padding: 8px 12px;
}

.cart-receipt {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 20px;
  padding: 18px 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 14px 30px rgba(46, 35, 24, 0.1);
}

.cart-receipt-head,
.cart-receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
  gap: 14px;
  align-items: center;
}

.cart-receipt-head {
  border-bottom: 1px dashed rgba(63, 111, 69, 0.3);
  padding: 0 0 10px;
  color: rgba(43, 36, 31, 0.68);
  font-size: 0.88rem;
  font-weight: 900;
}

.cart-receipt-lines {
  display: grid;
  gap: 12px;
}

.cart-receipt-item {
  display: grid;
  gap: 10px;
  border-bottom: 1px dashed rgba(63, 111, 69, 0.18);
  padding: 0 0 13px;
}

.cart-receipt-lines > .cart-receipt-row,
.cart-receipt-summary > .cart-receipt-row {
  min-height: 34px;
  border-bottom: 1px solid rgba(63, 111, 69, 0.12);
  padding: 6px 0;
}

.cart-receipt-lines > .cart-receipt-row:last-child,
.cart-receipt-summary > .cart-receipt-row:last-child {
  border-bottom: 0;
}

.cart-receipt-row span {
  min-width: 0;
  color: #2b241f;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.cart-receipt-row small {
  display: block;
  margin-top: 4px;
  color: rgba(43, 36, 31, 0.62);
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.cart-receipt-item-detail {
  color: rgba(43, 36, 31, 0.78);
  font-size: 0.8rem;
}

.cart-receipt-detail {
  color: rgba(43, 36, 31, 0.58);
  font-size: 0.74rem;
}

.cart-receipt-row strong {
  color: #244b2b;
  text-align: right;
  white-space: nowrap;
  justify-self: end;
  min-width: 96px;
  line-height: 1.35;
}

.cart-receipt-row-discount span,
.cart-receipt-row-discount strong {
  color: #8a5637;
}

.cart-receipt-actions {
  justify-content: flex-start;
  margin: 0;
  padding-left: 0;
  gap: 8px;
  border: 0;
  background: transparent;
  min-height: 0;
}

.cart-receipt-actions button {
  min-width: 38px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.cart-receipt-summary {
  display: grid;
  gap: 0;
  border-top: 2px solid rgba(63, 111, 69, 0.26);
  margin-top: 2px;
  padding-top: 8px;
}

.cart-receipt-row-total {
  border-radius: 14px;
  padding: 12px 14px !important;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  grid-template-columns: minmax(0, 1fr) minmax(122px, auto);
  border-bottom: 0 !important;
  margin-top: 4px;
}

.cart-receipt-row-total span,
.cart-receipt-row-total strong {
  color: #fffaf0;
  font-size: 1.08rem;
}

.gift-voucher-row {
  border: 1px solid rgba(63, 111, 69, 0.18);
  border-radius: 18px;
  padding: 8px;
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.12), transparent 34%),
    rgba(255, 250, 240, 0.62);
}

.gift-voucher-check-panel {
  margin-top: 34px;
}

@media (max-width: 520px) {
  .cart-receipt {
    padding: 12px 10px;
    border-radius: 16px;
  }

  .cart-receipt-head,
  .cart-receipt-row {
    grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
    gap: 10px;
  }

  .cart-receipt-row strong {
    min-width: 84px;
    font-size: 0.92rem;
  }

  .cart-receipt-row span {
    font-size: 0.95rem;
  }

  .cart-receipt-row small {
    font-size: 0.74rem;
  }

  .cart-receipt-actions {
    flex-wrap: wrap;
  }

  .cart-receipt-actions button {
    min-height: 32px;
    padding: 6px 10px;
  }

  .cart-receipt-row-total {
    grid-template-columns: minmax(0, 1fr) minmax(98px, auto);
  }

  .cart-receipt-row-total span,
  .cart-receipt-row-total strong {
    font-size: 1rem;
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.92), rgba(255, 250, 240, 0.72));
  box-shadow: inset 0 1px 0 var(--soft-line);
}

.summary-grid strong {
  display: block;
  font-size: 28px;
  color: #244b2b;
}

.summary-grid span {
  color: rgba(43, 36, 31, 0.68);
}

.stats-panel {
  margin: 16px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.68), rgba(255, 250, 240, 0.48));
  box-shadow: inset 0 1px 0 var(--soft-line);
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stats-grid strong {
  overflow-wrap: anywhere;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.1;
}

.stats-list {
  margin-top: 12px;
}

.stats-reset-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(138, 86, 55, 0.28);
  border-radius: 8px;
  background: rgba(215, 125, 50, 0.1);
}

.stats-reset-box button {
  border: 1px solid rgba(138, 86, 55, 0.32);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255, 247, 232, 0.94);
  color: #6c321e;
  cursor: pointer;
  font-weight: 800;
}

body.theme-dark .stats-panel,
body.theme-dark.design-modern .stats-panel {
  border-color: rgba(255, 250, 240, 0.2);
  background:
    radial-gradient(circle at 10% 0, rgba(63, 111, 69, 0.16), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(215, 125, 50, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(26, 34, 24, 0.98), rgba(42, 40, 29, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 250, 240, 0.08);
}

body.theme-dark .summary-grid div,
body.theme-dark.design-modern .summary-grid div,
body.theme-dark .stats-grid div,
body.theme-dark.design-modern .stats-grid div {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.14), transparent 38%),
    linear-gradient(145deg, rgba(34, 48, 31, 0.96), rgba(54, 48, 35, 0.94));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 250, 240, 0.08);
}

body.theme-dark .summary-grid strong,
body.theme-dark.design-modern .summary-grid strong,
body.theme-dark .stats-grid strong,
body.theme-dark.design-modern .stats-grid strong {
  color: #fff8eb;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

body.theme-dark .summary-grid span,
body.theme-dark.design-modern .summary-grid span,
body.theme-dark .stats-grid span,
body.theme-dark.design-modern .stats-grid span {
  color: rgba(255, 243, 226, 0.76);
}

body.theme-dark .stats-list .admin-item,
body.theme-dark.design-modern .stats-list .admin-item,
body.theme-dark #adminLiveCarts .admin-item,
body.theme-dark.design-modern #adminLiveCarts .admin-item {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    linear-gradient(135deg, rgba(35, 51, 32, 0.95), rgba(48, 43, 31, 0.94));
}

body.theme-dark .stats-reset-box,
body.theme-dark.design-modern .stats-reset-box {
  border-color: rgba(215, 125, 50, 0.34);
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.18), rgba(215, 125, 50, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.07);
}

body.theme-dark .stats-reset-box button,
body.theme-dark.design-modern .stats-reset-box button {
  border-color: rgba(255, 250, 240, 0.22);
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #9b6844);
}

.cover-preview {
  width: min(180px, 100%);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.product-preview-grid,
.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.product-preview-grid img,
.product-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 247, 232, 0.72);
}

.product-gallery {
  margin: 12px 0;
}

.preview-section {
  margin: 14px 0;
}

.preview-section h3 {
  margin: 0 0 8px;
}

.preview-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-pages img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 247, 232, 0.72);
  box-shadow: inset 0 1px 0 var(--soft-line);
}

.newsletter-main {
  width: min(980px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.newsletter-hero {
  display: grid;
  gap: 14px;
  align-items: end;
  min-height: 260px;
  padding: 28px;
  border-radius: var(--radius);
  color: #fffaf0;
  background:
    linear-gradient(rgba(43, 36, 31, 0.2), rgba(43, 36, 31, 0.42)),
    url("assets/icon.jpeg") center/cover;
  box-shadow: var(--shadow);
}

.newsletter-hero h1 {
  margin: 0;
  font-size: 48px;
}

.newsletter-hero button {
  width: fit-content;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 11px 14px;
  color: var(--ink);
  background: #fff7e8;
  font-weight: 800;
  cursor: pointer;
}

.newsletter-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 247, 232, 0.88));
  box-shadow: 0 14px 36px rgba(46, 35, 24, 0.12);
}

.newsletter-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.newsletter-card.is-hidden-post {
  opacity: 0.72;
  border-style: dashed;
}

.social-main {
  width: min(1040px, calc(100% - 32px));
  margin: 24px auto 48px;
  display: grid;
  gap: 18px;
}

.social-hero {
  padding: 26px;
}

.social-hero h1 {
  margin: 4px 0 0;
  color: #244b2b;
  font-size: clamp(34px, 6vw, 58px);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.social-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 247, 232, 0.88));
  box-shadow: 0 14px 36px rgba(46, 35, 24, 0.12);
}

.social-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  padding: 8px;
  overflow: hidden;
  color: #fffaf0;
  font-weight: 900;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
}

.social-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(43, 36, 31, 0.22));
}

.social-card h2 {
  margin: 4px 0 0;
}

.social-card p {
  margin: 0;
  color: rgba(43, 36, 31, 0.72);
}

.social-button {
  align-self: end;
  justify-self: start;
  margin-top: 8px;
  border: 1px solid rgba(63, 111, 69, 0.26);
  border-radius: 999px;
  padding: 10px 13px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  font-weight: 850;
  text-decoration: none;
}

.social-instagram .social-icon {
  background: linear-gradient(135deg, #d77d32, #8a5637);
}

.social-tiktok .social-icon {
  padding: 0;
  border-radius: 999px;
  background: #050505;
  box-shadow:
    0 0 0 1px rgba(255, 250, 240, 0.16) inset,
    0 10px 22px rgba(5, 5, 5, 0.22);
}

.social-tiktok .social-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
}

.social-youtube .social-icon {
  background: linear-gradient(135deg, #b84b32, #d77d32);
}

.admin-actions,
.card-actions,
.quantity-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 6px;
}

.segmented-control button {
  border: 1px solid rgba(63, 111, 69, 0.28);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
  font-weight: 900;
}

.segmented-control button.active {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  box-shadow: 0 10px 22px rgba(79, 61, 39, 0.18);
}

.filter-status {
  margin: 4px 0 12px;
  font-weight: 900;
}

.buy-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buy-quantity {
  display: inline-grid;
  grid-template-columns: 42px 64px 42px;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(63, 111, 69, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 232, 0.86));
  box-shadow: 0 10px 22px rgba(46, 35, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.buy-quantity button {
  width: 42px;
  height: 44px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: rgba(63, 111, 69, 0.08);
  color: #244b2b;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.buy-quantity button:hover {
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.18), rgba(215, 125, 50, 0.14));
  color: #1f3d25;
}

.buy-quantity input {
  width: 64px;
  height: 44px;
  border: 0;
  border-inline: 1px solid rgba(63, 111, 69, 0.16);
  border-radius: 0;
  padding: 0;
  background: rgba(255, 250, 240, 0.72);
  text-align: center;
  font-weight: 900;
  color: #2b241f;
  appearance: textfield;
}

.buy-quantity input::-webkit-outer-spin-button,
.buy-quantity input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.download-status {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 850;
}

.download-status.downloaded {
  background: rgba(63, 111, 69, 0.14);
  color: #244b2b;
}

.download-status.pending {
  background: rgba(215, 125, 50, 0.16);
  color: #7b3f1f;
}

.card-actions button,
.admin-actions button,
.review-item button,
.quantity-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 13px;
  background: rgba(255, 247, 232, 0.94);
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.card-actions button:first-child {
  border-color: rgba(63, 111, 69, 0.3);
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.14), rgba(215, 125, 50, 0.12));
  color: #244b2b;
}

.card-actions .buy-quantity button,
.card-actions .buy-quantity button:first-child,
.card-actions .buy-quantity button:hover {
  width: 42px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: rgba(63, 111, 69, 0.08);
  box-shadow: none;
  color: #244b2b;
  transform: none;
}

.card-actions .buy-quantity input {
  min-height: 44px;
  box-shadow: none;
  transform: none;
}

.card-actions .buy-action-row > button {
  flex: 1 1 190px;
}

.card-actions button:hover,
.admin-actions button:hover,
.review-item button:hover,
.quantity-row button:hover,
.code-check-row button:hover {
  transform: translateY(-1px);
  background: #fffaf0;
  box-shadow: 0 9px 18px rgba(46, 35, 24, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(420px, 100%);
  height: 100vh;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 247, 232, 0.96));
  border-radius: var(--radius) 0 0 var(--radius);
  border-left: 1px solid var(--line);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(63, 48, 37, 0.12);
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 36, 31, 0.22);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  background: rgba(255, 250, 240, 0.97);
  border-radius: var(--radius);
}

.auth-modal-content {
  width: min(520px, 100%);
}

.admin-main,
.legal-document {
  min-height: 58vh;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
}

.modal-layout {
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr);
  gap: 18px;
}

.stars {
  color: #b55f18;
  font-weight: 800;
}

.site-footer {
  justify-content: center;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 24px;
  padding: 18px;
  border: 1px solid rgba(63, 48, 37, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.56);
  box-shadow: 0 12px 30px rgba(46, 35, 24, 0.08);
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 18px auto 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 1200;
  transform: translateX(-50%);
  max-width: min(680px, calc(100vw - 28px));
  padding: 13px 18px;
  border-radius: var(--radius-pill);
  color: #fffaf0;
  background: var(--ink);
  box-shadow: 0 18px 48px rgba(43, 36, 31, 0.28);
  border: 1px solid rgba(255, 250, 240, 0.14);
  pointer-events: none;
  font-weight: 950;
  line-height: 1.35;
  text-align: center;
}

.toast.is-error {
  border-color: rgba(255, 210, 199, 0.56);
  color: #fffaf0;
  background:
    linear-gradient(135deg, #7e2d24, #a84f28 55%, #7a4f2c);
  box-shadow: 0 22px 58px rgba(80, 24, 18, 0.38), 0 0 0 4px rgba(174, 68, 48, 0.16);
}

.toast.is-success {
  border-color: rgba(218, 238, 204, 0.34);
  background:
    linear-gradient(135deg, #244b2b, #6f8f55);
}

.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(43, 36, 31, 0.08);
  pointer-events: auto;
}

.cookie-consent-banner {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 200;
  width: min(390px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid rgba(63, 48, 37, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 247, 232, 0.96));
  box-shadow: 0 24px 64px rgba(46, 35, 24, 0.24);
}

.cookie-consent-banner h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #244b2b;
}

.cookie-consent-banner p {
  margin: 0 0 12px;
  color: rgba(43, 36, 31, 0.78);
}

.cookie-consent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-consent-actions button {
  flex: 1 1 130px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 13px;
  background: rgba(255, 247, 232, 0.94);
  cursor: pointer;
  font-weight: 850;
}

.cookie-consent-actions #acceptCookies {
  color: #fffaf0;
  border-color: rgba(63, 111, 69, 0.28);
  background: linear-gradient(135deg, var(--leaf), var(--orange));
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  :root {
    --header-height: 58px;
  }

  body {
    background:
      linear-gradient(135deg, #fffaf0 0%, #f1dfc4 52%, #e7c7a1 100%);
  }

  button,
  a {
    min-height: 38px;
  }

  .site-header {
    align-items: center;
  }

  .toolbar,
  .account-admin-grid,
  .modal-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    --header-height: 58px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 8px;
    padding: 6px 8px 7px;
    min-height: 0;
    overflow: visible;
  }

  .site-header.is-hidden-mobile {
    transform: translateY(-105%);
  }

  .brand {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    gap: 7px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    display: none;
  }

  .main-nav {
    grid-column: 1 / -1;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: visible;
    overflow-y: hidden;
    padding-bottom: 0;
  }

  .main-nav a,
  .main-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-align: center;
    flex: 0 0 auto;
  }

  .main-nav a,
  .site-footer a,
  .primary-link,
  .secondary-link {
    padding: 7px 9px;
    font-size: 12px;
  }

  .icon-button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .user-button {
    width: 34px;
    height: 34px;
    justify-self: center;
  }

  .user-button span::before {
    top: 7px;
    width: 9px;
    height: 9px;
  }

  .user-button span::after {
    bottom: 6px;
    width: 18px;
    height: 11px;
  }

  .admin-header-link {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .hero {
    min-height: 300px;
    padding: 24px 14px;
    align-items: flex-end;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero p {
    font-size: 16px;
    margin: 8px 0 14px;
  }

  .toolbar,
  .book-grid,
  .wishlist-panel,
  .admin-main,
  .legal-document {
    width: min(100% - 18px, 1180px);
    margin: 12px auto;
  }

  .toolbar {
    gap: 10px;
    padding: 10px;
  }

  input,
  select,
  textarea {
    padding: 10px 11px;
    border-radius: var(--radius-pill);
  }

  textarea,
  select[multiple] {
    border-radius: var(--radius-sm);
  }

  select {
    min-height: 42px;
  }

  textarea {
    min-height: 86px;
  }

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

  .book-card {
    grid-template-columns: 1fr;
    box-shadow: 0 10px 26px rgba(46, 35, 24, 0.12);
  }

  .book-card::after {
    display: none;
  }

  .book-card:hover {
    transform: none;
  }

  .book-card img {
    height: auto;
    min-height: 0;
    max-height: 310px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .book-body {
    padding: 10px;
    gap: 7px;
  }

  .book-title {
    font-size: 17px;
  }

  .book-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
  }

  .price {
    font-size: 16px;
  }

  body.design-modern .book-card .price-sale {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    padding: 9px 10px;
  }

  body.design-modern .book-card .price-sale .sale-label {
    grid-column: 1;
    grid-row: 1;
  }

  body.design-modern .book-card .price-sale em {
    grid-column: 2;
    grid-row: 1;
    padding: 4px 7px;
  }

  body.design-modern .book-card .price-sale s {
    grid-column: 1;
    grid-row: 2;
  }

  body.design-modern .book-card .price-sale strong {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 20px;
  }

  .stock-pill {
    padding: 4px 7px;
    font-size: 12px;
  }

  .stars {
    font-size: 14px;
  }

  .card-actions,
  .admin-actions,
  .order-shipping-form,
  .quantity-row,
  .code-check-row,
  #variantPricesWrap {
    display: grid;
    grid-template-columns: 1fr;
  }

  .card-actions button,
  .admin-actions button,
  .review-item button,
  .quantity-row button,
  .code-check-row button,
  button[type="submit"],
  .secondary-button,
  .google-button {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .cart-drawer {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-radius: 0;
    border-left: 0;
  }

  .cart-drawer .drawer-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background:
      linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 247, 232, 0.94));
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .cart-drawer .checkout-form {
    padding-bottom: max(78px, calc(70px + env(safe-area-inset-bottom)));
  }

  .cart-drawer .checkout-form button[type="submit"] {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 4;
    box-shadow: 0 14px 30px rgba(46, 35, 24, 0.22);
  }

  .modal {
    align-items: start;
    padding: 9px;
    overflow: auto;
  }

  .modal-content {
    width: 100%;
    max-height: none;
    min-height: calc(100vh - 18px);
    padding: 13px;
  }

  .modal-close {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: block;
  }

  .modal-cover {
    max-height: 340px;
  }

  .toast {
    width: calc(100% - 24px);
    bottom: 12px;
    text-align: center;
  }

  .cover-preview {
    justify-self: center;
    width: min(230px, 100%);
  }

  .product-preview-grid,
  .product-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-preview-grid img,
  .product-gallery img {
    min-height: 118px;
  }

  .summary-grid,
  .newsletter-card {
    grid-template-columns: 1fr;
  }

  .stats-panel,
  .panel,
  .legal-page {
    padding: 13px;
  }

  .newsletter-main {
    width: min(100% - 18px, 980px);
    margin: 12px auto 30px;
  }

  .social-main {
    width: min(100% - 18px, 1040px);
    margin: 12px auto 30px;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }

  .social-card {
    min-height: 0;
  }

  .newsletter-hero {
    min-height: 190px;
    padding: 16px;
  }

  .newsletter-hero h1 {
    font-size: 34px;
  }

  .account-main {
    width: min(100% - 18px, 760px);
    margin-top: 12px;
  }

  .account-page-heading {
    display: grid;
  }
}

html,
body,
body * {
  font-weight: 800 !important;
  font-synthesis: weight;
  -webkit-text-stroke: 0.12px currentColor;
}

@media (max-width: 430px) {
  .main-nav {
    display: flex;
    gap: 5px;
  }

  .main-nav a,
  .main-nav button {
    font-size: 12px;
  }

  .main-nav .user-button {
    flex: 0 0 auto;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .book-card {
    grid-template-columns: 1fr;
  }

  .book-card img {
    min-height: 0;
    max-height: 260px;
  }

  .book-body {
    gap: 6px;
    padding: 9px;
  }

  .book-title {
    font-size: 16px;
  }

  .book-body p {
    font-size: 13px;
  }

  .stock-pill {
    font-size: 11px;
  }

  .hero {
    min-height: 270px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .main-nav {
    font-size: 12px;
  }

  .cover-preview {
    width: min(210px, 100%);
  }

  .product-preview-grid img,
  .product-gallery img {
    min-height: 104px;
  }
}

body.design-modern .legal-document,
body.design-modern .legal-document .panel,
body.design-modern .legal-document .panel > h1,
body.design-modern .legal-document .panel > h2,
body.design-modern .legal-document h1,
body.design-modern .legal-document h2,
body.design-modern .legal-document h3,
body.design-modern .legal-document p,
body.design-modern .legal-document li,
body.design-modern .legal-document a,
.legal-document,
.legal-document .panel,
.legal-document .panel > h1,
.legal-document .panel > h2,
.legal-document h1,
.legal-document h2,
.legal-document h3,
.legal-document p,
.legal-document li,
.legal-document a {
  font-family: var(--clean-font);
  font-weight: 400;
  letter-spacing: 0;
}

.legal-content {
  line-height: 1.65;
}

.legal-content h2 {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid rgba(63, 48, 37, 0.12);
  color: #244b2b;
  font-weight: 800;
}

.legal-content h3 {
  margin-top: 22px;
  color: #6f432e;
  font-weight: 800;
}

.legal-content address {
  border-left: 4px solid rgba(63, 111, 69, 0.42);
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.07), rgba(138, 86, 55, 0.06));
  font-family: var(--clean-font);
  font-style: normal;
}

.legal-content li + li {
  margin-top: 5px;
}

.legal-placeholder-note {
  margin-top: 30px;
  border: 1px solid rgba(215, 125, 50, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: rgba(215, 125, 50, 0.09);
  font-family: var(--clean-font);
}

@media (max-width: 760px) {
  .admin-panel {
    padding: 14px;
  }
}

.support-page .panel {
  display: grid;
  gap: 18px;
}

.support-admin-panel,
.support-chat-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.68);
}

.support-chat-list-item.is-active {
  border-color: rgba(63, 111, 69, 0.42);
  background: rgba(63, 111, 69, 0.1);
}

.support-messages {
  display: grid;
  gap: 10px;
  min-height: 280px;
  max-height: 440px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(63, 48, 37, 0.12);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.58);
}

.support-message {
  position: relative;
  width: min(82%, 560px);
  padding: 10px 12px 9px;
  border: 1px solid rgba(63, 48, 37, 0.1);
  border-radius: 18px;
  background: #fff7e8;
  box-shadow: 0 7px 18px rgba(46, 35, 24, 0.08);
  animation: softPop 0.22s ease both;
}

.support-message.is-support {
  justify-self: end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, rgba(207, 235, 197, 0.96), rgba(231, 246, 221, 0.96));
}

.support-message.is-customer {
  justify-self: start;
  border-bottom-left-radius: 6px;
  background: rgba(255, 250, 240, 0.98);
}

.support-message::after {
  content: "";
  position: absolute;
  bottom: -1px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-bottom: 1px solid rgba(63, 48, 37, 0.08);
}

.support-message.is-support::after {
  right: -5px;
  border-right: 1px solid rgba(63, 48, 37, 0.08);
  border-bottom-left-radius: 12px;
  transform: skewX(-18deg);
}

.support-message.is-customer::after {
  left: -5px;
  border-left: 1px solid rgba(63, 48, 37, 0.08);
  border-bottom-right-radius: 12px;
  transform: skewX(18deg);
}

.support-message strong {
  display: block;
  margin-bottom: 2px;
  color: rgba(43, 36, 31, 0.72);
  font-size: 12px;
}

.support-message p {
  margin: 4px 0 0;
}

.support-ended-notice {
  align-self: center;
  justify-self: center;
  margin: 20px auto;
  padding: 10px 13px;
  border: 1px solid rgba(138, 86, 55, 0.18);
  border-radius: 999px;
  background: rgba(255, 247, 232, 0.92);
  color: rgba(43, 36, 31, 0.76);
  font-weight: 850;
  text-align: center;
}

.support-chat-form {
  display: grid;
  gap: 10px;
}

.customer-support-widget {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 210;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}

.customer-support-toggle,
.customer-support-panel {
  pointer-events: auto;
}

.customer-support-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid rgba(255, 250, 240, 0.42);
  border-radius: 999px;
  padding: 11px 15px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, var(--leaf), var(--orange));
  box-shadow: 0 18px 38px rgba(46, 35, 24, 0.24);
  cursor: pointer;
  font-weight: 900;
}

.customer-support-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f4c04e;
  box-shadow: 0 0 0 4px rgba(244, 192, 78, 0.2);
}

.customer-support-widget[data-status="present"] .customer-support-dot {
  background: #78c56f;
  box-shadow: 0 0 0 4px rgba(120, 197, 111, 0.22);
}

.customer-support-widget[data-status="away"] .customer-support-dot {
  background: #d08b6d;
  box-shadow: 0 0 0 4px rgba(208, 139, 109, 0.2);
}

.customer-support-panel {
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(63, 48, 37, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 247, 232, 0.96));
  box-shadow: 0 26px 68px rgba(46, 35, 24, 0.28);
  animation: softPop 0.2s ease both;
}

.customer-support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 13px 10px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.96), rgba(138, 86, 55, 0.94));
}

.customer-support-head strong {
  display: block;
  font-size: 18px;
}

.customer-support-head p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.25;
  color: rgba(255, 250, 240, 0.86);
}

.customer-support-head .icon-button {
  min-width: 34px;
  min-height: 34px;
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.28);
  background: rgba(255, 250, 240, 0.14);
}

.customer-support-messages {
  min-height: 210px;
  max-height: 320px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 250, 240, 0.54);
}

.support-widget-admin-tools {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(63, 48, 37, 0.12);
  background: rgba(255, 250, 240, 0.74);
}

.support-widget-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.support-widget-mode button,
.support-widget-chat-list button,
.support-widget-chat-entry button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 247, 232, 0.94);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.support-widget-mode button.is-active,
.support-widget-chat-list button.is-active,
.support-widget-chat-entry.is-active > button:first-child {
  color: #fffaf0;
  border-color: rgba(63, 111, 69, 0.32);
  background: linear-gradient(135deg, var(--leaf), var(--orange));
}

.support-widget-chat-list {
  display: grid;
  gap: 7px;
  max-height: 120px;
  overflow: auto;
}

.support-widget-chat-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.support-widget-chat-list button,
.support-widget-chat-entry button:first-child {
  display: grid;
  gap: 2px;
  border-radius: 14px;
  text-align: left;
}

.support-widget-chat-entry > button:last-child {
  align-self: center;
  white-space: nowrap;
}

.support-widget-chat-list span,
.support-widget-chat-list small {
  overflow: hidden;
  color: rgba(43, 36, 31, 0.68);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-widget-assign-box {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

.support-widget-assign-box select,
.support-widget-assign-box button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 9px;
  background: rgba(255, 247, 232, 0.94);
  font-weight: 850;
}

.customer-support-panel .support-chat-form {
  padding: 11px;
  border-top: 1px solid rgba(63, 48, 37, 0.12);
}

.customer-support-panel textarea {
  min-height: 70px;
  resize: vertical;
}

.customer-support-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.customer-support-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 247, 232, 0.94);
  cursor: pointer;
  font-weight: 850;
}

.customer-support-actions button[type="submit"] {
  border-color: rgba(63, 111, 69, 0.3);
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
}

.support-typing span {
  animation: typingDot 1s ease-in-out infinite;
}

.support-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.support-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.support-typing {
  display: none !important;
}

@keyframes typingDot {
  0%, 70%, 100% {
    opacity: 0.25;
  }
  35% {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .support-message {
    width: 94%;
  }

  .customer-support-widget {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .customer-support-panel {
    width: calc(100vw - 20px);
    border-radius: 18px;
  }

  .customer-support-toggle {
    min-height: 42px;
    padding: 9px 13px;
    font-size: 13px;
  }

  .customer-support-messages {
    min-height: 190px;
    max-height: min(300px, 42vh);
  }

  .customer-support-actions {
    grid-template-columns: 1fr;
  }
}

@supports (-webkit-touch-callout: none) {
  body.design-modern,
  body.design-modern button,
  body.design-modern input,
  body.design-modern select,
  body.design-modern textarea,
  body.design-modern #bookModal #modalTitle {
    font-family: var(--ios-readable-font);
    font-weight: 650;
  }

  body.design-modern .brand strong,
  body.design-modern h1,
  body.design-modern h2,
  body.design-modern h3 {
    font-family: var(--ios-readable-font);
    letter-spacing: 0;
  }
}

.account-security-section {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(63, 48, 37, 0.14);
}

.account-security-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-security-heading h2,
.security-setting h3 {
  margin: 0;
}

.security-status {
  flex: 0 0 auto;
  border: 1px solid rgba(138, 86, 55, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  color: #7b3f1f;
  background: rgba(138, 86, 55, 0.1);
  font-weight: 850;
}

.security-status.is-on {
  border-color: rgba(63, 111, 69, 0.28);
  color: #244b2b;
  background: rgba(63, 111, 69, 0.12);
}

.security-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.security-setting {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(63, 48, 37, 0.14);
  border-radius: var(--radius-sm);
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 250, 240, 0.9), rgba(255, 247, 232, 0.7)),
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.1), transparent 38%);
  box-shadow: 0 10px 26px rgba(46, 35, 24, 0.07);
}

.security-setting p {
  margin: 0;
}

.security-setting button {
  justify-self: start;
  min-height: 42px;
  border: 1px solid rgba(63, 111, 69, 0.3);
  border-radius: 999px;
  padding: 10px 15px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  box-shadow: 0 10px 22px rgba(46, 35, 24, 0.14);
  cursor: pointer;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.security-setting button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 14px 28px rgba(46, 35, 24, 0.18);
}

.security-setting button:focus-visible {
  outline: 3px solid rgba(215, 125, 50, 0.28);
  outline-offset: 2px;
}

.security-setting button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.25);
}

@media (max-width: 760px) {
  body.design-modern,
  body.design-modern h1,
  body.design-modern h2,
  body.design-modern h3,
  body.design-modern h4,
  body.design-modern p,
  body.design-modern span,
  body.design-modern label,
  body.design-modern a,
  body.design-modern button,
  body.design-modern input,
  body.design-modern select,
  body.design-modern textarea,
  body.design-modern strong,
  body.design-modern small {
    font-family: "Entfalta Segoe Print", cursive !important;
    letter-spacing: 0;
  }

  body.design-modern {
    font-weight: 500;
  }

  body.design-modern h1,
  body.design-modern h2,
  body.design-modern h3,
  body.design-modern .brand strong,
  body.design-modern .book-title,
  body.design-modern #bookModal #modalTitle {
    font-family: "Entfalta Segoe Print", cursive !important;
    font-weight: 700;
    letter-spacing: 0;
  }

  .account-security-heading {
    display: grid;
  }

  .security-status {
    justify-self: start;
  }

  .security-settings-grid {
    grid-template-columns: 1fr;
  }
}

body.legal-site-page,
body.legal-site-page * {
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: 400 !important;
  font-synthesis: none;
  -webkit-text-stroke: 0 transparent;
  letter-spacing: 0;
}

body.legal-site-page .legal-document h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700 !important;
}

body.legal-site-page .legal-document h2 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700 !important;
}

body.legal-site-page .legal-document h3 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700 !important;
}

body.legal-site-page .legal-document p,
body.legal-site-page .legal-document li,
body.legal-site-page .legal-document address,
body.legal-site-page .legal-document a {
  font-size: 16px;
  line-height: 1.65;
}

body.legal-site-page strong,
body.legal-site-page b {
  font-weight: 700 !important;
}

@media (max-width: 760px) {
  body.legal-site-page .legal-document h1 {
    font-size: 28px;
  }

  body.legal-site-page .legal-document h2 {
    font-size: 20px;
  }

  body.legal-site-page .legal-document h3 {
    font-size: 17px;
  }

  body.legal-site-page .legal-document p,
  body.legal-site-page .legal-document li,
  body.legal-site-page .legal-document address,
  body.legal-site-page .legal-document a {
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  body.design-modern::before,
  body.design-modern::after {
    display: none;
    animation: none !important;
  }

  body.design-modern .price-sale,
  body.design-modern .price-sale em,
  body.design-modern .stars,
  body.design-modern .hero-copy,
  body.design-modern .newsletter-hero::after {
    animation: none !important;
  }

  .site-header,
  .toolbar,
  .panel,
  .modal-content,
  .cart-drawer,
  .cookie-consent-banner,
  .customer-support-panel {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .site-header,
  .page-scroll-indicator,
  .cart-drawer,
  .customer-support-widget {
    will-change: transform;
  }

  .book-card,
  .newsletter-card,
  .admin-item,
  .customer-order-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
  }

  body.design-modern .book-card,
  body.design-modern .panel,
  body.design-modern .modal-content,
  body.design-modern .cart-drawer,
  .admin-item,
  .cart-item {
    box-shadow: 0 7px 18px rgba(46, 35, 24, 0.1);
  }

  .book-card,
  .book-card img,
  button,
  input,
  select,
  textarea {
    transition-duration: 0.14s !important;
  }

  .book-card:hover,
  body.design-modern .book-card:hover,
  .book-card:hover img,
  body.design-modern .book-card:hover img {
    transform: none;
    filter: none;
  }
}

body.theme-dark,
body.theme-dark * {
  color: #fff3e2;
}

body.theme-dark.design-modern::before {
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 250, 240, 0.08) 19% 21%, transparent 22% 100%),
    radial-gradient(ellipse at 8% 42%, rgba(63, 111, 69, 0.12), transparent 34%),
    radial-gradient(ellipse at 92% 72%, rgba(215, 125, 50, 0.09), transparent 32%);
  opacity: 0.55;
}

body.theme-dark.design-modern::after {
  background:
    linear-gradient(90deg, transparent, rgba(255, 250, 240, 0.06), transparent),
    radial-gradient(circle at 50% 0%, rgba(255, 250, 240, 0.08), transparent 36%);
  opacity: 0.38;
}

body.theme-dark.design-modern .site-header,
body.theme-dark .site-header {
  background:
    linear-gradient(90deg, rgba(29, 34, 25, 0.96), rgba(45, 40, 30, 0.92)),
    linear-gradient(135deg, rgba(63, 111, 69, 0.16), rgba(215, 125, 50, 0.1));
  border-bottom-color: rgba(255, 250, 240, 0.16);
}

body.theme-dark .brand strong,
body.theme-dark .brand small,
body.theme-dark .main-nav a,
body.theme-dark .main-nav button,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark p,
body.theme-dark label,
body.theme-dark small,
body.theme-dark strong,
body.theme-dark b,
body.theme-dark .muted,
body.theme-dark .price,
body.theme-dark .stars {
  color: #fff3e2;
}

body.theme-dark .muted,
body.theme-dark .brand small,
body.theme-dark .auth-action-card p,
body.theme-dark .panel p.muted {
  color: rgba(255, 243, 226, 0.78);
}

body.theme-dark.design-modern .panel,
body.theme-dark.design-modern .modal-content,
body.theme-dark.design-modern .cart-drawer,
body.theme-dark.design-modern .book-card,
body.theme-dark.design-modern .newsletter-card,
body.theme-dark.design-modern .admin-item,
body.theme-dark.design-modern .review-item,
body.theme-dark.design-modern .cart-item,
body.theme-dark.design-modern .auth-action-card,
body.theme-dark .panel,
body.theme-dark .modal-content,
body.theme-dark .cart-drawer,
body.theme-dark .book-card,
body.theme-dark .newsletter-card,
body.theme-dark .admin-item,
body.theme-dark .review-item,
body.theme-dark .cart-item,
body.theme-dark .auth-action-card {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(33, 39, 29, 0.98), rgba(44, 43, 32, 0.94));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body.theme-dark.design-modern .admin-panel,
body.theme-dark .admin-panel {
  background: transparent;
  box-shadow: none;
}

body.theme-dark.design-modern .admin-panel > .stacked-form,
body.theme-dark.design-modern .admin-panel > .admin-list,
body.theme-dark.design-modern .admin-panel > .stats-panel,
body.theme-dark.design-modern .admin-panel > #adminOrderSummary,
body.theme-dark .admin-panel > .stacked-form,
body.theme-dark .admin-panel > .admin-list,
body.theme-dark .admin-panel > .stats-panel,
body.theme-dark .admin-panel > #adminOrderSummary {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    linear-gradient(180deg, rgba(36, 42, 31, 0.98), rgba(45, 44, 33, 0.94));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark.design-modern input,
body.theme-dark.design-modern select,
body.theme-dark.design-modern textarea {
  border-color: rgba(255, 250, 240, 0.22);
  color: #fff3e2;
  background-color: rgba(18, 22, 16, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.08);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder,
body.theme-dark.design-modern input::placeholder,
body.theme-dark.design-modern textarea::placeholder {
  color: rgba(255, 243, 226, 0.64);
}

body.theme-dark select option {
  color: #fff3e2;
  background: #23291e;
}

body.theme-dark .checkbox-line input[type="checkbox"] {
  accent-color: var(--orange);
}

body.theme-dark .icon-button,
body.theme-dark .user-button,
body.theme-dark .secondary-link,
body.theme-dark .mini-link-button,
body.theme-dark .google-button,
body.theme-dark .main-nav a,
body.theme-dark .admin-header-link,
body.theme-dark .account-tools button,
body.theme-dark .admin-actions button,
body.theme-dark .card-actions button,
body.theme-dark .quantity-row button,
body.theme-dark .buy-quantity button {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.1);
}

body.theme-dark .buy-quantity {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(8, 12, 8, 0.34);
}

body.theme-dark .buy-quantity input {
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.06);
}

body.theme-dark .buy-quantity button:hover,
body.theme-dark .quantity-row button:hover {
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.3);
  background: linear-gradient(135deg, #4f8955, #9b6844);
}

body.theme-dark .buy-quantity button:disabled,
body.theme-dark .quantity-row button:disabled {
  color: rgba(255, 243, 226, 0.42);
  border-color: rgba(255, 250, 240, 0.1);
  background: rgba(255, 250, 240, 0.06);
}

body.theme-dark button[type="submit"],
body.theme-dark .primary-link,
body.theme-dark .account-login-button {
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #9b6844);
}

body.theme-dark .stock-pill,
body.theme-dark .role-pill {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fff3e2;
  background: rgba(63, 111, 69, 0.28);
}

body.theme-dark .stock-pill-soldout {
  border-color: rgba(242, 122, 96, 0.38);
  color: #ffd2c7;
  background: rgba(174, 68, 48, 0.24);
}

body.theme-dark .price-sale,
body.theme-dark .price-sale strong,
body.theme-dark .price-sale .sale-label {
  color: #fff3e2;
}

body.theme-dark .price-sale s {
  color: rgba(255, 243, 226, 0.58);
}

body.theme-dark .price-sale em {
  color: #ffe7cc;
  background: rgba(215, 125, 50, 0.28);
}

body.theme-dark .site-footer {
  border-color: rgba(255, 250, 240, 0.16);
  background: rgba(35, 40, 30, 0.88);
}

body.theme-dark.design-modern .toolbar,
body.theme-dark .toolbar {
  border-color: rgba(255, 250, 240, 0.2);
  background:
    radial-gradient(circle at 10% 0, rgba(215, 125, 50, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.26);
}

body.theme-dark.design-modern label,
body.theme-dark label {
  color: #fff3e2;
}

body.theme-dark.design-modern input:focus,
body.theme-dark.design-modern select:focus,
body.theme-dark.design-modern textarea:focus,
body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color: rgba(215, 125, 50, 0.66);
  color: #fff3e2;
  background:
    linear-gradient(180deg, rgba(23, 28, 20, 0.96), rgba(34, 38, 28, 0.94));
  box-shadow: 0 0 0 4px rgba(215, 125, 50, 0.18), 0 12px 26px rgba(0, 0, 0, 0.22);
}

body.theme-dark.design-modern input[type="search"],
body.theme-dark.design-modern #searchInput,
body.theme-dark input[type="search"],
body.theme-dark #searchInput {
  color: #fff3e2;
  background-image:
    radial-gradient(circle at 20px 50%, rgba(215, 125, 50, 0.58) 0 5px, transparent 6px),
    linear-gradient(180deg, rgba(23, 28, 20, 0.96), rgba(34, 38, 28, 0.94));
}

body.theme-dark.design-modern .security-setting,
body.theme-dark .security-setting,
body.theme-dark.design-modern .profile-manage-form,
body.theme-dark .profile-manage-form,
body.theme-dark.design-modern .account-security-section,
body.theme-dark .account-security-section {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark.design-modern #bookModal .modal-content,
body.theme-dark #bookModal .modal-content {
  border-color: rgba(255, 250, 240, 0.2);
  background:
    radial-gradient(circle at 8% 12%, rgba(215, 125, 50, 0.11), transparent 28%),
    radial-gradient(circle at 94% 86%, rgba(63, 111, 69, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(32, 37, 27, 0.99), rgba(43, 42, 31, 0.96));
}

body.theme-dark.design-modern #bookModal .modal-layout > div > p:not(.price):not(.stars),
body.theme-dark #bookModal .modal-layout > div > p:not(.price):not(.stars),
body.theme-dark.design-modern #bookModal #modalTitle,
body.theme-dark #bookModal #modalTitle,
body.theme-dark.design-modern #bookModal .published-date,
body.theme-dark #bookModal .published-date {
  color: #fff3e2;
}

body.theme-dark.design-modern #bookModal .published-date,
body.theme-dark #bookModal .published-date,
body.theme-dark.design-modern #bookModal .stars,
body.theme-dark #bookModal .stars,
body.theme-dark.design-modern #bookModal .card-actions,
body.theme-dark #bookModal .card-actions,
body.theme-dark.design-modern #bookModal #reviewForm,
body.theme-dark #bookModal #reviewForm,
body.theme-dark.design-modern #bookModal .preview-section,
body.theme-dark #bookModal .preview-section,
body.theme-dark.design-modern #bookModal .product-gallery,
body.theme-dark #bookModal .product-gallery {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(18, 22, 16, 0.56);
}

body.theme-dark.design-modern #bookModal .modal-cover,
body.theme-dark #bookModal .modal-cover,
body.theme-dark.design-modern #bookModal .preview-pages img,
body.theme-dark #bookModal .preview-pages img,
body.theme-dark.design-modern #bookModal .product-gallery img,
body.theme-dark #bookModal .product-gallery img {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.18), rgba(138, 86, 55, 0.16)),
    rgba(18, 22, 16, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

body.theme-dark.design-modern .price-sale,
body.theme-dark .price-sale {
  border-color: rgba(215, 125, 50, 0.38);
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.2), rgba(215, 125, 50, 0.14)),
    rgba(18, 22, 16, 0.62);
}

body.theme-dark.design-modern .book-card .price-sale s,
body.theme-dark .book-card .price-sale s {
  color: rgba(255, 243, 226, 0.62);
}

body.theme-dark.design-modern .book-card .price-sale strong,
body.theme-dark .book-card .price-sale strong {
  color: #fff3e2;
}

body.theme-dark.design-modern .book-card .price-sale .sale-label,
body.theme-dark .book-card .price-sale .sale-label {
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #c77c3a);
}

body.theme-dark.design-modern .stock-pill,
body.theme-dark .stock-pill {
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.32), rgba(255, 250, 240, 0.08));
}

body.theme-dark.design-modern .stars,
body.theme-dark .stars {
  color: #ffd08a;
  background: rgba(215, 125, 50, 0.14);
}

body.theme-dark .main-nav a[data-category].active,
body.theme-dark .main-nav a.active {
  border-color: rgba(215, 125, 50, 0.46);
  color: #fff3e2;
  background:
    linear-gradient(135deg, rgba(63, 111, 69, 0.44), rgba(138, 86, 55, 0.34));
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.12);
}

body.theme-dark .cookie-consent-overlay,
body.theme-dark .consent-overlay {
  background: rgba(8, 12, 7, 0.46);
}

body.theme-dark .cookie-consent-banner,
body.theme-dark .consent-panel {
  border-color: rgba(255, 250, 240, 0.2);
  background:
    radial-gradient(circle at 12% 0, rgba(215, 125, 50, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.99), rgba(44, 43, 32, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

body.theme-dark .cookie-consent-banner h2,
body.theme-dark .cookie-consent-banner p,
body.theme-dark .consent-panel h2,
body.theme-dark .consent-panel p,
body.theme-dark .consent-panel a {
  color: #fff3e2;
}

body.theme-dark .cookie-consent-actions button,
body.theme-dark .consent-actions button {
  border-color: rgba(255, 250, 240, 0.18);
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.1);
}

body.theme-dark .cookie-consent-actions #acceptCookies,
body.theme-dark .consent-actions button:last-child {
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #c77c3a);
}

body.theme-dark .game-header,
body.theme-dark .game-tile,
body.theme-dark .memory-status div,
body.theme-dark .difficulty-control,
body.theme-dark .card-back,
body.theme-dark .win-panel {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark .game-brand strong,
body.theme-dark .game-brand small,
body.theme-dark .game-tile h2,
body.theme-dark .game-tile p,
body.theme-dark .game-tag,
body.theme-dark .play-label,
body.theme-dark .memory-title h1,
body.theme-dark .kind-note,
body.theme-dark .memory-status strong,
body.theme-dark .memory-status span,
body.theme-dark .memory-message,
body.theme-dark .card-label,
body.theme-dark .win-panel h2,
body.theme-dark .win-panel p {
  color: #fff3e2;
}

body.theme-dark .game-header nav a,
body.theme-dark .game-footer a,
body.theme-dark .win-actions a,
body.theme-dark .icon-control {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.1);
}

/* Games shared styles */
.game-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 10px clamp(14px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 8px 24px rgba(46, 35, 24, 0.09);
}

.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.game-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.5);
}

.game-brand span {
  display: grid;
  min-width: 0;
}

.game-brand strong {
  color: #244b2b;
  font-size: 20px;
  line-height: 1.05;
}

.game-brand small {
  overflow: hidden;
  color: rgba(43, 36, 31, 0.68);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-header nav a,
.game-footer a,
.win-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 999px;
  padding: 8px 13px;
  color: #244b2b;
  background: rgba(255, 247, 232, 0.88);
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.game-header nav a:hover,
.game-footer a:hover,
.win-actions a:hover {
  transform: translateY(-1px);
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(46, 35, 24, 0.1);
}

.game-library,
.memory-main {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
}

.game-library {
  min-height: calc(100vh - 150px);
  padding: clamp(28px, 6vw, 64px) 0 44px;
}

.library-heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #6f432e;
  font-size: 14px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #244b2b;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.game-tile {
  overflow: hidden;
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 52px rgba(46, 35, 24, 0.18);
}

.game-tile-link {
  display: grid;
  color: inherit;
  text-decoration: none;
}

.emotion-preview {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(63, 111, 69, 0.82), rgba(111, 143, 85, 0.7) 44%, rgba(215, 125, 50, 0.78));
}

.emotion-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(180deg, transparent, rgba(43, 36, 31, 0.16));
}

.preview-face {
  position: absolute;
  z-index: 1;
  width: 88px;
  height: 88px;
  border: 5px solid rgba(255, 250, 240, 0.72);
  border-radius: 50%;
  background: #f5cda6;
  box-shadow: 0 14px 26px rgba(43, 36, 31, 0.22);
}

.preview-face::before {
  content: "••";
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  color: #3e2e27;
  font-family: Arial, sans-serif;
  font-size: 26px;
  letter-spacing: 18px;
  text-align: center;
  text-indent: 18px;
}

.preview-face::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 30px;
  height: 14px;
  border-bottom: 5px solid #8a5637;
  border-radius: 50%;
  transform: translateX(-50%);
}

.preview-happy {
  top: 48px;
  left: 12%;
  transform: rotate(-8deg);
}

.preview-worried {
  top: 80px;
  left: calc(50% - 44px);
  transform: rotate(3deg);
}

.preview-worried::after {
  border-top: 5px solid #8a5637;
  border-bottom: 0;
}

.preview-calm {
  top: 42px;
  right: 12%;
  transform: rotate(8deg);
}

.preview-calm::after {
  height: 0;
  border-bottom: 4px solid #8a5637;
  border-radius: 0;
}

.game-tile-copy {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.game-tag {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  color: #244b2b;
  background: rgba(63, 111, 69, 0.12);
  font-size: 13px;
}

.game-tile h2 {
  margin: 0;
  color: #244b2b;
  font-size: 27px;
}

.game-tile p {
  margin: 0;
  color: rgba(43, 36, 31, 0.76);
}

.play-label {
  margin-top: 5px;
  color: #7b3f1f;
}

.game-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 18px 14px 26px;
}

.game-footer a {
  border: 0;
  border-radius: 0;
  padding: 6px 4px;
  background: transparent;
  box-shadow: none;
}

.game-footer a:hover {
  background: transparent;
  box-shadow: none;
}

.memory-main {
  padding: 22px 0 46px;
}

.memory-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.memory-title h1 {
  font-size: clamp(30px, 5vw, 48px);
}

.kind-note {
  max-width: 620px;
  margin: 7px 0 0;
  color: rgba(43, 36, 31, 0.7);
  font-size: 14px;
}

.memory-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.difficulty-control {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(63, 111, 69, 0.24);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.78);
}

.difficulty-control button,
.icon-control,
.win-actions button {
  min-height: 42px;
  border: 0;
  padding: 9px 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.difficulty-control button + button {
  border-left: 1px solid rgba(63, 48, 37, 0.12);
}

.difficulty-control button.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
}

.icon-control {
  width: 44px;
  border: 1px solid rgba(63, 111, 69, 0.24);
  border-radius: 50%;
  color: #244b2b;
  background: rgba(255, 250, 240, 0.86);
  font-family: Arial, sans-serif;
  font-size: 25px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.icon-control:hover {
  transform: rotate(24deg);
  background: #fffaf0;
}

.memory-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px auto 0;
}

.memory-status div {
  display: grid;
  justify-items: center;
  border: 1px solid rgba(63, 48, 37, 0.12);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 250, 240, 0.7);
}

.memory-status strong {
  color: #244b2b;
  font-size: 22px;
  line-height: 1;
}

.memory-status span {
  color: rgba(43, 36, 31, 0.66);
  font-size: 12px;
}

.memory-message {
  min-height: 26px;
  margin: 12px 0 8px;
  color: #6f432e;
  text-align: center;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1.5vw, 13px);
  max-width: 820px;
  margin: 0 auto;
  perspective: 1100px;
}

.memory-card {
  position: relative;
  min-width: 0;
  border: 0;
  aspect-ratio: 4 / 5;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.2, 0.72, 0.24, 1);
}

.memory-card.is-flipped,
.memory-card.is-matched {
  transform: rotateY(180deg);
}

.memory-card.is-matched {
  cursor: default;
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(63, 111, 69, 0.22);
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 9px 22px rgba(46, 35, 24, 0.14);
}

.card-front {
  color: #fffaf0;
  background:
    linear-gradient(145deg, rgba(63, 111, 69, 0.98), rgba(111, 143, 85, 0.9) 48%, rgba(138, 86, 55, 0.96));
}

.card-front::before,
.card-front::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 5px;
}

.card-front::after {
  inset: 18px;
  border-style: dashed;
  opacity: 0.62;
}

.card-question {
  position: relative;
  z-index: 1;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 6vw, 50px);
  font-weight: 900;
}

.card-back {
  align-content: center;
  gap: 5px;
  padding: 8px;
  color: var(--ink);
  background: linear-gradient(155deg, #fffaf0, #f3e6d0);
  transform: rotateY(180deg);
}

.memory-card.is-matched .card-back {
  border-color: rgba(63, 111, 69, 0.6);
  box-shadow: 0 0 0 3px rgba(63, 111, 69, 0.12), 0 9px 22px rgba(46, 35, 24, 0.12);
}

.card-visual {
  width: min(92%, 140px);
  aspect-ratio: 1;
}

.card-visual svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body[data-page="emotion-memory"] .card-back {
  gap: 0;
}

body[data-page="emotion-memory"] .card-visual {
  width: min(96%, 156px);
}

/*
  Alte Textwerte bleiben für Screenreader/aria im DOM, sichtbar ist im Spiel nur Symbolik.
*/
.card-label {
  max-width: 100%;
  color: #244b2b;
  font-size: clamp(10px, 1.8vw, 14px);
  line-height: 1.16;
  text-align: center;
}

.win-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 36, 31, 0.62);
}

.win-panel {
  width: min(430px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 250, 240, 0.4);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(255, 250, 240, 0.98), rgba(243, 230, 208, 0.96));
  box-shadow: 0 28px 76px rgba(43, 36, 31, 0.34);
  text-align: center;
  animation: winIn 0.28s ease both;
}

.win-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--orange), var(--leaf));
  font-family: Arial, sans-serif;
  font-size: 31px;
}

.win-panel h2,
.win-panel p {
  margin: 0;
}

.win-panel h2 {
  color: #244b2b;
  font-size: 28px;
}

.win-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.win-actions button {
  border-radius: 999px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
}

.game-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 150;
  width: min(420px, calc(100% - 24px));
  border-radius: 999px;
  padding: 10px 14px;
  color: #fffaf0;
  background: #2b241f;
  box-shadow: var(--shadow);
  text-align: center;
}

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(43, 36, 31, 0.32);
}

.consent-panel {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 200;
  width: min(390px, calc(100% - 28px));
  border: 1px solid rgba(63, 48, 37, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: #fffaf0;
  box-shadow: 0 24px 60px rgba(43, 36, 31, 0.28);
}

.consent-panel h2,
.consent-panel p {
  margin: 0 0 9px;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.consent-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  cursor: pointer;
  font-weight: 800;
}

.consent-actions button:last-child {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
}

.hidden {
  display: none !important;
}

@keyframes winIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 700px) {
  .game-header {
    min-height: 56px;
    padding: 7px 10px;
  }

  .game-brand img {
    width: 38px;
    height: 38px;
  }

  .game-brand strong {
    font-size: 17px;
  }

  .game-brand small,
  .game-header nav a {
    font-size: 12px;
  }

  .game-header nav a {
    min-height: 36px;
    padding: 7px 10px;
  }

  .game-library,
  .memory-main {
    width: min(100% - 18px, 1080px);
  }

  .game-library {
    padding-top: 24px;
  }

  .emotion-preview {
    min-height: 190px;
  }

  .memory-main {
    padding-top: 12px;
  }

  .memory-toolbar {
    display: grid;
    gap: 12px;
  }

  .memory-controls {
    justify-content: space-between;
  }

  .difficulty-control {
    flex: 1;
  }

  .difficulty-control button {
    min-width: 0;
    padding: 8px 9px;
    font-size: 12px;
  }

  .memory-status {
    margin-top: 10px;
  }

  .memory-status strong {
    font-size: 19px;
  }

  .memory-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .card-back {
    padding: 5px;
  }

  .card-label {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
  }

  .card-face {
    box-shadow: 0 5px 13px rgba(46, 35, 24, 0.12);
  }

  .memory-card {
    transition-duration: 0.3s;
  }
}

@media (max-width: 370px) {
  .game-brand small {
    display: none;
  }

  .memory-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Final dark-mode guards after shared game styles */
body.theme-dark .main-nav a[data-category].active,
body.theme-dark .main-nav a.active {
  border-color: rgba(215, 125, 50, 0.46);
  color: #fff3e2;
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.44), rgba(138, 86, 55, 0.34));
}

body.theme-dark .cookie-consent-banner,
body.theme-dark .consent-panel,
body.theme-dark .game-header,
body.theme-dark .game-tile,
body.theme-dark .game-stat-card,
body.theme-dark .memory-status div,
body.theme-dark .difficulty-control,
body.theme-dark .card-back,
body.theme-dark .win-panel {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark .cookie-consent-banner h2,
body.theme-dark .cookie-consent-banner p,
body.theme-dark .consent-panel h2,
body.theme-dark .consent-panel p,
body.theme-dark .consent-panel a,
body.theme-dark .game-brand strong,
body.theme-dark .game-brand small,
body.theme-dark .game-tile h2,
body.theme-dark .game-tile p,
body.theme-dark .game-tag,
body.theme-dark .play-label,
body.theme-dark .memory-title h1,
body.theme-dark .kind-note,
body.theme-dark .memory-status strong,
body.theme-dark .memory-status span,
body.theme-dark .memory-message,
body.theme-dark .card-label,
body.theme-dark .win-panel h2,
body.theme-dark .win-panel p,
body.theme-dark .game-stat-card h2,
body.theme-dark .game-stat-card p {
  color: #fff3e2;
}

/* Wunschzettel als kleines Lesezeichen-Widget */
.wishlist-panel {
  display: none;
}

.wishlist-widget {
  position: fixed;
  top: calc(var(--header-height, 72px) + 12px);
  left: max(14px, env(safe-area-inset-left));
  z-index: 184;
  display: grid;
  gap: 10px;
  align-items: start;
  pointer-events: none;
}

.wishlist-toggle,
.wishlist-widget-panel {
  pointer-events: auto;
}

.wishlist-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 54px;
  min-height: 48px;
  border: 1px solid rgba(255, 250, 240, 0.48);
  border-radius: 999px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  box-shadow: 0 18px 38px rgba(46, 35, 24, 0.22);
  cursor: pointer;
  font-weight: 950;
}

.wishlist-bookmark {
  width: 18px;
  height: 24px;
  border-radius: 7px 7px 4px 4px;
  background: #fffaf0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  box-shadow: inset 0 -8px 0 rgba(215, 125, 50, 0.24);
}

.wishlist-widget-panel {
  width: min(350px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 130px));
  overflow: auto;
  border: 1px solid rgba(63, 48, 37, 0.16);
  border-radius: 22px;
  padding: 12px;
  background:
    radial-gradient(circle at 0 0, rgba(63, 111, 69, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 247, 232, 0.96));
  box-shadow: 0 26px 68px rgba(46, 35, 24, 0.26);
  animation: softPop 0.2s ease both;
}

.wishlist-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.wishlist-widget-head h2 {
  margin: 0;
  font-size: 22px;
}

.wishlist-entry {
  padding: 12px;
}

/* Dark-Mode Guards für Widgets, Support und kleine helle Restflächen */
body.theme-dark .wishlist-widget-panel,
body.theme-dark .customer-support-panel,
body.theme-dark .support-admin-panel,
body.theme-dark .support-chat-panel,
body.theme-dark .support-page .panel,
body.theme-dark .support-widget-admin-tools,
body.theme-dark .support-widget-chat-list,
body.theme-dark .support-widget-assign-box,
body.theme-dark .customer-support-messages,
body.theme-dark .support-messages,
body.theme-dark .wishlist-entry,
body.theme-dark .admin-item,
body.theme-dark .toolbar {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.15), transparent 36%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.95));
  color: #fff3e2;
}

body.theme-dark .wishlist-widget-panel h2,
body.theme-dark .wishlist-widget-panel strong,
body.theme-dark .wishlist-widget-panel p,
body.theme-dark .wishlist-widget-panel label,
body.theme-dark .customer-support-panel,
body.theme-dark .customer-support-panel strong,
body.theme-dark .customer-support-panel p,
body.theme-dark .customer-support-panel label,
body.theme-dark .support-admin-panel,
body.theme-dark .support-admin-panel strong,
body.theme-dark .support-admin-panel p,
body.theme-dark .support-chat-panel,
body.theme-dark .support-chat-panel strong,
body.theme-dark .support-chat-panel p,
body.theme-dark .support-widget-chat-list span,
body.theme-dark .support-widget-chat-list small {
  color: #fff3e2;
}

body.theme-dark .support-message {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(255, 250, 240, 0.08);
  color: #fff3e2;
}

body.theme-dark .support-message.is-support {
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.7), rgba(86, 112, 72, 0.55));
}

body.theme-dark .support-message.is-customer {
  background: linear-gradient(135deg, rgba(138, 86, 55, 0.64), rgba(70, 61, 42, 0.7));
}

body.theme-dark .support-widget-mode button,
body.theme-dark .support-widget-chat-list button,
body.theme-dark .support-widget-chat-entry button,
body.theme-dark .support-widget-assign-box select,
body.theme-dark .support-widget-assign-box button,
body.theme-dark .customer-support-actions button,
body.theme-dark .wishlist-widget-panel button:not(.icon-button) {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.1);
}

body.theme-dark .profile-photo-settings,
body.theme-dark .profile-file-picker {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark .profile-file-name {
  color: rgba(255, 243, 226, 0.82);
}

body.theme-dark .checkbox-line input[type="checkbox"] {
  border-color: rgba(255, 250, 240, 0.28);
  background: rgba(255, 250, 240, 0.1);
}

body.theme-dark .checkbox-line input[type="checkbox"]:checked {
  border-color: rgba(215, 125, 50, 0.62);
  background: linear-gradient(135deg, #4f8955, #c77c3a);
}

body.theme-dark .support-widget-mode button.is-active,
body.theme-dark .support-widget-chat-list button.is-active,
body.theme-dark .support-widget-chat-entry.is-active > button:first-child,
body.theme-dark .customer-support-actions button[type="submit"],
body.theme-dark .wishlist-widget-panel button[type="button"]:not(.icon-button):hover {
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #c77c3a);
}

body.theme-dark .wishlist-toggle,
body.theme-dark .customer-support-toggle {
  border-color: rgba(255, 250, 240, 0.26);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

body.theme-dark .customer-support-head {
  border-bottom: 1px solid rgba(255, 250, 240, 0.18);
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.95), rgba(138, 86, 55, 0.86));
}

body.theme-dark .user-button.has-profile-photo,
body.theme-dark.design-modern .user-button.has-profile-photo {
  overflow: hidden;
  background:
    var(--profile-photo) center / cover no-repeat,
    rgba(35, 40, 30, 0.9);
}

body.theme-dark #adminOrderSummary .summary-grid > div,
body.theme-dark .order-group,
body.theme-dark .order-group-content,
body.theme-dark .order-card,
body.theme-dark .order-card-content,
body.theme-dark .order-detail-list,
body.theme-dark .order-shipping-form,
body.theme-dark .customer-order-card,
body.theme-dark .download-list,
body.theme-dark .admin-stats-grid > div,
body.theme-dark .stats-panel,
body.theme-dark .admin-item.order-card {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
  color: #fff3e2;
}

body.theme-dark .order-group-collapsible summary,
body.theme-dark .order-card-summary,
body.theme-dark .customer-order-card summary {
  border-color: rgba(255, 250, 240, 0.18);
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.08);
}

body.theme-dark .order-group h3,
body.theme-dark .order-group h3 span,
body.theme-dark .order-card p,
body.theme-dark .order-card strong,
body.theme-dark .order-card small,
body.theme-dark .order-card-summary span,
body.theme-dark .order-detail-list p,
body.theme-dark .order-detail-list strong,
body.theme-dark .summary-grid strong,
body.theme-dark .summary-grid span {
  color: #fff3e2;
}

body.theme-dark .order-card-summary > b,
body.theme-dark .customer-order-card summary > strong,
body.theme-dark .order-detail-list span,
body.theme-dark .download-status {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fff3e2;
  background: rgba(63, 111, 69, 0.24);
}

body.theme-dark .download-status.pending,
body.theme-dark .stock-pill-soldout {
  color: #ffd2c7;
  background: rgba(174, 68, 48, 0.24);
}

body.theme-dark .newsletter-hero button,
body.theme-dark.design-modern .newsletter-hero button,
body.theme-dark #newsletterSubscribe {
  border: 1px solid rgba(255, 250, 240, 0.24);
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #9b6844);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

body.theme-dark .newsletter-hero button:hover,
body.theme-dark.design-modern .newsletter-hero button:hover,
body.theme-dark #newsletterSubscribe:hover {
  color: #fffaf0;
  background: linear-gradient(135deg, #5d9962, #c77c3a);
}

body.theme-dark .social-hero,
body.theme-dark .social-card {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(33, 39, 29, 0.98), rgba(44, 43, 32, 0.94));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

body.theme-dark .social-hero h1,
body.theme-dark .social-hero .muted,
body.theme-dark .social-card h2,
body.theme-dark .social-card p {
  color: #fff3e2;
}

body.theme-dark .social-card p,
body.theme-dark .social-hero .muted {
  opacity: 0.86;
}

body.theme-dark .social-button {
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.24);
  background: linear-gradient(135deg, #5f7f42, #b46a31);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

body.theme-dark .social-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

body.theme-dark .gift-voucher-presets button {
  color: #fff3e2;
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(33, 39, 29, 0.98), rgba(44, 43, 32, 0.94));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
}

body.theme-dark .gift-voucher-presets button:hover,
body.theme-dark .gift-voucher-presets button.is-active {
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.26);
  background: linear-gradient(135deg, #5f7f42, #b46a31);
}

body.theme-dark .gift-voucher-template-card {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.1), transparent 32%),
    rgba(20, 25, 18, 0.72);
}

body.theme-dark .cart-receipt {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(22, 30, 20, 0.98), rgba(27, 34, 24, 0.94));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

body.theme-dark .cart-receipt-head {
  border-bottom-color: rgba(255, 250, 240, 0.24);
  color: rgba(255, 243, 226, 0.76);
}

body.theme-dark .cart-receipt-item {
  border-bottom-color: rgba(255, 250, 240, 0.14);
}

body.theme-dark .cart-receipt-lines > .cart-receipt-row,
body.theme-dark .cart-receipt-summary > .cart-receipt-row {
  border-bottom-color: rgba(255, 250, 240, 0.12);
}

body.theme-dark .cart-receipt-row span,
body.theme-dark .cart-receipt-row strong,
body.theme-dark .cart-receipt-row small {
  color: #fff3e2;
}

body.theme-dark .cart-receipt-item-detail {
  color: rgba(255, 243, 226, 0.84);
}

body.theme-dark .cart-receipt-detail {
  color: rgba(255, 243, 226, 0.68);
}

body.theme-dark .cart-receipt-row-discount span,
body.theme-dark .cart-receipt-row-discount strong {
  color: #ffd3a5;
}

body.theme-dark .cart-receipt-summary {
  border-top-color: rgba(255, 250, 240, 0.24);
}

body.theme-dark .cart-receipt-row-total {
  background: linear-gradient(135deg, #4f8955, #9b6844);
}

body.theme-dark .cart-receipt-row-total span,
body.theme-dark .cart-receipt-row-total strong {
  color: #fffaf0;
}

body.theme-dark .gift-voucher-row,
body.theme-dark .checkout-consent {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 125, 50, 0.12), transparent 34%),
    rgba(20, 25, 18, 0.72);
}

body.theme-dark .code-check-row button {
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.24);
  background: linear-gradient(135deg, #5f7f42, #b46a31);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

body.theme-dark .code-check-row button:hover {
  color: #fffaf0;
  border-color: rgba(255, 250, 240, 0.32);
  background: linear-gradient(135deg, #6c9250, #cf7c35);
  transform: translateY(-1px);
}

body.theme-dark .code-check-row button:disabled {
  color: rgba(255, 250, 240, 0.5);
  background: rgba(255, 250, 240, 0.08);
  box-shadow: none;
}

body.theme-dark .checkout-consent,
body.theme-dark .checkout-consent span,
body.theme-dark .checkout-consent a {
  color: #fff3e2;
}

body.theme-dark .checkbox-line input[type="checkbox"] {
  border-color: rgba(255, 250, 240, 0.38);
  background: rgba(10, 14, 10, 0.44);
}

/* Gemeinsamer Admin-Feinschliff: Nicknames, Versand und Bestellungen */
.admin-list button,
.admin-panel button,
.order-shipping-form button,
#nicknameAdminPanel button {
  border: 1px solid rgba(63, 111, 69, 0.22);
  border-radius: 999px;
  padding: 9px 13px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  box-shadow: 0 10px 22px rgba(46, 35, 24, 0.12);
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.admin-list button:hover,
.admin-panel button:hover,
.order-shipping-form button:hover,
#nicknameAdminPanel button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(46, 35, 24, 0.18);
}

.admin-list button:disabled,
.admin-panel button:disabled,
.order-shipping-form button:disabled {
  cursor: not-allowed;
  color: rgba(43, 36, 31, 0.58);
  background: linear-gradient(135deg, rgba(111, 143, 85, 0.24), rgba(138, 86, 55, 0.18));
  box-shadow: none;
  transform: none;
}

#nicknameAdminPanel .admin-item,
#nicknameAdminPanel details.admin-list,
.order-shipping-form {
  border-color: rgba(63, 111, 69, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(255, 247, 232, 0.9));
}

#nicknameAdminPanel details.admin-list > summary {
  min-height: 42px;
  border-radius: 12px;
  padding: 8px 10px;
  color: #244b2b;
  background: rgba(63, 111, 69, 0.07);
}

body.theme-dark .admin-list button,
body.theme-dark .admin-panel button,
body.theme-dark .order-shipping-form button,
body.theme-dark #nicknameAdminPanel button {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #9b6844);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

body.theme-dark .admin-list button:disabled,
body.theme-dark .admin-panel button:disabled,
body.theme-dark .order-shipping-form button:disabled {
  color: rgba(255, 243, 226, 0.5);
  background: rgba(255, 250, 240, 0.08);
}

body.theme-dark #nicknameAdminPanel .admin-item,
body.theme-dark #nicknameAdminPanel details.admin-list,
body.theme-dark .order-shipping-form {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
  color: #fff3e2;
}

body.theme-dark #nicknameAdminPanel details.admin-list > summary {
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.08);
}

body.theme-dark #nicknameAdminStatus,
body.theme-dark #nicknameAdminPanel p,
body.theme-dark #nicknameAdminPanel strong {
  color: #fff3e2;
}

.isbn-entry {
  align-items: stretch;
  gap: 14px;
}

.isbn-receipt .isbn-entry {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px dashed rgba(63, 111, 69, 0.2);
}

.isbn-receipt .isbn-entry:last-child {
  border-bottom: 0;
}

.isbn-entry-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  margin-top: 0.6rem;
}

.isbn-entry-tools input {
  min-width: min(260px, 100%);
  flex: 1 1 220px;
  border-radius: 999px;
  border: 1px solid rgba(63, 111, 69, 0.18);
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.86);
  font-weight: 900;
}

.isbn-barcode-preview {
  flex-basis: 100%;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(63, 111, 69, 0.16);
  background: rgba(255, 250, 240, 0.72);
  padding: 12px;
}

.isbn-barcode-preview:empty {
  display: none;
}

.isbn-barcode-preview canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(46, 35, 24, 0.12);
}

body.theme-dark .isbn-entry-tools input {
  border-color: rgba(255, 250, 240, 0.22);
  color: #fff3e2;
  background: rgba(10, 14, 10, 0.58);
}

body.theme-dark .isbn-entry-tools input::placeholder {
  color: rgba(255, 243, 226, 0.68);
}

body.theme-dark .isbn-barcode-preview {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(12, 16, 12, 0.58);
}

body.theme-dark .icon-button {
  color: #fff3e2;
}

@media (max-width: 760px) {
  .wishlist-widget {
    top: calc(var(--header-height, 58px) + 8px);
    left: max(8px, env(safe-area-inset-left));
  }

  .wishlist-toggle {
    min-width: 46px;
    min-height: 42px;
    padding: 8px 10px;
  }

  .wishlist-widget-panel {
    width: min(330px, calc(100vw - 18px));
    max-height: min(520px, calc(100vh - 104px));
  }
}

body[data-page] .customer-support-widget {
  display: none !important;
}

body[data-page] .site-footer.game-footer a,
body[data-page] .site-footer.game-footer a:hover,
body.theme-dark[data-page] .site-footer.game-footer a,
body.theme-dark[data-page] .site-footer.game-footer a:hover {
  min-height: 0;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 6px 4px !important;
  color: inherit;
  background: transparent !important;
  box-shadow: none !important;
}

.game-scoreboard-widget,
.game-friends-widget {
  position: fixed;
  z-index: 195;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.customer-support-widget {
  z-index: 185;
}

.game-scoreboard-widget {
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  justify-items: end;
}

.game-friends-widget {
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  justify-items: start;
}

.game-scoreboard-widget .game-widget-panel,
.game-friends-widget .game-widget-panel {
  width: 100%;
}

.game-widget-toggle {
  pointer-events: auto;
  border: 1px solid rgba(255, 250, 240, 0.26);
  border-radius: 999px;
  padding: 10px 14px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  box-shadow: 0 16px 36px rgba(43, 36, 31, 0.22);
  cursor: pointer;
}

.game-widget-panel {
  pointer-events: auto;
  max-height: min(62vh, 440px);
  overflow: auto;
  margin-bottom: 8px;
  border: 1px solid rgba(63, 48, 37, 0.16);
  border-radius: 22px;
  padding: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(247, 238, 220, 0.94));
  box-shadow: 0 24px 58px rgba(43, 36, 31, 0.24);
}

.game-widget-panel h2,
.game-widget-panel h3,
.game-widget-panel p {
  margin: 0 0 8px;
}

.score-row,
.friend-row {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid rgba(63, 48, 37, 0.1);
  padding: 8px 0;
}

.score-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
}

.score-row strong,
.score-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row button {
  border: 0;
  border-radius: 999px;
  padding: 6px 9px;
  color: #fffaf0;
  background: linear-gradient(135deg, #9b4f3f, var(--clay));
  cursor: pointer;
}

.score-row.is-own {
  color: #244b2b;
}

.friend-row {
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
}

.friend-avatar,
.profile-photo-preview {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(63, 111, 69, 0.22);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(63, 111, 69, 0.16), rgba(138, 86, 55, 0.14)),
    rgba(255, 250, 240, 0.86);
}

.friend-avatar {
  width: 34px;
  height: 34px;
}

.friend-avatar::before,
.profile-photo-preview::before {
  content: "";
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: var(--leaf);
  transform: translateY(-12%);
}

.friend-avatar::after,
.profile-photo-preview::after {
  content: "";
  position: absolute;
  bottom: 16%;
  width: 58%;
  height: 28%;
  border-radius: 999px 999px 40% 40%;
  background: var(--leaf);
}

.friend-avatar.has-image,
.profile-photo-preview.has-image {
  background: var(--friend-avatar, var(--profile-photo)) center / cover no-repeat;
}

.friend-avatar.has-image::before,
.friend-avatar.has-image::after,
.profile-photo-preview.has-image::before,
.profile-photo-preview.has-image::after {
  display: none;
}

.profile-photo-settings {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(63, 111, 69, 0.16);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 250, 240, 0.46);
}

.profile-photo-preview {
  width: 84px;
  height: 84px;
}

.profile-file-label {
  gap: 8px;
}

.profile-file-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(63, 111, 69, 0.18);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 247, 232, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 18px rgba(46, 35, 24, 0.08);
}

.profile-file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.profile-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 9px 13px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--orange));
  box-shadow: 0 10px 22px rgba(63, 111, 69, 0.18);
  white-space: nowrap;
}

.profile-file-name {
  min-width: 0;
  overflow: hidden;
  color: rgba(43, 36, 31, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-file-picker:focus-within {
  outline: 3px solid rgba(215, 125, 50, 0.24);
  outline-offset: 3px;
}

.friend-row button,
.compact-form button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
  cursor: pointer;
}

.compact-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.game-nickname-modal {
  max-width: 460px;
}

body.theme-dark .game-widget-panel {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark .game-widget-panel h2,
body.theme-dark .game-widget-panel h3,
body.theme-dark .game-widget-panel p,
body.theme-dark .game-widget-panel span,
body.theme-dark .game-widget-panel strong {
  color: #fff3e2;
}

@media (max-width: 700px) {
  .game-scoreboard-widget,
  .game-friends-widget {
    width: min(330px, calc(100vw - 18px));
  }

  .game-friends-widget {
    bottom: 64px;
  }
}

.tidy-preview,
.balloon-preview {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 250, 240, 0.36), transparent 24%),
    linear-gradient(145deg, rgba(63, 111, 69, 0.86), rgba(215, 125, 50, 0.72));
}

.tidy-preview-item,
.tidy-preview-box,
.balloon-preview-pump,
.balloon-preview-shape {
  position: absolute;
  display: block;
  box-shadow: 0 14px 28px rgba(43, 36, 31, 0.2);
}

.tidy-preview-item {
  width: 58px;
  height: 58px;
  border: 5px solid rgba(255, 250, 240, 0.7);
  border-radius: 18px;
  background: #f0c08d;
}

.tidy-preview-item.one {
  left: 12%;
  top: 26%;
  transform: rotate(-13deg);
}

.tidy-preview-item.two {
  left: 42%;
  top: 17%;
  border-radius: 50%;
  background: #b8d19a;
}

.tidy-preview-item.three {
  right: 13%;
  top: 33%;
  transform: rotate(12deg);
  background: #f6e0ba;
}

.tidy-preview-box {
  left: 18%;
  right: 18%;
  bottom: 18px;
  height: 70px;
  border: 5px solid rgba(255, 250, 240, 0.72);
  border-radius: 18px;
  background: rgba(138, 86, 55, 0.72);
}

.tidy-board {
  position: relative;
  min-height: min(52vh, 430px);
  overflow: hidden;
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 24%, rgba(215, 125, 50, 0.12), transparent 22%),
    radial-gradient(circle at 78% 18%, rgba(63, 111, 69, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.9), rgba(243, 230, 208, 0.72));
  box-shadow: var(--shadow);
  touch-action: none;
}

.tidy-item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  width: clamp(88px, 22vw, 132px);
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 2px solid rgba(255, 250, 240, 0.78);
  border-radius: 24px;
  padding: 8px;
  color: #fffaf0;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 250, 240, 0.5), transparent 24%),
    linear-gradient(145deg, var(--item-color), #8a5637);
  box-shadow: 0 16px 30px rgba(43, 36, 31, 0.22);
  cursor: grab;
  user-select: none;
  transform: translate(-50%, -50%) rotate(var(--tilt, -2deg));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tidy-item:nth-child(2n) {
  --tilt: 4deg;
}

.tidy-item span:last-child:not(.sr-only) {
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.tidy-item.is-dragging {
  position: fixed;
  z-index: 260;
  pointer-events: none;
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 22px 46px rgba(43, 36, 31, 0.3);
}

.tidy-item.is-sorted {
  position: static;
  width: 100%;
  min-height: 58px;
  transform: none;
  box-shadow: none;
  cursor: default;
}

.tidy-block-icon,
.tidy-book-icon,
.tidy-sock-icon,
.tidy-car-icon,
.tidy-bear-icon {
  width: 42px;
  height: 42px;
  display: block;
  background: rgba(255, 250, 240, 0.86);
}

.tidy-block-icon {
  border-radius: 10px;
  box-shadow: inset 0 0 0 8px var(--item-color);
}

.tidy-book-icon {
  border-radius: 6px 12px 12px 6px;
  box-shadow: inset 9px 0 0 var(--item-color), inset 0 -6px 0 rgba(138, 86, 55, 0.24);
}

.tidy-sock-icon {
  width: 48px;
  border-radius: 18px 18px 26px 10px;
  transform: rotate(-12deg);
  box-shadow: inset 0 -14px 0 var(--item-color);
}

.tidy-car-icon {
  height: 32px;
  border-radius: 20px 20px 10px 10px;
  box-shadow: inset 0 -12px 0 var(--item-color), 10px 27px 0 -7px #2b241f, 31px 27px 0 -7px #2b241f;
}

.tidy-bear-icon {
  border-radius: 50%;
  box-shadow: -15px -7px 0 -9px var(--item-color), 15px -7px 0 -9px var(--item-color), inset 0 -12px 0 var(--item-color);
}

.tidy-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tidy-box {
  min-height: 138px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 2px dashed rgba(63, 111, 69, 0.34);
  border-radius: 24px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.86), rgba(243, 230, 208, 0.72));
}

.tidy-box strong {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(63, 111, 69, 0.18), rgba(215, 125, 50, 0.14));
  color: #244b2b;
  font-family: Arial, sans-serif;
  font-size: 26px;
}

.tidy-box-count {
  justify-self: start;
  min-width: 34px;
  text-align: center;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--leaf), var(--clay));
}

.balloon-preview-pump {
  left: 13%;
  bottom: 22px;
  width: 80px;
  height: 88px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(135deg, #fffaf0, #b8d19a);
}

.balloon-preview-shape {
  right: 18%;
  top: 28px;
  width: 92px;
  height: 118px;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 30% 23%, rgba(255, 250, 240, 0.76), transparent 16%),
    linear-gradient(145deg, #d77d32, #8a5637);
}

.balloon-stage {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.balloon-sky {
  position: relative;
  width: min(760px, 100%);
  min-height: min(62vh, 560px);
  overflow: hidden;
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 250, 240, 0.58), transparent 18%),
    radial-gradient(circle at 80% 22%, rgba(255, 250, 240, 0.42), transparent 16%),
    linear-gradient(180deg, rgba(183, 218, 219, 0.78), rgba(255, 250, 240, 0.74) 70%, rgba(111, 143, 85, 0.26));
  box-shadow: var(--shadow);
}

.balloon-shape {
  position: absolute;
  left: calc(50% - 55px);
  bottom: 214px;
  width: 110px;
  height: 138px;
  border-radius: 54% 54% 48% 48%;
  background:
    radial-gradient(circle at 30% 22%, var(--balloon-shine, #ffd3a0), transparent 17%),
    linear-gradient(145deg, var(--balloon-color, #d77d32), #8a5637);
  box-shadow: inset -14px -18px 24px rgba(43, 36, 31, 0.16), 0 20px 44px rgba(43, 36, 31, 0.18);
  transform-origin: center bottom;
}

.balloon-shape::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 98px;
  background: rgba(43, 36, 31, 0.44);
  transform: translateX(-50%);
}

.balloon-knot {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 24px;
  height: 18px;
  border-radius: 50% 50% 10px 10px;
  background: var(--balloon-color, #d77d32);
  transform: translateX(-50%);
}

.balloon-shape.is-popped {
  opacity: 0;
  transform: scale(0.2) !important;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.balloon-shape.is-waiting-next {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.balloon-flyer {
  z-index: 4;
  pointer-events: none;
  animation: balloonFlyAway var(--fly-duration, 4s) cubic-bezier(0.22, 0.68, 0.2, 1) forwards;
}

@keyframes balloonFlyAway {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(var(--fly-scale, 1));
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0.92;
    transform: translate(var(--fly-drift, 0), -760px) scale(calc(var(--fly-scale, 1) * 0.94));
  }
}

.balloon-confetti {
  position: absolute;
  left: 50%;
  bottom: 314px;
  z-index: 3;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.balloon-confetti span {
  position: absolute;
  width: 10px;
  height: 20px;
  border-radius: 5px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 250, 240, 0.85), transparent 22%),
    linear-gradient(135deg, var(--balloon-color, var(--orange)), var(--leaf));
  animation: balloonShard 1.05s cubic-bezier(0.18, 0.74, 0.22, 1) forwards;
  transform: rotate(var(--a)) translateY(0);
}

@keyframes balloonShard {
  42% {
    opacity: 1;
    transform: rotate(calc(var(--a) + var(--r, 90deg))) translateY(calc(-0.55 * var(--d))) translateX(calc(0.7 * var(--d)));
  }
  to {
    opacity: 0;
    transform: rotate(calc(var(--a) + var(--r, 90deg))) translateY(calc(-1 * var(--d))) translateX(var(--d)) scale(0.72);
  }
}

.pump-button {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: min(250px, 78vw);
  min-height: 118px;
  border: 0;
  border-radius: 26px;
  padding: 58px 14px 14px;
  color: #fffaf0;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 250, 240, 0.52), transparent 18%),
    linear-gradient(145deg, #4f8955, #9b6844);
  box-shadow: 0 20px 48px rgba(43, 36, 31, 0.24);
  cursor: pointer;
  touch-action: none;
  transform: translateX(-50%);
}

.pump-button.is-active {
  transform: translateX(-50%) translateY(3px) scale(0.99);
}

.pump-top,
.pump-body,
.pump-hose {
  position: absolute;
  display: block;
}

.pump-top {
  left: 50%;
  top: 9px;
  width: 106px;
  height: 14px;
  border-radius: 999px;
  background: #fffaf0;
  transform: translateX(-50%);
}

.pump-body {
  left: 50%;
  top: 27px;
  width: 70px;
  height: 48px;
  border-radius: 17px 17px 10px 10px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 250, 240, 0.85), transparent 18%),
    linear-gradient(180deg, #fffaf0, #e7bd58 58%, #9b6844);
  box-shadow: inset -8px -10px 16px rgba(43, 36, 31, 0.18);
  transform: translateX(-50%);
}

.pump-hose {
  left: 50%;
  top: -92px;
  width: 8px;
  height: 122px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.72), rgba(43, 36, 31, 0.5));
  box-shadow: 0 0 0 4px rgba(63, 111, 69, 0.16);
  transform: translateX(-50%);
}

.pump-hose::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 -18px 0 -6px rgba(255, 250, 240, 0.56), 0 -38px 0 -8px rgba(255, 250, 240, 0.38), 8px -58px 0 -8px rgba(255, 250, 240, 0.32);
  transform: translateX(-50%);
}

.pump-hose::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.78);
  opacity: 0;
  transform: translateX(-50%);
}

.pump-button.is-active .pump-hose::after {
  animation: airBubble 0.7s linear infinite;
}

@keyframes airBubble {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.65);
  }
  20% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-118px) scale(1.18);
  }
}

body.theme-dark .tidy-board,
body.theme-dark .tidy-box,
body.theme-dark .balloon-sky {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark .tidy-box strong {
  color: #fff3e2;
}

.game-footer a,
body.theme-dark .game-footer a {
  border: 0;
  border-radius: 0;
  padding: 6px 4px;
  color: inherit;
  background: transparent;
  box-shadow: none;
}

.game-footer a:hover,
body.theme-dark .game-footer a:hover {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 700px) {
  .tidy-board {
    min-height: 430px;
  }

  .tidy-item {
    width: 108px;
    min-height: 76px;
  }

  .tidy-boxes {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tidy-box {
    min-height: 118px;
    padding: 9px;
  }

  .balloon-sky {
    min-height: 510px;
  }

  .pump-button {
    min-height: 108px;
    padding-top: 54px;
  }
}

body.theme-dark .cookie-consent-actions button,
body.theme-dark .consent-actions button,
body.theme-dark .game-header nav a,
body.theme-dark .game-footer a,
body.theme-dark .win-actions a,
body.theme-dark .icon-control {
  border-color: rgba(255, 250, 240, 0.2);
  color: #fff3e2;
  background: rgba(255, 250, 240, 0.1);
}

body.theme-dark .cookie-consent-actions #acceptCookies,
body.theme-dark .consent-actions button:last-child,
body.theme-dark .difficulty-control button.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, #4f8955, #c77c3a);
}

.game-stat-card {
  border: 1px solid rgba(63, 111, 69, 0.2);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: var(--shadow);
}

.game-stat-card h2,
.game-stat-card p {
  margin: 0 0 7px;
}

body.theme-dark .game-stat-card {
  border-color: rgba(255, 250, 240, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 111, 69, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(35, 40, 30, 0.98), rgba(44, 43, 32, 0.94));
}

body.theme-dark .game-stat-card h2,
body.theme-dark .game-stat-card p {
  color: #fff3e2;
}

/* Firebase asset management */
.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
}

.asset-thumb {
  width: 74px;
  height: 54px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(63, 111, 69, 0.28);
  background: rgba(255, 250, 240, 0.58);
}

body.theme-dark .asset-thumb {
  border-color: rgba(255, 248, 235, 0.22);
  background: rgba(255, 248, 235, 0.08);
}

@media (max-width: 680px) {
  .asset-row {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .asset-thumb {
    width: 100%;
    height: 140px;
  }
}
