:root {
  --portal-bg: #f5f7fa;
  --portal-ink: #0b1016;
  --portal-muted: #667184;
  --portal-line: rgba(14, 23, 35, 0.13);
  --portal-border: rgba(14, 23, 35, 0.13);
  --portal-accent: #16b9ed;
  --portal-deep: #070c12;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--portal-ink);
  background: var(--portal-bg);
  font-family: "Manrope", Arial, sans-serif;
}

body.portal-denied main {
  visibility: hidden;
}

.site-topbar {
  position: relative;
  inset: auto;
  color: var(--portal-ink);
  background: rgba(245, 247, 250, 0.94);
  border-bottom: 1px solid var(--portal-line);
  backdrop-filter: blur(16px);
}

.site-brand {
  gap: 0.6rem;
  color: var(--portal-ink);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
}

.site-brand img {
  width: 30px;
  height: 30px;
}

.site-topbar .site-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--portal-ink);
  background: #ffffff;
  border-color: var(--portal-line);
  text-align: center;
}

.site-topbar .site-menu-toggle {
  background: #ffffff;
  border-color: var(--portal-line);
}

.site-topbar .site-menu-toggle span {
  background: var(--portal-ink);
}

.site-topbar .site-mobile-menu.is-open {
  border-top-color: var(--portal-line);
}

.site-topbar .site-mobile-menu-title {
  color: var(--portal-muted);
}

.portal-shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2.75rem 0 4rem;
}

.portal-heading {
  display: grid;
  justify-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

.portal-kicker {
  margin: 0 0 0.55rem;
  color: #087fa8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-heading h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.portal-logout {
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  color: var(--portal-ink);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.site-nav-actions .portal-logout {
  border-radius: 999px;
}

.portal-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.25rem;
}

.portal-project-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--portal-deep);
  border-radius: 12px;
  color: #ffffff;
  box-shadow: 0 20px 60px rgba(7, 12, 18, 0.12);
}

.portal-project-picker h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.portal-project-picker p:not(.portal-kicker) {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
}

