/* ==========================================================================
   CastleForever - consolidated styles
   Loaded once from base/layout.html and core/dashboard_layout.html.

   Tailwind handles layout/utilities. This file owns the small set of custom
   components and the dark theme. Keep page-specific CSS out of templates.
   ========================================================================== */

/* Design tokens ---------------------------------------------------------- */
:root {
  --cf-cream: #f8f6f0;
  --cf-forest: #243b32;
  --cf-gold: #a58a5a;
  --cf-line: #c9bda6;

  /* Tailwind's `ink` color is driven by these channels so that every
     text-ink / text-ink/NN utility flips to a legible light tone in dark mode. */
  --cf-ink: 34 40 34;

  /* Dark theme: only Tailwind stone-700 through stone-900. */
  --cf-stone-bg: #292524;        /* stone-800 - page gradient midpoint */
  --cf-stone-bg-alt: #44403c;    /* stone-700 - alternating sections */
  --cf-stone-surface: #1c1917;   /* stone-900 - cards */
  --cf-stone-surface-alt: #44403c; /* stone-700 - hover surfaces */
  --cf-stone-border: #44403c;    /* stone-700 */
  --cf-stone-text: #f5f5f4;      /* stone-100 */
  --cf-stone-subtle: #e7e5e4;    /* stone-200 */
  --cf-stone-muted: #d6d3d1;     /* stone-300 */
}

html.dark {
  --cf-ink: 245 245 244;
}

/* Base ------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #f8f6f0 0%, #f2eee4 50%, #e8e2d5 100%);
  background-attachment: fixed;
  color: rgb(var(--cf-ink));
}

/* Shared components ------------------------------------------------------ */
/* The hero image is a real <img> in home.html so it can be preloaded and
   prioritised. The old CSS background could silently fetch a 5 MB JPEG. */
.hero {
  background-color: #101b17;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media.image-skeleton {
  background-color: #101b17;
  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 80%
  );
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(16, 27, 23, 0.72), rgba(16, 27, 23, 0.18));
}

/* Image loading shimmer --------------------------------------------------- */
/* Wrappers opt in with `image-skeleton`. app.js adds `is-loaded` once the
   image is ready. `js` on <html> means no-JS visitors always see the image. */
.image-skeleton {
  position: relative;
  background-color: #e8e2d5;
  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  background-position: 200% 0;
  background-size: 200% 100%;
  animation: cf-shimmer 1.5s ease-in-out infinite;
}

.js .image-skeleton > img,
.js img.image-skeleton {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.js .image-skeleton.is-loaded > img,
.js img.image-skeleton.is-loaded {
  opacity: 1;
}

.image-skeleton.is-loaded {
  animation: none;
  background-color: transparent;
  background-image: none;
}

@keyframes cf-shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-skeleton {
    animation: none;
  }
}

.photo {
  transition: transform 0.7s ease;
}

.photo-wrap {
  overflow: hidden;
}

.photo-wrap:hover .photo {
  transform: scale(1.055);
}

.line {
  height: 1px;
  background: var(--cf-line);
}

.eyebrow {
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

input,
select,
textarea {
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cf-gold);
}

/* Dashboard -------------------------------------------------------------- */
input[type="checkbox"] {
  appearance: none;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background: var(--cf-forest);
}

input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.2s ease;
}

input[type="checkbox"]:checked::before {
  left: 23px;
}

.dashboard-table th {
  background: var(--cf-forest);
  color: white;
}

.dashboard-table td,
.dashboard-table th {
  padding: 12px 16px;
}

.dashboard-table tr:nth-child(even) {
  background: var(--cf-cream);
}

.dashboard-format-select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--cf-forest);
  border-radius: 0;
  background: transparent;
  color: var(--cf-forest);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html.dark .dashboard-format-select {
  border-color: var(--cf-gold);
  background: var(--cf-stone-surface);
  color: var(--cf-stone-text);
}

