html, body { margin: 0; min-height: 100%; background: #f5f7fb; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: #5e4ed1; }
.portal-boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.portal-logo { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.portal-logo span { background: #7565df; border-radius: 11px; padding: 9px; font-size: 13px; color: white; letter-spacing: 0; }
.portal-logo b { font-size: 10px; letter-spacing: .05em; border: 1px solid #85849c66; padding: 2px 5px; border-radius: 4px; }
.portal-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(330px, .9fr) minmax(420px, 1.1fr); }
.portal-auth__story { background: radial-gradient(ellipse at 20% 40%, #45347b 0%, #221e3b 55%, #171629 100%); color: #fff; padding: 48px 10%; display: flex; flex-direction: column; justify-content: space-between; gap: 60px; }
.portal-auth__story h1 { font-size: clamp(30px, 3vw, 48px); line-height: 1.18; font-weight: 600; letter-spacing: -.04em; margin: 24px 0; }
.portal-auth__story p:not(.portal-kicker) { color: #c1bdd8; font-size: 16px; max-width: 380px; }
.portal-auth__story small { color: #9e98b5; }
.portal-auth__features { display: grid; gap: 16px; border-top: 1px solid #ffffff22; padding-top: 25px; margin-top: 45px; font-size: 13px; color: #c7c1de; }
.portal-auth__main { display: grid; align-items: center; justify-items: center; padding: 40px; background: #fafbfe; }
.portal-auth__card { width: 100%; max-width: 440px; }
.portal-auth__card h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.035em; margin: 12px 0 18px; }
.portal-auth__card > p { font-size: 14px; color: #687388; }
.portal-kicker { font-size: 10px !important; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; color: #8e80d8 !important; }
.portal-form { display: grid; gap: 18px; margin: 24px 0; }
.portal-form label, .portal-enrollment label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.portal-form input:not([type=checkbox]), .portal-form select, .portal-form textarea, .portal-enrollment input { width: 100%; min-width: 0; }
.portal-form textarea { min-height: 110px; resize: vertical; }
.portal-form input:focus, .portal-form select:focus, .portal-form textarea:focus { border-color: #7565df; outline: 2px solid #7565df22; }
.portal-form .ops-button { min-height: 44px; justify-content: center; }
.portal-text-button { background: none; border: none; color: #6457d9; padding: 8px 0; font-size: 13px; text-align: left; }
.portal-auth__help { border-top: 1px solid #e5e9f1; padding-top: 22px; margin-top: 30px; font-size: 12px !important; }
.portal-steps { padding-left: 20px; font-size: 13px; color: #627085; display: grid; gap: 10px; }
.portal-enrollment { display: grid; justify-items: center; padding: 16px; border: 1px solid #e0e4ee; border-radius: 12px; background: white; }
.portal-enrollment details { width: 100%; font-size: 12px; overflow-wrap: anywhere; }
.portal-enrollment summary { text-align: center; color: #6457d9; padding: 8px 0; }
.portal-enrollment input { font-family: ui-monospace, monospace; font-size: 12px; }
.portal-recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: white; border: 1px solid #e0e4ee; padding: 20px; border-radius: 12px; margin: 20px 0; }
.portal-recovery code { text-align: center; letter-spacing: .1em; font-size: 14px; }
.portal-form .portal-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.portal-check input { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px; accent-color: #6457d9; }
.portal-notice { background: #eef3ff; border: 1px solid #d7e3ff; color: #354e77; border-radius: 10px; padding: 14px 16px; font-size: 13px; overflow-wrap: anywhere; }
.portal-notice--error { background: #fff1f3; border-color: #f5cbd2; color: #96394d; }
.portal-notice button { display: block; margin-top: 8px; background: none; border: 0; text-decoration: underline; color: inherit; }
.portal-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.portal-sidebar { position: sticky; top: 0; height: 100vh; background: #211e36; color: #efedf7; padding: 26px 16px 16px; display: flex; flex-direction: column; }
.portal-sidebar > .portal-logo { padding: 0 6px 26px; }
.portal-sidebar nav { flex: 1; overflow: auto; }
.portal-sidebar nav section { margin-bottom: 18px; }
.portal-sidebar nav p { color: #8c86a5; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding: 0 13px; margin: 15px 0 6px; }
.portal-sidebar nav a { display: block; padding: 9px 13px; border-radius: 7px; color: #c6c1d8; text-decoration: none; font-size: 13px; margin-bottom: 2px; }
.portal-sidebar nav a:hover { color: white; background: #ffffff0a; }
.portal-sidebar nav a.active { color: white; background: #6d5ed8; font-weight: 600; }
.portal-sidebar footer { border-top: 1px solid #ffffff15; padding: 16px 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-sidebar footer a { color: #efedf7; text-decoration: none; min-width: 0; }
.portal-sidebar footer strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.portal-sidebar footer small { color: #9991b3; font-size: 10px; }
.portal-sidebar footer button { background: none; border: none; padding: 4px 0; color: #bcb6d0; font-size: 11px; }
.portal-workspace { min-width: 0; padding: 30px; }
.portal-mobile, .portal-backdrop { display: none; }
.portal-page > h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.035em; margin: 10px 0 24px; }
.portal-page > p { color: #748095; font-size: 13px; }
.portal-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.portal-card { background: white; border: 1px solid #e5e9f1; border-radius: 13px; padding: 24px; min-width: 0; }
.portal-card h2 { margin: 0 0 12px; font-size: 17px; }
.portal-card p { color: #748095; font-size: 13px; }
.portal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.portal-actions > label { display: grid; gap: 7px; min-width: 0; max-width: 100%; font-size: 13px; }
.portal-actions > label select { width: 100%; }
.portal-page :is(h1,h2) { overflow-wrap: anywhere; }
.portal-actions select, .portal-filters input, .portal-filters select { min-width: 0; max-width: 100%; }
.portal-filters { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin: 24px 0; padding: 18px; border: 1px solid #e5e9f1; border-radius: 12px; background: white; }
.portal-filters label { display: grid; gap: 6px; font-size: 12px; min-width: 130px; }
.portal-filters details { width: 100%; font-size: 12px; }
.portal-pager { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin: 18px 0; font-size: 12px; color: #748095; }
.portal-pager span { margin-right: auto; }
.portal-registry { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; }
.portal-registry > a { background: white; border: 1px solid #e5e9f1; border-radius: 12px; padding: 22px; text-decoration: none; display: grid; gap: 14px; transition: border-color .15s; }
.portal-registry > a:hover { border-color: #7565df; }
.portal-registry small { font-size: 10px; color: #8c95a7; text-transform: uppercase; letter-spacing: .1em; }
.portal-registry strong { font-size: 15px; color: #172033; }
.portal-registry span { font-size: 12px; }
.portal-record { margin: 16px 0; }
.portal-record > div { display: grid; grid-template-columns: 190px minmax(0,1fr); padding: 13px 0; border-bottom: 1px solid #f0f2f7; gap: 20px; }
.portal-record dt { color: #748095; font-size: 12px; }
.portal-record dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.portal-table-wrap { overflow-x: auto; background: white; border: 1px solid #e5e9f1; border-radius: 12px; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.portal-table th { text-align: left; background: #f9fafc; padding: 13px; font-size: 10px; font-weight: 600; color: #748095; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.portal-table td { border-top: 1px solid #edf0f5; padding: 12px 13px; max-width: 230px; overflow-wrap: anywhere; vertical-align: top; }
.portal-table td > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.portal-editor { border: 0; padding: 0; display: grid; gap: 22px; min-width: 0; }
.portal-permissions, .portal-role-picker { border: 1px solid #e5e9f1; padding: 15px; border-radius: 10px; margin: 0; min-width: 0; }
.portal-permissions legend, .portal-role-picker legend { font-size: 13px; padding: 0 5px; }
.portal-permissions > div { max-height: 300px; overflow: auto; display: grid; gap: 12px; padding: 14px 0 0; }
.portal-permissions small { display: block; font-size: 10px; color: #8c95a7; overflow-wrap: anywhere; }
.portal-role-picker { display: flex; flex-wrap: wrap; gap: 18px; }
.portal-check { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; }
.portal-metrics { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 16px; margin-bottom: 24px; }
.portal-metrics article { border: 1px solid #e5e9f1; border-radius: 12px; background: white; padding: 20px; }
.portal-metrics span { display: block; color: #748095; font-size: 12px; }
.portal-metrics strong { display: block; font-size: 26px; margin-top: 10px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.portal-queue { display: grid; gap: 18px; }
.portal-queue article { border: 1px solid #e5e9f1; border-radius: 12px; background: white; padding: 22px; }
.portal-queue article > p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.portal-queue dl { display: flex; flex-wrap: wrap; gap: 22px; font-size: 11px; }
.portal-queue dt { color: #748095; margin-bottom: 5px; }
.portal-queue dd { margin: 0; overflow-wrap: anywhere; }
.portal-overdue { color: #be4560; }
.portal-chat { display: grid; gap: 16px; margin-top: 24px; }
.portal-chat article { background: white; border: 1px solid #e5e9f1; border-left: 3px solid #c5cee0; padding: 20px; border-radius: 10px; }
.portal-chat article.portal-chat__moderator { border-left-color: #7565df; background: #faf9ff; }
.portal-chat header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.portal-chat small, .portal-chat__status { color: #748095; font-size: 11px; }
.portal-chat p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.portal-attachment { border-top: 1px solid #edf0f5; display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 12px; padding-top: 10px; }
.portal-status { min-height: 65vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 20px; }
.portal-status > p { font-size: 64px; letter-spacing: -.05em; color: #b8b1de; margin: 0; }
.portal-status h1 { margin: 0; font-size: 28px; }
.portal-status span { font-size: 14px; color: #748095; max-width: 420px; }
.portal-layout .ops-toolbar { position: static; margin: -30px -30px 24px; padding: 18px 30px; grid-template-columns: minmax(100px,1fr) minmax(220px,auto); }
.portal-layout .ops-toolbar .ops-brand, .portal-layout .ops-toolbar__links { display: none; }
.portal-layout .ops-content { padding: 0; }
@media (max-width: 1100px) { .portal-grid { grid-template-columns: 1fr; } .portal-workspace { padding: 24px; } .portal-layout .ops-toolbar { margin: -24px -24px 24px; padding: 16px 24px; } }
@media (max-width: 800px) {
  .portal-auth { grid-template-columns: 1fr; }
  .portal-auth__story { padding: 22px; gap: 0; }
  .portal-auth__story > div, .portal-auth__story > small { display: none; }
  .portal-auth__main { padding: 32px 22px; align-items: start; }
  .portal-layout { display: block; }
  .portal-mobile { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #211e36; color: white; font-size: 12px; }
  .portal-mobile a, .portal-mobile button { color: white; text-decoration: none; border: none; background: none; padding: 5px 0; }
  .portal-sidebar { display: none; position: fixed; top: 58px; left: 0; bottom: 0; width: 260px; height: calc(100dvh - 58px); z-index: 45; }
  .portal-sidebar.is-open { display: flex; }
  .portal-backdrop { display: block; position: fixed; inset: 58px 0 0; z-index: 40; border: 0; background: #17162977; }
  .portal-workspace { padding: 18px 14px; }
  .portal-layout .ops-toolbar { margin: -18px -14px 20px; padding: 14px; display: flex; flex-wrap: wrap; gap: 12px; }
  .portal-layout .ops-search { width: 100%; min-width: 0; }
  .portal-card { padding: 20px; }
  .portal-page > h1 { font-size: 24px; }
  .portal-filters label { width: 100%; }
  .portal-actions > label { width: 100%; }
  .portal-filters input, .portal-filters select { width: 100%; }
  .portal-record > div { grid-template-columns: 1fr; gap: 5px; }
  .portal-table, .portal-table tbody, .portal-table tr, .portal-table td { display: block; }
  .portal-table thead { display: none; }
  .portal-table tr { padding: 12px 16px; border-bottom: 1px solid #e5e9f1; }
  .portal-table td { border: 0; max-width: none; padding: 7px 0; }
  .portal-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10px; color: #748095; margin-bottom: 4px; }
  .portal-attachment { flex-wrap: wrap; }
}

.portal-layout[hidden] { display: none; }
.portal-impersonation { position: relative; z-index: 1001; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 12px 20px; background: #fff1d6; color: #643c05; }
.portal-reauth { position: fixed; inset: 0; z-index: 1000; overflow: auto; background: #f6f8fc; }
.portal-reauth > .portal-notice { margin: 0; border-radius: 0; text-align: center; }