.portal-project-select {
  display: grid;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-project-select .portal-select {
  width: 100%;
}

.portal-picker-state {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  color: var(--portal-ink);
  background: #ffffff;
  border-radius: 8px;
}

.portal-picker-state span {
  color: var(--portal-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-nav,
.portal-workspace {
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(7, 12, 18, 0.08);
}

.portal-nav {
  align-self: start;
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
}

.portal-nav button,
.portal-nav a,
.portal-nav span {
  display: block;
  width: 100%;
  padding: 0.78rem 0.85rem;
  color: var(--portal-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.portal-nav .is-current {
  color: var(--portal-ink);
  background: rgba(22, 185, 237, 0.1);
}

.portal-nav .is-placeholder {
  opacity: 0.48;
  cursor: default;
}

.portal-nav .admin-nav-expander {
  position: relative;
  padding-right: 2rem;
}

.admin-nav-expander::after {
  position: absolute;
  right: 0.85rem;
  content: "+";
  font-size: 1.05rem;
  line-height: 1;
}

.admin-nav-expander[aria-expanded="true"]::after {
  content: "−";
}

.admin-nav-children {
  display: grid;
  gap: 0.2rem;
}

.admin-nav-children[hidden] {
  display: none;
}

.portal-nav .admin-nav-child {
  padding-top: 0.58rem;
  padding-bottom: 0.58rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
}

.site-mobile-menu .admin-nav-expander {
  position: relative;
  width: 100%;
  text-align: left;
}

.site-mobile-menu .admin-nav-children {
  padding-left: 0.5rem;
}

.site-mobile-menu .admin-nav-child {
  font-size: 0.9rem;
}

.portal-nav-label {
  margin: 0.35rem 0.85rem 0;
  color: #087fa8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-nav-divider {
  height: 1px;
  margin: 0.45rem 0.3rem;
  background: var(--portal-line);
}

.portal-workspace {
  min-height: 420px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.portal-workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--portal-line);
}

.portal-workspace h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.portal-view[hidden] {
  display: none;
}

.portal-workspace p {
  margin: 0.55rem 0 0;
  color: var(--portal-muted);
}

.portal-empty {
  min-height: 250px;
  display: grid;
  place-items: center;
  color: var(--portal-muted);
  text-align: center;
}

.portal-empty[hidden] {
  display: none;
}

.portal-select,
.portal-form input,
.portal-form select,
.portal-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  font: inherit;
}

.portal-select {
  width: min(320px, 100%);
}

.portal-site-summary,
.portal-toolbar,
.portal-form-head,
.portal-form-actions,
.portal-asset-head,
.portal-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-site-summary {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(22, 185, 237, 0.07);
  border: 1px solid rgba(22, 185, 237, 0.2);
  border-radius: 10px;
}

.portal-overview-card {
  min-height: 150px;
  margin-top: 1.5rem;
  padding: 1.4rem;
}

.portal-overview-card h3,
.portal-overview-help h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
}

.portal-overview-help {
  margin-top: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-overview-summary {
  margin-top: 1.5rem;
  border: 1px solid rgba(22, 185, 237, 0.24);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(22, 185, 237, 0.09), rgba(22, 185, 237, 0.025));
  overflow: hidden;
}

.portal-overview-summary-main,
.portal-overview-summary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
}

.portal-overview-summary h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.portal-overview-domain {
  display: inline-flex;
  margin-top: 0.35rem;
  color: #087fa8;
  font-size: 0.9rem;
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.portal-overview-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  color: #354052;
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.portal-overview-status[data-status="active"],
.portal-overview-status[data-status="live"],
.portal-overview-status[data-status="published"] {
  color: #075f37;
  background: #dcfce7;
  border-color: rgba(7, 95, 55, 0.16);
}

.portal-overview-summary-footer {
  border-top: 1px solid rgba(22, 185, 237, 0.18);
  background: rgba(255, 255, 255, 0.55);
}

.portal-overview-access {
  display: grid;
  gap: 0.15rem;
  margin: 0 !important;
}

.portal-overview-access span {
  color: var(--portal-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-overview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.portal-overview-actions .portal-text-action {
  margin-top: 0;
}

.portal-text-action {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0;
  color: #087fa8;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.portal-files-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: #f5f7fa;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-files-project span,
.portal-files-project strong {
  display: block;
}

.portal-files-project span {
  margin-bottom: 0.15rem;
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-files-project .portal-text-action {
  margin-top: 0;
}

.portal-site-summary h3,
.portal-toolbar h3,
.portal-form h3,
.portal-asset-card h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.portal-toolbar {
  margin: 1.5rem 0 1rem;
}

.portal-toolbar p {
  margin-top: 0.2rem;
}

.portal-button,
.portal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  color: #ffffff;
  background: var(--portal-deep);
  border: 1px solid var(--portal-deep);
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.portal-button-secondary,
.portal-close {
  color: var(--portal-ink);
  background: #ffffff;
  border-color: var(--portal-line);
}

.portal-button-danger {
  color: #ffffff;
  background: #b42318;
  border-color: #b42318;
}

.portal-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.portal-button[hidden] {
  display: none;
}

.portal-form {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-form[hidden] {
  display: none;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.portal-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-form textarea {
  min-height: 88px;
  resize: vertical;
}

.portal-form-wide {
  grid-column: 1 / -1;
}

.portal-form-actions {
  justify-content: flex-start;
  margin-top: 1rem;
}

.portal-batch-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.75rem;
  background: #fff;
}

.portal-batch-review[hidden] {
  display: none;
}

.portal-batch-review p {
  margin: 0;
  color: var(--portal-muted);
  font-weight: 800;
  text-align: center;
}

.portal-admin-picker {
  margin-top: 1.25rem;
}

.portal-admin-picker label {
  display: grid;
  gap: 0.45rem;
  min-width: min(100%, 22rem);
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.portal-url {
  max-width: 42rem;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
}

.portal-status-approved {
  color: #075f37;
  background: #dcfce7;
}

.portal-status-rejected {
  color: #991b1b;
  background: #fee2e2;
}

.portal-status-published {
  color: #164e63;
  background: #cffafe;
}

.portal-access-panel {
  margin: 1.25rem 0;
  padding: 1.1rem;
  border: 1px solid var(--portal-border);
  border-radius: 1rem;
  background: #fff;
}

.portal-access-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(9rem, 0.35fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.portal-access-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-access-form input,
.portal-access-form select,
.portal-member-role {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--portal-ink);
  font: inherit;
}

.portal-member-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.portal-project-link-panel .portal-toolbar {
  align-items: flex-start;
}

.portal-project-link-panel .portal-toolbar h3,
.portal-project-link-state h4 {
  margin: 0.15rem 0 0.35rem;
  font-family: "Fraunces", Georgia, serif;
}

.portal-project-link-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(22, 185, 237, 0.22);
  border-radius: 0.8rem;
  background: rgba(22, 185, 237, 0.07);
}

.portal-project-link-state p {
  margin: 0.2rem 0 0;
}

.portal-project-link-options {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.portal-project-quick-form {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto auto;
  align-items: end;
  gap: 0.75rem;
  width: 100%;
  flex: 1 0 100%;
  padding-top: 1rem;
  border-top: 1px solid var(--portal-line);
}

.portal-project-quick-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-project-quick-form input {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  font: inherit;
}

.portal-project-link-options > label:not(.portal-check-row) {
  display: grid;
  gap: 0.35rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-project-link-options input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  font: inherit;
}

.portal-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--portal-line);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--portal-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.portal-check-row input {
  width: 1rem;
  min-height: 1rem;
  margin-top: 0.15rem;
}

.portal-check-row span {
  display: grid;
  gap: 0.2rem;
}

.portal-check-row small {
  color: var(--portal-muted);
  font-weight: 400;
  line-height: 1.5;
}

.portal-request-form {
  margin-top: 1.25rem;
}

.portal-request-list {
  display: grid;
  gap: 0.75rem;
}

.portal-request-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.8rem;
  background: #fff;
}

#admin-ai-review-list details {
  display: block;
}

#admin-ai-review-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

#admin-ai-review-list summary::-webkit-details-marker {
  display: none;
}

#admin-ai-review-list details[open] summary {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--portal-line);
}

#admin-ai-review-list details > div {
  color: var(--portal-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

#admin-ai-review-list details ul {
  margin: 0.4rem 0 1rem;
  padding-left: 1.2rem;
}

#admin-ai-review-list details pre {
  max-height: 320px;
  overflow: auto;
  padding: 0.8rem;
  background: #f4f7f9;
  border-radius: 8px;
  color: var(--portal-ink);
  font: 0.7rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.portal-request-card h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.portal-request-admin {
  margin-top: 1.25rem;
}

.portal-request-admin-card {
  align-items: start;
}

.portal-request-controls {
  display: grid;
  gap: 0.55rem;
  width: min(18rem, 100%);
}

.portal-request-client-actions {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
  min-width: 10rem;
}

.portal-proposal-picker {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.portal-proposal-state {
  padding-bottom: 0.65rem;
}

.portal-intake-summary {
  display: grid;
  grid-template-columns: minmax(12rem, 0.65fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin: 1.25rem 0;
  padding: 1.15rem;
  background: linear-gradient(135deg, rgba(22, 185, 237, 0.08), rgba(22, 185, 237, 0.02));
  border: 1px solid rgba(22, 185, 237, 0.22);
  border-radius: 12px;
}

.portal-intake-summary h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
}

.portal-intake-summary dl,
.portal-proposal-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.portal-intake-summary dl div,
.portal-proposal-facts div {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--portal-line);
  border-radius: 8px;
}

.portal-intake-summary dt,
.portal-proposal-facts dt {
  color: var(--portal-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-intake-summary dd,
.portal-proposal-facts dd {
  margin: 0.3rem 0 0;
  font-weight: 700;
}

.portal-proposal-form {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.portal-form-section {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--portal-line);
}

.portal-form-section-head,
.proposal-email-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-form-section-head p {
  margin: 0.4rem 0 0;
  color: var(--portal-muted);
  font-size: 0.88rem;
}

.proposal-line-items {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0;
}

.proposal-pricing-guidance {
  display: grid;
  gap: 0.3rem;
  margin: 0.85rem 0 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(19, 132, 112, 0.2);
  border-radius: 8px;
  background: #f1faf7;
}

.proposal-plan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.proposal-pricing-guidance strong {
  font-size: 0.8rem;
}

.proposal-pricing-guidance span,
.proposal-referral-discount small {
  color: var(--portal-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.portal-form-grid .proposal-referral-discount {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #f7f9fb;
}

.proposal-referral-discount > span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--portal-ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.proposal-referral-discount input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.proposal-line-item {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr 0.9fr 0.65fr 0.8fr 0.85fr auto;
  align-items: end;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: #f8fafc;
}

.proposal-line-description {
  grid-column: 1 / -2;
}

.proposal-line-remove {
  grid-column: -2;
}

.proposal-email-dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.25rem;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(8, 15, 24, 0.3);
}

.proposal-email-dialog::backdrop {
  background: rgba(8, 15, 24, 0.58);
  backdrop-filter: blur(4px);
}

.proposal-email-dialog h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.proposal-email-meta {
  color: var(--portal-muted);
}

.proposal-email-preview {
  overflow: auto;
  max-height: 62vh;
  padding: 1.25rem;
  border-radius: 12px;
  background: #edf2f8;
}

.proposal-email-card {
  max-width: 620px;
  margin: auto;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(12, 18, 28, 0.12);
}

.proposal-email-hero {
  padding: 2rem;
  color: #fff;
  background: linear-gradient(135deg, #07111d, #123047);
}

.proposal-email-hero p {
  margin: 0 0 0.5rem;
  color: #a9e9ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.proposal-email-hero h2 {
  color: #fff;
}

.proposal-email-body {
  padding: 2rem;
  line-height: 1.65;
}

.proposal-email-body h3 {
  margin: 1.5rem 0 0.5rem;
}

.proposal-email-summary {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #f8fafc;
}

.proposal-email-summary p {
  margin: 0.45rem 0 0;
}

.proposal-email-notice {
  margin: 1.25rem 0;
  padding: 1rem;
  color: #0c4a6e;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: #f0f9ff;
}

.portal-control-note {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.proposal-email-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.proposal-email-item span small,
.portal-price-table span small {
  display: block;
  color: var(--portal-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.proposal-email-item.is-total {
  font-size: 1.05rem;
}

.proposal-email-cta {
  display: inline-block;
  margin: 1rem 0;
  padding: 0.85rem 1.15rem;
  color: #fff;
  background: #09111a;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.proposal-email-signoff {
  color: #475569;
}

.portal-form-section h4,
.portal-proposal-section h3,
.portal-proposal-section h4,
.portal-decision-panel h3,
.portal-empty h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.portal-form label span {
  font-weight: 500;
}

.portal-proposal-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 2;
  padding: 0.75rem;
  background: rgba(248, 250, 252, 0.94);
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.portal-proposal-document {
  margin-top: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #fff;
}

.portal-proposal-cover {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  color: #fff;
  background:
    radial-gradient(500px 260px at 10% 0%, rgba(22, 185, 237, 0.3), transparent 65%),
    linear-gradient(135deg, #09111a, #101d29);
}

.portal-proposal-cover h2 {
  max-width: 38rem;
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.portal-proposal-cover p {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.74);
}

.portal-proposal-cover-meta {
  min-width: 10rem;
  text-align: right;
}

.portal-proposal-section {
  padding: clamp(1.4rem, 5vw, 2.75rem);
  border-top: 1px solid var(--portal-line);
}

.portal-proposal-section > p:not(.portal-kicker) {
  max-width: 52rem;
  line-height: 1.75;
}

.portal-proposal-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.portal-proposal-columns > div,
.portal-proposal-note {
  padding: 1rem;
  background: #f7f9fb;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-proposal-columns ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.portal-proposal-columns li + li {
  margin-top: 0.45rem;
}

.portal-proposal-note {
  margin-top: 1rem;
}

.portal-price-table {
  max-width: 42rem;
  margin-top: 1.25rem;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-price-table div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.portal-price-table div + div {
  border-top: 1px solid var(--portal-line);
}

.portal-price-table .is-total {
  color: #fff;
  background: var(--portal-deep);
  font-size: 1.05rem;
}

.portal-decision-record {
  margin: 1.25rem;
  padding: 1rem;
  color: #075f37;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}

.portal-decision-panel {
  margin-top: 1.25rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
}

.portal-decision-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.portal-decision-option {
  min-height: 48px;
  padding: 0.7rem;
  color: var(--portal-muted);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 9px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.portal-decision-option.is-selected {
  color: #fff;
  background: var(--portal-deep);
  border-color: var(--portal-deep);
}

.portal-decision-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.portal-check {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.portal-check input {
  width: 1.1rem;
  min-height: 1.1rem;
  margin-top: 0.1rem;
}

.portal-status-sent {
  color: #164e63;
  background: #cffafe;
}

.portal-status-changes_requested,
.portal-status-proposal_changes_requested {
  color: #854d0e;
  background: #fef3c7;
}

.portal-status-approved,
.portal-status-proposal_approved {
  color: #075f37;
  background: #dcfce7;
}

.portal-status-declined,
.portal-status-proposal_declined {
  color: #991b1b;
  background: #fee2e2;
}

.portal-request-controls select,
.portal-request-controls textarea {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.65rem;
  background: #fff;
  font: inherit;
}

.portal-status-submitted,
.portal-status-reviewing {
  color: #164e63;
  background: #cffafe;
}

.portal-status-qualified,
.portal-status-converted {
  color: #075f37;
  background: #dcfce7;
}

.portal-status-needs_info {
  color: #854d0e;
  background: #fef3c7;
}

.portal-member-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.75rem;
}

.portal-member-row p {
  margin: 0.2rem 0 0;
  color: var(--portal-muted);
}

.portal-member-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.portal-inline-status {
  margin: 0;
  font-size: 0.84rem;
}

.portal-inline-status.is-error {
  color: #a32626;
}

.portal-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.portal-asset-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 22, 32, 0.05);
}

.portal-asset-preview {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  background: linear-gradient(145deg, #e9f6fb, #eef1f6);
}

.portal-asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-asset-preview-fallback {
  color: #607084;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-asset-body {
  padding: 1rem;
}

.portal-asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.portal-pill {
  display: inline-flex;
  padding: 0.28rem 0.48rem;
  color: var(--portal-muted);
  background: #f1f4f7;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: capitalize;
}

.portal-version-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.portal-version-row {
  padding-top: 0.65rem;
  border-top: 1px solid var(--portal-line);
  font-size: 0.82rem;
}

.portal-version-row p {
  margin: 0;
}

.portal-version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.portal-link-button {
  padding: 0;
  color: #087fa8;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.portal-onboarding-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(22, 185, 237, 0.12), rgba(22, 185, 237, 0.03));
  border: 1px solid rgba(22, 185, 237, 0.28);
  border-radius: 10px;
}

.portal-onboarding-callout p {
  margin: 0.2rem 0 0;
}

.portal-onboarding-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.75fr);
  gap: 1.5rem;
  align-items: center;
  margin-top: 1.25rem;
  padding: 1.15rem;
  background:
    radial-gradient(24rem 12rem at 0% 0%, rgba(22, 185, 237, 0.13), transparent 70%),
    #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
}

.portal-onboarding-overview h3 {
  margin: 0.55rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
}

.portal-progress-block > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
}

.portal-progress-block strong {
  color: var(--portal-ink);
}

.portal-progress-track {
  height: 8px;
  margin-top: 0.65rem;
  overflow: hidden;
  background: #dfe6ec;
  border-radius: 999px;
}

.portal-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #087fa8, var(--portal-accent));
  border-radius: inherit;
  transition: width 220ms ease;
}

.portal-onboarding-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.portal-step-nav {
  position: sticky;
  top: 6.5rem;
  align-self: start;
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  background: #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-step-nav button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem;
  color: var(--portal-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.portal-step-nav button span {
  display: grid;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  color: #496070;
  background: #e7edf2;
  border-radius: 999px;
  font-size: 0.68rem;
  place-items: center;
}

.portal-step-nav button.is-active {
  color: var(--portal-ink);
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(7, 12, 18, 0.07);
}

.portal-step-nav button.is-active span {
  color: #ffffff;
  background: var(--portal-deep);
}

.portal-onboarding-form {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
}

.portal-onboarding-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-onboarding-form input,
.portal-onboarding-form select,
.portal-onboarding-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  font: inherit;
}

.portal-onboarding-form textarea {
  min-height: 88px;
  resize: vertical;
}

.portal-onboarding-form :disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.portal-onboarding-section[hidden] {
  display: none;
}

.portal-section-heading {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--portal-line);
}

.portal-section-heading h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.portal-upload-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: #f7fafc;
  border: 1px dashed rgba(8, 127, 168, 0.35);
  border-radius: 10px;
}

.portal-file-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.portal-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 9px;
}

.portal-file-row > div {
  min-width: 0;
}

.portal-file-row strong {
  display: block;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.portal-file-row p {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.portal-file-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.75rem;
}

.portal-review-checklist {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.portal-review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
}

.portal-review-item span {
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-review-item .is-complete {
  color: #075f37;
}

.portal-review-item .is-incomplete {
  color: #854d0e;
}

.portal-onboarding-confirm {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding: 1rem;
  color: var(--portal-ink);
  background: #f7fafc;
  border: 1px solid var(--portal-line);
  border-radius: 9px;
}

.portal-onboarding-confirm input {
  width: 1.1rem;
  min-height: 1.1rem;
  margin-top: 0.05rem;
}

.portal-onboarding-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(7, 12, 18, 0.08);
  backdrop-filter: blur(12px);
}

.portal-onboarding-actions > div,
.portal-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.portal-admin-onboarding-queue {
  margin-top: 1.25rem;
}

.portal-admin-onboarding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
  gap: 1rem;
}

.portal-answer-sections {
  display: grid;
  gap: 0.8rem;
}

.portal-answer-section {
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-answer-section h4 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
}

.portal-answer-section dl {
  display: grid;
  gap: 0.7rem;
  margin: 0.85rem 0 0;
}

.portal-answer-section dl div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
  gap: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--portal-line);
}

.portal-answer-section dt {
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: capitalize;
}

.portal-answer-section dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.55;
}

.portal-status-not_started {
  color: #475569;
  background: #e2e8f0;
}

.portal-status-in_progress {
  color: #164e63;
  background: #cffafe;
}

.portal-status-needs_changes {
  color: #854d0e;
  background: #fef3c7;
}

.portal-project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.32fr);
  gap: 2rem;
  align-items: center;
  margin-top: 1.25rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  color: #ffffff;
  background:
    radial-gradient(30rem 18rem at 0% 0%, rgba(22, 185, 237, 0.28), transparent 70%),
    linear-gradient(135deg, #08111a, #111e29);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(7, 12, 18, 0.16);
}

.portal-project-hero h3 {
  margin: 0.7rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.portal-project-hero p {
  max-width: 46rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
}

.portal-project-badges,
.portal-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.portal-project-actions {
  margin-top: 1rem;
}

.portal-project-progress {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.portal-project-progress > strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.1rem;
}

.portal-project-progress > span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-project-progress .portal-progress-track {
  background: rgba(255, 255, 255, 0.15);
}

.portal-project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 11px;
}

.portal-project-facts div {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
}

.portal-project-facts div + div {
  border-left: 1px solid var(--portal-line);
}

.portal-project-facts span {
  color: var(--portal-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.55fr);
  gap: 1rem;
}

.portal-project-roadmap {
  display: grid;
  gap: 0.65rem;
}

.portal-project-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 11px;
}

.portal-project-stage.is-current {
  background: linear-gradient(135deg, rgba(22, 185, 237, 0.1), rgba(22, 185, 237, 0.02));
  border-color: rgba(8, 127, 168, 0.35);
  box-shadow: 0 10px 30px rgba(8, 127, 168, 0.08);
}

.portal-project-stage-number,
.portal-admin-milestone-title > span {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  color: #ffffff;
  background: var(--portal-deep);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  place-items: center;
}

.portal-project-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.portal-project-stage h4,
.portal-project-next-step h3,
.portal-project-reference h3,
.portal-admin-milestone h4 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.portal-project-stage p {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  line-height: 1.55;
}

.portal-project-stage-note {
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-radius: 7px;
}

.portal-project-stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.65rem;
  color: var(--portal-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.portal-stage-muted {
  color: var(--portal-muted);
  font-size: 0.74rem;
}

.portal-project-sidebar {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.portal-project-next-step,
.portal-project-reference {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 11px;
}

.portal-project-next-step {
  background: linear-gradient(145deg, #eaf8fc, #ffffff);
  border-color: rgba(8, 127, 168, 0.2);
}

.portal-project-next-step p:last-child {
  line-height: 1.65;
}

.portal-project-reference dl {
  display: grid;
  gap: 0.75rem;
  margin: 0.9rem 0 0;
}

.portal-project-reference dl div {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--portal-line);
}

.portal-project-reference dt {
  color: var(--portal-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-project-reference dd {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.portal-project-admin-form {
  margin-top: 1rem;
}

.portal-project-admin-settings,
.portal-project-admin-milestones,
.portal-project-admin-controls {
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
}

.portal-project-admin-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-project-admin-form input,
.portal-project-admin-form select,
.portal-project-admin-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  font: inherit;
}

.portal-project-admin-form textarea {
  min-height: 76px;
  resize: vertical;
}

.portal-admin-milestone-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.portal-admin-milestone {
  display: grid;
  grid-template-columns: minmax(12rem, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-admin-milestone-title {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.portal-admin-milestone-title p {
  font-size: 0.78rem;
  line-height: 1.5;
}

.portal-admin-milestone-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.portal-project-savebar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--portal-line);
  border-radius: 11px;
  box-shadow: 0 16px 38px rgba(7, 12, 18, 0.12);
  backdrop-filter: blur(12px);
}

.portal-project-control-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.portal-project-control-grid article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
}

.portal-project-control-grid article.is-danger {
  background: #fff7f6;
  border-color: #f0b8b2;
}

.portal-project-control-grid h4,
.portal-delete-project-dialog h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.portal-project-control-grid p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.portal-delete-project-dialog form,
.portal-delete-project-dialog label {
  display: grid;
  gap: 1rem;
}

.portal-delete-project-dialog input {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  font: inherit;
}

.portal-project-status-completed,
.portal-milestone-complete {
  color: #075f37;
  background: #dcfce7;
}

.portal-project-status-pending,
.portal-project-status-archived,
.portal-milestone-not_started,
.portal-milestone-not_applicable {
  color: #475569;
  background: #e2e8f0;
}

.portal-project-status-active,
.portal-project-status-ready_to_launch,
.portal-milestone-available,
.portal-milestone-in_progress {
  color: #164e63;
  background: #cffafe;
}

.portal-project-status-waiting_on_client,
.portal-project-status-on_hold,
.portal-milestone-blocked {
  color: #854d0e;
  background: #fef3c7;
}

.portal-project-status-launched,
.portal-milestone-complete {
  color: #075f37;
  background: #dcfce7;
}

.portal-project-status-cancelled {
  color: #991b1b;
  background: #fee2e2;
}

.portal-status {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  color: var(--portal-ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--portal-line);
  border-radius: 0.8rem;
  box-shadow: 0 12px 36px rgba(14, 23, 35, 0.14);
  font-size: 0.88rem;
  text-align: left;
}

.portal-status[hidden] {
  display: none;
}

.portal-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: min(26rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  color: #fff;
  background: #111a22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(7, 13, 19, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.portal-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.portal-toast.is-error {
  background: #5f1f25;
}

.portal-toast-icon {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  color: #092630;
  background: #76d5e7;
  border-radius: 999px;
  font-weight: 900;
  place-items: center;
}

.portal-toast.is-error .portal-toast-icon {
  color: #5f1f25;
  background: #ffd4d8;
}

.portal-toast button {
  padding: 0.15rem;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .proposal-line-item {
    grid-template-columns: 1fr 1fr;
  }

  .proposal-line-name,
  .proposal-line-description {
    grid-column: 1 / -1;
  }

  .proposal-line-remove {
    grid-column: auto;
  }

  .portal-form-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .portal-shell {
    width: calc(100vw - 1rem);
    padding: 1.5rem 0 3rem;
  }

  .portal-heading {
    align-items: center;
    margin-bottom: 1.5rem;
  }

  .portal-layout {
    grid-template-columns: 1fr;
  }

  .portal-layout > .portal-nav {
    display: none;
  }

  .portal-project-picker {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .portal-workspace {
    min-width: 0;
    padding: 1rem;
  }

  .portal-asset-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-workspace-head,
  .portal-site-summary,
  .portal-toolbar,
  .portal-form-head,
  .portal-version-row {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-overview-summary-main,
  .portal-overview-summary-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 1.1rem;
  }

  .portal-overview-actions {
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
  }

  .portal-files-project {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-form-grid {
    grid-template-columns: 1fr;
  }

  .portal-access-form {
    grid-template-columns: 1fr;
  }

  .portal-member-row {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-project-link-state {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-project-quick-form {
    grid-template-columns: 1fr;
  }

  .portal-request-card {
    flex-direction: column;
  }

  .portal-request-client-actions {
    justify-items: start;
  }

  .portal-proposal-picker,
  .portal-proposal-cover {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-proposal-cover-meta {
    text-align: left;
  }

  .portal-intake-summary,
  .portal-intake-summary dl,
  .portal-proposal-facts,
  .portal-proposal-columns,
  .portal-decision-options,
  .portal-decision-form {
    grid-template-columns: 1fr;
  }

  .portal-proposal-actions {
    position: static;
  }

  .portal-onboarding-callout,
  .portal-onboarding-overview,
  .portal-file-row {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-onboarding-overview,
  .portal-onboarding-layout,
  .portal-admin-onboarding-grid {
    grid-template-columns: 1fr;
  }

  .portal-step-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-onboarding-actions {
    position: static;
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .portal-onboarding-actions > div,
  .portal-onboarding-actions .portal-button,
  .portal-file-actions {
    width: 100%;
  }

  .portal-answer-section dl div {
    grid-template-columns: 1fr;
  }

  .portal-project-hero,
  .portal-project-facts,
  .portal-project-grid,
  .portal-admin-milestone {
    grid-template-columns: 1fr;
  }

  .portal-project-facts div + div {
    border-top: 1px solid var(--portal-line);
    border-left: 0;
  }

  .portal-project-stage-head,
  .portal-project-control-grid article,
  .portal-project-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-admin-milestone-fields {
    grid-template-columns: 1fr;
  }

  .portal-project-savebar {
    position: static;
  }
}

@media (max-width: 520px) {
  .site-topbar-inner {
    width: calc(100vw - 1rem);
    padding: 0.75rem 0;
    gap: 0.65rem;
  }

  .site-topbar-row {
    gap: 0.4rem;
  }

  .site-brand {
    gap: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }

  .site-brand img {
    width: 26px;
    height: 26px;
  }

  .site-nav-actions {
    gap: 0.3rem;
  }

  .site-topbar .site-menu-link,
  .site-nav-actions .portal-logout {
    min-height: 38px;
    padding: 0.4rem 0.55rem;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
  }

  .site-topbar .site-menu-toggle {
    width: 38px;
    height: 38px;
  }

  .site-topbar .site-mobile-menu.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.7rem;
  }

  .site-topbar .site-mobile-menu-head {
    grid-column: 1 / -1;
  }

  .site-topbar .site-mobile-menu .site-menu-link {
    width: 100%;
    min-height: 42px;
    padding: 0.6rem 0.45rem;
    font-size: 0.62rem;
  }

  .portal-heading h1 {
    font-size: clamp(2rem, 12vw, 2.8rem);
  }

  .portal-project-picker h2 {
    font-size: 1.55rem;
  }

  .portal-workspace-head,
  .portal-site-summary,
  .portal-toolbar,
  .portal-form-head,
  .portal-form-actions,
  .portal-version-row,
  .portal-card-actions,
  .portal-member-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-button,
  .portal-close {
    width: 100%;
  }

  .portal-form,
  .portal-access-panel,
  .portal-overview-help {
    padding: 1rem;
  }

  .portal-asset-body {
    padding: 0.9rem;
  }
}

@media (max-width: 360px) {
  .site-brand span {
    display: none;
  }
}

.portal-ownership-section {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--portal-line);
}

.portal-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-service-card,
.portal-request-card,
.portal-admin-editor {
  padding: 1.15rem;
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  background: #fff;
}

.portal-service-card-head,
.portal-request-card,
.portal-request-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-service-card h4,
.portal-request-card h4 {
  margin: 0.15rem 0 0.35rem;
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
}

.portal-service-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.portal-service-facts div {
  display: grid;
  gap: 0.15rem;
}

.portal-service-facts dt {
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-service-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.portal-ownership-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.portal-ownership-form .portal-field-wide,
.portal-ownership-form .portal-form-actions {
  grid-column: 1 / -1;
}

.portal-admin-editor summary {
  cursor: pointer;
  font-weight: 800;
}

.portal-services-admin .portal-workspace {
  display: grid;
  gap: 1.25rem;
}

.portal-admin-record-section {
  display: grid;
  gap: 0.8rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--portal-line);
}

.portal-admin-record-section .portal-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.portal-admin-record-section .portal-section-heading h3 {
  margin: 0.15rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
}

.portal-admin-record-section .portal-section-heading > p {
  max-width: 440px;
  margin: 0;
  text-align: right;
}

.portal-admin-editor .portal-form {
  margin: 1rem 0 0;
  border: 0;
  background: #f7f9fb;
}

.portal-ownership-form label {
  display: grid;
  gap: 0.38rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-ownership-form input,
.portal-ownership-form select,
.portal-ownership-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  color: var(--portal-ink);
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.portal-ownership-form textarea {
  min-height: 82px;
  resize: vertical;
}

.portal-ownership-form .portal-check-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #fff;
}

.portal-ownership-form .portal-check-field input {
  width: auto;
  min-height: 0;
  margin: 0 0.55rem 0 0;
}

.portal-services-admin .portal-empty-compact {
  min-height: 64px;
  padding: 0.8rem;
  border: 1px dashed var(--portal-line);
  border-radius: 12px;
}

.portal-request-controls {
  min-width: min(360px, 45%);
  flex-direction: column;
}

.portal-request-controls select,
.portal-request-controls textarea {
  width: 100%;
}

.portal-dialog {
  width: min(620px, calc(100vw - 2rem));
  padding: 1.4rem;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgb(4 12 22 / 25%);
}

.portal-dialog::backdrop {
  background: rgb(4 12 22 / 65%);
}

@media (max-width: 720px) {
  .portal-service-grid,
  .portal-ownership-form,
  .portal-service-facts {
    grid-template-columns: 1fr;
  }

  .portal-request-card {
    flex-direction: column;
  }

  .portal-request-controls {
    width: 100%;
    min-width: 0;
  }

  .portal-admin-record-section .portal-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-admin-record-section .portal-section-heading > p {
    text-align: left;
  }
}
