.sd-page {
  container-type: inline-size;
  color: var(--ink);
}
.sd-back, .sd-account, .sd-account a, .sd-meta, .sd-meta span,
.sd-panel-head, .sd-panel h2, .sd-actions,
.sd-video-summary, .sd-fold summary, .sd-byline, .sd-version-label,
.sd-version-receipts, .sd-metrics span { display: flex; align-items: center; }
.sd-back {
  width: fit-content; gap: 5px; margin: 0 0 13px;
  color: var(--muted); font-size: var(--type-ui); font-weight: 600;
}
.sd-back svg { width: 14px; height: 14px; transform: rotate(180deg); }
.sd-account a:hover, .sd-back:hover { color: var(--blue-strong); text-decoration: underline; }
.sd-mast, .sd-panel, .sd-fold {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-panel); box-shadow: var(--panel-shadow);
}
.sd-mast {
  display: grid; grid-template-columns: minmax(175px, 25%) minmax(0, 1fr);
  min-height: 172px; overflow: hidden;
}
.sd-cover { position: relative; min-width: 0; overflow: hidden; background: #e7e2dc; }
.sd-cover .scene-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sd-heading { align-self: center; min-width: 0; padding: 24px clamp(20px, 2.4vw, 38px); }
.sd-account { gap: 9px; color: var(--muted); font-size: var(--type-ui); }
.sd-account > span { padding: 2px 8px; color: var(--blue-strong); border-radius: var(--radius-pill); background: #f1effa; font-weight: 650; }
.sd-account a { gap: 3px; color: #526076; }
.sd-account svg { width: 13px; height: 13px; }
.sd-heading h1 { margin: 9px 0 12px; font-size: clamp(24px, 2.3vw, 36px); line-height: 1.28; letter-spacing: -.035em; overflow-wrap: anywhere; }
.sd-meta { flex-wrap: wrap; gap: 6px 18px; color: #58657a; font-size: var(--type-ui); }
.sd-meta span { gap: 6px; }
.sd-meta svg, .sd-panel h2 svg, .sd-fold summary svg { width: 16px; height: 16px; flex: none; }
/* Each collection kind has the same position in the ledger and in its read-only history. */
.sd-collection-nav { margin: 20px 0; }
.sd-collection-heading, .sd-collection-heading a, .sd-kind-title { display: flex; align-items: center; }
.sd-collection-heading { gap: 12px; justify-content: space-between; margin-bottom: 11px; }
.sd-collection-heading h2 { margin: 0; color: var(--ink); font-size: 15px; }
.sd-collection-heading a { gap: 2px; color: #435da0; font-size: var(--type-caption); font-weight: 600; }
.sd-collection-heading a:hover, .sd-collection-heading a[aria-current] { text-decoration: underline; }
.sd-collection-heading a svg { width: 13px; height: 13px; }
.sd-collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sd-kind-card {
  min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 13px 15px;
  background: white; border: 1px solid var(--line); border-radius: var(--radius-panel);
}
a.sd-kind-card:hover, .sd-kind-card[aria-current] { border-color: #91a8df; background: #f3f6fd; }
.sd-kind-title { flex-wrap: wrap; gap: 6px; color: #34435a; }
.sd-kind-title > svg { flex: none; width: 16px; height: 16px; color: #5b6b83; }
.sd-kind-title strong { margin-right: auto; font-size: var(--type-body); font-weight: 650; }
.sd-progress-pair { display: grid; gap: 4px; font-size: var(--type-caption); color: #596779; }
.sd-progress-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1px 8px; }
.sd-progress-line:not(:first-child) { margin-top: 4px; }
.sd-progress-pair progress { display: block; appearance: none; width: 100%; height: 3px; border: 0; border-radius: var(--radius-pill); background: var(--progress-track); color: var(--blue-strong); }
.sd-progress-pair progress::-webkit-progress-bar { background: var(--progress-track); border-radius: var(--radius-pill); }
.sd-progress-pair progress::-webkit-progress-value { background: var(--blue-strong); border-radius: var(--radius-pill); }
.sd-progress-pair progress::-moz-progress-bar { background: var(--blue-strong); border-radius: var(--radius-pill); }
.sd-progress-pair b { font-weight: 550; color: #324158; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-columns { display: grid; align-items: stretch; grid-template-columns: minmax(0, 1.85fr) minmax(225px, 1fr); gap: 18px; }
.sd-primary-col, .sd-side { display: grid; min-width: 0; gap: 14px; }
.sd-primary-col { grid-template-rows: 1fr auto; }
.sd-panel { min-width: 0; }
.sd-panel h2 { margin: 0; gap: 8px; color: var(--ink); font-size: 17px; line-height: 1.45; }
.sd-panel h2 svg { color: var(--blue-strong); }
.sd-panel-head { justify-content: space-between; gap: 8px; min-height: 57px; padding: 15px 21px; border-bottom: 1px solid #e9ebf2; }
.sd-panel-head small, .sd-steps small { display: block; color: var(--muted); font-size: var(--type-caption); }
.sd-page .badge { font-size: var(--small-label); border-radius: var(--radius-pill); }
.sd-video-body { padding: 21px; }
.sd-video-body p, .sd-empty p { margin: 8px 0 0; font-size: var(--type-ui); color: var(--muted); }
.sd-video-summary { justify-content: space-between; align-items: end; }
.sd-video-summary small { font-size: var(--type-ui); color: #526076; display: block; }
.sd-video-summary strong { display: block; margin: 4px 0 0; font-size: clamp(29px, 3vw, 41px); color: #363057; font-weight: 680; line-height: 1.12; letter-spacing: -.045em; }
.sd-video-summary strong em { font: 650 18px/1 Inter, system-ui, sans-serif; margin-left: 3px; }
.sd-video-summary > span { color: var(--muted); font-size: var(--type-caption); }
.sd-video-body progress { width: 100%; margin-top: 14px; height: 7px; display: block; appearance: none; border: 0; border-radius: var(--radius-pill); overflow: hidden; background: var(--progress-track); }
.sd-video-body progress::-webkit-progress-bar { background: var(--progress-track); }
.sd-video-body progress::-webkit-progress-value { border-radius: var(--radius-pill); background: var(--blue-strong); }
.sd-video-body progress::-moz-progress-bar { border-radius: var(--radius-pill); background: var(--blue-strong); }
.sd-actions { flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sd-page .btn.sd-primary { color: white; background: var(--blue-strong); border-color: var(--blue-strong); border-radius: var(--control-radius); }
.sd-page .btn.sd-secondary { color: var(--blue-strong); background: #f5f3fc; border-color: #ded9ef; border-radius: var(--control-radius); }
.sd-page .btn.sd-primary:hover { background: var(--blue-hover); }
.sd-side .sd-panel h2 { padding: 17px 19px 0; font-size: 15px; }
.sd-steps { list-style: none; padding: 16px 19px 17px; margin: 0; }
.sd-steps li { display: flex; gap: 9px; align-items: start; position: relative; }
.sd-steps li + li { margin-top: 11px; }
.sd-steps li + li::before { content: ""; position: absolute; width: 1px; background: #dfe2e9; left: 12px; height: 17px; bottom: calc(100% + 1px); }
.sd-steps b, .sd-byline b { font-size: var(--type-ui); font-weight: 650; }
.sd-step, .sd-person, .sd-empty > span { display: inline-grid; place-items: center; flex: none; }
.sd-step { width: 25px; height: 25px; border-radius: 50%; background: #f2f2f6; color: #6d7484; }
.sd-step.done { background: #e5f4ed; color: #26734f; }
.sd-step svg { width: 14px; height: 14px; }
.sd-page .info { padding: 3px 0; }
.sd-page .info > div { min-width: 0; padding: 8px 0; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.sd-page .info dt, .sd-page .info dd { margin: 0; font: inherit; font-size: var(--type-caption); }
.sd-page .info dt { color: var(--muted); flex: none; }
.sd-page .info dd { text-align: right; overflow-wrap: anywhere; }
.sd-side .sd-panel .info { padding: 8px 19px 11px; }
.sd-fold summary { cursor: pointer; list-style: none; padding: 14px 18px; gap: 8px; font-size: var(--type-ui); font-weight: 630; color: #49556b; }
.sd-fold summary::-webkit-details-marker { display: none; }
.sd-fold summary svg:last-child { margin-left: auto; width: 14px; }
.sd-fold[open] summary svg:last-child { transform: rotate(90deg); }
.sd-fold-body { padding: 0 18px 10px; }
.sd-fold-body .segments { margin: 0 0 8px; }
.sd-fold-body .segments i { background: #e8e7ef; }
.sd-fold-body .segments i.filled { background: #8175be; }
.sd-comments, .sd-versions ul { list-style: none; margin: 0; padding: 0; }
.sd-comments li { display: flex; align-items: start; gap: 12px; margin: 0 21px; padding: 15px 0; }
.sd-comments li + li, .sd-versions li + li { border-top: 1px solid #eceef4; }
.sd-comments li > div { min-width: 0; flex: 1; }
.sd-person { width: 33px; height: 33px; border-radius: 50%; font-weight: 650; font-size: var(--type-caption); }
.sd-person-0 { background: #eeeafa; color: #60558f; }
.sd-person-1 { background: #edede2; color: #62643b; }
.sd-person-2 { background: #f8ebe4; color: #8c5a42; }
.sd-byline { justify-content: space-between; gap: 8px; }
.sd-byline time { color: var(--muted); font-size: var(--type-caption); font-variant-numeric: tabular-nums; }
.sd-comments p { margin: 3px 0 0; color: #414d61; font-size: var(--type-body); }
.sd-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 20px 6px; }
.sd-metrics > div { padding: 2px 14px; }
.sd-metrics > div + div { border-left: 1px solid #e7e8ef; }
.sd-metrics span { gap: 5px; color: #525d73; font-size: var(--type-ui); }
.sd-metrics span svg { width: 14px; height: 14px; }
.sd-metrics strong { display: block; margin: 7px 0 3px; color: #302d4b; font-size: clamp(22px,2.2vw,34px); font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.sd-metrics small, .sd-version-label small { color: var(--muted); font-size: var(--type-caption); }
.sd-empty { padding: 30px 20px; text-align: center; }
.sd-empty > span { width: 36px; height: 36px; color: var(--blue-strong); background: #f0edf8; border-radius: var(--radius-panel); }
.sd-empty > span svg { width: 19px; height: 19px; }
.sd-empty h3 { margin: 8px 0 0; font-size: var(--type-subheading); }
.sd-empty .btn { margin-top: 12px; }
.sd-versions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(255px,100%),1fr)); gap: 14px; margin-bottom: 15px; }
.sd-versions li { padding: 17px 19px; }
.sd-version-label, .sd-version-receipts { flex-wrap: wrap; gap: 6px 9px; }
.sd-version-label b { font-size: 17px; }
.sd-version-receipts { margin-top: 11px; display: grid; font-size: var(--type-caption); color: var(--muted); }
.sd-version-receipts b { margin-left: 5px; font-weight: 550; color: #4c586b; font-variant-numeric: tabular-nums; }
.sd-difference { margin: 11px 0 0; color: #855b2e; font-size: var(--type-caption); }
@container (max-width: 720px) {
  .sd-columns { grid-template-columns: minmax(0,1fr); }
  .sd-side { grid-template-columns: repeat(auto-fit,minmax(min(210px,100%),1fr)); }
  .sd-mast { min-height: 139px; grid-template-columns: 26% minmax(0,1fr); }
  .sd-heading { padding: 16px; }
}
@container (max-width: 440px) {
  .sd-mast { display: block; }
  .sd-cover { height: 90px; }
  .sd-heading { padding: 13px 15px; }
  .sd-heading h1 { margin: 8px 0; font-size: 22px; }
  .sd-meta { gap: 3px 8px; font-size: var(--type-caption); }
  .sd-collection-grid { grid-template-columns: 1fr; gap: 5px; }
  .sd-kind-card { padding: 9px 12px; }
  .sd-kind-title strong { margin-right: 2px; }
  .sd-panel-head { padding: 13px 15px; }
  .sd-video-body { padding: 16px; }
  .sd-comments li { margin-inline: 15px; }
  .sd-metrics { padding-inline: 3px; }
  .sd-metrics > div { padding-inline: 8px; }
  .sd-metrics span svg { display: none; }
}

.sd-cover > a[data-original-cover] {
  position: absolute; inset: 0; display: grid; place-items: center; background: #edf0f4;
}
.sd-cover > a[data-original-cover] .scene-photo {
  z-index: auto;
}
a[data-original-cover]:focus-visible { outline: 3px solid var(--blue-strong); outline-offset: -3px; }
.sd-versions .dq-empty { padding: 18px 21px; margin: 0; color: var(--muted); font-size: var(--type-ui); }

.ds-record-extra {
  padding: 13px 18px 15px; min-width: 0; text-align: left; color: #304358;
  background: #f8fafd; box-shadow: inset 3px 0 #d7e6f7;
}
.ds-record-extra h3 { margin: 0; font-size: var(--type-ui); font-weight: 650; }
.ds-extra-title, .ds-file-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.ds-extra-title { justify-content: space-between; }
.ds-extra-title a, .ds-file-more summary { color: #365e8d; font-size: var(--type-caption); }
.ds-record-extra .info { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(290px,100%),1fr)); gap: 6px 25px; margin: 9px 0 0; padding: 0; }
.ds-record-extra .info > div { display: grid; grid-template-columns: minmax(5em,auto) 1fr; gap: 7px; align-items: baseline; justify-content: start; padding: 0; border: 0; }
.ds-record-extra .info :is(dt,dd) { margin: 0; font-size: var(--type-caption); line-height: 1.65; text-align: left; overflow-wrap: anywhere; }
.ds-record-extra .info dt, .ds-file-heading > span, .ds-record-note, .ds-file-more > small { color: #586a7e; }
.ds-record-note { margin: 10px 0 0; font-size: var(--type-caption); }
.ds-file-list { list-style: none; padding: 0; margin: 5px 0; }
.ds-file-row { padding: 7px 0; border-bottom: 1px solid #dee6ef; }
.ds-file-heading > strong, .ds-file-heading > span { font-size: var(--type-caption); }
.ds-file-heading .actions { margin-left: auto; flex-wrap: wrap; gap: 4px; }
.ds-record-extra .ds-file-heading .btn { min-height: 25px; padding: 1px 5px; }
.ds-file-more { margin-top: 5px; }
.ds-file-more summary { cursor: pointer; width: fit-content; padding-block: 2px; }
.ds-file-more[open] > summary { margin-bottom: 3px; }
.ds-file-more[open] > .info { margin: 5px 0; }

.crumbs:has(.scene-origin-scope) { min-width: 0; }
.crumbs .scene-origin-scope {
  display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 36ch;
  padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--control-radius);
  background: var(--canvas); color: var(--muted); font-size: var(--small-label); white-space: nowrap;
}
.scene-origin-scope > strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
@media (max-width: 550px) {
  .shell-main > .topbar:has(.scene-origin-scope) {
    display: grid; grid-template-columns: auto minmax(0, 1fr); height: auto; row-gap: 3px; padding-block: 4px 7px;
  }
  .crumbs:has(.scene-origin-scope) { display: contents; }
  .crumbs:has(.scene-origin-scope) .mobile-menu { grid-area: 1 / 1; }
  .topbar:has(.scene-origin-scope) > .actions { grid-area: 1 / 2; justify-self: end; }
  .crumbs .scene-origin-scope { grid-area: 2 / 1 / 3 / -1; justify-self: start; max-width: 100%; }
}
