/* Billing V2 RC2.9. Screen-only themes keep receipts and exported printouts light. */
@media screen {
  :root {
    --ui-bg:#f4f6f8; --ui-surface:#fff; --ui-soft:#edf3f0; --ui-text:#17212b;
    --ui-muted:#617184; --ui-border:#d9e2e9; --ui-accent:#13775a; --ui-focus:#147dcb;
    --ui-header-height:64px;
    color-scheme:light;
  }
  html[data-theme="dark"] {
    color-scheme:dark;
    --ui-bg:#101820; --ui-surface:#1a2632; --ui-soft:#22333e; --ui-text:#e3ebf1;
    --ui-muted:#a7b7c6; --ui-border:#364957; --ui-accent:#6dd4b0; --ui-focus:#80caff;
    --evolve-bg:var(--ui-bg); --evolve-surface:var(--ui-surface); --evolve-text:var(--ui-text);
    --evolve-muted:var(--ui-muted); --evolve-border:var(--ui-border); --evolve-sidebar:#111d29;
    --evolve-brand:#6dd4b0; --evolve-brand-dark:#98e5cb; --evolve-brand-soft:#203d36;
    --evolve-warning-soft:#3d321e; --evolve-danger-soft:#422c35; --evolve-info-soft:#223d47;
    --evolve-warning:#f2c86d; --evolve-danger:#ff9ca7; --evolve-info:#86cedf;
    --portal-bg:var(--ui-bg); --portal-surface:var(--ui-surface); --portal-text:var(--ui-text);
    --portal-muted:var(--ui-muted); --portal-border:var(--ui-border); --portal-accent:#6dd4b0;
    --portal-accent-dark:#a5e6cf; --portal-accent-soft:#203d36; --portal-danger:#ff9ca7;
    --portal-danger-soft:#422c35; --portal-warning:#f2c86d; --portal-warning-soft:#3d321e;
    --portal-blue:#9bc6e1; --portal-blue-soft:#223d47;
    --public-text:var(--ui-text); --public-muted:var(--ui-muted); --public-soft:var(--ui-bg);
    --public-border:var(--ui-border); --public-brand-soft:#203d36; --public-white:var(--ui-surface);
    --public-brand:#6dd4b0; --public-brand-dark:#98e5cb; --public-brand-deep:#164c3b;
    --ink:var(--ui-text); --muted:var(--ui-muted); --line:var(--ui-border);
  }
  [hidden] { display:none !important; }
  html { scroll-padding-top:calc(var(--ui-header-height) + 18px); }
  #main-content { scroll-margin-top:calc(var(--ui-header-height) + 18px); }
  #main-content:focus { outline:none; }
  :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
    outline:3px solid var(--ui-focus) !important; outline-offset:3px;
  }
  :where(button,.btn,[role="button"],.public-button) { transition:background-color .16s,color .16s,box-shadow .16s,filter .16s; }
  @media (hover:hover) {
    :where(button,.btn,[role="button"],.public-button):not(:disabled):not(.disabled):hover { filter:brightness(.94); box-shadow:0 2px 7px #0b152426; }
    html[data-theme="dark"] :where(button,.btn,[role="button"],.public-button):not(:disabled):not(.disabled):hover { filter:brightness(1.16); }
  }
  :where(button,.btn):disabled { cursor:not-allowed; }
  .ui-skip-link { position:fixed; z-index:10000; top:8px; left:10px; transform:translateY(-180%); padding:10px 16px; background:var(--ui-surface); color:var(--ui-text); border:2px solid var(--ui-focus); border-radius:8px; font-weight:700; }
  .ui-skip-link:focus { transform:none; }
  .main-header.navbar { position:sticky !important; top:0; z-index:1034; }
  .public-header,.collector-nav { position:sticky; top:0; z-index:1034; }
  .ui-theme-toggle,.ui-sidebar-close,.ui-back-top,.ui-search-clear,.ui-password-toggle {
    display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--ui-border);
    background:var(--ui-surface); color:var(--ui-text); cursor:pointer; border-radius:10px;
  }
  .ui-theme-toggle { flex:none; width:40px; height:40px; margin:0 4px; padding:8px; }
  [data-theme="dark"] .ui-theme-toggle { background:#233b42; color:#a3edca; }
  .ui-scroll-progress { position:fixed; z-index:1060; top:0; left:0; right:0; height:3px; pointer-events:none; background:transparent; }
  .ui-scroll-progress span { display:block; height:100%; background:#1aa779; transform-origin:left; }
  .ui-back-top { position:fixed; z-index:1033; right:20px; bottom:max(20px,env(safe-area-inset-bottom)); width:44px; height:44px; font-size:26px; box-shadow:0 4px 18px #0003; }
  .ui-loading { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:1061; display:flex; align-items:center; gap:10px; max-width:calc(100vw - 100px); padding:12px 18px; background:var(--ui-surface); color:var(--ui-text); border:1px solid var(--ui-border); border-radius:12px; box-shadow:0 8px 30px #0003; font-size:14px; }
  .ui-spinner { width:18px; height:18px; flex:none; border:2px solid var(--ui-border); border-top-color:var(--ui-accent); border-radius:50%; animation:ui-spin .75s linear infinite; }
  @keyframes ui-spin { to { transform:rotate(360deg); } }
  .ui-submitting { cursor:progress; }
  .ui-submitting button[type="submit"],.ui-submitting button:not([type]),.ui-submitting input[type="submit"] { pointer-events:none; opacity:.65; }
  .ui-password-wrap { position:relative; flex:1 1 auto; min-width:0; }
  .ui-password-wrap>input { width:100%; padding-right:72px !important; }
  .ui-password-toggle { position:absolute; right:4px; top:50%; transform:translateY(-50%); height:30px; min-width:58px; padding:0 8px; font-size:12px; font-weight:700; border:0; background:transparent; }
  .ui-confirm { box-sizing:border-box; width:min(460px,calc(100vw - 32px)); padding:26px; background:var(--ui-surface); color:var(--ui-text); border:1px solid var(--ui-border); border-radius:16px; box-shadow:0 24px 80px #0005; }
  .ui-confirm::backdrop { background:#07101db3; }
  .ui-confirm h2 { font:700 21px/1.3 system-ui,sans-serif; margin:0 0 12px; color:inherit; }
  .ui-confirm p { font:400 15px/1.6 system-ui,sans-serif; color:var(--ui-muted); margin:0 0 24px; white-space:pre-line; overflow-wrap:anywhere; }
  .ui-confirm-actions { display:flex; justify-content:flex-end; gap:10px; }
  .ui-button { font:600 14px/1.4 system-ui,sans-serif; border:1px solid var(--ui-border); border-radius:8px; padding:10px 18px; min-height:44px; cursor:pointer; background:var(--ui-soft); color:var(--ui-text); }
  .ui-confirm-accept { background:#147456; color:white; border-color:#147456; }
  .ui-confirm-accept.is-danger { background:#b92e41; color:white; border-color:#b92e41; }
  .ui-sidebar-close { display:none; }
  .ui-menu-backdrop { position:fixed; inset:0; z-index:1036; background:#08142199; border:0; border-radius:0; }
  body.ui-mobile-menu-open { overflow:hidden; }
  .ui-site-search { margin:12px 3px 16px; padding:10px; border:1px solid #ffffff24; border-radius:10px; color:#dce5ed; background:#ffffff06; white-space:normal; }
  .ui-site-search label { display:flex; gap:6px; align-items:center; justify-content:space-between; font-size:12px; font-weight:600; margin:0 0 8px; }
  .ui-site-search kbd { font:10px system-ui,sans-serif; background:#ffffff12; border:1px solid #ffffff24; border-radius:4px; padding:2px 4px; color:inherit; }
  .ui-search-field { position:relative; }
  .ui-site-search input { display:block; width:100%; background:#0c1822; border:1px solid #60717f; border-radius:7px; padding:9px 28px 9px 9px; color:#f2f5f7; font-size:13px; line-height:1.4; }
  .ui-site-search input::placeholder { color:#aab7c5; }
  .ui-site-search input::-webkit-search-cancel-button { display:none; }
  .ui-search-clear { position:absolute; right:3px; top:3px; width:30px; height:30px; border:0; background:transparent; color:#dce5ed; font-size:20px; }
  .ui-search-status { font-size:11px; line-height:1.5; margin:7px 0 0; color:inherit; }
  .ui-search-status:empty { display:none; }
  .ui-search-results { max-height:45vh; overflow-y:auto; padding:3px; margin:8px -3px 0; scrollbar-width:thin; }
  .ui-search-results h3 { margin:10px 5px 5px; font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:inherit; opacity:.85; }
  .ui-search-result { display:block; padding:9px 6px; border-radius:6px; color:#fff !important; text-decoration:none; overflow-wrap:anywhere; }
  .ui-search-result:hover,.ui-search-result:focus { background:#ffffff14; }
  .ui-search-result strong { display:block; font-size:12px; font-weight:600; }
  .ui-search-result small { display:block; color:#b7c6d3; font-size:10px; }
  .sidebar-collapse:not(.sidebar-open) .main-sidebar:not(:hover):not(.sidebar-focused) .ui-site-search { display:none; }
  .portal-sidebar .ui-site-search { background:var(--ui-soft); color:var(--ui-text); border-color:var(--ui-border); }
  .portal-sidebar .ui-search-result { color:var(--ui-text) !important; }
  .portal-sidebar .ui-search-result small { color:var(--ui-muted); }
  .portal-sidebar .ui-search-result:hover { background:var(--ui-border); }
  .ui-collector-toggle { display:none; }
  .collector-nav { flex-wrap:wrap; }
  .collector-nav .ui-collector-menu { align-items:center; }
  .public-nav-shell { gap:12px; }
  .public-nav-shell>.ui-theme-toggle { margin-left:auto; }
  .public-nav-menu { margin-left:0; }

  /* Theme the existing component families, without filtering maps or photos. */
  html[data-theme="dark"] body,html[data-theme="dark"] .content-wrapper { background:var(--ui-bg) !important; color:var(--ui-text); }
  html[data-theme="dark"] :is(.card,.modal-content,.dropdown-menu,.list-group-item,.info-box,.collector-card,.public-login-card,.public-form-card,.public-contact-card,.public-plan-card,.public-feature-card,.public-input,.suggestions,.popover) { background:var(--ui-surface) !important; color:var(--ui-text); border-color:var(--ui-border) !important; }
  html[data-theme="dark"] :is(.main-header.navbar,.public-header,.portal-sidebar,.portal-sidebar .brand-link,.main-footer) { background:var(--ui-surface) !important; color:var(--ui-text); border-color:var(--ui-border); }
  html[data-theme="dark"] :is(.card-header,.card-footer,.modal-header,.modal-footer,.dropdown-divider,.table td,.table th) { border-color:var(--ui-border); }
  html[data-theme="dark"] :is(.card-footer,.table thead th,.table tfoot th,.input-group-text,.page-link,.btn-default,.btn-light,.bg-light,.bg-white,.collection-review) { background:var(--ui-soft) !important; color:var(--ui-text) !important; border-color:var(--ui-border) !important; }
  html[data-theme="dark"] :is(.table,.dropdown-item,.main-header .nav-link,.portal-navbar .nav-link,.portal-sidebar .nav-link,.close,.text-dark,.text-body,.text-black,.breadcrumb-item.active) { color:var(--ui-text) !important; }
  html[data-theme="dark"] :is(.text-muted,.form-text,.public-form-label) { color:var(--ui-muted) !important; }
  html[data-theme="dark"] :is(.form-control,.custom-select,.custom-file-label,.public-input,textarea) { background:var(--ui-bg) !important; color:var(--ui-text) !important; border-color:var(--ui-border) !important; }
  html[data-theme="dark"] :is(.form-control,.public-input)::placeholder { color:#8ea1b2; opacity:1; }
  html[data-theme="dark"] .form-control:disabled,html[data-theme="dark"] .form-control[readonly] { background:var(--ui-soft) !important; color:var(--ui-muted) !important; }
  html[data-theme="dark"] :is(.dropdown-item:hover,.suggestion-item:hover,.table-hover tbody tr:hover,.page-link:hover) { background:var(--ui-soft) !important; color:var(--ui-text) !important; }
  html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) { background:#ffffff04; }
  html[data-theme="dark"] .page-item.active .page-link { background:#206e54 !important; color:#fff !important; }
  html[data-theme="dark"] .btn-primary,html[data-theme="dark"] .btn-success,html[data-theme="dark"] .btn-portal-primary { background:#1e7557 !important; border-color:#418d72 !important; color:#fff !important; }
  html[data-theme="dark"] .btn-outline-primary,html[data-theme="dark"] .btn-outline-success { color:#91dec1; border-color:#62ab8f; }
  html[data-theme="dark"] .btn-outline-secondary { color:#c8d4df; border-color:#8194a7; }
  html[data-theme="dark"] .btn-outline-danger { color:#ffb0ba; border-color:#b46a76; }
  html[data-theme="dark"] .btn-outline-warning { color:#f2d08b; border-color:#b19759; }
  html[data-theme="dark"] :is(.btn-outline-primary,.btn-outline-success):hover { background:#245e4c; color:#fff; }
  html[data-theme="dark"] :is(.card-primary>.card-header:not(.bg-transparent),.card-header.bg-primary) { background:#1e7557 !important; border-color:#418d72 !important; color:#fff !important; }
  html[data-theme="dark"] .btn-danger { background:#b92e41; border-color:#cd6070; color:white; }
  html[data-theme="dark"] :is(.nav-sidebar .nav-link.active,.portal-sidebar .nav-link.active,.fc-button-primary) { background:#245e4c !important; color:white !important; }
  html[data-theme="dark"] .badge-success { background:#2d735a; color:white; }
  html[data-theme="dark"] .badge-danger { background:#8c3444; color:white; }
  html[data-theme="dark"] .badge-info { background:#236579; color:white; }
  html[data-theme="dark"] .text-success { color:#85daba !important; }
  html[data-theme="dark"] .text-danger { color:#ffa4b1 !important; }
  html[data-theme="dark"] .text-warning { color:#f2cd80 !important; }
  html[data-theme="dark"] :is(.text-info,.text-primary) { color:#9cceee !important; }
  html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.public-button):not(.ui-search-result):not(.dropdown-item):not(.brand-link) { color:var(--ui-accent); }
  html[data-theme="dark"] .public-button-primary { background:#147456; color:#fff; }
  html[data-theme="dark"] .public-button-secondary { background:var(--ui-soft); color:var(--ui-text); border-color:var(--ui-border); }
  html[data-theme="dark"] .alert-success { background:#203e33; color:#b1e4ce; }
  html[data-theme="dark"] .alert-info { background:#203d4b; color:#badfec; }
  html[data-theme="dark"] .alert-warning { background:#403720; color:#f4dc9e; }
  html[data-theme="dark"] .alert-danger { background:#452d37; color:#ffc1c9; }
  html[data-theme="dark"] .ui-theme-toggle { border-color:#557569; }
  html[data-theme="dark"] .ui-site-search input { background:#101a23; color:#fff; }
  html[data-theme="dark"] .portal-sidebar .brand-text { color:var(--ui-text); }
  /* Statement screenshots use the same light document as the print/export view. */
  html[data-theme="dark"] #statementDocument {
    color-scheme:light; background:white !important; color:#17212b !important;
    --ui-text:#17212b; --ui-muted:#617184; --ui-border:#d9e2e9; --ui-surface:#fff; --ui-soft:#f4f6f8;
    --evolve-text:#17212b; --evolve-muted:#6b7785; --evolve-border:#e2e7ec; --evolve-surface:#fff;
    --portal-text:#26332d; --portal-muted:#718078; --portal-border:#e4e9e6; --portal-surface:#fff;
  }
  html[data-theme="dark"] #statementDocument :is(.text-dark,.text-body,.table) { color:#17212b !important; }
  html[data-theme="dark"] #statementDocument .text-muted { color:#617184 !important; }
  html[data-theme="dark"] #statementDocument :is(.bg-light,.bg-white,.table th,.table td) { background:white !important; color:#17212b !important; border-color:#d9e2e9 !important; }

  @media (max-width:991.98px) {
    .ui-sidebar-close { display:flex; position:absolute; top:14px; right:8px; width:34px; height:34px; z-index:2; font-size:25px; background:#233746; color:white; border-color:#587080; }
    .main-sidebar .brand-link { padding-right:46px; }
    .main-sidebar .brand-text { font-size:12px; white-space:normal; }
    .main-sidebar { max-width:calc(100vw - 46px); }
    .sidebar-open .main-sidebar { z-index:1038; }
    .main-sidebar .sidebar { height:calc(100dvh - 64px); overflow-y:auto; }
    .ui-site-search input { font-size:16px; }
    .ui-collector-toggle { display:block; background:transparent; color:#fff; border:1px solid #ffffff80; border-radius:8px; min-height:40px; padding:5px 10px; margin-left:auto; }
    .collector-nav { flex-direction:row; align-items:center; gap:10px; padding:12px 16px; }
    .collector-nav .ui-collector-menu { display:none; width:100%; flex-direction:column; align-items:stretch; gap:0; }
    .collector-nav .ui-collector-menu.is-open { display:flex; }
    .ui-collector-menu a { padding:12px 4px; }
  }
  @media (max-width:575.98px) {
    .main-header .evolve-profile-name { display:none; }
    .main-header.navbar { padding-left:5px; padding-right:5px; }
    .main-header .evolve-nav-icon { width:34px; padding:5px; }
    .main-header .ui-theme-toggle { width:36px; height:36px; margin:0 2px; }
    .dropdown-menu-lg { min-width:280px; max-width:calc(100vw - 16px); }
    .ui-back-top { right:12px; bottom:12px; }
    .ui-confirm { padding:22px; }
    .ui-confirm-actions .ui-button { flex:1; }
    .public-brand img { max-width:160px; }
  }
  @media (prefers-reduced-motion:reduce) {
    html { scroll-behavior:auto !important; }
    *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
  }
}
@media print {
  .ui-skip-link,.ui-theme-toggle,.ui-scroll-progress,.ui-back-top,.ui-loading,.ui-confirm,.ui-menu-backdrop,.ui-sidebar-close,.ui-site-search,.ui-password-toggle,.ui-collector-toggle { display:none !important; }
}
