/* Alpha23 — restrained dark-theme outlines.
   Visual only; dark portal + screens only. Light and printable music remain unchanged.
   Borderless everywhere is not accessible: selected and keyboard-focused states stay visible. */
@media screen {
  html[data-fcp-theme="dark"] .fcp-portal {
    --fcp-a23-panel-edge: #193349;
    --fcp-a23-card-edge: #1e394f;
    --fcp-a23-inner-edge: #254158;
    --fcp-a23-control-edge: #29455e;
    --fcp-a23-hover-edge: #355a76;
    --fcp-a23-focus: #77aef2;
    --fcp-a23-depth: 0 7px 24px rgba(0, 0, 0, .105);
  }

  /* One calm silhouette for the largest containers. No luminous inset strokes. */
  html[data-fcp-theme="dark"] .fcp-portal :is(
    .fcp-front-hero, .fcp-panel-front, .fcp-stat-grid article,
    .fcp-service-card, .fcp-song-card, .fcp-music-service-card,
    .fcp-music-song, .fcp-login-card, .fcp-discovery-card,
    .fcp-discovery-results, .fcp-source-filter, .fcp-search-results,
    .fcp-harmony-pair-panel, .fcp-chart-toolbar, .fcp-studio,
    .fcp-quick-chord-editor, .fcp-profile-preference-block,
    .fcp-rephi-reference-item
  ) {
    border-color: var(--fcp-a23-panel-edge) !important;
    box-shadow: var(--fcp-a23-depth) !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-front-hero {
    border-color: #1e405c !important;
    box-shadow: 0 12px 34px rgba(0,0,0,.15) !important;
  }
  /* Separators remain visible; the contained content carries the hierarchy. */
  html[data-fcp-theme="dark"] .fcp-portal :is(
    .fcp-front-service-item, .fcp-song-card, .fcp-service-card,
    .fcp-discovery-result, .fcp-discovery-web-option, .fcp-studio-group,
    .fcp-studio-section-work, .fcp-studio-structure, .fcp-studio-bulk,
    .fcp-studio-review, .fcp-audio-player-shell, .fcp-source-note,
    .fcp-service-theme-suggestions, .fcp-chord-preview-pane,
    .fcp-live-chord-preview, .fcp-sticky-actions
  ) { border-color: var(--fcp-a23-card-edge) !important; }
  html[data-fcp-theme="dark"] .fcp-portal :is(.fcp-song-card,.fcp-service-card,.fcp-front-service-item):hover {
    border-color: var(--fcp-a23-hover-edge) !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal :is(
    .fcp-front-hero-icon, .fcp-studio-chord-compare > div,
    .fcp-studio-v160 .fcp-studio-chord-compare > div,
    .fcp-studio-guidance, .fcp-studio-v160 .fcp-studio-guidance,
    .fcp-studio-correction, .fcp-studio-v160 .fcp-studio-correction,
    .fcp-studio-wave, .fcp-studio-v160 .fcp-studio-wave,
    .fcp-song-jump-nav, .fcp-studio-status-tools,
    .fcp-library-display-choice, .fcp-studio-mode-switch,
    .fcp-visual-grid-line .fcp-grid-cell, .fcp-visual-slot,
    .fcp-audio-sync-panel, .fcp-audio-capture-row,
    .fcp-guest-tune-panel, .fcp-profile-choice-card
  ) { border-color: var(--fcp-a23-inner-edge) !important; }

  /* Alpha21's library filter divider retained a hard-coded almost-white border. */
  html[data-fcp-theme="dark"] .fcp-portal .fcp-library-smart-filters {
    border-bottom-color: var(--fcp-a23-panel-edge) !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-audio-player-shell {
    box-shadow: none !important;
  }

  /* Subtle form chrome: the common double border came from a search-field wrapper
     combined with the native input's own focused border / ring. */
  html[data-fcp-theme="dark"] .fcp-portal :is(
    .fcp-search-field, .fcp-song-search-box, .fcp-library-search,
    .fcp-studio-status-tools, .fcp-service-theme-suggestions
  ) { box-shadow: none !important; }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field {
    border-color: var(--fcp-a23-control-edge) !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field:focus-within {
    border-color: #40668a !important;
    box-shadow: 0 0 0 2px rgba(98,151,209,.09) !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    select, textarea
  ) {
    border-color: var(--fcp-a23-control-edge) !important;
    box-shadow: none !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    select, textarea
  ):hover:not(:disabled):not(:focus) { border-color: var(--fcp-a23-hover-edge) !important; }
  html[data-fcp-theme="dark"] .fcp-portal :is(input,select,textarea):focus {
    border-color: #4a769b !important;
    box-shadow: 0 0 0 2px rgba(90,147,212,.095) !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field input:focus {
    border-color: transparent !important;
    box-shadow: none !important;
  }

  /* The outer search field is the input boundary; avoid a nested second stroke. */
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Quiet buttons. Primary, affirmative, reject and error actions keep their own colors. */
  html[data-fcp-theme="dark"] .fcp-portal :is(
    .fcp-button:not(.fcp-button-primary):not(.fcp-studio-confirm):not(.fcp-studio-edit):not(.fcp-studio-reject):not(.fcp-studio-reconsider),
    .fcp-ui-theme-toggle, .fcp-library-layout, .fcp-studio-mode,
    .fcp-song-jump-nav a, .fcp-audio-jump, .fcp-audio-play,
    .fcp-audio-shortcuts kbd, .fcp-studio-marker
  ) { border-color: var(--fcp-a23-control-edge) !important; box-shadow: none !important; }
  html[data-fcp-theme="dark"] .fcp-portal :is(
    .fcp-button:not(.fcp-button-primary):not(.fcp-studio-confirm):not(.fcp-studio-edit):not(.fcp-studio-reject):not(.fcp-studio-reconsider),
    .fcp-ui-theme-toggle, .fcp-library-layout, .fcp-studio-mode,
    .fcp-audio-jump, .fcp-audio-play
  ):hover:not(:disabled) { border-color: var(--fcp-a23-hover-edge) !important; }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-front-hero .fcp-button:not(.fcp-button-primary) {
    border-color: #335474 !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 .fcp-studio-mode.is-selected,
  html[data-fcp-theme="dark"] .fcp-portal .fcp-library-layout.is-active {
    background: #183957 !important;
    border-color: #365e7d !important;
    color: #c4e7ff !important;
  }

  /* Harmony: preserve semantic accents instead of outlining the entire card. */
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 .fcp-studio-review {
    border: 1px solid var(--fcp-a23-card-edge) !important;
    box-shadow: none !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 .fcp-studio-review.is-rejected {
    border-color: var(--fcp-a23-card-edge) !important;
    border-left: 3px solid #af875a !important;
    background: #10283e !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 .fcp-studio-review.is-reviewed {
    border-color: var(--fcp-a23-card-edge) !important;
    border-left: 3px solid #318b70 !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 .fcp-studio-marker.is-active {
    border-color: #5c90b5 !important;
    outline: 1px solid #5c90b5 !important;
    outline-offset: 1px;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 .fcp-studio-marker.is-rejected {
    border-color: #735b40 !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-studio-v160 :is(.fcp-studio-reject,.fcp-studio-reconsider) {
    border-color: #765c40 !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-profile-choice-card:has(input:checked) {
    border-color: #5689b1 !important;
    outline: none !important;
    box-shadow: inset 3px 0 0 #5689b1 !important;
  }

  /* The search wrapper takes the keyboard focus stroke instead of the input. */
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field:has(input:focus-visible) {
    border-color: #568ab4 !important;
    box-shadow: 0 0 0 2px rgba(104,168,231,.22) !important;
  }

  /* Keyboard focus must never disappear with the decorative borders. */
  html[data-fcp-theme="dark"] .fcp-portal :is(
    a, button, input, select, textarea, summary, [role="button"], [tabindex="0"]
  ):focus-visible {
    outline: 2px solid var(--fcp-a23-focus) !important;
    outline-offset: 2px !important;
  }
  html[data-fcp-theme="dark"] .fcp-portal .fcp-search-field input:focus-visible {
    outline: none !important; /* wrapper is the focus target visually */
  }
}
