/* Public Pulse light-theme colours, sourced from frontend/web/src/index.css. */
:root {
  --brand: #43389b;
  --brand-hover: #362d7c;
  --brand-soft: #f0f2fe;
  --brand-border: #d1c6ff;
  --text: #111322;
  --secondary: #414651;
  --muted: #535862;
  --subtle: #717680;
  --placeholder: #a4a7ae;
  --surface: #ffffff;
  --background: #f9f9fb;
  --hover: #f6f6f9;
  --border: #e9ebf1;
  --input-border: #dcdfea;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --error: #b42318;
  --error-soft: #fef3f2;
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; font-weight: 600; letter-spacing: -.5px; line-height: 1.4; }
h2 { margin-bottom: 16px; font-size: 16px; font-weight: 600; }
p { margin-bottom: 16px; }
.header { height: 64px; border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { max-width: 1160px; height: 100%; margin: auto; padding: 0 32px; display: flex; align-items: center; gap: 40px; }
.brand { color: var(--brand); font-size: 22px; font-weight: 650; letter-spacing: -.7px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; height: 100%; gap: 28px; align-items: stretch; }
.nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; padding-top: 2px; }
.nav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.nav a:hover { text-decoration: none; color: var(--brand); }
.signout { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 12px; padding: 8px 0; }
.page { max-width: 1160px; padding: 32px; margin: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--input-border); background: var(--surface); color: var(--secondary); border-radius: 6px; padding: 9px 14px; font-size: 13px; font-weight: 550; min-height: 40px; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.danger { color: var(--error); border-color: #fecdca; }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.notice { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 10px 14px; font-size: 12px; margin-bottom: 20px; }
.notice a { margin-left: 8px; }
.composer { border: 1px solid var(--input-border); background: var(--surface); border-radius: 8px; margin-bottom: 32px; }
.composer label { display: block; padding: 18px 20px 0; font-weight: 550; font-size: 13px; color: var(--secondary); }
.prompt { display: block; resize: vertical; width: 100%; min-height: 128px; border: 0; padding: 12px 20px 20px; outline: none; background: transparent; color: var(--text); line-height: 1.65; }
.prompt::placeholder { color: var(--placeholder); }
.composer:focus-within { border-color: var(--brand); }
.composer-controls { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.composer-controls .btn { margin-left: auto; }
.repo-select { border: 1px solid var(--input-border); border-radius: 6px; background: var(--surface); color: var(--secondary); padding: 8px 10px; font-size: 12px; max-width: 75%; min-height: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section-head h2 { margin-bottom: 0; }
.filter { font-size: 12px; color: var(--secondary); border: 1px solid var(--input-border); background: var(--surface); border-radius: 6px; padding: 7px 10px; min-height: 34px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.sessions-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.sessions-table th { padding: 12px 18px; background: #fcfcfd; color: var(--muted); font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--border); }
.sessions-table td { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sessions-table tr:last-child td { border-bottom: 0; }
.sessions-table tbody tr:hover { background: #fcfcfd; }
.sessions-table td:first-child { width: 46%; }
.sessions-table .task-link { color: var(--text); font-weight: 500; }
.sessions-table .task-link:hover { color: var(--brand); }
.time { color: var(--subtle); font-size: 12px; white-space: nowrap; }
.empty { padding: 38px 18px !important; color: var(--muted); text-align: center; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 5px; color: var(--secondary); background: #eff1f5; font-size: 12px; white-space: nowrap; }
.badge.running, .badge.provisioning, .badge.reviewing, .badge.ci { background: var(--brand-soft); color: var(--brand); }
.badge.waiting { color: var(--warning); background: var(--warning-soft); }
.badge.completed { color: var(--success); background: var(--success-soft); }
.badge.failed { color: var(--error); background: var(--error-soft); }
.back { display: inline-block; color: var(--muted); margin-bottom: 20px; font-size: 12px; }
.session-heading { max-width: 760px; }
.session-repo { margin-top: 8px; margin-bottom: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.session-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.stage { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.panel { padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { margin-bottom: 0; }
.question-panel { border-color: var(--brand-border); }
.question-panel h2 { color: var(--brand); }
.question-text, .result-copy { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.input { display: block; width: 100%; background: var(--surface); border: 1px solid var(--input-border); border-radius: 6px; padding: 9px 12px; color: var(--text); min-height: 40px; outline: none; font-size: 13px; }
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #43389b12; }
textarea.input { resize: vertical; min-height: 88px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; color: var(--secondary); font-weight: 500; margin-bottom: 6px; }
.field small { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.full { grid-column: 1 / -1; }
.timeline { max-height: 540px; overflow: auto; }
.event { padding: 12px 0; border-bottom: 1px solid var(--border); }
.event:first-child { padding-top: 0; }
.event:last-child { padding-bottom: 0; border: 0; }
.event-header { display: flex; justify-content: space-between; gap: 15px; font-size: 11px; color: var(--subtle); margin-bottom: 5px; }
.event-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; color: var(--secondary); }
.event.error .event-text { color: var(--error); }
.event.question .event-text { color: var(--brand); }
.session-meta { display: flex; flex-wrap: wrap; gap: 16px 36px; margin: 0 0 24px; font-size: 12px; }
.session-meta dt { color: var(--muted); margin-bottom: 3px; }
.session-meta dd { margin: 0; color: var(--secondary); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
pre { font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 16px; background: var(--background); border: 1px solid var(--border); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; color: var(--secondary); }
summary { cursor: pointer; color: var(--secondary); font-size: 13px; font-weight: 500; }
details[open] > summary { margin-bottom: 14px; }
.detail-section { margin-top: 20px; }
.settings-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.settings-tabs a { color: var(--muted); padding: 12px 0; border-bottom: 2px solid transparent; font-size: 13px; white-space: nowrap; }
.settings-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 550; }
.settings-tabs a:hover { text-decoration: none; }
.settings-form { max-width: 700px; }
.settings-help { margin-top: 24px; font-size: 12px; }
.saved-note { color: var(--success); font-size: 11px; font-weight: 400; }
.link-btn { border: 0; background: none; padding: 6px 0 0; font-size: 11px; color: var(--muted); }
.link-btn:hover { color: var(--error); }
.inline-error { color: var(--error); font-size: 12px; margin-top: 12px; line-height: 1.6; }
.connection-result { font-size: 12px; line-height: 1.6; margin-top: 12px; color: var(--secondary); }
.muted { color: var(--muted); }
.setup-content { max-width: 720px; }
.setup-content section { margin-bottom: 28px; }
.setup-content p, .setup-content li { font-size: 13px; color: var(--secondary); line-height: 1.7; }
.login-page { display: grid; min-height: 100vh; place-items: center; }
.login-card { width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px; }
.login-card h1 { color: var(--brand); margin-bottom: 24px; }
.login-card .btn { width: 100%; }
.boot { padding: 40px; color: var(--muted); font-size: 13px; }
#toast { display: none; position: fixed; bottom: 24px; right: 24px; max-width: 440px; padding: 12px 18px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 13px; box-shadow: 0 4px 10px #11132218; z-index: 20; }
#toast.show { display: block; }
@media (max-width: 700px) {
  .header-inner { padding: 0 20px; gap: 28px; }
  .nav { gap: 20px; }
  .page { padding: 24px 18px; }
  .page-head { gap: 12px; }
  h1 { font-size: 21px; }
  .composer-controls { gap: 8px; padding: 12px; }
  .repo-select { max-width: 67%; font-size: 11px; }
  .composer-controls .btn { font-size: 12px; padding: 8px 12px; }
  .sessions-table .repository-col { display: none; }
  .sessions-table th, .sessions-table td { padding: 12px; }
  .sessions-table td:first-child { width: 52%; }
  .sessions-table .time { font-size: 11px; }
  .session-actions { flex-wrap: wrap; justify-content: flex-end; }
  .session-actions .btn { font-size: 11px; padding: 5px 8px; min-height: 32px; }
  .session-meta { gap: 14px 24px; }
  .panel { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-tabs { gap: 22px; }
  #toast { left: 18px; right: 18px; bottom: 18px; }
}
.profile-link { margin-left: auto; font-size: 12px; color: var(--secondary); white-space: nowrap; }
.signout { margin-left: 0; }
.scope-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scope-filters .search { max-width: 330px; min-height: 36px; font-size: 12px; margin-right: auto; }
.scope-filters .filter { max-width: 280px; }
.session-tabs { display: flex; gap: 24px; margin-top: 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.state-tab { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); padding: 10px 0; font-size: 12px; white-space: nowrap; }
.state-tab span { margin-left: 7px; font-size: 11px; background: #eff1f5; color: var(--muted); border-radius: 4px; padding: 1px 5px; }
.state-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.state-tab.active span { background: var(--brand-soft); color: var(--brand); }
.row-detail { color: var(--subtle); font-size: 11px; margin-top: 5px; max-width: 290px; line-height: 1.5; overflow-wrap: anywhere; }
.sessions-table td:first-child { width: 38%; }
.sessions-table td:nth-child(2) { white-space: nowrap; }
.sessions-table td:nth-child(3) { min-width: 180px; }
.sessions-table .needs-input-row { background: #fffcf5; }
.needs-input-row td:first-child { border-left: 3px solid #f2bd6a; padding-left: 15px; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 16px 0; font-size: 12px; color: var(--muted); }
.pagination span { margin-right: auto; }
.analytics-filters { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.metric-note { font-size: 12px; color: var(--muted); margin: 14px 0 24px; line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 24px; }
.metric { padding: 20px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric > span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 25px; font-weight: 600; margin: 6px 0; letter-spacing: -.5px; }
.metric small { color: var(--subtle); font-size: 11px; line-height: 1.6; display: block; }
.analytics-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.metric-list { margin: 0; font-size: 12px; }
.metric-list > div { display: flex; gap: 20px; align-items: baseline; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); }
.metric-list > div:last-child { border: 0; }
.metric-list dt { color: var(--muted); }
.metric-list dd { margin: 0; color: var(--secondary); font-variant-numeric: tabular-nums; }
.phase-table { width: 100%; text-align: left; border-collapse: collapse; font-size: 12px; margin-top: 14px; }
.phase-table th { color: var(--muted); font-weight: 500; font-size: 11px; padding: 8px 0; }
.phase-table td { padding: 7px 0; }
.phase-table td:nth-child(2) { color: var(--muted); white-space: nowrap; padding-right: 10px; }
.phase-table meter { width: 100%; min-width: 60px; height: 8px; accent-color: var(--brand); }
.phase-table meter::-webkit-meter-bar { background: var(--brand-soft); border: 0; }
.phase-table meter::-webkit-meter-optimum-value { background: var(--brand); }
.analytics-table td:first-child { width: 32%; }
.analytics-table td:nth-child(3) { min-width: 0; }
.analytics-table th, .analytics-table td { padding: 12px 16px; }
.phase-summary { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 11px; color: var(--muted); }
.phase-summary strong { font-weight: 500; color: var(--secondary); margin-left: 4px; }
.harness-meta { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 850px) { .metric-grid { grid-template-columns: 1fr 1fr; } .metric:nth-child(2) { border-right: 0; } .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); } .analytics-grid { grid-template-columns: 1fr; } .header-inner { gap: 24px; } }
@media (max-width: 600px) { .header-inner { gap: 18px; padding: 0 14px; } .nav { gap: 14px; } .nav a { font-size: 12px; } .profile-link { max-width: 80px; overflow: hidden; text-overflow: ellipsis; } .signout { display: none; } .scope-filters .search { max-width: none; width: 100%; } .scope-filters .filter { max-width: 100%; flex: 1; } .session-tabs { gap: 20px; } .metric { padding: 16px; } .metric strong { font-size: 22px; } .sessions-table { min-width: 660px; } }

.composer.collapsed { display: none; }
[hidden] { display: none !important; }
.connection-status { background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid #fedf89; padding: 10px max(16px,env(safe-area-inset-left)); font-size: 13px; }
.offline [data-online] { cursor: not-allowed; opacity: .55; }
.install-section { margin: 28px 0; max-width: 500px; }
.install-section p, .install-dialog p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.install-dialog { border: 1px solid var(--border); border-radius: 8px; padding: 24px; max-width: min(440px,90vw); color: var(--text); }
.install-dialog::backdrop { background: #11132266; }
@media (max-width: 600px) {
  .header { height: auto; padding-top: env(safe-area-inset-top); }
  .header-inner { flex-wrap: wrap; height: auto; gap: 0 20px; padding: 0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left)); }
  .brand { min-height: 54px; display: flex; align-items: center; }
  .nav { order: 3; width: 100%; height: 44px; gap: 28px; }
  .nav a { font-size: 13px; }
  .profile-link { max-width: 145px; padding: 12px 0; }
  .page { padding: 24px max(16px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
  .btn, .btn.small, .filter, .repo-select { min-height: 44px; }
  .input, textarea, select, .prompt, .filter, .repo-select { font-size: 16px; }
  .scope-filters .search { font-size: 16px; min-height: 44px; }
  .state-tab { min-height: 44px; }
  .session-list { border: 0; background: transparent; overflow: visible; }
  .session-list .sessions-table { display: block; min-width: 0; width: 100%; }
  .session-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .session-list tbody { display: grid; gap: 12px; }
  .session-list tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-areas: 'task task' 'status status' 'owner elapsed' 'updated updated'; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 0; }
  .session-list td { display: block; border: 0; min-width: 0; width: auto !important; padding: 8px 14px; white-space: normal !important; }
  .session-list td:first-child { grid-area: task; border-left: 0; }
  .session-list td:nth-child(2) { grid-area: owner; }
  .session-list td:nth-child(3) { grid-area: status; min-width: 0; }
  .session-list td:nth-child(4) { grid-area: elapsed; text-align: right; }
  .session-list td:nth-child(5) { grid-area: updated; padding-top: 0; }
  .session-list td[data-label]::before { content: attr(data-label) ' '; color: var(--subtle); font-size: 11px; margin-right: 4px; }
  .session-list .task-link { font-size: 15px; line-height: 1.6; display: inline-block; overflow-wrap: anywhere; }
  .session-list .row-detail { max-width: none; overflow-wrap: anywhere; }
  .session-list .needs-input-row { background: #fffcf5; border-left: 3px solid #f2bd6a; }
  .session-list .empty { grid-area: task; }
  .session-page-head { flex-direction: column; }
  .session-heading { min-width: 0; width: 100%; overflow-wrap: anywhere; }
  .session-actions { justify-content: flex-start; }
  .question-panel .form-actions .btn { width: 100%; }
  .question-panel { scroll-margin-top: 12px; }
  .question-panel .panel-heading { flex-wrap: wrap; }
  .question-panel .options .btn { white-space: normal; text-align: left; }
  .session-meta { display: grid; grid-template-columns: 1fr 1fr; }
  .session-meta > div { min-width: 0; overflow-wrap: anywhere; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--border); }
  .metric:last-child { border-bottom: 0; }
  .analytics-filters { align-items: stretch; }
  .analytics-filters .scope-filters { width: 100%; }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .login-page { min-height: 100svh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
}
.badge.needs_key { color: var(--warning); background: var(--warning-soft); }
.quality-check { padding: 10px 0; border-bottom: 1px solid var(--border); }
.quality-check:last-child { border-bottom: 0; }
.login-card .muted { font-size: 12px; margin-top: 12px; }
.login-card details { margin-top: 20px; }
#personal-key-form .form-actions { flex-wrap: wrap; }
.account-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.personal-key-form { min-width: 0; }
.personal-key-form .form-actions { flex-wrap: wrap; }
@media (max-width: 700px) { .account-keys { grid-template-columns: 1fr; } }
