@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/karla-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/karla-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --portal-ground: #f3f5f8;
  --portal-frame: #f1f4f8;
  --portal-surface: #ffffff;
  --portal-raised: #f8f9fb;
  --portal-active: #e9edf2;
  --portal-border: #e5e8ed;
  --portal-rule: #edf0f3;
  --portal-control: #cdd3dc;
  --portal-ink: #171923;
  --portal-navy: #010048;
  --portal-muted: #5f6673;
  --portal-faint: #6b7280;
  /* KAMNET brand orange plus its accessible ink tone for text and filled controls. */
  --portal-orange-brand: #ee8401;
  --portal-orange: #ba4e00;
  --portal-orange-soft: #fff2df;
  --portal-orange-border: #f3d2a7;
  --portal-positive: #247b50;
  --portal-negative: #9f2027;
  --portal-warning: #754600;
  --portal-radius-card: 8px;
  --portal-radius-sheet: 16px;
  --portal-shadow-menu: 0 8px 24px rgba(14, 22, 38, 0.12);
  --bs-primary: var(--portal-navy);
  --bs-primary-rgb: 1, 0, 72;
  --bs-accent: var(--portal-orange-brand);
  --bs-accent-rgb: 238, 132, 1;
  --bs-success: var(--portal-positive);
  --bs-success-rgb: 36, 123, 80;
  --bs-danger: var(--portal-negative);
  --bs-danger-rgb: 159, 32, 39;
  --bs-warning: #a25d00;
  --bs-light: var(--portal-raised);
  --bs-dark: var(--portal-ink);
  --bs-body-color: var(--portal-ink);
  --bs-body-bg: var(--portal-ground);
  --bs-body-font-family: "Karla", system-ui, sans-serif;
  --bs-body-font-size: 14px;
  --bs-border-color: var(--portal-border);
}

/* Match Bootstrap's global sizing reset even while its CDN stylesheet is loading. */
.portal-ui,
.portal-ui *,
.portal-ui *::before,
.portal-ui *::after { box-sizing: border-box; }

