:root {
  color-scheme: light;
  --navy: #25343c;
  --navy-deep: #25343c;
  --navy-soft: #dceef7;
  --teal: #dcecc5;
  --teal-dark: #345e31;
  --teal-pale: #eff5e8;
  --gold: #bdd69d;
  --gold-pale: #dceef7;
  --ink: #25343c;
  --muted: #52616a;
  --line: #cfd8dc;
  --surface: #fff;
  --canvas: #fff;
  --red: #b74949;
  --red-pale: #fff0ed;
  --shadow: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(39, 140, 130, .34);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.app-frame { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; width: 236px; display: flex; flex-direction: column;
  padding: 23px 15px 16px; color: var(--ink); background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 3px 9px 21px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 37px; height: 37px; display: grid; place-items: center; border-radius: 3px; background: var(--gold);
  color: var(--navy-deep); font-family: Georgia, serif; font-weight: 800; font-size: 21px; box-shadow: none;
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: .12em; }
.brand-copy small { color: var(--ink); font-size: 13px; }
.sidebar-rule { height: 1px; background: rgba(255,255,255,.13); margin: 0 9px 24px; }
.nav-label, .eyebrow { margin: 0; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .13em; line-height: 1.35; }
.nav-label { padding: 0 11px 10px; color: var(--ink); }
.primary-nav { display: grid; gap: 5px; }
.nav-item {
  position: relative; min-height: 43px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 11px;
  border: 0; border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-size: 13px; font-weight: 600;
  transition: background .16s ease, color .16s ease;
}
.nav-item:not(:disabled):not([aria-disabled="true"]):hover { color: var(--ink); background: rgba(255,255,255,.08); }
.nav-item.is-active { color: var(--ink); background: #1e435e; box-shadow: none; }
.nav-icon { width: 19px; color: var(--ink); font-size: 18px; text-align: center; }
.nav-item.is-active .nav-icon { color: var(--ink); }
.nav-count { margin-left: auto; min-width: 21px; padding: 3px 6px; border-radius: 3px; background: rgba(242,189,88,.16); color: var(--ink); text-align: center; font-size: 13px; font-weight: 800; }
.sidebar-spacer { flex: 1; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin: 12px 5px 0; padding: 13px 9px 4px; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-foot > span:last-child { display: grid; gap: 2px; }
.sidebar-foot strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.sidebar-foot small { color: var(--ink); font-size: 13px; }
.online-dot, .event-dot { width: 7px; height: 7px; border-radius: 3px; background: #55c7a1; box-shadow: none; }

.main-area { min-width: 0; width: calc(100% - 236px); margin-left: 236px; }
.topbar {
  position: sticky; top: 0; z-index: 4; min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 0 33px; border-bottom: 1px solid #e6ebef; background: rgba(255,255,255,.96); backdrop-filter: none;
}
.crumbs { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; }
.crumbs strong { color: var(--ink); font-weight: 700; }
.crumb-sep { color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.demo-chip { color: var(--ink); font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.event-chip, .revision-chip { min-height: 29px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #e7edf1; border-radius: 3px; background: #fff; color: var(--ink); white-space: nowrap; font-size: 13px; font-weight: 650; }
.event-chip { border-color: #e4eee9; background: #f7fbf9; color: var(--ink); }
.revision-chip { color: var(--ink); background: #fbfcfd; font-weight: 550; }
.event-dot { width: 6px; height: 6px; }
.sign-out-button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--muted); cursor: pointer; font-size: 13px; }

.content-wrap { width: 100%; margin: 0 auto; padding: 31px 34px 58px; }
#alert-region { position: relative; z-index: 1; }
.alert { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 0 0 19px; padding: 12px 15px; border: 1px solid #f0cbbe; border-radius: 3px; background: var(--red-pale); color: var(--ink); font-size: 13px; line-height: 1.45; }
.alert-conflict { border-color: #f1d28b; background: #fff8e7; color: var(--ink); }
.alert-action { flex: 0 0 auto; padding: 7px 10px; border: 1px solid currentColor; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; font-weight: 700; font-size: 13px; }
.page-section { animation: none; }
@keyframes page-in { from { opacity: .65; transform: none; } to { opacity: 1; transform: none; } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 23px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-heading .eyebrow { margin-bottom: 7px; color: var(--teal-dark); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; color: var(--navy); font-size: clamp(26px, 2.2vw, 32px); font-weight: 750; letter-spacing: -.04em; line-height: 1.14; }
h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 730; letter-spacing: -.02em; }
h3 { margin: 0; color: var(--ink); font-size: 16px; }
.page-subtitle { max-width: 650px; margin: 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
.button {
  min-height: 37px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid transparent;
  border-radius: 3px; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.button:hover { transform: none; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: var(--teal); color: var(--ink); box-shadow: none; }
.button-primary:not(:disabled):not([aria-disabled="true"]):hover { background: var(--teal-dark); }
.button-quiet { border-color: #dce4e9; background: #fff; color: var(--ink); }
.button-quiet:not(:disabled):not([aria-disabled="true"]):hover, .button-outline:not(:disabled):not([aria-disabled="true"]):hover { border-color: #a8c7c1; background: #f7fbfa; color: var(--teal-dark); }
.button-outline { border-color: #d9e3e7; background: #fff; color: var(--ink); }
.button-full { width: 100%; margin-top: 7px; }
.text-button { padding: 6px; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 650; }
.text-button:not(:disabled):not([aria-disabled="true"]):hover { color: var(--teal-dark); }
.subtle-status { padding: 7px 10px; border: 1px solid #e2e9ed; border-radius: 3px; color: var(--ink); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 21px; }
#metric-grid { max-width: 680px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-grid-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  min-width: 0; min-height: 82px; display: flex; align-items: flex-start; gap: 11px; padding: 14px 13px 12px; border: 1px solid #e4eaef;
  border-radius: 3px; background: #fff; cursor: pointer; text-align: left; box-shadow: none; transition: border .15s ease, box-shadow .15s ease, transform .15s ease;
}
.metric-card:not(:disabled):not([aria-disabled="true"]):hover { transform: none; border-color: #b6d1cb; box-shadow: none; }
.metric-icon { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 3px; background: #edf5f4; color: var(--teal-dark); font-size: 15px; font-weight: 800; }
.metric-card:nth-child(2) .metric-icon { background: var(--gold-pale); color: var(--ink); }
.metric-card:nth-child(3) .metric-icon { background: #edf1fb; color: var(--ink); }
.metric-card:nth-child(4) .metric-icon { background: #f0f3f6; color: var(--ink); }
.metric-copy { min-width: 0; display: grid; gap: 1px; }
.metric-label { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.metric-copy strong { color: var(--ink); font-size: 21px; font-weight: 740; line-height: 1.25; letter-spacing: -.035em; }
.metric-copy small { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.metric-arrow { margin-left: auto; color: var(--ink); opacity: 0; font-size: 13px; transition: opacity .15s ease; }
.metric-card:not(:disabled):not([aria-disabled="true"]):hover .metric-arrow { opacity: 1; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(265px, .88fr); align-items: start; gap: 17px; }
.primary-column, .secondary-column { display: grid; gap: 17px; min-width: 0; }
.panel { min-width: 0; border: 1px solid #e4eaf0; border-radius: 3px; background: var(--surface); box-shadow: none; }
.import-panel { padding: 19px 20px 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-heading .eyebrow { margin-bottom: 4px; color: var(--ink); }
.panel-heading-tight { padding: 17px 19px 13px; }
.step-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 5px 5px; border: 1px solid #e5eced; border-radius: 3px; color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; }
.step-badge span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 3px; background: #e7f5f2; color: var(--teal-dark); font-size: 13px; font-weight: 800; }
.drop-zone {
  position: relative; min-height: 113px; display: flex; align-items: center; gap: 13px; margin-top: 17px; padding: 16px 16px;
  border: 1px dashed #bccbd1; border-radius: 3px; background: #fbfcfd; cursor: pointer; transition: border .15s ease, background .15s ease;
}
.drop-zone:hover, .drop-zone.is-dragging { border-color: #5eaaa1; background: #f4fbf9; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-glyph { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #d8e7e4; border-radius: 3px; background: #eef8f6; color: var(--teal-dark); font-size: 21px; font-weight: 500; }
.drop-copy { display: grid; gap: 4px; }
.drop-copy strong { color: var(--ink); font-size: 13px; }
.drop-copy span { color: var(--ink); font-size: 13px; }
.drop-meta { margin-left: auto; color: var(--ink); font-size: 13px; text-align: right; }
.import-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 13px; }
.helper-text, .muted-inline { color: var(--ink); font-size: 13px; }
.muted-inline { white-space: nowrap; }
.review-panel { padding: 0 17px 16px; }
.review-total { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; background: var(--gold-pale); color: var(--ink); font-size: 13px; font-weight: 800; }
.panel-intro { margin: 0 0 12px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.issue-list { display: grid; gap: 0; }
.issue-card { display: flex; align-items: flex-start; gap: 9px; padding: 12px 0; border-top: 1px solid #edf0f3; }
.issue-marker { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 3px; background: #fff5e5; color: var(--ink); font-size: 13px; font-weight: 800; }
.issue-card-copy { min-width: 0; flex: 1; }
.issue-card-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 7px; }
.issue-card-title strong { color: var(--ink); font-size: 13px; font-weight: 720; text-transform: capitalize; }
.issue-card-title span { color: var(--ink); font-size: 13px; }
.issue-card-copy p { margin: 4px 0 0; color: var(--ink); font-size: 13px; line-height: 1.4; }
.issue-open { flex: 0 0 auto; min-height: 25px; margin-left: auto; padding: 2px 6px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; }
.issue-open:not(:disabled):not([aria-disabled="true"]):hover { background: #eef7f5; color: var(--teal-dark); }
.note-card { display: flex; gap: 10px; padding: 14px; border: 1px solid #eee2c5; border-radius: 3px; background: #fffbf1; }
.note-icon { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 3px; background: #f5e9c8; color: var(--ink); font-family: Georgia, serif; font-size: 13px; font-weight: 800; }
.note-card strong { color: var(--ink); font-size: 13px; }
.note-card p { margin: 5px 0 0; color: var(--ink); font-size: 13px; line-height: 1.5; }
.empty-state { display: flex; align-items: center; gap: 10px; padding: 18px 10px; color: var(--ink); }
.empty-state > div { display: grid; gap: 3px; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state span { color: var(--ink); font-size: 13px; }
.empty-check { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 3px; background: #e9f6f1; color: var(--ink); }
.compact-empty { padding: 16px 2px; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.data-table thead { background: #f8fafb; }
.data-table th { padding: 10px 12px; border-top: 1px solid #edf1f4; border-bottom: 1px solid #e9eef1; color: var(--ink); font-size: 13px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #edf1f3; color: var(--ink); font-size: 13px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfd; }
.compact-table th, .compact-table td { padding-left: 17px; padding-right: 17px; }
.compact-table td { font-size: 13px; }
.file-cell { display: inline-flex; align-items: center; gap: 8px; }
.file-cell strong { max-width: 205px; overflow: hidden; color: var(--ink); text-overflow: ellipsis; font-weight: 650; }
.file-mini { padding: 3px 4px; border-radius: 3px; background: #ecf4f3; color: var(--ink); font-size: 13px; font-weight: 800; }
.table-empty { padding: 18px; color: var(--ink); text-align: center; font-size: 13px; white-space: normal; }

.preview-container { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e8edef; }
.preview-header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.preview-header .eyebrow { margin-bottom: 5px; color: var(--ink); }
.preview-header p:last-child { margin: 5px 0 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.preview-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
.preview-stat { min-width: 90px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e8edef; border-radius: 3px; background: #fbfcfd; }
.preview-stat strong { color: var(--navy); font-size: 15px; }
.preview-stat span { color: var(--ink); font-size: 13px; }
.incoming-label { justify-self: end; color: var(--ink); font-size: 13px; font-weight: 650; }
.preview-record-list { display: grid; gap: 8px; max-height: 465px; overflow-y: auto; padding: 1px 2px 2px 0; }
.preview-record { border: 1px solid #e5eaee; border-radius: 3px; background: #fff; }
.preview-record-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; }
.preview-record-heading > div { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 2px 8px; min-width: 0; }
.preview-record-heading > div > strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; font-size: 13px; }
.preview-record-heading small { grid-column: 2; overflow: hidden; color: var(--ink); text-overflow: ellipsis; font-size: 13px; }
.preview-kind { grid-row: span 2; align-self: center; padding: 3px 5px; border-radius: 3px; background: #f1f4f6; color: var(--ink); font-size: 13px; font-weight: 850; letter-spacing: .06em; }
.preview-kind-new { background: #e8f5f1; color: var(--ink); }
.preview-kind-changed { background: #fff4dc; color: var(--ink); }
.skip-new { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); cursor: pointer; font-size: 13px; white-space: nowrap; }
.skip-new input { accent-color: var(--teal); }
.source-change-list { border-top: 1px solid #eff2f3; }
.change-row { display: grid; grid-template-columns: minmax(0, 1fr) 185px; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #eff2f3; }
.change-row:last-child { border-bottom: 0; }
.change-row > div > strong { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; }
.change-values { display: flex; gap: 7px; align-items: baseline; margin-top: 4px; color: var(--ink); font-size: 13px; }
.change-values > span:first-child { overflow: hidden; max-width: 180px; text-decoration: line-through; text-overflow: ellipsis; white-space: nowrap; }
.change-values strong { overflow: hidden; max-width: 230px; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.corrected-label { padding: 2px 4px; border-radius: 3px; background: #f4eddb; color: var(--ink); font-size: 13px; font-weight: 650; }
.change-choice { display: grid; gap: 4px; color: var(--ink); font-size: 13px; }
.change-choice select { width: 100%; height: 29px; padding: 0 7px; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); font-size: 13px; }
.roster-change-list { padding: 8px 12px; border-top: 1px solid #eff2f3; background: #fbfcfc; }
.roster-change-note { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--ink); font-size: 13px; }
.roster-change-note strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.muted-copy { margin: 0; padding: 8px 12px 12px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.history-review-form { padding: 14px 18px 18px; }
.history-review-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 10px; margin-bottom: 8px; }
.history-review-toolbar label, .history-review-decision, .history-review-edit { display: grid; gap: 4px; color: var(--ink); font-size: 12px; font-weight: 650; }
.history-review-toolbar input, .history-review-toolbar select, .history-review-decision select, .history-review-edit input { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 450; }
.history-review-toolbar :focus-visible, .history-review-decision select:focus-visible, .history-review-edit input:focus-visible { outline: 2px solid #488cc0; outline-offset: 1px; }
.history-review-count { min-height: 19px; margin-bottom: 6px; color: var(--ink); font-size: 12px; }
.history-review-records { display: grid; gap: 6px; }
.history-review-record { min-width: 0; border: 1px solid #e5eaee; border-radius: 3px; background: #fff; }
.history-review-record > summary { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 8px 10px; cursor: pointer; list-style: none; }
.history-review-record > summary::-webkit-details-marker { display: none; }
.history-review-record > summary::before { content: '›'; flex: 0 0 auto; color: #526273; font-size: 19px; line-height: 1; transform: rotate(0); transition: transform .14s ease; }
.history-review-record[open] > summary::before { transform: rotate(90deg); }
.history-review-kind, .history-review-locked { flex: 0 0 auto; padding: 3px 6px; border-radius: 3px; background: #f1f4f6; color: #40505e; font-size: 11px; font-weight: 700; }
.history-review-kind.is-new { background: #e8f5f1; color: #286454; }
.history-review-kind.is-changed { background: #fff4dc; color: #76531b; }
.history-review-locked { background: #f4eddb; color: #6c5425; }
.history-review-name { min-width: 0; display: grid; gap: 2px; }
.history-review-name strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-review-name small { overflow: hidden; color: #687887; font-size: 11px; text-overflow: ellipsis; }
.history-review-meta { margin-left: auto; color: #536271; font-size: 12px; white-space: nowrap; }
.history-review-record-body { padding: 0 10px 10px; }
.history-review-skip { display: flex; align-items: center; gap: 7px; padding: 0 0 8px; color: var(--ink); font-size: 12px; font-weight: 650; }
.history-review-skip input { accent-color: var(--teal); }
.history-review-change { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; align-items: end; padding: 9px 0; border-top: 1px solid #edf0f2; }
.history-review-change h3 { grid-column: 1 / -1; margin: 0; color: var(--ink); font-size: 12px; }
.history-review-values { grid-column: 1 / -1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.history-review-values > div { min-width: 0; display: grid; gap: 3px; }
.history-review-values span { color: #687887; font-size: 11px; }
.history-review-values strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.history-review-decision select { min-height: 32px; }
.history-review-edit input { min-height: 32px; }
.history-review-empty { margin: 0; padding: 18px 10px; color: #596b7b; font-size: 13px; text-align: center; }
.history-review-pagination { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 38px; margin-top: 8px; color: #536271; font-size: 12px; }
.history-review-pagination:empty { display: none; }
.history-review-pagination .button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.history-review-form .dialog-actions { margin-top: 10px; }
@media (max-width: 680px) {
  .history-review-form { padding: 12px 12px 15px; }
  .history-review-toolbar { grid-template-columns: 1fr; }
  .history-review-change { grid-template-columns: 1fr; gap: 8px; }
  .history-review-change h3 { grid-column: auto; }
  .history-review-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-review-record > summary { flex-wrap: wrap; }
  .history-review-meta { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .history-review-record > summary::before { transition: none; }
}
.question-change-details { margin: 0 0 12px; padding: 9px 11px; border: 1px solid #e8edf0; border-radius: 3px; color: var(--ink); font-size: 13px; }
.question-change-details summary { cursor: pointer; font-weight: 700; }
.question-change-details ul { margin: 8px 0 0; padding-left: 17px; }
.question-change-details li { margin: 5px 0; line-height: 1.45; }
.preview-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #e8edef; }
.preview-footer > span { max-width: 480px; color: var(--ink); font-size: 13px; line-height: 1.45; }

.roster-panel { overflow: hidden; }
.toolbar { min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 13px; padding: 10px 15px; }
.toolbar-single { justify-content: flex-start; }
.filter-tabs { min-width: 0; display: flex; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: thin; }
.filter-tab { min-height: 30px; flex: 0 0 auto; padding: 0 9px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 650; }
.filter-tab:not(:disabled):not([aria-disabled="true"]):hover { background: #f4f7f8; color: var(--ink); }
.filter-tab.is-selected { background: #e9f5f2; color: var(--ink); }
.search-box { min-width: 205px; height: 33px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid #e2e8ec; border-radius: 3px; background: #fff; color: var(--ink); font-size: 17px; }
.search-box:focus-within { border-color: #8bbab3; box-shadow: none; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: var(--ink); }
.status-filter { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 650; }
.status-filter select { height: 33px; max-width: 148px; padding: 0 7px; border: 1px solid #e2e8ec; border-radius: 3px; background: #fff; color: var(--ink); font-size: 13px; }
.roster-filter-note { padding: 9px 16px; border-top: 1px solid #edf1f3; background: #f7fbfa; color: var(--ink); font-size: 13px; }
.roster-filter-note strong { color: var(--ink); }
.roster-table th:first-child, .roster-table td:first-child { padding-left: 16px; }
.person-cell { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.person-cell > span:last-child { display: grid; gap: 3px; }
.person-cell strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.person-cell small { color: var(--ink); font-size: 13px; }
.avatar, .org-avatar { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 3px; background: #eef3f6; color: var(--ink); font-size: 13px; font-weight: 800; }
.category-tag, .status-pill, .yes-pill, .transport-pill, .confirmed-pill, .review-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 3px; font-size: 13px; font-weight: 700; }
.tag-rso { background: #edf1fb; color: var(--ink); }
.tag-ifc { background: #eaf5f3; color: var(--ink); }
.tag-friends { background: #fff1ec; color: var(--ink); }
.tag-individual { background: #f0f2f5; color: var(--ink); }
.tag-neutral { background: #f1f4f6; color: var(--ink); }
.yes-pill { background: #ecf7f2; color: var(--ink); }
.transport-pill { background: #fff4dc; color: var(--ink); }
.muted-dash { color: var(--ink); }
.status-active { background: #edf7f1; color: var(--ink); }
.status-muted { background: #f1f3f5; color: var(--ink); }
.inline-link { padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-size: inherit; font-weight: 650; }
.inline-link:not(:disabled):not([aria-disabled="true"]):hover { color: var(--ink); text-decoration: underline; }
.row-more { min-width: 27px; min-height: 27px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; font-weight: 800; font-size: 14px; }
.row-more:not(:disabled):not([aria-disabled="true"]):hover { background: #eef5f4; color: var(--teal-dark); }
.table-footer { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid #e9eef1; color: var(--ink); font-size: 13px; }
.issues-panel { margin-bottom: 16px; padding-bottom: 8px; }
.issues-panel .issue-list { padding: 0 18px; }
.issue-grid { grid-template-columns: minmax(0, 1fr); }
.issue-grid .issue-card { min-width: 0; }

.count-strip { margin: -6px 0 10px; padding: 0 0 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 650; }
.org-table td { padding-top: 12px; padding-bottom: 12px; }
.org-name-cell { display: inline-flex; align-items: center; gap: 9px; }
.org-name-cell > span:last-child { display: grid; gap: 3px; }
.org-name-cell strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.org-name-cell small { color: var(--ink); font-size: 13px; }
.org-avatar { border-radius: 3px; background: #eef5f3; color: var(--ink); font-size: 13px; }
.contact-cell { display: grid; gap: 3px; color: var(--ink); font-size: 13px; }
.contact-cell small { color: var(--ink); font-size: 13px; }
.confirmed-pill { background: #ebf7f1; color: var(--ink); }
.review-pill { background: #fff4df; color: var(--ink); }
.member-count { padding: 5px 7px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 750; }
.member-count:not(:disabled):not([aria-disabled="true"]):hover { background: #edf7f5; }

.output-status-card { display: flex; align-items: center; gap: 11px; margin: 0 0 17px; padding: 13px 15px; border: 1px solid #e7ebee; border-radius: 3px; background: #fff; }
.output-status-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 3px; background: #f1f4f6; color: var(--ink); font-size: 15px; font-weight: 800; }
.output-status-card > span:last-child { display: grid; gap: 3px; }
.output-status-card strong { color: var(--ink); font-size: 13px; }
.output-status-card small { color: var(--ink); font-size: 13px; }
.output-fresh { border-color: #d5e9df; background: #f8fcf9; }
.output-fresh .output-status-mark { background: #e7f5ec; color: var(--ink); }
.output-stale { border-color: #ecdcae; background: #fffcf3; }
.output-stale .output-status-mark { background: #fff2d3; color: var(--ink); }
.output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.output-panel { display: flex; gap: 13px; padding: 18px; }
.output-symbol { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 3px; background: #eaf5f3; color: var(--ink); font-size: 17px; }
.gold-symbol { background: #fff5df; color: var(--ink); }
.output-copy { min-width: 0; }
.output-copy .eyebrow { margin-bottom: 5px; color: var(--ink); }
.output-copy h2 { margin-bottom: 7px; }
.output-copy p:not(.eyebrow) { margin-bottom: 13px; color: var(--ink); font-size: 13px; line-height: 1.55; }
.output-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.output-tags span { padding: 4px 6px; border: 1px solid #e8edef; border-radius: 3px; background: #fbfcfc; color: var(--ink); font-size: 13px; }
.export-details { overflow: hidden; }
.export-view-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 18px 10px; }
.export-view-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 3px; border-top: 1px solid #edf1f3; color: var(--ink); font-size: 13px; }
.export-view-row > span { display: flex; align-items: center; gap: 8px; }
.export-view-row > strong { color: var(--ink); font-size: 13px; }
.export-view-dot { width: 6px; height: 6px; border-radius: 3px; background: #7ab6a9; }
.audience-exports { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 14px; border: 1px solid #e5eaee; border-radius: 3px; background: #fff; }
.audience-exports > div { display: grid; gap: 3px; margin-right: auto; }
.audience-exports .eyebrow { color: var(--ink); }
.audience-exports strong { color: var(--ink); font-size: 13px; }
.audience-exports span { color: var(--ink); font-size: 13px; }
.audience-exports .button { min-height: 33px; font-size: 13px; }
.download-launch { position: fixed; top: 0; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.app-dialog { width: min(780px, calc(100vw - 28px)); max-height: min(91vh, 900px); overflow-y: auto; padding: 0; border: 1px solid #dfe6eb; border-radius: 3px; background: #fff; color: var(--ink); box-shadow: none; }
.app-dialog::backdrop { background: rgba(9,28,45,.52); backdrop-filter: none; }
.dialog-top { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px 22px 15px; border-bottom: 1px solid #e9edf0; background: rgba(255,255,255,.97); }
.dialog-top .eyebrow { margin-bottom: 5px; color: var(--teal-dark); font-size: 13px; }
.dialog-top h2 { font-size: 18px; }
.dialog-subtitle { margin: 5px 0 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.dialog-close { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 3px; background: #f4f6f7; color: var(--ink); cursor: pointer; font-size: 19px; line-height: 1; }
.dialog-close:not(:disabled):not([aria-disabled="true"]):hover { background: #e9eff1; color: var(--ink); }
.dialog-form { padding: 17px 22px 19px; }
.compare-panel { margin: 16px 22px 0; border: 1px solid #e6ecef; border-radius: 3px; overflow: hidden; }
.compare-heading { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #f8fafb; }
.compare-heading strong { color: var(--ink); font-size: 13px; }
.compare-heading span { color: var(--ink); font-size: 13px; }
.compare-columns { display: grid; grid-template-columns: 1fr 1fr; }
.source-snapshot, .compare-current { min-width: 0; padding: 11px 12px; }
.source-snapshot { border-right: 1px solid #e9eef1; background: #fcfdfd; }
.source-snapshot > strong, .compare-current > strong { color: var(--ink); font-size: 13px; }
.source-snapshot dl, .compare-current dl { display: grid; gap: 0; max-height: 165px; overflow: auto; margin: 6px 0 0; }
.source-snapshot dl > div, .compare-current dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid #eff2f3; }
.source-snapshot dt, .compare-current dt { flex: 0 0 42%; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.source-snapshot dd, .compare-current dd { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); text-align: right; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.source-empty { padding: 15px 12px; color: var(--ink); font-size: 13px; }
.dialog-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.dialog-section-heading strong { color: var(--ink); font-size: 13px; }
.dialog-section-heading span { color: var(--ink); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.form-field { min-width: 0; display: grid; gap: 5px; color: var(--ink); font-size: 13px; font-weight: 650; }
.form-field > span { display: flex; align-items: center; gap: 5px; }
.form-field em { color: var(--ink); font-size: 13px; font-style: normal; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid #dfe6ea; border-radius: 3px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; font-weight: 450; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #80b5ad; box-shadow: none; }
.form-field textarea { resize: vertical; line-height: 1.45; }
.form-field small { color: var(--ink); font-size: 13px; font-weight: 450; }
.dialog-form-note { margin: 0 0 12px; padding: 9px 11px; border: 1px solid #ead9ab; border-radius: 3px; background: #fffaeb; color: var(--ink); font-size: 13px; }
.form-field-wide { grid-column: 1 / -1; }
.reason-field { margin-top: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 17px; padding-top: 13px; border-top: 1px solid #e9eef0; }
.dialog-actions-spread { justify-content: space-between; margin: 0; padding: 17px 22px 20px; }
.form-check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 550; }
.form-check input { width: 15px; min-height: 15px; accent-color: var(--teal); }
.dialog-error { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 22px 0; padding: 9px 11px; border: 1px solid #f0d1c6; border-radius: 3px; background: #fff5f1; color: var(--ink); font-size: 13px; }
.dialog-error.conflict { border-color: #efdcaa; background: #fffaeb; color: var(--ink); }
.dialog-error button { padding: 5px 7px; border: 1px solid currentColor; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; }
.duplicate-context { padding: 16px 22px; }
.duplicate-context > p { margin: 0 0 13px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.duplicate-candidates { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.duplicate-person { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid #e7ecef; border-radius: 3px; background: #fafcfc; }
.duplicate-person > span:last-child { min-width: 0; display: grid; gap: 3px; }
.duplicate-person strong { color: var(--ink); font-size: 13px; }
.duplicate-person small { overflow: hidden; color: var(--ink); text-overflow: ellipsis; font-size: 13px; }
.duplicate-options { display: grid; gap: 7px; padding: 0 22px 5px; }
.duplicate-choice { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #e2e9ed; border-radius: 3px; background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.duplicate-choice:not(:disabled):not([aria-disabled="true"]):hover { border-color: #9ac4bc; background: #f7fbfa; }
.duplicate-choice:disabled { opacity: .65; cursor: wait; }
.duplicate-choice span:first-child { display: grid; gap: 4px; }
.duplicate-choice strong { color: var(--ink); font-size: 13px; }
.duplicate-choice small { color: var(--ink); font-size: 13px; }
.duplicate-choice.keep-all { border-color: #d4e7e0; background: #f7fbf8; }
.review-record-summary { display: grid; gap: 4px; padding: 10px; border: 1px solid #e6ecef; border-radius: 3px; background: #fafcfc; }
.review-record-summary .eyebrow { font-size: 13px; }
.review-record-summary strong { color: var(--ink); font-size: 13px; }
.review-record-summary small { color: var(--ink); font-size: 13px; }
.mapping-context { display: grid; gap: 5px; margin-bottom: 14px; padding: 12px; border: 1px solid #e5ecee; border-radius: 3px; background: #f8fbfa; }
.mapping-context strong { color: var(--ink); font-size: 13px; }
.mapping-context span { color: var(--ink); font-size: 13px; font-weight: 700; }
.mapping-context small { color: var(--ink); font-size: 13px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(380px, calc(100vw - 40px)); padding: 0; border-radius: 3px; opacity: 0; pointer-events: none; transform: none; transition: opacity .2s ease, transform .2s ease; }
.toast-region.is-visible { padding: 12px 15px; border: 1px solid #cce3d8; background: #f0faf4; color: var(--ink); opacity: 1; pointer-events: auto; transform: none; box-shadow: none; font-size: 13px; font-weight: 650; }
.toast-region.error { border-color: #edccc3; background: #fff2ee; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 1120px) {
  .sidebar { width: 205px; }
  .main-area { width: calc(100% - 205px); margin-left: 205px; }
  .content-wrap { padding-right: 23px; padding-left: 23px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.45fr) minmax(238px, .85fr); gap: 13px; }
  .metric-grid { gap: 9px; }
  .metric-card { gap: 8px; padding-right: 9px; padding-left: 10px; }
  .metric-icon { flex-basis: 26px; width: 26px; height: 26px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .search-box { width: 100%; }
}
@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; height: auto; min-height: 0; padding: 10px 14px; }
  .app-frame { display: block; }
  .brand { padding: 0 5px 9px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 3px; font-size: 18px; }
  .brand-copy { flex-direction: row; align-items: baseline; gap: 8px; }
  .brand-copy strong { font-size: 13px; }
  .sidebar-rule, .nav-label, .sidebar-spacer, .sidebar-foot { display: none; }
  .primary-nav { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 1px; }
  .nav-item { flex: 0 0 auto; width: auto; min-height: 35px; padding: 0 10px; font-size: 13px; }
  .nav-icon { width: auto; font-size: 15px; }
  .nav-item.is-active { box-shadow: none; }
  .nav-count { min-width: 17px; padding: 2px 5px; }
  .main-area { width: 100%; margin-left: 0; }
  .topbar { min-height: 52px; padding: 0 19px; }
  .content-wrap { padding: 24px 19px 45px; }
}
@media (max-width: 700px) {
  .topbar { position: relative; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
  .demo-chip { width: 100%; text-align: right; }
  .event-chip, .revision-chip { min-height: 25px; font-size: 13px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-heading > .button, .page-heading > button { align-self: flex-start; }
  .metric-grid, .metric-grid-compact { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .secondary-column { grid-template-columns: 1fr; }
  .issue-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 10px; }
  .filter-tabs { width: 100%; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .output-grid { grid-template-columns: 1fr; }
  .audience-exports { align-items: flex-start; flex-wrap: wrap; }
  .audience-exports > div { flex-basis: 100%; margin-bottom: 2px; }
  .audience-exports .button { flex: 1 1 145px; }
  .export-view-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .content-wrap { padding: 19px 12px 34px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .crumbs { font-size: 13px; }
  .topbar-right { gap: 4px; }
  .event-chip { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .revision-chip { padding: 0 7px; }
  .demo-chip { font-size: 13px; }
  .import-panel { padding: 15px 13px; }
  .panel-heading-tight { padding-right: 13px; padding-left: 13px; }
  .drop-zone { align-items: flex-start; min-height: 96px; padding: 13px 11px; }
  .drop-meta { position: absolute; right: 11px; bottom: 10px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drop-copy { padding-bottom: 14px; }
  .import-actions { align-items: flex-start; flex-direction: column; }
  .import-actions .button { width: 100%; }
  .preview-header { flex-direction: column; }
  .change-row { grid-template-columns: 1fr; gap: 7px; }
  .change-choice { grid-template-columns: 58px 1fr; align-items: center; }
  .change-values > span:first-child, .change-values strong { max-width: 42vw; }
  .preview-footer { align-items: flex-start; flex-direction: column; }
  .preview-footer .button { width: 100%; }
  .preview-record-heading { align-items: flex-start; flex-direction: column; }
  .preview-record-heading > div { width: 100%; }
  .skip-new { margin-left: 1px; }
  .app-dialog { width: calc(100vw - 18px); max-height: 94vh; border-radius: 3px; }
  .dialog-top { padding: 15px 15px 12px; }
  .dialog-form { padding: 14px 15px 16px; }
  .compare-panel { margin: 13px 15px 0; }
  .compare-columns { grid-template-columns: 1fr; }
  .source-snapshot { border-right: 0; border-bottom: 1px solid #e9eef1; }
  .source-snapshot dl, .compare-current dl { max-height: 125px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field-wide { grid-column: auto; }
  .dialog-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1; }
  .duplicate-context { padding: 13px 15px; }
  .duplicate-candidates { grid-template-columns: 1fr; }
  .duplicate-options { padding-right: 15px; padding-left: 15px; }
  .dialog-actions-spread { padding: 14px 15px 16px; }
  .dialog-error { margin-right: 15px; margin-left: 15px; }
}

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

/* Approved B theme: flat surfaces, readable type, green and blue accents.
   Navigation remains independent of the eventual team/home-page structure. */
body { font-size: 15px; line-height: 1.5; }
.sidebar { width: 220px; padding: 22px 12px; background: #fff; color: var(--ink); border-right: 1px solid var(--line); border-top: 5px solid var(--gold); }
.main-area { margin-left: 220px; width: calc(100% - 220px); }
.brand { padding: 0 10px 24px; }
.brand-mark, .nav-icon, .sidebar-rule, .nav-label, .online-dot, .event-dot { display: none; }
.brand-copy strong { font-size: 20px; letter-spacing: 0; }
.brand-copy small, .sidebar-foot small { color: var(--muted); }
.primary-nav { gap: 4px; }
.nav-item { min-height: 44px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.nav-item:not(:disabled):not([aria-disabled="true"]):hover { background: #f3f6f7; color: var(--ink); }
.nav-item.is-active { background: var(--teal); color: var(--ink); font-weight: 600; }
.nav-count { background: transparent; color: var(--ink); font-size: 13px; padding: 0; }
.sidebar-foot { border-color: var(--line); padding: 16px 10px 0; }
.sidebar-foot strong { font-size: 13px; }
.topbar { position: static; background: #fff; padding: 15px 28px; border-color: var(--line); flex-wrap: wrap; }
.topbar { justify-content: space-between; align-items: center; min-height: 0; }
.event-picker { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 650; }
.event-picker select { min-height: 36px; max-width: min(360px, 58vw); padding: 6px 30px 6px 10px; border: 1px solid #b7c6cd; border-radius: 3px; background: #fff; color: var(--ink); font: inherit; }
.event-picker select:disabled { opacity: .65; }
.event-switch-status { color: var(--muted); font-size: 13px; font-weight: 600; }
.event-readonly-banner { margin: 0 0 18px; padding: 12px 15px; border: 1px solid #cbd9c0; background: #f4f8ef; color: var(--ink); font-weight: 600; }
.crumbs, .demo-chip, .event-chip, .revision-chip { font-size: 13px; }
.event-chip, .revision-chip { border: 0; background: transparent; padding: 0 4px; }
.demo-chip { color: var(--muted); }
.content-wrap { max-width: none; padding: 28px 32px 48px; }
.page-heading { align-items: center; margin-bottom: 18px; }
.page-heading .eyebrow, .panel-heading .eyebrow, .dialog-top .eyebrow, .output-copy .eyebrow { display: none; }
h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }
h2, h3 { font-size: 18px; letter-spacing: 0; font-weight: 600; }
.page-subtitle { font-size: 15px; color: var(--muted); max-width: 780px; }
.button { min-height: 38px; font-size: 14px; font-weight: 600; padding: 7px 13px; white-space: normal; }
.button-primary { background: var(--teal); color: var(--ink); border-color: #91ad71; }
.button-primary:not(:disabled):not([aria-disabled="true"]):hover { background: #cee2b2; }
.button-outline, .button-quiet { border-color: #a5b5bd; }
.button-outline:not(:disabled):not([aria-disabled="true"]):hover, .button-quiet:not(:disabled):not([aria-disabled="true"]):hover { background: var(--navy-soft); border-color: #94b6c8; color: var(--ink); }
.button:disabled { opacity: 1; color: #5b686e; border-color: var(--line); background: #edf0f1; cursor: not-allowed; }
.metric-grid, #metric-grid, .metric-grid-compact { display: flex; flex-wrap: wrap; gap: 8px 22px; max-width: none; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.metric-card { border: 0; background: transparent; padding: 3px 0; min-height: 0; gap: 0; }
.metric-card:not(:disabled):not([aria-disabled="true"]):hover { background: var(--navy-soft); }
.metric-icon, .metric-arrow, .metric-copy small { display: none; }
.metric-copy { display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
.metric-label { font-size: 14px; color: var(--muted); font-weight: 400; }
.metric-copy strong { font-size: 16px; letter-spacing: 0; }
.workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.primary-column { display: contents; }
.secondary-column { grid-row: 2; }
.panel { border: 0; border-radius: 0; background: #fff; }
.import-panel, .review-panel { padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.panel-heading-tight { padding: 0 0 12px; }
.step-badge { border: 0; background: transparent; font-size: 13px; padding: 0; }
.step-badge span { display: none; }
.drop-zone { min-height: 72px; padding: 14px; margin-top: 14px; background: #fff; border: 1px solid #9eb4bf; }
.drop-zone:hover, .drop-zone.is-dragging { background: #f0f7fb; border-color: #427799; }
.drop-zone:focus-within { outline: 2px solid #27618a; outline-offset: 3px; }
.upload-glyph, .issue-marker, .note-icon, .output-symbol, .output-status-mark, .empty-check { display: none; }
.drop-copy strong { font-size: 15px; }
.drop-copy span, .drop-meta, .helper-text, .muted-inline { color: var(--muted); font-size: 13px; }
.review-total, .step-badge { color: var(--muted); background: transparent; }
.panel-intro { color: var(--muted); font-size: 14px; }
.issue-card { padding: 15px 0; border-color: var(--line); align-items: center; }
.issue-card-title strong, .issue-card-title span { font-size: 14px; }
.issue-card-copy p { color: var(--muted); font-size: 14px; }
.issue-open { border: 1px solid #a5b5bd; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.issue-open:not(:disabled):not([aria-disabled="true"]):hover { background: var(--navy-soft); }
.review-panel .button-full { width: auto; margin-top: 14px; }
.note-card { border: 0; border-left: 3px solid #b7d3e2; border-radius: 0; background: #fff; padding: 4px 14px; }
.note-card strong, .note-card p { color: var(--muted); font-size: 13px; }
.empty-state { padding: 12px 0; }
.empty-state strong, .empty-state span { font-size: 14px; color: var(--muted); }
.data-table th { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); background: #f1f4f5; border-color: var(--line); }
.data-table td, .compact-table td { font-size: 14px; color: var(--ink); padding-top: 12px; padding-bottom: 12px; border-color: var(--line); }
.data-table tbody tr:hover { background: #f0f7fb; }
.table-sort-button { padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
th[aria-sort="ascending"] .table-sort-button::after { content: ' ↑'; }
th[aria-sort="descending"] .table-sort-button::after { content: ' ↓'; }
.file-mini, .avatar, .org-avatar, .export-view-dot { display: none; }
.person-cell strong, .org-name-cell strong { font-size: 14px; }
.person-cell small, .org-name-cell small, .contact-cell small { color: var(--muted); font-size: 13px; }
.toolbar { padding: 12px 0; flex-wrap: wrap; }
.filter-tabs { flex-wrap: wrap; overflow: visible; }
.filter-tab { font-size: 14px; }
.filter-tab.is-selected { background: var(--navy-soft); color: var(--ink); }
.search-box { min-height: 38px; border-color: #a5b5bd; }
.search-box input, .status-filter select { font-size: 14px; }
.status-filter select { min-height: 38px; border-color: #a5b5bd; }
.review-pill, .preview-kind-changed, .corrected-label { background: var(--navy-soft); color: var(--ink); }
.confirmed-pill, .preview-kind-new { background: var(--teal-pale); color: #345e31; }
.note-card, .output-stale { background: #fff; }
.output-status-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; padding: 10px 0 18px; }
.output-panel { padding: 16px 0; border-top: 1px solid var(--line); }
.output-grid { gap: 28px; }
.output-tags span { background: #f1f4f5; font-size: 13px; }
.audience-exports { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 20px 0; flex-wrap: wrap; }
.audience-exports .button { font-size: 14px; }
.export-view-list { padding: 0; gap: 0 32px; }
.export-view-row { font-size: 14px; }
.preview-stat { border: 0; border-radius: 0; background: #f1f4f5; }
.preview-record { border-color: var(--line); }
.change-choice select { height: auto; min-height: 36px; font-size: 14px; }
.change-values { flex-wrap: wrap; }
.change-values > span:first-child, .change-values strong { white-space: normal; overflow-wrap: anywhere; }
.app-dialog { width: min(880px, calc(100vw - 28px)); border-color: #879ca7; }
.dialog-top { background: #fff; }
.form-field, .form-field input, .form-field select, .form-field textarea { font-size: 14px; }
.form-field input, .form-field select { min-height: 40px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid #27618a; outline-offset: 1px; border-color: #27618a; }
.source-snapshot dt, .source-snapshot dd, .compare-current dt, .compare-current dd { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.dialog-form-note { background: #f0f7fb; border-color: #b7d3e2; color: var(--ink); }
.alert, .dialog-error { color: #8e3838; }
.toast-region.is-visible { font-size: 14px; background: #edf5e5; color: #345e31; }
#page-settings .dialog-form { padding: 0; display: grid; gap: 12px; }
#page-settings .form-field { max-width: 850px; }
#audit-body td:last-child { white-space: normal; min-width: 260px; max-width: 650px; overflow-wrap: anywhere; }
.import-mapping { margin-top: 16px; }
.import-mapping summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
#review-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.friend-match-row { padding: 16px 22px; border-top: 1px solid var(--line); }
.friend-match-row .dialog-actions { margin: 0; padding: 0; border: 0; flex-wrap: wrap; }
.friend-linked-list { display: grid; gap: 8px; margin: 8px 0 14px; }
.friend-linked small { color: var(--muted); }
.app-dialog > .form-field { margin: 16px 22px; }
.app-dialog > .helper-text { margin: 12px 22px; }
@media(max-width:860px) {
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px 8px; }
  .main-area { width: 100%; margin-left: 0; }
  .brand { padding: 0 0 14px; }
  .brand-copy strong { font-size: 20px; }
  .brand-copy { flex-wrap: wrap; }
  .primary-nav { flex-wrap: wrap; overflow: visible; gap: 4px; }
  .nav-item { min-height: 40px; padding: 8px 10px; font-size: 14px; }
  .topbar { padding: 12px 20px; }
  .content-wrap { padding: 24px 20px 40px; }
}
@media(max-width:480px) {
  .content-wrap { padding: 20px 16px 32px; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .topbar-right { justify-content: flex-start; }
  .event-picker { flex: 1 1 100%; justify-content: space-between; }
  .event-picker select { flex: 0 1 auto; max-width: 75vw; }
  .demo-chip { text-align: left; }
  .page-heading { align-items: flex-start; }
  .drop-zone { flex-wrap: wrap; }
  .drop-meta { position: static; max-width: 100%; text-align: left; margin: 0; white-space: normal; }
  .drop-copy { padding: 0; }
  .change-row { grid-template-columns: 1fr; }
  .change-choice { grid-template-columns: 1fr; }
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
  .preview-record-heading small { overflow-wrap: anywhere; white-space: normal; }
}

/* Task-based workspace navigation and the supplied event mark. */
:root {
  --brand-blue: #488cc0;
  --brand-blue-dark: #285d79;
  --teal: #e8f1df;
  --teal-pale: #f4f8ef;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline-color: rgba(55, 124, 162, .55);
}
.sidebar { border-top-color: #dcecc5; }
.brand { justify-content: center; min-height: 0; padding: 0 5px 19px; }
.brand-logo { display: block; width: min(100%, 184px); height: auto; object-fit: contain; }
.nav-label { display: block; padding: 0 12px 8px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.nav-item { color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: #e8f1df; color: #25343c; }
.nav-count { min-width: 22px; padding: 2px 6px; border-radius: 12px; background: #f1f4f5; color: #25343c; font-size: 12px; font-weight: 700; }
.button-primary { border-color: var(--brand-blue); background: var(--brand-blue); color: #fff; font-size: 18px; font-weight: 700; }
.button-primary:not(:disabled):not([aria-disabled="true"]):hover { border-color: var(--brand-blue-dark); background: var(--brand-blue-dark); color: #fff; }
.button-outline, .button-quiet { border-color: #b7c6cd; color: #263941; }
.button-outline:not(:disabled):not([aria-disabled="true"]):hover, .button-quiet:not(:disabled):not([aria-disabled="true"]):hover { border-color: #9dbbcc; background: #f1f7fa; color: #243842; }
.inline-link, .text-button, .member-count { color: var(--brand-blue-dark); }
.inline-link:not(:disabled):not([aria-disabled="true"]):hover, .text-button:not(:disabled):not([aria-disabled="true"]):hover, .member-count:not(:disabled):not([aria-disabled="true"]):hover { color: #235b79; }
.imports-column { display: grid; gap: 18px; }
.overview-heading { align-items: flex-start; }
.overview-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.overview-summary { display: grid; gap: 6px; min-width: 0; padding: 18px 19px; border: 1px solid var(--line); background: #fff; color: inherit; text-decoration: none; }
.overview-summary:hover { border-color: #9dbbcc; background: #fbfdfe; }
.overview-summary:focus-visible { outline: 3px solid rgba(55, 124, 162, .55); outline-offset: 2px; }
.overview-summary > span { color: var(--muted); font-size: 13px; font-weight: 600; }
.overview-summary > strong { color: var(--ink); font-size: 27px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.overview-summary:nth-child(3) > strong { font-size: 17px; }
.overview-summary > small { color: var(--muted); font-size: 13px; line-height: 1.4; }
#review-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.google-connect-row { display: flex; align-items: center; }
.google-connect-controls { display: flex; align-items: center; gap: 14px; }
.google-connect-controls > span { color: var(--ink); font-size: 13px; white-space: nowrap; }
.issues-panel .issue-list { padding: 0; }
.unsaved-confirmation { display: grid; gap: 10px; margin: 16px 22px; padding: 13px 15px; border: 1px solid #b7c6cd; background: #f7fafb; color: var(--ink); }
.unsaved-confirmation p { margin: 0; font-size: 14px; }
.unsaved-confirmation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#alert-region > .unsaved-confirmation { margin: 0 0 18px; }
@media (max-width: 480px) {
  .unsaved-confirmation { margin: 13px 15px; padding: 12px; }
  .unsaved-confirmation-actions .button { flex: 1 1 auto; }
}
@media (max-width: 860px) {
  .brand { justify-content: flex-start; padding: 0 0 12px; }
  .brand-logo { width: min(30vw, 132px); }
  .nav-label { display: none; }
  .primary-nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }
}
@media (max-width: 480px) {
  .google-connect-controls { align-items: stretch; flex-direction: column; gap: 8px; }
}
@media (max-width: 700px) {
  .overview-summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .overview-summary { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 12px; padding: 14px 15px; }
  .overview-summary > span { grid-column: 1; grid-row: 1; }
  .overview-summary > strong { grid-column: 2; grid-row: 1 / span 2; font-size: 24px; text-align: right; }
  .overview-summary:first-child > strong { grid-row: 1; }
  .overview-summary:nth-child(3) > strong { max-width: 52vw; font-size: 15px; }
  .overview-summary > small { grid-column: 1; grid-row: 2; }
}

/* Compact roster controls, neutral table values, and explicit required fields. */
.roster-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 10px; }
.roster-toolbar .search-box { width: 100%; max-width: 560px; }
.roster-toolbar .tbe-pref-trigger { justify-self: end; }
.participation-toolbar { min-height: 42px; padding-top: 0; padding-bottom: 8px; }
.participation-toolbar .filter-tabs { flex-wrap: wrap; overflow: visible; }
.organization-toolbar { justify-content: flex-start; flex-wrap: wrap; }
.organization-toolbar .filter-tabs { flex: 0 0 auto; }
.organization-toolbar .search-box { flex: 1 1 220px; margin-left: auto; }
.organization-toolbar .tbe-pref-trigger { margin-left: auto; }
.roster-table .person-cell, .org-name-link { color: var(--ink); }
.roster-table .person-cell strong, .org-name-link { text-decoration: underline; text-decoration-color: #9eb4bf; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.roster-table .inline-link { color: var(--brand-blue-dark); font-weight: 600; text-decoration: underline; text-decoration-color: #9eb4bf; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.roster-table .person-cell:hover strong, .org-name-link:hover { color: var(--brand-blue-dark); text-decoration-color: currentColor; }
.roster-table .inline-link:hover { text-decoration-color: currentColor; }
.org-name-link { padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 600; text-align: left; }
.member-count { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--brand-blue-dark); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.member-count:hover { color: #235b79; }
.form-field > span > em, .form-field > span:first-child em { color: #a33232; font-size: 12px; font-style: normal; font-weight: 650; }
.organization-type-change-note { grid-column: 1 / -1; margin: -4px 0 0; color: #566875; font-size: 13px; }
.import-preview-dialog { width: min(1080px, calc(100vw - 28px)); max-width: none; max-height: min(92vh, 900px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #bdcbd1; border-radius: 6px; background: #fff; color: var(--ink); box-shadow: 0 18px 60px rgba(28, 45, 55, .24); }
.import-preview-dialog::backdrop { background: rgba(25, 38, 47, .42); }
.import-preview-shell { display: flex; max-height: min(92vh, 900px); flex-direction: column; }
.import-preview-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 20px 24px 12px; border-bottom: 1px solid var(--line); }
.import-preview-header h2 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.import-preview-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.import-preview-header .dialog-close { position: static; flex: 0 0 auto; }
.import-preview-dialog .preview-stats { margin: 12px 24px; }
.import-preview-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 12px; padding: 0 24px 10px; }
.import-preview-toolbar .search-box { width: 100%; }
.import-preview-choice-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.import-preview-dialog .history-review-count { margin: 0; padding: 0 24px 8px; }
.import-preview-dialog .preview-record-list { display: grid; gap: 0; max-height: min(48vh, 470px); overflow-y: auto; padding: 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.preview-record-row { min-width: 0; border-bottom: 1px solid var(--line); }
.preview-record-row:last-child { border-bottom: 0; }
.preview-record { min-width: 0; border: 0; border-radius: 0; background: transparent; }
.preview-record > summary { display: grid; grid-template-columns: 14px max-content minmax(0, 1fr) max-content; align-items: center; gap: 10px; min-height: 54px; padding: 7px 4px; cursor: pointer; list-style: none; }
.preview-record > summary::-webkit-details-marker { display: none; }
.preview-record > summary::before { content: '›'; color: #526273; font-size: 19px; line-height: 1; transform: rotate(0); transition: transform .14s ease; }
.preview-record[open] > summary::before { transform: rotate(90deg); }
.preview-record > summary .preview-kind { grid-row: auto; grid-column: auto; }
.preview-record-name { min-width: 0; display: grid; gap: 1px; }
.preview-record-name strong, .preview-record-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-record-name strong { font-size: 13px; }
.preview-record-name small, .preview-record-meta { color: var(--muted); font-size: 12px; }
.preview-record-meta { white-space: nowrap; }
.preview-record-detail { padding: 2px 4px 12px 28px; }
.preview-field-change { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 270px); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid #edf1f3; }
.preview-field-change > div { min-width: 0; display: grid; gap: 3px; }
.preview-field-change > div > strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.preview-field-change small { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.preview-field-decision, .preview-field-edit { display: grid; gap: 4px; }
.preview-field-decision select, .preview-field-edit input { width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid #b7c6cd; border-radius: 3px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.preview-footer { align-items: center; margin: 0; padding: 12px 24px 16px; border-top: 0; }
.preview-footer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.history-review-table-wrap { max-height: min(52vh, 520px); overflow: auto; }
.history-review-table { min-width: 740px; }
.history-review-table th, .history-review-table td { padding: 9px 11px; white-space: normal; vertical-align: top; }
.history-review-table th:nth-child(2), .history-review-table td:nth-child(2) { min-width: 350px; }
.history-review-record { min-width: 0; border: 0; border-radius: 0; background: transparent; }
.history-review-record > summary { min-height: 34px; padding: 3px 0; }
.history-review-record-body { padding: 3px 0 10px; }
.history-review-values strong { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.history-review-form .dialog-actions [data-history-save]:disabled { cursor: not-allowed; }
.import-actions { justify-content: flex-start; flex-wrap: wrap; }
.fictional-preview-disabled-note { margin: 9px 0 0; }
.preview-demo-notice { margin: 0 24px 12px; padding: 9px 12px; border-left: 3px solid #718390; background: #f2f5f6; color: var(--ink); font-size: 13px; line-height: 1.45; }
.preview-demo-notice strong { margin-right: 4px; }
@media (max-width: 760px) {
  .roster-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .roster-toolbar .search-box { grid-column: 1 / -1; max-width: none; }
  .roster-toolbar .status-filter { grid-column: 1; }
  .roster-toolbar .tbe-pref-trigger { grid-column: 2; grid-row: 2; }
  .organization-toolbar .filter-tabs { flex-wrap: wrap; }
  .import-preview-toolbar { grid-template-columns: minmax(0, 1fr) auto; padding-right: 16px; padding-left: 16px; }
  .import-preview-toolbar .search-box { grid-column: 1 / -1; }
  .import-preview-choice-count { grid-column: 1 / -1; }
  .import-preview-dialog .preview-stats, .import-preview-dialog .history-review-count { margin-right: 16px; margin-left: 16px; padding-right: 0; padding-left: 0; }
  .import-preview-header, .preview-footer { padding-right: 16px; padding-left: 16px; }
  .import-preview-dialog .preview-record-list { padding-right: 16px; padding-left: 16px; }
  .preview-demo-notice { margin-right: 16px; margin-left: 16px; }
  .preview-field-change { grid-template-columns: 1fr; gap: 6px; }
  .preview-footer { align-items: flex-start; flex-direction: column; }
  .preview-footer-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .organization-toolbar { align-items: stretch; }
  .organization-toolbar .filter-tabs { flex: 1 1 100%; }
  .organization-toolbar .search-box { flex-basis: 100%; margin-left: 0; }
  .organization-toolbar .tbe-pref-trigger { margin-left: 0; }
  .preview-record > summary { grid-template-columns: 12px max-content minmax(0, 1fr) max-content; gap: 6px; }
  .preview-record-meta { grid-column: auto; }
  .import-preview-dialog .preview-stats { gap: 5px; }
  .import-preview-dialog .preview-stat { min-width: 0; flex: 1 1 95px; }
}

/* Collapsible task navigation and reusable in-page navigation. */
.sidebar { width: 248px; padding: 20px 13px 14px; background: #fff; border-right: 1px solid var(--line); border-top: 0; }
.main-area { width: calc(100% - 248px); margin-left: 248px; }
.brand { justify-content: center; min-height: 0; padding: 0 5px 16px; }
.brand-logo { display: block; width: min(100%, 154px); height: auto; object-fit: contain; }
.sidebar-rule { display: block; height: 1px; background: var(--line); margin: 0 8px 14px; }
.primary-nav { display: grid; width: 100%; gap: 4px; }
.nav-item { min-height: 43px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 11px; border-radius: 4px; color: var(--ink); font-size: 14px; font-weight: 550; }
.nav-item:not(:disabled):not([aria-disabled="true"]):hover { background: #f4f7f8; }
.nav-item.is-active { background: #e8f1df; color: var(--ink); }
.nav-icon { display: block; flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { margin-left: auto; }
.sidebar-toggle { width: 100%; min-height: 40px; display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 12px; padding: 8px 10px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.sidebar-toggle:not(:disabled):not([aria-disabled="true"]):hover { border-color: var(--line); background: #f7f9fa; color: var(--ink); }
.sidebar-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main-area { min-height: 100vh; }
.topbar { position: sticky; top: 0; min-height: 46px; padding: 7px 25px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.event-switch-status { margin-left: auto; }
.settings-heading { align-items: center; }
.settings-heading-title { display: flex; align-items: center; gap: 12px; }
.settings-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); align-items: start; gap: 30px; }
.settings-layout.is-secondary-nav-hidden { grid-template-columns: minmax(0, 1fr); gap: 0; }
.secondary-nav { display: grid; align-content: start; gap: 3px; }
.settings-secondary-nav { position: sticky; top: var(--settings-sticky-top, 0px); align-self: start; }
.settings-nav-toggle { width: 40px; min-width: 40px; min-height: 40px; display: inline-flex; justify-content: center; align-items: center; margin: 0; padding: 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.settings-nav-toggle:not(:disabled):not([aria-disabled="true"]):hover { border-color: var(--line); background: #f7f9fa; color: var(--ink); }
.settings-nav-toggle:focus-visible { outline: 3px solid rgba(72, 140, 192, .42); outline-offset: 2px; }
.settings-nav-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-nav-toggle .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
#sidebar-toggle[hidden], #settings-nav-toggle[hidden] { display: none; }
.secondary-nav-item { min-height: 40px; display: flex; align-items: center; padding: 8px 11px; border: 0; border-left: 3px solid transparent; border-radius: 0 4px 4px 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; line-height: 1.35; text-align: left; text-decoration: none; }
.secondary-nav-item:not(:disabled):not([aria-disabled="true"]):hover { background: #f5f8f9; color: var(--ink); }
.secondary-nav-item.is-active { border-left-color: #488cc0; background: #e8f1df; font-weight: 650; }
.secondary-nav-item:focus-visible { position: relative; z-index: 1; }
.settings-sections { min-width: 0; display: grid; gap: 0; }
.settings-sections > .settings-section { scroll-margin-top: var(--settings-section-scroll-top, 20px); padding: 21px 0 22px; border: 0; border-radius: 0; background: transparent; }
.settings-sections > .settings-section + .settings-section { border-top: 2px solid #9aaab2; }
.settings-sections .panel-heading-tight { padding-right: 0; padding-left: 0; }
.settings-section > .form-field { max-width: 850px; margin: 0 0 14px; }
.settings-section > .event-picker { margin: 1px 0 0; padding: 0; }
.settings-section .dialog-form { padding: 0; display: grid; gap: 12px; }
.settings-section .form-field { max-width: 850px; }
.settings-section .toolbar { padding-right: 0; padding-left: 0; }
.settings-section .panel-heading .button { flex: 0 0 auto; }
.count-strip { margin: -6px 0 10px; padding: 0 0 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 650; }
#settings-history .table-scroll { max-width: 100%; }
#settings-history .audit-toolbar { min-height: 0; padding: 0 0 12px; }
#settings-history .audit-toolbar .search-box { width: min(100%, 420px); }
#settings-history .audit-toolbar .muted-inline { margin-left: auto; white-space: nowrap; }
.button-danger { border-color: #9d3838; background: #b74949; color: #fff; }
.button-danger:not(:disabled):not([aria-disabled="true"]):hover { border-color: #762828; background: #8f3030; color: #fff; }
.app-frame.is-sidebar-collapsed .sidebar { width: 76px; padding-right: 9px; padding-left: 9px; }
.app-frame.is-sidebar-collapsed .main-area { width: calc(100% - 76px); margin-left: 76px; }
.app-frame.is-sidebar-collapsed .brand { padding-right: 0; padding-left: 0; }
.app-frame.is-sidebar-collapsed .brand-logo { width: 43px; }
.app-frame.is-sidebar-collapsed .sidebar-rule { width: 34px; margin-right: auto; margin-left: auto; }
.app-frame.is-sidebar-collapsed .nav-item { position: relative; justify-content: center; width: 48px; min-height: 46px; gap: 0; margin: 0 auto; padding: 0; }
.app-frame.is-sidebar-collapsed .nav-item > span:first-of-type { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
.app-frame.is-sidebar-collapsed .nav-item .nav-count { position: absolute; top: 2px; right: 1px; min-width: 17px; margin: 0; padding: 0 4px; border: 1px solid #fff; border-radius: 12px; background: #dceef7; font-size: 11px; line-height: 16px; }
.app-frame.is-sidebar-collapsed .sidebar-toggle { min-height: 42px; padding: 8px; }
.app-frame.is-sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.app-frame.is-sidebar-collapsed .sidebar-toggle .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; gap: 13px; }
  .settings-secondary-nav { position: sticky; top: var(--settings-sticky-top, 0px); z-index: 3; display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--line); background: #fff; }
  #settings-nav-toggle { display: none; }
  .secondary-nav-item { flex: 0 0 auto; border-left: 0; border-bottom: 3px solid transparent; border-radius: 4px 4px 0 0; white-space: nowrap; }
  .secondary-nav-item.is-active { border-bottom-color: #488cc0; }
}
@media (max-width: 860px) {
  .app-frame { display: block; }
  .sidebar { position: sticky; inset: 0 0 auto; z-index: 8; width: 100%; height: 62px; min-height: 62px; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { flex: 0 0 auto; width: 104px; justify-content: flex-start; padding: 0; }
  .brand-logo { width: auto; height: auto; max-width: 102px; max-height: 44px; }
  .sidebar-rule, .sidebar-spacer { display: none; }
  .primary-nav { flex: 1 1 auto; min-width: 0; width: auto; display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; overflow-x: auto; padding: 0 0 3px; }
  .nav-item { flex: 0 0 auto; width: auto; min-height: 39px; padding: 0 9px; gap: 7px; white-space: nowrap; }
  .sidebar-toggle { flex: 0 0 38px; width: 38px; min-height: 38px; margin: 0 0 0 auto; padding: 7px; }
  .sidebar-toggle .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
  .main-area, .app-frame.is-sidebar-collapsed .main-area { width: 100%; margin-left: 0; }
  .app-frame.is-sidebar-collapsed .sidebar { width: 100%; }
  .app-frame.is-sidebar-collapsed .brand { width: 42px; }
  .app-frame.is-sidebar-collapsed .brand-logo { width: 40px; }
  .app-frame.is-sidebar-collapsed .primary-nav { justify-content: flex-start; }
  .app-frame.is-sidebar-collapsed .nav-item { width: 40px; min-height: 38px; margin: 0; padding: 0; }
  .app-frame.is-sidebar-collapsed .sidebar-toggle { margin-left: auto; }
  .topbar { padding-right: 18px; padding-left: 18px; }
}
@media (max-width: 480px) {
  .sidebar { gap: 6px; padding-right: 8px; padding-left: 8px; }
  .brand { width: 80px; }
  .brand-logo { width: auto; max-width: 78px; }
  .app-frame.is-sidebar-collapsed .brand { width: 36px; }
  .app-frame.is-sidebar-collapsed .brand-logo { width: 35px; }
  .nav-item { padding: 0 7px; font-size: 13px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .settings-sections > .settings-section { padding-right: 0; padding-left: 0; }
  .settings-section .panel-heading-tight { padding-right: 0; padding-left: 0; }
  .settings-section .panel-heading .button { white-space: normal; }
  .settings-section > .event-picker { flex: initial; justify-content: flex-start; padding-right: 0; padding-left: 0; }
  .settings-section > .event-picker select { max-width: min(66vw, 280px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Event-scoped live Google Sheets and optional downloads. */
#page-outputs .google-outputs { margin-bottom: 24px; }
#page-outputs .google-outputs > .panel-heading { padding: 0 0 12px; }
.google-output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.google-output-item { min-width: 0; padding: 15px 16px; border: 1px solid var(--line); background: #fff; }
.google-output-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.google-output-heading h3 { min-width: 0; overflow-wrap: anywhere; margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.google-output-state { color: var(--muted); font-size: 12px; font-weight: 650; }
.google-output-stale .google-output-state { color: #76591b; }
.google-output-blocked .google-output-state { color: #8e3838; }
.google-output-message { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.google-output-updated { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.google-output-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.google-output-actions .button { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.google-output-settings-link { color: var(--brand-blue-dark); font-size: 12px; }
.google-output-error { margin: 9px 0 0; color: #8e3838; font-size: 13px; }
.google-output-loading, .google-output-load-error { margin: 0; padding: 14px 0; color: var(--muted); font-size: 13px; }
.google-output-load-error { display: flex; align-items: center; gap: 12px; }
.google-output-load-error p { margin: 0; }
.google-output-load-error .button { min-height: 33px; padding: 5px 9px; font-size: 13px; }
@media (max-width: 640px) {
  .google-output-grid { grid-template-columns: 1fr; }
}
.output-all-data { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.google-output-actions .google-output-open { border-color: #91ad71; background: var(--teal); color: var(--ink); font-size: 13px; }
.google-output-actions .google-output-open:not(:disabled):hover { border-color: #91ad71; background: #cee2b2; color: var(--ink); }
.google-schedule-budget-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 10px; }
.google-schedule-budget { margin: 0; color: var(--muted); font-size: 12px; }
.google-schedule-budget-row .button { flex: 0 0 auto; }
.google-schedule-budget.is-over-limit, .google-schedule-error { color: #8e3838; }
.google-sheet-schedule { display: grid; justify-items: start; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.google-sheet-schedule-controls { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 28px auto auto; align-items: center; gap: 5px 12px; }
.google-sheet-schedule-heading { grid-column: 1; grid-row: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.google-sheet-schedule-heading > span { font-weight: 650; }
.google-sheet-schedule-value { min-width: 0; color: var(--ink); font-size: 13px; font-weight: 500; text-align: right; }
.google-sheet-schedule-track { grid-column: 1 / -1; grid-row: 2; position: relative; isolation: isolate; width: 100%; height: 28px; display: flex; align-items: center; }
.google-sheet-schedule-track::before { content: ""; position: absolute; z-index: 0; left: 10px; right: 10px; top: 50%; height: 4px; border-radius: 2px; background: linear-gradient(to right, #a9c38a 0, #a9c38a var(--google-schedule-progress, 0%), #dce3e3 var(--google-schedule-progress, 0%), #dce3e3 85%, #edf0ef 85%, #edf0ef 100%); transform: translateY(-50%); pointer-events: none; }
.google-sheet-schedule-range { -webkit-appearance: none; appearance: none; position: relative; z-index: 1; display: block; width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0; background: transparent; accent-color: #819d5d; cursor: pointer; }
.google-sheet-schedule-range:disabled { cursor: not-allowed; }
.google-sheet-schedule-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: transparent; }
.google-sheet-schedule-range::-moz-range-track { height: 4px; border: 0; border-radius: 2px; background: transparent; }
.google-sheet-schedule-range::-moz-range-progress { height: 4px; border-radius: 2px; background: transparent; }
.google-sheet-schedule-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 1px solid #849d6c; border-radius: 50%; background: var(--teal); }
.google-sheet-schedule-range::-moz-range-thumb { width: 20px; height: 20px; border: 1px solid #849d6c; border-radius: 50%; background: var(--teal); }
.google-sheet-schedule-manual-divider { position: absolute; z-index: 0; left: calc(85% - 7px); top: 50%; height: 18px; border-left: 1px solid #9da9a2; transform: translate(-50%, -50%); pointer-events: none; }
.google-sheet-schedule-endpoints { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: space-between; gap: 12px; padding: 0 10px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.google-sheet-schedule-manual-endpoint { text-align: right; }
.google-sheet-schedule .button { grid-column: 1; grid-row: 4; justify-self: end; align-self: start; min-height: 34px; padding: 5px 9px; font-size: 13px; }
.google-schedule-loading { color: var(--muted); font-size: 12px; line-height: 1.4; }
.google-schedule-retry { min-height: 31px !important; padding: 4px 8px !important; }
@media (max-width: 640px) {
  .google-sheet-schedule-controls { gap: 5px 8px; }
  .google-sheet-schedule .button { white-space: nowrap; }
}
.custom-outputs { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
#page-outputs .custom-outputs > .panel-heading { padding: 0 0 8px; }
.custom-output-status { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.custom-output-grid { margin-top: 8px; }
.custom-output-secondary-actions { margin-top: 7px; }
.custom-output-delete { color: #8e3838; }
.custom-output-delete:not(:disabled):hover { background: #fff1ef; color: #762d2d; }
.app-dialog.custom-output-dialog { position: relative; width: min(1120px, calc(100vw - 28px)); max-height: min(94vh, 1080px); overflow-x: hidden; }
.custom-output-dialog .dialog-top { position: absolute; top: 12px; right: 14px; padding: 0; border: 0; background: transparent; }
.custom-output-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; box-sizing: border-box; padding: 17px 22px 20px; background: #fff; }
.custom-output-editor > * { min-width: 0; max-width: 100%; }
.custom-output-editor-heading { padding-right: 42px; }
.custom-output-editor-heading h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; }
.custom-output-editor-subheading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.custom-output-name-field, .custom-output-filter-select { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.custom-output-name-field input, .custom-output-filter-select select { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 450; }
.custom-output-tabs { --custom-output-drop-offset: -6.5px; display: flex; align-items: flex-start; gap: 7px; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior: contain; min-height: 35px; box-sizing: border-box; padding: 2px 0 7px 8px; border-bottom: 1px solid var(--line); }
.custom-output-tab-item { position: relative; display: flex; flex: 0 0 190px; flex-direction: column; align-items: stretch; width: 190px; min-height: 47px; box-sizing: border-box; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; }
.custom-output-tab-item.is-selected, .custom-output-column.is-selected, .custom-output-tab-item:not(.is-selected):focus-within, .custom-output-column:focus-visible { border-color: #9abbb6; box-shadow: none; }
.custom-output-tab-item.is-selected .custom-output-tab-header { background: #f4f8f8; }
.custom-output-tab-item:not(.is-selected):hover:not(:focus-within) { border-color: #c5d4d7; background: #fbfdfd; }
.custom-output-tab-header { display: flex; align-items: center; gap: 5px; width: 100%; height: 45px; min-height: 45px; padding: 6px 7px; box-sizing: border-box; background: #f7f9fa; }
.custom-output-tab { display: flex; flex: 1 1 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; width: 0; height: 38px; min-width: 0; max-width: none; min-height: 30px; overflow: hidden; padding: 2px 3px; box-sizing: border-box; border: 0; border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; text-align: left; }
.custom-output-tab-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-output-tab-source-name { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.custom-output-tab:hover { background: #f1f6f6; color: var(--ink); }
.custom-output-tab.is-selected { flex: 1 1 auto; min-width: 0; padding: 0; background: transparent; color: var(--ink); font-weight: 650; }
.custom-output-tab-name-input { width: clamp(82px, 14vw, 165px); max-width: 100%; min-height: 30px; padding: 4px 6px; box-sizing: border-box; border: 1px solid #abc1bf; border-radius: 2px; outline: 0; background: #fff; color: var(--ink); cursor: text; font: inherit; font-size: 13px; }
.custom-output-tab-name-input:focus-visible { outline: 0; }
.custom-output-tab:focus-visible { outline: 0; }
.custom-output-column-heading:focus-visible, .custom-output-inline-remove:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.custom-output-drag-handle { display: inline-flex; flex: 0 0 24px; align-items: center; justify-content: center; min-height: 28px; padding: 0; border: 1px solid #c8d0d5; border-radius: 3px; background: #edf0f2; color: #56636b; cursor: grab; font-size: 17px; font-weight: 700; line-height: 1; }
.custom-output-drag-handle:hover { border-color: #9caab1; background: #dfe5e8; color: #34434c; }
.custom-output-drag-handle:active { cursor: grabbing; }
.custom-output-drag-handle:disabled { cursor: not-allowed; }
.custom-output-tab-drag-handle { flex-basis: 20px; align-self: center; margin: 0; }
.custom-output-tab-item.is-selected .custom-output-tab-drag-handle { margin: 0; }
.custom-output-tab-item.is-dragging { opacity: 1; background: #e8f1ef; box-shadow: 0 0 0 1px #9abbb6; }
.custom-output-tab-add, .custom-output-add-column { flex: 0 0 auto; min-height: 32px; padding: 5px 8px; font-size: 12px; }
.custom-output-tab-inline-remove { flex: 0 0 25px; width: 25px; min-height: 25px; margin: 0 3px 0 0; padding: 0; border: 0; border-radius: 3px; background: transparent; font-size: 19px; }
.custom-output-tab-setting { display: grid; gap: 3px; width: 100%; box-sizing: border-box; margin: 0; padding: 5px 7px; border-top: 1px solid #dfe6ea; background: #fff; color: var(--muted); font-size: 10px; font-weight: 650; }
.custom-output-tab-audience-row { gap: 4px; }
.custom-output-audience-group { gap: 4px 8px; margin: 0; }
.custom-output-audience-group .custom-output-filter-option { gap: 4px; font-size: 10px; }
.custom-output-audience-group input { margin: 0; }
.custom-output-audience-conflict { color: #825f24; font-size: 10px; font-weight: 450; line-height: 1.35; }
.custom-output-tab-setting select, .custom-output-option-setting select { width: 100%; min-width: 0; min-height: 27px; padding: 2px 5px; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 450; }
.custom-output-options { border-top: 1px solid #dfe6ea; background: #fbfcfc; }
.custom-output-options summary { width: fit-content; padding: 5px 7px; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 650; }
.custom-output-options-content { display: grid; gap: 7px; padding: 0 7px 8px; }
.custom-output-option-setting { display: grid; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 600; }
.custom-output-options .custom-output-filter-group { gap: 5px 8px; margin: 0; }
.custom-output-options .custom-output-filter-option { gap: 4px; font-size: 10px; }
.custom-output-options .custom-output-filter-option input { margin: 0; }
.custom-output-tab-picker { position: fixed; z-index: 1000; inset: auto; display: grid; gap: 10px; width: min(680px, calc(100vw - 24px)); max-height: min(540px, calc(100vh - 24px)); overflow: auto; margin: 0; padding: 12px; border: 1px solid #c8d5d9; border-radius: 5px; background: #fff; color: var(--ink); box-shadow: 0 14px 38px rgba(24, 43, 48, .2); }
.custom-output-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-output-picker-heading strong { font-size: 14px; }
.custom-output-tab-categories { display: flex; gap: 5px; border-bottom: 1px solid #dfe6ea; }
.custom-output-tab-category { min-height: 30px; padding: 5px 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; }
.custom-output-tab-category.is-selected { border-color: #c8d5d9; background: #fff; color: var(--ink); }
.custom-output-picker-content { display: grid; grid-template-columns: minmax(190px, .82fr) minmax(250px, 1.18fr); align-items: start; gap: 11px; min-height: 0; }
.custom-output-add-choices { display: grid; align-content: start; gap: 5px; max-height: min(350px, calc(100vh - 210px)); overflow-y: auto; padding-right: 3px; }
.custom-output-add-choice { display: grid; gap: 3px; min-height: 44px; padding: 7px 9px; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; text-align: left; }
.custom-output-add-choice:hover:not(:disabled), .custom-output-add-choice.is-previewed { border-color: #9abbb6; background: #f4f8f8; }
.custom-output-add-choice:focus-visible, .custom-output-tab-category:focus-visible, .custom-output-picker-close:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.custom-output-add-choice small { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.35; }
.custom-output-add-choice:disabled { color: #7d898e; cursor: not-allowed; }
.custom-output-picker-preview { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #e2e9eb; border-radius: 3px; background: #fbfcfc; }
.custom-output-picker-preview-title { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.custom-output-picker-preview-description, .custom-output-picker-preview-details { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.custom-output-picker-field-disclosure > summary { width: fit-content; max-width: 100%; color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.custom-output-picker-field-disclosure[open] > summary { margin-bottom: 6px; }
.custom-output-picker-field-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; max-height: 175px; overflow: auto; margin: 0; padding: 1px 2px 1px 0; list-style: none; }
.custom-output-picker-field-list li { max-width: 100%; padding: 3px 6px; overflow-wrap: anywhere; border: 1px solid #e1e7e9; border-radius: 3px; background: #fff; color: #46565d; font-size: 10px; line-height: 1.3; }
.custom-output-picker-sample-scroll { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid #e1e7e9; background: #fff; }
.custom-output-picker-sample-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 10px; }
.custom-output-picker-sample-table th, .custom-output-picker-sample-table td { padding: 5px 7px; border-bottom: 1px solid #e7ecee; color: #46565d; text-align: left; white-space: nowrap; }
.custom-output-picker-sample-table th { background: #f0f4f5; color: #34434c; font-weight: 700; }
.custom-output-picker-empty { margin: 0; padding: 7px; color: var(--muted); font-size: 12px; }
.custom-output-picker-close { min-height: 28px; padding: 4px 8px; font-size: 12px; }
@media (max-width: 640px) {
  .custom-output-tab-picker { width: calc(100vw - 20px); max-height: calc(100vh - 20px); padding: 10px; }
  .custom-output-picker-content { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .custom-output-add-choices { max-height: 155px; }
}
.custom-output-report-settings { display: grid; gap: 8px; }
.custom-output-report-setting { min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid #dfe6ea; border-radius: 3px; }
.custom-output-report-setting legend { padding: 0 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.custom-output-report-options { display: flex; flex-wrap: wrap; gap: 6px 13px; }
.custom-output-report-options .custom-output-filter-option { font-size: 12px; }
.custom-output-report-validation { color: #825f24; font-size: 12px; }
.custom-output-source-context { color: var(--muted); font-size: 12px; }
.custom-output-raw-all-summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.custom-output-tab-item.drop-before::before, .custom-output-tab-item.drop-after::after { position: absolute; z-index: 8; top: -4px; bottom: -4px; width: 4px; border-radius: 3px; background: #12645e; box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(20, 50, 48, .38); content: ''; pointer-events: none; }
.custom-output-tab-item.drop-before::before { left: var(--custom-output-drop-offset); }
.custom-output-tab-item.drop-after::after { right: var(--custom-output-drop-offset); }
.custom-output-columns { --custom-output-drop-offset: -6.5px; display: flex; align-items: flex-start; gap: 7px; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow-x: auto; overscroll-behavior: contain; padding: 2px 0 8px 8px; }
.custom-output-sticky-end-cap { position: sticky; right: 0; z-index: 3; display: flex; flex: 0 0 auto; align-self: stretch; align-items: flex-start; min-height: 47px; padding-left: 4px; box-sizing: border-box; border-left: 1px solid transparent; background: #fff; }
.custom-output-sticky-end-cap.is-overlapping::before { position: absolute; top: 0; left: -9px; width: 8px; height: var(--custom-output-overlap-shadow-height, 47px); background: linear-gradient(to right, rgba(37, 52, 60, 0), rgba(37, 52, 60, .18)); content: ''; pointer-events: none; }
.custom-output-sticky-end-cap > .custom-output-tab-add, .custom-output-sticky-end-cap > .custom-output-add-column { height: 47px; min-height: 47px; margin: 0; background: #fff; }
.custom-output-sticky-end-cap > .custom-output-tab-add:not(:disabled):hover, .custom-output-sticky-end-cap > .custom-output-add-column:not(:disabled):hover { background: #fff; }
.custom-output-sticky-end-cap > .custom-output-tab-add:disabled, .custom-output-sticky-end-cap > .custom-output-add-column:disabled { opacity: 1; color: #7d898e; cursor: not-allowed; }
.custom-output-column { position: relative; display: flex; flex: 0 0 190px; flex-direction: column; align-items: stretch; gap: 0; width: 190px; min-width: 190px; max-width: 190px; min-height: 46px; overflow: visible; box-sizing: border-box; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); }
.custom-output-column:not(.is-selected):hover:not(:focus-visible) { border-color: #c5d4d7; background: #fbfdfd; }
.custom-output-column:not(.is-selected):hover .custom-output-column-heading { background: #f1f6f6; }
.custom-output-column.is-selected { z-index: 1; background: #fff; }
.custom-output-column:focus-visible { outline: 0; }
.custom-output-column.is-dragging { opacity: 1; border-color: #9abbb6; background: #dcece9; box-shadow: 0 0 0 2px #9abbb6; }
.custom-output-column.drop-before::before, .custom-output-column.drop-after::after { position: absolute; z-index: 8; top: -4px; bottom: -4px; width: 4px; border-radius: 3px; background: #12645e; box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(20, 50, 48, .38); content: ''; pointer-events: none; }
.custom-output-column.drop-before::before { left: var(--custom-output-drop-offset); }
.custom-output-column.drop-after::after { right: var(--custom-output-drop-offset); }
.custom-output-column-heading-host { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 45px; padding: 6px 7px; border-radius: 3px 3px 0 0; background: #f7f9fa; }
.custom-output-column.is-selected .custom-output-column-heading-host { border-radius: 2px 2px 0 0; background: #f4f8f8; }
.custom-output-column-drag-handle { flex-basis: 20px; }
.custom-output-column-heading { flex: 1 1 auto; min-width: 0; min-height: 30px; overflow: hidden; padding: 4px 3px; border: 0; border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.custom-output-column-heading-host input { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 30px; padding: 4px 6px; border: 1px solid #abc1bf; border-radius: 2px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 650; }
.custom-output-column-heading-host input:focus-visible { outline: 0; }
.custom-output-column-field-picker { display: flex; align-items: center; gap: 7px; padding: 4px 9px 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
.custom-output-column-field-picker > label { flex: 0 0 auto; }
.custom-output-inline-remove { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 24px; min-height: 24px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: #b33d3d; cursor: pointer; font: inherit; font-size: 19px; line-height: 1; text-align: center; }
.custom-output-column-inline-remove { width: 25px; min-height: 25px; }
.custom-output-column-field-picker select { flex: 1 1 auto; width: auto; min-width: 0; min-height: 32px; padding: 5px 7px; border: 1px solid #dfe6ea; border-radius: 3px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 450; }
.custom-output-column-field-picker select option:disabled { background-color: #eef1f2; color: #7b888d; }
.custom-output-tab-inline-remove { color: #b33d3d; }
.custom-output-tab-inline-remove:hover:not(:disabled) { background: #fff1ef; color: #762d2d; }
.custom-output-column-inline-remove:hover:not(:disabled) { background: #fff1ef; color: #762d2d; }
.custom-output-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.custom-output-editor-actions .button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.custom-output-no-columns { display: flex; flex: 0 0 190px; align-items: center; width: 190px; min-width: 190px; max-width: 190px; min-height: 47px; margin: 0; padding: 6px 7px; border: 1px solid #dfe6ea; border-radius: 3px; background: #f7f9fa; color: var(--muted); font-size: 12px; line-height: 1.35; }
.custom-output-update-notice { margin: 0; padding: 9px 11px; border: 1px solid #ead9ab; background: #fffaeb; color: var(--ink); font-size: 13px; line-height: 1.45; }
.custom-output-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
.custom-output-filter-option { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 12px; }
.custom-output-dialog .unsaved-confirmation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 22px 16px; padding: 8px 10px; }
.custom-output-dialog .unsaved-confirmation p { font-size: 13px; }
.custom-output-dialog .unsaved-confirmation-actions .button { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.custom-output-filter-select { min-width: 145px; }
.custom-output-editor-error { margin: 0; color: #8e3838; font-size: 13px; }
.custom-output-preview { width: 100%; min-width: 0; max-width: 100%; }
.custom-output-preview-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
.custom-output-preview-count { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.custom-output-preview-table { font-size: 12px; }
.custom-output-preview-table { width: max-content; min-width: 100%; }
.custom-output-preview-table th, .custom-output-preview-table td { min-width: 130px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .app-dialog.custom-output-dialog { width: calc(100vw - 18px); max-height: 94vh; }
  .custom-output-dialog .dialog-top { top: 11px; right: 12px; }
  .custom-output-editor { padding: 14px 15px 16px; }
  .custom-output-editor-actions .button { flex: 1; }
  .custom-output-options-content { align-items: stretch; }
  .custom-output-dialog .unsaved-confirmation { margin: 0 15px 14px; }
}
@media (max-width: 1120px) {
  /* The toolbar stacks vertically here, so a flex-basis would size the search box height. */
  .organization-toolbar .search-box { flex: 0 0 auto; margin-left: 0; }
}

/* Sign-in: a focused card over a blurred, unreadable workspace. */
.login-dialog { width: min(380px, calc(100vw - 32px)); border-color: #e3e9ec; border-radius: 10px; box-shadow: 0 20px 60px rgba(9, 28, 45, .16); text-align: center; }
.login-dialog[open] { display: flex; flex-direction: column; }
.login-dialog::backdrop { background: rgba(238, 243, 242, .6); -webkit-backdrop-filter: blur(24px) saturate(.85); backdrop-filter: blur(24px) saturate(.85); }
.login-logo { order: -1; display: block; width: 104px; height: auto; margin: 30px auto 4px; }
.login-dialog .dialog-top { position: static; justify-content: center; padding: 6px 28px 0; border-bottom: 0; background: transparent; }
.login-dialog .dialog-top .eyebrow, .login-dialog .dialog-close { display: none; }
.login-dialog .dialog-top h2 { font-size: 22px; }
.login-dialog .dialog-subtitle { margin-top: 6px; font-size: 14px; }
.login-dialog .dialog-form { padding: 16px 28px 30px; }
.login-dialog .form-field { text-align: left; }
.login-dialog .dialog-actions { justify-content: center; margin-top: 10px; padding-top: 0; border-top: 0; }
.login-dialog .dialog-actions .button { width: 100%; min-height: 44px; justify-content: center; gap: 8px; white-space: nowrap; font-size: 15px; }
.login-dialog [role="alert"] { margin: 0 0 4px; line-height: 1.45; }

/* Service sites page (public/sites.js). */
.site-table .muted, #site-edit-form .muted, #site-import-form .muted, .site-org-picker .muted { color: var(--muted); font-size: 12px; }
.site-table { table-layout: fixed; min-width: 860px; }
.site-table th, .site-table td { vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
.site-table th:nth-child(1) { width: 28%; }
.site-table th:nth-child(2) { width: 26%; }
.site-table th:nth-child(3) { width: 18%; }
.site-table th:nth-child(4) { width: 18%; }
.site-table th:nth-child(5) { width: 10%; }
.site-import-button { cursor: pointer; }
.site-import-list { max-height: 260px; overflow-y: auto; margin: 10px 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.site-org-picker { margin: 14px 0 0; padding: 10px 12px; border: 1px solid #e2e8ec; border-radius: 3px; }
.site-org-picker legend { padding: 0 4px; font-size: 13px; font-weight: 650; }
.site-org-filter { width: 100%; margin-bottom: 8px; padding: 6px 8px; border: 1px solid #cfd9de; border-radius: 3px; font: inherit; font-size: 13px; }
.site-org-options { display: grid; max-height: 220px; overflow-y: auto; gap: 4px; font-size: 13px; }
.site-org-options label { display: flex; align-items: baseline; gap: 6px; }
