:root {
  --ink: #17201d;
  --muted: #607068;
  --faint: #8b9991;
  --line: rgba(29, 44, 38, .12);
  --line-strong: rgba(29, 44, 38, .22);
  --paper: #fbf7ee;
  --surface: rgba(255, 252, 245, .88);
  --surface-strong: #fffdf7;
  --teal: #1f7668;
  --teal-dark: #174c44;
  --blue: #315f9b;
  --gold: #d79a45;
  --coral: #c45f55;
  --green: #28745a;
  --shadow: 0 24px 70px rgba(28, 42, 36, .18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .76) 0 18%, transparent 18% 100%),
    linear-gradient(135deg, #f8f4ea 0%, #edf5ef 48%, #f7ead9 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.portal-shell {
  min-height: 100vh;
}

.portal-frame {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.portal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  color: #f8fbf6;
  background:
    linear-gradient(180deg, rgba(30, 82, 73, .98), rgba(28, 47, 44, .98)),
    #203530;
}

.portal-brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.portal-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8cf74, #ec8f61);
  color: #17302a;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.portal-brand strong {
  display: block;
  font-size: 15px;
}

.portal-brand span {
  color: rgba(248, 251, 246, .72);
  font-size: 12px;
}

.portal-nav {
  display: grid;
  gap: 8px;
}

.portal-nav button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: rgba(248, 251, 246, .82);
  background: rgba(255, 255, 255, .06);
  text-align: left;
}

.portal-nav button.is-on {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 3px 0 0 #f8cf74;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .11);
  font-size: 13px;
  font-weight: 900;
}

.portal-sidebar-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: rgba(248, 251, 246, .68);
  font-size: 12px;
  line-height: 1.45;
}

.portal-main {
  min-width: 0;
  padding: 24px;
}

.portal-topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.portal-topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
}

.portal-topbar p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.user-pill {
  display: inline-flex;
  max-width: min(100%, 420px);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-card,
.status-card,
.module-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 38px rgba(48, 60, 52, .10);
  backdrop-filter: blur(10px);
}

.hero-card {
  min-height: 260px;
  padding: 22px;
  color: #fdf8ed;
  background: linear-gradient(135deg, #1c5149 0%, #225f7c 55%, #7d5d35 100%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: #f8cf74;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-card h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-card p {
  max-width: 720px;
  margin: 16px 0 0;
  color: rgba(253, 248, 237, .82);
  font-size: 15px;
  line-height: 1.55;
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.button {
  border: 1px solid var(--teal);
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.ghost-button {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, .78);
}

.hero-card .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, .13);
  border-color: rgba(255, 255, 255, .24);
}

.status-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-row span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8f4ef;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.gold {
  background: #fff0d7;
  color: #946321;
}

.badge.red {
  background: #fae7e3;
  color: #a7443e;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 16px;
}

.module-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  font-weight: 950;
}

.module-card h3 {
  margin: 0;
  font-size: 16px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.module-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ghost-button.quiet {
  border-color: rgba(29, 44, 38, .10);
  color: var(--muted);
  background: rgba(255, 255, 255, .54);
}

.command-stack {
  display: grid;
  gap: 14px;
}

.private-data-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(31, 118, 104, .10), rgba(49, 95, 155, .08)),
    rgba(255, 252, 245, .86);
  box-shadow: 0 12px 34px rgba(48, 60, 52, .08);
}

.private-data-banner h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
}

.private-data-banner p:not(.eyebrow) {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.metric-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 28px rgba(48, 60, 52, .06);
}

.metric-card span,
.metric-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.data-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 14px;
}

.data-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(48, 60, 52, .07);
}

.data-panel.wide {
  min-width: 0;
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.data-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(29, 44, 38, .10);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .72);
}

.data-row strong,
.data-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-row strong {
  font-size: 13px;
}

.data-row span,
.data-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tiny-action,
.save-chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(31, 118, 104, .16);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, .72);
  color: #2a6258;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.tiny-action.is-on,
.save-chip {
  border-color: rgba(216, 155, 61, .28);
  background: #fff0d7;
  color: #805615;
}

.save-hint {
  align-self: center;
  color: #7a877f;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.interactive-row {
  align-items: start;
}

.row-drawer {
  margin-top: 8px;
}

.row-drawer summary {
  width: fit-content;
  cursor: pointer;
  border: 1px solid rgba(31, 118, 104, .16);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(248, 251, 247, .92);
  color: #295b52;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  list-style: none;
}

.row-drawer summary::-webkit-details-marker {
  display: none;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(29, 44, 38, .10);
  padding-top: 10px;
}

.field-label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field-label.wide-field {
  grid-column: 1 / -1;
}

.field-label span {
  color: #6b766f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.field-label input,
.field-label select,
.field-label textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(29, 44, 38, .14);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, .84);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.field-label textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
  white-space: pre-wrap;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.search-control-panel .panel-heading {
  align-items: start;
}

.search-control-panel .panel-heading p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.safety-note,
.result-line {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(22, 116, 102, .14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(239, 249, 244, .72);
}

.safety-note strong,
.result-line strong {
  color: #145e54;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.safety-note span,
.result-line span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

button:disabled {
  cursor: progress;
  opacity: .62;
}

.drawer-grid .row-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.role-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-block {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(29, 44, 38, .10);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, .58);
}

.detail-block span {
  color: #6b766f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.detail-block p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.detail-block a {
  color: #1f7668;
  font-weight: 900;
}

.tiny-link {
  display: inline-flex;
  max-width: 150px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(31, 118, 104, .18);
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef8f2;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-panel {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(29, 44, 38, .20);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .42);
}

.empty-panel strong {
  font-size: 13px;
}

.empty-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  padding: 16px;
}