html { min-width: 320px; font-size: 16px; }
body.portal-ui,
.portal-ui button,
.portal-ui input,
.portal-ui select,
.portal-ui textarea {
  font-family: "Karla", system-ui, sans-serif;
}
body.portal-ui {
  min-height: 100vh;
  margin: 0;
  color: var(--portal-ink);
  background: var(--portal-ground);
  font-size: 14px;
  line-height: 1.5;
  font-kerning: normal;
  font-variant-numeric: proportional-nums;
  text-rendering: optimizeLegibility;
}
.portal-ui h1,
.portal-ui h2,
.portal-ui h3,
.portal-ui h4,
.portal-ui h5,
.portal-ui h6,
.portal-ui .section-title {
  color: var(--portal-navy);
  font-family: "Montserrat", "Karla", sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.portal-ui a { color: var(--portal-navy); text-underline-offset: 3px; }
.portal-ui a:hover { color: var(--portal-orange); }
.portal-ui :focus-visible {
  outline: 3px solid var(--portal-orange);
  outline-offset: 2px;
}
.portal-ui button:focus:not(:focus-visible), .portal-ui a:focus:not(:focus-visible) { outline: 0; }
.portal-ui .text-primary { color: var(--portal-navy) !important; }
.portal-ui .text-muted, .portal-ui .form-text { color: var(--portal-muted) !important; }
.portal-ui .text-accent { color: var(--portal-orange) !important; }
.portal-ui .bg-accent { background-color: var(--portal-orange) !important; }
.portal-ui .bg-light { background-color: var(--portal-raised) !important; }

/* Shared application shell primitives. */
.portal-nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; color: var(--portal-orange); background: var(--portal-orange-soft); border: 1px solid var(--portal-orange-border); border-radius: 10px; font-size: 11px; font-variant-numeric: tabular-nums; }
.portal-main { display: flex; min-width: 0; flex-direction: column; }
.portal-account-button { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 4px 8px; color: var(--portal-ink); background: transparent; border: 0; border-radius: 6px; font-size: 13px; }
.portal-account-button:hover { background: rgba(255,255,255,.72); }
.portal-account-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: #3f4652; background: #e2e7ed; border-radius: 50%; font-size: 12px; }
.portal-account-chevron { color: var(--portal-muted); font-size: 10px; }
.portal-account-menu { min-width: 220px; padding: 6px; border: 1px solid var(--portal-border); border-radius: 8px; box-shadow: var(--portal-shadow-menu); } /* taste-skill-ignore: shadow belongs to the floating account menu overlay. */
.portal-account-menu .dropdown-item { display: flex; align-items: center; gap: 10px; min-height: 38px; border-radius: 5px; font-size: 14px; }
.portal-account-menu button.dropdown-item { border: 0; background: transparent; }
.portal-account-menu .dropdown-item i { width: 16px; color: var(--portal-muted); text-align: center; }
.portal-sheet { flex: 1 0 auto; min-width: 0; }
.portal-page-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 24px; }
.portal-page-heading h1 { margin: 0; color: var(--portal-navy); font-size: 22px; line-height: 1.3; }
.portal-footer { padding: 2px 24px 10px; color: #666e7b; font-size: 12px; }
.portal-footer span { padding: 0 4px; color: #a1a6af; }

/* Shared interface components. */
.portal-ui .container { width: 100%; max-width: 100%; padding-right: 0; padding-left: 0; }
.portal-ui .container.my-4, .portal-ui .container.my-5 { flex-grow: 1; padding-top: 0; padding-bottom: 0; margin-top: 0 !important; margin-bottom: 0 !important; }
.portal-ui .row { --bs-gutter-x: 20px; }
.portal-ui .card, .portal-ui .modal-content { color: var(--portal-ink); background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: var(--portal-radius-card); box-shadow: none; } /* taste-skill-ignore: explicit reset keeps Bootstrap's legacy surfaces flat. */
.portal-ui .card { margin-bottom: 20px; }
.portal-ui .card-header { padding: 15px 18px; color: var(--portal-ink); background: var(--portal-surface); border-bottom: 1px solid var(--portal-rule); border-radius: 8px 8px 0 0 !important; font-weight: 600; }
.portal-ui .card-header h1, .portal-ui .card-header h2, .portal-ui .card-header h4, .portal-ui .card-header h5 { margin: 0; color: var(--portal-ink); font-size: 16px; font-weight: 600; }
.portal-ui .card-header h4 i, .portal-ui .card-header h5 i { margin-right: 9px; color: #69717e; }
.portal-ui .card-body { padding: 18px; }
.portal-ui .display-6 { font-size: 1.65rem; font-weight: 600; line-height: 1.2; }
.portal-ui .card-footer { padding: 14px 18px; background: var(--portal-raised); border-top: 1px solid var(--portal-rule); }
.portal-ui .btn { min-height: 40px; padding: 7px 13px; border-radius: 6px; font-size: 14px; font-weight: 600; line-height: 1.35; transition: color .14s ease, background-color .14s ease, border-color .14s ease; }
.portal-ui .btn:active { transform: translateY(1px); }
.portal-ui .btn:disabled, .portal-ui .btn.disabled { cursor: not-allowed; opacity: .62; }
.portal-ui .btn-primary, .portal-ui .btn-accent { color: #fff; background: var(--portal-orange); border-color: var(--portal-orange); }
.portal-ui .btn-primary:hover, .portal-ui .btn-accent:hover { color: #fff; background: #a94400; border-color: #a94400; }
.portal-ui .btn-primary:active, .portal-ui .btn-accent:active { color: #fff; background: #873800; border-color: #873800; }
.portal-ui .btn-secondary { color: #343944; background: #eef0f3; border-color: #d7dbe2; }
.portal-ui .btn-secondary:hover { color: var(--portal-ink); background: #e3e6eb; border-color: #c8cdd5; }
.portal-ui .btn-outline-primary, .portal-ui .btn-outline-accent { color: var(--portal-navy); background: #fff; border-color: #b9bec8; }
.portal-ui .btn-outline-primary:hover, .portal-ui .btn-outline-accent:hover { color: var(--portal-navy); background: #f3f5f8; border-color: #8f96a3; }
.portal-ui .btn-outline-secondary { color: #3d434e; border-color: #c7ccd4; }
.portal-ui .btn-outline-secondary:hover { color: var(--portal-ink); background: #f2f4f6; border-color: #aeb4bf; }
.portal-ui .btn-danger { color: #fff; background: #a5262c; border-color: #a5262c; }
.portal-ui .form-label { margin-bottom: 7px; color: var(--portal-ink); font-size: 14px; font-weight: 600; }
.portal-ui .form-control, .portal-ui .form-select { min-height: 40px; padding: 8px 11px; color: var(--portal-ink); background-color: #fff; border: 1px solid var(--portal-control); border-radius: 6px; font-size: 14px; line-height: 1.4; }
.portal-ui textarea.form-control { min-height: 112px; }
.portal-ui .form-control::placeholder { color: #6b7280; opacity: 1; }
.portal-ui .form-control:focus, .portal-ui .form-select:focus, .portal-ui .form-check-input:focus { border-color: var(--portal-orange); outline: 2px solid var(--portal-orange); outline-offset: 1px; }
.portal-ui .form-check-input:checked { background-color: var(--portal-navy); border-color: var(--portal-navy); }
.portal-ui .form-check-input:focus { border-color: var(--portal-orange); }
.portal-ui .input-group-text { color: #59616f; background: #f6f7f9; border-color: var(--portal-control); }
.portal-ui .table { margin-bottom: 0; color: var(--portal-ink); --bs-table-bg: transparent; --bs-table-hover-bg: #fafbfc; --bs-table-hover-color: var(--portal-ink); --bs-table-striped-bg: #f8f9fb; --bs-table-striped-color: var(--portal-ink); font-size: 14px; vertical-align: middle; }
.portal-ui .table > :not(caption) > * > * { padding: 11px 10px; border-bottom-color: var(--portal-rule); }
.portal-ui .table thead th { color: var(--portal-muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.portal-ui .table td { line-height: 1.4; }
.portal-ui .table tbody tr:hover > * { background-color: #fafbfc; }
.portal-ui .table tfoot { border-top: 1px solid var(--portal-border); font-weight: 600; }
.portal-ui .table-responsive { border-radius: 0 0 7px 7px; }
.portal-ui .badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.portal-ui .badge.bg-success, .portal-ui .badge-confirmed, .portal-ui .status-resolved { color: #164d30 !important; background: #e5f3e9 !important; border-color: #c9e3d1; }
.portal-ui .badge.bg-danger, .portal-ui .badge-confirmed.bg-danger, .portal-ui .status-new { color: #7f1d22 !important; background: #fff0f0 !important; border-color: #f0c7c9; }
.portal-ui .badge.bg-warning, .portal-ui .badge-waiting, .portal-ui .status-open { color: #684000 !important; background: #fff5df !important; border-color: #f0d7a2; }
.portal-ui .badge.bg-primary, .portal-ui .badge-open, .portal-ui .status-other { color: #363c47 !important; background: #eef0f3 !important; border-color: #d9dce2; }
.portal-ui .badge.bg-secondary { color: #454b55 !important; background: #eef0f2 !important; border-color: #d8dce2; }
.portal-ui .alert { padding: 12px 14px; border-radius: 6px; font-size: 14px; }
.portal-ui .alert-success { color: #164d30; background: #eff8f1; border-color: #c9e3d1; }
.portal-ui .alert-danger { color: #7f1d22; background: #fff2f2; border-color: #f0c7c9; }
.portal-ui .alert-warning { color: #684000; background: #fff8e8; border-color: #f0d7a2; }
.portal-ui .alert-primary, .portal-ui .alert-info { color: #323946; background: #f1f4f8; border-color: #e0e5ec; }
.portal-ui .accordion-item { background: #fff; border-color: var(--portal-border); }
.portal-ui .accordion-button { min-height: 48px; color: var(--portal-ink); background: #fff; box-shadow: none; font-size: 14px; } /* taste-skill-ignore: Bootstrap accordion focus shadow is replaced by the visible outline below. */
.portal-ui .accordion-button:not(.collapsed) { color: var(--portal-navy); background: #f7f8fa; box-shadow: none; } /* taste-skill-ignore: expanded state stays flat and uses background plus text hierarchy. */
.portal-ui .accordion-button:focus-visible { outline: 2px solid var(--portal-orange); outline-offset: 1px; }
.portal-ui .nav-tabs { border-bottom: 1px solid var(--portal-border); }
.portal-ui .nav-tabs .nav-link { min-height: 42px; padding: 9px 14px; color: var(--portal-muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; font-weight: 500; }
.portal-ui .nav-tabs .nav-link:hover { color: var(--portal-ink); }
.portal-ui .nav-tabs .nav-link.active { color: var(--portal-ink); background: transparent; border-bottom-color: var(--portal-ink); font-weight: 600; }
.portal-ui .pagination { gap: 4px; flex-wrap: wrap; }
.portal-ui .pagination .page-link { min-width: 34px; min-height: 34px; color: var(--portal-navy); border: 1px solid var(--portal-border); border-radius: 5px !important; text-align: center; }
.portal-ui .pagination .page-link:hover { background: #f4f6f8; border-color: #bfc5ce; }
.portal-ui .pagination .page-item.active .page-link { color: var(--portal-navy); background: var(--portal-active); border-color: #c5cbd4; }
.portal-ui .pagination .page-item.disabled .page-link { color: #6b7280; background: #fafafa; }
.portal-ui .modal-backdrop.show { opacity: .38; }
.portal-ui .fade, .portal-ui .modal.fade .modal-dialog, .portal-ui .collapsing { transition: none !important; }
.portal-ui .modal-header, .portal-ui .modal-footer { padding: 14px 18px; border-color: var(--portal-rule); }
.portal-ui .modal-title { color: var(--portal-navy); font-size: 17px; font-weight: 600; }
.portal-ui .modal-body { padding: 18px; }
.portal-ui .dropdown-menu { color: var(--portal-ink); background: #fff; }
.portal-ui .dropdown-item { color: var(--portal-ink); }
.portal-ui .dropdown-item:hover { color: var(--portal-navy); background: #f3f5f8; }
.portal-ui .list-group-item { color: var(--portal-ink); background: #fff; border-color: var(--portal-rule); }
.portal-ui .list-group-item:hover { background: #fafbfc; }
.portal-ui .breadcrumb { margin: 0 0 20px; padding: 0; background: transparent; font-size: 13px; }
.portal-ui .breadcrumb-item.active { color: var(--portal-muted); }
.portal-ui .actions-group { display: flex; align-items: center; gap: 8px; }
.portal-ui .actions-group .btn { min-width: 36px; }

/* Overview, using only the data already loaded for the dashboard. */
.portal-overview-panel { min-width: 0; }
.portal-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.portal-panel-heading h2 { margin: 0 0 3px; color: var(--portal-ink); font-size: 16px; font-weight: 600; }
.portal-panel-heading p { margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-panel-heading > .portal-text-link { flex: 0 0 auto; margin-top: 3px; }
.portal-balance-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
.portal-balance-print-form { min-width: 0; }
.portal-balance-document-actions { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.portal-invoice-select { display: inline-flex; min-width: 36px; min-height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.portal-invoice-select .form-check-input,
.portal-select-all-invoices .form-check-input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.portal-select-all-invoices { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; color: var(--portal-ink); font-size: 13px; cursor: pointer; }
.portal-invoice-print-status { text-align: right; }
.portal-data-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--portal-rule); }
.portal-data-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; min-height: 62px; padding: 9px 2px; border-bottom: 1px solid var(--portal-rule); }
.portal-data-primary { min-width: 0; color: var(--portal-ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.portal-data-primary a { color: inherit; text-decoration: none; }
.portal-data-primary a:hover { color: var(--portal-orange); }
.portal-data-secondary { min-width: 0; color: var(--portal-muted); font-size: 13px; overflow-wrap: anywhere; }
.portal-data-amount { grid-column: 2; grid-row: 1 / span 2; color: var(--portal-ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.portal-data-amount small { color: var(--portal-muted); font-size: 12px; font-weight: 400; }
.portal-status-chip { grid-column: 2; grid-row: 1 / span 2; justify-self: end; color: #4b515d; font-size: 12px; text-align: right; }
.portal-list-more { display: inline-block; margin-top: 10px; color: var(--portal-navy); font-size: 13px; font-weight: 600; text-decoration: none; }
.portal-empty-inline { padding: 14px; color: var(--portal-muted); background: #fafbfc; border: 1px dashed #d8dde5; border-radius: 6px; font-size: 13px; }

/* Overview: consistent rows keep the amount, label and date easy to scan. */
.portal-overview-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--portal-rule); }
.portal-overview-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 13px 2px; border-bottom: 1px solid var(--portal-rule); }
.portal-overview-row-main { display: grid; min-width: 0; gap: 3px; }
.portal-overview-row-title { min-width: 0; color: var(--portal-ink); font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
a.portal-overview-row-title { text-decoration: none; }
a.portal-overview-row-title:hover { color: var(--portal-orange); }
.portal-overview-row-meta { color: var(--portal-muted); font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.portal-overview-row-value { color: var(--portal-ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.portal-overview-row-value.is-positive { color: var(--portal-positive); }
.portal-overview-row-value.is-negative { color: var(--portal-negative); }
.portal-overview-row-value.is-discount { color: #24704d; }

/* Contract configurator keeps all existing form names and calculations. */
.portal-ui .option-box { position: relative; height: 100%; min-height: 94px; margin-bottom: 10px; padding: 15px; color: var(--portal-ink); background: #fff; border: 1px solid var(--portal-border); border-radius: 8px; cursor: pointer; }
.portal-ui .option-box:hover { background: #fafbfc; border-color: #bac1cb; }
.portal-ui .option-box.selected { background: var(--portal-orange-soft); border: 2px solid var(--portal-orange-brand); }
.portal-ui .option-box:focus-within { outline: 3px solid var(--portal-orange); outline-offset: 2px; }
.portal-ui .option-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.portal-ui .option-title { margin-bottom: 5px; color: var(--portal-ink); font-size: 15px; font-weight: 600; }
.portal-ui .option-box.selected .option-title { color: var(--portal-navy); }
.portal-ui .option-description { color: var(--portal-muted); font-size: 12px; }
.portal-ui .option-price { margin-top: 8px; color: var(--portal-navy); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.portal-ui .option-box.selected .option-price { color: var(--portal-orange); }
.portal-ui .option-box.is-invalid { border-color: var(--portal-negative); }
.portal-ui .summary-card { position: sticky; top: 16px; }
.portal-ui .summary-section { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--portal-rule); }
.portal-ui .price-tag { min-height: 29px; padding: 4px 0; color: var(--portal-muted); border-bottom: 1px solid var(--portal-rule); font-size: 13px; }
.portal-ui .price-value { color: var(--portal-ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-ui .summary-total { align-items: baseline; margin-top: 8px; color: var(--portal-ink); }
.portal-ui .summary-total .price-value { color: var(--portal-navy); font-size: 19px; }
.portal-ui #contract-form h5.mb-3 { margin: 20px 0 12px !important; padding: 0; color: var(--portal-ink); border: 0; font-size: 15px; font-weight: 600; }
.portal-ui .summary-card h5 { font-size: 14px; font-weight: 600; }
.portal-ui .contract-generator-container h5.mb-3 { color: var(--portal-ink); border-color: var(--portal-orange); }

/* Helpdesk, notifications and document preview. */
.portal-ui .portal-ticket-thread { display: flex; height: min(780px, calc(100vh - 220px)); height: min(780px, calc(100dvh - 220px)); min-height: 500px; flex-direction: column; }
.portal-ui .portal-ticket-thread > .card-header,
.portal-ui .portal-ticket-thread > .card-footer { flex: 0 0 auto; }
.portal-ui .portal-ticket-thread > .card-body { display: flex; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.portal-ui .messages-container { min-height: 0; height: 100%; max-height: none; flex: 1 1 auto; overflow-y: auto; padding: 28px clamp(16px, 4vw, 48px); background: #fbfcfe; overscroll-behavior: contain; }
.portal-ui .portal-chat-new-messages { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; margin-top: 8px; padding: 6px 11px; color: var(--portal-navy); background: #fff; border: 1px solid var(--portal-control); border-radius: 6px; font: 600 13px/1.3 "Karla", sans-serif; cursor: pointer; }
.portal-ui .portal-chat-new-messages:hover { background: #f3f5f8; border-color: #aeb6c2; }
.portal-ui .portal-chat-new-messages:active { background: var(--portal-active); }
.portal-ui .portal-chat-new-messages[hidden] { display: none; }
.portal-ui .portal-chat-message { display: flex; align-items: flex-end; gap: 12px; width: 100%; margin: 0 0 24px; }
.portal-ui .portal-chat-message:last-child { margin-bottom: 0; }
.portal-ui .portal-chat-message.is-customer { flex-direction: row-reverse; }
.portal-ui .portal-chat-avatar { display: inline-flex; width: 32px; height: 32px; flex: 0 0 32px; align-items: center; justify-content: center; border: 1px solid #dce2eb; border-radius: 50%; color: var(--portal-navy); background: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.portal-ui .portal-chat-message.is-customer .portal-chat-avatar { color: #fff; background: var(--portal-navy); border-color: var(--portal-navy); }
.portal-ui .portal-chat-content { display: flex; min-width: 0; max-width: min(86%, 900px); flex-direction: column; align-items: flex-start; }
.portal-ui .portal-chat-message.is-customer .portal-chat-content { align-items: flex-end; }
.portal-ui .portal-chat-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 3px 5px; color: var(--portal-muted); font-size: 12px; line-height: 1.35; }
.portal-ui .portal-chat-meta .message-author { color: var(--portal-ink); font-size: 12px; font-weight: 600; }
.portal-ui .portal-chat-meta time { font-variant-numeric: tabular-nums; }
.portal-ui .message-bubble { width: fit-content; max-width: 100%; border: 1px solid var(--portal-border); border-radius: 14px; overflow: hidden; }
.portal-ui .message-bubble .card-body { padding: 14px 17px; }
.portal-ui .message-bubble .message-body { margin-bottom: 0 !important; color: var(--portal-ink); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.portal-ui .message-customer { color: var(--portal-ink); background: #edf1f7; border-color: #dce3ed; border-bottom-right-radius: 5px; }
.portal-ui .message-staff { color: var(--portal-ink); background: #fff; border-color: #e0e4eb; border-bottom-left-radius: 5px; }
.portal-ui .message-bubble hr { margin: 12px 0; border-color: var(--portal-rule); opacity: 1; }
.portal-ui .message-body blockquote { margin: 9px 0 0; padding: 8px 11px; color: #4c5360; background: rgba(255,255,255,.72); border-left: 2px solid #b8c2d1 !important; border-radius: 0 5px 5px 0; }
.portal-ui .portal-chat-message .text-muted-inherited { color: var(--portal-muted) !important; }
.portal-ui .portal-chat-message a.attachment-link { color: var(--portal-navy); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.portal-ui .portal-chat-message a.attachment-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.portal-ui .portal-chat-message .attachment-item { margin: 10px 0 0 !important; padding: 9px !important; background: rgba(255,255,255,.76); border: 1px solid var(--portal-border); border-radius: 9px !important; }
.portal-ui .portal-chat-message .attachment-item > div { min-width: 0; }
.portal-ui .portal-chat-message .attachment-item > div > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.portal-ui .portal-chat-message .attachment-item .btn { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.portal-ui .portal-chat-message .quote-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 7px 10px; color: var(--portal-muted) !important; border-radius: 5px; font-size: 13px; text-decoration: none; }
.portal-ui .portal-chat-message .quote-link:hover { color: var(--portal-navy) !important; background: #f0f2f6; }
.portal-ui .portal-chat-actions { margin: 3px 2px 0; }
.portal-ui .portal-chat-event { display: flex; justify-content: center; margin: 6px 0 22px; }
.portal-ui .system-note { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; max-width: min(100%, 620px); padding: 7px 12px; color: var(--portal-muted); background: #f0f2f6; border: 1px solid #e7eaf0; border-radius: 999px; font-size: 12px; line-height: 1.45; text-align: center; }
.portal-ui .system-note time { font-variant-numeric: tabular-nums; }
.portal-ui .portal-chat-composer { padding: 16px clamp(16px, 4vw, 48px) 20px; background: #fff; border-top: 1px solid var(--portal-rule); }
.portal-ui .portal-chat-composer-heading { max-width: 900px; margin: 0 auto 10px; }
.portal-ui .portal-chat-composer-heading h3 { margin: 0 0 2px; color: var(--portal-ink); font-size: 15px; font-weight: 600; }
.portal-ui .portal-chat-live-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--portal-muted); font-size: 12px; line-height: 1.4; }
.portal-ui .portal-chat-live-status::before { width: 7px; height: 7px; flex: 0 0 7px; background: #7d8795; border-radius: 50%; content: ""; }
.portal-ui .portal-chat-live-status[data-status="connected"]::before { background: #43835a; }
.portal-ui .portal-chat-live-status[data-status="error"]::before,
.portal-ui .portal-chat-live-status[data-status="expired"]::before { background: #ad4a42; }
.portal-ui .portal-chat-form { max-width: 900px; margin: 0 auto; }
.portal-ui .portal-chat-compose-box { overflow: hidden; background: #fff; border: 1px solid var(--portal-control); border-radius: 8px; }
.portal-ui .portal-chat-compose-box:focus-within { border-color: var(--portal-orange); outline: 2px solid var(--portal-orange); outline-offset: 2px; }
.portal-ui .portal-chat-compose-box textarea.form-control { display: block; min-height: 88px; padding: 12px 14px 8px; border: 0; border-radius: 0; box-shadow: none; resize: vertical; } /* taste-skill-ignore: reset Bootstrap's control shadow; the enclosing composer owns the surface. */
.portal-ui .portal-chat-compose-box textarea.form-control:focus { border: 0; outline: 0; box-shadow: none; } /* taste-skill-ignore: the enclosing composer supplies the visible focus ring. */
.portal-ui .portal-chat-compose-box textarea.form-control::placeholder { color: #626a78; opacity: 1; }
.portal-ui .portal-chat-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--portal-rule); }
.portal-ui .portal-chat-file-field { display: flex; min-width: 0; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.portal-ui .portal-chat-file-field input[type="file"] { width: auto; max-width: min(100%, 500px); min-height: 36px; padding: 3px 0; color: var(--portal-muted); background: transparent; border: 0; font-size: 12px; }
.portal-ui .portal-chat-file-field input[type="file"]::file-selector-button { min-height: 32px; margin-right: 8px; padding: 4px 10px; color: var(--portal-navy); background: #fff; border: 1px solid var(--portal-control); border-radius: 6px; font: 600 12px/1.3 "Karla", sans-serif; cursor: pointer; }
.portal-ui .portal-chat-file-field .form-text { display: block; margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-ui .portal-chat-compose-footer > .btn { flex: 0 0 auto; min-width: 100px; }
.portal-ui .status-new, .portal-ui .status-open, .portal-ui .status-resolved, .portal-ui .status-other { min-height: 20px; padding: 3px 7px; border: 1px solid; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.portal-ui .status-new { color: #7f1d22; background: #fff0f0; border-color: #f0c7c9; }
.portal-ui .status-open { color: #684000; background: #fff5df; border-color: #f0d7a2; }
.portal-ui .status-resolved { color: #164d30; background: #e5f3e9; border-color: #c9e3d1; }
.portal-ui .status-other { color: #424854; background: #eef0f3; border-color: #d9dce2; }
.portal-ui .badge-confirmed { color: #164d30; background: #e5f3e9; border-color: #c9e3d1; }
.portal-ui .badge-waiting { color: #684000; background: #fff5df; border-color: #f0d7a2; }
.portal-ui .badge-open { color: #424854; background: #eef0f3; border-color: #d9dce2; }
.portal-ui .ticket-composer, .portal-ui .message-body { overflow-wrap: anywhere; }
.portal-ui .ratio iframe { background: #f3f5f8; }
.portal-document-preview { position: relative; height: min(80vh, 900px); min-height: min(600px, 80vh); overflow: hidden; background: #fff; border: 1px solid var(--portal-border); border-radius: 6px; }
.portal-document-preview-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.portal-document-image-preview { max-height: 80vh; object-fit: contain; }
.portal-document-description, .portal-notice-content.is-plain { white-space: pre-wrap; }
.portal-notice-content.is-html { white-space: normal; }
.portal-notice-content.is-html > :first-child { margin-top: 0; }
.portal-notice-content.is-html > :last-child { margin-bottom: 0; }
.portal-notice-attachments { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--portal-rule); }
.portal-notice-attachments > strong { display: block; margin-bottom: 8px; color: var(--portal-ink); font-size: 13px; }
.portal-notice-attachments ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.portal-notice-attachments a { display: inline-flex; min-height: 40px; align-items: center; gap: 9px; color: var(--portal-link); text-decoration: none; }
.portal-notice-attachments a:hover { text-decoration: underline; }
.portal-notice-attachments a span { overflow-wrap: anywhere; }
.portal-account-number { display: inline-block; max-width: 100%; color: var(--portal-navy); font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .02em; overflow-wrap: anywhere; cursor: pointer; }
.portal-pin-display { font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.portal-attachment-image { width: 40px; height: 40px; object-fit: cover; }
.portal-attachment-file-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 6px; }
.portal-attachment-file-icon.is-pdf { color: #8b292e; background: #fff1f1; }
.portal-attachment-file-icon.is-generic { color: #4f5865; background: #edf0f4; }

/* Sign-in and standalone pages retain their existing endpoints. */
.portal-login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  background: #e9edf3 !important;
}
.portal-login-page .portal-login-layout {
  display: grid;
  width: min(100%, 1120px);
  min-height: min(680px, calc(100svh - 80px));
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
}
.portal-login-brand-panel { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: clamp(34px, 5vw, 58px); color: var(--portal-ink); background: #f2f4f7; border-right: 1px solid var(--portal-border); }
.portal-login-brand-block { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: flex-start; gap: 40px; }
.portal-login-brand-mark { display: inline-flex; width: fit-content; align-items: center; padding: 0; background: transparent; }
.portal-login-brand-mark img { display: block; width: 128px; height: 49px; object-fit: contain; object-position: left center; }
.portal-login-brand-copy { max-width: 350px; padding-left: 0; border: 0; }
.portal-login-brand-footer { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 40px; }
.portal-login-brand-copy::before { display: block; width: 36px; height: 3px; margin: 0 0 18px; background: var(--portal-orange-brand); content: ""; }
.portal-login-brand-copy h2 { margin: 0; color: var(--portal-navy); font-size: clamp(34px, 3.1vw, 42px); font-weight: 600; letter-spacing: -.04em; line-height: 1.08; }
.portal-login-brand-copy p { max-width: 300px; margin: 14px 0 0; color: var(--portal-muted); font-size: 15px; line-height: 1.6; }
.portal-login-copyright { margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-login-main { display: flex; min-width: 0; align-items: center; justify-content: center; padding: clamp(24px, 4vw, 58px); background: #f8f9fb; }
.portal-login-form-wrap { width: min(100%, 380px); margin: 0 auto; }
.portal-login-intro { margin: 0 0 28px; }
.portal-login-title { margin: 0; color: var(--portal-navy); font-size: 27px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.portal-login-subtitle { margin: 8px 0 0; color: var(--portal-muted); font-size: 14px; line-height: 1.5; }
.portal-login-message { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 17px; padding: 11px 13px; border-radius: 6px; font-size: 14px; line-height: 1.45; text-align: left; }
.portal-login-message > i { flex: 0 0 auto; margin-top: 2px; }
.portal-login-field { margin: 0 0 17px; }
.portal-login-field .form-label { display: block; margin: 0 0 6px; color: var(--portal-ink); font-size: 14px; font-weight: 600; }
.portal-login-form .form-control,
.portal-login-form .form-select { min-height: 48px; padding: 9px 11px; border-radius: 6px; font-size: 16px; }
.portal-login-form [hidden] { display: none !important; }
.portal-login-submit { display: inline-flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; margin-top: 3px; padding: 10px 16px; border-radius: 6px; font-size: 15px; }
.portal-login-secondary-action { display: inline-flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; margin-top: 11px; border-radius: 6px; }
.portal-login-help { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin-top: 25px; padding-top: 16px; border-top: 1px solid var(--portal-rule); font-size: 13px; }
.portal-login-help > span { color: var(--portal-muted); }
.portal-login-help a { color: var(--portal-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.portal-login-skip { position: fixed; top: 8px; left: 8px; z-index: 2000; padding: 10px 14px; color: #fff; background: var(--portal-navy); border-radius: 6px; font-size: 14px; font-weight: 600; text-decoration: none; transform: translateY(-160%); }
.portal-login-skip:focus { transform: translateY(0); }
.portal-document-page, .portal-contract-page { background: var(--portal-frame); }
.portal-contract-page { display: flex; min-height: 100vh; flex-direction: column; }
.portal-contract-page .navbar { min-height: 56px; background: var(--portal-frame) !important; border-bottom: 1px solid var(--portal-border); }
.portal-contract-page .navbar-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--portal-ink) !important; font-size: 14px; font-weight: 600; }
.portal-contract-page .navbar-brand img { width: 94px; height: 36px; object-fit: contain; }
.portal-contract-page footer { margin-top: auto; padding: 14px 16px !important; color: var(--portal-muted); background: var(--portal-frame) !important; border-top: 1px solid var(--portal-border); font-size: 12px; }
.portal-contract-page .navbar .container { padding: 7px 16px; }
.portal-contract-page .container.my-5 { width: min(100% - 32px, 1200px); margin: 24px auto !important; padding: 0; }
.portal-document-page .card-header .actions-group, .portal-document-page .card-header .d-flex { gap: 8px; }
.portal-document-summary-heading { padding: 21px 22px; }
.portal-document-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.portal-document-heading-copy { min-width: 0; }
.portal-document-heading-copy .portal-section-eyebrow { margin-bottom: 4px; font-size: 12px; }
.portal-document-heading-copy h2 { margin: 0; color: var(--portal-navy); font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.portal-document-number { margin: 5px 0 0; color: var(--portal-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.portal-document-actions { flex: 0 0 auto; }
.portal-document-summary .card-body .row { row-gap: 14px !important; }
.portal-document-summary .card-body strong { margin-bottom: 2px; color: var(--portal-muted) !important; font-size: 12px; font-weight: 500; }
.portal-document-summary .card-body .mb-2 { margin-bottom: 0 !important; line-height: 1.5; }
.portal-document-summary .card-body .border-top { border-color: var(--portal-rule) !important; }
.portal-document-attachments .list-group-item { min-height: 58px; padding: 12px 18px; color: var(--portal-ink); border-color: var(--portal-rule); text-decoration: none; }
.portal-document-attachments .list-group-item:hover { background: #fafbfc; }
.portal-document-attachments .list-group-item > div { min-width: 0; }
.portal-document-attachments .list-group-item > div > div { min-width: 0; overflow-wrap: anywhere; }
.portal-document-confirm { border-color: #ead9b1 !important; }
.portal-document-confirm .card-header { color: #684000 !important; background: #fff8e8 !important; border-color: #f0e2c4; }
.portal-document-confirm .card-body { padding: 18px 20px; }
.portal-document-preview-panel .card-body { padding: 12px; }
.portal-contract-page .section-title { margin-bottom: 22px !important; text-align: left !important; font-size: 22px; }

@media (max-width: 991.98px) {
  .portal-ui .summary-card { position: static; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .portal-action-tariffs .table-responsive { position: relative; }
  .portal-action-tariffs #services-tab-pane .table tr > :first-child,
  .portal-action-tariffs #balance-tab-pane .table tr > :first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--portal-surface);
    border-right: 1px solid var(--portal-rule);
  }
  .portal-action-tariffs #services-tab-pane .table thead tr > :first-child,
  .portal-action-tariffs #balance-tab-pane .table thead tr > :first-child,
  .portal-action-tariffs #services-tab-pane .table tfoot tr > :first-child,
  .portal-action-tariffs #balance-tab-pane .table tfoot tr > :first-child { z-index: 2; }
  .portal-action-tariffs #services-tab-pane .table tbody tr:hover > :first-child,
  .portal-action-tariffs #balance-tab-pane .table tbody tr:hover > :first-child { background: #fafbfc; }
}
@media (max-width: 900px) and (min-width: 768px) {
  .portal-login-brand-panel { padding: 30px 26px; }
  .portal-login-brand-copy h2 { font-size: 34px; }
  .portal-login-main { padding: 30px 26px; }
}
@media (max-width: 767.98px) {
  .portal-sheet { margin: 0; padding: 19px 17px 26px; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
  .portal-page-heading { margin-bottom: 19px; }
  .portal-page-heading h1 { font-size: 21px; }
  .portal-panel-heading { flex-wrap: wrap; }
  .portal-ui .card-body { padding: 15px; }
  .portal-ui .card-header { padding: 13px 15px; }
  .portal-ui .table-mobile-cards { display: block; width: 100%; }
  .portal-ui .table-mobile-cards thead { display: none; }
  .portal-ui .table-mobile-cards tbody { display: block; padding: 10px; }
  .portal-ui .table-mobile-cards tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; margin: 0 0 9px; padding: 9px 11px; background: #fff; border: 1px solid var(--portal-border); border-radius: 8px; }
  .portal-ui .table-mobile-cards tbody tr:last-child { margin-bottom: 0; }
  .portal-ui .table-mobile-cards tbody td { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 0 !important; border: 0; font-size: 14px; overflow-wrap: anywhere; }
  .portal-ui .table-mobile-cards tbody td.is-empty-action { display: none !important; }
  .portal-ui .table-mobile-cards tbody td::before { color: var(--portal-muted); content: attr(data-label); font-size: 12px; font-weight: 500; line-height: 1.3; }
  .portal-ui .table-mobile-cards tbody td.is-empty-value:not(.is-empty-action)::after,
  .portal-ui .table-mobile-cards tfoot .is-empty-value:not(.is-empty-action)::after { color: var(--portal-muted); content: "-"; }
  .portal-ui .table-mobile-cards tbody td:first-child { grid-column: 1 / -1; padding-bottom: 7px !important; border-bottom: 1px solid var(--portal-rule); color: var(--portal-ink); font-size: 14px; font-weight: 600; }
  .portal-ui .table-mobile-cards tbody td:first-child::before { font-weight: 500; }
  .portal-ui .table-mobile-cards tbody td:nth-child(2) { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding: 7px 0 !important; border-bottom: 1px solid var(--portal-rule); text-align: right !important; font-weight: 600; font-variant-numeric: tabular-nums; }
  .portal-ui .table-mobile-cards tbody td:nth-child(2)::before { margin-right: auto; font-weight: 500; text-align: left; }
  .portal-ui .table-mobile-cards tbody td:last-child { align-items: flex-start; }
  .portal-ui .table-mobile-cards tfoot { display: block; padding: 0 10px 10px; }
  .portal-ui .table-mobile-cards tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 10px; background: #f7f8fa; border: 1px solid var(--portal-border); border-radius: 8px; }
  .portal-ui .table-mobile-cards tfoot th, .portal-ui .table-mobile-cards tfoot td { display: block; padding: 5px !important; border: 0; font-size: 13px; }
  .portal-ui .table-mobile-cards tfoot th::before, .portal-ui .table-mobile-cards tfoot td::before { display: block; margin-bottom: 2px; color: var(--portal-muted); content: attr(data-label); font-size: 12px; font-weight: 500; }
  .portal-ui .table-mobile-cards tfoot .is-empty-action { display: none !important; }
  .portal-ui .table-responsive:has(.table-mobile-cards) { overflow: visible; }
  .portal-ui .table-mobile-cards tbody tr td[colspan] { grid-column: 1 / -1; }
  .portal-ui .table-mobile-cards tbody tr td[colspan]::before { content: none; }
  .portal-ui .message-bubble { max-width: 94%; }
  .portal-ui .messages-container { max-height: 48vh; padding: 12px; }
  .portal-ui .page-heading { align-items: flex-start; }
  .portal-contract-page .container.my-5 { width: min(100% - 24px, 1200px); margin: 16px auto !important; }
  .portal-document-preview { height: 80vh; min-height: min(440px, 80vh); }
  .portal-document-page .card-header .d-flex { align-items: flex-start !important; flex-direction: column; }
  .portal-document-heading-row { align-items: flex-start; flex-direction: column; gap: 16px; }
  .portal-document-summary-heading { padding: 17px; }
  .portal-document-heading-copy h2 { font-size: 18px; line-height: 1.4; }
  .portal-document-actions { width: 100%; }
  .portal-document-actions .btn { flex: 1 1 auto; }
  .portal-document-attachments .list-group-item { align-items: flex-start !important; gap: 12px; padding: 12px 14px; }
  .portal-document-attachments .list-group-item > i { flex: 0 0 auto; margin-top: 5px; }
  .portal-document-preview-panel .card-body { padding: 8px; }
  .portal-contract-page .section-title { font-size: 20px; }
  .portal-login-page { display: block; padding: 0; background: #e9edf3 !important; }
  .portal-login-page .portal-login-layout { width: 100%; min-height: 100vh; min-height: 100svh; grid-template-columns: minmax(0, 1fr); overflow: visible; border: 0; border-radius: 0; }
  .portal-login-brand-panel { min-height: 0; padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left)); color: var(--portal-ink); background: #fff; border-right: 0; border-bottom: 1px solid var(--portal-border); }
  .portal-login-brand-block { display: none; }
  .portal-login-brand-footer { justify-content: flex-start; margin-top: 0; }
  .portal-login-brand-mark { padding: 0; background: transparent; }
  .portal-login-brand-mark img { width: 112px; height: 42px; }
  .portal-login-brand-copy, .portal-login-copyright { display: none; }
  .portal-login-main { align-items: flex-start; padding: 38px max(22px, 7vw) max(28px, env(safe-area-inset-bottom)); }
  .portal-login-form-wrap { width: min(100%, 420px); }
  .portal-login-intro { margin-bottom: 24px; }
  .portal-login-title { font-size: 24px; }
}
@media (max-width: 420px) {
  .portal-topbar { padding: 0 12px; }
  .portal-account-name { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-sheet { padding-right: 14px; padding-left: 14px; }
  .portal-ui .actions-group { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-ui *, .portal-ui *::before, .portal-ui *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* KAMNET portal shell v2: a quiet horizontal workspace, without a sidebar. */
.portal-app { display: block; min-height: 100vh; padding: 0 16px; background: var(--portal-ground); }
.portal-main { width: min(100%, 1360px); min-height: 100vh; margin: 0 auto; }
.portal-app .portal-topbar { position: sticky; top: 0; z-index: 1020; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 22px; padding: 0 34px; background: var(--portal-surface); border-bottom: 1px solid var(--portal-border); }
.portal-brand-horizontal { display: inline-flex; min-width: 220px; align-items: center; gap: 14px; color: var(--portal-ink) !important; text-decoration: none; }
.portal-brand-horizontal img { display: block; width: 94px; height: 36px; object-fit: contain; object-position: left center; }
.portal-brand-horizontal span { max-width: 120px; color: var(--portal-muted); font-size: 12px; line-height: 1.25; }
.portal-primary-nav { display: flex; min-width: 0; align-items: stretch; gap: 4px; align-self: stretch; }
.portal-primary-link { position: relative; display: inline-flex; min-height: 48px; align-items: center; gap: 8px; padding: 0 12px; color: #4f5663 !important; border: 0; border-bottom: 2px solid transparent; border-radius: 0; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.portal-primary-link:hover { color: var(--portal-ink) !important; background: transparent; }
.portal-primary-link.is-active { color: var(--portal-navy) !important; background: transparent; border-bottom-color: var(--portal-navy); font-weight: 600; }
.portal-nav-count { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; margin-left: 1px; padding: 0 5px; color: var(--portal-orange); background: var(--portal-orange-soft); border: 1px solid var(--portal-orange-border); border-radius: 10px; font-size: 11px; font-variant-numeric: tabular-nums; }
.portal-topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.portal-account-button { min-height: 44px; gap: 8px; padding: 4px 7px; }
.portal-account-mark { color: #4f5663; background: var(--portal-active); }
.portal-menu-trigger { display: none; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; color: var(--portal-navy); background: #fff; border: 1px solid var(--portal-border); border-radius: 6px; font: 600 14px "Karla", sans-serif; }
.portal-menu-trigger:hover { background: #f8f9fb; }
.portal-sheet { margin: 0 0 10px; padding: 30px 34px 36px; background: var(--portal-surface); border: 1px solid #e6e9ef; border-radius: var(--portal-radius-sheet); }
.portal-page-heading { margin-bottom: 25px; }
.portal-page-heading h1 { font-size: 23px; }
.portal-footer { padding: 3px 18px 16px; }
.portal-nav-modal { --bs-modal-zindex: 1060; }
.portal-nav-modal .modal-dialog { margin: 0; }
.portal-nav-modal .modal-content { min-height: 100dvh; border: 0; border-radius: 0; }
.portal-nav-modal-header { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 10px 18px; background: var(--portal-ground); border-bottom: 1px solid var(--portal-border); }
.portal-nav-close { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--portal-ink); background: #fff; border: 1px solid var(--portal-border); border-radius: 50%; font-size: 18px; }
.portal-nav-modal .modal-body { width: min(100%, 660px); margin: 0 auto; padding: 30px 22px; }
.portal-nav-modal-caption { margin: 0 0 12px; color: var(--portal-muted); font-size: 13px; }
.portal-mobile-menu-links { border-top: 1px solid var(--portal-rule); }
.portal-mobile-menu-link { display: flex; min-height: 58px; align-items: center; gap: 12px; padding: 0 4px; color: var(--portal-ink) !important; border-bottom: 1px solid var(--portal-rule); text-decoration: none; font-size: 19px; font-weight: 500; }
.portal-mobile-menu-link > .portal-mobile-menu-label { flex: 1 1 auto; min-width: 0; }
.portal-mobile-menu-link > i { color: #828996; font-size: 13px; }
.portal-mobile-menu-link:hover { color: var(--portal-ink) !important; background: #f3f5f7; }
.portal-mobile-menu-link.is-active { color: var(--portal-ink) !important; background: var(--portal-active); font-weight: 600; }
.portal-mobile-menu-link.is-active > i { color: var(--portal-ink); }
.portal-mobile-menu-account { display: grid; gap: 0; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--portal-border); }
.portal-mobile-menu-account p { margin: 0 0 8px; color: var(--portal-muted); font-size: 13px; }
.portal-mobile-menu-account a,
.portal-mobile-menu-account button { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 10px; padding: 0; color: var(--portal-ink); background: transparent; border: 0; text-align: left; text-decoration: none; font: inherit; font-size: 14px; cursor: pointer; }
.portal-mobile-menu-account a i,
.portal-mobile-menu-account button i { width: 18px; color: var(--portal-muted); text-align: center; }

/* Overview: balance and recent documents lead, supporting account data follows. */
.portal-overview-primary { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 1.55fr); gap: 18px; align-items: stretch; }
.portal-balance-lead, .portal-overview-documents { min-width: 0; padding: 23px 25px; background: #fff; border: 1px solid var(--portal-border); border-radius: var(--portal-radius-card); }
.portal-balance-lead { display: flex; min-height: 190px; flex-direction: column; justify-content: space-between; background: #f8f9fb; border-top: 2px solid var(--portal-orange-brand); }
.portal-section-eyebrow { margin: 0 0 10px; color: var(--portal-muted); font-size: 13px; font-weight: 500; }
.portal-balance-value { display: flex; align-items: baseline; gap: 7px; margin: 0; color: var(--portal-navy); font-variant-numeric: tabular-nums; }
.portal-balance-value strong { font-size: clamp(30px, 3vw, 40px); font-weight: 600; letter-spacing: -.04em; line-height: 1.15; }
.portal-balance-value span { color: var(--portal-muted); font-size: 16px; }
.portal-balance-value.is-negative { color: var(--portal-negative); }
.portal-inline-action { display: inline-flex; min-height: 36px; align-items: center; gap: 8px; color: var(--portal-navy); text-decoration: none; font-size: 13px; font-weight: 600; }
.portal-inline-action:hover { color: var(--portal-orange); }
.portal-inline-action i, .portal-text-link i, .portal-list-more i { font-size: 10px; }
.portal-overview-documents { display: flex; flex-direction: column; }
.portal-panel-heading { align-items: center; margin-bottom: 10px; }
.portal-panel-heading h2 { color: var(--portal-navy); font-size: 16px; }
.portal-panel-heading p { font-size: 13px; }
.portal-panel-heading > .portal-text-link { margin-top: 0; }
.portal-text-link { font-size: 13px; }
.portal-data-list { border-top-color: var(--portal-rule); }
.portal-overview .portal-data-row { min-height: 62px; padding: 10px 2px; }
.portal-overview .portal-document-list .portal-data-row { min-height: 60px; }
.portal-data-primary { font-size: 13px; }
.portal-data-secondary { font-size: 13px; }
.portal-data-secondary > span { padding: 0 3px; color: #a0a5ae; }
.portal-data-amount { font-size: 13px; }
.portal-data-amount.is-positive { color: var(--portal-positive); }
.portal-data-amount.is-negative { color: var(--portal-negative); }
.portal-status-chip { color: var(--portal-muted); font-size: 12px; }
.portal-overview-secondary { display: grid; grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.portal-overview-secondary > .portal-overview-panel { min-width: 0; padding: 20px 22px; background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: var(--portal-radius-card); }
.portal-overview-secondary .portal-panel-heading { min-height: 34px; margin-bottom: 10px; }
.portal-overview-secondary .portal-overview-row { padding: 13px 0; }
.portal-overview-secondary .portal-overview-row:last-child { border-bottom: 0; }
.portal-overview .portal-empty-inline { padding: 12px 0 0; background: transparent; border: 0; border-radius: 0; }
.portal-ticket-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid var(--portal-border); border-radius: 5px; color: #414854; background: #f3f4f6; font-size: 12px; font-weight: 600; line-height: 1.2; }
.portal-ticket-status.is-new { color: #762126; background: #fff2f2; border-color: #edd1d2; }
.portal-ticket-status.is-open { color: #684000; background: #fff5df; border-color: #f0d7a2; }
.portal-ticket-status.is-resolved { color: #164d30; background: #eaf5ed; border-color: #c9e3d1; }
.portal-empty-inline { padding: 13px 14px; border-radius: 6px; }
.portal-support-note { padding: 16px; background: #f7f8fa; border-radius: 8px; }
.portal-support-note h6 { margin: 0 0 4px; color: var(--portal-navy); font-size: 14px; }
.portal-support-note p { margin: 0 0 12px; color: var(--portal-muted); font-size: 13px; }

@media (max-width: 1100px) {
  .portal-app { padding: 0 10px; }
  .portal-app .portal-topbar { gap: 12px; padding: 0 34px; }
  .portal-brand-horizontal { min-width: 185px; gap: 9px; }
  .portal-brand-horizontal img { width: 82px; }
  .portal-brand-horizontal span { max-width: 100px; font-size: 11px; }
  .portal-primary-nav { display: none; }
  .portal-account { display: none; }
  .portal-document-page .portal-account,
  .portal-contract-page .portal-account { display: block; }
  .portal-document-page .portal-account-name,
  .portal-document-page .portal-account-chevron,
  .portal-contract-page .portal-account-name,
  .portal-contract-page .portal-account-chevron { display: none; }
  .portal-menu-trigger { display: inline-flex; }
}
@media (max-width: 991.98px) {
  .portal-app { padding: 0 10px; }
  .portal-app .portal-topbar { min-height: 68px; padding: 0 24px; }
  .portal-primary-nav { display: none; }
  .portal-menu-trigger { display: inline-flex; }
  .portal-sheet { margin-bottom: 10px; padding: 24px 24px 30px; }
  .portal-footer { padding: 4px 14px 16px; }
  .portal-overview-primary { grid-template-columns: minmax(220px, .72fr) minmax(0, 1.4fr); }
  .portal-overview-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .portal-overview-tickets { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .portal-app { padding: 0; }
  .portal-main { min-height: 100vh; }
  .portal-app .portal-topbar { min-height: 64px; padding: 0 18px; }
  .portal-brand-horizontal { min-width: 0; }
  .portal-brand-horizontal img { width: 84px; height: 32px; }
  .portal-brand-horizontal span { max-width: 100px; font-size: 11px; }
  .portal-account-name, .portal-account-chevron { display: none; }
  .portal-account-button { min-height: 44px; padding: 4px; }
  .portal-topbar-actions { gap: 6px; }
  .portal-menu-trigger { min-height: 44px; padding: 0 10px; }
  .portal-sheet { margin: 0; padding: 24px 20px 32px; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
  .portal-page-heading { margin-bottom: 19px; }
  .portal-overview-primary, .portal-overview-secondary { grid-template-columns: 1fr; gap: 16px; }
  .portal-overview-tickets { grid-column: auto; }
  .portal-balance-lead { min-height: 158px; padding: 20px 21px; }
  .portal-overview-documents { padding: 20px 21px; }
  .portal-overview-secondary { margin-top: 16px; }
  .portal-overview-secondary > .portal-overview-panel { padding: 18px; }
  .portal-ui .table-mobile-cards tbody tr { margin-bottom: 8px; }
  .portal-nav-modal-header { min-height: 60px; padding: 8px 16px; }
  .portal-nav-modal .modal-body { padding: 23px 20px; }
  .portal-mobile-menu-link { min-height: 54px; font-size: 18px; }
}
@media (max-width: 420px) {
  .portal-app .portal-topbar { padding: 0 14px; }
  .portal-brand-horizontal { gap: 7px; }
  .portal-brand-horizontal img { width: 74px; }
  .portal-brand-horizontal span { max-width: 92px; }
  .portal-menu-trigger { gap: 6px; padding: 0 9px; font-size: 13px; }
  .portal-sheet { padding-right: 16px; padding-left: 16px; }
  .portal-balance-value strong { font-size: 32px; }
  .portal-panel-heading { align-items: flex-start; }
}

/* KAMNET account workspace: full-width brand bar, focused content and a useful footer. */
.portal-app { padding: 0; }
.portal-main { width: 100%; min-height: 100vh; margin: 0; }
.portal-app .portal-topbar { width: 100%; min-height: 76px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--portal-border); }
.portal-topbar-inner { display: flex; width: min(100%, 1440px); min-height: 76px; align-items: center; justify-content: space-between; gap: 22px; margin: 0 auto; }
.portal-brand-horizontal { min-width: 190px; gap: 12px; }
.portal-primary-nav { align-items: center; gap: 3px; }
.portal-primary-link { min-height: 42px; padding: 0 12px; border: 0; border-radius: 7px; }
.portal-primary-link:hover { background: #f6f7f9; }
.portal-primary-link.is-active { color: var(--portal-navy) !important; background: #f0f2f7; border: 0; }
.portal-sheet { width: min(calc(100% - 64px), 1280px); margin: 32px auto 42px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.portal-page-heading { min-height: 42px; margin-bottom: 26px; }
.portal-footer { width: 100%; padding: 0; background: #fff; border-top: 1px solid var(--portal-border); }
.portal-footer-inner { display: grid; width: min(calc(100% - 64px), 1280px); min-height: 76px; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin: 0 auto; }
.portal-footer-brand { display: inline-flex; width: fit-content; align-items: center; gap: 10px; color: var(--portal-ink) !important; text-decoration: none; }
.portal-footer-brand img { display: block; width: 76px; height: 29px; object-fit: contain; object-position: left center; }
.portal-footer-brand span { color: var(--portal-muted); font-size: 12px; }
.portal-footer-inner p { margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-footer-support { justify-self: end; color: var(--portal-navy) !important; font-size: 13px; font-weight: 600; text-decoration: none; }
.portal-footer-support i { margin-left: 5px; color: var(--portal-muted); font-size: 10px; }
.portal-footer-support:hover { text-decoration: underline; text-underline-offset: 3px; }
.portal-ticket-thread { overflow: hidden; border-radius: 12px; }
.portal-ticket-thread > .card-header { min-height: 82px; padding: 18px 24px; }
.portal-ticket-thread .messages-container { padding-top: 30px; padding-bottom: 30px; background: #f5f7fa; }
.portal-ticket-thread .message-customer { background: #e9eef7; border-color: #dbe3f0; }
.portal-ticket-thread .message-staff { background: #fff; }
.portal-ticket-thread .portal-chat-composer { padding-top: 18px; padding-bottom: 20px; }
.portal-ticket-thread .portal-chat-compose-box { border-radius: 9px; }

@media (max-width: 1100px) {
  .portal-app .portal-topbar { padding-right: 24px; padding-left: 24px; }
  .portal-topbar-inner { min-height: 72px; }
  .portal-primary-nav, .portal-account { display: none; }
  .portal-menu-trigger { display: inline-flex; }
  .portal-sheet { width: min(calc(100% - 48px), 1280px); }
}
@media (max-width: 767.98px) {
  .portal-app .portal-topbar { min-height: 64px; padding: 0 18px; }
  .portal-topbar-inner { min-height: 64px; gap: 10px; }
  .portal-sheet { width: 100%; margin: 24px auto 30px; padding: 0 20px; }
  .portal-page-heading { min-height: 38px; margin-bottom: 20px; }
  .portal-footer-inner { width: calc(100% - 40px); min-height: 90px; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; }
  .portal-footer-brand { grid-column: 1; grid-row: 1; }
  .portal-footer-inner p { grid-column: 2; grid-row: 1; text-align: right; }
  .portal-footer-support { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .portal-ticket-thread > .card-header { min-height: 0; padding: 15px 17px; }
  .portal-ticket-thread .messages-container { padding: 22px 16px; }
}
@media (max-width: 420px) {
  .portal-app .portal-topbar { padding-right: 14px; padding-left: 14px; }
  .portal-sheet { padding-right: 16px; padding-left: 16px; }
  .portal-footer-inner { width: calc(100% - 32px); }
}

/* Individual customer workspaces: services, documents, support and account. */
.portal-module { overflow: hidden; }
.portal-count-label { flex: 0 0 auto; color: var(--portal-muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Services and account balance have a compact, ledger-like hierarchy. */
.portal-tariffs-module > .card-header { padding: 0 20px; }
.portal-tariffs-module .tab-pane { min-width: 0; }
.portal-subview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.portal-subview-heading h2 { margin: 0 0 3px; color: var(--portal-ink); font-size: 16px; font-weight: 600; }
.portal-subview-heading p { margin: 0; color: var(--portal-muted); font-size: 13px; }
.portal-action-tariffs .table-responsive { border-top: 1px solid var(--portal-rule); }
.portal-action-tariffs .table thead th { padding-top: 12px; padding-bottom: 12px; font-size: 11px; }
.portal-action-tariffs .table tbody tr > * { padding-top: 13px; padding-bottom: 13px; }
.portal-action-tariffs #services-tab-pane .table tbody td:first-child { min-width: 180px; color: var(--portal-ink); font-weight: 600; }
.portal-action-tariffs .table tfoot > tr > * { padding-top: 14px; padding-bottom: 14px; background: #f7f8fa; }
.portal-action-tariffs .table tfoot th:first-child { color: var(--portal-muted); font-size: 12px; }
.portal-action-tariffs .table tfoot .fs-5 { color: var(--portal-navy); font-size: 17px !important; font-variant-numeric: tabular-nums; }
.portal-money-mark { display: inline-block; min-width: 88px; color: var(--portal-ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.portal-money-mark.is-outgoing { color: #7f1d22; }
.portal-money-mark.is-incoming { color: #164d30; }
.portal-balance-heading { padding-bottom: 13px; }
.portal-balance-heading + .table-responsive { border-top: 1px solid var(--portal-rule); }
.portal-action-tariffs #balance-tab-pane .table td:nth-child(2), .portal-action-tariffs #balance-tab-pane .table td:nth-child(3), .portal-action-tariffs #balance-tab-pane .table td:nth-child(4) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-action-tariffs #balance-tab-pane .table td:nth-child(4) { font-weight: 600; }
.portal-action-tariffs #balance-tab-pane .table td:nth-child(5) { min-width: 210px; }
.portal-action-tariffs #balance-tab-pane .table td:last-child { white-space: nowrap; }
.portal-action-tariffs .card-footer { border-top: 1px solid var(--portal-rule); }
.portal-action-tariffs .accordion-button { padding: 14px 20px; font-weight: 500; }
.portal-action-tariffs .accordion-body { background: #fafbfc; }

/* Services: a customer-facing billable list, without network provisioning details. */
.portal-service-list { margin: 0; padding: 0 26px; list-style: none; border-top: 1px solid var(--portal-rule); }
.portal-service-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 58px; padding: 12px 0; border-bottom: 1px solid var(--portal-rule); }
.portal-service-information { display: grid; min-width: 0; gap: 3px; }
.portal-service-name { min-width: 0; color: var(--portal-ink); font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.portal-service-period { color: var(--portal-muted); font-size: 13px; line-height: 1.4; }
.portal-service-price { color: var(--portal-ink); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.portal-service-price.is-discount { color: #24704d; }
.portal-service-total { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 26px 20px; background: var(--portal-raised); border-top: 1px solid var(--portal-border); }
.portal-service-total-copy { display: grid; gap: 4px; }
.portal-service-total-copy > span { color: var(--portal-ink); font-size: 14px; font-weight: 600; }
.portal-service-total-copy > small { color: var(--portal-muted); font-size: 12px; line-height: 1.45; }
.portal-service-total-values { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
.portal-service-total-values strong { color: var(--portal-navy); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-overview-service-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--portal-rule); }
.portal-overview-service-summary > span { color: var(--portal-muted); font-size: 13px; font-weight: 600; }
.portal-overview-service-summary > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; }
.portal-overview-service-summary strong { color: var(--portal-navy); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Help center: readable article width and clear, keyboard-friendly topic links. */
.portal-help-module > .card-header { min-height: 76px; padding: 16px 22px; }
.portal-help-module > .card-header h2 { color: var(--portal-ink); font-size: 16px; font-weight: 600; }
.portal-help-module > .card-header p { margin-top: 3px; color: var(--portal-muted); font-size: 13px; }
.portal-help-mark { display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; align-items: center; justify-content: center; color: var(--portal-navy); background: #f0f2f7; border: 1px solid #e5e8ef; border-radius: 12px; font-size: 17px; }
.portal-help-back { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin: -4px 0 12px; color: var(--portal-muted) !important; font-size: 14px; font-weight: 600; text-decoration: none; }
.portal-help-back:hover { color: var(--portal-navy) !important; }
.portal-help-article { max-width: 78ch; padding: 4px 0 8px; }
.portal-help-article > h3 { margin: 0 0 14px; color: var(--portal-navy); font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
.portal-help-content { color: var(--portal-ink); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.portal-help-content > :first-child { margin-top: 0; }
.portal-help-content > :last-child { margin-bottom: 0; }
.portal-help-content a { font-weight: 600; }
.portal-help-content table { width: 100%; border-collapse: collapse; }
.portal-help-content th, .portal-help-content td { padding: 8px 10px; border: 1px solid var(--portal-border); text-align: left; vertical-align: top; }
.portal-help-topics { max-width: 900px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--portal-rule); }
.portal-help-topics > h3 { margin: 0 0 12px; color: var(--portal-ink); font-size: 15px; font-weight: 600; }
.portal-help-topics ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; padding: 0; list-style: none; }
.portal-help-topics a { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; color: var(--portal-ink); background: #fff; border: 1px solid var(--portal-border); border-radius: 7px; font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.portal-help-topics a:hover { color: var(--portal-navy); background: #f8f9fb; border-color: #cbd2dc; }
.portal-help-topics a span { min-width: 0; overflow-wrap: anywhere; }
.portal-help-topics a i { flex: 0 0 auto; color: var(--portal-muted); font-size: 12px; }
.portal-help-contact { display: flex; max-width: 900px; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--portal-rule); }
.portal-help-contact strong { color: var(--portal-ink); font-size: 14px; }
.portal-help-contact p { margin: 3px 0 0; color: var(--portal-muted); font-size: 13px; line-height: 1.45; }
@media (max-width: 767.98px) {
  .portal-help-module > .card-header { padding: 14px 16px; }
  .portal-help-module > .card-body { padding: 18px 16px; }
  .portal-help-article > h3 { font-size: 20px; }
  .portal-help-content { font-size: 16px; }
  .portal-help-topics ul { grid-template-columns: minmax(0, 1fr); }
  .portal-help-contact { align-items: flex-start; flex-direction: column; gap: 12px; }
  .portal-help-contact .btn { width: 100%; justify-content: center; }
}

/* Documents: the document identity leads; status and actions stay quiet but clear. */
.portal-documents-module .card-header { min-height: 54px; }
.portal-documents-module .table-responsive { border-top: 1px solid var(--portal-rule); }
.portal-documents-module .table thead th { padding: 12px 14px; }
.portal-documents-module .table tbody td { padding-top: 14px; padding-bottom: 14px; }
.portal-documents-module .table tbody td:nth-child(1) { width: 18%; color: var(--portal-muted); font-variant-numeric: tabular-nums; }
.portal-documents-module .table tbody td:nth-child(2) { color: var(--portal-ink); font-weight: 600; }
.portal-documents-module .table tbody td:nth-child(3) { color: var(--portal-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-documents-module .actions-group { justify-content: flex-end; }
.portal-documents-module .actions-group .btn { min-width: 36px; }
.portal-empty-state { display: grid; min-height: 145px; align-content: center; justify-items: center; gap: 5px; padding: 24px; text-align: center; }
.portal-empty-state strong { color: var(--portal-ink); font-size: 15px; font-weight: 600; }
.portal-empty-state p { max-width: 380px; margin: 0; color: var(--portal-muted); font-size: 13px; }

/* Support inbox and conversation. */
.portal-helpdesk-view .alert { margin-bottom: 16px; }
.portal-ticket-heading h2 { margin: 0; color: var(--portal-ink); font-size: 16px; font-weight: 600; line-height: 1.35; }
.portal-ticket-heading p { margin: 4px 0 0; color: var(--portal-muted); font-size: 13px; font-weight: 400; }
.portal-ticket-kicker { margin: 0 0 4px; color: var(--portal-muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.portal-ticket-list .card-header { min-height: 72px; gap: 18px; }
.portal-ticket-list .table-responsive { border-top: 1px solid var(--portal-rule); }
.portal-ticket-list .table thead th { padding: 12px 12px; }
.portal-ticket-list .table tbody td { padding-top: 13px; padding-bottom: 13px; }
.portal-ticket-list .table tbody td:nth-child(1) { color: var(--portal-muted); font-variant-numeric: tabular-nums; }
.portal-ticket-list .table tbody td:nth-child(2) { min-width: 180px; color: var(--portal-ink); font-weight: 600; }
.portal-ticket-list .table tbody td:nth-child(5) { color: var(--portal-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-ticket-list .table tbody td:last-child { text-align: right; white-space: nowrap; }
.portal-ticket-thread > .card-header { align-items: center; gap: 16px; padding: 16px 20px; }
.portal-ticket-thread .portal-ticket-heading { min-width: 0; }
.portal-ticket-thread .portal-ticket-heading h2 { overflow-wrap: anywhere; }
.portal-ticket-thread > .card-header > .btn { flex: 0 0 auto; }
.portal-ticket-thread .card-body.p-0 { padding: 0; }
.portal-ticket-thread .messages-container { background: #f8f9fb; }
.portal-ticket-thread .message-bubble { max-width: 100%; }
.portal-ticket-thread .message-bubble .card-body { padding: 13px 16px; }
.portal-ticket-thread .message-customer .message-body blockquote { color: #424957; background: rgba(255,255,255,.72); border-color: #aeb8c7 !important; }
.portal-ticket-thread .card-footer { padding: 18px clamp(16px, 4vw, 48px); }
.portal-ticket-thread .attachment-item { border-radius: 9px; }
.portal-helpdesk-view .pagination { padding: 12px 16px; }
.portal-helpdesk-view #newTicketModal .modal-header { align-items: center; }

/* Notices: unread messages are legible in the list without loud saturated badges. */
.portal-notices-view .portal-notice-list .card-header { min-height: 64px; gap: 16px; }
.portal-notice-list .accordion { border-top: 1px solid var(--portal-rule); }
.portal-notice-list .accordion-item { border-right: 0; border-bottom: 1px solid var(--portal-rule); border-left: 0; }
.portal-notice-list .accordion-item:first-child { border-top: 0; }
.portal-notice-list .accordion-item:last-child { border-bottom: 0; }
.portal-notice-list .accordion-button { min-height: 60px; gap: 12px; padding: 12px 20px; }
.portal-notice-list .accordion-button::after { margin-left: 4px; }
.portal-notice-list .accordion-item.is-unread .accordion-button > .me-auto { color: var(--portal-ink); font-weight: 600; }
.portal-notice-list .accordion-item.is-read .accordion-button > .me-auto { color: #4b515d; font-weight: 500; }
.portal-notice-list .portal-notice-heading { display: grid; min-width: 0; gap: 2px; margin-right: auto !important; text-align: left; white-space: normal; }
.portal-notice-list .portal-notice-subject { min-width: 0; overflow-wrap: anywhere; }
.portal-notice-list .portal-notice-date { min-width: 0; color: var(--portal-muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1.35; text-align: left; }
.portal-notice-list .accordion-item.is-urgent .accordion-button > i { color: #8b272b !important; }
.portal-notice-list .accordion-button .badge { margin-right: 8px !important; }
.portal-notice-list .accordion-button > .badge { flex: 0 0 auto; }
.portal-notice-list .accordion-body { padding: 18px 22px 20px; color: #353a44; line-height: 1.6; }
.portal-notice-list .accordion-body p { margin-bottom: 14px; }
.portal-notice-list .portal-notice-read-feedback { margin-top: 12px; color: #7f1d22; font-size: 13px; line-height: 1.45; }
.portal-notice-list .portal-notice-read-feedback[hidden] { display: none; }
.portal-notice-list .accordion-body hr { margin: 14px 0; border-color: var(--portal-rule); }
.portal-urgent-notice { overflow: hidden; border-color: #e3b7b9 !important; }
.portal-urgent-notice-header { color: #762126; background: #fff2f2; border-bottom-color: #edd1d2 !important; }
.portal-urgent-notice-header .modal-title { color: inherit; }
.portal-urgent-placeholder { border-color: #e3b7b9; }
.portal-urgent-placeholder .card-body { display: flex; align-items: baseline; gap: 12px; }
.portal-urgent-placeholder strong { color: #762126; font-size: 14px; }
.portal-urgent-placeholder p { color: var(--portal-muted); font-size: 13px; }

/* Profile and security: account facts grouped into quiet, readable rows. */
.portal-profile-view { align-items: start; }
.portal-profile-view .card-header { min-height: 54px; }
.portal-profile-details > .card-body > .row { margin-right: 0; margin-left: 0; padding: 10px 0 12px; border-bottom: 1px solid var(--portal-rule); }
.portal-profile-details > .card-body > .row:first-child { padding-top: 0; }
.portal-profile-details > .card-body > .row:last-child { border-bottom: 0; }
.portal-profile-view .form-label { display: block; margin-bottom: 3px; color: var(--portal-muted) !important; font-size: 12px; font-weight: 500; }
.portal-profile-data { margin-bottom: 0; }
.portal-profile-data dt { margin-bottom: 3px; color: var(--portal-muted); font-size: 12px; font-weight: 500; }
.portal-profile-data dd { margin-bottom: 0; color: var(--portal-ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.portal-profile-details h6.text-primary, .portal-profile-security h6.text-primary { color: var(--portal-ink) !important; font-size: 14px; font-weight: 600; }
.portal-profile-details .accordion { margin-top: 20px; }
.portal-profile-details .accordion-item { border-radius: 6px; }
.portal-profile-details .accordion-button { min-width: 0; text-align: left; white-space: normal; }
.portal-profile-details .accordion-button > span { min-width: 0; overflow-wrap: anywhere; }
.portal-profile-details .accordion-button > i { flex: 0 0 auto; }
.portal-profile-details .table-responsive { border: 1px solid var(--portal-rule); border-radius: 6px; }
.portal-profile-details .table tbody td { padding-top: 10px; padding-bottom: 10px; }
.portal-profile-details .table tbody td:first-child { color: var(--portal-muted); }
.portal-profile-security .bg-light { background: #f7f8fa !important; }
.portal-profile-security .portal-profile-surface { border-radius: 6px; }
.portal-bank-account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.portal-profile-security .copy_by_ppm { display: block; width: auto; max-width: 100%; color: var(--portal-ink); font-size: 14px !important; line-height: 1.6; overflow-wrap: anywhere; }
.portal-copy-account { display: inline-flex; min-width: 78px; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.portal-copy-account i { font-size: 12px; }
.portal-copy-feedback { margin: 9px 0 0; color: var(--portal-positive); font-size: 12px; line-height: 1.45; }
.portal-copy-feedback[data-status="error"] { color: var(--portal-negative); }
.portal-copy-feedback[hidden] { display: none; }
.portal-profile-security .display-6 { color: var(--portal-navy); font-size: 26px; font-variant-numeric: tabular-nums; }
.portal-profile-security .portal-profile-balance-surface { display: flex; min-height: 64px; align-items: baseline; justify-content: space-between; gap: 12px; }
.portal-profile-security .portal-profile-balance-label { color: var(--portal-muted); font-size: 13px; font-weight: 500; }
.portal-profile-security .portal-profile-balance-amount { margin: 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.2; white-space: nowrap; }
.portal-profile-security .portal-profile-balance-amount.is-positive { color: var(--portal-positive); }
.portal-profile-security .portal-profile-balance-amount.is-negative { color: var(--portal-negative); }
.portal-profile-pin-surface { padding: 14px; background: #f7f8fa; border-radius: 6px; }
.portal-profile-pin-surface > .card-body { padding: 0; }
.portal-profile-security .portal-support-note { margin-top: 10px; }
.portal-profile-security .portal-support-note .btn { align-self: flex-start; }
.portal-profile-security .card.bg-light { border-radius: 6px; }
.portal-profile-security .card.bg-light .card-body { padding: 14px; }
.portal-profile-services { padding: 14px; background: #f7f8fa; border-radius: 6px; }
.portal-profile-services p { color: var(--portal-muted); font-size: 13px; line-height: 1.5; }
.portal-profile-services .btn { min-height: 44px; align-items: center; }
.portal-profile-details > .card-header { flex-wrap: wrap; }
.portal-profile-heading { min-width: 0; }
.portal-profile-heading h2 { overflow-wrap: anywhere; }
.portal-profile-edit-link { display: inline-flex; min-height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; }

@media (max-width: 767.98px) {
  .portal-service-list { padding-right: 18px; padding-left: 18px; }
  .portal-profile-edit-link { width: 100%; }
  .portal-service-total { align-items: flex-start; flex-direction: column; padding-right: 18px; padding-left: 18px; }
  .portal-service-total-values { justify-content: flex-start; }
  .portal-ui .btn,
  .portal-ui .nav-tabs .nav-link,
  .portal-ui .pagination .page-link { min-height: 44px; }
  .portal-ui .form-control, .portal-ui .form-select { min-height: 44px; }
  .portal-ui .modal-header .btn-close { width: 44px; height: 44px; }
  .portal-subview-heading { align-items: flex-start; padding: 17px 16px 12px; }
  .portal-subview-heading p { max-width: 42ch; }
  .portal-tariffs-module > .card-header { padding: 0 15px; }
  .portal-action-tariffs .table-responsive { border-top: 0; }
  .portal-action-tariffs .table-mobile-cards tbody { padding: 10px 12px 12px; }
  .portal-action-tariffs .table-mobile-cards tbody tr { gap: 3px 12px; }
  .portal-action-tariffs .table-mobile-cards tbody td { font-size: 14px; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(2),
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(3) { display: flex; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(5) { grid-column: 1 / -1; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
  .portal-action-tariffs .card-footer { padding: 12px; }
  .portal-documents-module .table-mobile-cards tbody td:first-child { width: 100%; color: var(--portal-muted); font-size: 13px; font-weight: 500; }
  .portal-documents-module .table-mobile-cards tbody td:nth-child(2) {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left !important;
    font-size: 14px;
  }
  .portal-documents-module .table-mobile-cards tbody td:last-child { align-items: flex-end; }
  .portal-ticket-list .card-header { align-items: flex-start !important; flex-direction: column; }
  .portal-ticket-list .card-header .btn { width: 100%; }
  .portal-ticket-list .table-mobile-cards tbody td:nth-child(2) { grid-column: 1 / -1; }
  .portal-ticket-list .table-mobile-cards tbody td:last-child { align-items: flex-start; }
  .portal-ticket-thread > .card-header { align-items: flex-start !important; flex-direction: column; padding: 14px 15px; }
  .portal-ticket-thread > .card-header .btn { align-self: flex-start; }
  .portal-ticket-thread .card-footer { padding: 16px 14px; }
  .portal-ui .portal-ticket-thread { height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 460px; }
  .portal-ticket-thread .messages-container { min-height: 0; max-height: none; padding: 18px 13px; }
  .portal-ticket-thread .portal-chat-message { gap: 9px; margin-bottom: 21px; }
  .portal-ticket-thread .portal-chat-avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; }
  .portal-ticket-thread .portal-chat-content { max-width: calc(100% - 36px); }
  .portal-ticket-thread .message-bubble .card-body { padding: 13px 14px; }
  .portal-ticket-thread .portal-chat-compose-footer { align-items: center; gap: 8px; padding: 8px; }
  .portal-ticket-thread .portal-chat-file-field { min-width: 0; }
  .portal-ticket-thread .portal-chat-file-field input[type="file"] { max-width: 100%; font-size: 11px; }
  .portal-ticket-thread .portal-chat-file-field .form-text { flex-basis: 100%; }
  .portal-ticket-thread .portal-chat-compose-footer > .btn { width: auto; min-width: 88px; padding-right: 10px; padding-left: 10px; }
  .portal-ticket-thread .portal-chat-compose-footer > .btn i { margin-right: 5px !important; }
  .portal-ticket-thread .portal-chat-compose-box textarea.form-control { min-height: 72px; padding: 11px 12px 7px; }
  .portal-ticket-thread .portal-chat-new-messages { min-height: 44px; }
  .portal-notice-list .card-header { align-items: flex-start !important; }
  .portal-notice-list .accordion-button { flex-wrap: wrap; gap: 7px 10px; padding: 12px 14px; }
  .portal-notice-list .accordion-button > .portal-notice-heading { flex: 1 1 calc(100% - 28px); }
  .portal-notice-list .accordion-button .badge { margin: 0 !important; }
  .portal-notice-list .portal-notice-date { font-size: 12px; }
  .portal-notice-list .accordion-body { padding: 15px; }
  .portal-profile-details > .card-body > .row { padding: 8px 0 10px; }
  .portal-bank-account-row { align-items: flex-start; gap: 8px; }
  .portal-profile-security .portal-profile-balance-surface { align-items: flex-start; flex-direction: column; gap: 4px; }
  .portal-profile-security .portal-profile-balance-amount { font-size: 23px; }
  .portal-copy-account { min-width: 72px; }
  .portal-profile-view .col-lg-7, .portal-profile-view .col-lg-5 { margin-bottom: 14px !important; }
  .portal-overview .portal-data-primary,
  .portal-overview .portal-data-amount { font-size: 14px; }
  .portal-overview .portal-status-chip,
  .portal-overview .portal-ticket-status { font-size: 12px; }
}
@media (max-width: 420px) {
  .portal-count-label { font-size: 11px; }
  .portal-subview-heading { gap: 8px; }
  .portal-money-mark { min-width: 78px; font-size: 12px; }
  .portal-urgent-placeholder .card-body { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* Logged-in workspace rhythm: slightly wider breathing room without changing the contract flow. */
.portal-app .portal-sheet { padding: 34px 40px 42px; }
.portal-app .portal-page-heading { margin-bottom: 30px; }
.portal-app .portal-module { margin-bottom: 24px; }
.portal-app .portal-module > .card-header { padding: 17px 22px; }
.portal-app .portal-module > .card-body:not(.p-0) { padding: 22px 24px; }
.portal-app .portal-module > .card-footer { padding: 16px 22px; }
.portal-app .portal-subview-heading { padding: 23px 26px 16px; }
.portal-document-page .portal-document-summary .card-body { padding: 22px 24px; }
.portal-document-page .portal-document-confirm .card-header { padding: 17px 22px; }
.portal-document-page .portal-document-confirm .card-body { padding: 22px 24px; }
.portal-document-page .portal-document-attachments .list-group-item { min-height: 62px; padding: 14px 20px; }

@media (max-width: 991.98px) {
  .portal-app .portal-sheet { padding: 28px 28px 36px; }
  .portal-app .portal-module > .card-body:not(.p-0) { padding: 20px 22px; }
  .portal-app .portal-subview-heading { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 767.98px) {
  .portal-app .portal-sheet { padding: 24px 20px 32px; }
  .portal-app .portal-page-heading { margin-bottom: 24px; }
  .portal-app .portal-module { margin-bottom: 20px; }
  .portal-app .portal-module > .card-header { padding: 15px 18px; }
  .portal-app .portal-module > .card-body:not(.p-0) { padding: 19px 20px; }
  .portal-app .portal-module > .card-footer { padding: 15px 18px; }
  .portal-app .portal-subview-heading { padding: 20px 18px 15px; }
  .portal-document-page .portal-document-summary .card-body { padding: 19px 20px; }
  .portal-document-page .portal-document-confirm .card-header { padding: 15px 18px; }
  .portal-document-page .portal-document-confirm .card-body { padding: 19px 20px; }
  .portal-document-page .portal-document-attachments .list-group-item { padding: 13px 16px; }
}

@media (max-width: 420px) {
  .portal-app .portal-sheet { padding-right: 16px; padding-left: 16px; }
  .portal-app .portal-module > .card-header { padding-right: 16px; padding-left: 16px; }
  .portal-app .portal-module > .card-body:not(.p-0) { padding-right: 17px; padding-left: 17px; }
  .portal-app .portal-module > .card-footer { padding-right: 16px; padding-left: 16px; }
  .portal-document-page .portal-document-summary .card-body { padding-right: 17px; padding-left: 17px; }
  .portal-document-page .portal-document-confirm .card-header { padding-right: 16px; padding-left: 16px; }
  .portal-document-page .portal-document-confirm .card-body { padding-right: 17px; padding-left: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-ui .btn { transition: none; }
}

/* Ticket chat: give the conversation room and keep new-message navigation with the history. */
.portal-ui .portal-ticket-thread {
  height: min(860px, calc(100vh - 220px));
  height: min(860px, calc(100dvh - 220px));
  min-height: 560px;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(22, 34, 54, .06);
}
.portal-ui .portal-ticket-thread > .card-body { flex-direction: column; }
.portal-chat-history { position: relative; display: flex; min-height: 0; flex: 1 1 auto; overflow: hidden; background: #f4f6f9; }
.portal-ui .portal-ticket-thread .messages-container {
  height: auto;
  max-height: none;
  padding: 28px clamp(18px, 4vw, 56px) 78px;
  background: #f4f6f9;
  scroll-behavior: smooth;
}
.portal-ui .portal-ticket-thread .portal-chat-content { max-width: min(90%, 980px); }
.portal-ui .portal-ticket-thread .portal-chat-message { gap: 13px; margin-bottom: 25px; }
.portal-ui .portal-ticket-thread .portal-chat-day { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 23px; color: var(--portal-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-ui .portal-ticket-thread .portal-chat-day::before, .portal-ui .portal-ticket-thread .portal-chat-day::after { width: min(13%, 88px); height: 1px; background: #d9dfe8; content: ""; }
.portal-ui .portal-ticket-thread .portal-chat-day span { padding: 4px 11px; background: #fff; border: 1px solid #e1e5eb; border-radius: 999px; }
.portal-ui .portal-ticket-thread .portal-chat-avatar { width: 36px; height: 36px; flex-basis: 36px; font-size: 12px; }
.portal-ui .portal-ticket-thread .portal-chat-meta { gap: 10px; margin-bottom: 7px; font-size: 13px; }
.portal-ui .portal-ticket-thread .portal-chat-meta .message-author { font-size: 13px; }
.portal-ui .portal-ticket-thread .portal-ticket-heading h2 { font-size: 18px; line-height: 1.4; }
.portal-ui .portal-ticket-thread .message-bubble { max-width: min(100%, 78ch); border-radius: 15px; box-shadow: 0 1px 2px rgba(22, 34, 54, .04); }
.portal-ui .portal-ticket-thread .message-bubble .card-body { padding: 15px 18px; }
.portal-ui .portal-ticket-thread .message-bubble .message-body { font-size: 17px; line-height: 1.65; }
.portal-ui .portal-ticket-thread .message-customer { background: #e6efff; border-color: #d1def3; border-bottom-right-radius: 5px; }
.portal-ui .portal-ticket-thread .message-staff { background: #fff; border-color: #dfe4ec; border-bottom-left-radius: 5px; }
.portal-ui .portal-ticket-thread .portal-chat-new-messages {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 16px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 15px;
  color: #fff;
  background: var(--portal-navy);
  border: 1px solid var(--portal-navy);
  border-radius: 999px;
  box-shadow: 0 5px 18px rgba(1, 0, 72, .2);
  font: 600 14px/1.3 "Karla", sans-serif;
}
.portal-ui .portal-ticket-thread .portal-chat-new-messages::before { content: "↓"; font-size: 17px; line-height: 1; }
.portal-ui .portal-ticket-thread .portal-chat-new-messages[hidden] { display: none; }
.portal-ui .portal-ticket-thread .portal-chat-new-messages:hover { color: #fff; background: #17145f; border-color: #17145f; }
.portal-ui .portal-ticket-thread .portal-chat-new-messages:focus-visible { outline: 3px solid var(--portal-orange-brand); outline-offset: 3px; }
.portal-ui .portal-ticket-thread .portal-chat-composer { padding: 17px clamp(18px, 4vw, 56px) 20px; }
.portal-ui .portal-ticket-thread .portal-chat-composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 1000px; }
.portal-ui .portal-ticket-thread .portal-chat-composer-heading h3 { font-size: 16px; }
.portal-ui .portal-ticket-thread .portal-chat-form { max-width: 1000px; }
.portal-ui .portal-ticket-thread .portal-chat-compose-box { border-radius: 10px; }
.portal-ui .portal-ticket-thread .portal-chat-compose-box textarea.form-control { min-height: 92px; font-size: 16px; line-height: 1.5; }

@media (max-width: 767.98px) {
  .portal-ui .portal-ticket-thread { height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 440px; }
  .portal-ui .portal-ticket-thread .messages-container { padding: 20px 14px 72px; }
  .portal-ui .portal-ticket-thread .portal-chat-message { gap: 9px; margin-bottom: 21px; }
  .portal-ui .portal-ticket-thread .portal-chat-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .portal-ui .portal-ticket-thread .portal-chat-content { max-width: calc(100% - 41px); }
  .portal-ui .portal-ticket-thread .message-bubble .card-body { padding: 13px 15px; }
  .portal-ui .portal-ticket-thread .portal-chat-composer { padding: 14px 14px 16px; }
  .portal-ui .portal-ticket-thread .portal-chat-composer-heading { align-items: flex-start; flex-direction: column; gap: 0; margin-bottom: 8px; }
  .portal-ui .portal-ticket-thread .portal-chat-compose-box textarea.form-control { min-height: 76px; }
  .portal-ui .portal-ticket-thread .portal-chat-new-messages { right: 12px; bottom: 12px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-ui .portal-ticket-thread .messages-container { scroll-behavior: auto; }
}

/* The standalone contract generator still uses its compact legacy header. */
.portal-contract-page .portal-document-topbar { display: flex; width: 100%; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--portal-border); }
.portal-contract-page .portal-document-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--portal-ink) !important; font-size: 13px; font-weight: 600; text-decoration: none; }
.portal-contract-page .portal-document-brand img { display: block; width: 94px; height: 36px; object-fit: contain; }
@media (max-width: 767.98px) {
  .portal-contract-page .portal-document-topbar { min-height: 64px; padding: 0 18px; }
  .portal-contract-page .portal-document-brand { gap: 7px; font-size: 11px; }
  .portal-contract-page .portal-document-brand img { width: 74px; height: 30px; }
}

/* Support inbox: each ticket is an easy-to-scan entry point back into its conversation. */
.portal-ticket-list > .card-header.portal-ticket-list-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; }
.portal-ticket-list-title { min-width: 0; }
.portal-ticket-list-title h2 { margin: 0; color: var(--portal-ink); font-size: 19px; font-weight: 650; }
.portal-ticket-list-title p { margin: 5px 0 0; color: var(--portal-muted); font-size: 14px; }
.portal-ticket-list-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 16px; }
.portal-ticket-count { color: var(--portal-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-ticket-inbox { display: grid; }
.portal-ticket-row { display: grid; min-width: 0; min-height: 106px; grid-template-columns: 46px minmax(0, 1fr) minmax(150px, auto) 20px; align-items: center; gap: 18px; padding: 17px 24px; color: inherit; background: #fff; border-top: 1px solid var(--portal-rule); text-decoration: none; transition: background-color .15s ease; }
.portal-ticket-row:hover { color: inherit; background: #f7f9fc; }
.portal-ticket-row:focus-visible { position: relative; z-index: 1; outline: 3px solid var(--portal-orange-brand); outline-offset: -3px; }
.portal-ticket-row-mark { display: inline-flex; width: 46px; height: 46px; align-items: center; justify-content: center; color: var(--portal-navy); background: #f0f2f7; border: 1px solid #e5e8ef; border-radius: 14px; font-size: 17px; }
.portal-ticket-row-main { display: grid; min-width: 0; gap: 5px; }
.portal-ticket-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.portal-ticket-number { color: var(--portal-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-ticket-row .status-new, .portal-ticket-row .status-open, .portal-ticket-row .status-resolved, .portal-ticket-row .status-other { min-height: 22px; padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.portal-ticket-row-subject { min-width: 0; color: var(--portal-ink); font-size: 16px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.portal-ticket-row-queue { display: inline-flex; min-width: 0; align-items: center; gap: 7px; color: var(--portal-muted); font-size: 13px; overflow-wrap: anywhere; }
.portal-ticket-row-queue i { color: #818998; font-size: 12px; }
.portal-ticket-row-update { display: grid; gap: 3px; justify-items: end; color: var(--portal-muted); font-size: 12px; text-align: right; white-space: nowrap; }
.portal-ticket-row-update time { color: var(--portal-ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.portal-ticket-row-open { color: #8b93a0; font-size: 13px; }
.portal-ticket-row:hover .portal-ticket-row-open { color: var(--portal-navy); }
.portal-ticket-empty { display: grid; min-height: 250px; align-content: center; justify-items: center; gap: 8px; padding: 30px; text-align: center; }
.portal-ticket-empty-icon { display: inline-flex; width: 58px; height: 58px; align-items: center; justify-content: center; margin-bottom: 5px; color: var(--portal-navy); background: #f0f2f7; border-radius: 50%; font-size: 23px; }
.portal-ticket-empty strong { color: var(--portal-ink); font-size: 17px; }
.portal-ticket-empty p { max-width: 380px; margin: 0; color: var(--portal-muted); font-size: 14px; }
.portal-ticket-list > .card-footer { background: #fff; }

/* Conversation header and strongly differentiated incoming/outgoing bubbles. */
.portal-ticket-thread > .card-header.portal-ticket-chat-header { display: flex; min-height: 94px; align-items: center; gap: 16px; padding: 18px 24px; }
.portal-chat-header-mark { display: inline-flex; width: 48px; height: 48px; flex: 0 0 48px; align-items: center; justify-content: center; color: var(--portal-navy); background: #f0f2f7; border: 1px solid #e5e8ef; border-radius: 15px; font-size: 19px; }
.portal-ticket-chat-header .portal-ticket-heading { flex: 1 1 auto; }
.portal-ticket-chat-header .portal-ticket-heading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.portal-ticket-chat-header .portal-ticket-kicker { margin: 0; }
.portal-ticket-chat-header .portal-ticket-heading h2 { margin-top: 4px; }
.portal-ticket-back { display: inline-flex; min-height: 44px; flex: 0 0 auto; align-items: center; gap: 8px; padding: 0 13px; }
.portal-ui .portal-ticket-thread .message-customer { color: #fff; background: #11105f; border-color: #11105f; }
.portal-ui .portal-ticket-thread .message-customer .message-body { color: #fff; }
.portal-ui .portal-ticket-thread .message-customer .message-body blockquote { color: #20223a; background: #f3f4fb; border-left-color: #9da2bd !important; }
.portal-ui .portal-ticket-thread .message-customer .attachment-item { background: #fff; border-color: #dce1ec; }
.portal-ui .portal-ticket-thread .message-customer .portal-chat-actions,
.portal-ui .portal-ticket-thread .message-customer .text-muted-inherited { color: #f0f1ff !important; }

@media (max-width: 767.98px) {
  .portal-ticket-list > .card-header.portal-ticket-list-header { align-items: stretch; flex-direction: column; gap: 14px; padding: 18px 17px; }
  .portal-ticket-list-actions { justify-content: space-between; gap: 10px; }
  .portal-ticket-list-actions .btn { min-height: 44px; }
  .portal-ticket-row { min-height: 0; grid-template-columns: minmax(0, 1fr) 18px; gap: 8px 12px; padding: 15px 16px; }
  .portal-ticket-row-mark { display: none; }
  .portal-ticket-row-main { grid-column: 1; grid-row: 1; }
  .portal-ticket-row-subject { font-size: 15px; }
  .portal-ticket-row-update { grid-column: 1 / -1; grid-row: 2; display: flex; justify-items: initial; align-items: baseline; gap: 6px; text-align: left; white-space: normal; }
  .portal-ticket-row-update time { font-size: 12px; }
  .portal-ticket-row-open { grid-column: 2; grid-row: 1; align-self: start; margin-top: 4px; }
  .portal-ticket-thread > .card-header.portal-ticket-chat-header { align-items: flex-start; gap: 11px; padding: 15px 15px; }
  .portal-chat-header-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 16px; }
  .portal-ticket-back { width: 44px; min-width: 44px; justify-content: center; padding: 0; }
  .portal-ticket-back span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-ticket-row { transition: none; }
}

/* Ticket conversation workspace: use the viewport for the thread and its composer. */
body.portal-helpdesk-ticket-page {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #f2f4f8;
}
body.portal-helpdesk-ticket-page .portal-app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.portal-helpdesk-ticket-page .portal-main {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.portal-helpdesk-ticket-page .portal-app .portal-topbar {
  position: relative;
  inset: auto;
  z-index: 10;
  flex: 0 0 auto;
}
.portal-helpdesk-ticket-page .portal-sheet {
  display: flex;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  flex: 1 1 0;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 14px clamp(12px, 1.7vw, 28px) 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.portal-helpdesk-ticket-page .portal-page-heading,
.portal-helpdesk-ticket-page .portal-footer { display: none; }
.portal-helpdesk-ticket-page .portal-helpdesk-view {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  flex-direction: column;
}
.portal-helpdesk-ticket-page .portal-helpdesk-view > .alert {
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 1 1 0;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(22, 34, 54, .07);
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread > .card-header.portal-ticket-chat-header {
  display: flex;
  min-height: 78px;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(16px, 2.2vw, 30px);
  background: #fff;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-header-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 13px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-heading { min-width: 0; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread > .card-body {
  display: flex;
  min-height: 0;
  flex: 1 1 0;
  overflow: hidden;
  padding: 0;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-history {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  overflow: hidden;
  background: #f3f5f9;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .messages-container {
  display: flex;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  flex: 1 1 0;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px clamp(18px, 4vw, 72px) 34px;
  background: #f3f5f9;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-content {
  width: min(100%, 960px);
  max-width: min(100%, 960px);
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-message {
  gap: 14px;
  margin-bottom: 26px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  font-size: 12px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-meta {
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-meta .message-author { font-size: 14px; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-meta time { font-size: 13px; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble {
  width: fit-content;
  max-width: min(100%, 900px);
  border-radius: 15px;
  box-shadow: 0 1px 2px rgba(22, 34, 54, .045);
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .card-body { padding: 17px 21px; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .message-body {
  font-size: 17px;
  line-height: 1.65;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-event { margin: 8px 0 24px; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-day { margin: 4px 0 26px; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-composer {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: 12px clamp(16px, 2.2vw, 30px) 14px;
  background: #fff;
  border-top: 1px solid #dfe4ec;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-composer-heading {
  display: flex;
  max-width: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 8px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-composer-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-live-status { margin-top: 0; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-form {
  max-width: none;
  margin: 0 auto;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-box {
  overflow: hidden;
  border: 1px solid #cbd2dc;
  border-radius: 13px;
  box-shadow: 0 1px 3px rgba(22, 34, 54, .045);
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-box:focus-within {
  border-color: var(--portal-orange);
  outline: 3px solid rgba(186, 78, 0, .2);
  outline-offset: 1px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-box textarea.form-control {
  width: 100%;
  height: 64px;
  min-height: 64px;
  max-height: min(220px, 28dvh);
  overflow-y: hidden;
  padding: 14px 17px 10px;
  color: var(--portal-ink);
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 17px;
  line-height: 1.5;
  resize: none;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-box textarea.form-control:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 7px 9px;
  border-top: 1px solid #e8ebf0;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-file-field {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-attach-button {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
  color: #353c49;
  background: #f4f6f9;
  border: 1px solid #dce1e8;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-attach-button:hover { background: #e9edf3; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread #reply_attachments:focus-visible + .portal-chat-file-names { outline: 2px solid var(--portal-orange); outline-offset: 3px; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-file-names {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-hint {
  flex: 0 0 auto;
  color: var(--portal-muted);
  font-size: 12px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-footer > .btn {
  min-width: 112px;
  min-height: 44px;
  flex: 0 0 auto;
  border-radius: 9px;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-new-messages { bottom: 18px; }
.portal-helpdesk-ticket-page .portal-nav-modal { z-index: 1060; }

@media (max-width: 767.98px) {
  body.portal-helpdesk-ticket-page,
  body.portal-helpdesk-ticket-page .portal-app {
    height: var(--portal-chat-viewport-height, 100vh);
    height: var(--portal-chat-viewport-height, 100dvh);
  }
  .portal-helpdesk-ticket-page .portal-sheet { padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread { border-radius: 11px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread > .card-header.portal-ticket-chat-header {
    min-height: 72px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-header-mark { display: none; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-heading h2 { font-size: 16px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-back {
    width: auto;
    min-width: 64px;
    min-height: 44px;
    align-self: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    white-space: nowrap;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-back span { display: inline; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .messages-container {
    padding: 18px 12px 28px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-message { gap: 9px; margin-bottom: 21px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-content { max-width: calc(100% - 41px); }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble { max-width: 100%; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .card-body { padding: 13px 15px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .message-body { font-size: 16px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-composer { padding: 9px 10px max(10px, env(safe-area-inset-bottom)); }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-composer-heading { margin-bottom: 6px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-box textarea.form-control {
    height: 60px;
    min-height: 60px;
    max-height: min(180px, 25dvh);
    padding: 11px 13px 8px;
    font-size: 16px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-footer {
    min-height: 54px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-file-field { gap: 7px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-attach-button {
    min-height: 44px;
    gap: 7px;
    padding: 0 10px;
    font-size: 13px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-file-names { font-size: 13px; line-height: 1.4; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-hint { display: none; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-footer > .btn {
    min-width: 100px;
    min-height: 44px;
    padding-right: 10px;
    padding-left: 10px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-new-messages {
    right: 12px;
    bottom: 12px;
    min-height: 44px;
  }
}
@media (max-width: 420px) {
  .portal-ticket-list-actions { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .portal-ticket-list-actions .btn { width: 100%; justify-content: center; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread > .card-header.portal-ticket-chat-header { flex-wrap: wrap; align-items: flex-start; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-heading { flex: 1 1 100%; order: 1; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-ticket-back { order: 2; margin-top: -2px; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-file-names:not(.has-files) { display: none; }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-file-names.has-files {
    display: block;
    flex: 1 1 72px;
    max-width: 126px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-compose-footer > .btn { min-width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .messages-container { scroll-behavior: auto; }
}

/* Give long support messages more room on desktop while retaining a readable mobile measure. */
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-content {
  width: 100%;
  max-width: min(calc(100% - 52px), 1120px);
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble {
  max-width: min(100%, 1080px);
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .message-body {
  font-size: 18px;
  line-height: 1.65;
}
@media (max-width: 767.98px) {
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .portal-chat-content {
    width: 100%;
    max-width: calc(100% - 43px);
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .message-body {
    font-size: 17px;
  }
  .portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-bubble .card-body {
    padding: 14px 16px;
  }
}


/* Mobile-first refinements across the customer portal. */
.portal-document-action-label { display: none; }
@media (max-width: 767.98px) {
  body.portal-ui {
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
  }
  body.portal-helpdesk-ticket-page {
    min-height: 0;
    height: var(--portal-chat-viewport-height, 100vh);
    height: var(--portal-chat-viewport-height, 100dvh);
  }
  .portal-main { min-height: 100vh; min-height: 100svh; }
  .portal-app .portal-topbar { min-height: calc(64px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-right: max(14px, env(safe-area-inset-right)); padding-left: max(14px, env(safe-area-inset-left)); }
  .portal-topbar-inner { min-height: 64px; }
  .portal-sheet { width: 100%; margin: 0 auto 24px; padding: 18px 16px max(28px, env(safe-area-inset-bottom)); }
  .portal-app .portal-sheet { padding: 18px 16px max(28px, env(safe-area-inset-bottom)); }
  .portal-helpdesk-ticket-page .portal-sheet { padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
  .portal-page-heading { min-height: 0; margin-bottom: 16px; }
  .portal-page-heading h1 { font-size: 21px; line-height: 1.3; }
  .portal-app .portal-page-heading { margin-bottom: 16px; }
  .portal-app .portal-module { margin-bottom: 14px; }
  .portal-app .portal-module > .card-header { padding: 14px 16px; }
  .portal-app .portal-module > .card-body:not(.p-0) { padding: 16px; }
  .portal-app .portal-module > .card-footer { padding: 12px 14px; }
  .portal-ui .form-control,
  .portal-ui .form-select,
  .portal-ui textarea.form-control { font-size: 16px; }
  .portal-ui .btn,
  .portal-ui .nav-tabs .nav-link,
  .portal-ui .pagination .page-link,
  .portal-ui .accordion-button,
  .portal-menu-trigger,
  .portal-account-button { min-height: 44px; }
  .portal-ui .pagination .page-link { min-width: 44px; }
  .portal-inline-action,
  .portal-text-link { min-height: 44px; }
  .portal-text-link { display: inline-flex; align-items: center; }
  .portal-nav-modal-header { padding-top: max(8px, env(safe-area-inset-top)); padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .portal-nav-modal .modal-body { padding-bottom: max(23px, env(safe-area-inset-bottom)); }

  .portal-overview-primary,
  .portal-overview-secondary { gap: 14px; }
  .portal-overview-secondary { margin-top: 14px; }
  .portal-overview-secondary > .portal-overview-panel { padding: 16px; }
  .portal-balance-lead,
  .portal-overview-documents { padding: 18px; }
  .portal-balance-lead { min-height: 146px; gap: 18px; }
  .portal-overview-documents { min-height: 0; }
  .portal-panel-heading { flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-bottom: 8px; }
  .portal-panel-heading > .portal-text-link { margin-left: auto; }
  .portal-overview .portal-data-row { min-height: 58px; }
  .portal-overview-row { gap: 6px 12px; padding: 12px 1px; }

  .portal-subview-heading { align-items: center; gap: 8px; padding: 15px 15px 12px; }
  .portal-balance-heading-actions { justify-content: flex-start; }
  .portal-service-list { padding-right: 15px; padding-left: 15px; }
  .portal-service-row { min-height: 56px; gap: 10px; padding: 12px 0; }
  .portal-service-name { font-size: 14px; }
  .portal-service-price { font-size: 14px; }
  .portal-service-total { gap: 10px; padding: 14px 15px 16px; }
  .portal-service-total span { font-size: 13px; }
  .portal-service-total strong { font-size: 17px; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody { padding: 8px; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody tr { gap: 4px 10px; padding: 10px 11px; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(2).is-empty-value,
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(3).is-empty-value { display: none; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(3),
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(4) {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: right !important;
  }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(3)::before,
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(4)::before { margin-right: auto; text-align: left; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(5),
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:last-child { grid-column: 1 / -1; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:nth-child(5) { padding-top: 8px !important; }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:last-child {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 8px !important;
    border-top: 1px solid var(--portal-rule);
  }
  .portal-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:last-child .btn { min-height: 44px; }

  .portal-documents-module .card-header { gap: 10px; }
  .portal-documents-module .card-header h2 { min-width: 0; font-size: 16px; }
  .portal-documents-module .table-mobile-cards tbody td:last-child { grid-column: 1 / -1; align-items: stretch; }
  .portal-documents-module .actions-group { width: 100%; justify-content: flex-start; gap: 8px; }
  .portal-documents-module .actions-group .btn { display: inline-flex; min-width: 0; min-height: 44px; flex: 1 1 0; align-items: center; justify-content: center; gap: 7px; }
  .portal-document-action-label { display: inline; }
  .portal-document-preview { height: min(70dvh, 720px); min-height: min(340px, 70dvh); }
  .portal-document-preview-panel .card-body { padding: 6px; }
  .portal-document-page .portal-account,
  .portal-contract-page .portal-account { display: none; }
  .portal-document-page .portal-sheet { padding-top: 12px; }
  .portal-document-page .portal-document-page-heading { align-items: center; flex-direction: row; gap: 10px; }
  .portal-document-page-heading .btn { flex: 0 0 auto; }
  .portal-document-actions { width: 100%; }
  .portal-document-actions .btn { min-height: 44px; justify-content: center; }

  .portal-notice-list .accordion-button { align-items: center; }
  .portal-notice-list .accordion-button::after { margin-left: auto; }
  .portal-notice-list .accordion-body { padding: 14px 16px 17px; }
  .portal-notice-list .accordion-body .btn { min-height: 44px; }
  .portal-profile-data dd { font-size: 15px; }
  .portal-profile-security .portal-profile-balance-surface { align-items: baseline; flex-direction: row; }
  .portal-profile-security .portal-profile-balance-amount { font-size: 22px; }
  .portal-bank-account-row { align-items: center; }
  .portal-profile-security .portal-account-number { line-height: 1.6; }
  .portal-support-note .btn { min-height: 44px; }

  .portal-ui .modal:not(.portal-nav-modal) .modal-content { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px); }
  .portal-ui .modal:not(.portal-nav-modal) .modal-content > form { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
  .portal-ui .modal:not(.portal-nav-modal) .modal-content > form > .modal-body,
  .portal-ui .modal:not(.portal-nav-modal) .modal-content > .modal-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
}

@media (max-width: 420px) {
  .portal-sheet,
  .portal-app .portal-sheet { padding-right: 14px; padding-left: 14px; }
  .portal-documents-module .actions-group .btn { gap: 4px; padding-right: 7px; padding-left: 7px; font-size: 13px; white-space: nowrap; }
  .portal-documents-module .actions-group .btn i { margin-right: 0 !important; }
  .portal-app .portal-module > .card-header { padding-right: 14px; padding-left: 14px; }
  .portal-app .portal-module > .card-body:not(.p-0) { padding-right: 14px; padding-left: 14px; }
  .portal-page-heading h1 { font-size: 20px; }
  .portal-balance-lead,
  .portal-overview-documents { padding: 16px; }
  .portal-overview-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .portal-overview-service-summary { align-items: flex-start; flex-direction: column; gap: 6px; }
  .portal-overview-service-summary > div { justify-content: flex-start; }
  .portal-overview-row-value,
  .portal-overview-row .portal-ticket-status { grid-column: 1; grid-row: auto; justify-self: start; text-align: left; }
  .portal-overview-row-value { margin-top: 2px; }
  .portal-data-row { grid-template-columns: minmax(0, 1fr); gap: 4px; align-items: start; }
  .portal-overview .portal-data-row { grid-template-columns: minmax(0, 1fr); }
  .portal-status-chip { grid-column: 1; grid-row: auto; justify-self: start; text-align: left; }
  .portal-panel-heading { align-items: flex-start; }
  .portal-panel-heading > .portal-text-link { margin-top: -5px; }
  .portal-count-label { font-size: 12px; }
  .portal-document-page .portal-document-page-heading { align-items: flex-start; flex-direction: column; }
  .portal-document-page-heading .btn { max-width: 100%; align-self: flex-start; padding-right: 9px; padding-left: 9px; font-size: 13px; white-space: normal; }
  .portal-service-row { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-height: 620px) and (max-width: 767.98px) {
  .portal-document-preview { height: 62dvh; min-height: 260px; }
  .portal-nav-modal .modal-body { overflow-y: auto; }
}

/* Services, balance and traffic share the Overview surface and grid system. */
.portal-app .portal-tariffs-module {
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.portal-app .portal-tariffs-module > .card-header {
  margin: 0 0 18px;
  padding: 0;
  background: transparent;
  border: 0 !important;
}
 .portal-app .portal-tariffs-module > .card-header > nav { width: 100%; }
.portal-app .portal-tariffs-nav {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 28px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  border-bottom: 1px solid var(--portal-border);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.portal-app .portal-tariffs-nav::-webkit-scrollbar { display: none; }
.portal-app .portal-tariffs-nav-item { flex: 0 0 auto; margin-bottom: -1px; }
.portal-app .portal-tariffs-nav-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 0 2px;
  color: var(--portal-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 140ms ease, border-color 140ms ease;
}
.portal-app .portal-tariffs-nav-link > i { color: #8993a1; font-size: 13px; transition: color 140ms ease; }
.portal-app .portal-tariffs-nav-link:hover { color: var(--portal-ink); }
.portal-app .portal-tariffs-nav-link:hover > i { color: var(--portal-navy); }
.portal-app .portal-tariffs-nav-link.active {
  color: var(--portal-navy);
  border-bottom-color: var(--portal-orange-brand);
  font-weight: 650;
}
.portal-app .portal-tariffs-nav-link.active > i { color: var(--portal-orange-brand); }
.portal-app .portal-tariffs-nav-link:focus-visible {
  outline: 2px solid var(--portal-navy);
  outline-offset: -4px;
  border-radius: 4px;
}
.portal-app .portal-tariffs-module .tab-pane { min-width: 0; }
.portal-app .portal-tariffs-view .portal-overview-grid { min-width: 0; }
.portal-app .portal-tariffs-view .portal-overview-card {
  min-width: 0;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-card);
}
.portal-app .portal-tariffs-services-summary {
  display: flex;
  min-height: 190px;
  grid-column: span 4;
  flex-direction: column;
  justify-content: space-between;
  background: #f8f9fb !important;
  border-top: 2px solid var(--portal-orange-brand) !important;
}
.portal-app .portal-tariffs-service-list-card { grid-column: span 8; }
.portal-app .portal-tariffs-service-list-card .portal-panel-heading { min-height: 34px; margin-bottom: 8px; }
.portal-app .portal-tariffs-service-list-card .portal-overview-row:last-child,
.portal-app .portal-traffic-device-metrics .portal-overview-row:last-child { border-bottom: 0; }
.portal-app .portal-tariffs-service-list-card .portal-overview-row-value.is-discount { color: var(--portal-positive, #24704d); }
.portal-app .portal-tariffs-view .portal-empty-inline { padding: 14px 0 0; background: transparent; border: 0; border-radius: 0; }

.portal-app .portal-balance-layout { display: grid; min-width: 0; gap: 16px; }
.portal-app .portal-balance-current {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #f8f9fb;
  border-top: 2px solid var(--portal-orange-brand);
}
.portal-app .portal-balance-current > div { min-width: 0; }
.portal-app .portal-balance-current .portal-section-eyebrow { margin-bottom: 5px; }
.portal-app .portal-balance-value { gap: 8px; }
.portal-app .portal-balance-value strong { font-size: clamp(30px, 3vw, 38px); }
.portal-app .portal-balance-current .btn { min-height: 44px; flex: 0 0 auto; }
.portal-app .portal-balance-payment-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.portal-app .portal-billtech-payment { color: #176b45; border-color: #7aa88d; }
.portal-app .portal-billtech-payment:hover,
.portal-app .portal-billtech-payment:focus-visible { color: #fff; background: #176b45; border-color: #176b45; }
.portal-app .portal-balance-ledger-card { padding: 0 !important; overflow: hidden; }
.portal-app .portal-balance-ledger-heading { margin: 0; padding: 22px 24px 14px; }
.portal-app .portal-action-tariffs #balance-tab-pane .table-responsive { border-top: 1px solid var(--portal-rule); }
.portal-app .portal-action-tariffs #balance-tab-pane .table { min-width: 850px; }
.portal-app .portal-action-tariffs #balance-tab-pane .table thead th {
  padding-top: 13px;
  padding-bottom: 13px;
  color: var(--portal-muted);
  background: #f7f8fa;
  border-bottom-color: var(--portal-border);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.portal-app .portal-action-tariffs #balance-tab-pane .table tbody td { padding-top: 14px; padding-bottom: 14px; vertical-align: middle; }
.portal-app .portal-action-tariffs #balance-tab-pane .table tbody tr:hover > * { background: #fafbfc; }
.portal-app .portal-action-tariffs #balance-tab-pane .table tbody td:first-child { color: var(--portal-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-app .portal-action-tariffs #balance-tab-pane .portal-money-mark { min-width: 0; padding: 5px 8px; border-radius: 6px; }
.portal-app .portal-action-tariffs #balance-tab-pane .portal-money-mark.is-outgoing { background: #fbefef; }
.portal-app .portal-action-tariffs #balance-tab-pane .portal-money-mark.is-incoming { background: #edf5ef; }
.portal-app .portal-action-tariffs #balance-tab-pane .table-mobile-cards tbody td:last-child { white-space: normal; }
.portal-app .portal-balance-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 24px; background: #fff; border-top: 1px solid var(--portal-border); }
.portal-app .portal-balance-actions .btn { min-height: 42px; }
.portal-app .portal-balance-layout .btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.portal-app .portal-balance-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-app .portal-balance-document-actions { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; }
.portal-app .portal-balance-document-actions .portal-billtech-payment { white-space: nowrap; }
.portal-app .portal-balance-select-all { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 12px; }

.portal-app .portal-traffic-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 2px 0 18px; }
.portal-app .portal-traffic-heading { min-width: 0; padding: 0; }
.portal-app .portal-traffic-heading h2 { margin: 0 0 3px; color: var(--portal-navy); font-size: 17px; font-weight: 600; }
.portal-app .portal-traffic-heading p { margin: 0; color: var(--portal-muted); font-size: 13px; line-height: 1.45; }
.portal-app .portal-traffic-periods { display: flex; flex: 0 0 auto; gap: 4px; max-width: 100%; overflow-x: auto; padding: 3px; background: #f2f4f7; border: 1px solid var(--portal-border); border-radius: 8px; scrollbar-width: thin; }
.portal-app .portal-traffic-period {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  color: var(--portal-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.portal-app .portal-traffic-period:hover { color: var(--portal-ink); background: rgba(255, 255, 255, .58); }
.portal-app .portal-traffic-period.is-active { color: var(--portal-navy); background: #fff; border-color: var(--portal-border); box-shadow: 0 1px 2px rgba(25, 35, 52, .05); }
.portal-app .portal-traffic-total-card { grid-column: 1 / -1; }
.portal-app .portal-traffic-total-card .portal-panel-heading { min-height: 34px; margin-bottom: 12px; }
.portal-app .portal-traffic-total-card .portal-traffic-summary { gap: 18px; }
.portal-app .portal-traffic-total-card .portal-traffic-total { padding-right: 18px; border-right: 1px solid var(--portal-rule); }
.portal-app .portal-traffic-total-card .portal-traffic-total:last-child { padding-right: 0; border-right: 0; }
.portal-app .portal-traffic-total-card .portal-traffic-total > span { font-size: 13px; }
.portal-app .portal-traffic-total-card .portal-traffic-total > span i { margin-right: 6px; }
.portal-app .portal-traffic-total-card .portal-traffic-total > strong { font-size: clamp(17px, 2vw, 23px); }
.portal-app .portal-traffic-total-card .portal-traffic-total > small { color: var(--portal-muted); font-size: 12px; }
.portal-app .portal-traffic-device-list { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin: 18px 0 0; }
.portal-app .portal-traffic-device-list > .portal-panel-heading { grid-column: 1 / -1; margin: 0; }
.portal-app .portal-traffic-device { grid-column: span 6; }
.portal-app .portal-traffic-device .portal-panel-heading { min-height: 38px; margin-bottom: 8px; }
.portal-app .portal-traffic-device .portal-panel-heading h2 { overflow-wrap: anywhere; }
.portal-app .portal-traffic-device-ip { margin: 3px 0 0; color: var(--portal-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-app .portal-traffic-chart { min-width: 0; margin: 8px 0 12px; overflow: hidden; border: 0; }
.portal-app .portal-traffic-chart img { display: block; width: 100%; max-width: 100%; height: auto; }
.portal-app .portal-traffic-device-metrics .portal-overview-row { padding-right: 0; padding-left: 0; }
.portal-app .portal-tariffs-empty { grid-column: 1 / -1; }

@media (max-width: 991.98px) {
  .portal-app .portal-tariffs-services-summary { grid-column: span 2; }
  .portal-app .portal-tariffs-service-list-card { grid-column: span 4; }
  .portal-app .portal-traffic-device-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .portal-app .portal-traffic-device { grid-column: span 3; }
}
@media (max-width: 767.98px) {
  .portal-app .portal-tariffs-module > .card-header { margin-bottom: 15px; }
  .portal-app .portal-tariffs-nav { gap: 22px; }
  .portal-app .portal-tariffs-nav-link { min-height: 48px; font-size: 13px; }
  .portal-app .portal-tariffs-view .portal-overview-card { padding: 19px 20px; }
  .portal-app .portal-tariffs-services-summary,
  .portal-app .portal-tariffs-service-list-card,
  .portal-app .portal-traffic-total-card,
  .portal-app .portal-traffic-device { grid-column: 1 / -1; }
  .portal-app .portal-tariffs-services-summary { min-height: 164px; }
  .portal-app .portal-action-tariffs #balance-tab-pane .table { min-width: 0; }
  .portal-app .portal-balance-layout { gap: 14px; }
  .portal-app .portal-balance-current { min-height: 0; align-items: flex-start; flex-direction: column; gap: 14px; }
  .portal-app .portal-balance-current .btn { width: 100%; }
  .portal-app .portal-balance-payment-actions { width: 100%; flex-direction: column; }
  .portal-app .portal-balance-ledger-heading { padding: 19px 20px 13px; }
  .portal-app .portal-balance-actions { align-items: stretch; flex-direction: column; padding: 14px 16px; }
  .portal-app .portal-balance-action-buttons { width: 100%; }
  .portal-app .portal-balance-action-buttons .btn { flex: 1 1 auto; }
  .portal-app .portal-balance-select-all { justify-content: flex-start; }
  .portal-app .portal-traffic-controls { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 14px; }
  .portal-app .portal-traffic-periods { width: 100%; }
  .portal-app .portal-traffic-period { min-height: 40px; padding: 0 12px; }
  .portal-app .portal-traffic-total-card .portal-traffic-summary { gap: 12px; }
  .portal-app .portal-traffic-device-list { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
  .portal-app .portal-traffic-device { padding: 19px 20px; }
}
@media (max-width: 420px) {
  .portal-app .portal-tariffs-nav { gap: 17px; }
  .portal-app .portal-tariffs-nav-link { gap: 7px; font-size: 12px; }
  .portal-app .portal-tariffs-view .portal-overview-card { padding: 17px 16px; }
  .portal-app .portal-balance-ledger-heading { padding: 17px 16px 12px; }
  .portal-app .portal-balance-actions { padding-right: 12px; padding-left: 12px; }
  .portal-app .portal-traffic-total-card .portal-traffic-summary { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .portal-app .portal-traffic-total-card .portal-traffic-total { padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--portal-rule); }
  .portal-app .portal-traffic-total-card .portal-traffic-total:last-child { padding-bottom: 0; border-bottom: 0; }
  .portal-app .portal-traffic-device { padding: 17px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-app .portal-tariffs-nav-link,
  .portal-app .portal-traffic-period { transition: none; }
}

/* VoIP history and number settings use the same quiet ledger surfaces as the rest of the portal. */
.portal-voip-module > .card-header { padding: 0 20px; }
.portal-voip-module .nav-tabs { gap: 18px; }
.portal-voip-module .nav-tabs .nav-link { display: inline-flex; align-items: center; white-space: nowrap; }
.portal-voip-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--portal-rule); }
.portal-voip-summary-item { display: grid; min-width: 0; gap: 5px; padding: 12px 14px; background: var(--portal-raised); border: 1px solid var(--portal-border); border-radius: 7px; }
.portal-voip-summary-item > span { color: var(--portal-muted); font-size: 12px; line-height: 1.35; }
.portal-voip-summary-item > strong { color: var(--portal-navy); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portal-voip-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 12px; padding: 18px 22px; background: #fbfcfd; border-bottom: 1px solid var(--portal-rule); }
.portal-voip-filter-field { display: grid; min-width: 0; gap: 6px; }
.portal-voip-filter-field label { margin: 0; color: var(--portal-ink); font-size: 12px; font-weight: 600; }
.portal-voip-filter-field .form-control,
.portal-voip-filter-field .form-select { min-width: 0; }
.portal-voip-filter-submit { min-height: 40px; justify-self: start; }
.portal-voip-list-heading { padding-bottom: 12px; }
.portal-voip-table-wrap { border-top: 1px solid var(--portal-rule); }
.portal-voip-table { min-width: 1080px; }
.portal-voip-table thead th { padding: 12px 11px !important; font-size: 11px !important; }
.portal-voip-table tbody td { padding: 12px 11px !important; }
.portal-voip-table tbody td:nth-child(2),
.portal-voip-table tbody td:nth-child(3) { min-width: 115px; overflow-wrap: anywhere; }
.portal-voip-direction { display: block; color: var(--portal-ink); font-weight: 600; white-space: nowrap; }
.portal-voip-type { display: block; margin-top: 3px; color: var(--portal-muted); font-size: 12px; line-height: 1.35; }
.portal-voip-price { color: var(--portal-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.portal-voip-recording-link { min-width: 84px; min-height: 36px !important; white-space: nowrap; }
.portal-voip-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 20px 20px; color: var(--portal-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.portal-voip-account-settings { display: grid; gap: 14px; padding: 18px 22px; }
.portal-voip-account-card { min-width: 0; padding: 18px; background: #fff; border: 1px solid var(--portal-border); border-radius: 8px; }
.portal-voip-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--portal-rule); }
.portal-voip-account-eyebrow { display: block; margin-bottom: 3px; color: var(--portal-muted); font-size: 11px; font-weight: 500; }
.portal-voip-account-heading h3 { margin: 0; color: var(--portal-ink); font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.portal-voip-account-number-count { flex: 0 0 auto; color: var(--portal-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-voip-recording-setting { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 16px 0; padding: 0; border: 0; }
.portal-voip-recording-setting legend { width: 100%; margin-bottom: 6px; color: var(--portal-ink); font-size: 13px; font-weight: 600; }
.portal-voip-recording-help { width: 100%; margin: -3px 0 2px; color: var(--portal-muted); font-size: 12px; line-height: 1.45; }
.portal-voip-recording-setting label { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; color: var(--portal-ink); font-size: 13px; cursor: pointer; }
.portal-voip-recording-setting input { width: 18px; height: 18px; margin: 0; accent-color: var(--portal-navy); }
.portal-voip-phone-order { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.5fr); gap: 18px; padding-top: 14px; border-top: 1px solid var(--portal-rule); }
.portal-voip-phone-order h4 { margin: 0 0 4px; color: var(--portal-ink); font-size: 13px; font-weight: 600; }
.portal-voip-phone-order p { margin: 0; color: var(--portal-muted); font-size: 12px; line-height: 1.45; }
.portal-voip-phone-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.portal-voip-phone-item { display: grid; min-width: 0; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 50px; padding: 5px 7px; border: 1px solid var(--portal-rule); border-radius: 6px; }
.portal-voip-phone-position { display: grid; width: 25px; height: 25px; place-items: center; color: var(--portal-muted); background: var(--portal-raised); border-radius: 50%; font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-voip-phone-number { min-width: 0; color: var(--portal-ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portal-voip-phone-controls { display: flex; gap: 4px; }
.portal-voip-phone-controls .btn { display: inline-grid; width: 40px; min-height: 40px; place-items: center; padding: 4px; }
.portal-voip-settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; background: var(--portal-raised); border-top: 1px solid var(--portal-rule); }
.portal-voip-settings-footer p { margin: 0; color: var(--portal-muted); font-size: 12px; line-height: 1.45; }
.portal-voip-settings-footer .btn { flex: 0 0 auto; }

@media (max-width: 767.98px) {
  .portal-voip-module > .card-header { padding-right: 15px; padding-left: 15px; }
  .portal-voip-module .nav-tabs { gap: 14px; overflow-x: auto; }
  .portal-voip-module .nav-tabs .nav-link { min-height: 54px; padding-right: 0; padding-left: 0; font-size: 13px; }
  .portal-voip-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 13px 14px; }
  .portal-voip-summary-item { padding: 10px 11px; }
  .portal-voip-summary-item:last-child { grid-column: 1 / -1; }
  .portal-voip-summary-item > strong { font-size: 17px; }
  .portal-voip-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; }
  .portal-voip-filter-submit { width: 100%; min-height: 44px; grid-column: 1 / -1; }
  .portal-voip-list-heading { padding: 16px 14px 11px; }
  .portal-voip-table { min-width: 0; }
  .portal-voip-table tbody tr { gap: 4px 12px; padding: 11px 12px; }
  .portal-voip-table tbody td { font-size: 13px; }
  .portal-voip-table tbody td:first-child { width: 100%; }
  .portal-voip-table tbody td:nth-child(2) { grid-column: 1 / -1; }
  .portal-voip-table tbody td:nth-child(3),
  .portal-voip-table tbody td:nth-child(4),
  .portal-voip-table tbody td:nth-child(5),
  .portal-voip-table tbody td:nth-child(7),
  .portal-voip-table tbody td:nth-child(8) { display: flex; }
  .portal-voip-table tbody td:nth-child(6) { grid-column: 1 / -1; }
  .portal-voip-table tbody td:nth-child(8) { flex-direction: row; align-items: baseline; justify-content: space-between; text-align: left !important; font-weight: 600; }
  .portal-voip-table tbody td:last-child { grid-column: 1 / -1; align-items: stretch; }
  .portal-voip-table tbody td:last-child .btn { min-height: 44px !important; }
  .portal-voip-pagination { flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 14px; }
  .portal-voip-account-settings { gap: 10px; padding: 14px; }
  .portal-voip-account-card { padding: 14px; }
  .portal-voip-recording-setting { display: grid; gap: 3px; }
  .portal-voip-recording-setting label { min-height: 44px; }
  .portal-voip-phone-order { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .portal-voip-phone-controls .btn { width: 44px; min-height: 44px; }
  .portal-voip-settings-footer { align-items: stretch; flex-direction: column; padding: 14px; }
  .portal-voip-settings-footer .btn { width: 100%; min-height: 44px; }
}

@media (max-width: 420px) {
  .portal-voip-summary { grid-template-columns: minmax(0, 1fr); }
  .portal-voip-summary-item:last-child { grid-column: 1; }
  .portal-voip-filters { grid-template-columns: minmax(0, 1fr); }
  .portal-voip-filter-submit { grid-column: 1; }
  .portal-voip-table tbody tr { grid-template-columns: minmax(0, 1fr); }
  .portal-voip-table tbody td:nth-child(2),
  .portal-voip-table tbody td:nth-child(6),
  .portal-voip-table tbody td:nth-child(8),
  .portal-voip-table tbody td:last-child { grid-column: 1; }
  .portal-voip-table tbody td:nth-child(8) { flex-direction: row; }
  .portal-voip-account-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .portal-voip-pagination .btn { min-height: 44px; }
}

/* Shared customer navigation: one hierarchy, consistent widths, and a real content landmark. */
.portal-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 10px 14px;
  color: #fff !important;
  background: var(--portal-navy);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.portal-skip-link:focus { transform: translateY(0); }
.portal-app { display: flex; min-height: 100vh; min-height: 100svh; flex-direction: column; padding: 0; }
.portal-main { display: flex; width: 100%; min-height: 100vh; min-height: 100svh; flex: 1 0 auto; flex-direction: column; margin: 0; }
.portal-app .portal-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  width: 100%;
  min-height: 72px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--portal-border);
}
.portal-topbar-inner {
  display: flex;
  width: min(100%, 1280px);
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
}
.portal-brand-horizontal { min-width: 0; flex: 0 0 auto; gap: 10px; }
.portal-brand-horizontal img { width: 92px; height: 36px; }
.portal-brand-horizontal span { max-width: 104px; color: var(--portal-muted); font-size: 12px; line-height: 1.3; }
.portal-primary-nav { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: center; gap: 3px; }
.portal-primary-link {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--portal-muted) !important;
  border: 0;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 140ms ease, background-color 140ms ease;
}
.portal-primary-link > i { width: 15px; color: #737b88; font-size: 13px; text-align: center; }
.portal-primary-link:hover { color: var(--portal-ink) !important; background: #f5f6f8; }
.portal-primary-link.is-active { color: var(--portal-navy) !important; background: #edf0f6; font-weight: 650; }
.portal-primary-link.is-active > i { color: var(--portal-navy); }
.portal-primary-link .portal-nav-count { min-width: 19px; height: 19px; margin-left: 0; font-size: 10px; }
.portal-topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.portal-account-button { min-height: 44px; gap: 8px; padding: 4px 8px; }
.portal-account-name { display: block; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-menu-trigger { display: none; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 0 13px; color: var(--portal-navy); background: #fff; border: 1px solid var(--portal-control); border-radius: 7px; font: 600 14px "Karla", sans-serif; }
.portal-menu-trigger:hover { background: #f5f6f8; }
.portal-menu-trigger:active, .portal-account-button:active, .portal-nav-close:active { background: #e9edf2; }
.portal-sheet { flex: 1 0 auto; }

.portal-footer { width: 100%; margin-top: auto; padding: 0; color: var(--portal-muted); background: #fff; border-top: 1px solid var(--portal-border); }
.portal-footer-inner {
  display: flex;
  width: min(calc(100% - 64px), 1280px);
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
}
.portal-footer-copyright { margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-footer-copyright span { padding-left: 5px; color: #7a818c; }
.portal-footer-links { display: flex; align-items: center; gap: 22px; }
.portal-footer-links a { display: inline-flex; min-height: 44px; align-items: center; color: var(--portal-navy) !important; font-size: 13px; font-weight: 600; text-decoration: none; }
.portal-footer-links a:hover, .portal-footer-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

.portal-nav-modal { --bs-modal-zindex: 1060; }
.portal-nav-modal .modal-dialog.modal-fullscreen { width: min(420px, calc(100vw - 24px)) !important; max-width: 420px !important; height: 100dvh !important; margin: 0 auto 0 0 !important; }
.portal-nav-modal.fade .modal-dialog { transform: translateX(-16px); transition: transform 220ms cubic-bezier(.23, 1, .32, 1); }
.portal-nav-modal.show .modal-dialog { transform: translateX(0); }
.portal-nav-modal .modal-content { display: flex; min-height: 0; height: 100%; flex-direction: column; border: 0; border-radius: 0 18px 18px 0; }
.portal-nav-modal-header { min-height: 72px; flex: 0 0 auto; padding: 10px 20px; background: #fff; }
.portal-nav-modal-header .portal-brand-horizontal { min-width: 0; }
.portal-nav-close { display: inline-flex; width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center; color: var(--portal-ink); background: #fff; border: 1px solid var(--portal-border); border-radius: 50%; font-size: 17px; }
.portal-nav-modal .modal-body { width: 100%; min-height: 0; flex: 1 1 auto; overflow-y: auto; margin: 0; padding: 22px 20px max(24px, env(safe-area-inset-bottom)); }
.portal-nav-modal-caption { margin: 0 0 16px; color: var(--portal-muted); font-size: 13px; font-weight: 500; }
.portal-mobile-menu-links { border: 0; }
.portal-mobile-menu-group { margin: 0 0 22px; }
.portal-mobile-menu-group > h2 { margin: 0 0 7px; color: var(--portal-muted); font-family: "Karla", system-ui, sans-serif; font-size: 12px; font-weight: 650; letter-spacing: .04em; line-height: 1.4; text-transform: uppercase; }
.portal-mobile-menu-link {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  color: var(--portal-ink) !important;
  border: 0;
  border-radius: 7px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 140ms ease, background-color 140ms ease;
}
.portal-mobile-menu-link:hover { color: var(--portal-ink) !important; background: #f5f6f8; }
.portal-mobile-menu-link.is-active { color: var(--portal-navy) !important; background: #edf0f6; font-weight: 650; }
.portal-mobile-menu-icon { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; color: #5f6876; background: #f1f3f6; border-radius: 8px; font-size: 14px; }
.portal-mobile-menu-link.is-active .portal-mobile-menu-icon { color: var(--portal-navy); background: #fff; }
.portal-mobile-menu-label { min-width: 0; flex: 1 1 auto; }
.portal-mobile-menu-current { color: var(--portal-navy); font-size: 13px; }
.portal-mobile-menu-link .portal-nav-count { margin-left: auto; }
.portal-mobile-menu-account { display: grid; gap: 2px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--portal-border); }
.portal-mobile-menu-user { display: flex; min-width: 0; align-items: center; gap: 11px; margin-bottom: 7px; padding: 0 4px 9px; }
.portal-mobile-menu-user > span:last-child { display: grid; min-width: 0; gap: 1px; }
.portal-mobile-menu-user small { color: var(--portal-muted); font-size: 11px; }
.portal-mobile-menu-user strong { overflow: hidden; color: var(--portal-ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.portal-mobile-menu-account a, .portal-mobile-menu-account button { min-height: 46px; padding: 0 8px; border-radius: 7px; }
.portal-mobile-menu-account a[aria-current="page"] { color: var(--portal-navy); background: #edf0f6; font-weight: 650; }
.portal-mobile-menu-account form { margin: 0; }

@media (max-width: 1239.98px) {
  .portal-app .portal-topbar { padding-right: 24px; padding-left: 24px; }
  .portal-primary-nav, .portal-account { display: none !important; }
  .portal-menu-trigger { display: inline-flex; }
}
@media (max-width: 767.98px) {
  .portal-app .portal-topbar { min-height: calc(64px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .portal-topbar-inner { min-height: 64px; gap: 12px; }
  .portal-brand-horizontal { gap: 8px; }
  .portal-brand-horizontal img { width: 84px; height: 32px; }
  .portal-brand-horizontal span { max-width: 92px; font-size: 11px; }
  .portal-menu-trigger { gap: 8px; padding: 0 11px; }
  .portal-sheet { width: 100%; margin-top: 20px; margin-bottom: 28px; padding-right: 20px; padding-left: 20px; }
  .portal-footer-inner { width: calc(100% - 40px); min-height: 0; align-items: flex-start; flex-direction: column; gap: 4px; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
  .portal-footer-links { gap: 18px; }
  .portal-footer-links a { min-height: 40px; }
  .portal-nav-modal-header { min-height: calc(64px + env(safe-area-inset-top)); padding-top: max(8px, env(safe-area-inset-top)); padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .portal-nav-modal .modal-body { padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
}
@media (max-width: 575.98px) {
  .portal-nav-modal .modal-dialog.modal-fullscreen { width: 100vw !important; max-width: none !important; }
  .portal-nav-modal .modal-content { border-radius: 0; }
  .portal-footer-inner { width: calc(100% - 32px); }
  .portal-mobile-menu-group { margin-bottom: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-primary-link, .portal-mobile-menu-link { transition: none; }
}

/* Overview dashboard: compact bento layout with equal, legible data surfaces. */
.portal-overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.portal-overview-card {
  min-width: 0;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-card);
}
.portal-overview-balance { display: flex; min-height: 190px; grid-column: span 3; flex-direction: column; justify-content: space-between; background: #f8f9fb; border-top: 2px solid var(--portal-orange-brand); }
.portal-overview-service-kpi { display: flex; min-height: 190px; grid-column: span 3; flex-direction: column; justify-content: space-between; }
.portal-overview-traffic { display: flex; min-height: 230px; grid-column: span 6; flex-direction: column; }
.portal-overview-documents { grid-column: span 7; }
.portal-overview-services { grid-column: span 5; }
.portal-overview-operations { grid-column: span 7; }
.portal-overview-tickets { grid-column: span 5; }
.portal-overview .portal-panel-heading { display: flex; min-height: 34px; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.portal-overview .portal-panel-heading h2 { margin: 0; color: var(--portal-navy); font-size: 16px; }
.portal-overview .portal-panel-heading > .portal-text-link { flex: 0 0 auto; margin-top: 0; }
.portal-overview-count { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--portal-navy); font-variant-numeric: tabular-nums; }
.portal-overview-count strong { font-size: 34px; font-weight: 650; letter-spacing: -.04em; line-height: 1.1; }
.portal-overview-count span { color: var(--portal-muted); font-size: 13px; line-height: 1.3; }
.portal-overview-monthly { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--portal-rule); }
.portal-overview-monthly > span { color: var(--portal-muted); font-size: 12px; }
.portal-overview-monthly > div { display: grid; gap: 2px; }
.portal-overview-monthly strong { color: var(--portal-navy); font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portal-overview-monthly .portal-overview-unavailable { color: var(--portal-muted); font-size: 13px; font-weight: 500; }
.portal-overview-service-kpi > .portal-inline-action { margin-top: 8px; }
.portal-traffic-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-traffic-total { display: grid; min-width: 0; gap: 4px; }
.portal-traffic-total > span { color: var(--portal-muted); font-size: 12px; }
.portal-traffic-total > span i { margin-right: 4px; color: var(--portal-navy); font-size: 10px; }
.portal-traffic-total > strong { overflow: hidden; color: var(--portal-navy); font-size: clamp(14px, 1.4vw, 18px); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.portal-traffic-chart-wrap { min-height: 54px; flex: 1 1 auto; margin-top: 7px; }
.portal-traffic-chart-status { display: flex; min-height: 54px; align-items: center; margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-overview-traffic-image { display: block; width: 100%; min-width: 0; max-width: 100%; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; }
.portal-overview-traffic-image[hidden] { display: none !important; }
.portal-overview .portal-data-row { min-height: 62px; padding: 10px 2px; }
.portal-overview .portal-document-list .portal-data-row { min-height: 60px; }
.portal-overview .portal-overview-list { border-top-color: var(--portal-rule); }
.portal-overview .portal-overview-row { padding: 13px 2px; }
.portal-overview .portal-overview-row:last-child { border-bottom: 0; }
.portal-overview .portal-empty-inline { padding: 12px 0 0; background: transparent; border: 0; border-radius: 0; }

@media (max-width: 991.98px) {
  .portal-overview-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .portal-overview-balance, .portal-overview-service-kpi { grid-column: span 3; }
  .portal-overview-traffic { grid-column: 1 / -1; }
  .portal-overview-documents, .portal-overview-services { grid-column: span 3; }
  .portal-overview-operations, .portal-overview-tickets { grid-column: span 3; }
  .portal-overview-card { padding: 20px; }
}
@media (max-width: 767.98px) {
  .portal-overview-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .portal-overview-card { grid-column: 1; padding: 19px 20px; }
  .portal-overview-balance, .portal-overview-service-kpi { min-height: 164px; }
  .portal-overview-traffic { min-height: 180px; }
  .portal-traffic-total > strong { font-size: 17px; }
}
@media (max-width: 420px) {
  .portal-overview-card { padding: 17px 16px; }
  .portal-overview .portal-panel-heading { gap: 8px; }
  .portal-overview .portal-panel-heading h2 { font-size: 15px; }
  .portal-overview-count strong { font-size: 31px; }
  .portal-traffic-summary { gap: 8px; }
}

/* Liquid Glass is limited to the floating shared navigation layer. */
.portal-app .portal-topbar {
  background: #fff;
  border-bottom-color: rgba(205, 211, 220, .9);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .portal-app .portal-topbar {
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .portal-app .portal-topbar {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom-color: #727b88;
  }
}


/* Idle-session countdown in the shared navigation. */
.portal-session-countdown {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--portal-muted);
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.portal-session-countdown > i { color: #687487; font-size: 12px; }
.portal-session-countdown > strong { color: var(--portal-navy); font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.portal-session-countdown.is-near-expiry { color: var(--portal-negative); border-color: #e8c9c9; background: #fff7f7; }
.portal-session-countdown.is-near-expiry > i,
.portal-session-countdown.is-near-expiry > strong { color: var(--portal-negative); }
@media (max-width: 767.98px) {
  .portal-session-countdown { min-height: 40px; gap: 6px; padding: 0 9px; }
  .portal-session-countdown-label { display: none; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .portal-session-countdown { background: #fff; }
}


/* Match the session clock and navigation to the usable card-grid edges inside the padded sheet. */
.portal-app .portal-topbar { padding-right: 0; padding-left: 0; }
.portal-topbar-inner { width: min(calc(100% - 144px), 1200px); gap: 18px; }
.portal-topbar-main { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 18px; }
.portal-topbar-actions { margin-left: auto; }
.portal-topbar-utility { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; }
.portal-session-countdown {
  min-height: 32px;
  gap: 5px;
  padding: 0 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 11px;
}
.portal-session-countdown > i { font-size: 11px; }
.portal-session-countdown > strong { font-size: 12px; }
.portal-session-countdown.is-near-expiry { background: transparent; }
@media (max-width: 1100px) {
  .portal-topbar-inner { width: min(calc(100% - 128px), 1200px); }
}
@media (max-width: 991.98px) {
  .portal-topbar-inner { width: min(calc(100% - 104px), 1224px); }
}
@media (max-width: 767.98px) {
  .portal-topbar-inner {
    width: calc(100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)));
    margin-left: max(16px, env(safe-area-inset-left));
    margin-right: max(16px, env(safe-area-inset-right));
  }
  .portal-topbar-inner, .portal-topbar-main { gap: 12px; }
  .portal-session-countdown { min-height: 36px; padding: 0 2px; }
}
@media (max-width: 420px) {
  .portal-topbar-inner {
    width: calc(100% - max(14px, env(safe-area-inset-left)) - max(14px, env(safe-area-inset-right)));
    margin-left: max(14px, env(safe-area-inset-left));
    margin-right: max(14px, env(safe-area-inset-right));
  }
}


/* Document history uses the same concise rows and surfaces as Overview. */
.portal-documents-view { min-width: 0; }
.portal-documents-list-card { min-width: 0; }
.portal-documents-list { border-top: 1px solid var(--portal-rule); }
.portal-document-list-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 22px;
  min-height: 78px;
  padding: 16px 2px;
}
.portal-document-row-main { min-width: 0; }
.portal-document-row-title { display: inline-block; color: var(--portal-ink); text-decoration: none; }
a.portal-document-row-title:hover { color: var(--portal-orange); }
.portal-document-list-row .portal-document-status {
  position: static;
  grid-column: 2;
  grid-row: auto;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-self: end;
  gap: 7px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.portal-document-status::before { width: 7px; height: 7px; flex: 0 0 7px; background: currentColor; border-radius: 50%; content: ""; }
.portal-document-status.is-approved { color: #286344; background: #edf5ef; border-color: #dcebdd; }
.portal-document-status.is-pending { color: #78540b; background: #fff6df; border-color: #f0dfb4; }
.portal-document-status.is-open { color: #4e5d70; background: #f1f3f6; border-color: #e0e4ea; }
.portal-document-row-actions {
  display: flex;
  grid-column: 3;
  grid-row: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.portal-document-row-actions .btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  white-space: nowrap;
}
.portal-documents-list-card .portal-document-action-label { display: inline; }
.portal-document-unavailable { max-width: 210px; color: var(--portal-muted); font-size: 12px; line-height: 1.4; text-align: right; }
.portal-documents-empty { padding: 20px 0 0; background: transparent; border: 0; border-radius: 0; }
.portal-documents-empty p { margin: 4px 0 0; color: var(--portal-muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 991.98px) {
  .portal-document-list-row { gap: 10px 14px; }
  .portal-document-row-actions { gap: 6px; }
  .portal-document-row-actions .btn { padding-right: 9px; padding-left: 9px; }
}
@media (max-width: 767.98px) {
  .portal-document-list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 15px 1px;
  }
  .portal-document-list-row .portal-document-status,
  .portal-document-list-row .portal-document-row-actions {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
  .portal-document-row-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .portal-document-row-actions .btn { min-width: 128px; min-height: 44px; flex: 1 1 128px; }
  .portal-document-unavailable { max-width: none; text-align: left; }
}
@media (max-width: 420px) {
  .portal-document-list-row { gap: 9px; }
  .portal-document-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-document-row-actions .btn { min-width: 0; padding-right: 8px; padding-left: 8px; font-size: 13px; }
}


/* Ticket inbox shares Overview rows; the conversation stays a focused chat surface. */
.portal-ticket-inbox-card { min-width: 0; }
.portal-ticket-inbox-heading { align-items: center; margin-bottom: 14px; }
.portal-ticket-list-title { min-width: 0; }
.portal-ticket-list-title .portal-section-eyebrow { margin-bottom: 4px; }
.portal-ticket-list-title h2 { margin: 0; color: var(--portal-navy); font-size: 16px; font-weight: 600; }
.portal-ticket-list-title > p:last-child { margin: 4px 0 0; color: var(--portal-muted); font-size: 13px; line-height: 1.45; }
.portal-ticket-inbox-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; }
.portal-ticket-inbox-actions .btn { min-height: 44px; }
.portal-ticket-inbox { display: block; margin: 0; padding: 0; border-top: 1px solid var(--portal-rule); }
.portal-ticket-inbox-item { margin: 0; padding: 0; list-style: none; }
.portal-ticket-inbox-row {
  grid-template-columns: minmax(0, 1fr) auto auto 14px;
  min-height: 74px;
  gap: 8px 22px;
  padding: 15px 2px;
  color: inherit;
  text-decoration: none;
  transition: background-color 140ms ease;
}
.portal-ticket-inbox-row:hover { color: inherit; background: #f8f9fb; }
.portal-ticket-inbox-row:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--portal-orange-brand); outline-offset: -3px; }
.portal-ticket-inbox-row .portal-overview-row-title { transition: color 140ms ease; }
.portal-ticket-inbox-row:hover .portal-overview-row-title { color: var(--portal-orange); }
.portal-ticket-inbox-row .portal-ticket-status { grid-column: 2; grid-row: auto; justify-self: start; }
.portal-ticket-inbox-row .portal-ticket-inbox-date { grid-column: 3; grid-row: auto; color: var(--portal-muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.portal-ticket-inbox-row .portal-ticket-inbox-arrow { grid-column: 4; grid-row: auto; color: #8993a1; font-size: 12px; text-align: right; transition: color 140ms ease; }
.portal-ticket-inbox-row:hover .portal-ticket-inbox-arrow { color: var(--portal-navy); }
.portal-ticket-inbox-empty { padding: 18px 0 0; background: transparent; border: 0; border-radius: 0; }
.portal-ticket-inbox-empty strong { color: var(--portal-ink); font-size: 14px; font-weight: 600; }
.portal-ticket-inbox-empty p { margin: 3px 0 0; color: var(--portal-muted); font-size: 13px; line-height: 1.5; }
.portal-ticket-pagination { display: flex; justify-content: center; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--portal-rule); }
.portal-ticket-pagination .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
.portal-ticket-pagination .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }

.portal-app .portal-ticket-thread { border-radius: var(--portal-radius-card); }
.portal-app .portal-ticket-thread > .card-header.portal-ticket-chat-header { border-bottom: 1px solid var(--portal-rule); }
.portal-app .portal-ticket-thread .portal-chat-header-mark { width: 42px; height: 42px; flex-basis: 42px; background: #f2f4f7; border-color: var(--portal-border); border-radius: 10px; font-size: 16px; }
.portal-app .portal-ticket-thread .portal-ticket-heading h2 { font-size: 17px; line-height: 1.35; }
.portal-ui .portal-ticket-thread .messages-container { background: #f7f8fa; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-customer {
  color: var(--portal-ink);
  background: #e9eef7;
  border-color: #dbe3f0;
}
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-customer .message-body { color: var(--portal-ink); }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-customer .message-body blockquote { color: #424957; background: rgba(255, 255, 255, .78); border-color: #aeb8c7 !important; }
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-customer .portal-chat-actions,
.portal-ui.portal-helpdesk-ticket-page .portal-ticket-thread .message-customer .text-muted-inherited { color: var(--portal-muted) !important; }

@media (max-width: 991.98px) {
  .portal-ticket-inbox-row { gap: 8px 14px; }
}
@media (max-width: 767.98px) {
  .portal-app .portal-ticket-inbox-card { padding: 19px 20px; }
  .portal-ticket-inbox-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .portal-ticket-inbox-actions { width: 100%; justify-content: space-between; gap: 10px; }
  .portal-ticket-inbox-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 1px; }
  .portal-ticket-inbox-row .portal-overview-row-main { grid-column: 1 / -1; }
  .portal-ticket-inbox-row .portal-ticket-status { grid-column: 1; grid-row: auto; }
  .portal-ticket-inbox-row .portal-ticket-inbox-date { grid-column: 2; grid-row: auto; justify-self: end; font-size: 12px; }
  .portal-ticket-inbox-row .portal-ticket-inbox-arrow { display: none; }
}
@media (max-width: 420px) {
  .portal-app .portal-ticket-inbox-card { padding: 17px 16px; }
  .portal-ticket-inbox-actions { align-items: stretch; flex-direction: column; }
  .portal-ticket-inbox-actions .btn { width: 100%; }
  .portal-ticket-inbox-row { gap: 7px 10px; }
  .portal-ticket-inbox-row .portal-overview-row-title { font-size: 14px; }
  .portal-ticket-inbox-row .portal-ticket-inbox-date { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-ticket-inbox-row,
  .portal-ticket-inbox-row .portal-overview-row-title,
  .portal-ticket-inbox-row .portal-ticket-inbox-arrow { transition: none; }
}


/* Profile: account information follows the Overview card rhythm. */
.portal-profile-layout { display: grid; min-width: 0; gap: 16px; }
.portal-profile-identity {
  display: flex;
  min-width: 0;
  min-height: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  background: #f8f9fb;
  border-top: 2px solid var(--portal-orange-brand);
}
.portal-profile-identity-main { display: flex; min-width: 0; align-items: center; gap: 16px; }
.portal-profile-avatar { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; color: var(--portal-navy); background: #fff; border: 1px solid var(--portal-border); border-radius: 12px; font-size: 20px; }
.portal-profile-identity-copy { min-width: 0; }
.portal-profile-identity-copy .portal-section-eyebrow { margin-bottom: 4px; }
.portal-profile-identity-copy h2 { margin: 0; color: var(--portal-navy); font-size: clamp(21px, 2vw, 27px); font-weight: 650; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.portal-profile-customer-number { margin: 7px 0 0; color: var(--portal-muted); font-size: 13px; }
.portal-profile-customer-number strong { color: var(--portal-ink); font-variant-numeric: tabular-nums; }
.portal-profile-identity-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 18px; }
.portal-profile-status-group { display: grid; justify-items: start; gap: 5px; }
.portal-profile-status-label { color: var(--portal-muted); font-size: 12px; }
.portal-profile-status { display: inline-flex; min-height: 25px; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.portal-profile-status.is-active { color: #164d30; background: #e5f3e9; border-color: #c9e3d1; }
.portal-profile-status.is-pending { color: #684000; background: #fff5df; border-color: #f0d7a2; }
.portal-profile-status.is-blocked { color: #7f1d22; background: #fff0f0; border-color: #f0c7c9; }
.portal-profile-status.is-inactive { color: #454b55; background: #eef0f2; border-color: #d8dce2; }
.portal-profile-edit-link { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.portal-profile-grid { display: grid; min-width: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
.portal-profile-card { min-width: 0; padding: 22px 24px; }
.portal-profile-contact-card, .portal-profile-address-card,
.portal-profile-billing-card, .portal-profile-security-card { grid-column: span 6; }
.portal-profile-nodes-card { grid-column: 1 / -1; }
.portal-profile-card .portal-panel-heading { align-items: flex-start; margin-bottom: 15px; }
.portal-profile-card .portal-panel-heading .portal-section-eyebrow { margin-bottom: 3px; }
.portal-profile-card .portal-panel-heading h2 { margin: 0; color: var(--portal-navy); font-size: 16px; font-weight: 600; line-height: 1.35; }
.portal-profile-card .portal-panel-heading > .portal-text-link { margin-top: 8px; }
.portal-profile-detail-grid { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portal-profile-detail { min-width: 0; margin: 0; padding: 13px 14px; background: #f8f9fb; border-radius: 8px; }
.portal-profile-detail dt, .portal-profile-address-data dt, .portal-profile-metadata dt { margin: 0 0 4px; color: var(--portal-muted); font-size: 12px; font-weight: 500; }
.portal-profile-detail dd, .portal-profile-address-data dd, .portal-profile-metadata dd { margin: 0; color: var(--portal-ink); font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.portal-profile-subheading { margin: 18px 0 7px; }
.portal-profile-subheading h3 { margin: 0; color: var(--portal-ink); font-size: 13px; font-weight: 600; }
.portal-profile-contact-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--portal-rule); }
.portal-profile-contact-row { display: grid; min-width: 0; grid-template-columns: minmax(100px, .55fr) minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 2px; border-bottom: 1px solid var(--portal-rule); }
.portal-profile-contact-row > span { color: var(--portal-muted); font-size: 13px; }
.portal-profile-contact-row > strong { min-width: 0; color: var(--portal-ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.portal-profile-empty-contacts { margin-top: 14px; }
.portal-profile-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--portal-rule); }
.portal-profile-metadata dl { min-width: 0; margin: 0; }
.portal-profile-addresses { display: grid; gap: 9px; margin: 0; }
.portal-profile-addresses .accordion-item { overflow: hidden; border: 1px solid var(--portal-border); border-radius: 8px; }
.portal-profile-addresses .accordion-header { margin: 0; }
.portal-profile-addresses .accordion-button { min-height: 52px; gap: 10px; padding: 12px 14px; color: var(--portal-ink); background: #fff; box-shadow: none; font-size: 13px; font-weight: 600; line-height: 1.4; }
.portal-profile-addresses .accordion-button:not(.collapsed) { color: var(--portal-navy); background: #f8f9fb; }
.portal-profile-addresses .accordion-button > i { flex: 0 0 auto; color: var(--portal-muted); }
.portal-profile-addresses .accordion-button > span { min-width: 0; overflow-wrap: anywhere; }
.portal-profile-addresses .accordion-body { padding: 14px; border-top: 1px solid var(--portal-rule); }
.portal-profile-address-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; margin: 0; }
.portal-profile-address-data > div { min-width: 0; }
.portal-profile-address-data > div:first-child { grid-column: 1 / -1; }
.portal-profile-address-data dt { font-size: 11px; }
.portal-profile-address-data dd { font-size: 13px; }
.portal-profile-bank-surface { min-width: 0; padding: 15px; background: #f8f9fb; border-radius: 8px; }
.portal-profile-bank-label { margin-bottom: 8px; color: var(--portal-muted); font-size: 12px; font-weight: 500; }
.portal-profile-card .portal-bank-account-row { align-items: center; gap: 10px; }
.portal-profile-card .portal-account-number { min-width: 0; color: var(--portal-ink); font-size: 15px !important; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .015em; overflow-wrap: anywhere; }
.portal-profile-card .portal-copy-account { min-height: 40px; }
.portal-profile-balance-surface { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 15px 2px 0; border-top: 1px solid var(--portal-rule); }
.portal-profile-balance-surface .portal-section-eyebrow { margin-bottom: 5px; }
.portal-profile-balance-surface .portal-balance-value { gap: 6px; }
.portal-profile-balance-surface .portal-balance-value strong { font-size: clamp(27px, 2.6vw, 34px); }
.portal-profile-balance-icon { color: #9aa3b0; font-size: 19px; }
.portal-profile-pin-block { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.portal-profile-pin-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: var(--portal-navy); background: #f1f3f6; border-radius: 9px; }
.portal-profile-pin-copy { min-width: 0; padding-top: 1px; }
.portal-profile-pin-copy strong { color: var(--portal-ink); font-size: 14px; }
.portal-profile-pin-copy p { margin: 4px 0 0; color: var(--portal-muted); font-size: 13px; line-height: 1.45; }
.portal-profile-pin-button { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin-top: 15px; }
.portal-profile-pin-unavailable { margin: 15px 0 0; color: var(--portal-muted); font-size: 13px; }
.portal-profile-shortcuts { display: grid; gap: 2px; margin-top: 19px; padding-top: 9px; border-top: 1px solid var(--portal-rule); }
.portal-profile-shortcuts a { display: grid; min-height: 46px; grid-template-columns: 20px minmax(0, 1fr) 16px; align-items: center; gap: 9px; color: var(--portal-ink); text-decoration: none; font-size: 14px; font-weight: 550; }
.portal-profile-shortcuts a > i:first-child { color: var(--portal-muted); text-align: center; }
.portal-profile-shortcuts a > i:last-child { color: #9aa3b0; font-size: 11px; text-align: right; }
.portal-profile-shortcuts a:hover { color: var(--portal-navy); }
.portal-profile-shortcuts a:hover > i:last-child { color: var(--portal-orange-brand); }
.portal-profile-nodes-card .portal-panel-heading { align-items: center; }
.portal-profile-node-table { overflow: hidden; border: 1px solid var(--portal-rule); border-radius: 8px; }
.portal-profile-node-table .table thead th { padding-top: 12px; padding-bottom: 12px; }
.portal-profile-node-table .table tbody tr:last-child td { border-bottom: 0; }
.portal-profile-node-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.portal-profile-node-status.is-online { color: #216343; }
.portal-profile-node-status.is-offline { color: #7f1d22; }
.portal-profile-node-status i { font-size: 12px; }
.portal-profile-card .portal-count-label { flex: 0 0 auto; }

@media (max-width: 991.98px) {
  .portal-profile-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .portal-profile-contact-card, .portal-profile-address-card,
  .portal-profile-billing-card, .portal-profile-security-card { grid-column: span 3; }
}
@media (max-width: 767.98px) {
  .portal-profile-layout, .portal-profile-grid { gap: 14px; }
  .portal-profile-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-profile-card, .portal-profile-contact-card, .portal-profile-address-card,
  .portal-profile-billing-card, .portal-profile-security-card, .portal-profile-nodes-card { grid-column: 1; padding: 19px 20px; }
  .portal-profile-identity { min-height: 0; align-items: flex-start; flex-direction: column; gap: 18px; padding: 19px 20px; }
  .portal-profile-identity-actions { width: 100%; justify-content: space-between; gap: 12px; }
  .portal-profile-identity-copy h2 { font-size: 22px; }
  .portal-profile-card .portal-panel-heading { gap: 8px; }
  .portal-profile-card .portal-panel-heading > .portal-text-link { margin-top: 0; }
  .portal-profile-address-data { grid-template-columns: minmax(0, 1fr); }
  .portal-profile-address-data > div:first-child { grid-column: 1; }
  .portal-profile-node-table { overflow-x: auto; }
  .portal-profile-node-table .table { min-width: 540px; }
}
@media (max-width: 420px) {
  .portal-profile-card { padding: 17px 16px; }
  .portal-profile-identity { padding: 17px 16px; }
}
@media (max-width: 575.98px) {
  .portal-profile-identity-actions { align-items: flex-start; flex-direction: column; }
  .portal-profile-edit-link { width: 100%; }
  .portal-profile-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-profile-contact-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .portal-profile-contact-row > strong { text-align: left; }
  .portal-profile-metadata { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .portal-profile-balance-surface { align-items: flex-start; }
  .portal-profile-balance-surface .portal-balance-value strong { font-size: 28px; }
  .portal-profile-card .portal-panel-heading > .portal-text-link { max-width: 130px; white-space: normal; text-align: right; }
}

/* Mobile polish: keep account actions reachable while the section list scrolls. */
.portal-nav-modal .modal-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.portal-mobile-menu-links {
  display: block;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
.portal-mobile-menu-account {
  flex: 0 0 auto;
  margin-top: 10px;
  background: #fff;
}
.portal-mobile-menu-link:focus-visible,
.portal-mobile-menu-account a:focus-visible,
.portal-mobile-menu-account button:focus-visible,
.portal-nav-close:focus-visible {
  outline: 2px solid var(--portal-orange-brand);
  outline-offset: 2px;
}
@media (max-height: 520px) and (max-width: 1239.98px) {
  .portal-nav-modal .modal-body { padding-top: 12px; }
  .portal-nav-modal-caption { margin-bottom: 8px; }
  .portal-mobile-menu-group { margin-bottom: 10px; }
  .portal-mobile-menu-link { min-height: 44px; }
  .portal-mobile-menu-account { margin-top: 6px; padding-top: 8px; }
  .portal-mobile-menu-user { margin-bottom: 2px; padding-bottom: 4px; }
  .portal-mobile-menu-account a,
  .portal-mobile-menu-account button { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-nav-modal.fade .modal-dialog,
  .portal-nav-modal.show .modal-dialog { transform: none; transition: none; }
}

/* Profile devices become readable cards instead of a horizontally scrolling table. */
@media (max-width: 767.98px) {
  .portal-profile-node-table { overflow: visible; border: 0; border-radius: 0; }
  .portal-profile-node-table .table { width: 100%; min-width: 0; }
  .portal-profile-node-table .table-mobile-cards tbody { padding: 0; }
  .portal-profile-node-table .table-mobile-cards tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-profile-node-table .table-mobile-cards tbody td:last-child {
    grid-column: 1 / -1;
    align-items: flex-start;
    padding-top: 8px !important;
    border-top: 1px solid var(--portal-rule);
  }
}

/* BOK mobile refinement: profile node cards and the full-screen navigation. */
@media (max-width: 767.98px) {
  .portal-profile-node-table .table-mobile-cards tbody tr {
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 4px 12px;
  }

  .portal-profile-node-table .table-mobile-cards tbody td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 6px 0 !important;
    border-bottom: 0;
    font-weight: 500;
    text-align: left !important;
  }

  .portal-profile-node-table .table-mobile-cards tbody td:nth-child(2)::before {
    margin-right: 0;
    text-align: left;
  }

  .portal-profile-node-table .table-mobile-cards tbody td:last-child {
    grid-column: 2;
    grid-row: 2;
    align-items: flex-end;
    flex-direction: column;
    justify-content: center;
    padding: 6px 0 6px 8px !important;
    border-top: 0;
    text-align: right;
  }

  .portal-nav-modal .modal-content {
    box-sizing: border-box;
    height: 100dvh;
    min-height: 0;
  }

  .portal-nav-modal-header {
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }

  .portal-nav-modal .modal-body {
    box-sizing: border-box;
    flex: 1 1 0;
    min-height: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .portal-mobile-menu-links {
    flex: 1 1 0;
    min-height: 0;
    touch-action: pan-y;
  }

  .portal-mobile-menu-account {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 375.98px) {
  .portal-profile-node-table .table-mobile-cards tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-profile-node-table .table-mobile-cards tbody td:nth-child(2),
  .portal-profile-node-table .table-mobile-cards tbody td:last-child {
    grid-column: 1;
    grid-row: auto;
  }

  .portal-profile-node-table .table-mobile-cards tbody td:last-child {
    align-items: flex-start;
    padding: 8px 0 4px !important;
    border-top: 1px solid var(--portal-rule);
    text-align: left;
  }
}

/* Keep mobile menu icon tiles fixed; only the text label should take remaining width. */
.portal-mobile-menu-link > .portal-mobile-menu-icon:first-child {
  box-sizing: border-box;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.portal-mobile-menu-icon > i {
  width: 1em;
  text-align: center;
}


/* Keep the Adescom preflight controls visually identical to nav links. */
.portal-nav-form { display: flex; flex: 0 0 auto; align-items: center; margin: 0; }
.portal-nav-button { appearance: none; font: inherit; cursor: pointer; background: transparent; }
.portal-mobile-menu-form { width: 100%; margin: 0; }
.portal-mobile-menu-form .portal-mobile-menu-link { width: 100%; appearance: none; border: 0; font: inherit; text-align: left; cursor: pointer; background: transparent; }
