:root {
  color-scheme: light;
  --navy: #0f172a;
  --navy-2: #17233c;
  --blue: #0d9488;
  --blue-dark: #0f766e;
  --blue-soft: #f0fdfa;
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --gold: #b7791f;
  --gold-soft: #fff6df;
  --red: #bd3039;
  --red-soft: #fff0f1;
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --canvas: #f6f9fb;
  --shadow: 0 18px 45px rgba(15, 23, 42, .055), 0 8px 18px rgba(13, 148, 136, .055);
  --radius: 20px;
  --sidebar: 278px;
  font-family: Outfit, "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 91% 4%, rgba(45,212,191,.12), transparent 25rem), var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2.1rem, 3vw, 2.9rem); font-weight: 900; line-height: 1.06; letter-spacing: -.05em; }
h2 { margin-bottom: 8px; font-size: 1.18rem; line-height: 1.3; }
h3 { margin-bottom: 6px; font-size: 1rem; line-height: 1.35; }
p { color: var(--muted); line-height: 1.55; }
small { color: var(--muted); line-height: 1.4; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.page-progress { position: fixed; inset: 0 0 auto; z-index: 2000; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .12s; }
.page-progress span { display: block; width: 45%; height: 100%; border-radius: 99px; background: linear-gradient(90deg,var(--teal),#5eead4); transform: translateX(-110%); }
body.fluid-loading .page-progress { opacity: 1; }
body.fluid-loading .page-progress span { animation: fluid-progress .8s ease-in-out infinite; }
@keyframes fluid-progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
::view-transition-old(root) { animation: fluid-fade-out .09s ease both; }
::view-transition-new(root) { animation: fluid-fade-in .15s ease both; }
@keyframes fluid-fade-out { to { opacity: .88; } }
@keyframes fluid-fade-in { from { opacity: .88; } }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 16px; height: calc(100vh - 32px); display: flex; flex-direction: column; margin: 16px 0 16px 16px; padding: 25px 18px 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 36px; background: rgba(238,243,246,.94); color: var(--navy); box-shadow: 0 18px 48px rgba(15,23,42,.07); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 24px; color: var(--navy); }
.brand:hover, .mobile-brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(145deg, var(--teal), #14b8a6); color: #fff; font-size: .78rem; font-weight: 900; letter-spacing: .06em; box-shadow: 0 10px 24px rgba(13,148,136,.26); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.2rem; font-weight: 900; letter-spacing: -.04em; }
.brand small { margin-top: 2px; color: var(--blue-dark); font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.main-nav { display: grid; gap: 4px; }
.main-nav a { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 8px 11px; border: 1px solid transparent; border-radius: 16px; color: #4b5e78; font-size: .86rem; font-weight: 700; transition: background .18s, color .18s, transform .18s; }
.main-nav a:hover { background: rgba(255,255,255,.78); color: var(--blue-dark); text-decoration: none; transform: translateX(2px); }
.main-nav a.active { background: var(--teal); color: #fff; box-shadow: 0 10px 24px rgba(13,148,136,.26); }
.nav-icon { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 11px; background: rgba(255,255,255,.72); font-size: .88rem; }
.main-nav a.active .nav-icon { background: rgba(255,255,255,.16); }
.sidebar-foot { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: flex-start; gap: 9px; margin-top: auto; padding: 14px 9px; border: 1px solid rgba(13,148,136,.12); border-radius: 16px; background: rgba(255,255,255,.62); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: var(--navy); font-size: .72rem; }
.sidebar-foot small { margin-top: 3px; color: var(--muted); font-size: .62rem; }
.status-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #49d6ad; box-shadow: 0 0 0 4px rgba(73,214,173,.12); }
.account-summary { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: end; gap: 5px 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.account-summary a, .account-summary button { padding: 0; border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font-size: .62rem; font-weight: 800; }
.account-summary form { margin: 0; }
.page-column { min-width: 0; }
.mobile-header, .mobile-nav { display: none; }
main { width: 100%; max-width: 1660px; margin: 0 auto; padding: 38px clamp(28px, 3vw, 48px) 70px; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-shell { display: grid; width: 100%; max-width: 470px; padding: 0; }
.login-card { display: grid; gap: 24px; padding: clamp(28px,6vw,48px); border: 1px solid rgba(255,255,255,.9); border-radius: 32px; background: rgba(255,255,255,.96); box-shadow: 0 28px 75px rgba(15,23,42,.12); }
.login-card h1 { margin-bottom: 6px; }
.login-card p { margin-bottom: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { color: var(--navy); font-size: 1.2rem; font-weight: 900; }
.login-brand small { color: var(--blue-dark); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-password-panel { max-width: 620px; }

.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 13px 15px; border: 1px solid #9bd8c9; border-radius: 10px; background: var(--teal-soft); color: #135e52; font-size: .9rem; }
.notice > span:first-child { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; font-size: .72rem; }
.notice.error { border-color: #e9abb0; background: var(--red-soft); color: #8f212a; }
.notice.error > span:first-child { background: var(--red); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 26px; }
.page-heading > div:first-child { max-width: 820px; }
.page-heading p:not(.eyebrow) { max-width: 720px; margin-bottom: 0; }
.narrow-heading { max-width: 760px; padding-top: 10vh; }
.eyebrow { margin-bottom: 6px; color: var(--blue-dark); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button-row.compact { gap: 5px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 9px 16px; border: 1px solid transparent; border-radius: 14px; background: transparent; cursor: pointer; color: var(--ink); font-size: .8rem; font-weight: 800; line-height: 1.2; text-align: center; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { text-decoration: none; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--teal); color: #fff; box-shadow: 0 8px 18px rgba(13,148,136,.2); }
.button.primary:hover { background: var(--blue-dark); }
.button.primary-ghost { border-color: #8bb7f1; background: var(--blue-soft); color: var(--blue-dark); }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(15,23,42,.035); }
.button.secondary:hover { border-color: #9eabbc; background: #f9fafc; }
.button.text-button { color: var(--blue-dark); }
.button.text-button:hover { background: var(--blue-soft); }
.button.danger { border-color: #e5a0a6; background: var(--red-soft); color: var(--red); }
.button.small { min-height: 32px; padding: 6px 10px; font-size: .76rem; }
.button.large { min-height: 50px; padding: 12px 22px; font-size: .9rem; }
.button[disabled] { cursor: wait; opacity: .7; }
.button.disabled { cursor: default; opacity: .55; pointer-events: none; }
.icon-button { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: var(--muted); }
.icon-button:hover { background: #edf1f6; color: var(--ink); }
.icon-button.bordered { border: 1px solid var(--line); background: #fff; }
.copy-button { padding: 2px 0; border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font-size: .73rem; font-weight: 700; }

.panel { border: 1px solid rgba(226,232,240,.95); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.panel-heading h2 { margin-bottom: 0; }
.count-badge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; }
.good-badge, .warning-badge, .interested-badge, .active-badge, .neutral-badge, .deadline-passed, .interest-status { display: inline-flex; align-items: center; width: fit-content; min-height: 25px; padding: 4px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; line-height: 1.2; }
.good-badge { background: var(--teal-soft); color: #14715f; }
.warning-badge { background: var(--gold-soft); color: #8a5b16; }
.interested-badge, .interest-status.on { background: var(--gold-soft); color: #8a5b16; }
.active-badge { background: var(--blue-soft); color: var(--blue-dark); }
.neutral-badge, .interest-status.off { background: #edf0f4; color: #59667a; }
.deadline-passed { background: var(--red-soft); color: var(--red); }
.deadline-passed.inline { display: flex; margin-top: 5px; }
.quiet-line { color: var(--muted); font-size: .82rem; }
.empty-state { display: grid; justify-items: start; gap: 5px; padding: 24px 4px; }
.empty-state.large { justify-items: center; padding: 54px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,.65); text-align: center; }
.empty-state h2, .empty-state h3, .empty-state p { margin-bottom: 0; }
.full-span { grid-column: 1 / -1; }

label { display: grid; gap: 6px; color: #344156; font-size: .78rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); padding: 9px 12px; outline: none; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13,148,136,.1); }
label small { font-weight: 500; }
.form-stack { display: grid; gap: 14px; }
.form-stack.compact { gap: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.inline-form label { flex: 1 1 220px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; }
.check-row input, .check-list input { flex: 0 0 auto; width: 16px; min-height: 16px; margin-top: 2px; }
.check-list { display: grid; max-height: 220px; overflow: auto; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.check-list label { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 14px; }
fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
legend { padding: 0 5px; color: #344156; font-size: .78rem; font-weight: 800; }
.save-state { color: var(--muted); font-size: .72rem; }
.money-input { position: relative; display: flex; align-items: center; }
.money-input > span { position: absolute; left: 11px; color: var(--muted); }
.money-input input { padding-left: 25px; }
.divided-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { display: grid; align-content: start; min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.metric-card > span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.metric-card > strong { margin: 10px 0 14px; font-size: 2rem; line-height: 1; }
.metric-card a { margin-top: auto; font-size: .76rem; font-weight: 700; }
.metric-card small { margin-top: -8px; }
.profit-card { background: linear-gradient(145deg, var(--navy), #1e4269); color: #fff; }
.profit-card > span, .profit-card small { color: #c8d5e7; }
.profit-card > strong { font-size: 1.7rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; margin-bottom: 20px; }
.stack-list { display: grid; }
.stack-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 2px; border-top: 1px solid var(--line); color: var(--ink); }
.stack-row:first-child { border-top: 0; }
.stack-row:hover { text-decoration: none; }
.stack-row > span:not(.date-tile) { min-width: 0; }
.stack-row strong, .stack-row small { display: block; }
.stack-row strong { overflow: hidden; text-overflow: ellipsis; }
.stack-row small { margin-top: 4px; }
.row-arrow { margin-left: auto; color: var(--blue); font-size: 1.2rem; }
.date-tile { display: grid; place-items: center; flex: 0 0 45px; min-height: 45px; border-radius: 9px; background: var(--blue-soft); }
.date-tile strong { font-size: 1.05rem; }
.date-tile small { margin: 0; color: var(--blue-dark); font-size: .6rem; text-transform: uppercase; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 12px minmax(0,1fr); gap: 10px; padding: 13px 2px; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-row p { margin: 3px 0; }
.activity-row strong, .activity-row small { display: block; }
.activity-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }

.sync-summary { margin-bottom: 18px; padding: 17px 19px; border: 1px solid; border-radius: var(--radius); }
.sync-summary.success-box { border-color: #9bd8c9; background: var(--teal-soft); }
.sync-summary.error-box { border-color: #e9abb0; background: var(--red-soft); }
.sync-summary.progress-box { border-color: #9fd8d3; background: linear-gradient(135deg,#f4fbfa,#e7f7f5); }
.sync-summary > div:first-child { display: flex; justify-content: space-between; gap: 16px; }
.sync-summary > div:first-child span { color: var(--muted); font-size: .75rem; }
.sync-summary dl { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); margin: 15px 0 8px; }
.sync-summary dl div { padding: 0 14px; border-left: 1px solid rgba(16,35,63,.13); }
.sync-summary dl div:first-child { padding-left: 0; border-left: 0; }
.sync-summary dt { color: var(--muted); font-size: .68rem; }
.sync-summary dd { margin: 4px 0 0; font-size: 1.25rem; font-weight: 800; }
.sync-summary p { margin: 8px 0 0; }
.sync-progress-track { height: 7px; overflow: hidden; margin: 15px 0 2px; border-radius: 99px; background: rgba(8,122,115,.13); }
.sync-progress-marker { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--teal),#32b7ad); transition: width .25s ease; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.filter-bar label { min-width: 160px; }
.filter-bar .search-field { flex: 1 1 280px; }
.filter-bar input, .filter-bar select { min-height: 37px; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: var(--muted); }
.pagination .button-row > span { white-space: nowrap; }
.result-heading { display: flex; justify-content: space-between; margin: 10px 2px; }
.result-heading p { margin: 0; font-size: .8rem; }
.opportunity-list { display: grid; min-width: 0; gap: 12px; }
.opportunity-card { display: grid; width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr) 180px; gap: 22px; padding: 20px; border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: var(--radius); background: #fff; transition: border-color .15s, box-shadow .15s; }
.opportunity-card > *, .opportunity-main { min-width: 0; }
.opportunity-card:hover { border-color: #b7c7da; box-shadow: var(--shadow); }
.opportunity-card.interested { border-left-color: #e0a43c; }
.card-kicker, .title-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; color: var(--muted); font-size: .69rem; font-weight: 700; }
.opportunity-card h2 { margin-bottom: 9px; overflow-wrap: anywhere; font-size: 1.08rem; }
.opportunity-summary { max-width: 900px; margin-bottom: 14px; overflow-wrap: anywhere; color: #364258; }
.card-kicker span, .opportunity-meta strong { overflow-wrap: anywhere; }
.source-badge, .comparison-badge { display: inline-flex; width: fit-content; padding: 3px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: .63rem; font-weight: 850; }
.summary-unavailable { display: grid; gap: 3px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #ecd6a4; border-radius: 8px; background: var(--gold-soft); color: #6e4a14; font-size: .78rem; }
.summary-unavailable.large { padding: 18px; }
.opportunity-meta { display: flex; flex-wrap: wrap; gap: 18px; }
.opportunity-meta span { display: grid; gap: 2px; }
.opportunity-meta small { font-size: .63rem; text-transform: uppercase; }
.opportunity-meta strong { font-size: .77rem; }
.opportunity-action { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.opportunity-action .button { margin-top: auto; }

.active-summary { display: flex; flex-wrap: wrap; gap: 20px; margin: -8px 0 16px; color: var(--muted); font-size: .8rem; }
.segmented { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.segmented a { padding: 7px 11px; border-radius: 6px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.segmented a:hover { text-decoration: none; }
.segmented a.active { background: var(--navy); color: #fff; }
.table-panel { padding: 0; overflow: hidden; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; border-bottom: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: .65rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 13px; border-bottom: 1px solid var(--line); color: #344156; font-size: .78rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.table-title, .file-title { display: flex; align-items: center; gap: 10px; min-width: 180px; color: var(--ink); }
.table-title strong, .table-title small, .file-title strong, .file-title small { display: block; }
.table-title small, .file-title small { margin-top: 3px; }
.inline-edit { display: flex; align-items: center; gap: 5px; min-width: 200px; }
.inline-edit input { min-height: 34px; }
.active-work-table .table-title { min-width: 0; overflow-wrap: anywhere; }
.money-edit label { position: relative; }
.currency-prefix { position: absolute; left: 9px; top: 8px; color: var(--muted); z-index: 1; }
.money-edit input { padding-left: 21px; }
.kanban-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity; }
.kanban-column { min-height: 380px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #edf1f6; scroll-snap-align: start; }
.kanban-column > header { display: flex; justify-content: space-between; align-items: center; padding: 3px 3px 12px; }
.kanban-column > header h2 { margin: 0; font-size: .85rem; }
.kanban-column > header span { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 99px; background: #fff; font-size: .68rem; font-weight: 800; }
.kanban-stack { display: grid; gap: 9px; }
.kanban-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 3px 9px rgba(16,35,63,.05); }
.kanban-card h3 a { color: var(--ink); }
.kanban-card dl { display: grid; gap: 5px; margin: 12px 0; }
.kanban-card dl div { display: flex; justify-content: space-between; gap: 8px; }
.kanban-card dt, .kanban-card dd { font-size: .69rem; }
.kanban-card dt { color: var(--muted); }
.kanban-card dd { margin: 0; font-weight: 700; text-align: right; }

.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.contact-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.contact-card.archived { opacity: .78; }
.contact-heading { display: flex; align-items: flex-start; gap: 10px; }
.contact-heading > div { min-width: 0; }
.contact-heading h2, .contact-heading h3, .contact-heading p { margin-bottom: 2px; overflow-wrap: anywhere; }
.contact-heading .neutral-badge { margin-left: auto; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: .72rem; font-weight: 800; }
.contact-details { display: grid; gap: 8px; margin: 14px 0; }
.contact-details > div { display: grid; gap: 2px; }
.contact-details a { overflow-wrap: anywhere; font-size: .78rem; }
.contact-note { margin: 12px 0; padding: 10px; border-radius: 8px; background: #f6f8fb; }
.contact-note p { margin: 3px 0 0; color: #39465a; font-size: .77rem; white-space: pre-wrap; }
.linked-opportunities { display: grid; gap: 6px; margin: 12px 0; }
.linked-opportunities > small { font-weight: 700; }
.linked-opportunities > span { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 7px; background: #f5f7fa; }
.linked-opportunities a { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .72rem; }
.linked-opportunities form { display: inline-flex; }
.linked-opportunities .icon-button { flex: 0 0 30px; }
.linked-opportunities em { color: var(--muted); font-size: .72rem; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding-top: 11px; border-top: 1px solid var(--line); }
.card-actions form { display: inline-flex; }

.app-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 36px); padding: 0; border: 0; border-radius: 15px; box-shadow: 0 25px 80px rgba(16,35,63,.25); }
.app-dialog::backdrop { background: rgba(8,22,40,.55); backdrop-filter: blur(2px); }
.app-dialog > form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 4px; }
.dialog-heading h2 { margin: 0; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 7px; background: #eff2f6; cursor: pointer; font-size: 1.25rem; }
.dialog-danger { padding-top: 0 !important; border-top: 1px solid var(--line); }
.proposal-choice-note { margin: 0; padding: 10px 12px; border-left: 3px solid var(--teal); border-radius: 7px; background: var(--teal-soft); color: #344156; font-size: .76rem; line-height: 1.45; }
.proposal-choice-help { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.proposal-choice-help > summary { padding: 11px 12px; font-size: .78rem; }
.proposal-choice-help[open] > summary { border-bottom: 1px solid var(--line); }
.proposal-help-content { padding: 12px; }
.proposal-help-content > p { margin-bottom: 10px; font-size: .75rem; }
.proposal-help-list { display: grid; gap: 10px; margin: 0; }
.proposal-help-list > div { display: grid; gap: 3px; }
.proposal-help-list dt { color: var(--ink); font-size: .75rem; font-weight: 800; }
.proposal-help-list dd { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.proposal-choice-help.advanced-choice { background: #fff; }

.calendar-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.period-nav { display: flex; align-items: center; gap: 4px; }
.calendar-filters { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.calendar-filters select { min-width: 150px; min-height: 36px; }
.month-calendar { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.weekday-row, .month-grid { min-width: 735px; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekday-row { border-bottom: 1px solid var(--line); background: #f8fafc; }
.weekday-row span { padding: 9px; color: var(--muted); font-size: .65rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-cell { min-height: 128px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.outside { background: #fafbfc; color: #9ba5b5; }
.calendar-cell.today .day-number { background: var(--blue); color: #fff; }
.day-number { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: .69rem; font-weight: 800; }
.cell-events { display: grid; gap: 4px; margin-top: 5px; }
.calendar-chip { display: block; overflow: hidden; padding: 4px 5px; border-left: 3px solid; border-radius: 4px; background: #f2f5f9; color: #344156; font-size: .61rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.calendar-chip:hover { text-decoration: none; }
.calendar-chip span { margin-right: 3px; color: var(--muted); }
.calendar-chip.official { border-left-color: var(--blue); background: var(--blue-soft); }
.calendar-chip.owner { border-left-color: var(--teal); background: var(--teal-soft); }
.more-events { font-size: .6rem; font-weight: 700; }
.week-calendar { display: grid; grid-template-columns: repeat(7, minmax(120px,1fr)); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.week-day { min-height: 460px; border-right: 1px solid var(--line); }
.week-day:last-child { border-right: 0; }
.week-day > header { display: grid; place-items: center; gap: 3px; padding: 11px; border-bottom: 1px solid var(--line); }
.week-day > header span { color: var(--muted); font-size: .63rem; text-transform: uppercase; }
.week-day > header strong { font-size: 1rem; }
.week-day.today > header { background: var(--blue-soft); color: var(--blue-dark); }
.week-day > div { display: grid; align-content: start; gap: 6px; padding: 7px; }
.week-event { display: grid; gap: 2px; width: 100%; padding: 7px; border: 0; border-left: 3px solid; border-radius: 5px; text-align: left; cursor: pointer; }
.week-event.official { border-left-color: var(--blue); background: var(--blue-soft); }
.week-event.owner { border-left-color: var(--teal); background: var(--teal-soft); }
.week-event strong, .week-event span { font-size: .65rem; }
.week-event small { font-size: .58rem; }
.agenda-list { display: grid; gap: 16px; }
.agenda-group > header { padding: 5px 2px 8px; color: var(--muted); font-size: .75rem; }
.agenda-event { display: grid; grid-template-columns: 110px 10px minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.agenda-event h2, .agenda-event h3, .agenda-event p { margin-bottom: 3px; }
.agenda-time { display: grid; color: #344156; font-size: .76rem; font-weight: 700; }
.agenda-time small { display: block; }
.event-type-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; }
.event-type-dot.official { background: var(--blue); }
.event-type-dot.owner { background: var(--teal); }

.settings-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 18px; }
.settings-grid > *, .settings-list, .settings-list article { min-width: 0; }
.settings-side { display: grid; grid-template-columns: minmax(0,1fr); align-content: start; gap: 14px; }
.settings-side .panel { width: 100%; min-width: 0; }
.settings-side h2, .settings-side p { overflow-wrap: anywhere; }
.settings-side .panel h2 { font-size: 1.02rem; }
.settings-list { display: grid; }
.settings-list article { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.settings-list article:first-child { border-top: 0; }
.settings-list article p { margin: 3px 0; font-size: .78rem; }
.settings-list article strong, .settings-list article p, .settings-list dd { overflow-wrap: anywhere; }
.settings-list dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 4px 0 0; }
.settings-list dl div { padding: 8px; border-radius: 7px; background: #f7f9fb; }
.settings-list dt { color: var(--muted); font-size: .64rem; }
.settings-list dd { margin: 3px 0 0; font-size: .73rem; }
.certification-list { display: grid; gap: 10px; margin-top: 14px; }
.certification-list > div { display: flex; align-items: flex-start; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.certification-list > div:first-child { padding-top: 0; border-top: 0; }
.certification-list strong, .certification-list small { display: block; }
.source-settings-list { display: grid; margin-top: 10px; }
.source-settings-list article { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.source-settings-list article:first-child { border-top: 0; }
.source-settings-list strong, .source-settings-list small, .source-settings-list a { display: block; overflow-wrap: anywhere; }
.source-settings-list a { margin-top: 4px; font-size: .7rem; font-weight: 700; }

.vault-table { table-layout: fixed; }
.vault-table th:nth-child(1) { width: 26%; }
.vault-table th:nth-child(2) { width: 23%; }
.vault-table th:nth-child(3) { width: 11%; }
.vault-table th:nth-child(4) { width: 17%; }
.vault-table th:nth-child(5) { width: 23%; }
.vault-table td, .vault-table td a { overflow-wrap: anywhere; }
.vault-table .button-row { align-items: stretch; }

.source-provenance { display: block; margin-bottom: 4px; }
.file-icon { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 42px; border-radius: 7px; background: var(--blue-soft); color: var(--blue-dark); font-size: .58rem; font-weight: 900; text-transform: uppercase; }
.file-icon.large { width: 45px; height: 50px; }
.preview-heading { align-items: center; }
.preview-heading > div:first-child { min-width: 0; }
.preview-heading h1, .preview-heading p { overflow-wrap: anywhere; }
.document-viewer { min-height: 65vh; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #e8edf3; }
.document-viewer iframe { display: block; width: 100%; height: 72vh; border: 0; background: #fff; }
.document-viewer img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; object-fit: contain; }
.text-preview { min-height: 65vh; padding: 22px; background: #fff; }
.text-preview pre { max-width: 920px; margin: 0 auto; color: #263247; font: 400 .82rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.temporary-note { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--gold-soft); font-size: .75rem; }

.opportunity-context { margin: -38px calc(clamp(28px, 3vw, 48px) * -1) 25px; padding: 24px clamp(28px, 3vw, 48px) 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 9px 24px rgba(15,23,42,.035); }
.breadcrumb { display: flex; align-items: center; min-width: 0; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: .71rem; }
.breadcrumb span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opportunity-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; }
.opportunity-title-row > div:first-child { min-width: 0; max-width: 980px; }
.opportunity-title-row h1 { font-size: clamp(1.45rem,2.6vw,2rem); overflow-wrap: anywhere; }
.decision-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.opportunity-tabs { display: flex; align-items: center; gap: 2px; overflow-x: auto; margin-top: 20px; scrollbar-width: thin; }
.opportunity-tabs a { flex: 0 0 auto; padding: 12px 10px 11px; border-bottom: 3px solid transparent; color: var(--muted); font-size: .71rem; font-weight: 700; white-space: nowrap; }
.opportunity-tabs a:hover { color: var(--ink); text-decoration: none; }
.opportunity-tabs a.active { border-bottom-color: var(--blue); color: var(--blue-dark); }
.opportunity-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,320px); align-items: start; gap: 20px; }
.opportunity-primary { display: grid; gap: 18px; }
.opportunity-side { min-width: 0; }
.sticky-panel { position: sticky; top: 18px; }
.summary-panel h2 { margin: 5px 0 14px; font-size: 1.22rem; font-weight: 600; line-height: 1.55; }
details summary { cursor: pointer; color: var(--blue-dark); font-size: .75rem; font-weight: 700; }
.source-list { display: grid; gap: 8px; margin: 12px 0 0; padding-left: 18px; }
.source-list li { color: var(--muted); font-size: .76rem; }
.source-list span { display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.detail-grid > div { min-width: 0; padding: 12px; background: #fff; }
.detail-grid dt { color: var(--muted); font-size: .63rem; text-transform: uppercase; }
.detail-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: .78rem; font-weight: 700; }
.change-list { display: grid; }
.change-list article { padding: 11px 0; border-top: 1px solid var(--line); }
.change-list article:first-child { border-top: 0; }
.change-list p { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 4px 0; color: #344156; font-size: .76rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 5px; font-size: 1.45rem; }
.section-heading p { max-width: 720px; margin-bottom: 0; }
.requirements-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,340px); align-items: start; gap: 18px; }
.requirement-list { display: grid; }
.requirement-list article { padding: 17px 2px; border-top: 1px solid var(--line); }
.requirement-list article:first-child { border-top: 0; }
.requirement-list article p { margin-bottom: 7px; }
.category-label { display: inline-flex; margin-bottom: 7px; padding: 3px 7px; border-radius: 5px; background: var(--blue-soft); color: var(--blue-dark); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.source-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.source-pills a { padding: 4px 7px; border-radius: 5px; background: #f0f3f7; font-size: .66rem; }
.unknown-panel ul { display: grid; gap: 8px; padding-left: 19px; color: #465267; font-size: .78rem; line-height: 1.5; }
.document-card-list { display: grid; gap: 10px; }
.document-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.document-card.removed { opacity: .68; }
.document-card h3, .document-card p { margin-bottom: 3px; }
.document-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 16px; border: 1px solid #a9c7f2; border-radius: 11px; background: var(--blue-soft); }
.callout h3, .callout p { margin-bottom: 2px; }
.callout.compact { display: block; margin: 14px 0 0; padding: 12px 14px; }
.proposal-repository-heading { margin-bottom: 18px; }
.proposal-repository-layout { display: grid; grid-template-columns: minmax(280px,340px) minmax(0,1fr); align-items: start; gap: 18px; }
.proposal-version-panel { display: grid; gap: 18px; padding: 18px; }
.proposal-version-summary { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 12px; }
.proposal-version-summary h3 { margin: 0 0 3px; overflow-wrap: anywhere; }
.proposal-version-history { display: grid; gap: 7px; }
.proposal-version-history > .eyebrow { margin: 5px 3px 2px; }
.proposal-version-history > a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.proposal-version-history > a:hover { border-color: #9bd8c9; background: #fbfffe; text-decoration: none; }
.proposal-version-history > a.active { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px rgba(13,148,136,.08); }
.proposal-version-history strong, .proposal-version-history small { display: block; overflow-wrap: anywhere; }
.proposal-version-history small { margin-top: 2px; }
.proposal-version-note { color: #42526a; }
.proposal-version-number { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 10px; background: #edf2f6; color: var(--navy); font-size: .72rem; font-weight: 900; }
.proposal-version-history > a.active .proposal-version-number { background: var(--teal); color: #fff; }
.repository-separation-note { margin: 0; padding: 11px 12px; border-radius: 11px; background: #f3f6f8; font-size: .74rem; }
.proposal-file-viewer { min-width: 0; padding: 0; overflow: hidden; }
.proposal-file-viewer > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.proposal-file-viewer > header h2 { margin-bottom: 3px; overflow-wrap: anywhere; }
.proposal-file-viewer > header p { margin-bottom: 0; }
.proposal-file-viewer iframe { display: block; width: 100%; height: 76vh; min-height: 620px; border: 0; background: #dfe4e8; }
.proposal-word-preview { display: grid; justify-items: center; align-content: center; min-height: 620px; padding: 50px; background: #f4f7f9; text-align: center; }
.proposal-word-preview p { max-width: 580px; }
.proposal-repository-empty { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.75fr); align-items: center; gap: 44px; min-height: 460px; padding: clamp(28px,5vw,68px); }
.proposal-empty-copy { max-width: 660px; }
.proposal-empty-copy h2 { font-size: clamp(1.6rem,3vw,2.4rem); }
.proposal-empty-icon { width: 68px; height: 68px; margin-bottom: 22px; border-radius: 18px; }
.proposal-upload-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafb; }
.research-grid { display: grid; grid-template-columns: minmax(280px,.7fr) minmax(0,1.3fr); align-items: start; gap: 18px; }
.research-refresh-status { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: -6px 0 16px; padding: 11px 14px; border: 1px solid #9bd8c9; border-radius: 11px; background: var(--teal-soft); color: #23685d; font-size: .8rem; }
.research-refresh-status.failed { border-color: #e9abb0; background: var(--red-soft); color: #8f212a; }
.research-results-panel { min-width: 0; }
.research-source-facts .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.research-source-facts .detail-grid > div:first-child { grid-column: 1 / -1; }
.research-result { padding: 14px 0; border-top: 1px solid var(--line); }
.research-result:first-of-type { border-top: 0; }
.research-result .comparison-badge { margin-bottom: 7px; }
.research-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.research-result-heading a { font-size: .72rem; font-weight: 750; }
.research-result h3 { font-size: 1.02rem; }
.research-award-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 11px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.research-award-details > div { padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.research-award-details > div:nth-child(2n) { border-right: 0; }
.research-award-details dt { color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.research-award-details dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: .78rem; font-weight: 700; }
.research-unknown { margin: 14px 0 0; padding: 11px; border-radius: 8px; background: #f3f6f8; font-size: .75rem; }
.link-existing { margin-top: 18px; }
.notes-layout { display: grid; grid-template-columns: minmax(280px,.55fr) minmax(0,1.45fr); align-items: start; gap: 18px; }
.note-list { display: grid; gap: 11px; }
.note-card > p { color: #344156; white-space: pre-wrap; }
.history-row { padding: 9px 0; border-top: 1px solid var(--line); }
.history-row p { margin: 3px 0; white-space: pre-wrap; }
.narrow-panel { max-width: 700px; }
.current-status { display: grid; gap: 5px; margin-top: 22px; padding: 16px; border-radius: 10px; background: #f5f7fa; }
.current-status strong { font-size: 1.2rem; }
.activity-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 18px; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 1200; max-width: min(360px,calc(100vw - 36px)); padding: 12px 15px; border-radius: 9px; background: var(--navy); color: #fff; box-shadow: var(--shadow); font-size: .78rem; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .contact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kanban-board { grid-auto-flow: row; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-columns: auto; overflow: visible; }
  .kanban-column { min-height: 260px; }
  .settings-grid { grid-template-columns: minmax(0,1.25fr) minmax(270px,.75fr); }
  .active-work-table { table-layout: fixed; }
  .active-work-table th:nth-child(1) { width: 28%; }
  .active-work-table th:nth-child(2) { width: 12%; }
  .active-work-table th:nth-child(3) { width: 25%; }
  .active-work-table th:nth-child(4) { width: 27%; }
  .active-work-table th:nth-child(5) { width: 8%; }
  .active-work-table .inline-edit { display: grid; grid-template-columns: minmax(0,1fr) auto; min-width: 0; }
  .active-work-table th, .active-work-table td { padding-left: 8px; padding-right: 8px; }
  .opportunity-tabs { flex-wrap: wrap; overflow: visible; }
  .opportunity-tabs a { flex: 1 1 auto; text-align: center; }
}

@media (max-width: 1100px) {
  .proposal-repository-layout { grid-template-columns: minmax(250px,300px) minmax(0,1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar: 225px; }
  main { padding-left: 22px; padding-right: 22px; }
  .dashboard-grid, .opportunity-layout, .requirements-layout, .settings-grid, .research-grid, .notes-layout, .activity-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .opportunity-side { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .calendar-filters { width: 100%; margin-left: 0; }
  .proposal-repository-layout, .proposal-repository-empty { grid-template-columns: 1fr; }
  .proposal-version-panel { order: 2; }
  .proposal-file-viewer iframe { height: 68vh; min-height: 520px; }
}

@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 55px; padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,.12); background: var(--navy); color: #dfe8f5; font-size: .7rem; }
  .mobile-header > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: #fff; }
  .mobile-brand .brand-mark { width: 31px; height: 31px; flex-basis: 31px; border-radius: 8px; }
  .mobile-nav { position: sticky; top: 55px; z-index: 90; display: flex; flex-wrap: wrap; gap: 3px; overflow: visible; padding: 7px 8px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 3px 8px rgba(16,35,63,.05); }
  .mobile-nav a { flex: 1 1 calc(25% - 3px); padding: 6px 4px; border-radius: 6px; color: var(--muted); font-size: .62rem; font-weight: 700; text-align: center; }
  .mobile-nav a.active { background: var(--blue-soft); color: var(--blue-dark); }
  main { padding: 20px 14px 55px; }
  .page-heading, .section-heading, .opportunity-title-row { display: grid; gap: 14px; }
  .page-heading .button, .page-heading form, .page-heading form .button { width: 100%; }
  .decision-actions { width: 100%; }
  .decision-actions form, .decision-actions .button { flex: 1 1 130px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 125px; padding: 14px; }
  .metric-card > strong { font-size: 1.55rem; }
  .profit-card > strong { font-size: 1.2rem; }
  .dashboard-grid { gap: 12px; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-bar .search-field { grid-column: 1 / -1; }
  .filter-bar label { min-width: 0; }
  .opportunity-card { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .opportunity-action { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .opportunity-action .button { grid-column: 1 / -1; margin-top: 0; }
  .opportunity-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .sync-summary > div:first-child { display: grid; }
  .sync-summary dl { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .sync-summary dl div, .sync-summary dl div:first-child { padding: 0; border: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .table-panel { padding: 9px; background: transparent; border: 0; box-shadow: none; }
  .responsive-table { overflow: visible; }
  .responsive-table table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
  .responsive-table td { padding: 7px 0; border: 0; }
  .responsive-table tfoot { display: table; width: 100%; }
  .vault-table { table-layout: auto; }
  .inline-edit { min-width: 0; }
  .kanban-board { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .kanban-column { min-height: 0; }
  .calendar-toolbar { align-items: stretch; }
  .calendar-toolbar > * { max-width: 100%; }
  .calendar-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .calendar-filters select { min-width: 0; }
  .calendar-filters .button { grid-column: 1 / -1; }
  .month-calendar { overflow: hidden; }
  .weekday-row, .month-grid { min-width: 0; }
  .weekday-row span { padding: 7px 1px; font-size: .56rem; }
  .calendar-cell { min-width: 0; min-height: 92px; padding: 4px 3px; }
  .day-number { width: 21px; height: 21px; font-size: .62rem; }
  .calendar-chip { width: 100%; padding: 3px; overflow-wrap: anywhere; font-size: .53rem; text-overflow: clip; white-space: normal; }
  .calendar-chip span { display: none; }
  .agenda-event { grid-template-columns: 76px 8px minmax(0,1fr); gap: 8px; }
  .agenda-actions { grid-column: 3; }
  .week-calendar { grid-template-columns: 1fr; overflow: visible; }
  .week-day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .week-day > header { display: flex; justify-content: space-between; }
  .settings-list dl { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions > *, .page-actions .button { flex: 1 1 180px; }
  .opportunity-context { margin: -20px -14px 20px; padding: 15px 14px 0; }
  .opportunity-tabs { flex-wrap: wrap; overflow: visible; margin-left: -4px; margin-right: -4px; padding: 0; }
  .opportunity-tabs a { flex: 1 1 auto; padding: 9px 7px 8px; text-align: center; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .document-card { grid-template-columns: auto minmax(0,1fr); align-items: start; }
  .document-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .callout { display: grid; }
  .proposal-file-viewer > header { display: grid; padding: 15px; }
  .proposal-file-viewer > header .button-row { width: 100%; }
  .proposal-file-viewer > header .button { flex: 1; }
  .proposal-file-viewer iframe { height: 65vh; min-height: 440px; }
  .proposal-repository-empty { min-height: 0; padding: 22px 16px; gap: 24px; }
  .proposal-version-history > a { grid-template-columns: auto minmax(0,1fr); }
  .proposal-version-history > a .good-badge { grid-column: 2; }
  .research-result-heading { align-items: flex-start; flex-direction: column; }
  .research-award-details { grid-template-columns: 1fr; }
  .research-award-details > div { border-right: 0; }
  .activity-layout { gap: 12px; }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-field { grid-column: auto; }
  .option-grid { grid-template-columns: 1fr; }
  .opportunity-action { grid-template-columns: 1fr; }
  .opportunity-action .button { grid-column: auto; }
  .opportunity-meta, .detail-grid { grid-template-columns: 1fr; }
  .segmented { width: 100%; }
  .segmented a { flex: 1; text-align: center; }
  .active-summary { display: grid; gap: 6px; }
  .calendar-filters { grid-template-columns: 1fr; }
  .calendar-filters .button { grid-column: auto; }
  .agenda-event { grid-template-columns: 1fr 8px minmax(0,1fr); }
  .agenda-time { grid-column: 1 / -1; }
  .agenda-actions { grid-column: 3; }
  .preview-heading .button-row { display: grid; width: 100%; }
  .document-viewer iframe { height: 62vh; }
}