.dashboard-search-input {
  padding-left: 36px !important;
}

#dashboardResults {
  position: relative;
  transition: opacity 0.15s ease;
}

#dashboardResults.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

#dashboardResults.is-loading::after {
  content: "";
  position: absolute;
  top: 32px;
  left: 50%;
  z-index: 2;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border: 2px solid rgba(36, 59, 50, 0.2);
  border-top-color: var(--cf-forest);
  border-radius: 50%;
  animation: dashboard-results-spin 0.7s linear infinite;
}

html.dark #dashboardResults.is-loading::after {
  border-color: rgba(165, 138, 90, 0.25);
  border-top-color: var(--cf-gold);
}

@keyframes dashboard-results-spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid var(--cf-forest);
  color: var(--cf-forest);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dashboard-outline-button:hover {
  background: var(--cf-forest);
  color: #ffffff;
}

html.dark .dashboard-outline-button {
  border-color: var(--cf-gold);
  color: var(--cf-stone-text);
}

html.dark .dashboard-outline-button:hover {
  background: var(--cf-gold);
  border-color: var(--cf-gold);
  color: var(--cf-stone-surface);
}

.bulk-action-selection input[type="checkbox"] {
  accent-color: var(--cf-forest);
}

html.dark .bulk-action-selection input[type="checkbox"] {
  accent-color: var(--cf-gold);
}

.bulk-action-selection {
  min-width: 0;
}

.bulk-action-select {
  flex: 0 1 260px;
  min-width: 180px;
}

.bulk-action-select .select2-container {
  width: 100% !important;
}

#bulkActionApply {
  flex-shrink: 0;
}

#bulkActionApply.btn-primary {
  border-color: var(--cf-forest);
  background: var(--cf-forest);
  color: #ffffff;
}

#bulkActionApply.btn-primary:hover {
  border-color: var(--cf-gold);
  background: var(--cf-gold);
  color: var(--cf-stone-surface);
  transform: none;
}

html.dark #bulkActionApply.btn-primary {
  border-color: var(--cf-gold);
  background: var(--cf-gold);
  color: var(--cf-stone-surface);
}

#bulkActionApply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.dashboard-pagination {
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(36, 59, 50, 0.12);
  background: var(--cf-cream);
}

html.dark .dashboard-pagination {
  border-color: rgba(165, 138, 90, 0.3);
  background: var(--cf-stone-surface);
}

.dashboard-pagination-count {
  font-weight: 700;
}

