@import url('../generated-tokens.css?v=3');

:root {
  --studio-header-height: 72px;
  --studio-list-width: minmax(620px, 1.08fr);
  --studio-inspector-width: minmax(460px, 0.8fr);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-family-primary);
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--vd-b); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--ink-mid); opacity: 1; }
select option { background: var(--bg); color: var(--ink); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill, textarea:-webkit-autofill:hover, textarea:-webkit-autofill:focus { box-shadow: 0 0 0 1000px var(--bg) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.studio-app { min-height: 100vh; }
.studio-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--studio-header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 10px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.studio-brand { display: flex; align-items: center; gap: 12px; }
.studio-brand div { min-width: 0; }
.studio-brand span, .studio-brand strong { display: block; }
.studio-brand span, .studio-label { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.studio-brand strong { margin-top: 1px; font-size: 14px; }
.studio-save-state { color: var(--ink-soft); font-size: 12px; text-align: center; }
.studio-header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.studio-header-actions a { color: var(--vd); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.studio-export-menu { position: relative; }
.studio-export-menu summary { min-height: 38px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--radius-sm); color: var(--vd); font-size: 12px; font-weight: 750; list-style: none; cursor: pointer; }
.studio-export-menu summary::-webkit-details-marker { display: none; }
.studio-export-menu summary::after { margin-left: 7px; content: "↓"; }
.studio-export-menu[open] summary { border-color: var(--vd); background: color-mix(in srgb, var(--vd) 7%, var(--bg)); }
.studio-export-links { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 220px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--bg); box-shadow: var(--shadow-lg); }
.studio-export-links a { display: grid; gap: 2px; padding: 11px 12px; border-bottom: 1px solid var(--rule); color: var(--ink); }
.studio-export-links a:last-child { border-bottom: 0; }
.studio-export-links a:hover { background: var(--bg-2); color: var(--vd); }
.studio-export-links span { color: var(--ink-soft); font-size: 10px; font-weight: 650; }

.studio-nav {
  position: sticky;
  top: var(--studio-header-height);
  z-index: 19;
  display: flex;
  gap: 4px;
  padding: 8px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.studio-nav button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink-mid); font-size: 12px; font-weight: 700; }
.studio-nav button:hover { background: var(--bg-2); color: var(--ink); }
.studio-nav button[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.control-view { padding: clamp(24px, 4vw, 48px); }
.control-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.control-heading h1 { margin: 0; font-family: var(--font-family-primary); font-size: clamp(24px, 3vw, 28px); font-style: normal; font-weight: 750; letter-spacing: -.025em; }
.control-heading p, .panel-heading p { max-width: 68ch; margin: 8px 0 0; color: var(--ink-mid); font-size: 13px; line-height: 1.55; }
.deck-availability { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--rule); background: var(--bg); }
.deck-availability h2 { margin: 4px 0 0; font-size: 16px; }
.deck-availability p { margin: 6px 0 0; color: var(--ink-mid); font-size: 12px; line-height: 1.5; }
.deck-availability-control { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 12px; font-weight: 750; }
.deck-availability-control input { width: 20px; height: 20px; margin: 0; accent-color: var(--vd); }
.context-set-builder { margin-bottom: 18px; padding: 20px; border: 1px solid var(--rule); background: var(--bg); }
.context-set-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .34fr); align-items: end; gap: 24px; }
.context-set-heading h2 { margin: 4px 0 0; font-size: 16px; }
.context-set-heading p { max-width: 72ch; margin: 6px 0 0; color: var(--ink-mid); font-size: 12px; line-height: 1.5; }
.context-set-heading label { display: grid; gap: 6px; }
.context-set-heading label span { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.context-set-customizer { margin-top: 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.context-set-customizer summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 750; }
.context-set-customizer summary small { color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.context-set-options { margin: 0 0 16px; padding: 0; border: 0; }
.context-set-options > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 330px; overflow: auto; border: 1px solid var(--rule); }
.context-set-options label { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px 12px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.context-set-options label:nth-child(3n) { border-right: 0; }
.context-set-options input { width: 17px; min-height: 17px; margin: 2px 0 0; accent-color: var(--vd); }
.context-set-options strong, .context-set-options small { display: block; }
.context-set-options strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.context-set-options small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
.context-set-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; }
.context-set-footer p { margin: 0; color: var(--ink-mid); font-size: 11px; font-weight: 700; }
.structure-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--rule); background: var(--bg); }
.structure-summary > div { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; padding: 12px 14px; border-right: 1px solid var(--rule); }
.structure-summary > div:last-child { border-right: 0; }
.structure-summary strong { grid-row: 1 / 3; align-self: center; font-family: var(--font-family-mono); font-size: 21px; font-variant-numeric: tabular-nums; }
.structure-summary span { align-self: end; font-size: 12px; font-weight: 700; }
.structure-summary small { color: var(--ink-soft); font-size: 10px; }
.access-guide { margin: 0 0 18px; }
.access-guide summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--vd); font-size: 12px; font-weight: 750; }
.access-guide dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; border: 1px solid var(--rule); background: var(--bg); }
.access-guide dl > div { padding: 12px; border-right: 1px solid var(--rule); }
.access-guide dl > div:last-child { border-right: 0; }
.access-guide dt { font-size: 11px; font-weight: 800; }
.access-guide dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.structure-layout, .people-layout, .public-links-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.38fr); align-items: start; border-top: 1px solid var(--rule); }
.sequence-panel, .recipient-panel { min-width: 0; padding: 28px 28px 0 0; }
.section-panel, .recipient-editor { position: sticky; top: calc(var(--studio-header-height) + 55px); min-width: 0; min-height: 500px; padding: 28px 0 28px 28px; border-left: 1px solid var(--rule); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-family: var(--font-family-primary); font-size: 17px; font-style: normal; font-weight: 750; }
.sequence-list, .recipient-list, .public-variant-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.public-variant-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.public-variant-list strong, .public-variant-list span, .public-variant-list code { display: block; }.public-variant-list span { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }.public-variant-list code { margin-top: 8px; overflow-wrap: anywhere; color: var(--ink-mid); font-size: 10px; }
.public-variant-list .public-variant-open-status { margin-top: 8px; color: var(--ink-mid); font-weight: 750; }
.public-variant-list .public-variant-open-status[data-opened="true"] { color: var(--vd); }
.public-variant-list > li > div:last-child { display: flex; align-items: center; gap: 8px; }
.sequence-list > li { display: grid; grid-template-columns: 108px minmax(180px, 1fr) minmax(220px, .72fr) minmax(190px, .62fr); align-items: center; gap: 14px; padding: 12px 10px; border: 1px solid transparent; border-bottom-color: var(--rule); background: transparent; }
.sequence-list > li:hover { border-color: var(--rule); background: var(--bg); }
.sequence-list > li[data-lifecycle="excluded"], .sequence-list > li[data-lifecycle="retired"], .sequence-list > li[data-lifecycle="draft"] { opacity: .62; }
.sequence-position { width: max-content; display: inline-flex; align-items: center; margin-top: 9px; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius-xs); background: var(--surface-base); }
.sequence-copy .sequence-position > span { margin: 0; padding: 0 7px; color: var(--ink-soft); font-size: 9px; font-weight: 750; }
.sequence-position input { width: 48px; min-height: 30px; padding: 0 4px; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: var(--bg); font-family: var(--font-family-mono); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.sequence-position-apply { min-height: 30px; padding: 0 9px; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: var(--ink); color: var(--bg); font-size: 9px; font-weight: 800; }
.sequence-position-apply:hover { background: var(--vd); color: var(--bg); }
.library-status { min-height: 20px; margin: 0 0 10px; color: var(--ink-mid); font-size: 12px; }
.sequence-list img { width: 108px; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); background: var(--surface-base); }
.sequence-copy { min-width: 0; }
.sequence-copy strong, .sequence-copy span { display: block; }
.sequence-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sequence-copy span { margin-top: 5px; color: var(--ink-soft); font-size: 10px; }
.sequence-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sequence-controls select { min-height: 36px; padding: 0 8px; font-size: 10px; }
.sequence-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sequence-actions button { min-height: 30px; padding: 0 8px; border: 1px solid var(--rule); border-radius: var(--radius-xs); background: var(--bg); color: var(--ink-mid); font-size: 9px; font-weight: 700; }
.sequence-actions button:hover:not(:disabled) { border-color: var(--vd); color: var(--vd); }
.sequence-actions button:disabled { cursor: not-allowed; opacity: .38; }
.module-editor { display: grid; gap: 8px; }
.module-editor details { border: 1px solid var(--rule); background: var(--bg); }
.module-editor summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; padding: 0 14px; cursor: pointer; }
.module-editor summary strong { font-size: 12px; }
.module-editor summary span { color: var(--ink-soft); font-size: 10px; }
.module-options { display: grid; max-height: 360px; overflow: auto; padding: 4px 14px 14px; border-top: 1px solid var(--rule); }
.module-options label, [data-recipient-grants] label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 11px; line-height: 1.35; }
.module-options label:last-child, [data-recipient-grants] label:last-child { border-bottom: 0; }
.module-options input, [data-recipient-grants] input { flex: 0 0 auto; width: 16px; min-height: 16px; margin-top: 1px; accent-color: var(--vd); }
.module-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--rule); background: var(--bg); }
.module-context-link { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--ink); border-radius: var(--radius-xs); background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 800; text-decoration: none; }
.module-context-link:hover { border-color: var(--vd); background: var(--vd); }
.module-context-link[aria-disabled="true"] { pointer-events: none; opacity: .45; }

