.portal-shell { display:grid; grid-template-columns:220px minmax(0,1fr); gap:28px; padding-top:32px; padding-bottom:48px; align-items:start; }
.portal-sidebar { position:sticky; top:100px; }
.portal-navigation { display:grid; gap:4px; background:var(--dabok-ivory,#faf8f2); border:1px solid #ded9cd; border-radius:12px; padding:16px; }
.portal-menu-group { display:grid; gap:4px; }
.portal-navigation .portal-menu-group > a { padding:9px 12px; border-radius:6px; color:#303b3a; text-decoration:none; }
.portal-navigation a.is-active { background:#0f4b5a; color:white; font-weight:700; }
.portal-menu-heading { margin:16px 12px 4px; font-size:.8rem; color:#626d67; }
.portal-main { min-width:0; overflow-wrap:anywhere; }
.portal-main h1 { margin:0 0 12px; font-size:clamp(1.7rem,4vw,2.3rem); }
.portal-main .container { width:100%; max-width:none; margin:0; padding:0; }
.portal-main .section,.portal-main .customer-account-page { padding:0; }
.portal-main .account-card { padding:22px; margin:18px 0 0; border:1px solid #ded9cd; border-radius:12px; background:#fffdf8; }
.portal-main .account-card h2 { font-size:1.15rem; margin:0 0 12px; }
.portal-main .account-card h3 { font-size:1rem; margin:0 0 8px; }
.profile-page .account-card { margin-top:16px; }
.profile-page .profile-form { display:grid; gap:16px; max-width:520px; }
.profile-page .profile-form .consult-field { min-width:0; }
.profile-page .profile-form .button { justify-self:end; }
.profile-page .profile-password > summary { color:var(--dabok-teal); font-weight:600; cursor:pointer; }
.profile-page .profile-password[open] > summary { margin-bottom:20px; }
.profile-page .profile-back { margin-top:20px; }
/* Compact customer dashboard. Detailed case history stays on the progress page. */
.portal-dashboard-compact { display:grid; gap:12px; }
.dashboard-greeting { display:inline-block; margin-left:14px; color:#626d67; font-size:.9rem; font-weight:400; }
.portal-main .portal-dashboard-compact .account-card { margin:0; padding:16px; border:0; background:#fffdf8; }
.portal-main .portal-dashboard-compact .account-card h2 { margin:0 0 8px; font-size:1.05rem; }
.portal-case-selector { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.portal-case-selector label { font-size:.85rem; color:#626d67; }
.portal-case-selector select { min-height:40px; max-width:100%; padding:8px 12px; border:1px solid #ded9cd; border-radius:7px; background:#fffdf8; color:#164e4a; }
.portal-case-selector .button { min-height:40px; padding:8px 16px; }
.portal-main .portal-dashboard-compact .dashboard-progress { background:#e8f2ef; }
.dashboard-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dashboard-card-heading .portal-status { padding:4px 10px; font-size:.8rem; }
.dashboard-stage-summary { display:grid; grid-template-columns:1fr 1fr auto; gap:16px; align-items:center; }
.dashboard-stage-summary div { display:grid; gap:4px; min-width:0; }
.dashboard-stage-summary small,.dashboard-task-list small { color:#626d67; font-size:.75rem; line-height:1.4; }
.dashboard-stage-summary strong { color:#164e4a; font-size:1.15rem; line-height:1.4; }
.dashboard-main-grid { display:grid; grid-template-columns:1.3fr 1fr; gap:12px; }
.dashboard-task-list { list-style:none; padding:0; margin:0; }
.dashboard-task-list li { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:7px 0; }
.dashboard-task-list li + li { border-top:1px solid #e6e1d8; }
.dashboard-task-list li > div { display:grid; grid-template-columns:auto minmax(0,1fr); gap:4px 8px; min-width:0; }
.dashboard-task-list strong { color:#164e4a; font-size:.95rem; line-height:1.4; }
.portal-main .portal-dashboard-compact .dashboard-task-list p { grid-column:1/-1; margin:0; color:#626d67; font-size:.8rem; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.portal-main .portal-dashboard-compact a { font-size:.85rem; }
.portal-main .portal-dashboard-compact .text-link { min-height:36px; }
.portal-main .portal-dashboard-compact .dashboard-task-list a { flex-shrink:0; font-size:.8rem; }
.portal-main .portal-dashboard-compact .dashboard-task-list .button { padding:8px 12px; min-height:40px; }
.dashboard-empty { color:#626d67; font-size:.9rem; }
.portal-main .portal-dashboard-compact .dashboard-schedule-date { color:#164e4a; font-size:1.15rem; font-weight:700; margin:0 0 6px; }
.dashboard-next-schedule > .text-link { display:inline-block; margin-top:8px; }
.dashboard-finance-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.dashboard-finance-grid > div { min-width:0; }
.dashboard-finance-grid strong { color:#164e4a; font-size:.9rem; }
.portal-main .portal-dashboard-compact .dashboard-finance-grid p,.portal-main .portal-dashboard-compact .dashboard-small { margin:6px 0; color:#626d67; font-size:.82rem; line-height:1.5; }
.dashboard-finance-grid .text-link { font-size:.85rem; }
.portal-completed-steps { margin:16px 0; }
.portal-completed-steps > summary { cursor:pointer; color:#626d67; font-size:.9rem; padding:8px 0; }
.portal-step-next { border-color:#4f8179; border-style:dashed; color:#164e4a; }
@media(min-width:961px) {
    .portal-main:has(> .portal-dashboard-compact) { position:relative; }
    .portal-main:has(.portal-case-selector) > h1 { padding-right:450px; }
    .portal-dashboard-compact .portal-case-selector { position:absolute; top:4px; right:0; }
    .portal-dashboard-compact .portal-case-selector select { max-width:240px; }
}
@media(max-width:600px) {
    .portal-main .portal-dashboard-compact .account-card { padding:18px; }
    .dashboard-main-grid,.dashboard-finance-grid { grid-template-columns:1fr; gap:14px; }
    .dashboard-stage-summary { grid-template-columns:1fr 1fr; gap:12px; }
    .dashboard-stage-summary > a { grid-column:1/-1; font-size:.85rem; }
    .dashboard-stage-summary strong { font-size:1rem; }
    .portal-case-selector { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; }
    .portal-case-selector label { grid-column:1/-1; }
    .portal-case-selector select { width:100%; min-width:0; }
}
.portal-main .account-card p { margin:8px 0; }
.portal-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:18px; }
.portal-summary-grid .account-card { margin:0; }
.portal-case + .portal-case { border-top:1px solid #ded9cd; padding-top:16px; margin-top:16px; }
.portal-main .account-info dd { min-width:0; overflow-wrap:anywhere; }
.portal-main .portal-history { margin:0; padding:0; }
.portal-main .portal-history li { padding:12px 0; }
.portal-main .consult-form,.portal-main .story-reading { max-width:100%; }
.portal-main input,.portal-main select,.portal-main textarea { max-width:100%; min-width:0; }
.portal-navigation .account-logout { margin-top:20px; }
.story-filter { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:24px 0; }
.story-filter select { padding:10px 36px 10px 12px; border:1px solid #ded9cd; border-radius:6px; background:#fffdf8; color:#303b3a; }
.story-list.section { padding:40px 0 48px; }
.story-list .story-empty { min-height:0; padding:24px; margin:24px 0; }
.portal-shell a:focus-visible,.portal-shell summary:focus-visible,.story-filter select:focus-visible { outline:3px solid #0f4b5a; outline-offset:3px; }
@media (max-width:960px) { .portal-shell { grid-template-columns:minmax(0,1fr); gap:20px; padding-top:20px; } .portal-sidebar { display:none; } }
@media (max-width:600px) { .portal-summary-grid { grid-template-columns:minmax(0,1fr); } .portal-main .account-card { padding:18px; } .portal-main .account-info > div { grid-template-columns:minmax(0,1fr); gap:4px; } .portal-main .portal-history li { flex-wrap:wrap; } }
.portal-main .portal-current { color:var(--dabok-teal,#0f4b5a); font-size:1.3rem; }
.portal-steps { list-style:none; padding:0; margin:20px 0 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.portal-step { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px solid #ded9cd; border-radius:8px; }
.portal-step span { font-size:.85rem; flex-shrink:0; color:#626d67; }
.portal-step-current { background:#e8f2ef; border:2px solid #0f4b5a; color:#0f4b5a; }
.portal-step-attention { background:#fff4dd; }
.portal-step-completed { background:#f2f5f0; }
.portal-case { scroll-margin-top:100px; }
@media (max-width:600px) { .portal-steps { grid-template-columns:minmax(0,1fr); } }
.portal-summary-grid .portal-history li > div { flex:1; min-width:0; }
.portal-summary-grid .portal-history li > span { flex-shrink:0; white-space:nowrap; }

/* CRM schedules and versioned customer submissions. */
.portal-operation-list{display:grid;gap:18px;margin-top:20px}
.portal-operation-card{min-width:0;border:1px solid var(--portal-line,#ded9cf);border-radius:14px;padding:22px;background:#fffdf7;overflow-wrap:anywhere}
.portal-operation-card.needs-attention{border-left:4px solid #a76e3d;background:#faf4e8}
.portal-operation-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.portal-operation-heading h3{margin:0;color:#164e4a}
.portal-state{display:inline-block;padding:6px 12px;border-radius:20px;background:#e5efea;color:#164e4a;font-size:14px}
.portal-operation-meta{display:grid;grid-template-columns:130px minmax(0,1fr);gap:8px 12px;margin:18px 0}
.portal-operation-meta dt{color:#6c7069}.portal-operation-meta dd{margin:0;min-width:0}
.portal-public-message{padding:14px;border-radius:10px;background:#eee8dc;white-space:pre-wrap;overflow-wrap:anywhere}
.portal-upload-form{display:grid;gap:14px;margin:20px 0}.portal-upload-form label{display:grid;gap:8px}
.portal-upload-form input{width:100%;max-width:100%;box-sizing:border-box;min-height:44px}.portal-upload-form button,.portal-operation-card button{min-height:44px}
.portal-document-counts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:18px 0}
.portal-document-counts div{display:grid;gap:8px;padding:12px;background:#eee8dc;border-radius:10px;text-align:center}.portal-document-counts strong{font-size:24px;color:#164e4a}
.portal-file-history{list-style:none;padding:0;display:grid;gap:12px}.portal-file-history li{display:grid;gap:4px;min-width:0}.portal-operation-card summary{min-height:44px;cursor:pointer}
@media(max-width:600px){.portal-operation-card{padding:16px}.portal-document-counts{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-operation-meta{grid-template-columns:100px minmax(0,1fr)}.portal-upload-form button{width:100%}}

/* Customer schedules: timing is an on-screen view of the saved workflow status. */
.customer-schedules h2 { margin-bottom:12px; }
.customer-schedule-section { margin-top:16px; }
.customer-schedule-section>h3 { margin:0 0 8px; font-size:17px; color:#164e4a; }
.customer-schedule-group { margin:0 0 9px; padding:10px 14px; border:1px solid var(--portal-line,#ded9cf); border-radius:10px; background:#fffdf7; }
.customer-schedule-group.needs-attention { border-left:4px solid #a76e3d; }
.customer-schedule-group-title,.customer-schedule-entry-heading { display:flex; align-items:center; justify-content:space-between; gap:7px 12px; flex-wrap:wrap; }
.customer-schedule-group-title { padding-bottom:7px; color:#164e4a; }
.customer-schedule-group-title span { color:#6c7069; font-size:12px; }
.customer-schedule-entry { padding:7px 0; border-top:1px solid var(--portal-line,#ded9cf); }
.customer-schedule-entry:first-child { border-top:0; }
.customer-schedule-entry-heading strong { font-size:15px; color:#164e4a; }
.customer-schedule-entry p { margin:5px 0; }
.customer-schedule-time { font-size:14px; }
.customer-schedule-time.is-today { color:#164e4a; }
.customer-schedule-time span { margin-left:8px; padding:2px 6px; border-radius:4px; background:#e4f2ed; font-size:11px; font-weight:700; }
.customer-schedule-notice { color:#9a5b20; font-size:12px; font-weight:700; }
.customer-schedule-info,.customer-schedule-ack,.customer-schedule-empty { color:#6c7069; font-size:12px; }
.customer-schedule-entry .portal-public-message { margin:6px 0; padding:8px 10px; }
.customer-schedule-entry form { margin:7px 0 0; }
.customer-schedule-entry button { min-height:34px; padding:5px 11px; }
.customer-schedule-change summary { font-size:12px; }
.customer-schedule-past { margin-top:14px; }
.customer-schedule-past>summary { min-height:34px; cursor:pointer; font-weight:700; }
@media(max-width:600px){.customer-schedule-group{padding:9px 11px}.customer-schedule-entry button{width:auto}}

/* Customer matching phase 3: existing B-1 cards and controls. */
.portal-match-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:12px;align-items:end;margin:20px 0}
.portal-match-filters label{display:grid;gap:8px;min-width:0}.portal-match-filters input,.portal-match-filters select{width:100%;min-width:0;min-height:44px;box-sizing:border-box}
@media(max-width:600px){.portal-match-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-match-filters button{grid-column:1/-1}}

/* Shared customer profile cards, favorites and detail. */
.portal-match-tabs { display:flex; gap:8px; flex-wrap:wrap; border-bottom:1px solid #ded9cd; margin:24px 0; padding-bottom:12px; }
.portal-match-tabs a { padding:10px 16px; border-radius:8px; text-decoration:none; color:#626d67; font-weight:600; }
.portal-match-tabs a[aria-current="page"] { background:#e8f2ef; color:#0f4b5a; }
.portal-main .portal-match-filters { padding:18px; margin:0 0 28px; border:1px solid #ded9cd; border-radius:12px; background:#fffdf8; grid-template-columns:minmax(80px,1fr) minmax(80px,1fr) minmax(120px,1.3fr) minmax(170px,1.7fr) auto; }
.portal-match-filters label { font-size:.85rem; color:#626d67; gap:6px; }
.portal-match-filters input,.portal-match-filters select,.portal-meeting-response select { padding:10px 12px; border:1px solid #ded9cd; border-radius:7px; background:white; color:#303b3a; font:inherit; }
.portal-match-section { margin-top:28px; }
.portal-match-heading { display:flex; justify-content:space-between; align-items:start; flex-wrap:wrap; gap:16px; }
.portal-main .portal-match-heading h2 { margin:0; font-size:1.25rem; color:#164e4a; }
.portal-match-heading p,.portal-main .portal-match-help { color:#626d67; font-size:.875rem; line-height:1.7; margin:8px 0 16px; }
.portal-selection-counter { padding:10px 14px; border-radius:8px; background:#eee8dc; font-size:.8rem; white-space:nowrap; }
.portal-selection-counter strong { margin-left:6px; color:#164e4a; }
.customer-site .portal-profile-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:20px 0 0; align-items:start; }
.customer-site .portal-profile-grid-single { grid-template-columns:minmax(0,360px); }
.customer-site .portal-profile-card { display:flex; flex-direction:column; padding:0; border:1px solid #ded9cd; border-radius:12px; background:#fffdf8; overflow:hidden; }
.portal-profile-card.is-recommended { border-color:#94b4a8; }
.portal-profile-photo { display:block; position:relative; padding:10px 10px 0; }
.customer-site .portal-profile-card img { border-radius:7px; aspect-ratio:3/4; }
.portal-profile-card.is-recommended .portal-profile-photo img { outline:2px solid #628e7e; outline-offset:3px; }
.portal-recommendation-badge { position:absolute; top:22px; left:22px; padding:5px 10px; border-radius:5px; background:#164e4a; color:#fff; font-size:.75rem; font-weight:600; line-height:1.5; pointer-events:none; }
.portal-profile-body { display:flex; flex-direction:column; padding:18px; min-width:0; }
.customer-site .portal-profile-card h3 { margin:0 0 4px; font-size:1.15rem; line-height:1.45; color:#164e4a; }
.customer-site .portal-profile-card p { margin:4px 0; line-height:1.65; font-size:.875rem; }
.customer-site .portal-profile-card .portal-profile-location { font-size:.8rem; color:#7b8078; }
.customer-site .portal-profile-card .portal-profile-summary { color:#303b3a; }
.portal-recommendation-reason { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.customer-site .portal-profile-card .portal-profile-progress { margin-top:14px; padding-top:12px; border-top:1px solid #ece8df; color:#164e4a; }
.portal-profile-message { padding:10px 12px; border-radius:7px; background:#f0ede5; white-space:pre-wrap; overflow-wrap:anywhere; }
.customer-site .portal-profile-card .portal-profile-actions { margin-top:8px; padding-top:8px; display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; }
.portal-profile-actions .text-link { font-size:.85rem; }
.portal-profile-actions .button { padding:10px 14px; font-size:.85rem; min-height:44px; }
.portal-match-empty { grid-column:1/-1; text-align:center; padding:36px 20px; border:1px dashed #ded9cd; border-radius:12px; background:#faf8f2; }
.portal-main .portal-match-empty h3 { margin:0 0 10px; color:#164e4a; font-size:1.05rem; }
.portal-match-empty p { color:#626d67; line-height:1.8; margin:8px 0 20px; }
.portal-photo-placeholder { display:grid; place-items:center; aspect-ratio:3/4; background:#eee8dc; color:#626d67; font-size:.875rem; border-radius:7px; }
.portal-meetings-section { margin-top:40px; padding-top:28px; border-top:1px solid #ded9cd; }
.portal-meeting-response { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin-top:24px; padding-top:20px; border-top:1px solid #ded9cd; }
.portal-meeting-response label { display:grid; gap:8px; flex:1; min-width:0; font-size:.9rem; }
.portal-detail-overview { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; margin-top:28px; align-items:start; }
.portal-detail-gallery { position:relative; min-width:0; padding:10px; border:1px solid #ded9cd; border-radius:12px; background:#fffdf8; }
.portal-detail-gallery.is-recommended { border:2px solid #628e7e; }
.customer-site .portal-detail-gallery .portal-photos { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; }
.customer-site .portal-detail-gallery .portal-photos img { border-radius:7px; max-height:none; aspect-ratio:3/4; object-fit:contain; background:#eee8dc; }
.portal-detail-gallery .portal-photos > :first-child { grid-column:1/-1; }
.portal-main .portal-detail-info h2 { font-size:1.2rem; margin:0 0 12px; color:#164e4a; }
.portal-main .portal-detail-info .account-info > div { grid-template-columns:70px minmax(0,1fr); padding:13px 0; gap:16px; line-height:1.7; }
.portal-detail-info .account-info dd { font-weight:600; }
.portal-profile-information-notice { font-size:.95rem; line-height:1.75; color:var(--muted,#5c6675); }
.portal-profile-information-notice h2 { color:inherit; font-size:1rem; margin:0 0 8px; }
.portal-profile-information-notice p { margin:6px 0 0; }
.portal-detail-recommendation { padding:16px; margin-top:20px; border-left:3px solid #628e7e; background:#f1f5f0; border-radius:0 8px 8px 0; }
.portal-main .portal-detail-recommendation h3,.portal-main .portal-detail-action h3 { font-size:1rem; margin:0 0 8px; color:#164e4a; }
.portal-detail-recommendation p { margin:0; line-height:1.8; }
.portal-detail-action { margin-top:24px; padding:20px; border-radius:12px; background:#e8f2ef; }
.portal-detail-action p { line-height:1.7; font-size:.9rem; }
.portal-detail-action form { margin:16px 0 0; }
.portal-detail-action .button { width:100%; min-height:48px; }
.portal-detail-links { display:flex; flex-wrap:wrap; gap:16px 24px; align-items:center; margin-top:32px; padding-top:24px; border-top:1px solid #ded9cd; }
@media(max-width:1200px) and (min-width:961px) {
    .customer-site .portal-profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .portal-main .portal-match-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .portal-match-filters button { grid-column:1/-1; }
}
@media(max-width:760px) {
    .customer-site .portal-profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
    .portal-main .portal-match-filters { grid-template-columns:repeat(2,minmax(0,1fr)); padding:16px; }
    .portal-match-filters button { grid-column:1/-1; }
    .portal-detail-overview { grid-template-columns:minmax(0,1fr); gap:24px; }
}
@media(max-width:520px) {
    .customer-site .portal-profile-grid { grid-template-columns:minmax(0,1fr); grid-auto-rows:auto; }
    .portal-profile-body { padding:18px; }
    .portal-main .portal-detail-info .account-info > div { grid-template-columns:70px minmax(0,1fr); }
    .portal-meeting-response { flex-direction:column; align-items:stretch; }
    .portal-detail-links { align-items:stretch; flex-direction:column; }
    .portal-detail-links .button { white-space:normal; text-align:center; }
}

/* Personal recommendations remain part of the same eligible catalog. */
.portal-recommended-section { padding:22px; margin-top:24px; border:1px solid #94b4a8; border-radius:14px; background:#edf4f1; }
.portal-main .portal-recommended-section > header h3 { margin:0 0 8px; color:#0f4b5a; font-size:1.2rem; }
.portal-recommended-section > header p { margin:0; font-size:.9rem; color:#526b65; line-height:1.7; }
.portal-main .portal-catalog-heading { margin:32px 0 12px; color:#164e4a; font-size:1.15rem; }
.customer-site .portal-profile-card.is-recommended { border:2px solid #0f4b5a; background:#f4f8f5; }
.portal-profile-card.is-recommended .portal-profile-photo img { outline-color:#0f4b5a; }
.portal-detail-gallery.is-recommended { border-color:#0f4b5a; background:#edf4f1; }
.portal-detail-recommendation { border-left-color:#0f4b5a; }
@media(max-width:520px) { .portal-recommended-section { padding:14px; } }

.portal-main .portal-catalog-heading-without-recommendations { margin-top:0; }

/* CRM-approved contract and consultation presentation. */
.portal-contract-card { border-top: 1px solid var(--border, #e3e7e5); padding: 1.25rem 0; min-width: 0; }
.portal-contract-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .75rem; }
.portal-contract-heading h2, .portal-contract-heading h3 { margin: 0; }
.portal-status { display: inline-block; border-radius: 999px; background: #edf5ef; color: #285742; padding: .3rem .8rem; font-size: .875rem; }
.portal-contract-fields { margin: 1rem 0; }
.portal-contract-fields > div { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(0, 3fr); gap: .75rem; padding: .4rem 0; }
.portal-contract-fields dd { margin: 0; overflow-wrap: anywhere; }
.portal-money { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.portal-contract-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.portal-contract-text p, .portal-preserve-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.portal-contract-text { padding: .75rem 0; }
.portal-consultation-detail { margin-top: .75rem; }
.portal-consultation-detail summary { cursor: pointer; }
@media (max-width: 600px) { .portal-contract-fields > div { grid-template-columns: 1fr; gap: .25rem; } .portal-contract-actions .button { width: 100%; text-align: center; } }

/* Customer contract list/detail only; retain other portal card layouts. */
.portal-main .portal-contract-summary { padding:20px; }
.portal-contract-summary .portal-contract-heading { align-items:center; gap:8px 16px; }
.portal-main .portal-contract-summary .portal-contract-heading h2 { margin:0; min-width:0; overflow-wrap:anywhere; }
.portal-contract-summary .portal-status { flex-shrink:0; }
.portal-contract-meta { display:grid; gap:6px; margin:16px 0; }
.portal-contract-meta > div { display:grid; grid-template-columns:88px minmax(0,1fr); gap:12px; }
.portal-contract-meta dt { color:#626d67; }
.portal-contract-meta dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.portal-contract-amount { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 20px; padding:12px 16px; border-radius:8px; background:#edf4f1; color:#164e4a; }
.portal-contract-amount strong { min-width:0; font-size:1.3rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.portal-contract-document { margin-top:16px; padding-top:16px; border-top:1px solid #ded9cd; }
.portal-contract-document-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin-bottom:12px; }
.portal-main .portal-contract-document-heading h3 { margin:0; }
.portal-contract-document-heading > span,.portal-contract-document-notice { font-size:.875rem; color:#626d67; }
.portal-contract-buttons { display:flex; flex-wrap:wrap; gap:8px; }
.customer-site .portal-contract-buttons .button { min-height:44px; padding:9px 16px; font-size:.9rem; gap:8px; max-width:100%; }
.portal-contract-empty { margin-top:20px; }
.portal-contract-empty p + p { color:#626d67; }
@media(max-width:600px) {
    .portal-main .portal-contract-summary { padding:16px; }
    .portal-contract-meta > div { grid-template-columns:76px minmax(0,1fr); gap:8px; }
    .portal-contract-amount { flex-direction:column; align-items:flex-start; padding:12px; }
    .portal-contract-buttons { flex-direction:column; align-items:stretch; }
    .customer-site .portal-contract-buttons .button { width:100%; }
}

/* Customer payment page only. */
.portal-payment-case + .portal-payment-case { margin-top:28px; padding-top:24px; border-top:1px solid #ded9cd; }
.portal-payment-case-title { margin:18px 0 8px; font-size:1.05rem; color:#164e4a; }
.portal-main .portal-payments .account-card { padding:20px; }
.portal-payment-totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; }
.portal-payment-totals > div { padding:14px 16px; border-radius:8px; background:#edf4f1; min-width:0; }
.portal-payment-totals dt { color:#164e4a; margin-bottom:8px; }
.portal-payment-totals dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.portal-payment-totals strong { display:block; font-size:1.25rem; color:#164e4a; font-variant-numeric:tabular-nums; }
.portal-payment-totals small { display:block; }
.customer-site .portal-payment-totals .text-link { display:inline; min-height:0; font-size:.8rem; font-weight:400; }
.portal-payment-muted,.portal-payment-help { color:#626d67; font-size:.875rem; }
.portal-main .portal-payment-summary .portal-payment-help { margin:12px 0 0; }
.portal-payment-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.portal-payment-table th,.portal-payment-table td { padding:12px 8px; border-bottom:1px solid #ded9cd; text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.portal-payment-table th { color:#626d67; font-size:.875rem; font-weight:500; }
.portal-payment-table .portal-payment-value { text-align:right; font-variant-numeric:tabular-nums; }
.portal-payment-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.portal-payment-pagination { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:16px; }
.customer-site .portal-payment-pagination .button { min-height:44px; padding:9px 16px; font-size:.9rem; }
@media(max-width:600px) {
    .portal-main .portal-payments .account-card { padding:16px; }
    .portal-payment-totals { grid-template-columns:minmax(0,1fr); }
    .portal-payment-table,.portal-payment-table tbody { display:block; }
    .portal-payment-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
    .portal-payment-table tr { display:block; padding:10px 0; border-bottom:1px solid #ded9cd; }
    .portal-payment-table td { display:grid; grid-template-columns:90px minmax(0,1fr); gap:8px; padding:5px 0; border:0; }
    .portal-payment-table td::before { content:attr(data-label); color:#626d67; font-size:.875rem; text-align:left; }
}

/* Settlement uses the portal's B-1 colors and existing controls. */
.settlement-summary{display:grid;grid-template-columns:minmax(130px,1fr) 2fr;gap:12px;margin:20px 0}
.settlement-summary dd{margin:0;overflow-wrap:anywhere}
.settlement-item{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 0;border-bottom:1px solid var(--border,#ded7c9)}
.settlement-item>div{min-width:0;overflow-wrap:anywhere}
.settlement-item form{flex-shrink:0}.settlement-item button{min-height:44px}
.settlement-item .portal-status{margin-left:10px}.settlement-completed{margin:20px 0}
.settlement-customer h3{margin-top:28px}.settlement-completed summary{cursor:pointer;min-height:44px}
@media(max-width:600px){.settlement-item{flex-direction:column;align-items:stretch}.settlement-item button{width:100%}.settlement-summary{grid-template-columns:1fr;gap:6px}.settlement-summary dd{margin-bottom:12px}}

.header-notifications{display:inline-flex;align-items:center;gap:4px;min-width:44px;min-height:44px;color:#0f4b5a;text-decoration:none;justify-content:center}
.header-notifications svg{width:21px;height:21px}.notification-count{font-size:12px}
.notification-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0}
.notification-filters{display:flex;gap:20px;margin:16px 0}.notification-filters a{color:#0f4b5a;padding:10px 0;text-decoration:none}.notification-filters a[aria-current]{font-weight:700;border-bottom:2px solid #0f4b5a}
.notification-list{padding:0;list-style:none;margin:0}.notification-item{min-width:0;padding:12px 14px;border:1px solid #ded7c9;border-radius:10px;margin:8px 0;background:#fffdf8}
.notification-item-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-width:0}.notification-title{min-width:0;color:#0f4b5a;font-weight:700;line-height:1.4;text-decoration:none;overflow-wrap:anywhere}.notification-item form{flex:none;margin:0}.notification-item button{min-height:44px;padding:6px 12px;white-space:nowrap}
.notification-body{margin:3px 0 6px;line-height:1.45;white-space:pre-line;overflow-wrap:anywhere}.notification-item-footer{display:flex;align-items:center;flex-wrap:wrap;gap:4px 16px;min-width:0}.notification-item time,.notification-read-label{font-size:13px;color:#62706a}.notification-read-label{flex:none;line-height:1.4}.notification-progress-link{color:#0f4b5a;font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:2px}
.notification-item.is-unread{border-left:4px solid #0f4b5a}.notification-item.is-read{border-left:2px solid #c6cbc5;background:#f5f3ed}.notification-item.is-read .notification-title{color:#345a62}
.notification-empty{padding:28px 0}.notification-pagination{display:flex;gap:20px;justify-content:center;align-items:center;margin:24px 0}.notification-pagination a{color:#0f4b5a;padding:12px}
.dashboard-notifications{padding:16px 20px;margin-top:18px}.dashboard-notifications h2{font-size:18px}.dashboard-notifications ul{list-style:none;padding:0;display:grid;gap:10px}.dashboard-notifications a{color:#0f4b5a}
@media(max-width:600px){.notification-item{padding:10px 12px}.notification-item-heading{gap:8px}.notification-item button{padding-inline:8px}.notification-item-footer{gap:4px 12px}.header-account{gap:4px}.header-notifications{min-width:38px}.notification-toolbar{flex-wrap:wrap}}
.important-notification-modal { width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-sizing: border-box; overflow-y: auto; border: 1px solid var(--border, #d9e2e3); border-radius: 16px; padding: 24px; color: #183c42; }
.important-notification-modal::backdrop { background: rgba(10, 32, 38, .5); }
.important-notification-modal h2 { margin-top: 0; }
.important-notification-modal ul { padding: 0; list-style: none; }
.important-notification-modal li { border-top: 1px solid #d9e2e3; padding: 12px 0; overflow-wrap: anywhere; }
.important-notification-modal time { display: block; font-size: 13px; margin-bottom: 8px; }
.important-notification-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }

.portal-detail-info .account-info dd small { display:block; margin-top:6px; font-weight:400; line-height:1.6; }

/* Customer profile gallery: one stable photo area and a horizontal thumbnail strip. */
.profile-gallery-main { position:relative; display:block; width:100%; aspect-ratio:3/4; max-height:640px; padding:0; overflow:hidden; border:0; border-radius:7px; background:#eee8dc; cursor:zoom-in; }
.customer-site .profile-gallery-main img { position:absolute; inset:0; width:100%; height:100%; max-height:none; object-fit:contain; opacity:0; transition:opacity .5s ease-in-out; }
.customer-site .profile-gallery-main img.is-current { opacity:1; }
.profile-gallery-zoom { position:absolute; right:12px; bottom:12px; padding:5px 10px; border-radius:20px; background:rgba(15,75,90,.88); color:#fff; font-size:12px; }
.profile-gallery-thumbnails { position:relative; display:flex; gap:8px; overflow-x:auto; padding:10px 2px 6px; overscroll-behavior-x:contain; }
.profile-gallery-thumbnail { flex:0 0 80px; width:80px; height:80px; padding:3px; border:2px solid transparent; border-radius:7px; background:#eee8dc; cursor:pointer; }
.customer-site .profile-gallery-thumbnail img { display:block; width:100%; height:100%; object-fit:contain; border-radius:3px; }
.profile-gallery-thumbnail[aria-pressed="true"] { border-color:#0f4b5a; background:#edf4f1; }
.profile-gallery-main:focus-visible,.profile-gallery-thumbnail:focus-visible { outline:3px solid #0f4b5a; outline-offset:2px; }
.profile-gallery-playback { margin:6px 0 0; padding:4px; border:0; background:transparent; cursor:pointer; font-size:13px; }
.profile-gallery-playback:disabled { cursor:default; }
.profile-gallery-dialog { position:fixed; inset:0; width:100vw; height:100dvh; max-width:100vw; max-height:100dvh; margin:0; padding:0; border:0; background:#101719; color:#fff; }
.profile-gallery-dialog::backdrop { background:rgba(0,0,0,.9); }
.profile-gallery-lightbox { position:relative; width:100%; height:100%; padding:64px 60px; }
.customer-site .profile-gallery-lightbox img { display:block; width:100%; height:100%; object-fit:contain; }
.profile-gallery-close,.profile-gallery-prev,.profile-gallery-next { position:absolute; z-index:1; display:grid; place-items:center; width:48px; height:48px; padding:0; border:1px solid #708184; border-radius:50%; background:rgba(15,75,90,.85); color:#fff; font-size:32px; line-height:1; cursor:pointer; }
.profile-gallery-close { top:max(12px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); }
.profile-gallery-prev { top:calc(50% - 24px); left:8px; }
.profile-gallery-next { top:calc(50% - 24px); right:8px; }
.profile-gallery-count { position:absolute; right:0; bottom:max(12px,env(safe-area-inset-bottom)); left:0; margin:0; text-align:center; }
@media (max-width:600px) {
    .profile-gallery-lightbox { padding:64px 8px; }
    .profile-gallery-prev,.profile-gallery-next { width:44px; height:44px; }
}
@media (prefers-reduced-motion:reduce) {
    .customer-site .profile-gallery-main img { transition:none; }
}

/* Customer detail facts retain the existing card palette and spacing. */
.portal-profile-heading { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.portal-profile-name { display:inline-flex; flex-wrap:wrap; align-items:center; gap:12px; max-width:100%; }
.portal-marital-badge { display:inline-flex; align-items:center; padding:5px 12px; border:1px solid #b7ceca; border-radius:20px; background:#edf4f1; color:#0f4b5a; font-size:14px; font-weight:600; line-height:1.5; white-space:nowrap; }
.portal-profile-detail-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-top:24px; align-items:start; }
.customer-site .portal-profile-detail-cards .account-card { min-width:0; margin:0; overflow-wrap:anywhere; }
.portal-profile-introduction { grid-column:1/-1; }
.portal-profile-detail-cards h3 { margin-top:20px; font-size:16px; }
.portal-profile-detail-cards .account-info { margin-bottom:0; }
.portal-profile-detail-cards .account-info ul { margin:0; padding-left:18px; }
@media (max-width:600px) {
    .portal-profile-detail-cards { grid-template-columns:minmax(0,1fr); gap:16px; }
}

/* Marital labels share the detail-page palette; names wrap without overlapping badges. */
.portal-profile-card-name { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; overflow-wrap:anywhere; }
.portal-profile-card-name .portal-marital-badge { padding:2px 8px; font-size:12px; }
.portal-marital-badge.is-unmarried { background:#edf4f1; border-color:#b7ceca; color:#0f4b5a; }
.portal-marital-badge.is-remarried { background:#fbf0e2; border-color:#dfc29b; color:#795222; }

/* Current confirmed partner on the customer progress page. */
.portal-confirmed-partner-content { display:grid; grid-template-columns:128px minmax(0,1fr); gap:20px; align-items:start; }
.portal-confirmed-partner-content > img,.portal-confirmed-partner-placeholder { width:128px; height:160px; border-radius:8px; object-fit:cover; background:#f0ede5; }
.portal-confirmed-partner-placeholder { display:flex; align-items:center; justify-content:center; padding:12px; text-align:center; color:#626d67; font-size:.8rem; }
.portal-main .portal-confirmed-partner-info h3 { margin:0 0 8px; color:#164e4a; font-size:1.1rem; }
.portal-confirmed-partner-info dl { display:grid; gap:4px; margin:0 0 10px; }
.portal-confirmed-partner-info dl > div { display:flex; flex-wrap:wrap; gap:4px 10px; font-size:.875rem; line-height:1.5; }
.portal-confirmed-partner-info dt { color:#626d67; }
.portal-confirmed-partner-info dd { margin:0; color:#303b3a; font-weight:600; overflow-wrap:anywhere; }
.portal-main .portal-confirmed-partner-status { display:inline-block; margin:0 0 12px; padding:3px 9px; border-radius:6px; background:#e8f2ef; color:#0f4b5a; font-size:.8rem; font-weight:700; }

/* Customer portal navigation: the sidebar and the mobile sheet share one menu template. */
.portal-mobile-bar,.portal-mobile-sheet:not([open]) { display:none; }
.portal-mobile-sheet { box-sizing:border-box; }
@media (max-width:960px) {
    .portal-page { padding-bottom:calc(70px + env(safe-area-inset-bottom)); }
    .portal-page .site-header .mobile-menu { display:none; }
    .portal-page.portal-menu-open { overflow:hidden; }
    .portal-mobile-bar {
        position:fixed; z-index:30; inset:auto 0 0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr));
        min-height:64px; padding:3px max(4px,env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));
        border-top:1px solid #ded9cd; background:#fffdf8; box-shadow:0 -2px 12px rgb(15 75 90 / 8%);
    }
    .portal-mobile-bar > a,.portal-mobile-bar > button {
        display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; min-height:58px;
        padding:4px 1px; border:0; border-radius:7px; background:transparent; color:#526263;
        font:inherit; font-size:clamp(10px,2.8vw,12px); font-weight:600; line-height:1.2; text-decoration:none; white-space:nowrap; cursor:pointer;
    }
    .portal-mobile-bar svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
    .portal-mobile-bar .is-active { color:#0f4b5a; background:#e8f2ef; font-weight:700; }
    .portal-mobile-bar > :focus-visible,.portal-mobile-sheet :focus-visible { outline:3px solid #0f4b5a; outline-offset:-3px; }
    .portal-mobile-sheet[open] {
        position:fixed; inset:auto 0 0; width:100%; max-width:none; max-height:min(85dvh,760px); margin:0;
        padding:0 0 env(safe-area-inset-bottom); border:0; border-radius:16px 16px 0 0; background:#fffdf8;
        color:#303b3a; box-shadow:0 -8px 32px rgb(0 0 0 / 15%); overflow:hidden;
    }
    .portal-mobile-sheet::backdrop { background:rgb(17 32 35 / 48%); }
    .portal-mobile-sheet-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 20px; border-bottom:1px solid #ded9cd; }
    .portal-mobile-sheet-header h2 { margin:0; color:#0f4b5a; font-size:1.1rem; }
    .portal-mobile-sheet-header button { display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; background:transparent; color:#0f4b5a; font-size:28px; cursor:pointer; }
    .portal-mobile-sheet-links { display:grid; gap:16px; max-height:calc(min(85dvh,760px) - 74px - env(safe-area-inset-bottom)); padding:8px 20px 28px; overflow-y:auto; overscroll-behavior:contain; }
    .portal-mobile-sheet-links .portal-menu-group { gap:0; }
    .portal-mobile-sheet-links .portal-menu-heading { margin:14px 4px 3px; font-weight:700; }
    .portal-mobile-sheet-links a { display:flex; align-items:center; min-height:44px; padding:8px 12px; border-bottom:1px solid #eee9df; color:#303b3a; text-decoration:none; }
    .portal-mobile-sheet-links a.is-active { color:#0f4b5a; background:#e8f2ef; font-weight:700; }
    .portal-mobile-sheet-links .account-logout { margin:0 0 8px; }
    .portal-page:has(input:focus,textarea:focus,select:focus) .portal-mobile-bar { display:none; }
}
.portal-confirmed-partner-info .button { display:inline-flex; min-height:40px; align-items:center; }
@media(max-width:600px) {
    .portal-confirmed-partner-content { grid-template-columns:minmax(0,1fr); gap:14px; }
    .portal-confirmed-partner-content > img,.portal-confirmed-partner-placeholder { width:112px; height:140px; }
}
.portal-hold-notice { max-width:760px; }
.portal-hold-notice h1 { margin-top:0; }
.portal-hold-notice p { line-height:1.7; }
.portal-hold-allowed { display:flex; flex-wrap:wrap; gap:12px; margin-top:16px; }
.portal-hold-allowed a { color:inherit; text-decoration:underline; }