.dashboard-pagination-link {
  display: inline-flex;
  min-width: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid rgba(36, 59, 50, 0.25);
  color: var(--cf-forest);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-pagination-link.is-active {
  border-color: var(--cf-forest);
  background: var(--cf-forest);
  color: #ffffff;
}

.dashboard-pagination-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

html.dark .dashboard-pagination-link {
  border-color: rgba(165, 138, 90, 0.45);
  color: var(--cf-stone-text);
}

html.dark .dashboard-pagination-link.is-active {
  border-color: var(--cf-gold);
  background: var(--cf-gold);
  color: var(--cf-stone-surface);
}

.dashboard-row-primary,
.dashboard-row-more {
  display: inline-flex;
  height: 34px;
  width: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dashboard-row-primary {
  border: 1px solid var(--cf-forest);
  background: var(--cf-forest);
  color: #ffffff;
}

.dashboard-row-primary:hover {
  background: #1b2f27;
  transform: translateY(-1px);
}

.dashboard-row-more {
  border: 1px solid #d1d5db;
  background: transparent;
  color: #6b7280;
}

.dashboard-row-more:hover {
  background: #f3f4f6;
  color: var(--cf-forest);
}

html.dark .dashboard-row-more {
  border-color: var(--cf-stone-border);
  color: var(--cf-stone-muted);
}

html.dark .dashboard-row-more:hover {
  background: var(--cf-stone-surface-alt);
  color: var(--cf-stone-text);
}

.dashboard-row-action-menu {
  position: relative;
}

.row-actions-popover {
  min-width: 150px;
}

.row-actions-popover .ui-popover-link.danger,
.row-actions-popover .ui-popover-link.danger i {
  color: #a13f36;
}

.active_page {
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

/* Dashboard sidebar ------------------------------------------------------ */
.dashboard-sidebar {
  width: 16rem;
  transition: width 0.2s ease, transform 0.2s ease;
}

.dashboard-sidebar.sidebar-collapsed {
  width: 5rem;
}

.sidebar-logo-icon {
  display: none;
}

.sidebar-link i {
  flex-shrink: 0;
}

.dashboard-sidebar.sidebar-collapsed .sidebar-brand,
.dashboard-sidebar.sidebar-collapsed .sidebar-link,
.dashboard-sidebar.sidebar-collapsed .sidebar-collapse {
  justify-content: center;
}

.dashboard-sidebar.sidebar-collapsed .sidebar-logo-full,
.dashboard-sidebar.sidebar-collapsed .sidebar-label {
  display: none;
}

.dashboard-sidebar.sidebar-collapsed .sidebar-logo-icon {
  display: block;
}

.dashboard-sidebar.sidebar-collapsed .sidebar-link {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Dashboard title-bar tools ---------------------------------------------- */
.dashboard-titlebar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}

html.dark .dashboard-titlebar {
  background: var(--cf-stone-surface);
  border-bottom-color: var(--cf-stone-border);
  color: var(--cf-stone-text);
}

.display-tools,
.ui-popover {
  --tool-border: #e5e7eb;
  --tool-surface: #ffffff;
  --tool-text: #1f2937;
  --tool-muted: #6b7280;
  --tool-hover: rgba(36, 59, 50, 0.08);
  --tool-active: var(--cf-forest);
}

html.dark .display-tools,
html.dark .ui-popover {
  --tool-border: var(--cf-stone-border);
  --tool-surface: var(--cf-stone-surface);
  --tool-text: var(--cf-stone-text);
  --tool-muted: var(--cf-stone-muted);
  --tool-hover: rgba(255, 255, 255, 0.08);
  --tool-active: var(--cf-gold);
}

.display-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--tool-border);
  border-radius: 999px;
  background: rgba(36, 59, 50, 0.04);
}

html.dark .display-tools {
  background: rgba(255, 255, 255, 0.05);
}

.display-tool {
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tool-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.display-tool:hover {
  background: var(--tool-hover);
  color: var(--tool-text);
}

.display-tool:focus-visible,
.dashboard-account-toggle:focus-visible,
.dashboard-icon-button:focus-visible {
  outline: 2px solid var(--cf-gold);
  outline-offset: 2px;
}

.display-tool--lang {
  padding: 0 11px;
}

.lang-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.lang-chevron {
  font-size: 9px;
  opacity: 0.65;
  transition: transform 0.18s ease;
}

.display-tool--lang[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.display-tool.is-active {
  background: var(--tool-active);
  color: #ffffff;
}

html.dark .display-tool.is-active {
  color: var(--cf-stone-surface);
}

.display-tools-divider {
  width: 1px;
  height: 18px;
  flex: none;
  background: var(--tool-border);
}

.lang-picker {
  position: relative;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 11px);
  z-index: 60;
  min-width: 172px;
  padding: 8px;
  background: var(--tool-surface);
  border: 1px solid var(--tool-border);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  color: var(--tool-text);
}

.lang-menu::before {
  content: "";
  position: absolute;
  right: 20px;
  top: -5px;
  width: 9px;
  height: 9px;
  background: var(--tool-surface);
  border-left: 1px solid var(--tool-border);
  border-top: 1px solid var(--tool-border);
  transform: rotate(45deg);
}

.lang-menu[hidden],
.ui-popover[hidden] {
  display: none;
}

.lang-form {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}

.lang-menu .display-tool {
  width: 100%;
  height: 36px;
  justify-content: flex-start;
  gap: 10px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--tool-text);
}

.lang-menu .display-tool.is-active:hover {
  background: var(--tool-active);
  color: #ffffff;
}

html.dark .lang-menu .display-tool.is-active:hover {
  color: var(--cf-stone-surface);
}

.lang-check {
  width: 14px;
  flex: none;
  text-align: center;
  font-size: 11px;
}

.theme-toggle {
  width: 30px;
  padding: 0;
  font-size: 13px;
}

.theme-icon-moon {
  display: none;
}

html.dark .theme-icon-sun,
html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html.dark .theme-icon-moon,
html[data-theme="dark"] .theme-icon-moon {
  display: inline;
}

.dashboard-icon-button {
  height: 36px;
  width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--tool-border);
  background: transparent;
  color: var(--tool-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.dashboard-icon-button:hover {
  background: var(--tool-hover);
  color: var(--tool-text);
}

.dashboard-notifications {
  position: relative;
}

.dashboard-icon-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #a13f36;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.dashboard-notifications-popover {
  min-width: 300px;
  max-width: 340px;
  padding: 0;
  overflow: hidden;
}

.notification-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--tool-border);
  font-size: 12px;
}

