:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17243d;
  background: #eef3f7;
  font-synthesis: none;
  --navy: #101e3c;
  --navy-2: #182d58;
  --blue: #1f68ad;
  --cyan: #77d0ec;
  --orange: #b94e16;
  --orange-dark: #913709;
  --green: #18734f;
  --red: #a93636;
  --paper: #ffffff;
  --canvas: #eef3f7;
  --line: #d8e1e9;
  --line-strong: #c6d2dc;
  --muted: #59697d;
  --shadow: 0 16px 42px rgba(30, 55, 91, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: linear-gradient(180deg, #e8f0f6 0, var(--canvas) 250px); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 1; }
button:focus-visible:not(:disabled), input:focus-visible, a:focus-visible { outline: 3px solid rgba(40, 120, 197, .28); outline-offset: 2px; }

.app-header { height: 78px; padding: 0 clamp(20px, 4vw, 62px); display: flex; align-items: center; justify-content: space-between; color: white; background: linear-gradient(102deg, #0d1932 0%, #142956 62%, #243b86 100%); box-shadow: 0 5px 22px rgba(9, 23, 50, .24); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand > img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: 23px; font-weight: 780; letter-spacing: -.8px; line-height: 1; }
.brand-copy strong span { color: var(--cyan); }
.brand-copy small { margin-top: 6px; color: #a9bce5; font-size: 8px; font-weight: 800; letter-spacing: 2.1px; }
.header-context { display: flex; align-items: center; gap: 20px; }
.node-role { padding: 7px 11px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #c9d7f2; background: rgba(255,255,255,.06); font-size: 11px; }
.system-badge { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.system-badge i { width: 9px; height: 9px; border-radius: 50%; background: #e0a84c; box-shadow: 0 0 0 4px rgba(224,168,76,.15); }
.system-badge.ready i { background: #62d39c; box-shadow: 0 0 0 4px rgba(98,211,156,.14); }
.system-badge.warning i { background: #f3ab55; }

.app-shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.intro { min-height: 128px; display: flex; justify-content: space-between; align-items: flex-start; gap: 35px; padding: 0 6px 28px; }
.eyebrow, .section-kicker, .project-kind { margin: 0 0 7px; color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: 1.55px; text-transform: uppercase; }
.intro h1 { margin: 0; color: #13213a; font-size: clamp(31px, 4vw, 49px); line-height: 1.02; letter-spacing: -2px; overflow-wrap: anywhere; }
.intro > div > p:last-child { max-width: 700px; margin: 13px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.node-switcher { min-width: 390px; display: grid; grid-template-columns: minmax(115px, auto) 1fr; align-items: center; gap: 9px 14px; padding: 13px 14px; border: 1px solid rgba(40,120,197,.16); border-radius: 12px; background: rgba(255,255,255,.78); box-shadow: 0 8px 24px rgba(30,55,91,.06); color: var(--muted); font-size: 11px; }
.node-switcher[hidden] { display: none; }
.node-switcher-heading { min-width: 0; }
.node-switcher-label { display: block; color: #6c7d90; font-size: 8px; font-weight: 850; letter-spacing: 1px; text-transform: uppercase; }
.node-switcher strong { display: block; overflow: hidden; margin-top: 3px; color: #273750; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.node-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 4px; border: 1px solid #ccd8e2; border-radius: 9px; background: #edf3f7; }
.node-tab { min-height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; padding: 6px 10px; color: #53677c; font-size: 10px; font-weight: 800; line-height: 1.15; text-align: center; text-decoration: none; }
.node-tab:hover { border-color: #b6c7d5; background: rgba(255,255,255,.76); color: var(--blue); }
.node-tab.is-active { border-color: #9fc2d8; background: #fff; color: #164f82; box-shadow: 0 3px 9px rgba(36,78,115,.11); }
.node-switcher > small { grid-column: 1 / -1; color: #6a7a8c; font-size: 8px; line-height: 1.35; }
.dashboard-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); align-items: start; gap: 22px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }

.setup-card { position: sticky; top: 18px; overflow: hidden; }
.card-heading { display: flex; gap: 13px; padding: 22px 22px 19px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fbfcfd); }
.step-number { flex: 0 0 auto; padding-top: 3px; color: var(--orange); font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.card-heading h2, .projects-heading h2 { margin: 0; color: #1a2942; font-size: 20px; letter-spacing: -.45px; }
.card-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.48; }
.setup-card form { display: grid; gap: 15px; padding: 20px 22px 22px; }
.form-field { display: grid; gap: 7px; min-width: 0; }
.form-field > small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.drive-field { padding-top: 13px; border-top: 1px solid var(--line); }
.drive-intakes { display: grid; gap: 7px; }
.drive-intake { padding: 9px 10px; border: 1px solid #d5e1ea; border-radius: 7px; background: #f5f9fc; color: #435b73; font-size: 9px; }
.drive-intake strong, .drive-intake span { display: block; }
.drive-intake span { margin-top: 3px; color: var(--muted); }
label { color: #43556b; font-size: 10px; font-weight: 800; letter-spacing: .25px; text-transform: uppercase; }
input { width: 100%; min-width: 0; height: 42px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 11px; background: #fff; color: #1c2c45; font-size: 12px; text-transform: none; }
input::placeholder { color: #66778a; opacity: 1; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,120,197,.08); outline: none; }
.path-control { border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: #fafcfd; }
.path-control input { border: 0; border-radius: 0; background: #fff; }
.path-control input:focus { box-shadow: inset 0 0 0 2px rgba(40,120,197,.15); }
.path-actions { display: flex; gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.path-actions button { flex: 1; min-height: 33px; border: 0; background: #f6f9fb; color: #42617e; font-size: 10px; font-weight: 750; }
.path-actions button:hover:not(:disabled) { background: #edf4f8; color: var(--blue); }
.compact-path input { color: #5f7083; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
#upload-progress { width: 100%; height: 7px; accent-color: var(--blue); }
.create-button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 11px; border: 0; border-radius: 7px; background: var(--orange); color: white; box-shadow: 0 7px 18px rgba(201,91,32,.22); }
.create-button:hover:not(:disabled) { background: var(--orange-dark); }
.create-button .button-icon { font-size: 22px; font-weight: 300; }
.create-button span:last-child { display: flex; flex-direction: column; text-align: left; }
.create-button strong { font-size: 12px; }
.create-button small { margin-top: 2px; color: #fff; font-size: 8px; }
.create-button:disabled, .primary-action:disabled { background: #657383; color: #fff; box-shadow: none; }
.form-message { min-height: 15px; margin: -5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }

.projects-section { min-width: 0; }
.projects-heading { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 3px 4px 14px; }
.heading-copy { display: flex; gap: 13px; }
.icon-text-button, .ghost-action, .secondary-action { border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: #334c66; font-size: 10px; font-weight: 750; text-decoration: none; }
.icon-text-button { padding: 8px 11px; }
.icon-text-button:hover:not(:disabled), .ghost-action:hover:not(:disabled), .secondary-action:hover:not(:disabled) { border-color: #95abc0; background: #f7fafc; }
.projects-grid { display: grid; gap: 14px; }
.project-card { overflow: hidden; }
.project-card-header { min-height: 92px; display: flex; justify-content: space-between; gap: 18px; padding: 18px 20px 16px; }
.project-identity { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.project-identity > div { min-width: 0; }
.project-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #e4f6fc, #e8edfb); color: var(--blue); font-size: 26px; }
.project-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.project-name-row h3 { min-width: 0; }
.project-icon-button { position: relative; width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #60758a; }
.project-icon-button:hover:not(:disabled), .project-icon-button:focus-visible:not(:disabled) { border-color: #bfd0de; background: #f3f8fb; color: var(--blue); }
.project-icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-icon-button::after { content: attr(data-tooltip); position: absolute; z-index: 20; left: 50%; top: calc(100% + 7px); width: max-content; max-width: 180px; transform: translate(-50%, -3px); padding: 6px 8px; border-radius: 5px; background: #172943; color: white; font-size: 8px; font-weight: 700; line-height: 1.3; opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease; }
.project-icon-button:hover::after, .project-icon-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.project-card h3 { margin: 0; color: #182842; font-size: 18px; letter-spacing: -.35px; overflow-wrap: anywhere; }
.project-path { max-width: 650px; overflow: hidden; margin: 6px 0 0; color: #607185; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.project-status { align-self: flex-start; flex: 0 0 auto; max-width: 100%; border-radius: 999px; padding: 6px 9px; background: #edf1f4; color: #536477; font-size: 9px; font-weight: 850; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
.project-status.running { color: #854416; background: #fff0e5; }
.project-status.completed { color: #1d6647; background: #e7f5ee; }
.project-status.failed { color: #963737; background: #fceaea; }
.project-status.attention { color: #78420e; background: #fff0d6; }
.card-progress { padding: 0 20px 15px; }
.card-progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #52657a; font-size: 10px; }
.card-progress-copy span { color: var(--blue); font-weight: 800; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e8eef3; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue), #3850a0); transition: width .45s ease; }
.project-card:has(.project-status.running) .progress-track i, .progress-track.large i.is-running { background-image: linear-gradient(105deg, #6cc9e8 0%, #2f81ca 45%, #4554a4 60%, #2f81ca 75%, #6cc9e8 100%); background-size: 220% 100%; animation: progress-flow 2.2s linear infinite; }
.pipeline { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 0; margin: 0; padding: 0 20px 17px; list-style: none; }
.stage { position: relative; min-width: 0; padding: 21px 5px 0; color: #5f7083; text-align: center; font-size: 8px; font-weight: 750; }
.stage::before { content: ''; position: absolute; z-index: 2; left: 50%; top: 3px; width: 10px; height: 10px; transform: translateX(-50%); border: 2px solid #cbd5de; border-radius: 50%; background: white; }
.stage::after { content: ''; position: absolute; top: 8px; right: 50%; width: 100%; height: 2px; background: #dce4ea; }
.stage:first-child::after { display: none; }
.stage strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage small { display: block; margin-top: 2px; font-size: 7px; font-weight: 600; }
.stage[data-status="completed"] { color: var(--green); }
.stage[data-status="completed"]::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 2px white; }
.stage[data-status="completed"]::after { background: #72bea1; }
.stage[data-status="running"] { color: var(--blue); }
.stage[data-status="running"]::before { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(40,120,197,.12); animation: pulse 1.5s ease-in-out infinite; }
.stage[data-status="failed"] { color: var(--red); }
.stage[data-status="failed"]::before { border-color: var(--red); background: #fff; }
.retention-summary { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(190px, 1.2fr) minmax(180px, 1fr); gap: 10px; align-items: center; margin: 0 20px 14px; padding: 10px 12px; border: 1px solid #d8e2ea; border-radius: 8px; background: #f8fafc; color: #53667a; font-size: 8px; line-height: 1.35; }
.retention-summary strong { color: #26445f; font-size: 9px; }
.retention-summary[data-state="pinned"] { border-color: #8fb7d5; background: #f1f7fb; }
.retention-summary[data-state="active"] { border-color: #a8d3c1; background: #f3faf7; }
.retention-summary[data-state="due"] { border-color: #e1b46d; background: #fff9ed; }
.retention-summary[data-state="protected"] { border-color: #ccd7df; background: #f7f9fb; }
.carina-details { margin: 0 20px 14px; padding: 13px 14px; border: 1px solid #c8d8e5; border-radius: 8px; background: #f4f8fb; color: #334b63; }
.carina-details[hidden] { display: none; }
.carina-details > strong { font-size: 11px; }
.carina-details dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin: 10px 0 0; }
.carina-details dl div { min-width: 0; }
.carina-details dt { color: #596b7e; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.carina-details dd { margin: 3px 0 0; color: #20354d; font-size: 10px; overflow-wrap: anywhere; }
.carina-details .carina-path-row { grid-column: 1 / -1; }
.carina-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.processing-mode-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.processing-mode-picker legend { margin-bottom: 8px; color: #40546a; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .45px; }
.setup-mode-picker { display: grid; gap: 7px; margin: 2px 0 13px; }
.mode-option { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border: 1px solid #d4dfe8; border-radius: 7px; background: #f8fafc; }
.mode-option:has(input:checked) { border-color: #5b9bd0; background: #f0f7fc; box-shadow: 0 0 0 2px rgba(40,120,197,.07); }
.mode-option input { margin: 2px 0 0; accent-color: var(--blue); }
.mode-option label { cursor: pointer; }
.mode-option strong, .mode-option small { display: block; }
.mode-option strong { color: #233a54; font-size: 10px; }
.mode-option small { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.dialog-mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.dialog-mode-picker legend { grid-column: 1 / -1; }
.production-confirmation { grid-column: 1 / -1; display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border: 1px solid #e0b182; border-radius: 7px; background: #fff8ef; color: #784b20; font-size: 9px; line-height: 1.45; }
.production-confirmation input { margin: 1px 0 0; accent-color: var(--orange); }
.production-confirmation label { cursor: pointer; }
.project-actions { display: flex; align-items: center; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #f9fbfc; }
.primary-action { min-height: 38px; border: 0; border-radius: 6px; padding: 0 15px; background: var(--orange); color: white; font-size: 10px; font-weight: 850; box-shadow: 0 4px 12px rgba(201,91,32,.16); }
.primary-action:hover:not(:disabled) { background: var(--orange-dark); }
.secondary-action, .ghost-action { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; }
.secondary-action:disabled { border-color: #cbd4dc; background: #eef1f4; color: #657383; }
.show-log { margin-left: auto; }
.empty { border: 1px dashed #bdcad5; border-radius: 10px; padding: 46px 25px; background: rgba(255,255,255,.45); color: var(--muted); text-align: center; font-size: 12px; }

.processing-dialog { width: min(900px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: hidden; border: 0; border-radius: 14px; background: white; box-shadow: 0 28px 90px rgba(9,24,53,.32); }
.processing-dialog::backdrop { background: rgba(12, 25, 50, .64); backdrop-filter: blur(5px); }
.dialog-shell { max-height: calc(100vh - 30px); display: flex; flex-direction: column; }
.dialog-header, .dialog-actions { flex: 0 0 auto; }
.dialog-header { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 17px 12px 21px; color: white; background: linear-gradient(102deg, #101e3c, #213d7d); }
.dialog-brand { display: flex; align-items: center; gap: 12px; }
.dialog-brand > div { min-width: 0; }
.dialog-brand img { width: 45px; height: 45px; object-fit: contain; }
.dialog-brand span { color: #a9c7eb; font-size: 8px; font-weight: 850; letter-spacing: 1.45px; }
.dialog-brand h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.3px; overflow-wrap: anywhere; }
.dialog-close { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; background: rgba(255,255,255,.07); color: #d7e3f5; font-size: 23px; line-height: 1; }
.dialog-close:hover:not(:disabled) { background: rgba(255,255,255,.13); }
.rename-dialog { width: min(470px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 12px; background: white; box-shadow: 0 24px 75px rgba(9,24,53,.3); }
.rename-dialog::backdrop { background: rgba(12,25,50,.58); backdrop-filter: blur(4px); }
.danger-icon-button { color: #9f3434; }
.danger-icon-button:hover:not(:disabled) { border-color: #e0a7a7; background: #fff2f2; color: #7f2020; }
.rename-shell header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; color: white; background: linear-gradient(102deg, #101e3c, #213d7d); }
.rename-shell header h2 { margin: 3px 0 0; font-size: 18px; }
.rename-content { padding: 23px 23px 19px; }
.rename-content label { display: block; margin-bottom: 7px; color: #354b62; font-size: 10px; font-weight: 800; }
.rename-content input { width: 100%; box-sizing: border-box; }
.rename-content > p:not(.form-message) { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.rename-content .form-message { margin: 10px 0 0; }
.rename-shell footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #f9fbfc; }
.delete-dialog { width: min(610px, calc(100vw - 30px)); }
.delete-content { display: grid; gap: 12px; padding: 20px 23px; }
.delete-project-label { margin: 0 0 2px; color: #172943; font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.retention-status-panel { padding: 14px 15px; border: 1px solid #c9dae6; border-radius: 9px; background: linear-gradient(145deg, #f4f9fc, #fafcfd); }
.retention-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.retention-status-heading .section-kicker { margin-bottom: 3px; }
.retention-status-heading strong { color: #203850; font-size: 11px; }
.retention-state-badge { padding: 5px 8px; border: 1px solid #cbd8e2; border-radius: 999px; color: #4c6277; background: white; font-size: 8px; font-weight: 850; white-space: nowrap; }
.retention-state-badge[data-state="pinned"] { border-color: #86b4d4; color: #1f5c87; background: #edf7fd; }
.retention-state-badge[data-state="active"] { border-color: #8fc9af; color: #176441; background: #effaf4; }
.retention-state-badge[data-state="due"] { border-color: #dbad60; color: #79500d; background: #fff7e7; }
.retention-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; margin: 13px 0 0; }
.retention-status-grid div { min-width: 0; }
.retention-status-grid dt { color: #627488; font-size: 7px; font-weight: 850; letter-spacing: .35px; text-transform: uppercase; }
.retention-status-grid dd { margin: 3px 0 0; color: #253c54; font-size: 9px; overflow-wrap: anywhere; }
.delete-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid #d9e2ea; border-radius: 9px; background: #f8fafc; }
.delete-option strong { color: #263d57; font-size: 11px; }
.delete-option p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.delete-option-danger { grid-template-columns: 1fr; border-color: #edc2c2; background: #fff8f8; }
.delete-option-danger-soft { border-color: #e8cccc; background: #fffafa; }
.retention-pin-option { border-color: #c7dbea; background: #f5fafe; }
.retention-confirm-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px 12px; border: 1px solid #e2c183; border-radius: 7px; background: #fffaf0; }
.retention-confirm-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--orange); }
.retention-confirm-row label { color: #6d5123; font-size: 8px; line-height: 1.45; letter-spacing: 0; text-transform: none; }
.delete-option-danger label { color: #733535; font-size: 9px; font-weight: 750; }
.delete-option-danger input { width: 100%; box-sizing: border-box; }
.warning-action, .danger-action { min-height: 36px; border-radius: 6px; padding: 0 12px; font-size: 9px; font-weight: 850; }
.warning-action { border: 1px solid #d8a85e; background: #fff7e7; color: #764b0d; }
.warning-action:hover:not(:disabled) { border-color: #bd8635; background: #ffefcf; color: #5d3905; }
.danger-action { justify-self: start; border: 0; background: #b63d3d; color: white; }
.danger-action:hover:not(:disabled) { background: #902929; }
.preflight-panel { min-height: 0; display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: center; overflow-y: auto; padding: 35px 38px; }
.preflight-illustration { min-height: 205px; display: grid; place-items: center; border: 1px solid #dbe5ee; border-radius: 15px; background: radial-gradient(circle at 40% 30%, white 0, #eef6fb 56%, #e8edf9 100%); }
.preflight-illustration img { width: 160px; height: 160px; object-fit: contain; filter: drop-shadow(0 13px 17px rgba(33,62,125,.15)); }
.preflight-panel h3 { margin: 0; color: #172943; font-size: 24px; letter-spacing: -.65px; }
.preflight-panel p:not(.section-kicker) { margin: 10px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.preflight-panel ul { margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; color: #52647a; font-size: 10px; }
.preflight-panel li::before { content: '✓'; margin-right: 8px; color: var(--green); font-weight: 900; }
.live-progress-panel { min-height: 0; overflow-y: auto; padding: 24px 28px 18px; background: #f7f9fb; }
.progress-overview { display: grid; grid-template-columns: 115px 1fr; align-items: center; gap: 23px; padding: 2px 3px 22px; }
.progress-number { display: flex; align-items: flex-start; justify-content: center; color: #223a70; }
.progress-number strong { font: 650 56px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -4px; }
.progress-number span { margin-top: 7px; font-size: 18px; font-weight: 700; }
.progress-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.progress-title strong { color: #1b2c47; font-size: 14px; }
.progress-title span { color: var(--muted); font-size: 10px; }
.progress-track.large { height: 12px; border: 1px solid #dce5ec; background: #e8eef3; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; color: #596b7e; font-size: 8px; }
.dialog-stages { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.dialog-stage { min-width: 0; min-height: 66px; padding: 10px; border: 1px solid #dde5ec; border-radius: 7px; background: white; color: #56697c; }
.dialog-stage span { display: grid; place-items: center; width: 19px; height: 19px; margin-bottom: 7px; border-radius: 50%; background: #edf1f4; font-size: 8px; font-weight: 900; }
.dialog-stage strong { display: block; font-size: 9px; }
.dialog-stage strong, .dialog-stage small { overflow-wrap: anywhere; }
.dialog-stage small { display: block; margin-top: 3px; font-size: 7px; }
.dialog-stage[data-status="running"] { border-color: #96bedf; color: #245f9e; background: #f4f9fd; box-shadow: 0 0 0 2px rgba(40,120,197,.06); }
.dialog-stage[data-status="running"] span { color: white; background: var(--blue); }
.dialog-stage[data-status="completed"] { border-color: #aed8c7; color: #287854; background: #f4faf7; }
.dialog-stage[data-status="completed"] span { color: white; background: var(--green); }
.dialog-stage[data-status="failed"] { border-color: #e4b0b0; color: #a74343; background: #fff7f7; }
.recovery-panel { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; margin: 0 0 18px; padding: 17px; border: 1px solid #e0ba72; border-radius: 9px; background: linear-gradient(135deg, #fffaf0, #fffdf8); box-shadow: 0 8px 24px rgba(116,77,18,.07); }
.recovery-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: #8a5b12; background: #f7dfaa; font-size: 20px; }
.recovery-copy { min-width: 0; }
.recovery-copy h3 { margin: 3px 0 5px; color: #65420c; font-size: 15px; }
.recovery-copy > p:not(.section-kicker) { margin: 0; color: #66563d; font-size: 9px; line-height: 1.55; }
.recovery-details { margin-top: 8px; color: #725b38; font: 8px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.recovery-action { display: grid; gap: 2px; min-height: 42px; padding: 8px 13px; text-align: left; }
.recovery-action small { max-width: 520px; font-size: 7px; font-weight: 500; opacity: .82; }
.log-panel { overflow: hidden; border: 1px solid #263a54; border-radius: 8px; background: #0f1928; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.log-panel header { height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid #29394e; color: #b7c8db; background: #18263a; font-size: 9px; }
.log-panel header div { display: flex; align-items: center; gap: 7px; }
.log-panel header i { width: 7px; height: 7px; border-radius: 50%; background: #66d6a4; box-shadow: 0 0 0 3px rgba(102,214,164,.12); }
.log-panel header span { color: #9bafc4; }
.log-panel pre { height: 210px; margin: 0; overflow: auto; padding: 13px 15px; color: #aac3da; font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.dialog-actions { min-height: 66px; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: white; }
.dialog-actions #dialog-message { flex: 1; color: var(--muted); font-size: 9px; }
.large-action { min-width: 205px; min-height: 42px; }

@keyframes progress-flow { to { background-position: -220% 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(40,120,197,.04); } }

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 320px minmax(0,1fr); }
  .pipeline { grid-template-columns: repeat(3,1fr); row-gap: 9px; }
  .stage:nth-child(4)::after { display: none; }
}
@media (max-width: 820px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .setup-card { position: static; }
  .project-card-header { flex-direction: column; gap: 11px; }
  .project-status { margin-left: 52px; white-space: normal; }
}
@media (max-width: 760px) {
  .app-header { height: 68px; padding: 0 16px; }
  .brand > img { width: 44px; height: 44px; }
  .brand-copy strong { font-size: 19px; }
  .node-role { display: none; }
  .system-badge span { display: none; }
  .app-shell { width: min(100% - 22px, 1440px); padding-top: 28px; }
  .intro { display: grid; }
  .intro h1 { letter-spacing: -1.2px; }
  .node-switcher { width: 100%; min-width: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .setup-card { position: static; }
  .project-actions { flex-wrap: wrap; }
  .show-log { margin-left: 0; }
  .preflight-panel { grid-template-columns: 1fr; padding: 25px; }
  .preflight-illustration { display: none; }
  .progress-overview { grid-template-columns: 82px 1fr; gap: 12px; }
  .progress-number strong { font-size: 42px; }
  .dialog-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dialog-mode-picker { grid-template-columns: 1fr; }
  .dialog-mode-picker legend, .production-confirmation { grid-column: 1; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions #dialog-message { order: 3; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .app-shell { width: calc(100% - 18px); }
  .intro { gap: 20px; padding-inline: 2px; }
  .intro h1 { font-size: 30px; }
  .node-switcher { grid-template-columns: 1fr; align-items: stretch; }
  .node-tabs, .node-switcher > small { grid-column: 1; }
  .card-heading, .setup-card form { padding-inline: 17px; }
  .projects-heading { align-items: center; gap: 10px; }
  .project-card-header { flex-direction: column; gap: 11px; padding-inline: 15px; }
  .project-status { margin-left: 52px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 15px; row-gap: 10px; }
  .stage:nth-child(odd)::after { display: none; }
  .stage:nth-child(4)::after { display: block; }
  .carina-details { margin-inline: 15px; }
  .retention-summary { grid-template-columns: 1fr; margin-inline: 15px; }
  .carina-details dl { grid-template-columns: 1fr; }
  .carina-details .carina-path-row { grid-column: auto; }
  .project-actions { padding-inline: 15px; }
  .project-actions > button, .project-actions > a { flex: 1 1 100%; }
  .retention-status-heading { align-items: stretch; flex-direction: column; }
  .delete-option { grid-template-columns: 1fr; }
  .delete-option > button { justify-self: start; }
  .retention-status-grid { grid-template-columns: 1fr; }
  .processing-dialog { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
  .dialog-shell { max-height: calc(100vh - 12px); }
  .dialog-header { min-height: 68px; padding-inline: 12px; }
  .dialog-brand { gap: 8px; min-width: 0; }
  .dialog-brand img { width: 38px; height: 38px; }
  .dialog-brand span { font-size: 7px; letter-spacing: .9px; }
  .dialog-brand h2 { font-size: 15px; }
  .preflight-panel, .live-progress-panel { padding: 20px 16px; }
  .progress-overview { grid-template-columns: 1fr; }
  .progress-number { justify-content: flex-start; }
  .progress-title, .progress-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .dialog-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-actions { padding-inline: 12px; }
  .dialog-actions > button { width: 100%; }
  .large-action { min-width: 0; }
}
