/* Desktop-oriented management shell (PlanOps layout, TechCom tokens). */

body.manage-portal {
  background: var(--bg);
  overflow: hidden;
}

body.manage-portal .shell {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.manage-portal .auth-page-loading {
  min-height: 100vh;
  min-height: 100dvh;
}

.mp-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.mp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(20px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.mp-brand {
  /* Brand sizing comes from shared .tc-header / .tc-logo / .tc-tagline in app_v3.css */
  flex: 0 1 auto;
}

.mp-nav__label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-nav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.mp-nav__link.is-active,
.mp-nav__link:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.mp-nav__icon {
  flex: 0 0 auto;
}

.mp-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html:not(.mp-ready) .mp-nav__link[data-mp-feature],
html:not(.mp-ready) .mp-user-menu__item[data-mp-feature],
html.mp-ready:not(.mp-feat-projects) .mp-nav__link[data-mp-feature="projects"],
html.mp-ready:not(.mp-feat-projects) .mp-user-menu__item[data-mp-feature="projects"],
html.mp-ready:not(.mp-feat-tasks) .mp-nav__link[data-mp-feature="tasks"],
html.mp-ready:not(.mp-feat-tasks) .mp-user-menu__item[data-mp-feature="tasks"],
html.mp-ready:not(.mp-feat-osp) .mp-nav__link[data-mp-feature="osp"],
html.mp-ready:not(.mp-feat-osp) .mp-user-menu__item[data-mp-feature="osp"],
html.mp-ready:not(.mp-feat-locates) .mp-nav__link[data-mp-feature="locates"],
html.mp-ready:not(.mp-feat-locates) .mp-user-menu__item[data-mp-feature="locates"],
html.mp-ready:not(.mp-feat-my_work) .mp-nav__link[data-mp-feature="my_work"],
html.mp-ready:not(.mp-feat-my_work) .mp-user-menu__item[data-mp-feature="my_work"],
.mp-nav__link[data-mp-feature][hidden],
.mp-user-menu__item[data-mp-feature][hidden] {
  display: none !important;
}

.mp-sidebar__back {
  margin-top: auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}

.mp-sidebar__back:hover {
  color: var(--accent);
}

/* Mobile account menu — mirror home-user-menu sizing/chrome. */
.mp-user-menu {
  display: none;
  position: relative;
  flex: 0 0 auto;
  z-index: 100;
  margin-left: auto;
}

.mp-user-menu__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.mp-user-menu__trigger:active {
  transform: scale(0.96);
}

.mp-user-menu__trigger[aria-expanded="true"] {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.1);
}

.mp-user-menu__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}

