/* Expanded source cards: keep compact rows until the visitor opens Details. */
.portal-summary-meta { display:contents; }
.source-bookmark-caption { display:none; }
.bookmark-saved-copy { display:none; }
.source-bookmark[aria-pressed="true"] .bookmark-add-copy { display:none; }
.source-bookmark[aria-pressed="true"] .bookmark-saved-copy { display:inline; }
.catalog-workspace .source-card:has(> .portal-details[open]) {
  padding:24px; margin-block:10px 14px; background:var(--card); box-shadow:0 8px 24px #203c2408;
}
.catalog-workspace .source-card > .portal-details[open] > summary {
  display:grid; grid-template-columns:76px minmax(0,1fr) 96px; grid-template-rows:auto auto auto;
  gap:12px 22px; min-height:138px; padding:0 182px 0 105px; position:relative;
}
.catalog-workspace .source-card > .portal-details[open] .portal-emblem {
  grid-column:1; grid-row:1 / 4; align-self:start; width:76px; height:82px;
  border-radius:10px; background:color-mix(in srgb,var(--accent-weak) 65%,var(--card));
}
.catalog-workspace .source-card > .portal-details[open] .portal-emblem svg { width:42px; height:42px; }
.catalog-workspace .source-card > .portal-details[open] .portal-identity { grid-column:2; grid-row:1; align-self:start; }
.catalog-workspace .source-card > .portal-details[open] .portal-identity strong {
  font:600 1.65rem/1.17 Georgia,'Times New Roman',serif; letter-spacing:-.035em; color:var(--text);
}
.catalog-workspace .source-card > .portal-details[open] .portal-summary-meta {
  grid-column:2 / 4; grid-row:2; display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; min-width:0;
}
.catalog-workspace .source-card > .portal-details[open] .portal-country { font-size:.87rem; }
.catalog-workspace .source-card > .portal-details[open] .portal-excerpt {
  display:block; flex:1 1 280px; font-size:.83rem; line-height:1.6; color:var(--muted);
}
.catalog-workspace .source-card > .portal-details[open] .portal-tags {
  display:flex; grid-column:2 / 4; grid-row:3; gap:8px; align-self:start; margin:0;
}
.catalog-workspace .source-card > .portal-details[open] .portal-tags > span { padding:4px 13px; font-size:.76rem; }
.catalog-workspace .source-card > .portal-details[open] .portal-toggle {
  position:static; grid-column:3; grid-row:1; justify-self:end; align-self:start;
  min-height:44px; padding:3px 0; font-size:.9rem; gap:10px;
}
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark {
  top:24px; left:18px; display:flex; flex-direction:column; gap:8px;
  width:78px; height:auto; min-height:104px; padding:0; border-radius:8px; background:transparent;
}
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark::after {
  content:""; position:absolute; left:94px; top:0; height:108px; width:1px; background:var(--border);
}
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark > svg {
  width:58px; height:58px; padding:15px; border-radius:9px; background:var(--accent-weak);
}
.catalog-workspace .source-card:has(> .portal-details[open]) .source-bookmark-caption {
  display:block; max-width:78px; font-size:.75rem; line-height:1.45; font-weight:400;
}
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark:hover > svg { background:color-mix(in srgb,var(--accent) 16%,var(--card)); }
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-open { top:24px; right:24px; bottom:auto; margin:0; }
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-open::before {
  content:""; position:absolute; left:-16px; top:0; width:1px; height:54px; background:var(--border);
}
.catalog-workspace .source-card:has(> .portal-details[open]) > .source-open .btn {
  min-height:54px; width:160px; padding:12px 16px; font-size:.88rem; gap:12px;
  color:#fff; background:#214e3e; border-color:#214e3e;
}
.catalog-workspace .portal-details > .portal-sheet {
  margin:22px -24px -24px; padding:0; border-top:1px solid var(--border);
}
.portal-sheet-columns { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.95fr); gap:26px; padding:24px; }
.portal-sheet-main,.portal-sheet-side { min-width:0; }
.portal-sheet-side { border-left:1px solid var(--border); padding-left:26px; }
.portal-sheet-section { display:grid; grid-template-columns:48px minmax(0,1fr); gap:18px; padding-bottom:22px; }
.portal-sheet-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:50%; background:color-mix(in srgb,var(--accent-weak) 65%,var(--card)); color:var(--accent); }
.portal-sheet-copy h4 { margin:6px 0 10px; font:600 1.6rem/1.2 Georgia,'Times New Roman',serif; letter-spacing:-.03em; color:var(--text); }
.portal-sheet-copy p { margin:0; font-size:.9rem; line-height:1.65; color:var(--muted); overflow-wrap:anywhere; }
.portal-sheet-metadata { display:flex; flex-wrap:wrap; gap:10px 22px; margin-top:16px; color:var(--muted); font-size:.82rem; }
.portal-sheet-metadata > span { display:inline-flex; align-items:center; gap:9px; }
.portal-sheet-how { padding-top:22px; border-top:1px solid var(--border); }
.portal-sheet-tip { display:grid; grid-template-columns:38px minmax(0,1fr); gap:18px; padding:18px 20px; background:color-mix(in srgb,var(--accent-weak) 60%,var(--card)); border-radius:9px; color:var(--accent); }
.portal-sheet-tip > svg { margin-top:3px; }
.portal-sheet-tip h5 { margin:0 0 5px; font-size:.88rem; font-weight:600; }
.portal-sheet-tip p { margin:0; font-size:.85rem; line-height:1.65; }
.portal-sheet-tip p + p { margin-top:9px; }
.portal-sheet-metrics { position:relative; isolation:isolate; overflow:hidden; margin:0 0 22px; padding:22px 20px; border-radius:10px; background:color-mix(in srgb,var(--accent-weak) 67%,var(--card)); }
.portal-sheet-metrics::after { content:""; position:absolute; z-index:-1; right:-60px; bottom:-40px; width:220px; height:185px; background:url('ancestry-branch.svg') center / contain no-repeat; opacity:.22; pointer-events:none; }
.portal-sheet-metric { display:grid; grid-template-columns:66px minmax(0,1fr); column-gap:20px; align-items:center; }
.portal-sheet-metric-icon { grid-column:1; grid-row:1 / 3; display:grid; place-items:center; width:66px; height:72px; border-radius:50%; background:var(--accent-weak); color:var(--accent); }
.portal-sheet-metric dt { grid-column:2; grid-row:2; font-size:1rem; line-height:1.4; color:var(--text); }
.portal-sheet-metric dd { grid-column:2; grid-row:1; margin:0 0 3px; color:var(--accent); }
.portal-sheet-metric dd strong { display:block; font:600 clamp(2rem,3.4vw,3.1rem)/1.1 Georgia,'Times New Roman',serif; letter-spacing:-.04em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.portal-sheet-qualifier { display:block; margin-bottom:4px; font-size:1rem; }
.portal-sheet-metric + .portal-sheet-metric { margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.portal-sheet-metric + .portal-sheet-metric dd strong { font-size:1.9rem; }
.portal-sheet-metric + .portal-sheet-metric .portal-sheet-metric-icon { height:52px; background:transparent; }
.portal-sheet-metric + .portal-sheet-metric .portal-sheet-metric-icon svg { width:29px; }
.portal-sheet-access { padding-bottom:22px; }
.portal-sheet-access h4 { font-size:1.5rem; }
.portal-sheet-provenance { display:grid; grid-template-columns:26px minmax(0,1fr); gap:16px; padding:20px 6px 0; border-top:1px solid var(--border); }
.portal-sheet-provenance > svg { margin-top:2px; color:var(--accent); }
.portal-sheet-provenance h5 { margin:0 0 14px; font:600 1.22rem/1.3 Georgia,serif; color:var(--accent); }
.portal-sheet-dates { display:grid; gap:10px; margin:0; font-size:.81rem; line-height:1.4; }
.portal-sheet-dates > div { display:grid; grid-template-columns:minmax(120px,.9fr) minmax(0,1fr); gap:12px; }
.portal-sheet-dates dt { color:var(--muted); }
.portal-sheet-dates dd { margin:0; color:var(--text); }
.portal-sheet-provenance .historical-badge { margin-top:14px; }
.portal-sheet-footer { display:flex; align-items:center; justify-content:space-between; gap:14px 24px; flex-wrap:wrap; margin:0 24px; padding:18px 4px; border-top:1px solid var(--border); font-size:.8rem; }
.portal-sheet-checked { display:flex; align-items:center; gap:12px; color:var(--muted); }
.portal-sheet-links { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px 22px; margin-left:auto; }
.portal-sheet-links a { display:inline-flex; align-items:center; gap:12px; text-decoration:underline; text-underline-offset:3px; line-height:1.45; }
.portal-sheet-links a + a { border-left:1px solid var(--border); padding-left:22px; }
@media (max-width:1100px) {
  .catalog-workspace .source-card > .portal-details[open] > summary { padding-left:85px; grid-template-columns:58px minmax(0,1fr) 88px; gap:12px 16px; }
  .catalog-workspace .source-card > .portal-details[open] .portal-emblem { width:58px; height:64px; }
  .catalog-workspace .source-card > .portal-details[open] .portal-identity strong { font-size:1.4rem; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark { left:12px; width:70px; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark::after { left:78px; }
  .portal-sheet-columns { gap:20px; }
  .portal-sheet-side { padding-left:20px; }
  .portal-sheet-section { grid-template-columns:40px minmax(0,1fr); gap:12px; }
  .portal-sheet-icon { width:40px; height:40px; }
  .portal-sheet-copy h4 { font-size:1.4rem; }
  .portal-sheet-metric { grid-template-columns:44px minmax(0,1fr); gap:0 14px; }
  .portal-sheet-metric-icon { width:44px; height:54px; }
  .portal-sheet-metric-icon svg { width:30px; }
  .portal-sheet-metric dd strong { font-size:2.3rem; }
  .portal-sheet-dates > div { grid-template-columns:1fr; gap:3px; }
}
@media (max-width:850px) {
  .portal-sheet-columns { grid-template-columns:1fr; gap:22px; }
  .portal-sheet-side { border-left:0; border-top:1px solid var(--border); padding:22px 0 0; }
  .portal-sheet-dates > div { grid-template-columns:minmax(120px,.6fr) minmax(0,1fr); gap:12px; }
  .catalog-workspace .source-card > .portal-details[open] > summary { padding-right:0; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-open { position:static; margin:0 0 0 85px; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-open::before { content:none; }
  .catalog-workspace .source-card:has(> .portal-details[open]) { display:grid; grid-template-columns:minmax(0,1fr); }
  .catalog-workspace .source-card > .portal-details[open] { display:contents; }
  .catalog-workspace .source-card > .portal-details[open] > summary { grid-row:1; padding-bottom:0; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-open { grid-row:2; margin-top:16px; }
  .catalog-workspace .source-card > .portal-details[open] > .portal-sheet { grid-row:3; }
}
@media (max-width:600px) {
  .catalog-workspace .source-card:has(> .portal-details[open]) { padding:16px; }
  .catalog-workspace .source-card > .portal-details[open] > summary { grid-template-columns:40px minmax(0,1fr); gap:12px; padding-left:0; min-height:0; }
  .catalog-workspace .source-card > .portal-details[open] .portal-emblem { grid-column:1; grid-row:1; width:40px; height:44px; margin-left:48px; }
  .catalog-workspace .source-card > .portal-details[open] .portal-emblem svg { width:28px; height:28px; }
  .catalog-workspace .source-card > .portal-details[open] .portal-identity { grid-column:1 / 3; grid-row:2; }
  .catalog-workspace .source-card > .portal-details[open] .portal-identity strong { font-size:1.24rem; line-height:1.25; }
  .catalog-workspace .source-card > .portal-details[open] .portal-summary-meta { grid-column:1 / 3; grid-row:3; gap:8px; }
  .catalog-workspace .source-card > .portal-details[open] .portal-country { font-size:.78rem; }
  .catalog-workspace .source-card > .portal-details[open] .portal-excerpt { flex-basis:100%; font-size:.78rem; }
  .catalog-workspace .source-card > .portal-details[open] .portal-tags { grid-column:1 / 3; grid-row:4; flex-wrap:wrap; }
  .catalog-workspace .source-card > .portal-details[open] .portal-tags > span { font-size:.68rem; padding:4px 10px; }
  .catalog-workspace .source-card > .portal-details[open] .portal-toggle { grid-column:1 / 3; grid-row:5; justify-self:start; min-height:36px; padding:0; font-size:.8rem; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark { top:15px; left:8px; width:46px; min-height:44px; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark > svg { width:42px; height:44px; padding:10px; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-bookmark::after { content:none; }
  .catalog-workspace .source-card:has(> .portal-details[open]) .source-bookmark-caption { display:none; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-open { margin:9px 0 0; }
  .catalog-workspace .source-card:has(> .portal-details[open]) > .source-open .btn { width:100%; min-height:44px; font-size:.8rem; }
  .catalog-workspace .portal-details > .portal-sheet { margin:18px -16px -16px; }
  .portal-sheet-columns { padding:20px 16px; }
  .portal-sheet-copy h4 { margin-top:4px; font-size:1.3rem; }
  .portal-sheet-copy p { font-size:.83rem; }
  .portal-sheet-metadata { font-size:.76rem; gap:10px; }
  .portal-sheet-tip { padding:15px; gap:12px; grid-template-columns:28px minmax(0,1fr); }
  .portal-sheet-tip p { font-size:.8rem; }
  .portal-sheet-metrics { padding:18px 14px; }
  .portal-sheet-metric dd strong { font-size:2.1rem; }
  .portal-sheet-metric dt { font-size:.88rem; }
  .portal-sheet-provenance { gap:12px; padding-inline:0; }
  .portal-sheet-dates > div { grid-template-columns:1fr; gap:3px; }
  .portal-sheet-footer { margin:0 16px; padding:16px 0; font-size:.77rem; }
  .portal-sheet-links { margin-left:0; flex-direction:column; align-items:flex-start; gap:14px; }
  .portal-sheet-links a + a { padding-left:0; border-left:0; }
}
