body:not(.auth-ready) > header, body:not(.auth-ready) > .wrap { display: none; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #FDFCF9; }
.auth-card { width: min(100%, 420px); padding: 36px; border: 1px solid #D8DCE2; border-radius: 14px; background: white; box-shadow: 0 8px 30px #16283c10; }
.auth-card h1 { font-size: 26px; margin: 12px 0; }
.auth-brand { color: #1D5AA7; font-weight: 800; letter-spacing: .04em; }
.auth-card label { display: block; margin-top: 18px; color: #46525F; font-weight: 700; }
.auth-card input { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid #D8DCE2; border-radius: 7px; color: #1C2530; outline-color: #1D5AA7; }
.auth-card button { width: 100%; margin-top: 20px; padding: 12px; border: 0; border-radius: 7px; background: #1D5AA7; color: white; font-weight: 700; }
.auth-card button:disabled { opacity: .6; cursor: wait; }
.auth-message { margin-top: 16px; color: #a44336; line-height: 1.5; }
.auth-note { margin-top: 18px; font-size: 12px; }
.auth-account { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: #c7d8cf; font-size: 12px; }
.auth-account button { background: transparent; border: 1px solid #91aa9a; border-radius: 6px; color: white; padding: 7px 10px; }
.project-panel { margin-bottom: 24px; }
.project-drawer-toggle { order: -1; border: 1px solid #91aa9a; border-radius: 6px; background: transparent; color: white; padding: 7px 10px; font: inherit; font-size: 12px; font-weight: 700; }
.project-drawer-backdrop { position: fixed; z-index: 19; inset: 0; border: 0; padding: 0; background: rgb(22 40 60 / .18); cursor: default; }
.project-drawer-backdrop[hidden] { display: none; }
.project-drawer { position: fixed; z-index: 20; top: 0; left: 0; width: min(540px, 94vw); height: 100vh; margin: 0; overflow-y: auto; border-radius: 0 14px 14px 0; box-shadow: 12px 0 40px #16283c33; transform: translateX(-105%); transition: transform .2s ease; }
.project-drawer.is-open { transform: translateX(0); }
.project-row-actions { display: flex; flex: none; flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
.project-row-actions .button { padding: 7px 8px; white-space: nowrap; }
.project-rename-form { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.project-rename-form input { flex: 1 1 220px; padding: 8px; border: 1px solid #b9c9dc; border-radius: 6px; }
.category-collapsed > :not(.cost-heading) { display: none; }
.cost-heading .category-collapse { width: 40px; min-width: 40px; height: 40px; padding: 0; font-size: 23px; line-height: 1; white-space: nowrap; }
.project-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.project-current { margin-top: 16px; color: #315d4e; font-weight: 700; }
.project-status { margin-top: 8px; color: #7d592a; }
.project-list { margin: 12px 0; padding: 0; list-style: none; }
.project-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e3e9e4; }
.project-list li > span:first-child { flex: 1 1 0; min-width: 0; }
.project-restore { border: 0; padding: 0; color: #315d4e; background: none; text-decoration: underline; }
.project-footnote { display: block; margin-top: 8px; color: #75837d; line-height: 1.5; }
.project-confirm { padding: 14px; margin-top: 12px; border: 1px solid #d7e3d8; border-radius: 8px; background: #f5f7f3; }
.project-confirm p { margin-bottom: 10px; color: #344e43; }
.project-actions button:disabled { opacity: .5; cursor: wait; }
.project-documents { border-top: 1px solid #d9e1e6; margin-top: 1.25rem; padding-top: 1rem; }
.project-documents h3 { margin: 0 0 .5rem; }
.documents-list { list-style: none; padding: 0; }
.documents-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 0; overflow-wrap: anywhere; }
.documents-form input { max-width: 100%; }

/* Focused workspace controls */
.top .badge { display: none; }
.project-workbook-actions { display: grid; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #d9e1e6; }
.project-workbook-actions h3 { margin: 0; font-size: 14px; }
.project-workbook-actions p { margin: 0; color: #46525f; font-size: 12px; line-height: 1.5; }
.project-workbook-actions .button { width: 100%; }
.project-workbook-actions .link-note { margin: -2px 0 6px; }
.feas-aside > .workbook-reset,
.feas-aside > .link-note { display: none; }
.estimate-inputs { margin-top: 24px; padding-top: 20px; border-top: 1px solid #d9e1e6; }
.estimate-inputs h2 { margin: 0 0 5px; }
.estimate-inputs .field { margin-top: 16px; }
#cost-calculators > .main { width: 100%; }
.funding-scope-disclosure { margin-top: 14px; border: 1px solid #d8e4f2; border-radius: 8px; background: #f8fafc; }
.funding-scope-disclosure summary { cursor: pointer; padding: 14px 16px; color: #1c2530; font-weight: 700; }
.funding-scope-disclosure[open] { background: #fff; }
.funding-scope-disclosure .funding-card { margin: 0; border-width: 1px 0 0; border-radius: 0; box-shadow: none; }

/* Shared project record controls */
.project-collaboration { margin: 8px 0; color: #1d5aa7; font-size: 12px; font-weight: 650; }
.project-record-actions, .project-export > div { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.project-history, .project-export, .project-members { margin: 14px 0; padding: 14px; border: 1px solid #d8e4f2; border-radius: 8px; background: #f8fafc; }
.project-history h3, .project-export h3, .project-members h3 { margin: 0 0 5px; font-size: 14px; color: #1c2530; }
.project-history p, .project-export p, .project-members p { margin: 0 0 10px; font-size: 12px; }
.project-history ul, .project-members ul { list-style: none; margin: 0; padding: 0; }
.project-history li, .project-members li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; padding: 9px 0; border-top: 1px solid #d8e4f2; font-size: 12px; }
.project-members form { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 7px; margin: 12px 0; }
.project-members input, .project-members select, .project-members li select { min-width: 0; border: 1px solid #b9c9dc; border-radius: 6px; padding: 8px; background: #fff; color: #1c2530; }
.project-password-reset { border: 0; background: transparent; color: #1d5aa7; padding: 5px 0; text-decoration: underline; font-size: 12px; }
@media (max-width: 650px) { .project-members form { grid-template-columns: 1fr; } }
.settings-collapse-toggle { position: absolute; z-index: 4; top: 5px; left: 280px; width: 40px; height: 40px; border: 1px solid #b9c9dc; border-radius: 999px; background: #fff; color: #1d5aa7; box-shadow: 0 2px 8px #16283c18; font-size: 19px; line-height: 1; }
.layout:has(.feas-aside) { position: relative; padding-top: 50px; }
.layout.settings-collapsed { grid-template-columns: 0 minmax(0, 1fr); gap: 0; }
.layout.settings-collapsed .feas-aside { visibility: hidden; overflow: hidden; padding-left: 0; padding-right: 0; border-width: 0; }
.layout.settings-collapsed .settings-collapse-toggle { left: 0; }
.layout.settings-collapsed .main { grid-column: 2; }
@media (max-width: 1000px) {
  .layout:has(.feas-aside) { padding-top: 0; }
  .settings-collapse-toggle { display: none; }
  .layout.settings-collapsed { grid-template-columns: 1fr; gap: 20px; }
  .layout.settings-collapsed .feas-aside { visibility: visible; overflow: visible; padding-left: 22px; padding-right: 22px; border-width: 1px; }
  .layout.settings-collapsed .main { grid-column: auto; }
}