.settings-card h2,
.settings-card h3 {
  margin: 0 0 8px;
}

.settings-card p,
.settings-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-card {
  display: grid;
  width: min(760px, calc(100vw - 32px));
  margin: 8vh auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.auth-banner {
  padding: 28px;
  color: #fff;
  background: linear-gradient(135deg, #1c5149, #245f87 58%, #8b6133);
}

.auth-banner h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 54px);
  line-height: 1;
}

.auth-banner p {
  max-width: 580px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, .80);
}

.auth-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.auth-signal-row span {
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .11);
  color: rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 850;
}

.auth-body {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.auth-preview-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.auth-preview-grid article {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(30, 49, 43, .10);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .68);
}

.auth-preview-grid strong {
  color: #173f37;
  font-size: 13px;
}

.auth-preview-grid span,
.safe-launch-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.safe-launch-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(216, 155, 61, .22);
  border-radius: 8px;
  padding: 11px;
  background: #fff7e8;
}

.safe-launch-note strong {
  color: #805615;
  font-size: 12px;
}

.warning-line {
  border: 1px solid rgba(196, 95, 85, .24);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff2ee;
  color: #8d3d37;
  font-size: 12px;
  line-height: 1.45;
}

.preview-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(216, 155, 61, .24);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 9px 11px;
  background: linear-gradient(135deg, #fff5db, #eef8f4);
  color: #644716;
  font-size: 12px;
}

.preview-banner span {
  flex: 1 1 320px;
  color: #6b6350;
}

.preview-banner a {
  color: #116a5f;
  font-weight: 900;
  text-decoration: none;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1000px) {
  .portal-frame {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

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

  .portal-nav button {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    font-size: 11px;
  }

  .portal-sidebar-foot {
    display: none;
  }

  .hero-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-board {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .portal-main {
    padding: 14px;
  }

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

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

  .hero-card {
    min-height: 0;
    padding: 18px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 0;
  }

  .private-data-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

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

  .tiny-link {
    max-width: 100%;
  }
}

/* Private portal MVP polish: warmer, calmer, less status-page energy. */
:root {
  --ink: #18231f;
  --muted: #62756e;
  --faint: #92a39b;
  --line: rgba(30, 49, 43, .11);
  --line-strong: rgba(30, 49, 43, .20);
  --paper: #fbf5ea;
  --surface: rgba(255, 253, 247, .86);
  --surface-strong: #fffdf8;
  --teal: #167466;
  --teal-dark: #123f3a;
  --blue: #356d98;
  --gold: #d89b3d;
  --coral: #d86f58;
  --green: #2b7d62;
  --plum: #6d5a8f;
  --shadow: 0 24px 60px rgba(35, 48, 43, .15);
}

html {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .18) 42%, rgba(255, 255, 255, .50)),
    linear-gradient(135deg, #fff6df 0%, #eaf7f1 34%, #edf3ff 68%, #fff0e8 100%);
}

body {
  color: var(--ink);
}

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

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  gap: 16px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(17, 65, 59, .97), rgba(20, 43, 39, .98)),
    #15302d;
}

.portal-brand {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 14px;
}

.portal-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ffe28e, #ec8d5e 55%, #6eb8a7);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .20);
}

.portal-nav {
  gap: 6px;
}

.portal-nav button {
  min-height: 38px;
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .045);
}

.portal-nav button:hover,
.portal-nav button.is-on {
  color: #fff;
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .18);
}

.portal-nav button.is-on {
  box-shadow: inset 3px 0 0 #ffd978;
}

.nav-icon {
  background: rgba(255, 255, 255, .12);
  color: #ffe8ac;
}

.portal-main {
  padding: 24px clamp(18px, 3vw, 36px) 36px;
}

.portal-topbar {
  margin-bottom: 16px;
}

.portal-topbar h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.portal-topbar p {
  max-width: 620px;
  color: #516760;
}

.user-pill {
  border-color: rgba(22, 116, 102, .16);
  background: rgba(255, 255, 255, .72);
  color: #2f6258;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.lead-panel {
  min-height: 236px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  padding: clamp(22px, 3vw, 34px);
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(18, 63, 58, .98), rgba(31, 105, 119, .96) 52%, rgba(154, 96, 53, .95)),
    #164b45;
  box-shadow: var(--shadow);
}

.lead-panel h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
  line-height: .96;
}

.lead-panel p:not(.eyebrow) {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(255, 250, 240, .82);
  font-size: 16px;
  line-height: 1.45;
}

.lead-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.lead-metrics span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, .11);
  color: rgba(255, 250, 240, .84);
  font-size: 12px;
  font-weight: 760;
}

.lead-metrics strong {
  color: #ffe28e;
  font-size: 14px;
}

.calm-card {
  align-content: start;
  border-color: rgba(22, 116, 102, .16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 253, 247, .70)),
    var(--surface);
}

.portal-scoreboard {
  margin-bottom: 14px;
}

.metric-card {
  border-color: rgba(22, 116, 102, .12);
  background: rgba(255, 255, 255, .76);
}

.metric-card strong {
  color: #19352f;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  gap: 14px;
  margin-bottom: 18px;
}

.section-title-row {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.section-title-row h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.05;
}

.hero-card,
.status-card,
.module-card,
.settings-card,
.data-panel {
  border-color: rgba(30, 49, 43, .10);
  box-shadow: 0 14px 38px rgba(35, 48, 43, .08);
}

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-card {
  min-height: 172px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .84), rgba(255, 253, 247, .72)),
    var(--surface);
}

