/*
  RYBY 19.0.9.3 — MASTER DARK COHESION
  One consolidated visual layer for the entire public service. Route-audit fix.
  Typography is intentionally untouched: the approved base fonts, sizes,
  weights, spacing and line-height remain authoritative.
*/

html[data-ryby-master="19.0.9.3"] {
  --ry-master-bg: #071710;
  --ry-master-bg-2: #0b2118;
  --ry-master-bg-3: #122d22;
  --ry-master-panel: #11281e;
  --ry-master-panel-2: #19362a;
  --ry-master-panel-soft: #203b30;
  --ry-master-gold: #c7a451;
  --ry-master-gold-soft: #ead791;
  --ry-master-text: #f0eadf;
  --ry-master-text-soft: rgba(240, 234, 223, .66);
  --ry-master-text-muted: rgba(240, 234, 223, .46);
  --ry-master-line: rgba(226, 202, 132, .16);
  --ry-master-line-soft: rgba(255, 255, 255, .055);
  --ry-master-shadow: 0 20px 50px rgba(0, 0, 0, .24);
  --ry-master-section:
    radial-gradient(circle at 10% 8%, rgba(150, 163, 92, .075), transparent 28%),
    radial-gradient(circle at 90% 86%, rgba(191, 155, 73, .06), transparent 30%),
    linear-gradient(180deg, #10261c 0%, #081a12 100%);
  --ry-master-card:
    radial-gradient(circle at 100% 0, rgba(170, 183, 101, .075), transparent 35%),
    linear-gradient(150deg, rgba(27, 52, 40, .985), rgba(9, 25, 18, .995));
  --ry-master-card-muted:
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .025), transparent 28%),
    linear-gradient(150deg, rgba(32, 50, 40, .97), rgba(15, 28, 21, .985));
}

/* Global canvas */
html[data-ryby-master="19.0.9.3"],
html[data-ryby-master="19.0.9.3"] body {
  background:
    radial-gradient(circle at 12% 0, rgba(152, 168, 94, .045), transparent 24%),
    linear-gradient(180deg, var(--ry-master-bg), var(--ry-master-bg-2)) !important;
  color: var(--ry-master-text);
}

/*
 * All principal sections use one dark surface.
 * The hero is excluded so its photographic composition remains intact.
 */
html[data-ryby-master="19.0.9.3"]
:is(
  .catches,
  .conditions-center,
  .trophy-gallery,
  .analytics,
  .intelligence,
  .fisheries,
  .expeditions,
  .ry17-more,
  .detail-data,
  .session-ledger,
  .tactics-register,
  .events-ledger,
  .chronicle,
  .conditions-archive,
  .hall-of-fame,
  .laboratory,
  .season-book,
  .weather-center,
  .field-command,
  .page-section
) {
  color: var(--ry-master-text) !important;
  background: var(--ry-master-section) !important;
  border-top-color: rgba(226, 202, 132, .08) !important;
  border-bottom-color: rgba(226, 202, 132, .08) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .018),
    inset 0 -1px 0 rgba(0, 0, 0, .18) !important;
}

/* Covers additional page sections without touching the photographic hero */
html[data-ryby-master="19.0.9.3"] main > section:not(.hero):not(.hero-section),
html[data-ryby-master="19.0.9.3"] .site-main > section:not(.hero):not(.hero-section),
html[data-ryby-master="19.0.9.3"] .page-main > section:not(.hero):not(.hero-section) {
  color: var(--ry-master-text) !important;
  background: var(--ry-master-section) !important;
}

/* Typography: colors only — no font-family, size, weight or spacing overrides */
html[data-ryby-master="19.0.9.3"]
:is(
  .catches,
  .conditions-center,
  .trophy-gallery,
  .analytics,
  .intelligence,
  .fisheries,
  .expeditions,
  .ry17-more,
  .detail-data,
  .session-ledger,
  .tactics-register,
  .events-ledger,
  .chronicle,
  .conditions-archive,
  .hall-of-fame,
  .laboratory,
  .season-book,
  .weather-center,
  .field-command,
  .page-section
)
:is(h1, h2, h3, h4, h5, h6, strong) {
  color: var(--ry-master-text) !important;
  text-shadow: none !important;
}

