body { font-family: Inter, "Segoe UI", Arial, sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: "Inter Tight", Inter, "Segoe UI", Arial, sans-serif; }
body :is(h1, h2, h3, h4, h5, h6, .review h2, .concept-body) { letter-spacing: normal; }

.portal-shell {
  --portal-base: #090b0f;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  min-height: 100svh;
  background: var(--portal-base);
}

.portal-skip { position: absolute; inset: .75rem auto auto .75rem; z-index: 5; padding: .65rem 1rem; background: #12161d; transform: translateY(-180%); }
.portal-skip:focus { transform: none; }
.portal-sidebar { background: var(--surface); padding: 1.9rem 1.1rem; }
.portal-brand { display: block; width: fit-content; margin: 0 .75rem 2.2rem; }
.portal-brand img { display: block; width: var(--brand-logo-width); height: var(--brand-logo-height); object-fit: contain; object-position: left center; }
.portal-brand-fallback { display: grid; align-items: center; min-height: 2.75rem; font-size: 1.2rem; font-weight: 750; }
.portal-brand small { display: block; margin-top: .35rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.portal-nav { display: grid; gap: .3rem; }
.portal-nav a { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .45rem .75rem; border-radius: .65rem; color: #bbc1cc; font-size: .9rem; white-space: nowrap; }
.portal-nav a:hover, .portal-nav a[aria-current="page"] { background: var(--surface); color: var(--text); }
.portal-nav a[aria-current="page"] { font-weight: 650; }
.portal-nav svg { width: 1.15rem; height: 1.15rem; flex: none; }
.portal-nav a[aria-current="page"] svg { color: var(--blue); }

.portal-main { min-width: 0; }
.portal-main .dashboard { width: min(calc(100% - 3rem), 72rem); padding-block: clamp(1.7rem, 4vw, 3.5rem); }
.portal-main .dashboard h1 { font-size: clamp(2.15rem, 5vw, 3.5rem); overflow-wrap: anywhere; }
.portal-topbar { display: flex; justify-content: flex-end; align-items: center; min-height: 4.3rem; padding: .6rem clamp(1rem, 3vw, 2.5rem); }
.portal-profile-menu { position: relative; min-width: 0; }
.portal-profile-menu summary { display: flex; align-items: center; gap: .65rem; max-width: 23rem; min-height: 2.75rem; padding: .25rem .5rem; border-radius: .65rem; cursor: pointer; list-style: none; }
.portal-profile-menu summary::-webkit-details-marker { display: none; }
.portal-profile-menu summary:hover, .portal-profile-menu[open] summary { background: var(--surface); }
.portal-profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 600; }
.portal-profile-menu summary svg { flex: none; color: var(--muted); }
.portal-avatar { display: grid; flex: none; place-items: center; position: relative; width: 2.375rem; aspect-ratio: 1; overflow: hidden; border-radius: 50%; }
.portal-avatar:not(:has(img)) { background: #233c4b; color: #b7ebff; font-size: .75rem; font-weight: 750; }
.portal-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portal-profile-panel { position: absolute; z-index: 3; top: calc(100% + .5rem); right: 0; width: min(17rem, calc(100vw - 2rem)); padding: .45rem; border-radius: .75rem; background: linear-gradient(var(--surface), var(--surface)), var(--portal-base); box-shadow: 0 12px 30px #0006; }
.portal-profile-panel p { padding: .6rem .65rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.portal-profile-panel a, .portal-profile-panel button { display: block; width: 100%; padding: .55rem .65rem; border-radius: .5rem; text-align: left; font-size: .9rem; cursor: pointer; }
.portal-profile-panel a:hover, .portal-profile-panel button:hover { background: var(--surface); }

.portal-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.portal-tile { display: grid; align-content: start; justify-items: start; gap: .55rem; }
.portal-tile h2 { font-size: 1.2rem; }
.portal-tile .button { display: inline-flex; align-items: center; margin-top: .6rem; }
.portal-profile-card { max-width: 34rem; }
.portal-profile-form { display: grid; gap: .6rem; }
.portal-profile-form label { font-size: .9rem; font-weight: 600; }
.portal-profile-form input { min-width: 0; }
.portal-profile-form :is(input, textarea, select) {
  width: 100%; min-height: 2.8rem; margin-bottom: .55rem; padding: .55rem .7rem;
  border-radius: .5rem; background: var(--surface);
}
.portal-profile-form button { justify-self: start; }
.portal-profile-form [role="status"]:empty { margin-top: -.6rem; }

.profile-avatar-picker { display: grid; gap: .65rem; margin-bottom: .65rem; }
.profile-avatar-picker legend { margin-bottom: .65rem; font-size: .9rem; font-weight: 600; }
.profile-avatar-options { display: flex; flex-wrap: wrap; gap: .75rem; }
.profile-avatar-option { position: relative; cursor: pointer; }
.profile-avatar-option input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; }
.profile-avatar-preview {
  display: grid;
  place-items: center;
  width: 3.5rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #233c4b;
  color: #b7ebff;
  font-weight: 750;
}
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-option input:is(:checked, :focus-visible) + .profile-avatar-preview { outline: 2px solid var(--blue); outline-offset: 3px; }
.profile-avatar-option input:focus-visible + .profile-avatar-preview { outline-color: var(--text); }

@media (max-width: 760px) {
  .portal-shell { display: flex; flex-direction: column; position: relative; }
  .portal-sidebar { padding: .8rem 1rem .55rem; }
  .portal-brand { min-height: 2.8rem; margin: .15rem 0 .75rem; }
  .portal-brand-fallback { width: 7.25rem; height: 1.75rem; min-height: 1.75rem; font-size: .95rem; }
  .portal-brand small { margin-top: .2rem; }
  .portal-nav { display: flex; gap: .35rem; overflow-x: auto; padding: .2rem .25rem .35rem; }
  .portal-nav a { gap: .35rem; padding-inline: .55rem; font-size: .82rem; }
  .portal-nav a svg { width: .95rem; height: .95rem; }
  .portal-topbar { position: absolute; top: .8rem; right: .85rem; min-height: 0; padding: 0; }
  .portal-profile-menu summary { max-width: calc(100vw - 9.75rem); }
  .portal-overview { grid-template-columns: 1fr; }
  .portal-main .dashboard { width: calc(100% - 2rem); }
}

.support-button { display: inline-flex; align-items: center; margin-bottom: 1rem; }
.support-list a { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem .4rem; }
.support-list a:hover strong { color: var(--blue); }
.support-list a > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.support-list small { display: block; margin-top: .25rem; color: var(--muted); }
.support-stage { display: inline-block; width: fit-content; flex: none; padding: .28rem .6rem; border-radius: .4rem; background: #203846; color: #b7ebff; font-size: .8rem; }
.support-form-card { max-width: 46rem; }
.support-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; }
.support-stages { display: grid; gap: .3rem; }
.support-stages li { padding: .55rem .7rem; border-left: 2px solid transparent; font-size: .9rem; }
.support-stages [aria-current="step"] { border-color: var(--blue); background: #172129; border-radius: 0 .45rem .45rem 0; }
.support-stage-update { display: grid; gap: .35rem; }
.support-stage-update:not(:empty) { margin-top: .55rem; }
.support-stage-fields { display: grid; gap: .6rem; }
.support-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.support-dates label { display: block; margin-bottom: .45rem; }
.portal-profile-form input[type="file"]::file-selector-button {
  margin-right: .65rem; padding: .25rem .6rem; border: 0; border-radius: .3rem; background: var(--surface); color: var(--text);
}
@media (max-width: 760px) {
  .support-detail, .support-dates { grid-template-columns: 1fr; }
}

.project-setup, .project-editor, .project-timeline { display: grid; gap: 1rem; }
.project-setup { margin-block: .85rem; }
.project-editor { max-width: 54rem; }
.project-editor h2, .project-setup h2 { font-size: 1.2rem; }
.project-stage-editor { display: grid; gap: .45rem; min-width: 0; }
.project-stage-editor legend { padding-inline: .45rem; font-weight: 650; }
.project-task-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 9rem) auto; gap: .6rem; align-items: end; }
.project-task-editor label { display: block; margin-bottom: .4rem; }
.project-task-editor button { margin-bottom: .55rem; }
.project-template-picker { display: grid; gap: .6rem; min-width: 0; }
.project-template-picker legend { margin-bottom: .75rem; font-weight: 650; }
.project-template-choice { display: flex; align-items: start; gap: .75rem; padding: .65rem; border: 1px solid transparent; border-radius: .55rem; background: var(--surface); cursor: pointer; }
.project-template-choice:has(:checked) { border-color: var(--blue); }
.portal-profile-form .project-template-choice input { width: auto; min-height: 0; margin: .25rem 0 0; accent-color: var(--blue); }
.project-template-choice small { display: block; margin-top: .25rem; font-weight: 400; }
.project-timeline > li { display: grid; gap: .6rem; padding: .85rem; border-left: 2px solid transparent; border-radius: 0 .4rem .4rem 0; }
.project-timeline > [aria-current="step"] { border-color: var(--blue); background: #172129; }
.project-stage-heading, .project-task-list > li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; overflow-wrap: anywhere; }
.project-stage-heading h3 { font-weight: 650; }
.project-task-list > li { padding-block: .65rem; }
.project-action { display: grid; justify-items: start; gap: .4rem; }
@media (max-width: 760px) {
  .project-task-editor { grid-template-columns: 1fr; }
}