.recipient-toolbar { align-items: end; }
.recipient-toolbar label { width: min(280px, 44%); }
.recipient-list > li { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: center; gap: 18px; min-height: 76px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.recipient-list > li > div:first-child strong, .recipient-list > li > div:first-child span { display: block; }
.recipient-list > li > div:first-child strong { font-size: 13px; }
.recipient-list > li > div:first-child span { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.recipient-list > li[data-status="revoked"] { opacity: .58; }
.recipient-access { display: grid; grid-template-columns: auto minmax(130px, auto) auto; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 10px; }
.recipient-access button { min-height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--radius-xs); background: var(--bg); color: var(--ink); font-size: 10px; font-weight: 700; }
.status-badge { padding: 5px 8px; border: 1px solid var(--rule); border-radius: var(--radius-pill); font-weight: 800; text-transform: uppercase; }
.status-badge[data-status="active"] { border-color: var(--vd); color: var(--vd); }
.recipient-editor form { display: grid; gap: 16px; }
.recipient-editor label { display: grid; gap: 6px; }
.recipient-editor label > span, .grant-fieldset legend { color: var(--ink-mid); font-size: 11px; font-weight: 700; }
.recipient-editor small { color: var(--ink-soft); font-weight: 400; }
.access-consequence { margin: -6px 0 0; padding: 10px 12px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink-mid); font-size: 11px; line-height: 1.5; }
.access-consequence[data-status="revoked"] { border-color: var(--danger); color: var(--danger); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grant-fieldset { margin: 0; padding: 14px; border: 1px solid var(--rule); }
.grant-fieldset > p { margin: 6px 0 10px; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
[data-recipient-grants] label span { min-width: 0; }
[data-recipient-grants] label strong, [data-recipient-grants] label small { display: block; }
[data-recipient-grants] label small { margin-top: 3px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.form-actions p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.empty-message { padding: 20px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }

.button-primary, .button-secondary, .studio-auth-card button, .upload-heading button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
}
.button-secondary { background: transparent; color: var(--ink); }
.button-primary:hover, .studio-auth-card button:hover { border-color: var(--vd); background: var(--vd); }
.button-secondary:hover { border-color: var(--vd); color: var(--vd); }
.review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.review-actions p { flex: 0 0 100%; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; text-align: right; }

.studio-main {
  display: grid;
  grid-template-columns: var(--studio-list-width) var(--studio-inspector-width);
  align-items: start;
}

.import-workbench { grid-column: 1 / -1; min-width: 0; padding: clamp(24px, 4vw, 48px); }
.import-workbench-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.import-workbench-heading h1 { margin: 4px 0 0; font-size: 28px; font-weight: 750; letter-spacing: -.025em; }
.import-workbench-heading p { max-width: 72ch; margin: 8px 0 0; color: var(--ink-mid); font-size: 13px; line-height: 1.55; }
.import-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.import-heading-actions a { color: var(--vd); font-size: 11px; font-weight: 800; text-decoration: none; }
.import-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(150px, .32fr) minmax(150px, .32fr) auto; align-items: end; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.import-toolbar > label { display: grid; gap: 6px; }
.import-toolbar > label > span { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.import-selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; min-height: 42px; }
.import-selection-actions strong { margin-left: auto; color: var(--ink-mid); font-size: 11px; }
.import-status { min-height: 20px; margin: 14px 0 0; color: var(--ink-mid); font-size: 11px; line-height: 1.45; }
.import-candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.import-candidate { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(180px, .84fr) minmax(220px, 1fr); align-items: start; gap: 16px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--bg); }
.import-candidate[data-selected="true"] { border-color: var(--vd); }
.import-candidate[data-status="imported"] { opacity: .62; }
.import-candidate-select { position: absolute; top: 22px; left: 22px; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: var(--radius-xs); background: var(--bg); }
.import-candidate-select input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--vd); }
.import-candidate > img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: contain; border: 1px solid var(--rule); background: var(--surface-base); }
.import-candidate-fields { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.import-candidate-fields label { min-width: 0; display: grid; gap: 5px; }
.import-candidate-fields label:first-child, .import-candidate-fields label:last-of-type, .import-candidate-state { grid-column: 1 / -1; }
.import-candidate-fields label > span { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.import-candidate-fields input, .import-candidate-fields select { min-width: 0; min-height: 38px; font-size: 11px; }
.import-candidate-state { margin: 2px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.import-commit-bar { position: sticky; bottom: 16px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--bg); box-shadow: var(--shadow-lg); }
.import-commit-bar > div { min-width: 0; display: grid; gap: 3px; }
.import-commit-bar strong { color: var(--ink); font-size: 12px; }
.import-commit-bar span { color: var(--ink-mid); font-size: 11px; line-height: 1.4; }
.import-commit-bar .button-primary { flex: 0 0 auto; }

.studio-library { min-width: 0; padding: clamp(24px, 4vw, 48px); }
.library-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.library-toolbar h1 { margin: 3px 0 0; font-family: var(--font-family-primary); font-size: clamp(24px, 3vw, 28px); font-style: normal; font-weight: 750; letter-spacing: -.025em; }
.library-filters { display: grid; grid-template-columns: minmax(180px, 1.4fr) 1fr 1fr auto; align-items: end; gap: 12px; margin: 28px 0 20px; }
.library-filters label, .inspector-fields label, .revision-form > label, .upload-options label { display: grid; gap: 6px; }
.library-filters label > span, .inspector-fields label > span, .revision-form label > span, .upload-options label > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.library-view-switcher { display: grid; gap: 6px; }
.library-view-switcher > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.library-view-switcher > div { display: inline-flex; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius-xs); background: var(--bg); }
.library-view-switcher button { min-height: 40px; padding: 0 11px; border: 0; border-right: 1px solid var(--rule); background: transparent; color: var(--ink-mid); font-size: 10px; font-weight: 800; }
.library-view-switcher button:last-child { border-right: 0; }
.library-view-switcher button:hover { color: var(--vd); }
.library-view-switcher button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
input, select, textarea { width: 100%; border: 1px solid var(--rule); border-radius: 5px; background: var(--bg); color: var(--ink); }
input, select { min-height: 42px; padding: 0 12px; }
textarea { min-height: 110px; padding: 12px; resize: vertical; line-height: 1.5; }

.slide-library-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.slide-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 0 0 13px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  text-align: left;
}
.slide-row:hover { border-color: var(--ink-mid); box-shadow: var(--shadow-sm); }
.slide-row[aria-current="true"] { border-color: var(--vd); box-shadow: 0 0 0 2px color-mix(in srgb, var(--vd) 22%, transparent); }
.slide-row img { grid-column: 1 / -1; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 0; border-bottom: 1px solid var(--rule); background: var(--surface-base); }
.slide-row-copy { min-width: 0; }
.slide-row-copy { padding-left: 13px; }
.slide-row-copy span, .slide-row-copy strong { display: block; }
.slide-row-copy span { color: var(--ink-soft); font-family: var(--font-family-mono); font-size: 10px; }
.slide-row-copy strong { overflow: hidden; margin-top: 4px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.access-badge { justify-self: end; margin-right: 13px; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.slide-library-list[data-view="compact"] { grid-template-columns: 1fr; gap: 8px; }
.slide-library-list[data-view="compact"] .slide-row { grid-template-columns: 132px minmax(0, 1fr) 124px; gap: 16px; padding: 10px; background: transparent; }
.slide-library-list[data-view="compact"] .slide-row:hover { background: color-mix(in srgb, var(--bg) 68%, transparent); box-shadow: none; }
.slide-library-list[data-view="compact"] .slide-row[aria-current="true"] { background: var(--bg); box-shadow: none; }
.slide-library-list[data-view="compact"] .slide-row img { grid-column: auto; width: 132px; border: 1px solid var(--rule); }
.slide-library-list[data-view="compact"] .slide-row-copy { padding-left: 0; }
.slide-library-list[data-view="compact"] .access-badge { margin-right: 0; }
.access-badge[data-access="public"] { border-color: var(--vd); color: var(--vd); }
.access-badge[data-access="nda"] { border-color: var(--matte-deep); color: var(--matte-deep); }
.disclosure-note { margin: 0; padding: var(--spacing-4); background: var(--bg-2); color: var(--ink-mid); font-size: var(--font-size-xs); line-height: 1.55; }

.studio-inspector { position: sticky; top: var(--studio-header-height); min-width: 0; min-height: calc(100vh - var(--studio-header-height)); padding: clamp(24px, 3vw, 40px); border-left: 1px solid var(--rule); background: var(--bg); }
.inspector-preview { overflow: hidden; border: 1px solid var(--rule); background: var(--surface-base); box-shadow: var(--shadow-lg); }
.inspector-preview img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: contain; }
.inspector-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 26px 0 20px; }
.inspector-heading h2 { margin: 3px 0 0; font-family: var(--font-family-emphasis); font-size: clamp(26px, 3vw, 38px); font-style: italic; font-weight: 400; line-height: 1.05; }
.inspector-heading a { flex: 0 0 auto; color: var(--vd); font-size: 11px; font-weight: 700; text-decoration: none; }
.inspector-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inspector-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--rule); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-heading h3 { margin: 0; font-size: 13px; }
.section-heading span { color: var(--ink-soft); font-size: 10px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--vd); font-size: 10px; font-weight: 800; }
.source-list { display: grid; gap: 8px; }
.source-list a { display: block; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 5px; color: var(--ink); font-size: 11px; line-height: 1.4; text-decoration: none; }
.source-list a:hover { border-color: var(--vd); color: var(--vd); }
.source-empty { color: var(--ink-soft); font-size: 12px; }
.revision-form fieldset { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 14px 0; padding: 0; border: 0; }
.revision-form legend { width: 100%; margin-bottom: 4px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.revision-form fieldset label { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.revision-form input[type="checkbox"] { width: 16px; min-height: 16px; accent-color: var(--vd); }
.revision-status, .upload-actions p { min-height: 18px; margin: 10px 0 0; color: var(--ink-soft); font-size: 11px; }
.version-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.version-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 11px; }
.version-list li:last-child { border-bottom: 0; }
.version-list span { color: var(--ink-soft); }
.job-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.job-item { padding: 12px; border: 1px solid var(--rule); border-radius: 6px; background: color-mix(in srgb, var(--bg-2) 52%, transparent); }
.job-item > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job-item strong { font-size: 11px; }
.job-item p { overflow: hidden; margin: 8px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; }
.job-state { padding: 4px 7px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.job-state[data-status="completed"] { border-color: var(--vd); color: var(--vd); }
.job-state[data-status="failed"], .job-error { color: var(--danger) !important; }
.job-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.job-actions a, .job-actions button { color: var(--vd); font-size: 10px; font-weight: 800; text-decoration: none; }
.job-empty { color: var(--ink-soft); font-size: 11px; }

.studio-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-dark); }
.studio-auth-card { width: min(500px, 100%); padding: clamp(30px, 6vw, 64px); background: var(--bg); }
.studio-auth-card > span { display: block; margin-top: 24px; color: var(--vd); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.studio-auth-card h1 { max-width: 9ch; margin: 12px 0 18px; font-family: var(--font-family-emphasis); font-size: clamp(40px, 7vw, 64px); font-style: italic; font-weight: 400; line-height: .98; }
.studio-auth-card > p { color: var(--ink-mid); line-height: 1.6; }
.seed-plan-entry { display: block; width: 100%; margin-top: 24px; padding: 12px 18px; border: 1px solid var(--vd); background: var(--vd); color: var(--paper); font-size: 12px; font-weight: 800; text-align: center; text-decoration: none; }
.seed-plan-entry:hover { border-color: var(--ink); background: var(--ink); }
.studio-auth-status { min-height: 22px; font-size: 12px; }

.upload-dialog { width: min(720px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); color: var(--ink); }
.upload-dialog::backdrop { background: var(--overlay-deep); }
.upload-shell { padding: clamp(24px, 5vw, 44px); }
.upload-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.upload-heading h2 { margin: 3px 0 0; font-family: var(--font-family-emphasis); font-size: 34px; font-style: italic; font-weight: 400; }
.upload-heading button { width: 42px; padding: 0; background: transparent; color: var(--ink); font-size: 20px; }
.upload-shell > p { max-width: 62ch; color: var(--ink-mid); font-size: 13px; line-height: 1.6; }
.upload-drop { display: grid; place-items: center; gap: 7px; margin: 24px 0; padding: 38px 22px; border: 1px dashed var(--vd); background: color-mix(in srgb, var(--vd) 5%, var(--bg)); text-align: center; cursor: pointer; }
.upload-drop input { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.upload-file-action { display: inline-grid; min-height: 44px; place-items: center; padding: 0 18px; border: 1px solid var(--vd); border-radius: 4px; background: var(--vd); color: var(--bg); font-size: 11px; font-weight: 800; }
.upload-drop:hover .upload-file-action { border-color: var(--ink); background: var(--ink); }
.upload-drop:focus-within { outline: 2px solid var(--vd); outline-offset: 3px; }
.upload-drop strong { font-size: 14px; }
.upload-drop > span:last-child { color: var(--ink-soft); font-size: 11px; }
.upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; }

@media (max-width: 1120px) {
  .studio-header { grid-template-columns: 1fr auto; }
  .studio-save-state { display: none; }
  .studio-main { grid-template-columns: 1fr; }
  .import-candidate-grid { grid-template-columns: 1fr; }
  .studio-inspector { position: static; min-height: 0; border-top: 1px solid var(--rule); border-left: 0; }
  .studio-nav { position: static; }
  .structure-summary { grid-template-columns: 1fr 1fr; }
  .structure-summary > div:nth-child(2) { border-right: 0; }
  .structure-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .access-guide dl { grid-template-columns: 1fr 1fr; }
  .access-guide dl > div { border-bottom: 1px solid var(--rule); }
  .access-guide dl > div:nth-child(2n) { border-right: 0; }
  .access-guide dl > div:last-child { border-bottom: 0; }
  .structure-layout, .people-layout, .public-links-layout { grid-template-columns: 1fr; }
  .sequence-panel, .recipient-panel { padding-right: 0; }
  .section-panel, .recipient-editor { position: static; min-height: 0; margin-top: 28px; padding-left: 0; border-top: 1px solid var(--rule); border-left: 0; }
  .sequence-list > li { grid-template-columns: 96px minmax(160px, 1fr) minmax(200px, .8fr); }
  .sequence-list img { width: 96px; }
  .sequence-actions { grid-column: 2 / -1; display: flex; }
}

@media (max-width: 640px) {
  :root { --studio-header-height: 64px; }
  button, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { min-height: 44px; }
  .studio-header { align-items: center; gap: 10px; padding: 8px 14px; }
  .studio-header-actions { gap: 8px; }
  .studio-header-actions > :not([data-save]):not([data-export-menu]) { display: none; }
  .studio-export-menu summary { min-height: 44px; padding-inline: 11px; }
  .studio-export-links { position: fixed; top: calc(var(--studio-header-height) - 2px); right: 14px; width: min(250px, calc(100vw - 28px)); }
  .studio-header-actions .button-primary { min-height: 44px; padding-inline: 12px; }
  .studio-nav { overflow-x: auto; padding: 8px 14px; }
  .studio-nav button { flex: 0 0 auto; min-height: 44px; }
  .control-view { padding: 24px 14px; }
  .control-heading { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .import-workbench { padding: 24px 14px; }
  .import-workbench-heading { align-items: stretch; flex-direction: column; }
  .import-heading-actions { align-items: stretch; flex-direction: column; }
  .import-heading-actions .button-secondary { width: 100%; }
  .import-toolbar { grid-template-columns: 1fr; }
  .import-selection-actions { align-items: flex-start; flex-direction: column; }
  .import-selection-actions strong { margin-left: 0; }
  .import-candidate { grid-template-columns: 1fr; }
  .import-candidate-fields { grid-template-columns: 1fr; }
  .import-candidate-fields label { grid-column: 1; }
  .import-commit-bar { bottom: 10px; align-items: stretch; flex-direction: column; gap: 10px; }
  .import-commit-bar .button-primary { width: 100%; }
  .deck-availability { align-items: flex-start; flex-direction: column; }
  .context-set-heading { grid-template-columns: 1fr; }
  .context-set-customizer summary { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }
  .context-set-options > div { grid-template-columns: 1fr; }
  .context-set-options label { min-height: 44px; border-right: 0; }
  .context-set-footer { align-items: stretch; flex-direction: column; }
  .control-heading .button-primary { align-self: flex-start; }
  .review-actions { justify-content: flex-start; width: 100%; }
  .review-actions .button-primary, .review-actions .button-secondary { flex: 1 1 180px; }
  .review-actions p { text-align: left; }
  .structure-summary { grid-template-columns: 1fr 1fr; }
  .structure-summary > div { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .structure-summary > div:nth-child(2n) { border-right: 0; }
  .structure-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
  .structure-summary > div:last-child { border-bottom: 0; }
  .access-guide dl { grid-template-columns: 1fr; }
  .access-guide dl > div { border-right: 0; }
  .sequence-list > li { grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
  .sequence-list img { width: 78px; }
  .sequence-controls, .sequence-actions { grid-column: 1 / -1; }
  .sequence-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .sequence-position input, .sequence-position-apply, .sequence-controls select, .sequence-actions button, .recipient-access button { min-height: 44px; }
  .module-options label, [data-recipient-grants] label { min-height: 44px; align-items: center; }
  .revision-form fieldset label, .source-list a { min-height: 44px; align-items: center; }
  .recipient-toolbar { align-items: stretch; flex-direction: column; }
  .recipient-toolbar label { width: 100%; }
  .recipient-list > li { grid-template-columns: 1fr; }
  .public-variant-list > li { grid-template-columns: 1fr; }.public-variant-list > li > div:last-child { align-items: stretch; flex-direction: column; }
  .recipient-access { grid-template-columns: auto 1fr auto; }
  .field-pair { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .studio-library, .studio-inspector { padding: 20px 14px; }
  .library-filters, .inspector-fields, .upload-options { grid-template-columns: 1fr; }
  .library-view-switcher > div { width: 100%; }
  .library-view-switcher button { flex: 1 1 50%; min-height: 44px; }
  .slide-library-list { grid-template-columns: 1fr; }
  .slide-library-list[data-view="compact"] .slide-row { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; }
  .slide-library-list[data-view="compact"] .slide-row img { width: 104px; }
  .slide-library-list[data-view="compact"] .access-badge { display: none; }
  .upload-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
