.portal-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.steps { display: flex; gap: 6px; margin: 14px 0; }
.steps div { flex: 1; text-align: center; font-size: 12px; padding: 8px 4px; border-radius: 8px; background: #eef2f6; color: var(--muted); }
.steps div.done { background: #dff3e7; color: var(--ok); }
.steps div.current { background: var(--brand); color: #fff; font-weight: 600; }
.story-box { min-height: 180px; font-size: 16px; line-height: 1.6; }
.prompts { margin: 8px 0 12px; padding-left: 20px; color: var(--muted); font-size: 15px; }
.qa-progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0 10px; }
.qa-bar { height: 100%; width: 0; background: var(--brand-2); transition: width .25s ease; }
.qa-thread { display: grid; gap: 8px; margin: 0 0 16px; }
.qa-chip { display: grid; gap: 2px; text-align: left; width: 100%; border: 1px solid var(--line); background: #f7f9fb; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.qa-chip:hover { border-color: var(--brand-2); }
.qa-chip-q { font-size: 12px; color: var(--muted); font-weight: 600; }
.qa-chip-a { font-size: 15px; }
.qa-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.qa-nav #qa-back { margin-right: auto; }
.qa-choices { border: 0; padding: 0; margin: 0; }
.qa-choices legend { font-weight: 600; margin: 0 0 8px; }
.qa-recap { display: grid; gap: 10px; margin: 0 0 18px; }
.qa-recap-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qa-recap-row div div { white-space: pre-wrap; margin-top: 4px; }
@media (max-width: 600px) { .qa-recap-row { grid-template-columns: 1fr; } }
.msg { padding: 10px 12px; border-radius: 10px; margin: 8px 0; max-width: 85%; font-size: 15px; white-space: pre-wrap; }
.msg.mine { background: #e3edf7; margin-left: auto; }
.msg.theirs { background: #f3f4f6; }
.msg .meta { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: normal; }
.doc { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.saved { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .steps div { font-size: 10px; } }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.plan { display: block; border: 2px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; font-weight: 400; margin: 0; position: relative; }
.plan input { position: absolute; top: 14px; right: 14px; }
.plan.selected, .plan:has(input:checked) { border-color: var(--brand-2); background: #f0f6fc; }
.plan-name { font-weight: 700; font-size: 17px; padding-right: 24px; }
.plan-price { font-size: 26px; font-weight: 700; color: var(--brand); margin: 4px 0; }
.plan ul { padding-left: 18px; margin: 8px 0 0; font-size: 14px; }
.total { margin: 12px 0; font-size: 18px; }
.line { display: flex; justify-content: space-between; padding: 4px 0; }
.total-line { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 700; }
@media (max-width: 700px) { .plans { grid-template-columns: 1fr; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-select { width: auto; padding: 6px 8px; font-size: 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,.5); background: #fff; color: var(--ink); }
.topbar-right { flex-wrap: wrap; justify-content: flex-end; }
/* Right-to-left (Arabic) */
[dir=rtl] .plan input { right: auto; left: 14px; }
[dir=rtl] .plan-name { padding-right: 0; padding-left: 24px; }
[dir=rtl] .msg.mine { margin-left: 0; margin-right: auto; }
[dir=rtl] .prompts, [dir=rtl] .plan ul, [dir=rtl] .panel ul { padding-left: 0; padding-right: 20px; }
[dir=rtl] .seal { margin-right: 0; margin-left: 6px; }
[dir=rtl] .callout { border-left: 0; border-right: 4px solid var(--brand-2); }
[dir=rtl] .callout.ok { border-right-color: var(--ok); }
[dir=rtl] .callout.warn { border-right-color: var(--warn); }
[dir=rtl] .callout.bad { border-right-color: var(--bad); }
@media (max-width: 600px) { #who { display: none; } }

.upload-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; align-items: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.thumbs figure { margin: 0; text-align: center; font-size: 12px; }
.thumbs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
#docs select { margin-bottom: 4px; }

/* Firm branding */
.brand-sub { display: block; font-size: 12px; font-weight: 400; opacity: .8; }
.brand-tag { display: block; font-size: 12px; font-weight: 400; opacity: .7; }
.topbar { background: var(--firm, var(--brand)); }
.portal-main .primary { background: var(--firm, var(--brand)); }
button.login-send { display: block; width: 100%; margin-top: 14px; }
.sms-consent { margin-top: 12px; }
.portal-main .primary:hover { filter: brightness(1.1); }

/* Self-help (retail) mode */
.sh-disclaimer { border-left: 4px solid #b7791f; }
.sh-foot { max-width: 820px; margin: 0 auto 40px; padding: 0 16px; font-size: 12px; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.ck { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #c4ced8; display: inline-grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.ck.on { background: var(--ok); border-color: var(--ok); }
.btnlink { display: inline-block; padding: 9px 16px; border-radius: 8px; text-decoration: none; }
a.primary.btnlink { color: #fff; background: var(--firm, var(--brand)); }
.two-col { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

.cc-list { padding-left: 20px; }
.cc-list li { margin: 6px 0; }
.cc-contradiction, .cc-date_mismatch, .cc-name_mismatch { color: #8a1c13; }
.portal-main .primary.danger { background: #a63d2a; }
a.secondary.btnlink { color: inherit; border: 1px solid #c4ced8; }
/* Mobile app (public/portal/native.js): respect the notch and home indicator. */
.in-app .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
.in-app body, .in-app .sh-foot { padding-bottom: env(safe-area-inset-bottom); }
.hb-exit { color: #fff; font-weight: 600; }
.cu-entry { border-top: 1px solid #e3e8ec; padding: 10px 0; }
.cu-x { background: #f4f8f7; border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.cu-x h4 { margin: 8px 0 2px; font-size: 14px; }
.rm-list { padding-left: 0; list-style: none; } .rm-list li { margin: 6px 0; }