.notification-popover-head span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--tool-active);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

html.dark .notification-popover-head span {
  color: var(--cf-stone-surface);
}

.notification-popover-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.dashboard-notifications-popover .ui-popover-link {
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
}

.notification-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-copy strong {
  font-size: 12px;
  line-height: 1.3;
}

.notification-copy small {
  overflow: hidden;
  color: var(--tool-muted);
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-arrow {
  margin-left: auto;
  font-size: 9px;
  opacity: 0.5;
}

.notification-empty {
  margin: 0;
  padding: 18px 14px;
  color: var(--tool-muted);
  font-size: 12px;
  text-align: center;
}

.notification-mark-all-form {
  margin: 0;
  border-top: 1px solid var(--tool-border);
}

.dashboard-notifications-popover .notification-mark-all {
  justify-content: center;
  padding: 11px 14px;
  border-radius: 0;
  color: var(--cf-gold);
}

.dashboard-account {
  position: relative;
}

.dashboard-account-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px 0 4px;
  border: 1px solid var(--tool-border);
  border-radius: 999px;
  background: transparent;
  color: var(--tool-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.dashboard-account-toggle:hover {
  background: var(--tool-hover);
}

.dashboard-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--cf-gold);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

html.dark .dashboard-avatar {
  background: #d5c19b;
  color: #1c1917;
}

.dashboard-account-name {
  display: grid;
  line-height: 1.15;
  max-width: 150px;
  text-align: left;
}

.dashboard-account-name strong,
.dashboard-account-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-account-name strong {
  font-size: 12px;
}

.dashboard-account-name small {
  color: var(--tool-muted);
  font-size: 10px;
  font-weight: 400;
}

.ui-popover {
  position: fixed;
  z-index: 80;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--tool-border);
  border-radius: 10px;
  background: var(--tool-surface);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  color: var(--tool-text);
}

.ui-popover-link,
.ui-popover-form button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--tool-text);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ui-popover-link:hover,
.ui-popover-form button:hover {
  background: var(--tool-hover);
}

.ui-popover-link i,
.ui-popover-form button i {
  width: 16px;
  flex: none;
  text-align: center;
  color: var(--tool-muted);
}

.ui-popover-form {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--tool-border);
}

.ui-popover-form button.danger,
.ui-popover-form button.danger i {
  color: #a13f36;
}

/* Statistics dashboard --------------------------------------------------- */
.summary-card,
.chart-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover,
.chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(36, 59, 50, 0.08);
}

.summary-icon,
.chart-icon {
  flex-shrink: 0;
}

