/* Existing GWD palette, type, studio and canonical cards; only Rescue's workflow is arranged here. */
#df-tab-lost-disc { min-width: 0; }
#gwd-disc-page.gwd-rescue-page { margin: 0; padding-block: 24px; color: var(--theme-palette-color-8); }
.gwd-rescue-page *, .gwd-rescue-page *::before, .gwd-rescue-page *::after { box-sizing: border-box; }
.gwd-rescue-page [hidden], .df-tab-content[hidden] { display: none !important; }
.gwd-rescue-intro { margin-bottom: 24px; }
.gwd-rescue-intro h2 { font-size: clamp(24px, 2.5vw, 30px); margin: 0 0 8px; line-height: 1.25; }
.gwd-rescue-intro p, .gwd-rescue-setup p { margin: 8px 0 16px; color: var(--theme-palette-color-7); }
.gwd-rescue-setup { padding: 24px; margin-bottom: 24px; background: var(--theme-palette-color-5); border: 1px solid var(--theme-palette-color-6); border-radius: var(--gwd-radius-md); }
.gwd-rescue-setup form { max-width: 900px; }
.gwd-rescue-setup label, .gwd-rescue-setup legend { display: block; font-size: 16px; font-weight: 600; margin: 0 0 8px; padding: 0; }
.gwd-rescue-page input:not([type=radio]), .gwd-rescue-page select { font-size: 16px; }
.gwd-rescue-setup .gwd-fe-slot-search-input { padding-left: 14px !important; min-height: 48px; }
.gwd-rescue-page summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 600; }
.gwd-rescue-setup > summary { color: var(--theme-palette-color-1); }
.gwd-rescue-setup:not([open]) { padding-block: 8px; }
.gwd-rescue-setup[open] > summary { margin-bottom: 16px; }
.gwd-rescue-wear { border: 0; margin: 24px 0; padding: 0; min-width: 0; }
.gwd-rescue-wear-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gwd-rescue-setup label.gwd-rescue-wear-option { margin: 0; display: flex; align-items: start; gap: 10px; padding: 14px; border: 1px solid var(--theme-palette-color-6); border-radius: var(--gwd-radius-sm); cursor: pointer; background: var(--theme-palette-color-5); }
.gwd-rescue-wear-option:has(input:checked) { border-color: var(--theme-palette-color-1); outline: 1px solid var(--theme-palette-color-1); }
.gwd-rescue-wear-option input { accent-color: var(--theme-palette-color-1); margin: 4px 0 0; flex: 0 0 auto; width: 18px; height: 18px; }
.gwd-rescue-wear-option strong, .gwd-rescue-wear-option small { display: block; line-height: 1.45; }
.gwd-rescue-wear-option strong { font-size: 15px; }
.gwd-rescue-wear-option small { margin-top: 4px; font-size: 13px; font-weight: 400; color: var(--theme-palette-color-7); }
.gwd-rescue-fine { margin-bottom: 16px; }
.gwd-rescue-fine-fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin-top: 12px; }
.gwd-rescue-fine-fields input, .gwd-rescue-fine-fields select { display: block; width: 100%; min-height: 44px; margin-top: 8px; color: var(--theme-palette-color-8); background: var(--theme-palette-color-5); border: 1px solid var(--theme-palette-color-6); }
.gwd-rescue-page :is(button, summary) { touch-action: manipulation; }
.gwd-rescue-page button { min-height: 44px; }
.gwd-rescue-page [data-rescue-submit] { min-height: 48px; padding-inline: 24px; }
.gwd-rescue-page [data-rescue-submit]:disabled { opacity: .65; cursor: default; }
.gwd-rescue-page [data-rescue-status] { min-height: 1.5em; font-size: 14px; }
.gwd-rescue-page :focus-visible, .df-tabs-nav .df-tab-button:focus-visible { outline: 3px solid var(--theme-palette-color-1); outline-offset: 3px; }
.gwd-rescue-page .gwd-flight-studio { box-shadow: none; padding: 24px; scroll-margin-top: 100px; }
.gwd-rescue-page .gwd-fe-title { scroll-margin-top: 110px; }
.gwd-rescue-page .gwd-fe-grid { display: block; }
.gwd-rescue-page .gwd-fe-canvas-wrap { height: clamp(280px, 40vw, 420px); }
.gwd-rescue-page .gwd-fe-canvas { width: 100%; height: 100%; }
.gwd-rescue-page .gwd-fe-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gwd-rescue-page .gwd-fe-legend-item { align-items: start; font-size: 13px; line-height: 1.5; }
.gwd-rescue-page .gwd-fe-legend-dot { width: 24px; height: 0; border-top: 3px solid currentColor; background: none; border-radius: 0; margin-top: 8px; flex-shrink: 0; }
.gwd-rescue-page [data-rescue-line="0"] .gwd-fe-legend-dot { border-top-style: dashed; color: var(--theme-palette-color-1); }
.gwd-rescue-page [data-rescue-line="1"] .gwd-fe-legend-dot { color: #008080; }
.gwd-rescue-page [data-rescue-line="2"] .gwd-fe-legend-dot { border-top-style: dotted; color: #D97706; }
.gwd-rescue-page .gwd-fe-narrative-title, .gwd-rescue-page .gwd-fe-narrative-metrics { display: none; }
.gwd-rescue-page .gwd-fe-narrative-box { margin: 16px 0; }
.gwd-rescue-page .gwd-fe-narrative-box p { font-size: 16px; line-height: 1.6; margin: 0; }
.gwd-rescue-comparison-controls, .gwd-rescue-metrics, .gwd-rescue-candidates { margin-top: 12px; border-top: 1px solid var(--theme-palette-color-6); padding-top: 4px; }
.gwd-rescue-page .gwd-fe-controls-pane { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 16px; }
.gwd-rescue-page .gwd-fe-share, .gwd-rescue-page .gwd-fe-server-notice { margin-top: 12px; }
.gwd-rescue-page .gwd-fe-server-notice { font-size: 13px; }
.gwd-rescue-retailers { margin-top: 24px; }
.gwd-rescue-retailers > h3 { font-size: 22px; margin-bottom: 8px; }
.gwd-rescue-retailers > p { color: var(--theme-palette-color-7); font-size: 14px; }
.gwd-rescue-retailers .gwd-similar-title { display: none; }
#gwd-disc-page.gwd-rescue-page .gwd-similar-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.gwd-rescue-page .gwd-rescue-reason { font-size: 14px; line-height: 1.6; padding: 16px; margin: 0; border-bottom: 1px solid var(--theme-palette-color-6); }
.gwd-rescue-active .ct-trending-block, .gwd-rescue-active [data-trending], .gwd-rescue-active #df-recently-viewed-rail { display: none !important; }
.gwd-discfinder-page .df-tabs-nav__inner { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--theme-palette-color-1) var(--theme-palette-color-6); padding-block: 6px; }
.gwd-discfinder-page .df-tab-button { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
.gwd-discfinder-page .df-tabs-nav__inner::-webkit-scrollbar { height: 4px; display: block; }
.gwd-discfinder-page .df-tabs-nav__inner::-webkit-scrollbar-thumb { background: var(--theme-palette-color-1); border-radius: 2px; }
@media(max-width: 800px) {
    .gwd-rescue-wear-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gwd-rescue-fine-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gwd-rescue-fine-fields > label:first-child { grid-column: 1 / -1; }
    .gwd-rescue-page .gwd-fe-legend { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media(max-width: 480px) {
    .gwd-rescue-setup, .gwd-rescue-page .gwd-flight-studio { padding: 16px; }
    .gwd-rescue-page .gwd-fe-controls-pane, .gwd-rescue-fine-fields { grid-template-columns: minmax(0, 1fr); }
    .gwd-rescue-fine-fields > label:first-child { grid-column: auto; }
    .gwd-rescue-wear-options { gap: 8px; }
    .gwd-rescue-setup label.gwd-rescue-wear-option { padding: 12px; }
    .gwd-rescue-page .gwd-fe-canvas-wrap { height: 300px; }
    .gwd-rescue-page .gwd-fe-header { gap: 12px; align-items: start; flex-wrap: wrap; }
}
.gwd-rescue-retailers #gwd-similar-discs-title { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gwd-rescue-page .df-nrcard__body .gwd-rescue-reason { padding: 12px 0; border: 0; }
.gwd-rescue-page .gwd-similar-discs { padding: 0; }
/* Remove nested canonical-page gutters inside the existing DiscFinder panel. */
#df-tab-lost-disc > .df-wrap { padding-inline: 0; }
#df-tab-lost-disc #gwd-disc-page.gwd-rescue-page { padding-inline: 0; background: transparent; }
@media(max-width: 600px) {
    .gwd-rescue-page .gwd-fe-legend-item { font-size: 13px; }
    .gwd-rescue-page .gwd-fe-legend-item span:last-child { min-width: 0; }
    .gwd-rescue-page .gwd-fe-narrative-box { padding: 12px; }
}
#df-tab-lost-disc > .df-wrap { width: min(1180px, calc(100% - 32px)); }
.gwd-rescue-tab-hint { display: block; text-align: right; font-size: 13px; color: var(--theme-palette-color-7); padding: 2px 16px 8px; }
.gwd-rescue-tab-hint[hidden] { display: none; }
.gwd-rescue-wear-option > span { min-width: 0; }
@media(max-width: 360px) {
    .gwd-rescue-wear-options { grid-template-columns: minmax(0, 1fr); }
}

.gwd-rescue-fine-fields > p { grid-column: 1 / -1; margin: 0; }
.gwd-rescue-throw-style { margin-block: 16px; }
.gwd-rescue-page .gwd-fe-legend-item { background: transparent; color: inherit; border: 1px solid var(--theme-palette-color-6); padding: 8px; text-align: left; white-space: normal; }
.gwd-rescue-page .gwd-fe-legend-item[aria-pressed="false"] { text-decoration: line-through; opacity: .65; }
.gwd-rescue-line-help, .gwd-rescue-share-status { font-size: .875rem; }
.gwd-rescue-share-status { display: block; }
.gwd-rescue-page button.gwd-info-btn { position: relative; width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 50%; line-height: 22px; flex: 0 0 24px; }
.gwd-rescue-page .gwd-info-btn::after { content: ""; position: absolute; inset: -10px; }
.gwd-rescue-page .gwd-popover-tooltip { max-width: calc(100vw - 32px); }

.gwd-rescue-overlap { padding: 12px; border-left: 3px solid var(--theme-palette-color-1); background: var(--theme-palette-color-5); font-size: .875rem; }
.gwd-rescue-page .gwd-popover-tooltip[data-rescue-tooltip] { position: fixed; inset: auto; margin: 0; width: 280px; max-width: calc(100vw - 32px); height: auto; padding: 12px; border: 1px solid var(--theme-palette-color-6); }
.gwd-rescue-page .gwd-popover-tooltip[data-rescue-tooltip]::after { display: none; }
.gwd-rescue-page .gwd-popover-tooltip[data-rescue-tooltip]::backdrop { background: transparent; pointer-events: none; }