html[data-ryby-master="19.0.9.3"]
:is(
  .catches,
  .conditions-center,
  .trophy-gallery,
  .analytics,
  .intelligence,
  .fisheries,
  .expeditions,
  .ry17-more,
  .detail-data,
  .session-ledger,
  .tactics-register,
  .events-ledger,
  .chronicle,
  .conditions-archive,
  .hall-of-fame,
  .laboratory,
  .season-book,
  .weather-center,
  .field-command,
  .page-section
)
:is(p, small, .muted, .description, .subtitle) {
  color: var(--ry-master-text-soft) !important;
}

html[data-ryby-master="19.0.9.3"] :is(.eyebrow, .kicker, .label, .section-label) {
  color: var(--ry-master-gold-soft) !important;
}

/* Unified panels and cards */
html[data-ryby-master="19.0.9.3"]
:is(
  .season-explorer,
  .session-truth,
  .gallery-toolbar,
  .gallery-empty,
  .intelligence-command,
  .fishery-atlas-summary,
  .fishery-atlas-tabs,
  .fishery-atlas-focus,
  .fishery-atlas-list,
  .ry1903-detail-summary,
  .archive-panel,
  .explorer-panel,
  .truth-panel,
  .dashboard-panel,
  .summary-panel,
  .overview-panel,
  .content-panel,
  .data-panel,
  .module-panel,
  .glass-panel
) {
  color: var(--ry-master-text) !important;
  border: 1px solid var(--ry-master-line) !important;
  border-radius: 18px !important;
  background: var(--ry-master-card) !important;
  box-shadow:
    var(--ry-master-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .024) !important;
}

/* Generic card families used by modules and subpages */
html[data-ryby-master="19.0.9.3"]
:is(
  .analytics-grid,
  .intelligence-matrix,
  .detail-data-grid,
  .ry17-more-grid,
  .moments,
  .stats-grid,
  .metrics-grid,
  .cards-grid,
  .dashboard-grid,
  .module-grid
) > * {
  color: var(--ry-master-text) !important;
  border: 1px solid var(--ry-master-line) !important;
  border-radius: 17px !important;
  background: var(--ry-master-card-muted) !important;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, .17),
    inset 0 1px 0 rgba(255, 255, 255, .02) !important;
}

/* Detail data: missing and recorded values share one coherent system */
html[data-ryby-master="19.0.9.3"] .detail-data-grid article {
  color: var(--ry-master-text) !important;
  border-style: solid !important;
  opacity: 1 !important;
  background: var(--ry-master-card-muted) !important;
}

html[data-ryby-master="19.0.9.3"] .detail-data-grid article.is-recorded {
  border-color: rgba(226, 202, 132, .21) !important;
}

html[data-ryby-master="19.0.9.3"] .detail-data-grid article.is-missing {
  border-color: rgba(192, 178, 136, .12) !important;
  background:
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .018), transparent 28%),
    linear-gradient(150deg, rgba(29, 44, 35, .96), rgba(15, 27, 21, .985)) !important;
}

html[data-ryby-master="19.0.9.3"] .detail-data-grid article > i {
  color: var(--ry-master-gold) !important;
}

html[data-ryby-master="19.0.9.3"] .detail-data-grid article small {
  color: var(--ry-master-text-muted) !important;
}

html[data-ryby-master="19.0.9.3"] .detail-data-grid article strong {
  color: var(--ry-master-text) !important;
}

html[data-ryby-master="19.0.9.3"] .detail-data-grid article.is-missing strong {
  color: rgba(240, 234, 223, .67) !important;
}

/* Catches */
html[data-ryby-master="19.0.9.3"] .catch-card {
  color: var(--ry-master-text) !important;
  border: 1px solid var(--ry-master-line) !important;
  background: var(--ry-master-card) !important;
  box-shadow:
    var(--ry-master-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .022) !important;
}

html[data-ryby-master="19.0.9.3"] .catch-card :is(strong, h3, h4) {
  color: var(--ry-master-text) !important;
}

html[data-ryby-master="19.0.9.3"] .catch-card :is(small, p, .catch-meta) {
  color: var(--ry-master-text-soft) !important;
}

html[data-ryby-master="19.0.9.3"] .catch-card :is(em, b, .weight) {
  color: var(--ry-master-gold-soft) !important;
}