.module-card:hover,
.data-row:hover {
  border-color: rgba(22, 116, 102, .22);
  box-shadow: 0 16px 36px rgba(35, 48, 43, .11);
}

.module-icon {
  background: linear-gradient(135deg, var(--teal), var(--blue) 56%, var(--plum));
}

.button {
  border-color: rgba(11, 85, 75, .82);
  background: linear-gradient(135deg, #127063, #276f9c 62%, #7a5b94);
  box-shadow: 0 10px 22px rgba(39, 111, 156, .18);
}

.ghost-button {
  border-color: rgba(30, 49, 43, .14);
  background: rgba(255, 255, 255, .74);
}

.ghost-button:hover,
.button:hover {
  transform: translateY(-1px);
}

.badge {
  background: #e5f6ef;
  color: #116a5f;
}

.badge.gold {
  background: #fff1d3;
  color: #8b5c17;
}

.badge.red {
  background: #f9e4df;
  color: #a4493f;
}

.private-data-banner {
  background:
    linear-gradient(135deg, rgba(22, 116, 102, .12), rgba(53, 109, 152, .10), rgba(216, 155, 61, .08)),
    rgba(255, 253, 247, .78);
}

.data-row {
  background: rgba(255, 255, 255, .72);
}

.auth-card {
  width: min(900px, calc(100vw - 32px));
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  min-height: 440px;
}

.auth-banner {
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, #123f3a, #276f9c 56%, #9b6840),
    #123f3a;
}

.auth-body {
  align-content: center;
  padding: clamp(24px, 4vw, 42px);
}

@media (max-width: 1120px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .portal-frame {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    height: auto;
  }

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

  .overview-grid,
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .portal-main {
    padding: 14px;
  }

  .portal-brand {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .portal-sidebar {
    gap: 10px;
    padding: 10px;
  }

  .portal-mark {
    width: 34px;
    height: 34px;
  }

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

  .portal-brand strong {
    font-size: 14px;
  }

  .portal-brand span {
    font-size: 11px;
  }

  .portal-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 100%;
    overflow-x: hidden;
  }

  .portal-nav button {
    min-height: 54px;
    min-width: 0;
    padding-inline: 6px;
  }

  .portal-topbar {
    gap: 10px;
  }

  .lead-panel h2 {
    font-size: clamp(28px, 9vw, 38px);
  }

  .lead-panel {
    min-height: 0;
    padding: 18px;
  }

  .lead-panel p:not(.eyebrow) {
    margin-top: 12px;
    font-size: 14px;
  }

  .lead-metrics {
    margin-top: 12px;
  }

  .lead-metrics span {
    flex: 1 1 calc(33.333% - 6px);
    justify-content: center;
    min-width: 0;
    min-height: 26px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .portal-scoreboard,
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-banner {
    min-height: 260px;
  }
}

@media (max-width: 460px) {
  .portal-sidebar {
    padding: 12px;
  }

  .portal-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .portal-nav button {
    min-height: 48px;
    font-size: 10px;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
    font-size: 10px;
  }

  .lead-panel {
    padding: 16px;
  }

  .lead-panel h2 {
    max-width: 310px;
    font-size: clamp(28px, 9vw, 36px);
    line-height: .98;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
  }

  .hero-actions .button,
  .hero-actions .ghost-button {
    width: auto;
    min-height: 34px;
    padding: 7px 8px;
    font-size: 10.5px;
  }

  .hero-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .lead-metrics {
    gap: 5px;
    margin-top: 12px;
  }

  .lead-metrics span {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 10.5px;
  }

  .lead-metrics strong {
    font-size: 12px;
  }

  .portal-scoreboard,
  .module-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Private portal command surface v3: brighter, more useful, less status-report. */
:root {
  --sun: #ffe394;
  --mint: #bfeadf;
  --sky: #c9def8;
  --rose: #ffd8ca;
}

.portal-sidebar {
  background:
    radial-gradient(circle at 20% 4%, rgba(255, 227, 148, .24), transparent 28%),
    linear-gradient(180deg, rgba(14, 74, 67, .98), rgba(18, 42, 39, .98)),
    #133632;
}

.portal-nav button {
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.portal-nav button:hover {
  transform: translateX(2px);
}

.portal-topbar h1 {
  color: #112c28;
}

.lead-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 227, 148, .36), transparent 24%),
    radial-gradient(circle at 72% 86%, rgba(201, 222, 248, .26), transparent 30%),
    linear-gradient(135deg, #104940 0%, #22798d 55%, #ab7044 100%);
}

.lead-panel::after {
  content: "";
  position: absolute;
  inset: auto -44px -58px auto;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}

.lead-panel > * {
  position: relative;
  z-index: 1;
}

.portal-pulse-card {
  gap: 12px;
  padding: 18px;
}

.portal-pulse-card h2 {
  margin: 0;
  color: #143a34;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.05;
}

.portal-pulse-card p:not(.eyebrow) {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pulse-stack {
  display: grid;
  gap: 8px;
}

.pulse-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(30, 49, 43, .11);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .72);
}

.pulse-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.pulse-item strong {
  border-radius: 999px;
  padding: 4px 8px;
  background: #e6f7f0;
  color: #116a5f;
  font-size: 11px;
}

.pulse-item.watch strong {
  background: #fff1d3;
  color: #8b5c17;
}

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

.next-move-card {
  display: grid;
  gap: 5px;
  min-height: 112px;
  border: 1px solid rgba(30, 49, 43, .10);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 253, 247, .74)),
    var(--surface);
  box-shadow: 0 12px 30px rgba(35, 48, 43, .08);
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.next-move-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 116, 102, .24);
  box-shadow: 0 18px 40px rgba(35, 48, 43, .12);
}

