:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #12213c;
  background: #f1f5fa;
  font-synthesis: none;
  --blue: #1769df;
  --blue-dark: #174cae;
  --blue-soft: #eaf2ff;
  --green: #16a56b;
  --amber: #ed9b17;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --text: #12213c;
  --muted: #66758d;
  --border: #dce4ef;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-width: 320px; background: #f1f5fa; color: var(--text); }
button, select, input { font: inherit; }
[hidden] { display: none !important; }

html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #172033;
  --surface-soft: #1d2940;
  --text: #f3f7fc;
  --muted: #a9b5c8;
  --border: #34445f;
  background: #0f1726;
}
html[data-theme="dark"] body { background: #0f1726; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid #e2e8f1; background: var(--surface); box-shadow: 4px 0 18px rgba(29, 56, 91, .04); }
.brand { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.brand-mark { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #3479ee, #174caf); color: white; font-size: .76rem; font-weight: 850; box-shadow: 0 7px 16px rgba(23, 105, 223, .28); }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: .9rem; }
.brand small { color: var(--muted); font-size: .68rem; font-weight: 550; }
.sidebar-context { display: flex; width: calc(100% - 4px); align-items: center; gap: 10px; margin: 25px 2px 30px; padding: 12px; border: 1px solid #d9e7fb; border-radius: 10px; background: #f3f7fe; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.sidebar-context:hover, .sidebar-context.is-active { border-color: #bcd5fa; background: #edf4ff; box-shadow: 0 5px 14px rgba(23, 105, 223, .08); }
.context-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; background: #dfeaff; color: var(--blue); font-weight: 850; }
.sidebar-context .context-copy { display: grid; gap: 2px; }
.sidebar-context strong { color: #234063; font-size: .75rem; }
.sidebar-context small { color: #74859d; font-size: .66rem; }
.nav-label { margin: 0 10px 8px; color: #96a4b7; font-size: .62rem; font-weight: 850; letter-spacing: .12em; }
nav { display: grid; gap: 4px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: #40536d; font-size: .78rem; font-weight: 700; text-align: left; cursor: pointer; transition: .16s ease; }
.nav-item:hover { background: #f1f5fb; color: var(--blue); }
.nav-item.active { background: #e8f1ff; color: #155ec9; box-shadow: inset 3px 0 #1769df; }
.nav-icon { display: grid; width: 20px; place-items: center; color: var(--blue); font-size: 1rem; }
.sidebar-foot { position: absolute; right: 14px; bottom: 20px; left: 14px; display: flex; align-items: flex-start; gap: 9px; padding: 12px 10px; border-top: 1px solid var(--border); }
.status-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #20b66f; box-shadow: 0 0 0 4px rgba(32, 182, 111, .11); }
.sidebar-foot div { display: grid; gap: 2px; }
.sidebar-foot strong { font-size: .68rem; }
.sidebar-foot small { color: var(--muted); font-size: .62rem; }

main { min-width: 0; padding: 25px clamp(22px, 3.2vw, 48px) 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 21px; }
.eyebrow { margin: 0 0 4px; color: var(--blue); font-size: .66rem; font-weight: 850; letter-spacing: .1em; }
.topbar h1 { margin: 0; color: var(--text); font-size: clamp(1.55rem, 2.3vw, 2rem); line-height: 1.15; letter-spacing: -.035em; }
.welcome { margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.theme-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: #53647b; cursor: pointer; box-shadow: 0 3px 9px rgba(32, 54, 82, .05); }
.theme-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.page-view { animation: view-in .2s ease; }

.matrix-card { overflow: hidden; border: 1px solid #d9e3ef; border-radius: 14px; background: var(--surface); box-shadow: 0 10px 30px rgba(26, 57, 91, .07); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.section-tag { color: var(--blue); font-size: .64rem; font-weight: 900; letter-spacing: .11em; }
.card-heading h2 { margin: 5px 0 3px; font-size: 1.08rem; }
.card-heading p { margin: 0; color: var(--muted); font-size: .72rem; }
.period-pill { display: flex; align-items: center; gap: 9px; padding: 7px 9px 7px 12px; border: 1px solid #cbdcf4; border-radius: 9px; background: #f4f8fe; color: #526984; font-size: .68rem; font-weight: 700; }
.period-pill strong { padding: 5px 8px; border-radius: 6px; background: var(--blue); color: white; font-size: .76rem; }
.period-pill .period-value { color: #264b78; font-size: .7rem; font-weight: 850; }
.matrix-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.matrix-summary > div { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 14px 19px; border-right: 1px solid #e7edf4; }
.matrix-summary > div:last-child { border-right: 0; }
.summary-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 8px; font-size: .72rem; font-weight: 900; }
.summary-icon.blue { background: #e5efff; color: #1769df; }
.summary-icon.green { background: #e3f5eb; color: #159b60; }
.summary-icon.amber { background: #fff2d9; color: #e18b00; }
.summary-icon.slate { background: #edf1f6; color: #6d7c90; }
.matrix-summary p { display: grid; min-width: 0; gap: 2px; margin: 0; }
.matrix-summary small { overflow: hidden; color: #75849a; font-size: .62rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.matrix-summary strong { overflow: hidden; color: #172640; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }

.table-scroll { overflow-x: auto; padding: 20px 24px 15px; }
.week-table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; table-layout: fixed; color: #21344f; font-size: .72rem; }
.week-table th, .week-table td { border-right: 1px solid #dce4ed; border-bottom: 1px solid #dce4ed; }
.week-table tr > :first-child { border-left: 1px solid #dce4ed; }
.week-table thead tr:first-child th { border-top: 1px solid #dce4ed; }
.week-table thead th { padding: 9px 7px; background: #eef3f9; color: #53657c; font-size: .62rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.week-table thead tr:first-child th:first-child { border-radius: 8px 0 0; }
.week-table thead tr:first-child th:last-child { border-radius: 0 8px 0 0; }
.scope-heading { width: 78px; }
.mechanism-heading { width: 105px; }
.number-heading { width: 48px; }
.activity-heading { width: auto; }
.year-heading { background: linear-gradient(90deg, #266ed6, #1c58b4) !important; color: white !important; font-size: .72rem !important; }
.block-heading { width: 150px; background: #1f61c4 !important; color: white !important; }
.participation-heading { width: 92px; background: #174f9f !important; color: white !important; }
.scope-cell { position: relative; background: #f3f6fa; color: #61728a; }
.scope-cell span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); font-size: .67rem; font-weight: 850; letter-spacing: .07em; white-space: nowrap; }
.mechanism-cell { background: #f7f9fc; color: #315071; text-align: center; }
.mechanism-cell > * { display: block; margin-inline: auto; }
.mechanism-mark { width: 32px; margin-bottom: 7px; border-radius: 8px; background: #e2edff; padding: 7px 0; color: var(--blue); font-size: .7rem; font-weight: 900; }
.mechanism-cell strong { font-size: .7rem; }
.number-cell { background: #f5f8fc; color: #60728a; font-size: .68rem; font-weight: 850; text-align: center; }
.activity-cell { padding: 0; background: var(--surface); color: var(--text); text-align: left; }
.activity-button { display: flex; width: 100%; min-height: 64px; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 13px; border: 0; border-left: 3px solid transparent; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: .15s ease; }
.activity-button:hover { border-left-color: #72a8f4; background: #f8fbff; }
.activity-button[aria-expanded="true"] { border-left-color: var(--blue); background: #f2f7ff; }
.activity-copy { display: grid; gap: 4px; }
.activity-copy strong { color: #203550; font-size: .74rem; line-height: 1.3; }
.activity-copy small { color: #8290a3; font-size: .62rem; font-weight: 600; }
.open-detail { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; border: 1px solid #d5e0ee; border-radius: 999px; background: white; padding: 5px 8px 5px 10px; color: #526b8c; font-size: .6rem; font-weight: 750; white-space: nowrap; }
.open-detail b { color: var(--blue); font-size: .82rem; line-height: 1; }
.open-detail.automatic { border-color: #e8d7b5; background: #fffbf1; color: #8b681f; }
.metric-cell { background: var(--surface); color: #a0adbd; font-size: .82rem; font-weight: 800; text-align: center; }
.metric-cell span { display: inline-grid; min-width: 30px; place-items: center; border-radius: 6px; background: #f3f6fa; padding: 5px; }
.participation-cell { background: #f8fbff; color: #2367bc; font-size: .76rem; font-weight: 850; text-align: center; }
.participation-cell span { display: inline-grid; min-width: 42px; place-items: center; border-radius: 999px; background: #e9f2ff; padding: 5px 8px; white-space: nowrap; }
.subset-row { animation: subset-in .18s ease; }
.subset-row[hidden] { display: none; }
.subset-index { background: #f2f7ff; color: #6191d1; font-size: .61rem; font-weight: 800; text-align: center; }
.subset-name { position: relative; padding: 10px 13px 10px 34px; background: #f7faff; color: #385270; font-size: .69rem; text-align: left; }
.subset-name:before { position: absolute; content: ''; left: 16px; top: 0; width: 9px; height: 50%; border-bottom: 1px solid #9dbde7; border-left: 1px solid #9dbde7; }
.subset-name span { display: block; }
.subset-name small { display: inline-block; margin-top: 4px; border-radius: 999px; background: #e4efff; padding: 3px 7px; color: #3975c6; font-size: .55rem; font-weight: 800; }
.subset-metric { height: 48px; background: #fbfdff; color: #9eabbc; font-size: .75rem; font-weight: 750; text-align: center; }
.subset-participation { height: 48px; background: #f6faff; color: #3975c6; font-size: .7rem; font-weight: 800; text-align: center; white-space: nowrap; }
.automatic-row .subset-name { background: #fffaf0; }
.automatic-row .subset-name:before { border-color: #d9b96f; }
.automatic-row .subset-name small { background: #fff0c9; color: #8b681f; }
.automatic-row .subset-index, .automatic-row .subset-metric, .automatic-row .subset-participation { background: #fffcf5; }
.load-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(430px, 1.28fr); gap: 30px; align-items: start; }
.load-intro { padding: 25px 8px; }
.load-intro h2 { max-width: 460px; margin: 8px 0 10px; font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.13; letter-spacing: -.035em; }
.load-intro > p { max-width: 470px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.steps { display: grid; gap: 16px; margin-top: 32px; }
.step { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.step > span { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: .7rem; font-weight: 850; }
.step div { display: grid; gap: 2px; }
.step strong { color: var(--text); font-size: .75rem; }
.step small { font-size: .65rem; }
.step.is-current > span { border-color: var(--blue); background: var(--blue); color: white; box-shadow: 0 6px 13px rgba(23, 105, 223, .22); }
.upload-card { display: grid; gap: 9px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 30px rgba(26, 57, 91, .07); }
.form-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.form-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 9px; background: #e5efff; color: var(--blue); font-size: 1rem; font-weight: 900; }
.form-heading h3 { margin: 0; font-size: 1rem; }
.form-heading p { margin: 3px 0 0; color: var(--muted); font-size: .67rem; }
.form-callout, .privacy-note { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border-radius: 8px; font-size: .65rem; }
.form-callout { border: 1px solid #efdfbd; background: #fffbf2; color: #765c29; }
.form-callout > span, .privacy-note > span { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border-radius: 50%; font-size: .64rem; font-weight: 900; }
.form-callout > span { background: #f7e7c4; }
.form-callout p, .privacy-note p { margin: 0; line-height: 1.45; }
.upload-card > label { margin-top: 5px; color: #354961; font-size: .7rem; font-weight: 800; }
.select-wrap { position: relative; }
.select-wrap:after { position: absolute; content: '⌄'; right: 13px; top: 50%; color: #75849a; pointer-events: none; transform: translateY(-55%); }
select { width: 100%; height: 42px; appearance: none; border: 1px solid #d5dfeb; border-radius: 8px; background: #fbfcfe; padding: 0 36px 0 12px; color: var(--text); font-size: .73rem; }
select:focus { outline: 3px solid rgba(23, 105, 223, .12); border-color: var(--blue); }
select:disabled { opacity: .58; }
.period-field select:disabled { opacity: 1; color: var(--text); cursor: not-allowed; }
.period-field { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 9px; }
.detected-block { display: grid; place-items: center; border: 1px solid #c9dbf3; border-radius: 8px; background: #edf4ff; text-align: center; }
.detected-block small { color: #6680a1; font-size: .54rem; font-weight: 800; text-transform: uppercase; }
.detected-block strong { color: #155ec9; font-size: .82rem; }
.period-help { margin: -2px 0 1px; color: #6f8198; font-size: .61rem; line-height: 1.4; }
.period-help.is-error { color: #b33a3a; }
.block-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.block-options label { cursor: pointer; }
.block-options input { position: absolute; opacity: 0; pointer-events: none; }
.block-options span { display: grid; height: 39px; place-items: center; border: 1px solid #d7e0eb; border-radius: 8px; background: #fbfcfe; color: #66778e; font-size: .71rem; font-weight: 850; }
.block-options input:checked + span { border-color: var(--blue); background: #eaf2ff; color: #155ec9; box-shadow: 0 0 0 2px rgba(23, 105, 223, .1); }
.drop-zone { display: flex; min-height: 160px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed #afc1d8; border-radius: 10px; background: #f8fafd; color: var(--text); text-align: center; cursor: pointer; transition: .15s; }
.drop-zone:hover, .drop-zone.has-file { border-color: var(--blue); background: #f2f7ff; }
.excel-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; background: #e2f5ea; color: #188b56; font-size: .82rem; font-weight: 900; }
.drop-zone strong { font-size: .75rem; }
.drop-zone > span:not(.excel-icon):not(.browse-button) { color: var(--muted); font-size: .64rem; }
.browse-button { margin-top: 4px; border: 1px solid #cad8e8; border-radius: 7px; background: white; padding: 6px 10px; color: #2d609d; font-size: .66rem; font-weight: 800; }
.file-rules { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); padding: 10px 12px; }
.file-rules > strong { font-size: .68rem; }
.file-rules ul { display: grid; gap: 3px; margin: 6px 0 0; padding-left: 17px; color: var(--muted); font-size: .62rem; line-height: 1.4; }
.selection-summary { display: grid; gap: 3px; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; background: #edf4ff; padding: 9px 11px; }
.selection-summary span { color: #5f7797; font-size: .58rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.selection-summary strong { color: #31547f; font-size: .66rem; line-height: 1.4; }
.privacy-note { background: #edf8f2; color: #356b52; }
.privacy-note > span { background: #d8eee2; color: #138252; }
.primary-button { height: 42px; margin-top: 3px; border: 0; border-radius: 8px; background: linear-gradient(90deg, #1d72e8, #175dc5); color: white; font-size: .73rem; font-weight: 850; cursor: pointer; box-shadow: 0 7px 15px rgba(23, 105, 223, .2); }
.primary-button:hover { filter: brightness(.97); }
.form-status { min-height: 17px; margin: 0; color: var(--muted); font-size: .64rem; text-align: center; }
.form-status.error { color: #b83232; }
.form-status.success { color: #13794b; }
.primary-button:disabled, .confirm-button:disabled { cursor: not-allowed; opacity: .58; box-shadow: none; }
.preview-panel { display: grid; gap: 12px; margin-top: 8px; border: 1px solid #d7e2ef; border-radius: 11px; background: #fbfcfe; padding: 16px; }
.preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.preview-heading span { color: var(--blue); font-size: .57rem; font-weight: 900; letter-spacing: .1em; }
.preview-heading h4 { margin: 3px 0 0; font-size: .85rem; }
.preview-heading > small { border-radius: 999px; background: #e8f1ff; padding: 5px 8px; color: #2763ad; font-size: .58rem; font-weight: 800; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview-stat { display: grid; gap: 2px; border: 1px solid transparent; border-radius: 8px; padding: 9px 11px; font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.preview-stat:hover:not(:disabled) { transform: translateY(-1px); }
.preview-stat:focus-visible { outline: 3px solid rgba(29, 114, 232, .2); outline-offset: 2px; }
.preview-stat[aria-pressed="true"] { border-color: currentColor; box-shadow: 0 5px 12px rgba(31, 52, 80, .12); }
.preview-stats small { font-size: .58rem; font-weight: 750; }
.preview-stats strong { font-size: 1rem; }
.preview-stats .valid { background: #e9f7ef; color: #147b4c; }
.preview-stats .warning { background: #fff6df; color: #9a6810; }
.preview-stats .error { background: #fff0f0; color: #ad3c3c; }
.preview-table-wrap { max-height: 270px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: .63rem; }
.preview-table th { position: sticky; top: 0; z-index: 1; background: #eef3f9; padding: 8px; color: #52657d; text-align: left; }
.preview-table td { border-top: 1px solid #e6ecf3; padding: 8px; color: #53647a; }
.preview-table th:first-child, .preview-table td:first-child { width: 44px; text-align: center; }
.preview-table .empty-row { padding: 24px 12px; color: #718096; text-align: center; }
.validation-badge { display: inline-block; border-radius: 999px; padding: 4px 7px; font-size: .55rem; font-weight: 850; white-space: nowrap; }
.validation-badge.valid { background: #dff3e8; color: #147b4c; }
.validation-badge.not_in_period { background: #fff0c9; color: #8c6413; }
.validation-badge.not_in_canvas { background: #ffe1e1; color: #a63232; }
.preview-note { margin: 0; color: #697a90; font-size: .62rem; line-height: 1.45; }
.confirm-button { height: 40px; border: 0; border-radius: 8px; background: #15965d; color: white; font-size: .7rem; font-weight: 850; cursor: pointer; box-shadow: 0 7px 15px rgba(21, 150, 93, .18); }
.confirmation-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 28, 45, .56); backdrop-filter: blur(3px); }
.confirmation-modal[hidden] { display: none; }
.confirmation-card { width: min(720px, 100%); max-height: min(780px, calc(100vh - 40px)); overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 22px; box-shadow: 0 24px 70px rgba(10, 24, 43, .28); }
.confirmation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.confirmation-heading span { color: var(--blue); font-size: .57rem; font-weight: 900; letter-spacing: .1em; }
.confirmation-heading h2 { margin: 4px 0 0; font-size: 1rem; }
.confirmation-heading button { border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.confirmation-total { margin: 16px 0; border-left: 3px solid #15965d; border-radius: 0 8px 8px 0; background: #edf8f2; padding: 12px; color: #356b52; font-size: .7rem; line-height: 1.5; }
.confirmation-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.confirmation-groups section { min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 12px; }
.confirmation-groups h3 { margin: 0 0 9px; font-size: .7rem; }
.confirmation-groups ul { max-height: 210px; overflow: auto; display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.confirmation-groups li { display: grid; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 0 7px; font-size: .62rem; }
.confirmation-groups li strong { overflow-wrap: anywhere; }
.confirmation-groups li span { color: var(--muted); }
.confirmation-groups .confirmation-empty { border: 0; color: var(--muted); }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.confirmation-actions button { min-width: 130px; padding-inline: 15px; }
.secondary-button { height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: .7rem; font-weight: 800; cursor: pointer; }

html[data-theme="dark"] .sidebar-context, html[data-theme="dark"] .matrix-summary, html[data-theme="dark"] .week-table thead th, html[data-theme="dark"] .number-cell, html[data-theme="dark"] .scope-cell, html[data-theme="dark"] .mechanism-cell, html[data-theme="dark"] .metric-cell, html[data-theme="dark"] .participation-cell, html[data-theme="dark"] .subset-name, html[data-theme="dark"] .subset-index, html[data-theme="dark"] .subset-metric, html[data-theme="dark"] .subset-participation { background: var(--surface-soft); color: var(--text); }
html[data-theme="dark"] .activity-copy strong, html[data-theme="dark"] .matrix-summary strong { color: var(--text); }
html[data-theme="dark"] .open-detail, html[data-theme="dark"] .browse-button { background: #22314b; color: #c7d7eb; }

@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes subset-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

@media (max-width: 1050px) {
  .load-layout { grid-template-columns: 1fr; }
  .load-intro { padding-bottom: 0; }
  .steps { grid-template-columns: repeat(3, 1fr); margin-top: 23px; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; height: auto; grid-template-columns: 1fr auto; align-items: center; padding: 13px 15px; }
  .sidebar-context, .nav-label, .sidebar-foot { display: none; }
  nav { display: block; }
  .nav-item { width: auto; }
  main { padding: 21px 14px 35px; }
  .card-heading { align-items: flex-start; padding: 18px; }
  .table-scroll { padding: 15px 12px; }
  .matrix-note { margin-inline: 12px; }
  .steps { gap: 7px; }
  .step { gap: 7px; }
  .step small { display: none; }
  .upload-card { padding: 18px; }
}

@media (max-width: 480px) {
  .matrix-summary { grid-template-columns: 1fr; }
  .matrix-summary > div { border-right: 0; border-bottom: 1px solid #e7edf4; }
  .period-pill .period-label { display: none; }
  .steps { grid-template-columns: 1fr; }
  .step small { display: block; }
  .open-detail { font-size: 0; padding-left: 7px; }
  .open-detail b { font-size: .82rem; }
  .confirmation-groups { grid-template-columns: 1fr; }
  .confirmation-actions { flex-direction: column-reverse; }
  .confirmation-actions button { width: 100%; }
}