/* Forms and controls */
html[data-ryby-master="19.0.9.3"] :is(input, select, textarea) {
  color: var(--ry-master-text) !important;
  background: rgba(5, 18, 12, .62) !important;
  border: 1px solid rgba(226, 202, 132, .16) !important;
  border-radius: 12px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018) !important;
}

html[data-ryby-master="19.0.9.3"] select option {
  color: var(--ry-master-text) !important;
  background: #10261c !important;
}

html[data-ryby-master="19.0.9.3"]
:is(
  .filters button,
  .fishery-atlas-tabs button,
  .chip,
  .pill,
  .tag-pill,
  .filter-pill,
  .segmented button
) {
  color: var(--ry-master-text-soft) !important;
  background: rgba(5, 18, 12, .42) !important;
  border: 1px solid rgba(226, 202, 132, .13) !important;
}

html[data-ryby-master="19.0.9.3"]
:is(
  .filters button.active,
  .fishery-atlas-tabs button.active,
  .chip.active,
  .pill.active,
  .tag-pill.active,
  .filter-pill.active,
  .segmented button.active
) {
  color: #102219 !important;
  background: linear-gradient(135deg, #ead68e, #c39d47) !important;
  border-color: rgba(234, 213, 141, .37) !important;
}

/* Tables and list rows */
html[data-ryby-master="19.0.9.3"] :is(table, .table-shell, .data-table) {
  color: var(--ry-master-text) !important;
  background: transparent !important;
}

html[data-ryby-master="19.0.9.3"] :is(th, td, .table-row, .list-row) {
  color: inherit !important;
  border-color: rgba(226, 202, 132, .10) !important;
}

/* Navigation, floating buttons and footer */
html[data-ryby-master="19.0.9.3"]
:is(.site-nav, .nav-shell, .topbar, .back-to-top, #ry17-add-catch, .nav-float) {
  color: var(--ry-master-gold-soft) !important;
  border-color: rgba(226, 202, 132, .31) !important;
  background:
    linear-gradient(145deg, rgba(10, 28, 20, .995), rgba(4, 16, 11, .995)) !important;
}

html[data-ryby-master="19.0.9.3"] :is(.site-footer, .footer) {
  color: var(--ry-master-text) !important;
  background: linear-gradient(180deg, #0b2118, #06130d) !important;
  border-top-color: rgba(226, 202, 132, .10) !important;
}

/* Modal shells and lightboxes */
html[data-ryby-master="19.0.9.3"] :is(.modal, .dialog, .drawer, .lightbox-panel) {
  color: var(--ry-master-text) !important;
  border-color: var(--ry-master-line) !important;
  background: var(--ry-master-card) !important;
}

/* Admin pages: same palette, without changing layout or typography */
html[data-ryby-master="19.0.9.3"] body[data-ryby-admin],
html[data-ryby-master="19.0.9.3"] body.admin-page {
  color: var(--ry-master-text) !important;
  background:
    radial-gradient(circle at 12% 0, rgba(152, 168, 94, .045), transparent 24%),
    linear-gradient(180deg, #071710, #0b2118) !important;
}

html[data-ryby-master="19.0.9.3"]
:is(
  .admin-card,
  .admin-panel,
  .admin-shell,
  .dashboard-card,
  .module-card,
  .admin-grid > *,
  .dashboard-grid > *
) {
  color: var(--ry-master-text) !important;
  border-color: var(--ry-master-line) !important;
  background: var(--ry-master-card) !important;
}

/* Mobile */
@media (max-width: 680px) {
  html[data-ryby-master="19.0.9.3"]
  :is(
    .season-explorer,
    .session-truth,
    .gallery-toolbar,
    .gallery-empty,
    .intelligence-command,
    .fishery-atlas-summary,
    .fishery-atlas-tabs,
    .ry1903-detail-summary
  ) {
    border-radius: 15px !important;
  }

  html[data-ryby-master="19.0.9.3"]
  :is(
    .analytics-grid,
    .intelligence-matrix,
    .detail-data-grid,
    .ry17-more-grid,
    .moments,
    .stats-grid,
    .metrics-grid
  ) > * {
    border-radius: 15px !important;
  }
}