.next-move-card span {
  color: #5e7169;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.next-move-card strong {
  min-width: 0;
  overflow: hidden;
  color: #132f2a;
  font-size: 16px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-move-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.next-move-card.hot {
  background:
    linear-gradient(135deg, rgba(255, 227, 148, .52), rgba(255, 253, 247, .82)),
    var(--surface);
}

.next-move-card.focus {
  background:
    linear-gradient(135deg, rgba(191, 234, 223, .54), rgba(255, 253, 247, .84)),
    var(--surface);
}

.next-move-card.watch {
  background:
    linear-gradient(135deg, rgba(201, 222, 248, .56), rgba(255, 253, 247, .84)),
    var(--surface);
}

.launch-card {
  position: relative;
  overflow: hidden;
}

.launch-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.launch-card.watch::before {
  background: linear-gradient(90deg, var(--gold), #efbd73);
}

.launch-card.danger::before {
  background: linear-gradient(90deg, var(--coral), #e7a390);
}

.launch-card.focus::before {
  background: linear-gradient(90deg, var(--blue), var(--plum));
}

.launch-card .eyebrow {
  color: #7b8b84;
}

.launch-card.ready .eyebrow {
  color: #116a5f;
}

.launch-card.watch .eyebrow {
  color: #8b5c17;
}

.launch-card.danger .eyebrow {
  color: #a4493f;
}

.launch-card.focus .eyebrow {
  color: #345e96;
}

.module-card {
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.module-card.tone-gold::before {
  background: linear-gradient(90deg, var(--gold), #efb96a);
}

.module-card.tone-muted::before {
  background: linear-gradient(90deg, #9aa9a2, #c8d2cc);
}

.module-card.tone-ready {
  border-color: rgba(22, 116, 102, .18);
}

.module-card.tone-gold {
  border-color: rgba(216, 155, 61, .20);
}

.module-card.tone-muted {
  opacity: .86;
}

.module-card.tone-muted .module-icon {
  background: linear-gradient(135deg, #82948e, #637a8c);
}

@media (max-width: 1000px) {
  .next-move-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .portal-nav button:hover,
  .ghost-button:hover,
  .button:hover,
  .next-move-card:hover {
    transform: none;
  }

  .next-move-card {
    min-height: 0;
  }
}

/* Private doorway v6: the public face is intentionally quiet. */
.portal-shell:has(.minimal-auth) {
  display: grid;
  place-items: start center;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(247, 247, 244, .94)),
    #f7f7f4;
}

.minimal-auth {
  width: min(360px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  min-height: 0;
  margin: 18vh auto 0;
  border: 1px solid rgba(23, 32, 29, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 48px rgba(23, 32, 29, .10);
}

.minimal-auth .auth-body {
  align-content: start;
  gap: 14px;
  padding: 24px;
}

.minimal-auth .eyebrow {
  margin: 0;
  color: #6a746f;
}

.minimal-auth h1 {
  margin: 0 0 4px;
  color: #17201d;
  font-size: 28px;
  line-height: 1.05;
}

.minimal-auth .button {
  width: 100%;
  min-height: 42px;
  border-color: #1d3d37;
  background: #1d3d37;
  box-shadow: none;
}

.minimal-auth .button:hover {
  transform: none;
  background: #17332e;
}

.access-gate .auth-body p {
  max-width: 520px;
  margin: 0 auto 16px;
  color: #5f6c66;
  line-height: 1.55;
}

.access-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .72);
  text-align: left;
}

.access-meta span {
  color: #6a746f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.access-meta strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.access-gate .hero-actions {
  margin-top: 0;
}

.access-gate .hero-actions .button,
.access-gate .hero-actions .ghost-button {
  flex: 1 1 130px;
}

/* Private portal shell v2: clearer navigation, richer status hierarchy, full module registry. */
.portal-sidebar {
  gap: 14px;
}

.portal-brand {
  border-bottom: 0;
  padding-bottom: 0;
}

.portal-shell-status {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  padding: 11px;
  background:
    linear-gradient(135deg, rgba(255, 217, 120, .14), rgba(108, 184, 167, .10)),
    rgba(255, 255, 255, .055);
}

.portal-shell-status span,
.portal-nav-label {
  color: rgba(248, 251, 246, .58);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.portal-shell-status strong {
  color: #fff7df;
  font-size: 14px;
  line-height: 1.05;
}

.portal-shell-status em {
  color: rgba(248, 251, 246, .68);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.portal-nav-label {
  margin: 2px 2px -4px;
}

.portal-nav {
  gap: 7px;
}

.portal-nav button {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 52px;
  padding: 9px 10px;
  border-color: rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .052);
}

.portal-nav button.is-on {
  background:
    linear-gradient(135deg, rgba(255, 217, 120, .18), rgba(255, 255, 255, .11)),
    rgba(255, 255, 255, .12);
}

.nav-icon {
  width: 34px;
  height: 34px;
  background:
    linear-gradient(135deg, rgba(255, 226, 142, .24), rgba(110, 184, 167, .13)),
    rgba(255, 255, 255, .10);
  color: #ffe8ac;
}

.nav-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.nav-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy em {
  overflow: hidden;
  color: rgba(248, 251, 246, .60);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-sidebar-foot {
  gap: 5px;
  border-top-color: rgba(255, 255, 255, .11);
}

.portal-sidebar-foot span:first-child {
  color: rgba(248, 251, 246, .54);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-context-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 16px;
}

.portal-context-strip div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(22, 116, 102, .10);
  border-radius: 8px;
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(239, 248, 243, .68)),
    rgba(255, 255, 255, .70);
  box-shadow: 0 10px 28px rgba(35, 48, 43, .055);
}

.portal-context-strip span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.portal-context-strip strong {
  overflow: hidden;
  color: #193f36;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-grid {
  align-items: stretch;
}

.lead-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, .38);
  background:
    radial-gradient(circle at 92% 86%, rgba(255, 194, 116, .42), transparent 0 16%, transparent 34%),
    radial-gradient(circle at 74% 12%, rgba(141, 211, 198, .22), transparent 0 17%, transparent 40%),
    linear-gradient(135deg, rgba(18, 63, 58, .98), rgba(31, 105, 119, .96) 54%, rgba(154, 96, 53, .95)),
    #164b45;
}

.lead-panel::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -74px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  pointer-events: none;
}

.lead-panel > * {
  position: relative;
  z-index: 1;
}

.portal-pulse-card {
  border-color: rgba(49, 109, 152, .15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 253, 247, .72)),
    var(--surface);
}

.next-move-strip {
  margin-bottom: 14px;
}

.next-move-card strong {
  font-size: 16px;
}

.module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-card {
  min-height: 184px;
}

.module-card.tone-ready {
  background:
    linear-gradient(180deg, rgba(238, 249, 244, .88), rgba(255, 253, 247, .74)),
    var(--surface);
}

.module-card.tone-gold {
  background:
    linear-gradient(180deg, rgba(255, 246, 224, .90), rgba(255, 253, 247, .76)),
    var(--surface);
}

.module-card.tone-muted {
  background:
    linear-gradient(180deg, rgba(246, 249, 247, .90), rgba(255, 253, 247, .76)),
    var(--surface);
  opacity: .92;
}

@media (max-width: 1180px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .portal-sidebar {
    height: auto;
    gap: 12px;
  }

  .portal-shell-status,
  .portal-nav-label {
    display: none;
  }

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

  .portal-nav button {
    grid-template-columns: 1fr;
    min-height: 58px;
    justify-items: center;
  }

  .nav-copy {
    justify-items: center;
    text-align: center;
  }

  .nav-copy em {
    display: none;
  }

  .portal-context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-context-strip {
    grid-template-columns: 1fr;
  }

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

  .portal-nav button {
    min-height: 52px;
  }

  .nav-copy strong {
    font-size: 12px;
  }
}

/* Private portal shell v4: first-screen command deck, lighter rail, faster path to work. */
@media (min-width: 1001px) {
  .portal-frame {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .portal-sidebar {
    gap: 11px;
    padding: 14px;
    background:
      radial-gradient(circle at 16% 4%, rgba(255, 227, 148, .20), transparent 26%),
      linear-gradient(180deg, rgba(15, 78, 70, .97), rgba(18, 46, 42, .98)),
      #143934;
  }

  .portal-brand {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .portal-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 11px;
  }

  .portal-brand strong {
    font-size: 13px;
    line-height: 1.05;
  }

  .portal-brand span {
    font-size: 10.5px;
  }

  .portal-shell-status {
    gap: 3px;
    padding: 9px;
  }

  .portal-shell-status strong {
    font-size: 12px;
  }

  .portal-shell-status em {
    font-size: 10px;
  }

  .portal-nav {
    gap: 5px;
  }

  .portal-nav button {
    grid-template-columns: 29px minmax(0, 1fr);
    min-height: 43px;
    gap: 8px;
    padding: 7px 8px;
  }

  .nav-icon {
    width: 29px;
    height: 29px;
    border-radius: 7px;
    font-size: 11px;
  }

  .nav-copy strong {
    font-size: 11.5px;
  }

  .nav-copy em {
    font-size: 9.5px;
  }

  .portal-sidebar-foot {
    gap: 4px;
    padding-top: 10px;
    font-size: 10.5px;
  }
}

.portal-main {
  padding-top: 18px;
}

.preview-banner {
  margin-bottom: 10px;
  padding: 7px 9px;
}

.portal-topbar {
  margin-bottom: 10px;
}

.portal-topbar h1 {
  font-size: clamp(28px, 3.25vw, 40px);
}

.portal-topbar p {
  margin-top: 5px;
  font-size: 13px;
}

.user-pill {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 11px;
}

.portal-context-strip {
  gap: 8px;
  margin: 0 0 12px;
}

.portal-context-strip div {
  min-height: 49px;
  padding: 7px 9px;
}

.portal-context-strip span {
  font-size: 8.8px;
}

.portal-context-strip strong {
  font-size: 11.5px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.lead-panel {
  min-height: 250px;
  padding: clamp(18px, 2.25vw, 26px);
}

.lead-panel h2 {
  max-width: 650px;
  font-size: clamp(32px, 4.25vw, 52px);
}

.lead-panel p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 12px;
  font-size: 14px;
}

.lead-metrics {
  gap: 6px;
  margin-top: 12px;
}

.lead-metrics span {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
}

.hero-actions {
  gap: 7px;
  margin-top: 12px;
}

.button,
.ghost-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 11px;
}

.portal-pulse-card {
  gap: 9px;
  padding: 14px;
}

.portal-pulse-card h2 {
  font-size: clamp(20px, 2.4vw, 26px);
}

.pulse-stack {
  gap: 6px;
}

.pulse-item {
  padding: 8px;
}

.next-move-strip {
  gap: 10px;
  margin-bottom: 12px;
}

.next-move-card {
  min-height: 88px;
  gap: 4px;
  padding: 11px;
}

.next-move-card span {
  font-size: 9.5px;
}

.next-move-card strong {
  font-size: 14px;
}

.next-move-card em {
  font-size: 11px;
}

.portal-scoreboard {
  margin-bottom: 12px;
}

.metric-grid {
  gap: 10px;
}

.metric-card {
  gap: 3px;
  min-height: 74px;
  padding: 11px;
}

.metric-card strong {
  font-size: 24px;
}

.dashboard-split {
  gap: 12px;
}

.data-panel {
  padding: 12px;
}

.data-row {
  padding: 9px;
}

.module-card {
  min-height: 158px;
  gap: 9px;
  padding: 14px;
}

@media (max-width: 760px) {
  .portal-main {
    padding: 12px;
  }

  .drawer-grid {
    grid-template-columns: 1fr;
  }

  .role-detail-grid {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    gap: 8px;
  }

  .portal-brand span {
    display: none;
  }

  .portal-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .portal-nav button {
    min-height: 46px;
    padding: 5px 3px;
  }

  .nav-icon {
    width: 21px;
    height: 21px;
    font-size: 9px;
  }

  .nav-copy strong {
    font-size: 9.5px;
    white-space: normal;
  }

  .portal-topbar h1 {
    font-size: 28px;
  }

  .portal-context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lead-panel {
    width: 100%;
    padding: 16px;
  }

  .lead-panel h2 {
    font-size: clamp(27px, 8vw, 34px);
  }

  .portal-pulse-card {
    padding: 12px;
  }

  .portal-pulse-card h2 {
    font-size: 20px;
  }

  .portal-pulse-card p:not(.eyebrow) {
    font-size: 12px;
  }

  .pulse-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .pulse-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 7px;
  }

  .pulse-item span {
    font-size: 8px;
  }

  .pulse-item strong {
    justify-self: start;
    padding: 3px 6px;
    font-size: 9px;
  }

  .next-move-strip {
    gap: 8px;
  }

  .next-move-card {
    min-height: 0;
  }
}

@media (max-width: 460px) {
  .portal-context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-scoreboard,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Production portal v5: compact drill-in shell for app.bamboo.holdings. */
.portal-sidebar {
  overflow: auto;
  scrollbar-width: thin;
}

.portal-nav {
  gap: 5px;
}

.portal-nav button {
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
}

.nav-icon {
  width: 25px;
  height: 25px;
  font-size: 10px;
}

.nav-copy strong {
  font-size: 11.5px;
  line-height: 1.05;
}

.nav-copy em {
  display: block;
  margin-top: 2px;
  color: rgba(248, 251, 246, .56);
  font-size: 9.5px;
  font-style: normal;
  line-height: 1.05;
}

.drilldown-stack {
  display: grid;
  gap: 14px;
}

.compact-banner {
  align-items: flex-start;
}

.compact-banner h2 {
  max-width: 960px;
  font-size: clamp(22px, 3vw, 34px);
}

.warning-list {
  display: grid;
  gap: 8px;
}

.warning-list div {
  border: 1px solid rgba(196, 95, 85, .22);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff2ee;
  color: #8d3d37;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 1000px) {
  .portal-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .portal-nav button {
    grid-template-columns: 1fr;
    min-height: 50px;
    justify-items: center;
    padding: 6px 4px;
    text-align: center;
  }

  .nav-copy em {
    display: none;
  }
}

@media (max-width: 760px) {
  .portal-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .portal-nav button {
    min-height: 45px;
  }

  .nav-copy strong {
    font-size: 9.5px;
  }
}

/* Production portal v7: phone screens keep modules readable instead of cramming cards. */
@media (max-width: 560px) {
  .module-grid,
  .overview-grid,
  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-width: 0;
  }

  .module-head {
    align-items: flex-start;
  }

  .module-card h3,
  .module-card p {
    overflow-wrap: anywhere;
  }

  .module-action-row {
    align-items: stretch;
  }

  .module-action-row .ghost-button,
  .module-action-row .button {
    width: 100%;
  }
}

/* Production portal v8: logged-in landing treats each tool as an app container. */
.portal-app-container {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, .10);
}

