:root {
    --portal-bg: #071013;
    --portal-surface: #0b171b;
    --portal-surface-raised: #101f24;
    --portal-surface-hover: #14272d;
    --portal-border: rgba(126, 168, 177, 0.2);
    --portal-border-strong: rgba(34, 211, 238, 0.36);
    --portal-text: #edf7f8;
    --portal-muted: #93aeb4;
    --portal-subtle: #6e8b92;
    --portal-cyan: #22d3ee;
    --portal-cyan-soft: #9cecf5;
    --portal-blue: #60a5fa;
    --portal-green: #71e2b0;
    --portal-amber: #f8c777;
    --portal-red: #fb8f8f;
    --portal-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid rgba(34, 211, 238, 0.55); outline-offset: 3px; }
a { color: inherit; }
.modal-open { overflow: hidden; }

.portal-shell { min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(19, 74, 83, 0.34), transparent 34%), var(--portal-bg); }

.portal-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 12px clamp(18px, 4vw, 48px); border-bottom: 1px solid var(--portal-border); background: rgba(7, 16, 19, 0.92); backdrop-filter: blur(18px); }
.portal-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--portal-text); text-decoration: none; }
.portal-brand-mark { display: grid; place-items: center; width: 48px; height: 40px; overflow: hidden; border: 1px solid rgba(34, 211, 238, 0.28); border-radius: 10px; background: #0a181c; box-shadow: 0 0 24px rgba(34, 211, 238, 0.1); }
.portal-brand-mark img { width: 44px; height: auto; object-fit: contain; }
.portal-brand-copy { display: grid; gap: 1px; }
.portal-brand-copy strong { font-size: 0.94rem; letter-spacing: -0.01em; }
.portal-brand-copy span { color: var(--portal-muted); font-size: 0.77rem; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.demo-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(248, 199, 119, 0.25); border-radius: 999px; color: var(--portal-amber); background: rgba(248, 199, 119, 0.08); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--portal-amber); box-shadow: 0 0 10px rgba(248, 199, 119, 0.7); }
.account-menu { position: relative; }
.account-trigger { display: inline-flex; align-items: center; gap: 10px; padding: 5px 7px 5px 5px; border: 1px solid transparent; border-radius: 12px; color: var(--portal-text); background: transparent; text-align: left; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: var(--portal-border); background: var(--portal-surface); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #06252b; background: linear-gradient(145deg, #9cecf5, #22d3ee); font-size: 0.72rem; font-weight: 800; }
.account-copy { display: grid; gap: 0; }
.account-copy strong { font-size: 0.82rem; }
.account-copy small { color: var(--portal-muted); font-size: 0.72rem; }
.chevron { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.account-dropdown { position: absolute; top: calc(100% + 10px); right: 0; display: grid; min-width: 205px; padding: 6px; border: 1px solid var(--portal-border); border-radius: 13px; background: #0d1c20; box-shadow: var(--portal-shadow); }
.account-dropdown[hidden] { display: none; }
.account-dropdown button { padding: 10px 11px; border: 0; border-radius: 8px; color: var(--portal-muted); background: transparent; text-align: left; }
.account-dropdown button:hover { color: var(--portal-text); background: var(--portal-surface-hover); }
.account-dropdown .dropdown-danger:hover { color: var(--portal-red); }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--portal-border); border-radius: 10px; color: var(--portal-muted); background: transparent; }
.icon-button:hover { color: var(--portal-text); border-color: var(--portal-border-strong); background: var(--portal-surface-hover); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.mobile-menu-toggle { display: none; }

.portal-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.portal-sidebar { border-right: 1px solid var(--portal-border); background: rgba(6, 15, 18, 0.5); }
.sidebar-inner { position: sticky; top: 76px; display: flex; flex-direction: column; min-height: calc(100vh - 76px); padding: 28px 14px 22px; }
.sidebar-heading { padding: 0 13px 12px; color: var(--portal-subtle); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.portal-nav { display: grid; gap: 4px; }
.portal-nav-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; border: 1px solid transparent; border-radius: 10px; color: var(--portal-muted); background: transparent; text-align: left; transition: 160ms ease; }
.portal-nav-link svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.portal-nav-link:hover { color: var(--portal-text); background: var(--portal-surface); }
.portal-nav-link.is-active { border-color: rgba(34, 211, 238, 0.18); color: var(--portal-cyan-soft); background: rgba(34, 211, 238, 0.1); }
.nav-count { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: auto; border-radius: 999px; color: #08272d; background: var(--portal-cyan); font-size: 0.68rem; font-weight: 800; }
.nav-count.muted { color: var(--portal-muted); background: var(--portal-surface-raised); }
.sidebar-spacer { flex: 1; min-height: 40px; }
.sidebar-help { padding: 16px; border: 1px solid var(--portal-border); border-radius: 14px; background: linear-gradient(145deg, rgba(20, 49, 55, 0.65), rgba(10, 25, 29, 0.7)); }
.help-icon { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 13px; border-radius: 9px; color: var(--portal-cyan); background: rgba(34, 211, 238, 0.12); }
.help-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.sidebar-help strong { display: block; font-size: 0.84rem; }
.sidebar-help p { margin: 4px 0 11px; color: var(--portal-muted); font-size: 0.76rem; }
.sidebar-help-link { padding: 0; border: 0; color: var(--portal-cyan); background: transparent; font-size: 0.76rem; font-weight: 800; }
.sidebar-help-link:hover { color: var(--portal-cyan-soft); }

.portal-main { width: 100%; max-width: 1500px; margin: 0 auto; padding: clamp(26px, 4vw, 58px) clamp(18px, 4vw, 64px) 24px; }
.demo-notice { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 11px 14px; border: 1px solid rgba(248, 199, 119, 0.23); border-radius: 10px; color: #e8c98e; background: rgba(248, 199, 119, 0.07); font-size: 0.78rem; }
.demo-notice svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.demo-notice strong { color: var(--portal-amber); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--portal-cyan); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.eyebrow::before { display: inline-block; width: 21px; height: 2px; margin: 0 8px 3px 0; border-radius: 2px; background: currentColor; content: ""; vertical-align: middle; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.35rem); letter-spacing: -0.05em; line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -0.025em; }
.page-intro { max-width: 640px; margin-bottom: 0; color: var(--portal-muted); font-size: 1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; transition: 160ms ease; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.button-primary { color: #03252b; background: linear-gradient(135deg, #a4f2f6, #22d3ee); box-shadow: 0 9px 24px rgba(34, 211, 238, 0.14); }
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(34, 211, 238, 0.22); }
.button-secondary { border-color: var(--portal-border); color: var(--portal-text); background: rgba(14, 31, 36, 0.7); }
.button-secondary:hover { border-color: var(--portal-border-strong); background: var(--portal-surface-hover); }
.button-danger { color: #fff4f4; background: #8d353b; }
.button-danger:hover { background: #aa4249; }
.button-full { width: 100%; }

.security-note { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; padding: 12px 14px; border: 1px solid rgba(113, 226, 176, 0.19); border-radius: 10px; color: #b8d9ce; background: rgba(113, 226, 176, 0.06); font-size: 0.8rem; }
.security-note strong { color: var(--portal-green); }
.security-icon { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; color: var(--portal-green); background: rgba(113, 226, 176, 0.11); }
.security-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.security-label { margin-left: auto; color: var(--portal-green); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: flex-start; gap: 13px; min-height: 112px; padding: 18px; border: 1px solid var(--portal-border); border-radius: 14px; background: rgba(11, 23, 27, 0.78); }
.stat-card-accent { border-color: rgba(34, 211, 238, 0.32); background: linear-gradient(145deg, rgba(14, 44, 50, 0.68), rgba(11, 23, 27, 0.78)); }
.stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; color: var(--portal-cyan); background: rgba(34, 211, 238, 0.11); }
.stat-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.stat-label, .stat-detail { display: block; color: var(--portal-muted); font-size: 0.76rem; }
.stat-value { display: block; margin: 2px 0; font-size: 1.43rem; letter-spacing: -0.03em; }
.stat-detail { color: var(--portal-subtle); font-size: 0.7rem; }

.portal-content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr); align-items: start; gap: 20px; }
.main-column, .side-column { display: grid; gap: 20px; }
.panel { border: 1px solid var(--portal-border); border-radius: 15px; background: rgba(11, 23, 27, 0.8); box-shadow: 0 12px 35px rgba(0, 0, 0, 0.09); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 22px 22px 18px; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.text-button, .icon-text-button { padding: 3px 0; border: 0; color: var(--portal-cyan); background: transparent; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.text-button:hover, .icon-text-button:hover { color: var(--portal-cyan-soft); }
.contract-list { border-top: 1px solid var(--portal-border); }
.contract-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 15px 22px; border-bottom: 1px solid var(--portal-border); }
.contract-row:last-child { border-bottom: 0; }
.contract-row:hover { background: rgba(20, 39, 45, 0.5); }
.contract-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.contract-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.contract-mark-cyan { color: var(--portal-cyan); background: rgba(34, 211, 238, 0.11); }
.contract-mark-blue { color: var(--portal-blue); background: rgba(96, 165, 250, 0.11); }
.contract-mark-gray { color: var(--portal-subtle); background: rgba(147, 174, 180, 0.09); }
.contract-copy { display: grid; gap: 2px; min-width: 0; }
.contract-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; }
.contract-copy span { color: var(--portal-muted); font-size: 0.73rem; }
.status-chip { display: inline-flex; align-items: center; justify-content: center; width: max-content; padding: 4px 8px; border-radius: 999px; font-size: 0.66rem; font-weight: 800; white-space: nowrap; }
.status-active, .status-paid { color: var(--portal-green); background: rgba(113, 226, 176, 0.11); }
.status-open { color: var(--portal-amber); background: rgba(248, 199, 119, 0.1); }
.status-ended { color: var(--portal-subtle); background: rgba(147, 174, 180, 0.1); }
.row-action { padding: 4px 0; border: 0; color: var(--portal-cyan); background: transparent; font-size: 0.7rem; font-weight: 800; white-space: nowrap; }
.row-action:hover { color: var(--portal-cyan-soft); }
.row-action-muted { color: var(--portal-muted); }
.row-action-muted:hover { color: var(--portal-text); }
.contract-row.is-requested .row-action { color: var(--portal-muted); pointer-events: none; }
.contract-row.is-requested .status-chip { color: var(--portal-amber); background: rgba(248, 199, 119, 0.1); }
.contract-row.is-requested .status-chip::after { content: ""; }
.invoice-table-wrap { overflow-x: auto; border-top: 1px solid var(--portal-border); }
.invoice-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.78rem; }
.invoice-table th { padding: 11px 22px; color: var(--portal-subtle); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
.invoice-table td { padding: 14px 22px; border-top: 1px solid var(--portal-border); color: var(--portal-muted); vertical-align: middle; }
.invoice-table td:first-child { color: var(--portal-text); }
.invoice-table td strong, .invoice-table td span { display: block; }
.invoice-table td span { margin-top: 2px; color: var(--portal-subtle); font-size: 0.7rem; }
.invoice-table td:nth-child(3) { color: var(--portal-text); font-weight: 700; }
.invoice-table td:nth-child(4) span { display: inline-flex; }
.invoice-table td:last-child { text-align: right; }
.icon-text-button { color: var(--portal-muted); }
.icon-text-button span { display: inline; margin: 0; color: inherit; font-size: inherit; }
.detail-list { display: grid; gap: 0; margin: 0 22px 18px; }
.detail-list div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--portal-border); }
.detail-list dt { color: var(--portal-subtle); font-size: 0.72rem; }
.detail-list dd { margin: 0; color: var(--portal-text); font-size: 0.78rem; font-weight: 650; overflow-wrap: anywhere; }
.profile-sync-status { min-height: 18px; margin: -9px 22px 9px; color: var(--portal-subtle); font-size: 0.68rem; }
.profile-sync-status[data-state="error"] { color: var(--portal-amber); }
.profile-address { white-space: pre-line; }
.panel > .button-full { width: calc(100% - 44px); margin: 0 22px 22px; }
.mini-lock { color: var(--portal-green); }
.mini-lock svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.payment-method { display: flex; align-items: center; gap: 10px; margin: 0 22px 14px; padding: 12px; border: 1px solid var(--portal-border); border-radius: 10px; background: var(--portal-surface); }
.payment-symbol { display: grid; place-items: center; width: 38px; height: 30px; border-radius: 6px; color: #c6eef3; background: #16434b; font-size: 0.56rem; font-weight: 900; letter-spacing: 0.05em; }
.payment-method > div { display: grid; gap: 1px; min-width: 0; }
.payment-method strong { font-size: 0.78rem; }
.payment-method div span { color: var(--portal-muted); font-size: 0.7rem; }
.payment-method .status-chip { margin-left: auto; }
.panel-note { margin: 0 22px 16px; color: var(--portal-muted); font-size: 0.72rem; }
.payment-panel > .text-button { margin: 0 22px 22px; }
.next-step-card { padding: 22px; border: 1px solid rgba(34, 211, 238, 0.28); border-radius: 15px; background: linear-gradient(145deg, rgba(14, 50, 57, 0.82), rgba(9, 27, 32, 0.9)); }
.next-step-kicker { display: block; margin-bottom: 10px; color: var(--portal-cyan); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.next-step-card h2 { max-width: 240px; margin-bottom: 8px; font-size: 1.33rem; }
.next-step-card p { margin-bottom: 18px; color: var(--portal-muted); font-size: 0.78rem; }
.portal-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding: 22px 0 4px; border-top: 1px solid var(--portal-border); color: var(--portal-subtle); font-size: 0.72rem; }
.portal-footer span:last-child { display: flex; gap: 18px; }
.portal-footer a { color: var(--portal-muted); text-decoration: none; }
.portal-footer a:hover { color: var(--portal-text); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(2, 9, 11, 0.75); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(100%, 500px); padding: 30px; border: 1px solid var(--portal-border-strong); border-radius: 18px; background: #0b1b20; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42); }
.modal-close { position: absolute; top: 18px; right: 18px; }
.modal-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border-radius: 12px; color: var(--portal-amber); background: rgba(248, 199, 119, 0.1); }
.modal-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.modal-icon-cyan { color: var(--portal-cyan); background: rgba(34, 211, 238, 0.1); }
.modal h2 { margin-bottom: 9px; font-size: 1.6rem; letter-spacing: -0.04em; }
.modal > p:not(.eyebrow) { color: var(--portal-muted); }
.modal-callout { margin: 18px 0; padding: 12px 14px; border-left: 3px solid var(--portal-amber); border-radius: 7px; color: #ead3a8; background: rgba(248, 199, 119, 0.08); font-size: 0.79rem; }
.modal-callout strong { color: var(--portal-amber); }
.modal form { display: grid; gap: 9px; }
.modal label:not(.checkbox-label) { color: var(--portal-muted); font-size: 0.76rem; font-weight: 700; }
.modal textarea { width: 100%; resize: vertical; min-height: 82px; padding: 10px 11px; border: 1px solid var(--portal-border); border-radius: 8px; outline: 0; color: var(--portal-text); background: var(--portal-surface); }
.modal textarea::placeholder { color: var(--portal-subtle); }
.modal textarea:focus { border-color: var(--portal-cyan); }
.profile-modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.profile-modal > p:not(.eyebrow) { margin-bottom: 16px; }
.profile-modal form { display: grid; gap: 18px; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-form-field { display: grid; gap: 6px; min-width: 0; }
.profile-form-field-wide { grid-column: 1 / -1; }
.profile-form-field label, .profile-address-fieldset legend { color: var(--portal-muted); font-size: 0.76rem; font-weight: 700; }
.profile-form-field label span { color: var(--portal-cyan); }
.profile-form-field input, .profile-form-field select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--portal-border); border-radius: 8px; outline: 0; color: var(--portal-text); background: var(--portal-surface); font: inherit; font-size: 0.82rem; }
.profile-form-field select { cursor: pointer; }
.profile-form-field input:focus, .profile-form-field select:focus { border-color: var(--portal-cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12); }
.profile-form-field input:invalid:not(:placeholder-shown), .profile-form-field select:invalid { border-color: var(--portal-amber); }
.profile-address-fieldset { display: grid; gap: 11px; margin: 0; padding: 14px; border: 1px solid var(--portal-border); border-radius: 10px; }
.profile-address-fieldset legend { padding: 0 5px; }
.form-message { min-height: 19px; margin: 0; font-size: 0.78rem; }
.form-message[data-state="error"] { color: var(--portal-amber); }
.form-message[data-state="success"] { color: var(--portal-green); }
.checkbox-label { display: flex; align-items: flex-start; gap: 9px; margin-top: 5px; color: var(--portal-muted); font-size: 0.76rem; }
.checkbox-label input { flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--portal-cyan); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: grid; gap: 9px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 13px 15px; border: 1px solid rgba(113, 226, 176, 0.28); border-radius: 11px; color: #d9f4e9; background: #102a27; box-shadow: var(--portal-shadow); font-size: 0.8rem; animation: toast-in 180ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1120px) {
    .portal-content-grid { grid-template-columns: minmax(0, 1fr); }
    .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .next-step-card { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .portal-layout { display: block; }
    .portal-sidebar { position: fixed; inset: 76px auto 0 0; z-index: 30; width: min(280px, 86vw); transform: translateX(-102%); transition: transform 180ms ease; box-shadow: 24px 0 60px rgba(0, 0, 0, 0.28); }
    .portal-sidebar.is-open { transform: translateX(0); }
    .sidebar-inner { min-height: calc(100vh - 76px); }
    .mobile-menu-toggle { display: inline-grid; }
    .portal-main { max-width: none; }
}

@media (max-width: 680px) {
    .profile-form-grid { grid-template-columns: 1fr; }
    .profile-form-field-wide { grid-column: auto; }
    .portal-topbar { min-height: 68px; padding: 10px 14px; }
    .portal-brand-copy strong { font-size: 0.83rem; }
    .portal-brand-copy span { font-size: 0.7rem; }
    .portal-brand-mark { width: 42px; height: 36px; }
    .portal-brand-mark img { width: 38px; }
    .topbar-actions { gap: 8px; }
    .demo-badge { padding: 6px 8px; font-size: 0.68rem; }
    .account-copy, .chevron { display: none; }
    .account-trigger { padding-right: 0; }
    .portal-main { padding: 20px 13px 18px; }
    .demo-notice { align-items: flex-start; margin-bottom: 21px; font-size: 0.74rem; }
    .page-heading { display: block; margin-bottom: 21px; }
    .page-heading .button { width: 100%; margin-top: 17px; }
    h1 { font-size: 2.25rem; }
    .page-intro { font-size: 0.9rem; }
    .security-note { align-items: flex-start; font-size: 0.74rem; }
    .security-label { display: none; }
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { min-height: 0; padding: 14px; }
    .portal-content-grid { gap: 14px; }
    .main-column, .side-column { gap: 14px; }
    .side-column { grid-template-columns: 1fr; }
    .next-step-card { grid-column: auto; }
    .panel-heading { padding: 18px 16px 15px; }
    .contract-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; padding: 13px 16px; }
    .contract-row .status-chip { grid-column: 2; justify-self: start; }
    .contract-row .row-action { grid-column: 3; grid-row: 1 / span 2; align-self: center; white-space: normal; text-align: right; }
    .contract-copy strong { font-size: 0.78rem; }
    .contract-copy span { font-size: 0.68rem; }
    .invoice-table th, .invoice-table td { padding-right: 16px; padding-left: 16px; }
    .detail-list { margin-right: 16px; margin-left: 16px; }
    .panel > .button-full { width: calc(100% - 32px); margin-right: 16px; margin-left: 16px; }
    .payment-method, .panel-note { margin-right: 16px; margin-left: 16px; }
    .payment-panel > .text-button { margin-right: 16px; margin-left: 16px; }
    .next-step-card { padding: 19px; }
    .portal-footer { display: grid; gap: 8px; margin-top: 22px; }
    .modal { padding: 25px 19px 20px; }
    .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .modal-actions .button { width: 100%; padding-right: 9px; padding-left: 9px; }
}
