/* Agent portal — brand palette only: white, charcoal #2E2E2E, orange #FF8B0B. No navy. */

.nav-portal {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  margin-left: 4px;
}
.nav-portal:hover,
.nav-portal[aria-current="page"] {
  color: var(--ink);
  border-color: var(--orange);
  text-decoration: none;
}

/* ---- Landing ---- */
.portal-hero {
  position: relative;
  background: #2E2E2E;
  color: #fff;
  overflow: hidden;
  padding: 88px 0 96px;
}
.portal-hero .wrap { position: relative; z-index: 1; }
.portal-hero .kicker { color: var(--orange); }
.portal-hero h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
  margin: 0.15em 0 0.35em;
  max-width: 16em;
  text-wrap: balance;
}
.portal-hero .lede {
  color: rgba(255,255,255,0.9);
  font-size: 1.12rem;
  max-width: 38em;
  margin: 0 0 28px;
  line-height: 1.55;
}
.portal-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.portal-hero .btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.45);
  text-decoration: none;
}
.portal-hero .btn-ghost:hover { border-color: #fff; color: #fff; }

.pgenie-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: -48px;
  position: relative;
  z-index: 2;
}
.pgenie-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px 26px;
  box-shadow: 0 18px 40px rgba(46,46,46,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  border-top: 3px solid var(--orange);
}
.pgenie-card.accent-ink { border-top-color: #2E2E2E; }
.pgenie-card.accent-soft { border-top-color: #C46A08; }
.pgenie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 48px rgba(46,46,46,0.12);
  text-decoration: none;
  color: var(--ink);
}
.pgenie-figure {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  margin: 0 0 8px;
  position: relative;
}
.pgenie-figure img {
  width: auto;
  height: 170px;
  object-fit: contain;
  display: block;
  background: transparent;
}
.pgenie-prop {
  width: 56px;
  height: 56px;
  color: var(--orange);
  flex-shrink: 0;
  align-self: center;
}
.pgenie-prop svg { width: 56px; height: 56px; display: block; }
.pgenie-card h2 {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.pgenie-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; }
.pgenie-card .more { margin-top: 10px; font-weight: 650; color: var(--orange); font-size: 0.9rem; }

.portal-note {
  background: #FFF8F0;
  border: 1px solid #F0E0CC;
  border-radius: 14px;
  padding: 18px 22px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.portal-note strong { color: var(--ink); }

@media (max-width: 900px) {
  .pgenie-grid { grid-template-columns: 1fr; margin-top: 32px; }
  .portal-hero { padding: 56px 0 48px; }
  .pgenie-figure img { height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .pgenie-card { transition: none; }
  .pgenie-card:hover { transform: none; }
}

/* ---- Login ---- */
.portal-login {
  min-height: calc(100dvh - var(--header, 100px) - 220px);
  display: flex;
  align-items: center;
  padding: 48px 0 80px;
  background: #F7F5F2;
}
.login-card {
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px 32px;
  box-shadow: 0 16px 40px rgba(46,46,46,0.08);
}
.login-card h1 {
  font-family: "Fraunces", serif;
  font-size: 1.85rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.login-card .form-lede { color: var(--muted); margin: 0 0 22px; }
.login-card label {
  display: block;
  font-weight: 650;
  font-size: 0.85rem;
  margin: 0 0 6px;
}
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E8E4DE;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  margin-bottom: 16px;
  background: #fff;
  color: var(--ink);
}
.login-card input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,139,11,0.2);
}
.login-card .btn { width: 100%; justify-content: center; }
.login-error {
  background: #FDECEC;
  color: #6B1C1C;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  margin: 0 0 14px;
  display: none;
}
.login-error.is-on { display: block; }
.demo-flag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  background: #FFF1E0;
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 10px;
}