.portal-app-container.is-active {
  border-color: rgba(248, 207, 116, .55);
  background: rgba(255, 255, 255, .08);
}

.portal-app-entry {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  padding: 7px 8px;
  color: rgba(248, 251, 246, .94);
  background: rgba(255, 255, 255, .08);
  text-align: left;
}

.portal-app-entry.is-on {
  background: rgba(255, 255, 255, .15);
  box-shadow: inset 3px 0 0 #f8cf74;
}

.portal-app-entry .nav-copy strong {
  white-space: normal;
}

.app-section-nav {
  gap: 4px;
}

.app-section-nav button {
  min-height: 30px;
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .035);
}

.app-section-nav .nav-icon {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.app-section-nav .nav-copy strong {
  font-size: 10.5px;
}

.app-container-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.app-container-kicker {
  margin: 0;
  color: #6f7c74;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-section-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-section-list span {
  border: 1px solid rgba(31, 118, 104, .12);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, .62);
  color: #4f5f57;
  font-size: 10.5px;
  font-weight: 850;
}

@media (max-width: 1000px) {
  .portal-app-entry {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .app-section-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .portal-app-container {
    padding: 7px;
  }

  .app-section-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Functional UX pass v10: workflow-first surfaces over module-first admin pages. */
.workflow-stack {
  display: grid;
  gap: 14px;
}

.workflow-lead {
  min-height: 0;
}

.workflow-lead h2 {
  max-width: 760px;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.02;
}

.workflow-lead p:not(.eyebrow) {
  max-width: 760px;
  font-size: 14px;
}

.today-grid,
.opportunity-layout,
.document-context-grid,
.intelligence-grid,
.settings-admin-grid,
.applications-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 14px;
  align-items: start;
}

.today-grid .wide,
.opportunity-layout .collapsed-search-setup,
.settings-admin-grid .wide {
  grid-column: 1 / -1;
}

.attention-list {
  display: grid;
  gap: 8px;
}

.attention-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  border: 1px solid rgba(30, 49, 43, .10);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .68);
  color: var(--ink);
  text-align: left;
}

