.portal { min-width: 280px; }
.profile-account-footer .btn--danger { color: #ffb0b0; border-color: rgba(255,110,110,.35); background: rgba(255,110,110,.08); }
.profile-account-footer .btn--danger:hover { background: rgba(255,110,110,.16); }
.account-devices .panel-heading { align-items: flex-start; gap: 8px; }
.account-devices .panel-heading h2 { flex: 1 1 180px; }
.account-devices .text-button { min-height: 44px; padding: 0 4px; font-size: 12px; }
.devices-policy { margin: 16px 0; color: #c9bfff; line-height: 1.6; }
#account-devices-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#account-devices-list > .empty-state { grid-column: 1/-1; }
#account-devices-list > .btn { grid-column: 1/-1; justify-self: start; }
.account-device { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #101424; }
.account-device-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-device-summary { flex: 1; min-width: 0; }
.account-device-summary strong { display: block; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.account-device-summary p { margin: 2px 0 0; font-size: 12px; line-height: 1.5; }
.account-device-info { min-width: 0; margin-top: 6px; color: var(--text-muted); }
.account-device-metadata { display: grid; gap: 2px; margin: 0; }
.account-device-metadata > div { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; }
.account-device-metadata dt { font-size: 12px; line-height: 1.5; }
.account-device-metadata dt::after { content: ':'; }
.account-device-metadata dd { min-width: 0; margin: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.account-device-info code { font-size: inherit; font-family: inherit; overflow-wrap: anywhere; user-select: all; }
.account-device-info .account-device-agent { margin: 2px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.account-device-fingerprint { display: inline-block; max-width: 100%; margin-top: 4px; padding: 2px 6px; border-radius: 4px; background: rgba(154,163,199,.16); color: #c6cde5; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.portal .account-device .btn--danger, .portal[data-page=account] #confirm-yes { color: #ffb0b0; border: 1px solid rgba(255,110,110,.35); background: rgba(255,110,110,.08); min-height: 44px; flex-shrink: 0; }
.portal .account-device .btn--danger:hover, .portal[data-page=account] #confirm-yes:hover { background: rgba(255,110,110,.16); }
.account-devices .status-line:empty { display: none; }
@media (max-width: 800px) { #account-devices-list { grid-template-columns: minmax(0,1fr); } }
[hidden] { display: none !important; }
.portal-header { min-height: 80px; padding: 18px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.portal-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.portal a { color: var(--accent-2); }
.portal .app-download { color: var(--text); }
.portal .btn--primary, .portal .btn--primary:visited { color: #fff; }
.portal .btn--ghost, .portal .btn--ghost:visited { color: var(--text); }
.portal .header .nav__link { color: var(--text-muted); }
.portal .header .nav__link:hover { color: var(--text); }
.portal .logo { color: var(--text); gap: 8px; }
.account-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(154,163,199,.12); font-size: 13px; }
.account-toolbar:has(#logout[hidden]) { display: none; }
.account-toolbar #session-email { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.account-toolbar #admin-link { font-size: 12px; }
.subscription-notice { display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px; margin: 20px 0; background: rgba(234,180,89,.07); border: 1px solid rgba(234,180,89,.22); border-radius: 12px; color: #e5c28c; font-size: 13px; line-height: 1.65; }
.subscription-notice::before { content: "↻"; font-size: 22px; line-height: 1.2; }
.portal-main { max-width: 1288px; margin: 0 auto; padding: 44px 24px 64px; }
.portal[data-page=account] .portal-main { max-width: 1200px; padding-inline: 20px; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.2; margin-bottom: 14px; }
.eyebrow { color: var(--accent-2); font-size: 11px; letter-spacing: .14em; font-weight: 700; margin-bottom: 12px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; min-width: 0; }
.panel h2 { font-size: 21px; margin-bottom: 18px; }
.panel h3 { font-size: 17px; margin: 18px 0 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-heading h2, .panel-heading h3 { margin: 0; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.auth-panel { max-width: 500px; margin: 36px auto; }
.portal-form { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.portal-form label, .search-form label { display: flex; flex-direction: column; gap: 7px; color: var(--text-muted); font-size: 14px; min-width: 0; }
.portal input, .portal select, .portal textarea { width: 100%; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 12px 14px; color: var(--text); font: inherit; }
.portal input:focus, .portal select:focus, .portal textarea:focus { border-color: var(--accent); }
.portal textarea { resize: vertical; }
.portal .check-label { flex-direction: row; align-items: center; gap: 10px; }
.portal input[type=checkbox], .portal input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; }
.full-width { grid-column: 1 / -1; }
.form-actions, .row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.text-button { background: transparent; border: 0; color: var(--accent-2); font: inherit; cursor: pointer; padding: 8px; }
.status-line { min-height: 24px; font-size: 14px; margin: 12px 0 20px; color: var(--text-muted); overflow-wrap: anywhere; }
.status-line.error { color: #ffb0b0; }
.status-line.success { color: #66dfb3; }
.empty-state { color: var(--text-muted); padding: 22px 0; }
.subscription-panel { background: radial-gradient(ellipse at top right, rgba(124,108,255,.16), transparent 75%), var(--surface); }
.subscription-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 28px 0; }
.subscription-dates dt { font-size: 13px; color: var(--text-muted); }
.subscription-dates dd { font-size: 20px; font-weight: 650; margin-top: 6px; }
.subscription-panel h3 { font-size: 20px; font-weight: 600; }
.connection-steps { list-style: none; counter-reset: connection; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin: 26px 0; }
.connection-steps li { counter-increment: connection; position: relative; min-width: 0; padding-left: 35px; }
.connection-steps li::before { content: '0' counter(connection); position: absolute; top: 0; left: 0; color: #a897ff; font-size: 11px; font-weight: 600; }
.connection-steps span { font-size: 14px; font-weight: 600; }
.connection-steps p { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.connection-footnote { margin-top: 18px; }
.incy-panel h2 { font-size: 26px; letter-spacing: -.025em; }
.badge { border-radius: 999px; background: rgba(124,108,255,.15); color: #cabfff; border: 1px solid rgba(124,108,255,.3); font-size: 12px; padding: 4px 10px; white-space: nowrap; display: inline-block; }
.badge.good { background: rgba(64,210,155,.1); color: #66dfb3; border-color: rgba(64,210,155,.25); }
.badge.bad { background: rgba(255,110,110,.1); color: #ffb0b0; border-color: rgba(255,110,110,.25); }
.subscription-link { font: 12px/1.8 monospace; word-break: break-all; color: var(--text-muted); border: 1px solid var(--border); background: var(--bg); padding: 12px 14px; border-radius: 10px; margin: 14px 0; user-select: all; }
.qr-image { display: block; width: 184px; height: 184px; background: white; padding: 8px; border-radius: 8px; margin-top: 18px; }
.portal-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.portal-plan { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: grid; gap: 9px; cursor: pointer; }
.portal-plan:has(input:checked) { border-color: var(--accent); background: rgba(124,108,255,.1); }
.portal-plan strong { font-size: 22px; }
.portal-plan input { position: absolute; top: 18px; right: 16px; }
#renew-form { max-width: 440px; }
.instructions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0; }
.instructions-grid details { border: 1px solid var(--border); border-radius: 10px; }
.instructions-grid summary { padding: 15px; cursor: pointer; }
.instructions-grid ol { padding: 0 22px 20px 36px; font-size: 14px; color: var(--text-muted); }
.instructions-grid li { margin-bottom: 8px; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 28px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.admin-tabs button { border: 1px solid transparent; background: none; color: var(--text-muted); padding: 11px 15px; border-radius: 9px; font: inherit; font-size: 14px; cursor: pointer; }
.admin-tabs button[aria-current] { color: var(--text); border-color: var(--border); background: var(--surface); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 20px; }
.metric p { color: var(--text-muted); font-size: 13px; margin-bottom: 9px; }
.metric strong { font-size: 25px; }
.metric { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(145deg, #1a2035, var(--surface)); }
.metric::before { content: ''; position: absolute; top: 18px; left: 0; width: 3px; height: 22px; border-radius: 3px; background: #8972ff; opacity: .8; }
.metric strong { font-weight: 650; letter-spacing: -.03em; }
.admin-tabs button { transition: color .15s, background .15s; }
.admin-tabs button:hover { background: #ffffff06; color: var(--text); }
.admin-tabs button[aria-current] { background: #7560ea15; border-color: #8972ff40; color: #c9bfff; }
.portal-table tbody tr:hover { background: rgba(255,255,255,.025); }
.table-wrap { width: 100%; overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.portal-table th { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.portal-table td, .portal-table th { padding: 15px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.portal-table td { max-width: 300px; overflow-wrap: anywhere; }
.operation-error-code { display: block; margin-top: 5px; font-size: 11px; color: var(--text-muted); }
.portal-table th:first-child, .portal-table td:first-child { padding-left: 0; }
.portal-table .btn { font-size: 12px; padding: 7px 10px; white-space: nowrap; }
.search-form { display: flex; gap: 14px; align-items: end; margin: 20px 0; flex-wrap: wrap; }
.search-form label { flex: 1; min-width: 180px; }
.search-form .btn { padding: 12px 20px; }
.portal-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 28px; width: min(900px, calc(100% - 32px)); max-height: 88vh; margin: auto; }
.portal-dialog::backdrop { background: rgba(5,7,14,.8); backdrop-filter: blur(3px); }
.confirm-dialog { max-width: 500px; }
.confirm-dialog p { white-space: pre-line; margin: 20px 0; color: var(--text-muted); overflow-wrap: anywhere; }
.chart-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.chart-summary > strong { font-size: 28px; letter-spacing: -.8px; font-weight: 650; }
.chart-period { color: var(--text-muted); font-size: 12px; }
.chart-visual { position: relative; margin-top: 12px; width: 100%; }
.chart-svg { display: block; width: 100%; height: 230px; overflow: visible; touch-action: pan-y; border-radius: 8px; }
.chart-svg:focus-visible { outline: 2px solid #a897ff; outline-offset: 6px; }
.chart-axis { fill: #8e99bb; font-size: 11px; font-family: inherit; }
.chart-empty { fill: #8e99bb; font-size: 12px; font-family: inherit; }
.chart-tooltip { position: absolute; transform: translateX(-50%); display: grid; gap: 2px; min-width: 122px; max-width: 155px; padding: 10px 13px; background: #242b46; border: 1px solid #465078; border-radius: 10px; pointer-events: none; box-shadow: 0 8px 25px rgba(0,0,0,.25); font-size: 12px; text-align: center; z-index: 2; }
.chart-tooltip span { color: var(--text-muted); font-size: 11px; }
.chart-values { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(154,163,199,.13); font-size: 12px; color: var(--text-muted); }
.chart-values summary { cursor: pointer; width: fit-content; }
.chart-value-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid rgba(154,163,199,.07); }
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.health-item { padding: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.health-item dt { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.grant-result { margin-top: 22px; }
.pagination { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--text-muted); font-size: 13px; }
.account-pagination { justify-content: space-between; gap: 8px; }
.account-pagination-status { text-align: center; font-size: 12px; }
.portal-footer { border-top: 1px solid var(--border); color: var(--text-muted); text-align: center; padding: 24px; font-size: 13px; }
.skip-link { position: fixed; top: -80px; left: 20px; background: var(--surface); color: var(--text); padding: 12px; z-index: 1000; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 960px) { .metrics-grid { grid-template-columns: repeat(2, 1fr); } .account-grid { grid-template-columns: 1fr; gap: 0; } .health-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .portal-header { padding: 18px; flex-direction: column; align-items: start; } .portal-header nav { gap: 12px; } .portal-main { padding: 30px 16px 45px; } .panel { padding: 20px; } .form-grid, .instructions-grid, .health-grid, .connection-steps { grid-template-columns: 1fr; } .portal-form .btn, .search-form .btn { width: 100%; } .metric { padding: 14px; } .metric strong { font-size: 23px; } .admin-tabs { flex-wrap: wrap; gap: 4px; } .admin-tabs button { font-size: 12px; padding: 9px 12px; } .subscription-dates { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 12px; } .subscription-dates dd { font-size: 16px; } .portal-dialog { padding: 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 600px) {
  .portal[data-page=account] .portal-table, .portal[data-page=account] .portal-table tbody { display: block; }
  .portal[data-page=account] .portal-table thead { display: none; }
  .portal[data-page=account] .portal-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
  .portal[data-page=account] .portal-table td { display: block; max-width: none; padding: 0 !important; border: 0; }
  .portal[data-page=account] .portal-table td:first-child, .portal[data-page=account] .portal-table td:last-child { grid-column: 1 / -1; }
  .portal[data-page=account] .portal-table td::before { content: attr(data-label); display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 5px; }
}

/* Page 1 · account and operator workspace. API data owns all amounts and states. */
.portal { --border: #2a304a; --surface: #151a2e; --text-muted: #9aa3c7; --accent: #7560ea; --accent-2: #b9acff; --radius: 24px; font-weight: 400; }
.portal a { color: #b9acff; }
.portal .btn { gap: 8px; border-radius: 12px; font-size: 14px; font-weight: 600; min-height: 48px; }
.portal .btn--primary { background: #7560ea; box-shadow: none; }
.portal .btn--primary:hover { background: #8972ff; }
.portal .btn--ghost { background: #1c2340; border: 1px solid #2a304a; }
.portal img { flex-shrink: 0; }
.portal .btn img, .portal .text-button img { display: inline-block; vertical-align: middle; }
.portal .btn:has(img) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.portal .panel { border-color: #2a304a; border-radius: 24px; box-shadow: none; }
.portal .panel h2 { font-size: 22px; font-weight: 500; line-height: 1.25; }
.portal .panel h3 { font-weight: 500; }
.portal-main .eyebrow { display: flex; gap: 8px; align-items: center; letter-spacing: 0; font-size: 10px; color: #9aa3c7; font-weight: 600; margin-bottom: 20px; }
.portal-main .eyebrow::before { content: ''; display: block; width: 16px; height: 2px; background: #4dd0e1; }
.page-heading h1 { font-weight: 500; line-height: 1.25; letter-spacing: -.025em; }
.portal .status-line:empty { display: none; }
.portal .status-line { font-size: 13px; }
.portal .badge { border: 0; background: #242544; color: #b9acff; padding: 6px 10px; line-height: 1.3; font-size: 12px; font-weight: 500; }
.portal .badge::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.portal .badge.good { color: #66dfb3; background: #142e2d; }
.portal .badge.bad { color: #f39baa; background: #302236; }
.portal .badge.warning { color: #edc087; background: #30283a; }
.portal input, .portal select, .portal textarea { background: #101424; border-color: #2a304a; border-radius: 12px; min-height: 48px; font-size: 14px; }
.portal input[type=radio], .portal input[type=checkbox] { min-height: 0; }
.portal input::placeholder, .portal textarea::placeholder { color: #9aa3c7; opacity: 1; }
.portal .auth-panel { max-width: 520px; padding: 32px; margin: 32px auto 80px; }
.portal .auth-panel h2 { font-size: 30px; }
.portal .auth-panel .muted { font-size: 14px; }
.portal .auth-panel .btn { width: 100%; }
.portal .auth-panel input[name=code] { font-size: 24px; letter-spacing: .35em; }
.portal[data-page=account] .portal-main { max-width: 1440px; padding: 48px 96px 64px; }
.portal[data-page=account] .page-heading { margin-bottom: 32px; }
.account-toolbar { width: 100%; padding: 0; margin-top: 20px; min-height: 44px; border: 0; gap: 20px; font-size: 14px; }
.account-identity { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.account-toolbar #session-email { max-width: none; overflow-wrap: anywhere; white-space: normal; }
.account-toolbar .text-button { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 8px 0; }
.account-toolbar:has(#logout[hidden]) { display: none; }
.portal[data-page=account] #portal-content > .panel { margin-bottom: 32px; }
.portal[data-page=account] .subscription-panel { background: linear-gradient(110deg,#1c2340,#151a2e); border-color: #51477d; padding: 28px; }
.portal .subscription-panel .panel-heading { margin-bottom: 24px; }
.portal .subscription-panel h2 { font-size: 14px; color: #9aa3c7; font-weight: 400; }
.subscription-overview { display: flex; align-items: center; gap: 32px; }
#subscription-summary { flex: 1; display: flex; align-items: center; gap: 32px; min-width: 0; flex-wrap: wrap; }
.subscription-plan { flex: 1; min-width: 160px; }
.subscription-plan h3 { font-size: 32px; margin: 0 0 8px; line-height: 1.25; overflow-wrap: anywhere; }
.subscription-plan p { font-size: 13px; color: #9aa3c7; }
.portal .subscription-dates { display: flex; flex-direction: column; gap: 6px; width: 220px; margin: 0; }
.subscription-dates dt { font-size: 12px; }
.subscription-dates dd { font-size: 16px; font-weight: 400; margin-top: 6px; }
.subscription-remaining { color: #66dfb3; font-size: 14px; }
.subscription-remaining.expired { color: #9aa3c7; }
.subscription-notice { width: 100%; margin: 0; }
.account-layout { display: grid; grid-template-columns: minmax(0,744fr) minmax(0,480fr); gap: 24px; align-items: start; margin-bottom: 32px; }
.account-primary, .account-secondary { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.account-layout .panel { margin: 0; }
.account-layout .panel:last-child { margin-bottom: 0; }
.connection-panel h2 { display: flex; align-items: center; gap: 12px; }
.connection-intro { font-size: 14px; line-height: 1.55; margin-bottom: 24px; }
.connection-import { display: grid; grid-template-columns: minmax(0,1fr) 152px; gap: 24px; align-items: center; }
.connection-copy { min-width: 0; }
.connection-copy > .small { font-size: 12px; }
.portal .subscription-link { font: 13px/1.7 Inter, sans-serif; color: #e8eaf6; background: #101424; border-radius: 12px; padding: 14px; margin: 12px 0; }
.connection-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.connection-qr .btn { font-size: 12px; min-height: 44px; padding: 10px; }
.portal .qr-image { width: 132px; height: 132px; padding: 12px; border-radius: 12px; margin: 0; }
.connection-qr p { font-size: 11px; color: #9aa3c7; text-align: center; }
.connection-guide { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 44px; margin-top: 20px; text-decoration: none; }
.connection-unavailable { border-radius: 16px; background: #101424; padding: 20px; font-size: 14px; }
.connection-unavailable h3 { margin: 0 0 8px; font-size: 17px; }
.connection-unavailable p { color: #9aa3c7; font-size: 13px; }
.portal .incy-panel h2 { font-size: 22px; letter-spacing: 0; margin-bottom: 8px; }
.incy-panel > .muted { font-size: 13px; line-height: 1.55; }
.incy-panel .app-downloads { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.incy-panel .app-download { display: flex; flex-direction: row; gap: 10px; align-items: center; text-align: left; min-height: 72px; padding: 12px; background: #101424; border: 1px solid #2a304a; border-radius: 12px; text-decoration: none; }
.app-download__copy { flex: 1; min-width: 0; }
.incy-panel .app-download__platform { font-size: 14px; font-weight: 400; display: block; color: #e8eaf6; }
.incy-panel .app-download__store { font-size: 11px; display: block; color: #9aa3c7; margin-top: 4px; }
.app-download__action { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: #1c2340; flex-shrink: 0; }
.connection-footnote { display: block; margin-top: 24px; font-size: 12px; }
.connection-footnote img { display: inline-block; width: auto; height: auto; vertical-align: middle; }
#renewal h2 { margin-bottom: 8px; }
.portal-plans { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.portal-plan { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 4px 10px; min-height: 80px; padding: 14px; background: #101424; border-radius: 12px; }
.portal-plan input { position: static; width: 18px; height: 18px; grid-row: 1/3; }
.portal .portal-plan input { appearance: none; padding: 0; border-radius: 50%; border: 1px solid #9aa3c7; background: transparent; cursor: pointer; }
.portal .portal-plan input:checked { border: 0; background: url('/css/icons/page1-portals/radio-selected.svg') center no-repeat; }
.portal .portal-plan input:focus-visible { outline: none; }
.portal-plan:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.portal-plan .plan-name { font-size: 14px; }
.portal-plan .plan-period { font-size: 12px; grid-column: 2; }
.portal-plan .plan-price { font-size: 16px; font-weight: 500; grid-column: 3; grid-row: 1; }
.portal-plan .plan-price-note { font-size: 11px; grid-column: 3; grid-row: 2; text-align: right; }
.portal-plan:has(input:checked) { background: #211d3f; border-color: #8972ff; }
#renew-form { max-width: none; gap: 16px; margin-top: 24px; }
#renew-form > label { font-size: 12px; }
.portal #renew-form .legal-check { font-size: 11px; line-height: 1.55; }
.renew-total { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #2a304a; padding-top: 20px; font-size: 14px; }
.renew-total strong { font-size: 28px; font-weight: 400; }
#renew-description { font-size: 12px; }
.payment-security { display: flex; justify-content: center; align-items: center; gap: 6px; color: #9aa3c7; font-size: 12px; margin: 16px 0; }
#renewal > .small { font-size: 12px; }
.renew-notice { display: flex; gap: 10px; align-items: flex-start; background: #101424; border-radius: 12px; padding: 14px; margin-top: 24px; color: #9aa3c7; font-size: 12px; line-height: 1.55; }
.access-info > img { margin-bottom: 20px; }
.access-info > p { margin: 16px 0 24px; font-size: 14px; color: #9aa3c7; }
.access-info .btn { width: 100%; }
.portal .renewal-dialog { width: min(520px,calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.renewal-dialog > .panel { margin: 0; padding: 0; border: 0; border-radius: 0; }
.renewal-dialog-toolbar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.renewal-dialog-toolbar .text-button { width: 40px; height: 40px; font-size: 28px; line-height: 1; border-radius: 10px; }
.renewal-dialog-toolbar .text-button:hover { background: #292441; }
html:has(#renewal-dialog[open]) { overflow: hidden; }
.account-history { margin-top: 0; }
.account-history h2 { margin-bottom: 8px; }
.account-history .panel-heading { margin-bottom: 24px; }
.history-details, .extra-metrics { font-size: 12px; color: #9aa3c7; margin-top: 20px; }
.history-details summary, .extra-metrics summary { cursor: pointer; }
.support-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #211d3f; border: 1px solid #2a304a; border-radius: 24px; padding: 28px; margin-top: 64px; }
.support-banner h2 { font-size: 26px; font-weight: 500; line-height: 1.25; margin-bottom: 8px; }
.support-banner p { color: #9aa3c7; font-size: 14px; }
.portal[data-page=account] .portal-footer { max-width: 1248px; margin: 0 auto; padding: 24px 0 32px; text-align: left; font-size: 12px; line-height: 2; }
.portal[data-page=admin] .portal-main { position: relative; max-width: 1440px; padding: 32px 32px 64px 288px; min-height: calc(100vh - 160px); }
.portal[data-page=admin] .page-heading { margin-bottom: 24px; }
.portal[data-page=admin] .page-heading .eyebrow { color: #4dd0e1; margin-bottom: 10px; font-weight: 400; }
.portal[data-page=admin] .page-heading h1 { font-size: 36px; margin-bottom: 10px; }
.portal[data-page=admin] .page-heading .muted { font-size: 13px; }
.portal[data-page=admin] .panel { border-radius: 20px; padding: 24px; margin-bottom: 20px; }
.portal[data-page=admin] .panel h2 { font-size: 20px; }
.admin-sidebar { position: absolute; left: 32px; top: 40px; width: 224px; }
.sidebar-label { font-size: 10px; color: #9aa3c7; margin-bottom: 24px; }
.admin-tabs { display: flex; flex-direction: column; gap: 4px; border: 0; padding: 0; margin-bottom: 40px; }
.admin-tabs button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 12px; color: #9aa3c7; border-radius: 12px; font-size: 13px; text-align: left; }
.admin-tabs button img { visibility: hidden; }
.admin-tabs button[aria-current] { border-color: #51477d; background: #211d3f; color: #e8eaf6; }
.admin-tabs button[aria-current] img { visibility: visible; }
.admin-session { background: #101424; border: 1px solid #2a304a; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 13px; overflow-wrap: anywhere; }
.admin-session .badge { font-size: 11px; }
.admin-session .badge::before { display: none; }
.admin-session .btn { width: 100%; min-height: 44px; font-size: 13px; }
.admin-session #admin-link { display: none; }
.admin-mobile-toolbar { display: none; }
.portal[data-page=admin] .portal-main:has(#portal-content[hidden]) { padding-left: 32px; }
.portal[data-page=admin] .portal-main:has(#portal-content[hidden]) .admin-sidebar { display: none; }
.portal[data-page=admin] .portal-main:has(#auth-panel:not([hidden])) > .page-heading, .portal[data-page=admin] .portal-main:has(#mfa-panel:not([hidden])) > .page-heading { max-width: 520px; margin-inline: auto; }
.dashboard-period { min-height: 44px; margin-bottom: 24px; }
.report-period { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid #2a304a; background: #1c2340; border-radius: 12px; font-size: 13px; }
.metrics-grid { gap: 20px; margin-bottom: 24px; }
.metric { border-radius: 16px; background: #151a2e; padding: 20px; }
.metric::before { display: none; }
.metric p { font-size: 12px; margin-bottom: 10px; }
.metric strong { font-size: 28px; font-weight: 500; letter-spacing: 0; line-height: 1.5; }
.metric small { font-size: 11px; display: block; color: #9aa3c7; }
#dashboard-metrics .metric:first-child { background: #211d3f; border-color: #51477d; }
.portal[data-page=admin] .account-grid { gap: 20px; }
.portal[data-page=admin] .account-grid .panel { padding: 24px; }
.portal .chart-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; margin: 0 0 16px; }
.chart-legend { width: 18px; height: 3px; border-radius: 3px; background: #b9acff; }
.chart-legend.cyan { background: #4dd0e1; }
.chart-summary { display: block; }
.chart-summary > strong { font-size: 28px; font-weight: 400; letter-spacing: 0; display: block; line-height: 1.5; }
.chart-period { display: block; font-size: 11px; margin-bottom: 14px; }
.chart-axis { fill: #9aa3c7; font-size: 10px; }
.chart-tooltip { min-width: 80px; max-width: 130px; text-align: left; padding: 7px 10px; font-size: 11px; border-radius: 6px; background: #1c2340; border-color: #51477d; box-shadow: none; }
.chart-tooltip span { font-size: 9px; }
.chart-tooltip strong { font-weight: 400; }
.chart-values { border: 0; padding-top: 0; font-size: 10px; }
.dashboard-footnote { color: #9aa3c7; font-size: 12px; margin: 4px 0 24px; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0,8fr) minmax(0,3fr); gap: 20px; align-items: start; }
.dashboard-bottom .btn { width: 100%; font-size: 13px; min-height: 44px; margin-top: 18px; }
.dashboard-bottom .btn + .btn { margin-top: 12px; }
.dashboard-bottom .panel > .small { margin-bottom: 20px; }
.portal-table { font-size: 13px; }
.portal-table th { font-size: 11px; font-weight: 400; }
.portal-table td, .portal-table th { padding: 18px 12px; border-color: #2a304a; }
.portal-table tbody tr:last-child td { border-bottom: 0; }
.portal-table .badge { font-size: 11px; }
.portal-table .btn { min-height: 36px; }
.portal-table .row-actions { max-width: 260px; }
.portal-table .row-actions .btn { white-space: normal; }
.subscription-actions { display: inline-flex; }
.subscription-actions-trigger { gap: 14px; white-space: nowrap; }
.subscription-actions-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.subscription-actions-trigger[aria-expanded=true] { border-color: #7560ea; background: #292441; }
.subscription-actions-trigger[aria-expanded=true] .subscription-actions-chevron { transform: translateY(2px) rotate(225deg); }
.subscription-action-menu { display: none; position: fixed; inset: auto; margin: 0; width: min(284px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 6px; border: 1px solid #353c5a; border-radius: 16px; background: #191f34; color: #e8eaf6; box-shadow: 0 16px 48px #0006; }
.subscription-action-menu:popover-open { display: block; }
.subscription-action-menu::backdrop { background: transparent; }
.subscription-action-group + .subscription-action-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid #2b324c; }
.subscription-action-heading { margin: 5px 10px 3px; color: #8f9bbb; font-size: 10px; line-height: 1.6; font-weight: 500; letter-spacing: .04em; }
.subscription-action-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #e8eaf6; font: inherit; font-size: 13px; line-height: 1.45; text-align: left; cursor: pointer; }
.subscription-action-item img { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.subscription-action-item:hover, .subscription-action-item:focus-visible { background: #2b3150; outline: none; }
.subscription-action-item:focus-visible { box-shadow: inset 0 0 0 1px #a99aef; }
.subscription-action-item.is-danger { color: #f4a4b7; }
.subscription-action-item.is-danger:hover, .subscription-action-item.is-danger:focus-visible { background: #3a273c; }
.search-form { margin: 24px 0 20px; }
.search-form label { font-size: 12px; }
.search-form input[type=search] { background-image: url('/css/icons/page1-portals/search.svg'); background-repeat: no-repeat; background-position: 14px center; padding-left: 40px; }
.pagination { min-height: 44px; justify-content: flex-end; font-size: 12px; }
.pagination > span { order: -1; margin-right: auto; }
.pagination .btn { min-width: 44px; min-height: 44px; }
.admin-editor-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.admin-editor-layout .form-grid { grid-template-columns: 1fr; }
.admin-editor-layout .full-width { grid-column: auto; }
.preview-panel { background: #211d3f; border-color: #51477d !important; }
.preview-panel > .small { margin-bottom: 20px; }
#grant-preview { font-size: 14px; }
#grant-preview > div { margin: 16px 0; background: #101424; border: 1px solid #2a304a; border-radius: 12px; padding: 14px; }
#grant-preview p { margin: 8px 0; }
.portal[data-page=admin] .portal-footer { max-width: 1440px; margin: 0 auto; padding: 0 32px 40px 288px; text-align: left; font-size: 11px; border: 0; }
.portal-dialog { border-radius: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.plan-admin-card { border: 1px solid #2a304a; background: #151a2e; border-radius: 20px; padding: 24px; }
.plan-admin-card h3 { font-size: 20px; margin: 0 0 20px; }
.plan-admin-card .panel-heading { margin-bottom: 20px; }
.plan-admin-field { background: #101424; border: 1px solid #2a304a; border-radius: 12px; padding: 14px; margin-top: 16px; font-size: 14px; }
.plan-admin-field span { display: block; color: #9aa3c7; font-size: 11px; margin-bottom: 5px; }
.plan-admin-card > p { font-size: 20px; margin: 20px 0 8px; }
.plan-admin-card > .small { color: #9aa3c7; font-size: 12px; margin-bottom: 20px; }
.plan-admin-card .btn { width: 100%; }
.section-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.section-notice { background: #101424; border: 1px solid #2a304a; border-radius: 12px; padding: 16px; margin-bottom: 24px; color: #9aa3c7; font-size: 12px; }
.profile-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 20px; margin: 20px 0; }
.profile-grid > section { min-width: 0; border: 1px solid #2a304a; border-radius: 20px; padding: 24px; background: #101424; }
.profile-grid > section:last-child { background: #211d3f; border-color: #51477d; }
.profile-grid .row-actions { margin-top: 20px; }
.profile-account-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-account-heading h3 { flex: 1; min-width: 0; margin: 0; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.profile-account-heading .badge { flex-shrink: 0; margin-top: 2px; }
.profile-account-meta { display: grid; gap: 12px; margin: 16px 0; }
.profile-account-meta dt { color: var(--text-muted); font-size: 11px; line-height: 1.3; margin-bottom: 4px; }
.profile-account-meta dd { margin: 0; font-size: 14px; line-height: 1.45; }
.profile-note-form { display: grid; gap: 10px; }
.profile-note-form .btn { justify-self: start; }
.profile-notes-list { margin-top: 16px; }
.profile-note { padding: 14px 0; border-top: 1px solid var(--border); }
.profile-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-account-id { display: flex; align-items: center; gap: 10px; }
.profile-account-id code { flex: 1; min-width: 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.profile-account-id .btn { flex-shrink: 0; padding: 8px; min-height: 40px; font-size: 11px; }
.profile-account-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.profile-account-footer .btn { min-height: 44px; }
.profile-subscription-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-subscription-heading h3 { min-width: 0; margin: 0; font-size: 18px; line-height: 1.4; }
.profile-subscription-heading .badge { flex-shrink: 0; margin-top: 2px; }
.profile-subscription .profile-subscription-term { display: grid; gap: 6px; margin: 20px 0; }
.profile-subscription-term strong { font-size: 22px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.profile-subscription-footer { display: flex; justify-content: flex-end; border-top: 1px solid #51477d80; padding-top: 16px; }
.profile-subscription-footer .subscription-actions-trigger { min-height: 44px; padding: 10px 16px; }
.panel-identity dl { display: grid; gap: 16px; margin: 20px 0; }
.panel-identity dt { color: #9aa3c7; font-size: 12px; margin-bottom: 8px; }
.panel-identity dd { display: flex; align-items: center; gap: 12px; margin: 0; }
.panel-identity code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: #e8eaf6; font-size: 13px; }
.panel-identity dd .btn { min-width: 104px; min-height: 40px; padding: 8px; font-size: 12px; }
.portal[data-page=admin] .panel.plans-workspace { background: transparent; border: 0; padding: 0; }
.plans-workspace > .muted { padding: 16px; border: 1px solid #2a304a; border-radius: 12px; background: #101424; margin-bottom: 24px; font-size: 12px; }
.plans-workspace > h2 { display: none; }
.plans-workspace > .portal-form { border: 1px solid #2a304a; border-radius: 20px; padding: 24px; background: #151a2e; }
.plans-workspace > h3 { margin-top: 32px; }
.promo-preview-label { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; color: #9aa3c7; font-size: 12px; }
[data-section=promos] .form-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
[data-section=promos] .form-grid > label:first-child { grid-column: 1/-1; }
#promo-preview { font-size: 14px; }
#promo-preview p { margin-bottom: 20px; }
#promo-preview strong { font-size: 28px; font-weight: 400; }
.portal-footer-brand { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 32px; margin-bottom: 20px; border-bottom: 1px solid #2a304a; }
.portal .portal-brand { display: flex; align-items: center; gap: 9px; color: #e8eaf6; font-size: 18px; text-decoration: none; }
.portal-footer-brand > span { color: #9aa3c7; font-size: 12px; }
.portal-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.portal-footer nav a { color: #9aa3c7; font-size: 12px; text-decoration: none; }
@media (max-width: 1150px) {
  .portal[data-page=account] .portal-main { padding-inline: 40px; }
  .portal[data-page=account] .portal-footer { margin-inline: 40px; }
  .portal[data-page=admin] .portal-main { padding-left: 252px; padding-right: 24px; }
  .admin-sidebar { left: 24px; width: 200px; }
  .portal[data-page=admin] .portal-footer { padding-left: 252px; }
  .connection-import { grid-template-columns: minmax(0,1fr); }
  .subscription-dates { width: 190px; }
  .dashboard-bottom { grid-template-columns: minmax(0,1.8fr) minmax(0,1fr); }
  .portal[data-page=admin] .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .portal[data-page=account] .portal-main { padding: 32px 20px 40px; }
  .portal[data-page=account] .portal-footer { margin-inline: 20px; }
  .account-layout { grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
  .portal[data-page=account] .page-heading { margin-bottom: 24px; }
  .page-heading h1 { font-size: 30px; }
  .portal[data-page=account] #portal-content > .panel { margin-bottom: 24px; }
  .portal[data-page=account] .subscription-panel { padding: 20px; }
  .subscription-overview { flex-direction: column; align-items: stretch; gap: 20px; }
  #subscription-summary { display: block; }
  .subscription-plan { margin-bottom: 20px; }
  .portal .subscription-dates { width: auto; }
  .subscription-notice { margin-top: 20px; }
  .support-banner { margin-top: 40px; padding: 24px 20px; flex-direction: column; align-items: stretch; }
  .support-banner h2 { font-size: 24px; }
  .support-banner p { font-size: 13px; }
  .portal[data-page=admin] .portal-main, .portal[data-page=admin] .portal-main:has(#portal-content[hidden]) { padding: 24px 20px 40px; }
  .admin-sidebar { position: static; width: 100%; margin-bottom: 24px; }
  .sidebar-label, .admin-tabs, .admin-session .muted, .admin-session #admin-link { display: none; }
  .admin-session { border: 0; border-bottom: 1px solid #2a304a; background: none; padding: 0 0 16px; flex-direction: row; align-items: center; gap: 12px; font-size: 11px; border-radius: 0; }
  .admin-session #session-email { flex: 1; }
  .admin-session .badge { font-size: 10px; padding: 5px 8px; }
  .admin-session .btn { width: auto; min-height: 44px; font-size: 11px; padding: 8px; background: none; border: 0; }
  .admin-mobile-toolbar { display: block; margin: 0 0 24px; }
  .admin-mobile-toolbar > span { display: none; }
  .portal[data-page=admin] .portal-main:has(#portal-content[hidden]) .admin-mobile-toolbar { display: none; }
  .portal[data-page=admin] .page-heading h1 { font-size: 30px; }
  .portal[data-page=admin] .portal-footer { padding: 0 20px 24px; }
  .portal[data-page=admin] .account-grid, .dashboard-bottom, .admin-editor-layout, .profile-grid { grid-template-columns: 1fr; gap: 0; }
  .profile-grid { gap: 16px; }
  .admin-editor-layout { gap: 20px; }
  .portal[data-page=admin] .metrics-grid { grid-template-columns: 1fr; gap: 12px; }
  .portal[data-page=admin] .metric { padding: 20px; }
  .dashboard-period { gap: 12px; }
  .portal[data-page=admin] .panel { padding: 20px; }
  .portal .auth-panel { padding: 24px 20px; }
  .portal[data-page=admin] .portal-table, .portal[data-page=admin] .portal-table tbody { display: block; }
  .portal[data-page=admin] .portal-table thead { display: none; }
  .portal[data-page=admin] .portal-table tr { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; border: 1px solid #2a304a; border-radius: 12px; padding: 16px; margin-top: 12px; background: #101424; }
  .portal[data-page=admin] .portal-table td { padding: 0; border: 0; max-width: none; font-size: 12px; }
  .portal[data-page=admin] .portal-table td::before { content: attr(data-label) ': '; color: #9aa3c7; font-size: 11px; }
  .portal[data-page=admin] .portal-table td:first-child::before, .portal[data-page=admin] .portal-table td:last-child::before { display: none; }
  .portal[data-page=admin] .portal-table td > .btn { white-space: normal; text-align: left; }
  .plan-cards { grid-template-columns: 1fr; }
  [data-section=promos] .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .profile-account-heading { flex-wrap: wrap; }
  .profile-account-heading h3 { flex: 1 1 180px; }
  .profile-account-footer .btn { width: 100%; }
  .profile-grid > section { padding: 20px; }
  .profile-subscription-heading { flex-wrap: wrap; align-items: center; }
  .profile-subscription-heading h3 { flex: 1 1 180px; }
  .profile-subscription-footer .subscription-actions, .profile-subscription-footer .subscription-actions-trigger { width: 100%; }
  .profile-subscription-footer .subscription-actions-trigger { justify-content: space-between; }
  .portal .panel { padding: 20px; }
  .connection-import { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .connection-copy .btn { width: 100%; }
  .incy-panel .app-downloads { grid-template-columns: 1fr; gap: 10px; }
  .account-toolbar { gap: 10px; font-size: 12px; }
  .account-toolbar #admin-link { font-size: 10px; }
  .portal .account-history .panel-heading { gap: 8px; }
  .portal[data-page=account] .portal-table tr { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 16px; margin-top: 12px; background: #101424; border: 1px solid #2a304a; border-radius: 12px; }
  .portal[data-page=account] .portal-table td:first-child, .portal[data-page=account] .portal-table td:last-child { grid-column: auto; }
  .portal[data-page=account] .portal-table td::before { display: none; }
  .portal[data-page=account] .portal-table td:last-child { order: -1; justify-self: end; }
  .portal-plan { padding: 14px 12px; }
  .portal-plan .plan-price { font-size: 14px; }
  .portal-plan .plan-name { font-size: 13px; }
}
