/* FANGST v65 – coherent high-contrast dark mode across every view.
   Applied last. All changes are scoped to body.fangst-dark; light mode stays unchanged. */
body.fangst-dark {
  color-scheme: dark;
  --fangst-dark-surface: #123349;
  --fangst-dark-raised: #163d52;
  --fangst-dark-field: #0c283a;
  --fangst-dark-border: #3e6477;
  --fangst-dark-text: #eef9ff;
  --fangst-dark-muted: #bbd2de;
  --fangst-dark-link: #86eeee;
  --turq: #087987; /* white text on main buttons stays readable */
}

/* Formerly white/pale cards with inherited light text, across menus and modules */
body.fangst-dark .dashed,
body.fangst-dark .upload,
body.fangst-dark .v57-catch-split,
body.fangst-dark .fa-news-card,
body.fangst-dark .fa-news-empty,
body.fangst-dark .fa-news-loading,
body.fangst-dark .v57-secondary-actions button,
body.fangst-dark .v46-history,
body.fangst-dark .auth-panel,
body.fangst-dark .install-panel {
  background: var(--fangst-dark-surface);
  color: var(--fangst-dark-text);
  border-color: var(--fangst-dark-border);
}
body.fangst-dark .upload {
  background: linear-gradient(160deg, #163e50, #0d3043);
}
body.fangst-dark .upload .uicon {
  background: #1c5364;
  color: #9cfafa;
}
body.fangst-dark .upload small,
body.fangst-dark .v57-catch-split p,
body.fangst-dark .fa-news-bottom,
body.fangst-dark .fa-news-empty p,
body.fangst-dark .fa-news-loading,
body.fangst-dark .v57-empty {
  color: var(--fangst-dark-muted);
}
body.fangst-dark .v57-secondary-actions button {
  background: #19485c;
  color: #e1f8ff;
}
body.fangst-dark .v57-secondary-actions button:focus-visible {
  outline: 3px solid #8af3f1;
  outline-offset: 2px;
}

/* Fiskeavisen: headings previously used #112e40 against inherited dark text */
body.fangst-dark .fa-news-copy h3 {
  color: var(--fangst-dark-text);
}
body.fangst-dark .fa-news-source,
body.fangst-dark .fa-news-bottom span,
body.fangst-dark .fa-news-visit,
body.fangst-dark .fa-news-empty a {
  color: var(--fangst-dark-link);
}
body.fangst-dark .fa-news-image {
  background: linear-gradient(145deg, #19485b, #103549);
}

/* Forms, standalone dropdowns (judge controls, year picker), native controls */
body.fangst-dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
body.fangst-dark select,
body.fangst-dark textarea {
  background-color: var(--fangst-dark-field);
  color: var(--fangst-dark-text);
  border-color: var(--fangst-dark-border);
  caret-color: #d5ffff;
}
body.fangst-dark select option {
  color: var(--fangst-dark-text);
  background: var(--fangst-dark-field);
}
body.fangst-dark input::placeholder,
body.fangst-dark textarea::placeholder {
  color: #a8c6d4;
  opacity: 1;
}
body.fangst-dark input[type="file"] {
  color: var(--fangst-dark-text);
}
body.fangst-dark input[type="file"]::file-selector-button {
  background: #20536b;
  color: #effcff;
  border: 1px solid #477d90;
  border-radius: 8px;
  padding: 8px 11px;
}
body.fangst-dark input:focus-visible,
body.fangst-dark select:focus-visible,
body.fangst-dark textarea:focus-visible {
  outline: 2px solid #83e7ed;
  outline-offset: 2px;
}
body.fangst-dark .field label,
body.fangst-dark .v46-filter label,
body.fangst-dark .photo-note,
body.fangst-dark .photo-note b,
body.fangst-dark .field .hint,
body.fangst-dark .footnote {
  color: var(--fangst-dark-muted);
}

/* Generic text, status labels, links and selection tabs */
body.fangst-dark .textlink,
body.fangst-dark .ranking .points,
body.fangst-dark .wr-show,
body.fangst-dark .wr-rule-sources a {
  color: var(--fangst-dark-link);
}
body.fangst-dark .event-card .tagline,
body.fangst-dark .feed-item strong,
body.fangst-dark .ranking small,
body.fangst-dark .cardline small,
body.fangst-dark .v54-next {
  color: #d6edf6;
}
body.fangst-dark .eyebrow,
body.fangst-dark .v54-current {
  color: #91eafa;
}
body.fangst-dark .tabs {
  background: #0d283b;
  border: 1px solid #32596c;
}
body.fangst-dark .tab {
  color: #b9d3de;
}
body.fangst-dark .tab.active {
  background: #24617b;
  color: #fff;
}
body.fangst-dark .pill {
  background: #174c46;
  color: #bdf6de;
}
body.fangst-dark .pill.red {
  background: #562c3d;
  color: #ffced8;
}
body.fangst-dark .event-delete-btn {
  background: #4b2838;
  color: #ffced8;
  border-color: #885165;
}

/* Fishing-day timer, upload details, GPS and judge notices */
body.fangst-dark .v54-sessions,
body.fangst-dark .v54-session,
body.fangst-dark .v54-day,
body.fangst-dark .fangst-participant-row {
  border-color: #375d6f;
}
body.fangst-dark .v51-status,
body.fangst-dark .v46-gps-auto {
  background: #154a3f;
  color: #bdffe4;
}
body.fangst-dark .v46-await,
body.fangst-dark .v49-map-meta,
body.fangst-dark .v49-chip {
  background: #1a485d;
  color: #d5faff;
}
body.fangst-dark .v41-warning,
body.fangst-dark .warning,
body.fangst-dark .info.warning,
body.fangst-dark .alert {
  background: #49391e;
  color: #ffe5ac;
  border-color: #786037;
}
body.fangst-dark .catch-feedback {
  background: #512f2e;
  color: #ffe0d7;
  border-color: #8e5a56;
}
body.fangst-dark .catch-feedback.success {
  background: #164d42;
  color: #ccffec;
  border-color: #438c79;
}
body.fangst-dark .catch-feedback.progress {
  background: #153d59;
  color: #dcf6ff;
  border-color: #447b9a;
}
body.fangst-dark .admin-review-card .admin-card-actions {
  background: linear-gradient(to bottom, rgba(18,51,73,.97), #123349 24%);
}
body.fangst-dark .medal,
body.fangst-dark .medal.silver,
body.fangst-dark .medal.bronze {
  background: #28485a;
  color: #e5f6ff;
}
body.fangst-dark .medal.gold {
  background: #544222;
  color: #ffe2a5;
}

/* Rules had legacy !important declarations permanently forcing white surfaces */
body.fangst-dark .wr-rules-screen .wr-water-tile,
body.fangst-dark .wr-rules-screen .wr-rule-panel {
  background: #12384d !important;
  color: #edfaff !important;
  border-color: #47758a !important;
}
body.fangst-dark .wr-rules-screen .wr-water-tile.is-active {
  background: #164f5a !important;
  border-color: #79e6e9 !important;
}
body.fangst-dark .wr-rules-screen .wr-water-tile span,
body.fangst-dark .wr-rules-screen .wr-water-tile svg,
body.fangst-dark .wr-rules-screen .wr-rule-panel h2,
body.fangst-dark .wr-rules-screen .wr-rule-panel h3,
body.fangst-dark .wr-rules-screen .wr-rule-points,
body.fangst-dark .wr-rules-screen .wr-rule-points li,
body.fangst-dark .wr-rules-screen .wr-rule-panel p:not(.wr-status):not(.wr-disclaimer),
body.fangst-dark .wr-rules-screen .wr-rule-panel strong {
  color: #edfaff !important;
}
body.fangst-dark .wr-rules-screen .wr-status,
body.fangst-dark .wr-rules-screen .wr-rule-panel .eyebrow,
body.fangst-dark .wr-rules-screen .wr-rule-sources a {
  color: #87eeee !important;
}
body.fangst-dark .wr-rules-screen .wr-status-caution {
  color: #ffd19b !important;
}
body.fangst-dark .wr-rules-screen .wr-disclaimer {
  color: #b7d1de !important;
}

/* Auth and install dialogs remain readable when dark mode is remembered */
body.fangst-dark .auth-panel h2,
body.fangst-dark .install-panel h2,
body.fangst-dark .install-panel p {
  color: var(--fangst-dark-text);
}
body.fangst-dark .install-close {
  color: #c8e2eb;
}
