/* Keep the question and next action close without constraining long content. */
:root {
  --se-page-header-height: 52px;
  --se-page-start-space: 20px;
  --se-navigation-height: 46px;
}
body[data-portal-view] {
  --se-workflow-height: calc(100dvh - var(--demo-session-bar-height, 48px) - var(--se-navigation-space, var(--se-navigation-height)));
}
body[data-portal-view] .app-shell,
body[data-portal-view] .entry-shell,
body[data-portal-view] .aip-shell,
body[data-portal-view] .fi-shell,
body[data-portal-view] .f-shell,
body[data-portal-view] .rp-app { min-height: var(--se-workflow-height); }
.se-page-navigation { padding-block: 5px; gap: 12px; }
body[data-portal-view] .entry-header,
body[data-portal-view] .aip-header,
body[data-portal-view] .fi-header,
body[data-portal-view] .f-header,
body[data-portal-view] .rp-header { padding-block: 8px; }
body[data-portal-view] .simple-entry .entry-heading { margin-bottom: 22px; }
body[data-portal-view] .simple-entry .entry-heading p { margin-top: 10px; }
@media (min-width: 761px) {
  body[data-portal-view] .sidebar {
    height: var(--se-workflow-height);
    max-height: var(--se-workflow-height);
  }
}

/* Short introductions use the same compact rhythm as the working screens. */
body[data-portal-view] .aip-header { max-width: 1280px; padding-inline: 28px; }
.aip-main { padding-top: 8px; padding-bottom: 22px; }
body[data-portal-view] .aip-progress { min-height: 28px; margin-bottom: 10px; }
.aip-progress li { font-size: 12px; }
.aip-intro { margin-bottom: 18px; }
.aip-intro h1 { font-size: clamp(28px, 3vw, 36px); margin-bottom: 9px; }
.aip-intro > p { line-height: 1.6; }
.aip-entry-choices { margin-top: 18px; gap: 18px; }
.aip-entry-choice { padding: 22px; }
.aip-entry-icon { width: 36px; height: 36px; margin-bottom: 14px; }
.aip-entry-choice h2 { font-size: 23px; margin-bottom: 9px; }
.aip-entry-choice p { margin-bottom: 16px; line-height: 1.6; }
.aip-entry-choice > span:last-child { padding-top: 13px; }
.aip-entry-note { margin-block: 14px !important; }
.aip-main > .aip-setup-options { margin-block: 14px; padding-block: 10px; }
.aip-invitation-card { margin-top: 14px; padding: 20px 24px; }
.aip-invitation-card h2 { font-size: 22px; margin-block: 10px; }
.aip-invitation-card > p { margin-block: 10px; line-height: 1.6; }
.aip-invitation-amount { padding-block: 12px; margin-block: 14px; }
.aip-invitation-amount > span { gap: 5px; }
.aip-invitation-card > .aip-example-ai { padding: 12px 14px; margin-block: 14px; }
.aip-invitation-card .button-row { margin-top: 14px; }
.aip-footer { max-width: 1280px; padding: 12px 28px 18px; }

