:root {
  --canvas: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #122033;
  --muted: #667085;
  --line: #dde3ea;
  --navy: #0b1830;
  --navy-soft: #172744;
  --blue: #235bd7;
  --blue-dark: #1747b0;
  --blue-soft: #eaf0ff;
  --green: #168467;
  --green-soft: #e7f5ef;
  --amber: #a46212;
  --amber-soft: #fff2dc;
  --red: #bb3140;
  --red-soft: #ffebed;
  --shadow: 0 12px 30px rgba(17, 32, 55, 0.07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(35, 91, 215, 0.35); outline-offset: 3px; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; color: #fff; background: var(--blue); border-radius: 8px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 238px; padding: 31px 20px 24px; color: #d8e2f5; background: var(--navy); }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0 8px 52px; color: #fff; text-decoration: none; }
.brand img { display: block; width: 100%; max-width: 190px; height: auto; }

.nav-label { margin: 0 12px 12px; color: #6f86aa; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
nav { display: grid; gap: 6px; }
nav a { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 10px 13px; color: #aebdd6; border-radius: 9px; font-weight: 650; text-decoration: none; }
nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
nav a[aria-current="page"] { color: #fff; background: var(--navy-soft); box-shadow: inset 3px 0 #5886ff; }
.nav-icon { width: 21px; height: 21px; flex-shrink: 0; color: #83a4f0; }
.privacy-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: #44d3aa; border-radius: 50%; }
.workspace { min-height: 100vh; margin-left: 238px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; padding: 0 42px; background: rgba(255,255,255,.8); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; max-width: 460px; }
.topbar-search input { min-width: 0; }
.profile { flex-shrink: 0; display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 650; text-decoration: none; }
.profile > span { text-align: right; max-width: 150px; overflow-wrap: anywhere; display: flex; flex-direction: column; line-height: 1.25; }
.profile small { color: var(--muted); font-size: 10px; font-weight: 500; }
.avatar { display: block; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.main { width: min(1240px, calc(100% - 80px)); margin: 0 auto; padding: 54px 0 120px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.038em; }
h2 { margin-bottom: 10px; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; font-size: 16px; }
.eyebrow { margin-bottom: 12px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.muted, .help { color: var(--muted); }
.help { margin: 7px 0 0; font-size: 12px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.page-heading > div:first-child { max-width: 770px; }
.page-heading > div > p:last-child { margin-bottom: 0; font-size: 16px; }
.module-heading h1 { overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 40px 0 18px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.section-heading > p { max-width: 520px; color: var(--muted); font-size: 13px; }
.section-block { margin-top: 48px; }

.panel, .module-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(17,32,55,.02); }
.panel { padding: 28px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading h2, .panel-heading p { margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 9px 16px; color: var(--ink); background: var(--surface); border: 1px solid #cbd3df; border-radius: 9px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; }
.button:hover { background: #f5f7fa; border-color: #aeb9c8; }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 7px 16px rgba(35,91,215,.2); }
.button.primary:hover { background: var(--blue-dark); }
.button.light { color: var(--navy); background: #fff; border-color: #fff; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.button.wide { width: 100%; }
.button:disabled { color: #8e98a7; background: #e7eaf0; border-color: #e0e4e9; box-shadow: none; cursor: not-allowed; }
.text-link, .text-button { color: var(--blue); background: transparent; border: 0; font-weight: 700; text-decoration: none; cursor: pointer; }
.text-link:hover, .text-button:hover { text-decoration: underline; }
.text-button.danger { color: var(--red); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.badge.neutral { color: #586275; background: #edf0f4; }
.badge.blue { color: var(--blue-dark); background: var(--blue-soft); }
.badge.success { color: #0d6b53; background: var(--green-soft); }
.badge.warning { color: var(--amber); background: var(--amber-soft); }

.filter-bar { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 27px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.search-field { flex: 1; }
.search-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.filter-options { display: flex; align-items: center; gap: 16px; }
label { display: grid; gap: 7px; color: #364154; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 43px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #cbd3df; border-radius: 8px; }
input:hover, select:hover, textarea:hover { border-color: #9faaba; }
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; cursor: pointer; }
.checkbox input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.full-width { grid-column: 1 / -1; }
.form-action { display: flex; align-items: flex-end; }
.optional { color: var(--muted); font-weight: 500; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { display: flex; align-items: center; padding: 0 0 0 12px; color: #576377; background: #f2f4f7; border: 1px solid #cbd3df; border-right: 0; border-radius: 8px 0 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prefix-input input { border-radius: 0 8px 8px 0; border-left: 0; padding-left: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-layout, .preview-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 24px; align-items: start; }
.form-card { padding: 34px; }
.form-section { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 10px 0 34px; }
.form-section + .form-section { padding-top: 34px; border-top: 1px solid var(--line); }
.form-section > div { max-width: 670px; }
.step-number { display: grid; place-items: center; width: 34px; height: 34px; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 11px; font-weight: 800; }
.form-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--line); }
.side-note { color: #415067; background: #f7f9fc; }
.numbered-list { padding: 0; margin: 24px 0 0; list-style: none; }
.numbered-list li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.numbered-list li > span { display: grid; place-items: center; align-self: start; width: 25px; height: 25px; color: var(--blue); background: #fff; border: 1px solid #dbe2ed; border-radius: 50%; font-size: 10px; font-weight: 800; }
.numbered-list li p { margin-bottom: 23px; font-size: 13px; }
.numbered-list strong { display: block; color: var(--ink); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.module-card { display: flex; flex-direction: column; min-height: 315px; padding: 23px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.module-card:hover { transform: translateY(-2px); border-color: #c9d4e8; box-shadow: var(--shadow); }
.module-card.selected { border-color: #8eacf2; box-shadow: inset 0 0 0 1px #8eacf2; }
.card-top, .card-actions, .workflow-title, .source-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.module-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; color: var(--blue); background: var(--blue-soft); border-radius: 11px; font-size: 12px; font-weight: 850; letter-spacing: .05em; }
.project-symbol { color: #7251b5; background: #f1eafd; }
.module-card h2 { margin: 22px 0 8px; font-size: 18px; overflow-wrap: anywhere; }
.module-card h2 a { text-decoration: none; }
.card-description { min-height: 48px; color: var(--muted); font-size: 13px; }
.card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: auto 0 22px; padding-top: 18px; border-top: 1px solid #edf0f4; }
.card-meta div { min-width: 0; }
.card-meta dt, .meta-label { display: block; margin-bottom: 3px; color: #8993a2; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card-meta dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.card-actions { align-items: center; }
.card-actions form { margin: 0; }
.selection-button { min-height: 35px; padding: 6px 10px; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 8px; font-size: 11px; font-weight: 800; cursor: pointer; }
.selection-tray { position: fixed; right: 34px; bottom: 26px; left: 272px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 920px; margin: 0 auto; padding: 15px 17px; color: #fff; background: rgba(11,24,48,.96); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; box-shadow: 0 18px 45px rgba(9,20,42,.25); backdrop-filter: blur(12px); }
.selection-tray > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.selection-tray p { display: flex; flex-direction: column; margin: 0; min-width: 0; }
.selection-tray small { color: #91a3c1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-count { display: grid; place-items: center; width: 35px; height: 35px; color: var(--navy); background: #fff; border-radius: 10px; font-weight: 850; }
.empty-state { padding: 60px 28px; text-align: center; }
.empty-state > p { max-width: 520px; margin-right: auto; margin-left: auto; color: var(--muted); }
.empty-state.compact { padding: 26px; }
.empty-state.compact p { margin-bottom: 0; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; color: var(--blue); background: var(--blue-soft); border-radius: 16px; font-size: 23px; }

.source-strip { display: grid; grid-template-columns: minmax(280px, 1.2fr) repeat(2, minmax(140px, .45fr)); gap: 18px; align-items: end; margin-bottom: 24px; padding: 20px; background: var(--navy); color: #fff; border-radius: 14px; }
.source-strip code { color: #bcd0ff; }
.source-strip .meta-label { color: #8295b6; }
.ref-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; }
.ref-form label { grid-column: 1 / -1; color: #aebdd6; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 24px; align-items: start; }
.detail-side { display: grid; gap: 24px; }
.readme-panel { min-width: 0; }
.readme { max-height: 650px; margin: 0; padding: 22px; overflow: auto; color: #26334a; background: #f6f8fb; border: 1px solid #e7ebf0; border-radius: 11px; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: minmax(90px, .6fr) minmax(0, 1.4fr); gap: 11px 15px; margin: 20px 0 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.facts code { font-size: 11px; word-break: break-all; }
.facts.prominent { padding: 19px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts.full { width: 100%; grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
.workflow-list, .source-list { display: grid; gap: 14px; }
.workflow-card { padding: 23px; }
.workflow-title code { color: var(--muted); font-size: 11px; }
.grant-form { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 13px 15px; background: var(--surface-soft); border-radius: 9px; }
.workflow-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.workflow-form .form-grid { margin: 15px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th { padding: 12px 17px; color: #7b8697; background: #f7f8fa; font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 17px; border-top: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); }
.table-panel { padding: 0; overflow: hidden; }

.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 28px; color: #8b95a4; font-size: 12px; font-weight: 750; }
.flow-steps > :is(span, a) { position: relative; display: flex; align-items: center; gap: 9px; }
.flow-steps > :is(span, a)::after { content: ""; height: 1px; flex: 1; margin-right: 10px; background: #d6dce5; }
.flow-steps > :last-child::after { display: none; }
.flow-steps b { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #c8d0dc; border-radius: 50%; }
.flow-steps .done, .flow-steps .current { color: var(--blue); }
.flow-steps .done b { color: #fff; background: var(--blue); border-color: var(--blue); }
.flow-steps .current b { border-color: var(--blue); }
.project-basics { max-width: 800px; }
.source-card { padding: 24px; }
.source-card-title { justify-content: flex-start; margin-bottom: 22px; }
.source-card-title h3, .source-card-title p { margin-bottom: 0; }
.source-card-title p { color: var(--muted); }
.sticky-actions { position: sticky; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 14px 16px; background: rgba(255,255,255,.93); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }

.preview-summary { padding: 34px; }
.preview-summary h2 { font-size: 28px; overflow-wrap: anywhere; }
.preview-copy { margin-top: 26px; }
.preview-copy p { white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-module { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.preview-module p { margin-bottom: 8px; white-space: pre-wrap; }
.source-label { color: var(--muted); font-size: 11px; }
.confirm-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding: 20px 23px; color: #fff; background: var(--navy); border-radius: 14px; }
.confirm-bar p { display: flex; flex-direction: column; margin: 0; }
.confirm-bar small { color: #9aabc7; }
.confirm-copy { display: grid; gap: 13px; min-width: 0; }
.release-check { align-items: flex-start; min-height: 0; color: #dbe5f6; white-space: normal; }
.release-check a { color: #fff; }
.release-evidence { color: #aebdd6; font-size: 11px; }
.release-evidence summary { width: fit-content; cursor: pointer; }
.release-evidence dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 10px 0 0; }
.release-evidence dd { margin: 0; overflow-wrap: anywhere; }
.release-evidence code { color: #dce7ff; word-break: break-all; }

.status { display: inline-flex; align-items: center; gap: 7px; min-height: 29px; padding: 4px 10px; color: #526075; background: #edf0f4; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status > span { width: 7px; height: 7px; background: #8792a2; border-radius: 50%; }
.status-running { color: var(--blue-dark); background: var(--blue-soft); }
.status-running > span { background: var(--blue); animation: pulse 1.5s infinite; }
.status-completed { color: #0d6b53; background: var(--green-soft); }
.status-completed > span { background: var(--green); }
.status-failed, .status-needs_attention { color: var(--red); background: var(--red-soft); }
.status-failed > span, .status-needs_attention > span { background: var(--red); }
.status-awaiting_github_access { color: var(--amber); background: var(--amber-soft); }
.status-awaiting_github_access > span { background: var(--amber); }
.error-text { color: var(--red); }
.progress-panel { margin-bottom: 24px; }
.progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 18px 0 4px; margin: 0; list-style: none; }
.progress-steps li { position: relative; display: flex; gap: 11px; min-width: 0; color: #8a94a3; }
.progress-steps li::after { content: ""; position: absolute; top: 16px; right: 8px; left: 42px; height: 2px; background: #e1e5eb; }
.progress-steps li:last-child::after { display: none; }
.progress-steps li > span { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 auto; width: 33px; height: 33px; background: #edf0f4; border-radius: 50%; font-size: 11px; font-weight: 850; }
.progress-steps li div { display: flex; flex-direction: column; padding-right: 12px; }
.progress-steps strong { color: #586477; font-size: 12px; }
.progress-steps small { font-size: 10px; }
.progress-steps .done > span { color: #fff; background: var(--green); }
.progress-steps .done::after { background: #77c5ad; }
.progress-steps .done strong, .progress-steps .current strong { color: var(--ink); }
.progress-steps .current > span { color: #fff; background: var(--blue); box-shadow: 0 0 0 5px var(--blue-soft); }
.result-panel, .handoff-panel, .attention-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; margin-top: 24px; }
.result-panel > div:first-child, .handoff-panel > div:first-child, .attention-panel > div:first-child { max-width: 650px; }
.result-panel p, .handoff-panel p, .attention-panel p { margin-bottom: 0; }
.notice { margin-bottom: 20px; padding: 15px 17px; border: 1px solid #dbe1e9; border-radius: 10px; }
.notice p { margin: 4px 0 0; }
.notice.neutral { color: #41516a; background: #f4f6f9; }
.notice.success { color: #0d684f; background: var(--green-soft); border-color: #bde6d8; }
.notice.error { color: #922332; background: var(--red-soft); border-color: #f1c5ca; }

.auth-workspace { min-height: 100vh; }
.auth-main { min-height: 100vh; }
.login-layout { display: grid; min-height: 100vh; padding: 24px 0; }
.wordmark { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--ink); font-weight: 850; letter-spacing: .15em; }
.wordmark img { display: block; width: 100%; max-width: 320px; height: auto; }
.wordmark span { color: #6f9aff; }
.login-panel { display: flex; flex-direction: column; justify-content: center; width: min(470px, calc(100% - 50px)); margin: auto; padding: 50px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.login-panel h1 { margin: 0; }
.mfa-panel h1 { font-size: 30px; overflow-wrap: anywhere; margin-bottom: 16px; }
.mfa-panel code { overflow-wrap: anywhere; }
.mfa-qr { align-self: center; max-width: 100%; height: auto; margin-bottom: 16px; }
.recovery-codes { padding-left: 20px; line-height: 1.9; }
.login-panel form, .auth-card form { display: grid; gap: 18px; margin-top: 25px; }
.auth-card { width: min(560px, calc(100% - 36px)); margin: 8vh auto; padding: 40px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card .wordmark { margin-bottom: 38px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-columns dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.two-columns dd { margin: 0; font-weight: 650; }
.inline-form { display: flex; flex-wrap: wrap; gap: 9px; }
.inline-form select { width: auto; }
.copy-input { margin: 12px 0; font-family: ui-monospace, monospace; }

@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 1080px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid, .form-layout, .preview-layout { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-steps { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
  .progress-steps li:nth-child(2)::after { display: none; }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; min-height: auto; padding: 14px 16px; }
  .brand { margin: 0 0 13px; }
  .nav-label { display: none; }
  nav { display: flex; gap: 5px; overflow-x: auto; }
  nav a { flex: 0 0 auto; min-height: 42px; padding: 8px 11px; font-size: 12px; }
  nav a[aria-current="page"] { box-shadow: inset 0 -3px #5886ff; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 62px; padding: 14px 18px; gap: 12px; flex-wrap: wrap; }
  .topbar-search { order: 2; flex-basis: 100%; max-width: none; }
  .profile { margin-left: auto; }
  .main { width: calc(100% - 32px); padding: 35px 0 100px; }
  .page-heading { flex-direction: column; margin-bottom: 26px; }
  h1 { font-size: 32px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-options { flex-wrap: wrap; }
  .card-grid, .form-grid, .two-columns, .detail-side { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .selection-tray { right: 12px; bottom: 12px; left: 12px; }
  .selection-tray small { max-width: 190px; }
  .source-strip { grid-template-columns: 1fr 1fr; }
  .source-strip .ref-form { grid-column: 1 / -1; }
  .preview-module { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr 1fr; gap: 12px; }
  .flow-steps > :is(span, a)::after { display: none; }
  .confirm-bar, .sticky-actions { align-items: stretch; flex-direction: column; }
  .login-panel { padding: 32px 25px; }
}

@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
  .panel, .module-card, .form-card { padding: 21px; }
  .filter-options .button { width: 100%; }
  .source-strip { grid-template-columns: 1fr; }
  .ref-form { grid-template-columns: 1fr; }
  .source-strip .ref-form { grid-column: auto; }
  .form-section { grid-template-columns: 1fr; }
  .selection-tray { align-items: stretch; flex-direction: column; gap: 12px; }
  .progress-steps { grid-template-columns: 1fr; }
  .progress-steps li::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.project-cover { width: calc(100% + 48px); margin: -24px -24px 22px; height: 180px; object-fit: cover; border-radius: 15px 15px 0 0; }
.project-gallery { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 20px; margin: 22px 0; }
.project-gallery figure { margin: 0; min-width: 0; }
.project-gallery img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 12px; background: var(--surface-soft); }
.project-gallery figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.project-profile-form { display: grid; gap: 22px; }
.profile-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.7; }
.project-presentation { margin-top: 24px; }
.customer-list { display: flex; flex-wrap: wrap; gap: 10px; }
.technical-details > summary { cursor: pointer; font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.wiki-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 24px; }
.wiki-pages a { display: block; margin: 12px 0; overflow-wrap: anywhere; }
.wiki-content { overflow-wrap: anywhere; }
.wiki-content img { max-width: 100%; height: auto; }
.wiki-content pre { max-width: 100%; overflow: auto; padding: 16px; background: var(--surface-soft); }
.repository-actions { margin: 20px 0; }
.button.danger { color: var(--red); border-color: var(--red); }
@media(max-width:760px) { .wiki-layout { grid-template-columns: 1fr; } }

.profile-menu { position: relative; }
.profile-menu summary { cursor: pointer; list-style: none; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-dropdown { position: absolute; z-index: 25; right: 0; top: calc(100% + 12px); width: 190px; padding: 8px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; }
.profile-dropdown a, .profile-dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; color: var(--ink); background: transparent; border: 0; cursor: pointer; text-decoration: none; border-radius: 6px; }
.profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--blue-soft); }

.account-photo-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 24px; margin-top: 20px; }
.account-photo-row > div { flex: 1 1 240px; min-width: 0; }
.account-photo { flex-shrink: 0; border-radius: 50%; object-fit: cover; }
