/* Library shares app-shell.css with Analysis; only its content layout differs. */
@scope (.app.search-active:not(.compare-active)) {
 :scope { grid-template-rows:56px minmax(0,1fr); }
 .workspace-command-bar,.workspace-layout,.tips,.settings-page { display:none; }
 .search-page { display:block; width:100%; height:100%; min-height:0; margin:0; padding:20px 24px 32px; overflow:auto; background:var(--ui-bg); border:0; border-radius:0; }
 .search-page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 20px; padding:0; min-height:36px; border:0; }
 .search-page-heading>strong { font-size:18px; font-weight:600; }
 #addAthleteSearchButton { margin-left:auto; background:var(--ui-selected); color:var(--ui-accent-text); border-color:var(--ui-line); }
 #backToApp { display:none; }
 .search-results-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:24px; margin:0; padding:0; }
 .library-section { min-width:0; padding:0; margin:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
 .library-section>strong { display:block; margin:0; padding:0 0 12px; border:0; border-bottom:1px solid var(--ui-line); color:var(--ui-text); font-size:14px; font-weight:600; }
 .project-library { display:grid; gap:0; padding:0; margin:0; color:var(--ui-muted); font-size:12px; }
 .library-item { position:relative; display:grid; grid-template-columns:minmax(150px,34%) minmax(0,1fr); grid-template-rows:auto auto 1fr; gap:8px 16px; min-width:0; margin:0; padding:16px 0; border:0; border-bottom:1px solid var(--ui-line); border-radius:0; background:transparent; box-shadow:none; text-align:left; }
 .library-item>strong { grid-column:2; grid-row:1; font-size:14px; line-height:1.4; font-weight:600; color:var(--ui-text); overflow-wrap:anywhere; }
 .library-item>small { grid-column:2; grid-row:2; color:var(--ui-muted); font-size:11px; line-height:1.6; font-weight:400; }
 .project-thumbnail { position:relative; display:flex; width:100%; min-width:0; height:auto; min-height:0; aspect-ratio:16/10; margin:0; padding:0; overflow:hidden; border:1px solid var(--ui-line); border-radius:6px; background:var(--ui-panel); cursor:pointer; }
 .library-item>.project-thumbnail { grid-column:1; grid-row:1/4; align-self:start; }
 .project-thumbnail img,.project-thumbnail-pane,.project-thumbnail-media { min-width:0; width:100%; height:100%; object-fit:cover; flex:1; }
 .project-thumbnail-label { position:absolute; bottom:4px; left:4px; right:4px; width:auto; max-width:calc(100% - 8px); padding:3px 5px; background:#07120fe6; border-radius:3px; color:var(--ui-text); font-size:10px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .library-actions { grid-column:2; grid-row:3; display:flex; align-content:start; align-items:start; flex-wrap:wrap; gap:6px; margin:0; }
 .library-actions button { flex:none; font-size:11px; min-height:32px; padding:5px 8px; }
 .library-actions>button:first-child { background:var(--ui-selected); color:var(--ui-accent-text); }
 .danger-button { color:#f094a0; background:transparent; border-color:var(--ui-line); }
 .library-overflow { position:relative; margin-left:auto; }
 .library-overflow>summary { min-height:32px; padding:4px 10px; border:1px solid var(--ui-line); border-radius:6px; font-size:18px; line-height:1; }
 .library-overflow>summary::after { display:none; }
 .library-overflow>button { position:absolute; right:0; top:36px; z-index:5; min-width:130px; background:var(--ui-panel); box-shadow:0 6px 20px #0006; }
 .athlete-event-filters { display:flex; gap:2px; margin:12px 0 0; padding:2px; border:1px solid var(--ui-line); border-radius:6px; background:var(--ui-panel); }
 .athlete-event-filters button { flex:1; min-height:28px; padding:4px 8px; border:0; background:transparent; font-size:12px; color:var(--ui-muted); }
 .athlete-event-filters button.active { background:var(--ui-selected); color:var(--ui-accent-text); }
 .athlete-item { display:flex; flex-direction:column; gap:6px; padding:16px 0; }
 .athlete-item>strong { font-size:15px; }
 .athlete-item>small { line-height:1.5; font-size:12px; }
 .athlete-item>small:nth-of-type(3) { color:var(--ui-text); }
 .athlete-video-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:6px 0 0; padding:0; border:0; background:transparent; border-radius:0; }
 .athlete-video-list>strong,.athlete-video-list>small { grid-column:1/-1; font-size:11px; font-weight:500; color:var(--ui-muted); }
 .athlete-video-list .project-thumbnail { aspect-ratio:16/8; }
 .athlete-project-row { display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; border:0; }
 .athlete-project-row button { max-width:100%; overflow:hidden; text-overflow:ellipsis; font-size:11px; }
 .athlete-card-actions { display:flex; gap:6px; margin-top:6px; }
 .athlete-card-actions button { font-size:11px; }
 .focused-search-view { margin:0; padding:0; background:transparent; border:0; }
 .focused-search-heading { display:flex; gap:12px; align-items:center; margin-bottom:16px; }
 .show-all-results-button { justify-self:start; margin:12px 0; }
 /* Athlete details and expanded results stay within the same Library shell. */
 .focused-search-results { max-width:1100px; }
 .athlete-profile-heading { display:flex; justify-content:space-between; gap:12px; margin-bottom:20px; }
 .athlete-profile-content,.athlete-profile-card,.profile-pr-grid,.profile-project-grid { display:grid; gap:16px; min-width:0; }
 .athlete-profile-hero { display:flex; align-items:center; gap:20px; flex-wrap:wrap; padding-bottom:20px; border-bottom:1px solid var(--ui-line); }
 .athlete-avatar { display:grid; place-items:center; width:64px; height:64px; border-radius:50%; color:var(--ui-accent-text); background:var(--ui-selected); font-size:20px; }
 .athlete-hero-text { display:grid; gap:8px; }
 .athlete-hero-text h2 { font-size:22px; margin:0; }
 .athlete-hero-text p,.profile-fact span { color:var(--ui-muted); font-size:12px; }
 .athlete-profile-actions { display:flex; gap:8px; flex-wrap:wrap; }
 .athlete-hero-stats { display:flex; gap:24px; margin-left:auto; }
 .profile-fact { display:grid; gap:4px; padding:8px 0; }
 .athlete-profile-detail-grid,.athlete-profile-project-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
 .profile-fact-grid,.profile-pr-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(100px,1fr)); gap:12px; }
 .athlete-profile-card { align-content:start; padding:16px 0; border-bottom:1px solid var(--ui-line); }
 .athlete-project-section { min-width:0; }
 .athlete-project-section-heading { display:flex; justify-content:space-between; padding:12px 0; margin-bottom:12px; border-bottom:1px solid var(--ui-line); }
 .profile-project-card { display:flex; gap:8px; flex-wrap:wrap; }
 .profile-project-thumbnail { aspect-ratio:16/9; }
 @media(max-width:700px) { .athlete-profile-detail-grid,.athlete-profile-project-sections { grid-template-columns:1fr; } .athlete-hero-stats { margin-left:0; } }
 @media(max-width:1250px) { .search-page { padding:16px; } .search-results-grid { gap:20px; } .library-item { grid-template-columns:minmax(120px,34%) minmax(0,1fr); gap:8px 12px; } }
 @media(max-width:900px) { .search-results-grid { grid-template-columns:1fr; } .library-item { grid-template-columns:200px minmax(0,1fr); } }
 @media(max-width:700px) { :scope { grid-template-rows:92px minmax(0,1fr); } .library-item { grid-template-columns:130px minmax(0,1fr); } .library-actions { grid-column:1/-1; grid-row:4; } }
 @media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none; } }
}

.project-delete-confirmation { width:min(420px,calc(100vw - 32px)); padding:24px; border:1px solid #26392f; border-radius:8px; background:#0e1b16; color:#e9f0ec; font:13px/1.5 -apple-system,BlinkMacSystemFont,sans-serif; }
.project-delete-confirmation::backdrop { background:#0009; }
.project-delete-confirmation h2 { margin:0 0 10px; font-size:18px; }
.project-delete-confirmation p { margin:0 0 20px; }
.project-delete-confirmation > div { display:flex; justify-content:flex-end; gap:8px; }
.project-delete-confirmation button { padding:8px 12px; border:1px solid #26392f; border-radius:6px; background:#16261e; color:#e9f0ec; cursor:pointer; }
.project-delete-confirmation .danger-button { background:#672c35; color:#fff; }
#libraryDeleteStatus { margin:0 0 16px; color:#b5c4bb; font-size:12px; }
#libraryDeleteStatus.error { color:#f094a0; }