.attention-row.needs-action {
  border-color: rgba(216, 155, 61, .26);
  background: linear-gradient(135deg, rgba(255, 244, 219, .92), rgba(255, 255, 255, .70));
}

.attention-row span {
  font-size: 13px;
  font-weight: 900;
}

.attention-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.status-mini-grid,
.queue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.queue-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-mini {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(30, 49, 43, .10);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, .62);
}

.metric-mini span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-mini strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.role-queue {
  display: grid;
  gap: 8px;
}

.role-queue-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: start;
  border: 1px solid rgba(30, 49, 43, .10);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .68);
  color: var(--ink);
  text-align: left;
}

.role-queue-button.is-selected {
  border-color: rgba(22, 116, 102, .34);
  background: linear-gradient(135deg, rgba(229, 246, 239, .96), rgba(255, 255, 255, .72));
  box-shadow: inset 3px 0 0 var(--teal);
}

.role-queue-button span,
.role-queue-button strong,
.role-queue-button em,
.role-queue-button small,
.role-queue-button b,
.role-queue-button i {
  min-width: 0;
}

.role-queue-button span {
  display: grid;
  gap: 2px;
}

.role-queue-button strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-queue-button em,
.role-queue-button small,
.role-queue-button i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.role-queue-button b {
  grid-column: 2;
  grid-row: 1;
  border-radius: 999px;
  padding: 4px 7px;
  background: #e5f6ef;
  color: var(--teal);
  font-size: 11px;
}