/* The latest proposal and the reply editor share the desktop viewport. */
.aip-view-practice .aip-main { max-width: 1280px; padding-inline: 28px; }
.aip-room-heading { margin-bottom: 12px; }
.aip-room-heading h1 { font-size: clamp(26px, 2.5vw, 30px); margin-bottom: 6px; }
.aip-room-heading p { line-height: 1.6; }
.aip-scenario { padding: 9px 13px; margin-bottom: 14px; }
.aip-scenario .aip-sample-context { margin: 12px 0 0; padding: 12px 14px; }
.aip-room-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 20px; align-items: start; }
.aip-conversation { overflow: visible; }
.aip-conversation > .aip-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 18px;
  padding: 16px 18px 12px;
  border: 0;
  border-bottom: 1px solid #dfe6f2;
  border-radius: 14px 14px 0 0;
}
.aip-conversation .aip-current > .eyebrow,
.aip-conversation .aip-current-amount,
.aip-conversation .aip-current-from,
.aip-conversation .aip-current-plan { grid-column: 1; }
.aip-conversation .aip-current > .aip-wide {
  grid-column: 2;
  grid-row: 2 / span 2;
  width: auto;
  align-self: center;
  min-height: 44px;
}
.aip-conversation .aip-current > h2,
.aip-conversation .aip-current > p:not(.aip-current-from):not(.aip-current-plan),
.aip-conversation .aip-current-schedule { grid-column: 1 / -1; }
.aip-conversation .aip-current-amount { font-size: 32px; margin: 6px 0 2px; }
.aip-conversation .aip-current-from { margin-bottom: 3px; }
.aip-conversation .aip-current-plan { margin-bottom: 6px; line-height: 1.6; }
.aip-conversation .aip-current-schedule { margin-top: 4px; }
.aip-conversation .aip-current-schedule > summary { padding-top: 7px; }
.aip-conversation .aip-current .aip-fee-note { margin-top: 7px; line-height: 1.5; }
.aip-thread { padding: 16px 18px; gap: 18px; max-height: clamp(180px, calc(100dvh - 520px), 360px); scroll-padding: 16px; border-radius: 0 0 14px 14px; }
.aip-bubble > p { line-height: 1.65; }
.aip-offer-head { padding-top: 10px; margin-top: 10px; }
.aip-room-aside { position: sticky; top: calc(var(--demo-session-bar-height, 0px) + 12px); min-width: 0; grid-row: auto; }
.aip-room-aside .aip-composer,
.aip-room-aside .aip-completion,
.aip-room-aside .aip-limit { margin: 0; padding: 18px 20px; border: 1px solid #dfe6f2; border-radius: 14px; background: #fff; }
.aip-composer-heading { margin-bottom: 12px; }
.aip-room-aside .aip-composer-heading { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.aip-shell .field { margin-bottom: 12px; }
.aip-shell .input-label { margin-bottom: 6px; }
.aip-shell input, .aip-shell select { min-height: 44px; }
.aip-optional { padding-block: 9px; }
.aip-optional[open] > summary { margin-bottom: 12px; }
.aip-composer-actions { margin-top: 12px; position: sticky; bottom: 0; z-index: 2; background: #fff; padding-block: 8px; }
.aip-composer-actions .button { min-height: 44px; }
.aip-composer > .aip-disclosure { margin-top: 6px; line-height: 1.6; }
.aip-reserve-settings { margin-top: 12px; padding: 12px 16px; }
.aip-waiting-card { margin-top: 16px; padding: 24px; }

/* A completed reply stays on its own screen until the participant continues. */
.aip-result { max-width: 680px; }
.aip-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #e5edff;
  color: #365bb7;
}
.aip-result-icon svg { width: 25px; height: 25px; stroke-width: 2.2; }
.aip-result-rejected .aip-result-icon { background: #f9e9ee; color: #a24461; }
.aip-result h1 { font-size: clamp(28px, 3.5vw, 36px); }
.aip-result .aip-waiting-description { margin-top: 8px; font-size: 15px; line-height: 1.55; }
.aip-result-card { margin-top: 14px; padding: 20px 26px; }
.aip-result-amount { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #657796; font-size: 13px; }
.aip-result-amount .eyebrow { color: #496bb0; font-size: 10px; margin-bottom: 2px; }
.aip-result-amount > strong { font-size: 34px; line-height: 1.2; letter-spacing: -1px; font-weight: 600; color: #20385f; }
.aip-result-amount > small { font-size: 12px; line-height: 1.6; }
.aip-result-terms { margin-top: 10px; text-align: left; font-size: 12px; }
.aip-result-terms > summary { padding: 8px 0; cursor: pointer; color: #496bb0; }
.aip-result-terms .aip-table-wrap { margin-top: 4px; }
.aip-result-reply { margin-top: 10px; border-top: 1px solid #e1e7f3; padding-top: 14px; text-align: left; }
.aip-result-reply:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.aip-result-reply > span { font-size: 11px; font-weight: 600; color: #496bb0; }
.aip-result-reply > p { margin: 7px 0 0; color: #526987; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.aip-result-card > .button-row { margin-top: 16px; }
.aip-result-card .button.primary { min-width: 200px; justify-content: center; }

@media (max-width: 860px) {
  .aip-room-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .aip-room-aside { position: static; grid-row: auto; }
  .aip-thread { max-height: 280px; }
  .aip-view-practice .aip-main { padding-inline: 20px; }
}
@media (max-width: 580px) {
  :root { --se-page-start-space: 16px; }
  body[data-portal-view] .aip-header { padding-inline: 20px; }
  body[data-portal-view] .aip-progress { min-height: 44px; }
  .aip-progress { gap: 8px; }
  .aip-progress li { font-size: 11px; gap: 6px; }
  .aip-room-heading { gap: 6px; }
  .aip-room-heading h1 { font-size: 26px; }
  .aip-entry-choice { padding: 18px 20px; }
  .aip-entry-choices { gap: 12px; }
  .aip-entry-icon { margin-bottom: 10px; }
  .aip-entry-choice p { margin-bottom: 12px; }
  .aip-invitation-card { padding: 18px 20px; }
  .aip-conversation > .aip-current { padding: 16px; column-gap: 10px; }
  .aip-conversation .aip-current > .aip-wide { grid-column: 1 / -1; grid-row: auto; margin-top: 4px; width: 100%; }
  .aip-room-aside .aip-composer { padding: 18px; }
  .aip-shell input, .aip-shell select, .aip-shell textarea { font-size: 16px; }
  .aip-composer-actions { flex-wrap: wrap; }
  .aip-footer { padding-inline: 20px; }
  .aip-result-card { padding: 20px; }
  .aip-result-icon { width: 42px; height: 42px; margin-top: 0; }
  .aip-result .aip-waiting-description { font-size: 14px; }
  .aip-result-amount > strong { font-size: 34px; }
}
@media print {
  .aip-room-grid { display: block; }
  .aip-thread { max-height: none; overflow: visible; }
  .aip-room-aside { position: static; }
}
/* Keep the amount and deadline visible without making the offer form taller. */
.proposal-primary-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.proposal-primary-fields .field{min-width:0;margin-bottom:8px}
.proposal-primary-fields input{min-width:0;width:100%}
.proposal-primary-fields .field-help{font-size:11px;line-height:1.45;margin:6px 0 0}
.proposal-balance-review{padding:12px 14px;margin:10px 0;border:1px solid #ccd8f4;border-radius:10px;background:#f3f6ff;color:#243b72;font-size:12px;line-height:1.5}
.proposal-balance-review[hidden]{display:none}
.proposal-balance-review dl{display:grid;gap:5px;margin:0}
.proposal-balance-review dl>div{display:flex;gap:12px;justify-content:space-between}
.proposal-balance-review dt{font-weight:400}
.proposal-balance-review dd{margin:0;font-weight:700;white-space:nowrap}
.proposal-balance-review p{margin:8px 0 0;font-size:12px}
.proposal-balance-review .field{margin:10px 0 0}
.proposal-balance-review textarea{background:#fff}
.offer-next-step .offer-expiry{font-size:12px;line-height:1.4;margin:7px 0}
.offer-expiry.is-expired{color:#a21c35;font-weight:600}
@media(max-width:560px){.proposal-primary-fields{grid-template-columns:minmax(0,1fr)}.proposal-balance-review dl>div{gap:8px}}

/* Higher fixed totals stay visible beside the compact practice composer. */
.aip-offer-primary{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.aip-above-balance-fields{padding:12px;margin:0 0 14px;border:1px solid #ccd8f4;border-radius:10px;background:#f3f6ff}
.aip-above-balance-fields[hidden]{display:none}
.aip-above-balance-fields .aip-totals{margin:0}
.aip-above-balance-fields .field{margin:10px 0 0}
.aip-above-balance-fields textarea{min-height:62px}
.aip-above-balance-summary p{font-size:12px;line-height:1.5;margin:8px 0}
.aip-above-balance-summary .aip-disclosure{margin:6px 0}
.aip-review-required{border-color:#ccd8f4;background:#f3f6ff}
@media(max-width:560px){.aip-offer-primary{grid-template-columns:minmax(0,1fr)}}