/* ---- App chrome ---- */
.papp {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #F7F5F2;
}
.papp-top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.papp-top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.papp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.papp-brand img { height: 40px; width: auto; display: block; }
.papp-brand span {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.papp-user { display: flex; align-items: center; gap: 14px; font-size: 0.92rem; }
.papp-user strong { font-weight: 650; }
.papp-user button, .papp-user .btn-text {
  background: none;
  border: 0;
  font: inherit;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.papp-user button:hover, .papp-user .btn-text:hover { color: var(--orange); }

.demo-banner {
  background: #2E2E2E;
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  padding: 8px 16px;
}
.demo-banner strong { color: var(--orange); }

.papp-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
}
.papp-side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.papp-side a,
.papp-side button.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.papp-side a:hover,
.papp-side button.navitem:hover { background: #FFF8F0; text-decoration: none; color: var(--ink); }
.papp-side a.is-on,
.papp-side button.navitem.is-on {
  background: #FFF1E0;
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--orange);
}
.navitem .ni-ico {
  width: 28px;
  height: 28px;
  color: var(--orange);
  flex-shrink: 0;
}
.navitem .ni-ico svg { width: 28px; height: 28px; display: block; }
.papp-main {
  padding: 28px 32px 48px;
  min-width: 0;
}
.papp-main h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.papp-main .lede { margin: 0 0 22px; color: var(--muted); }

/* Files table */
.files-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(46,46,46,0.04);
}
.files-table th,
.files-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.files-table th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  background: #FAFAF8;
}
.files-table tr:last-child td { border-bottom: 0; }
.files-table tbody tr { cursor: pointer; }
.files-table tbody tr:hover td { background: #FFF8F0; }
.files-table .file-id { font-weight: 650; color: var(--ink); }
.status-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: #EEE;
  color: var(--ink);
}
.status-chip.conditions,
.status-chip.in-review { background: #FFF1E0; color: #8A4E00; }
.status-chip.approved, .status-chip.funded { background: #EEF6EE; color: #1E4D1E; }
.status-chip.submitted { background: #F0F0F0; }

.file-detail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 8px 24px rgba(46,46,46,0.04);
}
.file-detail .back {
  background: none;
  border: 0;
  font: inherit;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
}
.file-detail .back:hover { color: var(--orange); }
.file-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.file-meta div {
  background: #F7F5F2;
  border-radius: 12px;
  padding: 12px 14px;
}
.file-meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.file-meta dd { margin: 4px 0 0; font-weight: 650; }
.cond-list, .time-list { list-style: none; margin: 0; padding: 0; }
.cond-list li, .time-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.file-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Chat workspaces */
.chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  height: calc(100dvh - 220px);
  min-height: 480px;
}
.chat-shell.has-ctx {
  grid-template-columns: minmax(0, 1fr) 280px;
}
.chat-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-head img {
  height: 56px;
  width: auto;
  display: block;
  background: transparent;
}
.chat-head h2 { font-family: "Fraunces", serif; font-size: 1.2rem; margin: 0; }
.chat-head p { margin: 0; font-size: 0.82rem; color: var(--muted); }
.chat-msgs {
  flex: 1;
  overflow: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FAFAF8;
}
.msg {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.msg.user {
  align-self: flex-end;
  background: #2E2E2E;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}
.msg .demo-tag {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 140px;
  border: 1.5px solid #E8E4DE;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.95rem;
}
.chat-form textarea:focus { outline: none; border-color: var(--orange); }
.builder-steps {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  flex-wrap: wrap;
}
.builder-steps span {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: #EEE;
  color: var(--muted);
}
.builder-steps span.is-on { background: #FFF1E0; color: #8A4E00; }
.builder-steps span.is-done { background: #EEF6EE; color: #1E4D1E; }
.ctx-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  overflow: auto;
}
.ctx-panel h3 { font-size: 0.85rem; margin: 0 0 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ctx-panel select, .file-pick {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #E8E4DE;
  border-radius: 10px;
  font: inherit;
  margin-bottom: 12px;
  background: #fff;
}
.view { display: none; }
.view.is-on { display: block; }

.papp-foot {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 24px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .papp-body { grid-template-columns: 1fr; }
  .papp-side {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
    gap: 4px;
  }
  .papp-side a, .papp-side button.navitem {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
  .papp-main { padding: 20px 16px 36px; }
  .files-table { display: block; overflow-x: auto; }
  .file-meta { grid-template-columns: 1fr; }
  .chat-shell, .chat-shell.has-ctx {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .chat-msgs { min-height: 280px; max-height: 50vh; }
  .papp-brand span { display: none; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .pgenie-card, .files-table tbody tr { transition: none; }
}

/* ---- Client portal ---- */

.nav-portals {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  flex-shrink: 0;
}
.nav-portals .nav-portal {
  margin-left: 0;
  font-size: 0.68rem;
  padding: 5px 9px;
  letter-spacing: 0.04em;
}

/* Keep the primary nav on one line at desktop widths (1280 and up). */
@media (min-width: 961px) {
  .nav { flex-wrap: nowrap; }
}

.cportal-hero {
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  padding: 88px 0 72px;
  overflow: hidden;
}
.cportal-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cportal-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cportal-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(46,46,46,0.35) 0%, rgba(46,46,46,0.72) 48%, rgba(46,46,46,0.88) 100%);
}
.cportal-hero .wrap { max-width: 760px; }
.cportal-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 12em;
}
.cportal-hero h1 .h-keep { white-space: nowrap; }
.cportal-hero .lede { max-width: 42ch; color: rgba(255,255,255,0.9); }
.cfeat-ico { width: 64px; height: 64px; display: block; }
.cportal-features { margin-top: 32px; }
.section-lede { max-width: 58ch; }

.cportal-login .cp-demo-code {
  margin-top: 22px;
  padding: 14px 16px;
  background: #FFF8F0;
  border: 1px solid #F3D7B0;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.cportal-login .cp-demo-code[hidden] { display: none !important; }
.cp-code-value { margin: 10px 0 0; }
.cp-code-value span {
  display: inline-block;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: #fff;
  border: 1.5px dashed var(--orange);
  border-radius: 10px;
  padding: 6px 14px;
  margin-left: 6px;
}
.cp-magic { margin: 10px 0 0; }
.cp-resend { margin-top: 12px; display: inline-block; }
#cp-code-form[hidden],
#cp-email-form[hidden] { display: none !important; }
#cp-code { letter-spacing: 0.28em; font-size: 1.2rem; font-weight: 650; text-align: center; }

.cportal-app .cportal-main {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 28px 56px;
}
.cp-dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.cp-dash-head .lede { margin-bottom: 0; }
.cp-dash-head h1 { margin-bottom: 6px; }

.cp-stages {
  list-style: none;
  margin: 0 0 36px;
  padding: 22px 10px 8px;
  display: flex;
  justify-content: space-between;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(46,46,46,0.04);
  position: relative;
  overflow: hidden;
}
.cp-stages li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
  min-width: 0;
}
.cp-stages li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: #E8E4DE;
  z-index: 0;
}
.cp-stages li.done:not(:last-child)::after,
.cp-stages li.current:not(:last-child)::after { background: var(--orange); }
.cp-stage-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #C8C2B8;
  background: #fff;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.cp-stages li.done .cp-stage-dot {
  background: var(--orange);
  border-color: var(--orange);
}
.cp-stages li.done .cp-stage-dot::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 7px;
  height: 11px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
.cp-stages li.current .cp-stage-dot {
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255,139,11,0.22);
  animation: cp-pulse 2.4s ease-in-out infinite;
}
.cp-stages li.current .cp-stage-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--orange);
}
.cp-stage-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.25;
  padding: 0 6px 10px;
  max-width: 11em;
}
.cp-stages li.current .cp-stage-label { color: var(--ink); }
.cp-stages li.done .cp-stage-label { color: var(--ink); }
@keyframes cp-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,139,11,0.18); }
  50% { box-shadow: 0 0 0 8px rgba(255,139,11,0.08); }
}
@media (prefers-reduced-motion: reduce) {
  .cp-stages li.current .cp-stage-dot { animation: none; }
}

.cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
.cp-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: 0 8px 24px rgba(46,46,46,0.04);
}
.cp-card h2 {
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.cp-card-lede, .cp-status-lead {
  margin: 0 0 8px;
  font-weight: 650;
  color: var(--ink);
}
.cp-status-lead { font-size: 1.05rem; color: var(--orange); }
.cp-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 16px 0 0;
}
.cp-meta div { margin: 0; }
.cp-meta dt {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.cp-meta dd { margin: 2px 0 0; font-weight: 550; }
.cp-agent-name { font-size: 1.15rem; font-weight: 650; margin: 0 0 2px; }
.cp-agent-title { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }
.cp-agent-contact { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.cp-agent-contact a { font-weight: 650; }

.cp-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cp-docs li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.cp-docs li:last-child { border-bottom: 0; }
.cp-docs li strong { display: block; font-weight: 650; }
.cp-docs li small { color: var(--muted); font-size: 0.8rem; }
.cp-doc-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid #C8C2B8;
  position: relative;
}
.cp-docs li.received .cp-doc-mark {
  background: var(--orange);
  border-color: var(--orange);
}
.cp-docs li.received .cp-doc-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
.cp-docs li.outstanding .cp-doc-mark {
  border-color: var(--orange);
  background: #FFF8F0;
}

.cp-dates { list-style: none; margin: 0; padding: 0; }
.cp-dates li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.cp-dates li:last-child { border-bottom: 0; }
.cp-dates li span { color: var(--muted); white-space: nowrap; font-weight: 550; }

.cp-genie { margin-top: 8px; }
.cp-genie .chat-shell {
  height: auto;
  min-height: 0;
}
.cp-genie .chat-msgs {
  min-height: 220px;
  max-height: 360px;
  flex: none;
}

.cp-app-switch { margin-bottom: 18px; }
.cp-switch-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-switch-btn {
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.cp-switch-btn:hover { border-color: var(--orange); }
.cp-switch-btn.is-on { background: #FFF1E0; border-color: var(--orange); }

@media (max-width: 860px) {
  .cportal-hero { min-height: 0; padding: 72px 0 56px; align-items: flex-end; }
  .cportal-hero h1 { max-width: none; }
  .cp-grid, .cp-meta { grid-template-columns: 1fr; }
  .cportal-app .cportal-main { padding: 22px 16px 40px; }
  .cp-stages {
    flex-direction: column;
    padding: 16px 16px 16px 12px;
    gap: 0;
  }
  .cp-stages li {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 8px 0;
  }
  .cp-stages li:not(:last-child)::after {
    top: 32px;
    left: 12px;
    right: auto;
    width: 2px;
    height: calc(100% - 10px);
    background: #E8E4DE;
  }
  .cp-stages li.done:not(:last-child)::after,
  .cp-stages li.current:not(:last-child)::after { background: var(--orange); }
  .cp-stage-dot { margin: 0 12px 0 0; flex-shrink: 0; }
  .cp-stage-label { padding: 0; max-width: none; font-size: 0.88rem; }
  .cp-dash-head { flex-direction: column; }
  .cp-dates li { flex-direction: column; gap: 2px; }
  .cp-dates li span { white-space: normal; }
}

@media (max-width: 960px) {
  .nav-portals {
    margin: 8px 0 0;
    display: flex;
  }
}

/* ===== t103: Application Builder workspace, merged Genie, PDF Resources ===== */
.ab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.ab-head .lede { max-width: 640px; }
.ab-deal { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.ab-deal label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; }
.ab-deal .file-pick { min-width: 260px; width: auto; margin: 0; }
.ab-integrations { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ab-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); cursor: default; }
.ab-chip b { color: var(--ink); font-weight: 650; }
.ab-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #BDBDBD; }
.ab-chip.is-ok::before { background: var(--orange); }
.ab-chip.is-dry::before { background: #FFD3A3; border: 1px solid var(--orange); }
.ab-chip.is-off::before { background: #BDBDBD; }
.ab-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.ab-tab { background: none; border: 0; padding: 11px 14px; font: inherit; font-weight: 600; font-size: 0.93rem; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ab-tab:hover { color: var(--ink); }
.ab-tab.is-on { color: var(--ink); border-bottom-color: var(--orange); }
.ab-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #FFF1E0; color: var(--ink); font-size: 0.75rem; margin-left: 4px; }
.ab-panel { display: none; }
.ab-panel.is-on { display: block; }
.ab-note { font-size: 0.9rem; color: var(--muted); margin: 8px 0 14px; line-height: 1.5; }
.ab-note strong { color: var(--ink); }
.ab-empty { color: var(--muted); padding: 18px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; list-style: none; }
.ab-upload { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.ab-drop { position: relative; border: 2px dashed #E0D6CA; border-radius: 12px; background: #FFFBF6; text-align: center; transition: border-color .15s, background .15s; }
.ab-drop.is-drag, .ab-drop.has-files { border-color: var(--orange); background: #FFF1E0; }
.ab-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ab-drop label { display: block; padding: 26px 14px; color: var(--ink); cursor: pointer; }
.ab-drop small { color: var(--muted); }
.ab-upload-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.ab-upload-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 650; color: var(--muted); flex: 1 1 200px; }
.ab-upload-row select, .ab-upload-row input[type=file], .ab-doc-tools input, .ab-doc-tools select, .res-tools input, .res-tools select, .ab-add-item input {
  font: inherit; font-size: 0.93rem; padding: 9px 11px; border: 1.5px solid #E8E4DE; border-radius: 10px; background: #fff; color: var(--ink); }
.ab-upload-row select:focus, .ab-doc-tools input:focus, .res-tools input:focus, .ab-add-item input:focus, .ab-f input:focus, .ab-f select:focus, .ab-f textarea:focus, .ab-request:focus, .ab-note-form textarea:focus { outline: none; border-color: var(--orange); }
.ab-doc-tools, .res-tools { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ab-doc-tools input, .res-tools input { flex: 1 1 260px; }
.ab-group { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.ab-group span { color: var(--orange); margin-left: 4px; }
.ab-doclist, .ab-checks, .ab-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ab-doc { display: grid; grid-template-columns: minmax(0, 1fr) 190px 240px auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ab-doc-main { min-width: 0; }
.ab-doc-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-doc small { color: var(--muted); }
.ab-doc select { font: inherit; font-size: 0.85rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.ab-badge { display: inline-block; font-size: 0.72rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; }
.ab-badge.is-ok { background: #FFF1E0; color: var(--ink); border: 1px solid var(--orange); }
.ab-badge.is-off { background: #F2F2F2; color: var(--ink-soft); }
.ab-x { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.82rem; cursor: pointer; text-decoration: underline; }
.ab-x:hover { color: var(--orange); }
.ab-log { margin-top: 18px; display: grid; gap: 8px; }
.ab-log-item { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; }
.ab-log-item details { margin-top: 6px; }
.ab-log-item summary { cursor: pointer; color: var(--ink); font-weight: 600; font-size: 0.85rem; }
.ab-log pre, .ab-velocity pre { white-space: pre-wrap; word-break: break-word; background: #F7F5F2; border-radius: 8px; padding: 10px; font-size: 0.78rem; max-height: 320px; overflow: auto; }
.ab-check-head { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.ab-progress { height: 8px; background: #F0ECE6; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.ab-progress span { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .3s; }
.ab-progress-txt { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.ab-check { display: grid; grid-template-columns: 14px minmax(0, 1fr) 170px; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ab-check small { display: block; color: var(--muted); font-size: 0.8rem; }
.ab-check select { font: inherit; font-size: 0.85rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ab-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #BDBDBD; }
.ab-check.st-received .ab-dot { background: var(--orange); border-color: var(--orange); }
.ab-check.st-waived .ab-dot, .ab-check.st-na .ab-dot { background: #2E2E2E; border-color: #2E2E2E; }
.ab-check.st-waived span, .ab-check.st-na span { color: var(--muted); text-decoration: line-through; }
.ab-add-item { display: flex; gap: 10px; margin-top: 14px; }
.ab-add-item input { flex: 1; }
.ab-note-form { display: grid; gap: 10px; margin-bottom: 16px; }
.ab-note-form textarea, .ab-request { font: inherit; font-size: 0.95rem; padding: 12px 14px; border: 1.5px solid #E8E4DE; border-radius: 12px; background: #fff; color: var(--ink); resize: vertical; width: 100%; box-sizing: border-box; }
.ab-note-form .btn { justify-self: start; }
.ab-notes li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ab-notes li small { color: var(--muted); }
.ab-notes li p { margin: 4px 0 0; white-space: pre-wrap; }
.ab-app { display: grid; gap: 16px; }
.ab-sec { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 18px; margin: 0; min-width: 0; }
.ab-sec legend { font-weight: 700; font-size: 1rem; padding: 0 6px; }
.ab-sec legend small { font-weight: 500; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.04em; margin-left: 6px; }
.ab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ab-f { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); min-width: 0; }
.ab-f.is-wide { grid-column: 1 / -1; }
.ab-f input, .ab-f select, .ab-f textarea { font: inherit; font-size: 0.93rem; font-weight: 400; padding: 8px 10px; border: 1.5px solid #E8E4DE; border-radius: 9px; background: #fff; color: var(--ink); width: 100%; box-sizing: border-box; }
.ab-row { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.ab-row:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.ab-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.9rem; }
.ab-add { margin-top: 12px; }
.ab-app-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.ab-saved { font-size: 0.82rem; color: var(--muted); }
.ab-vel-status { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.ab-vel-status p { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.93rem; }
.ab-map { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); font-size: 0.9rem; }
.ab-map th, .ab-map td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ab-map th { background: #F7F5F2; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.ab-map code { font-size: 0.8rem; color: var(--ink); }
/* merged genie */
.uw-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; }
.uw-suggest button { font: inherit; font-size: 0.8rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.uw-suggest button:hover { border-color: var(--orange); }
.msg-src { margin: 10px 0 0; padding: 8px 0 0 20px; border-top: 1px solid var(--line); font-size: 0.8rem; }
.msg-src a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); }
.ctx-panel h3 + select + h3, .ctx-panel h3 { margin-top: 14px; }
.ctx-panel h3:first-child { margin-top: 0; }
.ctx-small { font-size: 0.82rem; color: var(--muted); margin: 4px 0 0; }
.uw-coverage { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 0.85rem; }
.uw-coverage > li > ul { margin: 4px 0 0; padding-left: 16px; }
.uw-coverage a { color: var(--ink-soft); }
.cov { font-size: 0.7rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.cov-public { background: #FFF1E0; border: 1px solid var(--orange); }
.cov-partial { background: #F2F2F2; color: var(--ink-soft); }
/* resources */
.res-upload { margin-bottom: 10px; }
.res-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.res-cat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; border-top: 3px solid var(--orange); }
.res-cat header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.res-cat h2 { font-size: 1.02rem; margin: 0; }
.res-cat header span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.res-hint { font-size: 0.84rem; color: var(--muted); margin: 4px 0 10px; }
.res-empty { font-size: 0.85rem; color: var(--muted); margin: 0; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.res-cat ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.res-cat li a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.res-cat li a:hover { background: #FFF8F0; }
.res-cat li small { display: block; color: var(--muted); font-size: 0.78rem; }
.res-pdf { flex: none; font-size: 0.65rem; font-weight: 800; color: #fff; background: #2E2E2E; border-radius: 6px; padding: 6px 5px; }
@media (max-width: 900px) {
  .ab-doc { grid-template-columns: 1fr 1fr; }
  .ab-doc-main { grid-column: 1 / -1; }
  .ab-check { grid-template-columns: 14px minmax(0, 1fr); }
  .ab-check select { grid-column: 2; }
  .ab-deal .file-pick { min-width: 0; flex: 1; }
}
.ab-upload-row label { min-width: 0; }
.ab-upload-row select, .ab-deal .file-pick, .res-tools select, .ab-doc-tools select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.ab-upload-row select { width: 100%; }
.msg-src li { margin: 2px 0; }
.msg-src small { color: var(--muted); }

/* t112: uploads paused in demo mode */
.ab-note-warn { background: #FFF4E6; border: 1px solid #FF8B0B; border-radius: 10px; padding: 10px 12px; color: #2E2E2E; }
.ab-upload.is-blocked .ab-drop { opacity: .5; pointer-events: none; }