.role-queue-button i {
  grid-column: 1 / -1;
}

.role-detail-panel {
  gap: 14px;
}

.role-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid rgba(30, 49, 43, .10);
  padding-bottom: 12px;
}

.role-detail-header h2,
.role-detail-header h3 {
  margin: 0;
}

.role-detail-header h2 {
  font-size: 24px;
  line-height: 1.05;
}

.role-detail-header h3 {
  margin-top: 4px;
  color: #2c453e;
  font-size: 16px;
}

.role-detail-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.role-score-stack {
  display: grid;
  gap: 4px;
  min-width: 98px;
  border: 1px solid rgba(22, 116, 102, .14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(238, 249, 244, .82);
  text-align: center;
}

.role-score-stack span,
.role-score-stack em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.role-score-stack strong {
  color: #123f3a;
  font-size: 28px;
  line-height: 1;
}

.role-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.primary-source-link {
  max-width: none;
}

.role-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.raw-posting-drawer {
  border-top: 1px solid rgba(30, 49, 43, .10);
  padding-top: 10px;
}

.collapsed-search-setup {
  display: block;
}

.collapsed-search-setup > summary {
  cursor: pointer;
  border: 1px solid rgba(22, 116, 102, .16);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, .72);
  color: #173f37;
  font-size: 13px;
  font-weight: 950;
  list-style: none;
}

.collapsed-search-setup > summary::-webkit-details-marker {
  display: none;
}

.collapsed-search-setup > p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.collapsed-search-setup .search-control-panel {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.document-context-grid,
.intelligence-grid,
.settings-admin-grid,
.applications-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.application-card-row span,
.detail-block p,
.empty-panel span {
  white-space: normal;
}

.compact-status {
  padding: 8px 0;
}

.settings-admin-grid .status-mini-grid {
  margin-bottom: 10px;
}

.portal-app-entry .nav-icon {
  color: transparent;
  font-size: 0;
}

.portal-app-entry .nav-icon::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffe28e;
  box-shadow: 0 0 0 5px rgba(255, 226, 142, .16);
}

.app-section-nav .nav-icon {
  color: rgba(255, 232, 172, .72);
}

@media (max-width: 1000px) {
  .today-grid,
  .opportunity-layout,
  .document-context-grid,
  .intelligence-grid,
  .settings-admin-grid,
  .applications-grid {
    grid-template-columns: 1fr;
  }

  .today-grid .wide,
  .opportunity-layout .collapsed-search-setup,
  .settings-admin-grid .wide {
    grid-column: auto;
  }

  .portal-app-container {
    gap: 6px;
  }

  .app-section-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workflow-stack {
    gap: 10px;
  }

  .app-section-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-nav button {
    min-height: 46px;
  }

  .nav-copy strong {
    font-size: 10.5px;
  }

  .role-detail-header,
  .role-section-grid,
  .status-mini-grid,
  .queue-metrics {
    grid-template-columns: 1fr;
  }

  .role-score-stack {
    grid-template-columns: auto auto auto;
    align-items: center;
    justify-content: start;
    text-align: left;
  }

  .role-score-stack strong {
    font-size: 22px;
  }

  .data-panel {
    padding: 11px;
  }

  .attention-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 430px) {
  .portal-context-strip {
    grid-template-columns: 1fr;
  }

  .app-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-app-entry {
    min-height: 34px;
  }

  .portal-topbar h1 {
    font-size: 25px;
  }

  .portal-topbar p {
    font-size: 12px;
  }

  .workflow-lead h2 {
    font-size: 26px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }
}