.chart-grid {
  display: grid;
  gap: 1.5rem;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-empty {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chart-empty[hidden] {
  display: none;
}

.statistics-tab {
  color: rgb(var(--cf-ink) / 0.65);
  background-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.statistics-tab:hover {
  color: var(--cf-forest);
  background-color: rgba(36, 59, 50, 0.06);
}

.statistics-tab[aria-selected="true"] {
  color: #ffffff;
  background-color: var(--cf-forest);
  border-color: var(--cf-forest);
}

.statistics-tab:focus-visible {
  outline: 2px solid var(--cf-gold);
  outline-offset: 2px;
}

.statistics-panel[hidden] {
  display: none;
}

@media (min-width: 1024px) {
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dark theme ------------------------------------------------------------- */
html.dark body {
  background: linear-gradient(135deg, #1c1917 0%, #292524 50%, #44403c 100%) !important;
  background-attachment: fixed !important;
  color: var(--cf-stone-text) !important;
}

/* Surfaces */
html.dark .bg-white {
  background-color: var(--cf-stone-surface) !important;
}

html.dark .bg-\[\#F0EDE5\],
html.dark .bg-\[\#f0ece3\],
html.dark .bg-\[\#E8E2D5\] {
  background-color: var(--cf-stone-bg-alt) !important;
}

/* Hairline gaps read as stone-900 separators between stone-700 cells. */
html.dark .bg-\[\#d8d1c2\] {
  background-color: var(--cf-stone-surface) !important;
}

html.dark .dashboard-table tr:nth-child(even) {
  background: var(--cf-stone-bg-alt);
}

html.dark input[type="checkbox"] {
  background: var(--cf-stone-border);
}

html.dark input[type="checkbox"]:checked {
  background: #78716c; /* stone-500 */
}

/* Borders */
html.dark .border-\[\#e8e2d5\],
html.dark .border-\[\#e8e4d9\],
html.dark .border-gray-200,
html.dark .border-forest\/20,
html.dark .border-ink\/10,
html.dark .border-ink\/15 {
  border-color: var(--cf-stone-border) !important;
}

html.dark .border-forest {
  border-color: var(--cf-stone-border) !important;
}

html.dark .statistics-tab {
  color: var(--cf-stone-muted);
}

html.dark .statistics-tab:hover {
  color: var(--cf-stone-text);
  background-color: rgba(255, 255, 255, 0.06);
}

html.dark .statistics-tab[aria-selected="true"] {
  color: var(--cf-stone-text);
  background-color: var(--cf-stone-surface-alt);
  border-color: var(--cf-stone-border);
}

/* Text: keep the muted steps well above a 7:1 contrast ratio on stone. */
html.dark .text-\[\#222\],
html.dark .text-\[\#1f2937\] {
  color: var(--cf-stone-text) !important;
}

html.dark .text-ink\/40,
html.dark .text-ink\/45,
html.dark .text-ink\/50,
html.dark .text-ink\/55,
html.dark .text-gray-500,
html.dark .text-gray-600 {
  color: var(--cf-stone-muted) !important;
}

html.dark .text-ink\/60,
html.dark .text-ink\/70,
html.dark .text-ink\/75,
html.dark .text-ink\/80 {
  color: var(--cf-stone-subtle) !important;
}

/* Tiny gold labels would disappear on stone, so use a neutral light tone. */
html.dark .text-gold,
html.dark .text-\[\#A58A5A\],
html.dark .text-\[\#b18c43\],
html.dark .text-\[\#bb9653\] {
  color: var(--cf-stone-subtle) !important;
}

/* Dropdown/overlay hovers must not flash a light background behind light text. */
html.dark .hover\:bg-\[\#f8f6f0\]:hover {
  background-color: var(--cf-stone-surface-alt) !important;
}

/* The primary gold call-to-action keeps dark text in both themes. */
html.dark .bg-\[\#d5c19b\],
html.dark .bg-\[\#dccba7\] {
  color: var(--cf-forest);
}