.mp-user-menu__avatar-fallback {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mp-user-menu__avatar-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.mp-user-menu__avatar.is-loaded .mp-user-menu__avatar-photo {
  opacity: 1;
}

.mp-user-menu__avatar--panel {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.mp-user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(240px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(17, 17, 17, 0.18);
  box-sizing: border-box;
}

.mp-user-menu__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mp-user-menu__identity {
  min-width: 0;
  flex: 1;
}

.mp-user-menu__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-user-menu__email {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-user-menu__divider {
  height: 1px;
  margin: 12px 0 8px;
  background: var(--border);
}

.mp-user-menu__item,
.mp-user-menu__sign-out {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.mp-user-menu__item.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.mp-user-menu__item:active,
.mp-user-menu__sign-out:active {
  background: var(--surface2);
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  .mp-user-menu__item:hover,
  .mp-user-menu__sign-out:hover {
    background: var(--surface2);
  }
}

.mp-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(16px + var(--safe-top)) 24px calc(32px + var(--safe-bottom));
}

.mp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.mp-topbar__crumb {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-topbar__role {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mp-topbar__name {
  font-size: 0.88rem;
  font-weight: 700;
}

.mp-page__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.mp-page__actions {
  display: flex;
  gap: 8px;
}

.mp-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.mp-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.mp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 200px;
  max-width: 420px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.mp-search input,
.mp-toolbar select {
  min-height: 42px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
}

.mp-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  color: var(--text);
  outline: none;
}

.mp-search svg {
  flex: 0 0 auto;
  pointer-events: none;
}

.mp-toolbar select {
  min-width: 140px;
  max-width: 220px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.mp-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.mp-refresh {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mp-refresh:hover {
  border-color: var(--border-hover);
}

.mp-refresh:disabled {
  opacity: 0.6;
  cursor: wait;
}

.mp-count {
  margin: 0 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.mp-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 8px;
}

.mp-pager__btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mp-pager__btn:hover:not(:disabled) {
  border-color: var(--border-hover);
}

.mp-pager__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.mp-pager__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.mp-state {
  padding: 28px 8px;
  color: var(--muted);
  font-weight: 600;
}

.mp-cards {
  display: grid;
  gap: 14px;
}

.mp-card {
  display: block;
  padding: 20px 22px 16px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: none;
}

.mp-card:hover {
  border-color: var(--border-hover);
}

.mp-card.is-progress {
  border-color: #3b82f6;
}

.mp-card.is-progress:hover {
  border-color: #1d4ed8;
}

.mp-card.is-done {
  border-color: #22c55e;
}

.mp-card.is-done:hover {
  border-color: #15803d;
}

.mp-card.is-hold {
  border-color: #f59e0b;
}

.mp-card.is-hold:hover {
  border-color: #b45309;
}

.mp-card.is-idle,
.mp-card.is-restore {
  border-color: rgba(17, 17, 17, 0.22);
}

.mp-card.is-idle:hover,
.mp-card.is-restore:hover {
  border-color: rgba(17, 17, 17, 0.4);
}

.mp-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mp-card__top:empty {
  display: none;
}

.mp-code {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mp-badge,
.mp-status,
.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mp-badge {
  background: var(--surface2);
  color: var(--text);
}

.mp-status {
  margin-left: auto;
  background: var(--surface2);
}

.mp-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.mp-status.is-progress {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.mp-status.is-progress::before {
  background: currentColor;
}

.mp-status.is-done {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.mp-status.is-done::before {
  background: currentColor;
}

.mp-status.is-hold {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.mp-status.is-restore {
  background: rgba(17, 17, 17, 0.08);
}

.mp-card__title {
  margin: 10px 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.mp-card__client {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.mp-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin-top: 16px;
  font-size: 0.95rem;
  font-weight: 700;
}

.mp-meta > div {
  min-width: 0;
}

.mp-meta > div > span:first-child {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.mp-progress__track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}

.mp-progress__bar {
  height: 100%;
  background: var(--accent);
}

.mp-progress__label {
  font-size: 0.78rem;
  font-weight: 800;
}

.mp-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mp-card__stage {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mp-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
}

.mp-dot.is-done {
  border-color: #15803d;
  background: #15803d;
}

.mp-dot.is-current {
  border-color: var(--accent);
  background: var(--accent);
}

.mp-chip--muted {
  background: var(--surface2);
  color: var(--muted);
}

.mp-chip--assigned {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.mp-chip--created {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.mp-chip--team {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
}

.mp-chip--subitems {
  background: var(--accent-soft);
  color: var(--text);
}

.mp-pm-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.mp-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.mp-page--detail {
  max-width: 1080px;
}

.mp-back-row {
  margin: 0 0 12px;
}

.mp-back {
  font-weight: 700;
  text-decoration: none;
}

.mp-hero {
  margin-bottom: 18px;
}

.mp-hero__meta,
.mp-hero__sub {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.mp-hero__meta {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mp-hero__meta a,
.mp-dl a {
  color: inherit;
  font-weight: 800;
}

.mp-hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 8px 0 0;
}

.mp-hero__copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.mp-hero h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.mp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 2px;
}

.mp-hero__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.mp-hero__meta-row .mp-status {
  margin-left: 0;
}

.mp-action {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.mp-action:hover {
  border-color: var(--border-hover);
}

.mp-life-band {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface2);
}

.mp-life-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.mp-life-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mp-life-card__head h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-life {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.mp-life__tile {
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.mp-life__tile.is-done {
  background: rgba(22, 163, 74, 0.1);
  border-color: transparent;
}

.mp-life__tile.is-current {
  background: var(--accent-soft);
  border-color: transparent;
}

.mp-life__tile strong,
.mp-life__tile em {
  display: block;
}

.mp-life__tile strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mp-life__tile em {
  margin-top: 4px;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.mp-life-card__foot {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.mp-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.mp-kpi,
.mp-panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.mp-kpi {
  border-left: 3px solid var(--border);
}

.mp-kpi:first-child {
  border-left-color: var(--accent);
}

.mp-kpi > span {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.mp-kpi em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.mp-muted {
  color: var(--muted);
  font-weight: 600;
}

.mp-panel {
  margin-bottom: 14px;
}

.mp-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.mp-panel__head h2,
.mp-panel h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-panel__meta {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.mp-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 0 0 16px;
}

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

.mp-dl dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.mp-dl .mp-status {
  margin-left: 0;
}

.mp-staff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.mp-staff__person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mp-staff__person strong,
.mp-staff__person em {
  display: block;
}

.mp-staff__person strong {
  font-size: 0.92rem;
}

.mp-staff__person em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.mp-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface2);
}

.mp-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-avatar--sm {
  width: 24px;
  height: 24px;
}

.mp-avatar--sm.mp-avatar--initials {
  font-size: 0.58rem;
}

.mp-avatar--initials {
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: none;
}

.mp-person__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.mp-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.mp-split > .mp-panel {
  margin-bottom: 0;
}

.mp-files {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.mp-file,
.mp-files .is-disabled {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface2);
  color: inherit;
  text-decoration: none;
}

.mp-file.mp-file--readonly {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.mp-file:hover {
  background: var(--accent-soft);
}

.mp-files .is-disabled {
  opacity: 0.65;
}

.mp-file__ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mp-file__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.mp-file__open {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.mp-stage + .mp-stage {
  margin-top: 16px;
}

.mp-stage__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.mp-stage__head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.mp-stage__head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.mp-stage__head strong {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

.mp-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.mp-check__mark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.mp-check.is-done .mp-check__mark {
  border-color: var(--accent);
  background: var(--accent);
  position: relative;
}

.mp-check.is-done .mp-check__mark::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 1px 0 0 5px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
}

.mp-check > div span {
  font-weight: 700;
  font-size: 0.9rem;
}

.mp-check em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.mp-subitems {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.mp-subitems li:not(.mp-subitem) {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.mp-subitems li:not(.mp-subitem):last-child {
  border-bottom: 0;
}

.mp-subitem {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.mp-subitem.is-deleting {
  opacity: 0.72;
  outline: 1px dashed var(--border-hover);
  pointer-events: none;
}

.mp-file-status--inline {
  margin: 0;
  padding: 6px 10px;
  min-height: 34px;
}

.mp-subitem__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mp-subitem__title {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mp-subitem__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mp-subitem__status .mp-status {
  margin-left: 0;
}

.mp-subitem__dl {
  margin: 12px 0 0;
  gap: 10px 20px;
}

.mp-subitem__pct {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-subitem__pct .mp-progress {
  margin-top: 0;
  min-width: 72px;
}

.mp-subitem__pct .mp-progress__track {
  width: 72px;
  flex: 0 0 72px;
}

.mp-subitem__pct .mp-progress__label {
  display: none;
}

.mp-subitem__block {
  margin-top: 12px;
}

.mp-subitem__block h4 {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-subitem__block .mp-prose {
  font-size: 0.88rem;
}

.mp-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.mp-prose {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
  font-weight: 600;
}

@media (max-width: 960px) {
  body.manage-portal {
    overflow: auto;
  }

  body.manage-portal .shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .mp-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .mp-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    height: auto;
    overflow: visible;
    margin: 0;
    padding: var(--shell-pad-top, calc(12px + var(--safe-top)))
      var(--shell-pad-right, 16px)
      12px
      var(--shell-pad-x, 16px);
    background: var(--bg);
    border-right: none;
    box-shadow: 0 1px 0 rgba(17, 17, 17, 0.06);
  }

  .mp-nav--desktop,
  .mp-sidebar__back--desktop {
    display: none;
  }

  .mp-user-menu {
    display: block;
    z-index: 60;
  }

  .mp-topbar__user {
    display: none;
  }

  .mp-main {
    height: auto;
    overflow: visible;
    /* Sticky header already clears the notch; don't add safe-top again. */
    padding: 16px 16px calc(32px + var(--safe-bottom));
  }

  .mp-page__head,
  .mp-hero__row,
  .mp-life,
  .mp-kpis,
  .mp-split,
  .mp-dl,
  .mp-staff,
  .mp-meta {
    grid-template-columns: 1fr;
  }

  .mp-page__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .mp-count {
    margin-left: 0;
  }
}

.mp-file__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0;
}

.mp-file__remove:hover {
  color: var(--danger, #b42318);
}

.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.mp-btn[hidden] {
  display: none;
}

.mp-btn:hover {
  border-color: var(--border-hover);
}

.mp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mp-btn--primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.mp-btn--danger {
  background: var(--danger, #b42318);
  border-color: var(--danger, #b42318);
  color: #fff;
}

.mp-btn--ghost {
  background: transparent;
}

.mp-form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger, #b42318);
  font-weight: 700;
  font-size: 0.88rem;
}

.mp-form-grid {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 16px;
}

.mp-field {
  display: grid;
  gap: 6px;
}

.mp-field--full {
  grid-column: 1 / -1;
}

.mp-field label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-field input[type="text"],
.mp-field input[type="date"],
.mp-field input[type="search"],
.mp-field select,
.mp-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 600;
}

.mp-field textarea {
  min-height: 96px;
  resize: vertical;
}

.mp-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-weight: 700;
}

.mp-check input {
  width: 16px;
  height: 16px;
}

.mp-people {
  display: grid;
  gap: 8px;
}

.mp-people__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.mp-chip-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.mp-chip-edit button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.mp-people__results {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  max-height: 160px;
  overflow: auto;
}

.mp-people__results[hidden] {
  display: none;
}

.mp-people__results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mp-people__results button:hover {
  background: var(--accent-soft);
}

.mp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

.mp-create-sub {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.mp-create-sub__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.mp-create-sub__toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--surface2);
}

.mp-create-sub__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
}

.mp-create-sub.is-expanded {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
}

.mp-create-sub__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mp-create-sub__head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.mp-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.mp-modal[hidden] {
  display: none;
}

.mp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
}

.mp-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.18);
}

.mp-modal__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.mp-modal__body {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.mp-modal__body strong {
  color: var(--text);
}

.mp-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 960px) {
  .mp-form-grid {
    grid-template-columns: 1fr;
  }
}

.mp-file-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.mp-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(17, 17, 17, 0.15);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: mp-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

@keyframes mp-spin {
  to {
    transform: rotate(360deg);
  }
}

.mp-file.is-busy {
  opacity: 0.72;
  outline: 1px dashed var(--border-hover);
}

.mp-file__remove:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mp-modal.is-busy .mp-modal__backdrop,
.mp-modal.is-busy [data-mp-modal-dismiss].mp-btn {
  pointer-events: none;
  opacity: 0.55;
}

.mp-modal.is-busy #mp-file-confirm-ok {
  min-width: 7.5rem;
}

.mp-file-picked {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.mp-file-picked .mp-btn {
  min-height: 28px;
  margin-left: 6px;
  padding: 0 10px;
  font-size: 0.75rem;
}