/* UX V2 Role-First Command Center: five-destination shell, content-first mobile. */
body {
  overflow-x: hidden;
}

.portal-frame {
  grid-template-columns: 218px minmax(0, 1fr);
  grid-template-areas: "sidebar main";
}

.portal-sidebar {
  grid-area: sidebar;
}

.portal-main {
  grid-area: main;
  min-width: 0;
}

.nav-label-short {
  display: none;
}

.portal-app-container {
  gap: 6px;
}

.app-section-nav {
  grid-template-columns: 1fr;
}

.app-section-nav button {
  min-height: 36px;
}

.portal-topbar h1 {
  font-size: clamp(28px, 3vw, 38px);
}

.portal-topbar p {
  max-width: 760px;
}

.workflow-lead {
  padding: clamp(16px, 2.1vw, 24px);
  background:
    linear-gradient(135deg, #164840 0%, #246f7f 58%, #8b6846 100%);
}

.workflow-lead h2 {
  max-width: 820px;
  font-size: clamp(26px, 3vw, 38px);
}

.workflow-lead p:not(.eyebrow) {
  margin-top: 10px;
}

.quiet-banner h2,
.compact-banner h2 {
  font-size: clamp(20px, 2.4vw, 30px);
}

.quiet-banner p,
.compact-banner p {
  max-width: 860px;
}

.more-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.more-item-grid {
  display: grid;
  gap: 8px;
}

.more-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid rgba(30, 49, 43, .10);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .66);
}

.more-item span {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.more-item strong {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 7px;
  background: #e5f6ef;
  color: var(--teal);
  font-size: 10.5px;
  white-space: nowrap;
}

.more-item em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.role-detail-panel {
  min-width: 0;
}

.mobile-back-button {
  display: none;
}

.role-section-grid .detail-block {
  min-height: 112px;
}

.data-row strong,
.data-row span {
  white-space: normal;
}

.role-queue-button strong {
  white-space: normal;
}

@media (min-width: 1180px) {
  .opportunity-layout {
    grid-template-columns: minmax(280px, .42fr) minmax(0, 1fr);
  }

  .role-detail-panel {
    min-height: 520px;
  }
}

@media (max-width: 1000px) {
  .portal-frame {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .portal-main {
    padding-bottom: 86px;
  }

  .portal-sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    overflow: visible;
    border-top: 1px solid rgba(18, 46, 42, .22);
    background:
      linear-gradient(180deg, rgba(255, 253, 247, .90), rgba(241, 249, 245, .96)),
      #f8fbf7;
    box-shadow: 0 -12px 34px rgba(24, 35, 31, .14);
  }

  .portal-brand,
  .portal-shell-status,
  .portal-app-entry,
  .portal-sidebar-foot {
    display: none;
  }

  .portal-app-container {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }

  .app-section-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .app-section-nav button,
  .portal-nav button {
    min-height: 52px;
    border-color: rgba(30, 49, 43, .10);
    border-radius: 8px;
    padding: 6px 4px;
    color: #28433c;
    background: rgba(255, 255, 255, .72);
    box-shadow: none;
  }

  .app-section-nav button.is-on,
  .portal-nav button.is-on {
    color: #123f3a;
    background: #e7f6f0;
    box-shadow: inset 0 3px 0 var(--teal);
  }

  .app-section-nav .nav-icon,
  .nav-icon {
    width: 23px;
    height: 23px;
    margin: 0 auto;
    color: #167466;
    background: rgba(22, 116, 102, .10);
    font-size: 10px;
  }

  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .nav-copy strong {
    color: inherit;
    font-size: 10.5px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .portal-topbar {
    margin-bottom: 10px;
  }

  .portal-topbar .user-pill {
    display: none;
  }

  .more-hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-main {
    padding: 12px 12px 86px;
  }

  .portal-topbar h1 {
    font-size: 25px;
  }

  .workflow-lead {
    padding: 14px;
  }

  .workflow-lead h2 {
    font-size: 24px;
  }

  .workflow-lead p:not(.eyebrow) {
    font-size: 13px;
  }

  .private-data-banner {
    padding: 12px;
  }

  .private-data-banner h2 {
    font-size: 21px;
  }

  .role-detail-header {
    gap: 9px;
  }

  .role-detail-header h2 {
    font-size: 21px;
  }

  .role-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-back-button {
    display: inline-flex;
  }

  .role-detail-selected .compact-banner,
  .role-detail-selected .role-queue-panel,
  .role-detail-selected .collapsed-search-setup,
  .role-detail-selected .opportunity-layout > .data-panel:not(.role-detail-panel) {
    display: none;
  }

  .role-detail-selected .opportunity-layout {
    display: block;
  }

  .role-detail-selected .role-detail-panel {
    min-height: calc(100vh - 120px);
  }

  .role-action-row .tiny-action,
  .role-action-row .tiny-link,
  .role-action-row .badge {
    width: 100%;
    max-width: none;
  }

  .row-actions {
    align-items: stretch;
  }

  .row-actions .tiny-action,
  .row-actions .tiny-link,
  .row-actions .button,
  .row-actions .ghost-button {
    flex: 1 1 auto;
  }
}
