/* Watts Support portal: the shared look.
 *
 * 1. Colour and type tokens for dark (default) and light, copied from the agreed mockups
 *    (customer-hub-concept/screens-source/design-canvas). Pages are dark unless they opt in to the
 *    theme switch; see layouts/app.blade.php.
 * 2. The frame (pf-) and the sign-in page.
 * 3. Customer Hub components (hub-).
 *
 * Loaded after watts.css, which still styles the content of pages that have not been redesigned.
 */
:root, html[data-theme="dark"] {

    --pagebg:radial-gradient(900px 420px at 18% -80px,rgba(0,174,239,.22),transparent 70%),radial-gradient(700px 380px at 92% 0,rgba(255,39,125,.13),transparent 70%),#080a18;
    --bar:rgba(8,10,24,.74); --card:#12152b; --hero:linear-gradient(135deg,#1a1e3c 0%,#12152b 55%,#0e1124 100%); --heroline:#2f3460;
    --heroshadow:0 1px 0 rgba(255,255,255,.07) inset,0 50px 90px -50px rgba(0,174,239,.42); --soft:rgba(255,255,255,.045); --btn:rgba(255,255,255,.04);
    --ink:#eef1ff; --ink2:#c5cbe8; --mute:#a9b1d6; --line:#2a2e52; --line2:#3a3f6b; --field:#05060f; --fieldink:#ffffff; --accenttext:#5cc8f5;
    --accentbg:rgba(0,174,239,.16); --editline:#00aeef; --primarybg:#00aeef; --primaryink:#06101f; --primarybd:#00aeef;
    --primaryshadow:0 10px 24px -10px rgba(0,174,239,.9); --chipbg:#00aeef; --chipink:#06101f; --chipbd:#00aeef; --ok:#5df0bd; --okdot:#2ee6a6;
    --okbg:rgba(46,230,166,.14); --warn:#ffb74d; --warnbg:rgba(255,183,77,.16); --warnrow:rgba(255,183,77,.07); --warnline:rgba(255,183,77,.36);
    --bad:#ff8a8a; --baddot:#ff6b6b; --badbg:rgba(255,90,90,.09); --badline:rgba(255,90,90,.38); --chat:#dba0e2; --chatbg:rgba(187,103,196,.18);
    --sms:#ff7fb1; --smsbg:rgba(255,39,125,.16); --livebg:rgba(46,230,166,.08); --livebd:rgba(46,230,166,.45); --liveink:#eef1ff; --livesub:#c5cbe8;
    --liveaccent:#5df0bd; --livedot:#2ee6a6; --pulse:rgba(46,230,166,.55); --mebg:rgba(0,174,239,.12); --mebd:rgba(0,174,239,.45); --feature:#00aeef;
    --logbg:#0b0d20; --logbd:#2a2e52; --loghead:#eef1ff; --logink:#c5cbe8; --logtime:#8f97bd; --loginfo:#5cc8f5; --logwarn:#ffb74d; --logerr:#ff8a8a;
    --logok:#5df0bd; --logline:#3a3f6b; --loglink:#5cc8f5; --shadow:0 1px 0 rgba(255,255,255,.05) inset,0 24px 44px -28px rgba(0,0,0,.8);
    --rowhover:rgba(255,255,255,.04); --logoglow:0 0 24px rgba(0,174,239,.55); --avatarbg:#080a18; --avatarbd:#00aeef; --avatarink:#5cc8f5;
    --avatarglow:0 0 34px rgba(0,174,239,.45); --display:'Montserrat',system-ui,sans-serif; --body:'Inter',system-ui,sans-serif; --h1:28px; --h2:16px;
    --hw:800; --h2w:700; --num:22px; --numw:800; --rcard:20px; --rbtn:13px; --rtile:14px;
}
html[data-theme="light"] {
    --pagebg:#fffce8; --bar:rgba(255,252,232,.88); --card:#fffef6; --hero:#fffef6; --heroline:#e4dfc4;
    --heroshadow:0 1px 2px rgba(70,60,20,.05),0 30px 60px -40px rgba(70,60,20,.3); --soft:#f7f3dc; --btn:#fffef6; --ink:#1a1a1a; --ink2:#3d3b33;
    --mute:#625f50; --line:#e4dfc4; --line2:rgba(26,26,26,.32); --field:#fffefa; --fieldink:#1a1a1a; --accenttext:#05596b; --accentbg:#d9eff6;
    --editline:#05596b; --primarybg:#cfeaf8; --primaryink:#1a1a1a; --primarybd:#1a1a1a; --primaryshadow:none; --chipbg:#1a1a1a; --chipink:#fffce8;
    --chipbd:#1a1a1a; --ok:#0b6146; --okdot:#16936a; --okbg:#dcf1df; --warn:#7d4a00; --warnbg:#fbe9c4; --warnrow:#fdf3d6; --warnline:#e5c98a;
    --bad:#a12a1c; --baddot:#c8402f; --badbg:#fae1d8; --badline:#e3a595; --chat:#6a3d9a; --chatbg:#eedffb; --sms:#9c2460; --smsbg:#fadcea;
    --livebg:#0a4f47; --livebd:#0a4f47; --liveink:#fffce8; --livesub:#d6e9df; --liveaccent:#b9f3d6; --livedot:#7be3b4; --pulse:rgba(123,227,180,.6);
    --mebg:#fffef6; --mebd:#1a1a1a; --feature:#0a4f47; --logbg:#1a1a1a; --logbd:#1a1a1a; --loghead:#fffce8; --logink:#e9e6d4; --logtime:#a9a694;
    --loginfo:#9bd8ee; --logwarn:#ffc878; --logerr:#ff9d8c; --logok:#b9f3d6; --logline:rgba(255,252,232,.3); --loglink:#9bd8ee;
    --shadow:0 1px 2px rgba(70,60,20,.05),0 20px 44px -30px rgba(70,60,20,.28); --rowhover:rgba(26,26,26,.04); --logoglow:none; --avatarbg:#cfeaf8;
    --avatarbd:#1a1a1a; --avatarink:#1a1a1a; --avatarglow:none; --display:'EB Garamond',Georgia,serif; --body:'Figtree',system-ui,sans-serif; --h1:40px;
    --h2:22px; --hw:500; --h2w:500; --num:28px; --numw:500; --rcard:26px; --rbtn:999px; --rtile:18px;
}

/* ---------------------------------------------------------------------------------------------
   The frame every page sits in: side menu, top bar, content area.
   Class names start with pf- (portal frame) so the older rules in watts.css cannot reach them.
   --------------------------------------------------------------------------------------------- */
html, body { height: auto; min-height: 100%; }
html { background: #080a18; }
html[data-theme="light"] { background: #fffce8; }
html[data-themed] body { font-family: var(--body); }
body { margin: 0; min-height: 100vh; background: var(--pagebg); background-attachment: fixed; color: var(--ink); }

.pf-side, .pf-top, .pf-signin { font-family: var(--body); font-size: 14px; line-height: 1.4; }
.pf-side, .pf-top, .pf-signin, .pf-side *, .pf-top *, .pf-signin * { box-sizing: border-box; }

.pf-side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: 248px; display: flex; flex-direction: column; gap: 18px;
           padding: 20px 14px 16px; background: var(--bar); border-right: 1px solid var(--line);
           -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow-y: auto; }
.pf-logo { display: block; padding: 4px 10px 6px; }
.pf-logo img { display: block; width: 132px; max-width: 100%; height: auto; filter: drop-shadow(var(--logoglow)); }
html[data-theme="light"] .pf-logo img { filter: none; }
.pf-nav { display: flex; flex-direction: column; gap: 2px; }
.pf-group { margin: 14px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.pf-nav .pf-group:first-child { margin-top: 0; }
.pf-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--rtile);
           border: 1px solid transparent; color: var(--ink2); font-weight: 500; text-decoration: none; }
.pf-link i { flex: none; width: 20px; font-size: 19px; text-align: center; color: var(--mute); }
.pf-link:hover { background: var(--rowhover); color: var(--ink); }
.pf-link:hover i { color: var(--ink); }
.pf-link.is-current { background: var(--soft); border-color: var(--line); color: var(--ink); font-weight: 600; }
.pf-link.is-current i { color: var(--accenttext); }
.pf-link:focus-visible, .pf-iconbtn:focus-visible, .pf-account-btn:focus-visible, .pf-menu a:focus-visible, .pf-menu button:focus-visible,
.pf-feedback:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.pf-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.pf-feedback { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 14px;
               border-radius: var(--rbtn); border: 1px solid var(--line2); background: var(--btn); color: var(--ink); font: inherit;
               font-weight: 600; cursor: pointer; }
.pf-feedback:hover { background: var(--rowhover); }
.pf-powered { padding: 0 10px; font-size: 12px; color: var(--mute); }
.pf-powered img { display: block; width: 96px; margin-top: 6px; }

.pf-main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.pf-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 24px;
          background: var(--bar); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.pf-top-spacer { flex: 1 1 0; }
.pf-iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px;
              border-radius: var(--rbtn); border: 1px solid var(--line2); background: var(--btn); color: var(--ink); font: inherit;
              font-weight: 600; font-size: 13px; cursor: pointer; }
.pf-iconbtn i { font-size: 18px; }
.pf-iconbtn:hover { background: var(--rowhover); }
.pf-burger { display: none; }

.pf-account { position: relative; }
.pf-account-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 4px; border-radius: 999px;
                  border: 1px solid var(--line2); background: var(--btn); color: var(--ink); font: inherit; cursor: pointer; }
.pf-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
             background: var(--avatarbg); border: 1px solid var(--avatarbd); color: var(--avatarink); font-weight: 700; font-size: 13px; }
.pf-account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.pf-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; display: none; flex-direction: column; gap: 2px; min-width: 240px;
           padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--rtile); box-shadow: var(--shadow); }
.pf-account.is-open .pf-menu { display: flex; }
.pf-menu-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pf-menu-who strong { display: block; color: var(--ink); overflow-wrap: anywhere; }
.pf-menu-who span { font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
.pf-menu form { margin: 0; }
.pf-menu a, .pf-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0;
                              border-radius: 10px; background: transparent; color: var(--ink2); font: inherit; font-weight: 500;
                              text-align: left; text-decoration: none; cursor: pointer; }
.pf-menu a:hover, .pf-menu button:hover { background: var(--rowhover); color: var(--ink); }
.pf-menu i { width: 20px; font-size: 18px; text-align: center; color: var(--mute); }

/* The bell: what changed in the portal (partials/navbar, App\Support\PortalNews). */
.pf-news { position: relative; }
.pf-news-btn { position: relative; width: 44px; padding: 0; border-radius: 50%; }
.pf-news-btn i { font-size: 20px; }
.pf-news-count { position: absolute; top: -5px; right: -5px; display: inline-flex; align-items: center; justify-content: center; min-width: 21px;
                 height: 21px; padding: 0 6px; border-radius: 999px; background: var(--chipbg); color: var(--chipink); border: 1px solid var(--chipbd);
                 font-size: 11.5px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pf-news-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; display: none; flex-direction: column;
                 width: min(460px, calc(100vw - 28px)); max-height: min(74vh, 680px); background: var(--card); border: 1px solid var(--line);
                 border-radius: var(--rtile); box-shadow: var(--shadow); overflow: hidden; }
.pf-news.is-open .pf-news-panel { display: flex; }
.pf-news-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.pf-news-title strong { font-size: 15px; color: var(--ink); }
.pf-news-title span { font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.pf-news-list { overflow-y: auto; overscroll-behavior: contain; }
.pf-news-item { padding: 13px 16px 12px; border-bottom: 1px solid var(--line); }
.pf-news-item:last-child { border-bottom: 0; }
.pf-news-item.is-new { background: var(--accentbg); }
.pf-news-item.is-long { cursor: pointer; }
.pf-news-item.is-long:hover { background: var(--rowhover); }
.pf-news-item.is-new.is-long:hover { background: var(--accentbg); }
.pf-news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pf-news-head strong { color: var(--ink); font-size: 14px; }
.pf-news-when { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.pf-news-pill { padding: 1px 8px; border-radius: 999px; background: var(--chipbg); color: var(--chipink); font-size: 11px; font-weight: 700; }
.pf-news-body { margin-top: 5px; max-height: 4.5em; overflow: hidden; color: var(--ink2); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.pf-news-item.is-long:not(.is-open) .pf-news-body { -webkit-mask-image: linear-gradient(#000 68%, transparent); mask-image: linear-gradient(#000 68%, transparent); }
.pf-news-item.is-open .pf-news-body { max-height: none; }
.pf-news-body p { margin: 0 0 8px; }
.pf-news-body ul, .pf-news-body ol { margin: 0 0 8px; padding-left: 20px; }
.pf-news-body li { margin: 0 0 4px; }
.pf-news-body > :last-child { margin-bottom: 0; }
.pf-news-body strong { color: var(--ink); }
.pf-news-body a { color: var(--accenttext); }
.pf-news-more { margin-top: 6px; padding: 4px 0; border: 0; background: transparent; color: var(--accenttext); font: inherit; font-size: 13px;
                font-weight: 600; cursor: pointer; }
.pf-news-more[hidden] { display: none; }
.pf-news-more:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; border-radius: 6px; }

.pf-content { flex: 1 1 auto; min-width: 0; }
.pf-content > .content-wrapper { padding: 24px; }
.pf-overlay { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }

/* "The portal is about to be updated": a message over every staff page, with a countdown and Snooze. */
.pf-update { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 90; width: min(680px, calc(100vw - 32px));
             display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px 18px; border-radius: 16px;
             background: var(--card); color: var(--ink); border: 2px solid var(--warn); box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
             font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45; }
.pf-update[hidden] { display: none; }
/* The person said ready: the message stays, quieter, so they see it was taken. */
.pf-update.is-ready { border-color: var(--line2); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); padding: 12px 18px; }
.pf-update.is-ready .pf-update-text strong { font-size: 15px; }
.pf-update-text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; }
.pf-update-text strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.pf-update-text span { color: var(--ink2); }
.pf-update-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-update-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--primarybd); background: var(--primarybg);
                 color: var(--primaryink); font: inherit; font-weight: 600; cursor: pointer; }
.pf-update-btn.is-quiet { background: transparent; color: var(--ink); border-color: var(--line2); }
.pf-update-btn[hidden] { display: none; }
.pf-update-btn:disabled { opacity: .6; cursor: default; }
.pf-update-btn:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }

@media (max-width: 960px) {
    .pf-side { transform: translateX(-100%); transition: transform .2s ease; }
    .pf-side.active { transform: none; }
    .pf-overlay.active { display: block; }
    .pf-main { margin-left: 0; }
    .pf-burger { display: inline-flex; }
    .pf-top { padding: 8px 14px; }
    .pf-content > .content-wrapper { padding: 14px; }
    .pf-account-name { display: none; }
    .pf-news { position: static; }
    .pf-news-panel { left: 14px; right: 14px; top: calc(100% + 4px); width: auto; }
}
@media (prefers-reduced-motion: reduce) { .pf-side { transition: none; } }

/* Sign-in page */
.pf-signin { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px; }
.pf-signin-logo img { display: block; width: 168px; height: auto; filter: drop-shadow(var(--logoglow)); }
html[data-theme="light"] .pf-signin-logo img { filter: none; }
.pf-signin-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; padding: 30px 28px; background: var(--card);
                  border: 1px solid var(--heroline); border-radius: var(--rcard); box-shadow: var(--heroshadow); }
.pf-signin-card h1 { margin: 0; padding: 0; font-family: var(--display); font-size: var(--h1); font-weight: var(--hw); line-height: 1.15;
                     color: var(--ink); text-align: left; }
.pf-signin-card p { margin: 0; color: var(--ink2); }
.pf-signin-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-field label { font-size: 13px; font-weight: 600; color: var(--ink2); }
.pf-field input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--rtile); border: 1px solid var(--line2);
                  background: var(--field); color: var(--fieldink); font: inherit; font-size: 15px; }
.pf-field input::placeholder { color: var(--mute); }
.pf-field input:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.pf-password { position: relative; }
.pf-password input { padding-right: 84px; }
.pf-password button { position: absolute; right: 6px; top: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px;
                      background: transparent; color: var(--accenttext); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pf-password button:hover { background: var(--rowhover); }
.pf-submit { min-height: 48px; padding: 0 18px; border-radius: var(--rbtn); border: 1px solid var(--primarybd); background: var(--primarybg);
             color: var(--primaryink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: var(--primaryshadow); }
.pf-submit[disabled] { opacity: .7; cursor: progress; }
.pf-signin-error { padding: 12px 14px; border-radius: var(--rtile); background: var(--badbg); border: 1px solid var(--badline); color: var(--bad);
                   font-weight: 600; }
.pf-signin-ok { padding: 12px 14px; border-radius: var(--rtile); background: var(--okbg); color: var(--ok); font-weight: 600; }
.pf-signin-foot { display: flex; align-items: center; gap: 12px; }
.pf-signin-foot span { font-size: 12.5px; color: var(--mute); }

/* ---------------------------------------------------------------------------------------------
   Customer Hub components (classes start with hub-). The Hub sits straight on the page.
   --------------------------------------------------------------------------------------------- */
.content-wrapper:has(> .hub) { max-width: none; }
.hub { box-sizing: border-box; color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.45; text-align: left; }
.hub *, .hub *::before, .hub *::after { box-sizing: border-box; }
.hub a { color: var(--accenttext); }
.hub a:hover { color: var(--ink); }
.hub a:focus-visible, .hub button:focus-visible, .hub input:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.hub h1, .hub h2 { margin: 0; padding: 0; color: var(--ink); font-family: var(--display); text-align: left; line-height: 1.2; }
.hub h1 { font-size: var(--h1); font-weight: var(--hw); }
.hub h2 { font-size: var(--h2); font-weight: var(--h2w); }
.hub p { margin: 0; }
/* The portal styles every table, th and td; undo that inside the Hub. */
.hub table { width: 100%; margin: 0; border-collapse: collapse; }
.hub th, .hub td { border: 0; font-family: inherit; text-align: left; }

.hub-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.hub-spacer { flex: 1 1 0; }
.hub-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; background: var(--card);
            border: 1px solid var(--line); border-radius: var(--rcard); box-shadow: var(--shadow); }
.hub-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hub-lbl { font-size: 12px; color: var(--mute); }
.hub-val { font-weight: 600; overflow-wrap: anywhere; }
.hub-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.hub-mute { color: var(--mute); }
.hub-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.hub-kv > div { min-width: 0; }
.hub-kv dt { font-size: 12px; color: var(--mute); }
.hub-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.hub-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
            background: var(--soft); color: var(--ink2); border: 1px solid var(--line); }
.hub-pill.info { background: var(--accentbg); color: var(--accenttext); border-color: transparent; }
.hub-pill.ok { background: var(--okbg); color: var(--ok); border-color: transparent; }
.hub-pill.warn { background: var(--warnbg); color: var(--warn); border-color: transparent; }
.hub-pill.bad { background: var(--badbg); color: var(--bad); border-color: var(--badline); }
/* A copy button beside a name, address or number (hub/partials/copy). */
.hub .hub-copy { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 0; margin: -4px 0 -4px 4px;
                 padding: 0; vertical-align: middle; border: 0; border-radius: 8px; background: transparent; color: var(--mute); cursor: pointer; }
.hub .hub-copy:hover, .hub .hub-copy:focus-visible { color: var(--ink); background: var(--soft); }
.hub .hub-copy .hub-copy-done { display: none; }
.hub .hub-copy.is-copied { color: var(--ok); }
.hub .hub-copy.is-copied .hub-copy-icon { display: none; }
.hub .hub-copy.is-copied .hub-copy-done { display: inline; }
.hub-btn { min-height: 44px; padding: 0 16px; border-radius: var(--rbtn); border: 1px solid var(--line2); background: var(--btn);
           color: var(--ink); font: inherit; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 8px;
           text-decoration: none; cursor: pointer; }
.hub a.hub-btn, .hub a.hub-btn:hover { color: var(--ink); }
.hub .hub-btn.primary, .hub a.hub-btn.primary { border-color: var(--primarybd); background: var(--primarybg); color: var(--primaryink);
                                                font-weight: 700; box-shadow: var(--primaryshadow); }
.hub-message { margin: 0; color: var(--ink2); }
.hub-error { padding: 12px 14px; border-radius: var(--rtile); background: var(--badbg); border: 1px solid var(--badline);
             color: var(--bad); font-weight: 600; }
.hub-table-wrap { overflow-x: auto; }
.hub-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hub-table th { text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--mute);
                border-bottom: 1px solid var(--line2); white-space: nowrap; }
.hub-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.hub-table tbody tr:last-child td { border-bottom: 0; }
.hub-table tbody tr:hover { background: var(--rowhover); }

/* Customers: the big search, the list of people recently in touch, and the bar on top of a person's page. */
.hub-title { display: flex; flex-direction: column; gap: 6px; max-width: 900px; }
.hub-find { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; max-width: 900px; }
.hub-find input { flex: 1 1 280px; min-width: 0; min-height: 52px; padding: 0 18px; border-radius: var(--rbtn); border: 1px solid var(--line2);
                  background: var(--field); color: var(--fieldink); font: inherit; font-size: 16px; }
.hub-find .hub-btn { min-height: 52px; padding: 0 22px; }
.hub-find input::placeholder, .hub-search-row input::placeholder, .hub-link-add input::placeholder { color: var(--mute); }
.hub-search-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.hub-search-row input, .hub-link-add input {
    flex: 1 1 160px; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: var(--rbtn);
    border: 1px solid var(--line2); background: var(--field); color: var(--fieldink); font: inherit; }
.hub-crumbs .hub-find-small { flex: 0 1 360px; }
.hub-results { max-width: 1280px; margin-bottom: 14px; }
.hub-contractor-box, .hub-recent { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.hub .hub-who { font-weight: 700; font-size: 14.5px; text-decoration: none; overflow-wrap: anywhere; }
.hub .hub-who:hover { text-decoration: underline; }
.hub-people td:first-child { min-width: 240px; }
.hub .hub-tab[aria-pressed] { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; gap: 8px; }
.hub .hub-tab[aria-pressed="true"] { background: var(--chipbg); color: var(--chipink); }
.hub-tab-count { font-weight: 400; opacity: .75; }
.hub-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hub-notice-ok { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--rtile); background: var(--okbg); color: var(--ok); }
.hub-notice-undo { display: flex; align-items: center; gap: 12px; }
.hub-notice-info { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--rtile); background: var(--accentbg); color: var(--accenttext);
                   display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hub-notice-info[hidden] { display: none; }
.hub-notice-info .hub-btn { min-height: 34px; padding: 0 14px; }
.hub-notice-undo .hub-btn { min-height: 34px; padding: 0 14px; }
/* A ticket from our own address (a website form): who it is really from, and "Change" under From. */
.hub-notice-sender > span { flex: 1 1 420px; }
.hub-notice-sender form { margin: 0; }
/* The status of a row in the Tickets list opens a short menu in place. */
.hub-status { display: inline-block; vertical-align: top; }
.hub-status > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.hub-status > summary::-webkit-details-marker { display: none; }
.hub-status > summary:hover, .hub-status[open] > summary { box-shadow: 0 0 0 2px var(--line2); }
.hub-status-menu { margin: 8px 0 4px; padding: 8px; width: 210px; display: flex; flex-direction: column; gap: 6px; white-space: normal;
                   border: 1px solid var(--line); border-radius: var(--rtile); background: var(--soft); }
.hub .hub-status-menu .hub-btn { min-height: 34px; padding: 0 12px; justify-content: flex-start; }
.hub-ticket-table tr:has(.hub-status[open]) > td { vertical-align: top; }
.hub-status-delete > summary { list-style: none; cursor: pointer; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--bad); }
.hub-status-delete > summary::-webkit-details-marker { display: none; }
.hub-status-delete p { margin: 2px 0 8px; padding: 0 4px; font-size: 12.5px; color: var(--ink2); }
.hub-ticket-delete { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line2); }
.hub-ticket-delete .hub-merge-what p { margin: 0 0 10px; }
.hub-urgent-form { margin-left: auto; }
.hub-urgent-form .hub-btn { min-height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.hub-sender-change { margin-top: 6px; font-size: 13px; }
.hub-sender-change > summary { display: inline-block; cursor: pointer; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.hub-sender-change > summary::-webkit-details-marker { display: none; }
.hub-sender-change > summary:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.hub-sender-change form { margin-top: 8px; padding: 12px 14px; max-width: 420px; display: flex; flex-direction: column; gap: 8px;
                          border-radius: var(--rtile); background: var(--soft); border: 1px solid var(--line); }
.hub-sender-change label { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.hub-sender-change input { width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--rtile); border: 1px solid var(--line2);
                           background: var(--field); color: var(--fieldink); font: inherit; font-size: 14px; }
.hub-sender-change input:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.hub-sender-change .hub-btn { align-self: flex-start; }

/* Merging tickets: the card "Other tickets from this person", the explanation that opens in place, and what was merged in. */
.hub-others { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.hub-other { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.hub-other-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hub-other-what > a { font-weight: 600; overflow-wrap: anywhere; }
.hub-other .hub-pill { margin-right: 4px; font-size: 11px; padding: 1px 8px; }
.hub-merge > summary { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; list-style: none; cursor: pointer; }
.hub-merge > summary::-webkit-details-marker { display: none; }
.hub-merge[open] > summary { border-color: var(--ink); }
.hub-merge-what { margin-top: 10px; padding: 12px 14px; border-radius: var(--rtile); background: var(--soft); border: 1px solid var(--line); font-size: 13.5px; }
.hub-merge-what ul { margin: 6px 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.hub-merge-find { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.hub-merge-find label { font-weight: 600; }
.hub-merge-find input { flex: 1 1 180px; min-width: 0; }
.hub-merged { margin: 14px 0 0; padding: 12px 0 0; list-style: none; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.hub-merged li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.hub-merged form { margin: 0 0 0 auto; }
.hub-block-pill { display: table; margin-top: 4px; text-decoration: none; }
/* Merging customers: the card of its own under "Who this is", and the way to it in the page's header. */
.hub-merge-card { margin-bottom: 16px; }
.hub-merge-card .hub-head { align-items: baseline; }
.hub-merge-card .hub-head .hub-lbl { flex: 1 1 320px; }
.hub-merge-search { margin-top: 12px; }
.hub-merge-search input { flex: 1 1 320px; min-width: 0; max-width: 640px; }
.hub-merge-card .hub-merge-what { max-width: 720px; }
.hub-hero-act { align-self: center; }
.hub-table form, .hub-ids form { margin: 0; }
.hub .hub-link-remove { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent;
                        color: var(--mute); font: inherit; font-size: 12.5px; cursor: pointer; }
.hub .hub-link-remove:hover { color: var(--ink); border-color: var(--ink); }
.hub-link-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

/* A person's page: "Who this is" (every account, address and number on their record) and the question before two records become one. */
.hub-who-card { margin-bottom: 16px; }
.hub-who-card .hub-head { align-items: baseline; }
.hub-who-card .hub-head .hub-lbl { flex: 1 1 320px; }
.hub-ids { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.hub-id { display: grid; grid-template-columns: 150px minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 6px 14px;
          padding: 10px 0; border-bottom: 1px solid var(--line); }
.hub-id:last-child { border-bottom: 0; }
.hub-id > .hub-pill { justify-self: start; }
.hub-id .hub-val .hub-pill { margin-left: 6px; font-size: 11px; padding: 1px 8px; }
.hub-matches .hub-id { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.hub-matches .hub-btn { min-height: 36px; padding: 0 14px; }
.hub-id-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px 28px; padding-top: 16px; border-top: 1px solid var(--line2); }
/* Someone with no app account: "Do they use the Watts app?" is the first question, adding an address the second. */
.hub-id-second { order: 2; }
.hub-id-second ~ form.hub-id-form { order: 3; }
.hub-id-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.hub .hub-id-form h3 { margin: 0; padding: 0; color: var(--ink); text-align: left; font-family: var(--display); font-size: 15px; font-weight: var(--h2w); }
.hub-ask { margin-bottom: 16px; border-color: var(--primarybd); }
.hub-ask-list { margin: 0; padding-left: 20px; }
.hub-ask-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hub-ask-actions form { margin: 0; }
.hub-account-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 4px 4px 0; }
.hub-hero-text .hub-pill { margin-left: 6px; }
@media (max-width: 820px) {
    .hub-id, .hub-matches .hub-id { grid-template-columns: minmax(0, 1fr); }
    .hub-id-forms { grid-template-columns: minmax(0, 1fr); }
}

/* Tickets: the queue */
.hub-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 4px; width: fit-content; max-width: 100%; background: var(--soft);
            border: 1px solid var(--line); border-radius: 999px; }
.hub .hub-tab { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--ink2);
                font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.hub .hub-tab:hover { color: var(--ink); background: var(--rowhover); }
.hub .hub-tab.is-current { background: var(--chipbg); color: var(--chipink); }
.hub-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 16px; }
.hub-filter { display: flex; flex-direction: column; gap: 6px; flex: 0 1 220px; min-width: 0; }
.hub-filter:first-of-type { flex: 1 1 320px; }
.hub-filter label { font-size: 12px; color: var(--mute); }
.hub-filter input, .hub-filter select { width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--rbtn); border: 1px solid var(--line2);
                                        background: var(--field); color: var(--fieldink); font: inherit; }
.hub-filter input::placeholder { color: var(--mute); }
.hub-filter input:focus-visible, .hub-filter select:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.hub-ticket-table td { vertical-align: middle; }
.hub-ticket-cell { min-width: 240px; }
.hub .hub-ticket-link { display: block; color: var(--ink); font-weight: 600; text-decoration: none; }
.hub .hub-ticket-link:hover { color: var(--accenttext); text-decoration: underline; }
.hub-ticket-number { display: block; font-size: 12px; color: var(--mute); }
.hub-block { display: block; }
.hub-nowrap { white-space: nowrap; }
.hub-table th.hub-num, .hub-table td.hub-num { text-align: right; white-space: nowrap; }

/* Tickets: one ticket */
.hub-ticket-head { margin-bottom: 16px; background: var(--hero); border-color: var(--heroline); box-shadow: var(--heroshadow); }
.hub-ticket-facts { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.hub-ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.hub-conversation, .hub-ticket-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hub-part.is-in { border-left: 3px solid var(--editline); }
.hub-part.is-internal { background: var(--warnrow); border-color: var(--warnline); }
.hub-part-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hub-part-body > .hub-btn { align-self: flex-start; }
.hub .hub-part-forward { min-height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
/* Messages are emails from outside: always on plain paper, whatever the theme. */
.hub-mail { display: block; width: 100%; height: 64px; border: 1px solid var(--line); border-radius: var(--rtile); background: #fbfaf4; }
.hub-note-text { white-space: normal; overflow-wrap: anywhere; color: var(--ink); }
.hub-files { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.hub .hub-file { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 10px 6px 6px; border-radius: var(--rtile);
                 border: 1px solid var(--line); background: var(--soft); color: var(--ink); text-decoration: none; min-width: 0; }
.hub .hub-file:hover { border-color: var(--line2); background: var(--rowhover); color: var(--ink); }
.hub-file-thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--field); }
.hub-file-kind { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: .04em;
                 color: var(--accenttext); background: var(--accentbg); }
.hub-file-text { display: flex; flex-direction: column; min-width: 0; }
.hub-file-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-events { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.hub-events li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line2); }
.hub-preview { width: min(1100px, 94vw); height: min(860px, 92vh); padding: 0; border: 1px solid var(--line2); border-radius: var(--rcard);
               background: var(--card); color: var(--ink); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .7); overflow: hidden; }
.hub-preview[open] { display: flex; flex-direction: column; }
.hub-preview::backdrop { background: rgba(4, 6, 16, .78); }
.hub-preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.hub-preview-bar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hub-preview-body { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--field); }
.hub-preview-body img, .hub-preview-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.hub-preview-body iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.hub-preview-body audio { width: min(560px, 100%); }
@media (min-width: 1300px) {
    .hub-ticket-layout { grid-template-columns: minmax(0, 1fr) 380px; }
    .hub-ticket-side { position: sticky; top: 76px; }
    .hub-ticket-side .hub-files { grid-template-columns: minmax(0, 1fr); }
}

/* Tickets: the actions card */
.hub-gap { margin-bottom: 16px; }
.hub-action-tabs { margin: 0; width: 100%; border-radius: var(--rtile); }
/* Six actions: two rows of three, so each name has room in the narrow side column. */
.hub-action-tabs { flex-wrap: wrap; gap: 2px; }
.hub .hub-action-tabs .hub-tab { flex: 1 1 30%; justify-content: center; min-width: 0; min-height: 40px; padding: 0 6px; border: 0; background: transparent; font-size: 12.5px;
                                 font-family: inherit; cursor: pointer; border-radius: calc(var(--rtile) - 4px); }
.hub .hub-action-tabs .hub-tab.is-current { background: var(--chipbg); color: var(--chipink); }
.hub-action-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.hub-action-form[hidden], #hub-action-follow-up[hidden] { display: none; }
#hub-action-follow-up { display: flex; flex-direction: column; gap: 12px; }
.hub-action-form label { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.hub-action-form textarea, .hub-action-form select, .hub-action-form input[type="date"], .hub-action-form input[type="time"], .hub-action-form input[type="text"], .hub-action-form input[type="email"] {
    width: 100%; padding: 10px 14px; border-radius: var(--rtile); border: 1px solid var(--line2); background: var(--field); color: var(--fieldink);
    font: inherit; font-size: 14px; }
.hub-action-form select, .hub-action-form input[type="date"], .hub-action-form input[type="time"], .hub-action-form input[type="text"], .hub-action-form input[type="email"] { min-height: 44px; padding: 0 14px; }
.hub-action-form textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.hub-action-form textarea:focus-visible, .hub-action-form select:focus-visible, .hub-action-form input:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.hub-action-form .hub-btn { align-self: flex-start; }
.hub-action-form .hub-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hub-action-form .hub-check input { width: 18px; height: 18px; accent-color: var(--editline); }
.hub-action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub-action-row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
html[data-theme="light"] .hub-action-form input[type="date"], html[data-theme="light"] .hub-action-form input[type="time"] { color-scheme: light; }
html[data-theme="dark"] .hub-action-form input[type="date"], html[data-theme="dark"] .hub-action-form input[type="time"] { color-scheme: dark; }

/* QR codes */
.hub-qr-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.hub-qr { flex-direction: row; align-items: flex-start; gap: 16px; }
.hub-qr-image { flex: none; width: 132px; height: 132px; padding: 8px; border-radius: var(--rtile); background: #fff; border: 1px solid var(--line); }
.hub-qr-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 auto; }
.hub .hub-qr-destination { overflow-wrap: anywhere; font-size: 13px; }
.hub-form-card { max-width: 640px; }

/* Saved replies: the picker on a reply form (hub/partials/saved-replies-pick) and the pages that keep them. */
.hub-saved-pick > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; list-style: none; cursor: pointer; font-size: 13px; }
.hub-saved-pick > summary::-webkit-details-marker { display: none; }
.hub-saved-pick[open] > summary { border-color: var(--ink); }
.hub-saved-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px; border-radius: var(--rtile); background: var(--soft); border: 1px solid var(--line); }
.hub-saved-find { width: 100%; min-height: 40px; padding: 0 14px; border-radius: var(--rtile); border: 1px solid var(--line2); background: var(--field);
                  color: var(--fieldink); font: inherit; font-size: 14px; }
.hub-saved-find::placeholder { color: var(--mute); }
.hub-saved-find:focus-visible { outline: 2px solid var(--accenttext); outline-offset: 1px; }
.hub-saved-list { margin: 0; padding: 0; list-style: none; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; }
.hub-saved-list button { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
                         background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.hub-saved-list button:hover, .hub-saved-list button:focus-visible { background: var(--rowhover); outline: 1px solid var(--line2); }
.hub-saved-list strong { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.hub-saved-list em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accentbg); color: var(--accenttext); white-space: nowrap; align-self: start; }
.hub-saved-list span { grid-column: 1 / -1; font-size: 12.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-saved-note[hidden] { display: none; }
.hub-saved-note { margin: 0; }
.hub-saved-manage { color: var(--accenttext); }
.hub-saved-search { align-items: center; margin: 14px 0 6px; }
.hub-saved-search input { flex: 1 1 280px; max-width: 460px; }
.hub-saved-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.hub-saved-name:hover { text-decoration: underline; }
.hub-saved-table tr[hidden] { display: none; }
.hub-saved-card { max-width: 820px; }
.hub-saved-for { margin: 4px 0 6px; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; }
.hub-saved-for legend { padding: 0; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.hub-saved-remove { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.hub-action-form input[type="text"], .hub-action-form input[type="url"], .hub-action-form input[type="password"] {
    width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--rtile); border: 1px solid var(--line2); background: var(--field);
    color: var(--fieldink); font: inherit; font-size: 14px; }
.hub-action-form input::placeholder { color: var(--mute); }
@media (max-width: 560px) { .hub-qr { flex-direction: column; } .hub-qr-grid { grid-template-columns: minmax(0, 1fr); } }

/* Home page of customers and contractors */
.hub-controllers { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.hub-controller-image { flex: none; width: 96px; height: auto; }
.hub-controller-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-controller-name .hub-mono { font-size: 12px; overflow-wrap: anywhere; }
/* The hidden attribute wins over any display rule above. */
.hub [hidden] { display: none !important; }
.hub-action-form input[type="email"] { width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--rtile); border: 1px solid var(--line2);
                                       background: var(--field); color: var(--fieldink); font: inherit; font-size: 14px; }

/* Reports */
.hub-reports-page [data-hub-load] { display: flex; flex-direction: column; gap: 16px; }
.hub-stats { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.hub-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-width: 0; }
.hub-stat-number { font-family: var(--display); font-size: calc(var(--num) + 8px); font-weight: var(--numw); line-height: 1.1; color: var(--ink);
                   font-variant-numeric: tabular-nums; }
.hub-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }

/* Feedback: the page for staff, and the "Send feedback" window on every page */
.hub-feedback-text { min-width: 280px; }
#feedbackModal .modal-container { background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: var(--rcard);
                                  box-shadow: var(--shadow); font-family: var(--body); }
#feedbackModal .modal-header { border-bottom: 1px solid var(--line); }
#feedbackModal .modal-header h3 { margin: 0; color: var(--ink); font-family: var(--display); font-size: var(--h2); font-weight: var(--h2w); }
#feedbackModal .modal-close { color: var(--mute); background: transparent; border: 0; cursor: pointer; }
#feedbackModal .feedback-form form { display: flex; flex-direction: column; gap: 10px; }
#feedbackModal .feedback-form label { color: var(--ink2); font-size: 13px; font-weight: 600; }
#feedbackModal .feedback-form textarea { width: 100%; min-height: 120px; padding: 10px 14px; border-radius: var(--rtile); border: 1px solid var(--line2);
                                         background: var(--field); color: var(--fieldink); font: inherit; font-size: 14px; resize: vertical; }
#feedbackModal .submit-feedback-button { align-self: flex-start; min-height: 44px; padding: 0 18px; border-radius: var(--rbtn); border: 1px solid var(--primarybd);
                                         background: var(--primarybg); color: var(--primaryink); font: inherit; font-weight: 700; cursor: pointer; }

/* The public front page */
.pf-front { min-height: 100vh; max-width: 980px; margin: 0 auto; padding: 56px 20px 28px; display: flex; flex-direction: column; gap: 28px;
            font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--ink); }
.pf-front * { box-sizing: border-box; }
.pf-front-hero { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 24px; text-align: center; background: var(--hero);
                 border: 1px solid var(--heroline); border-radius: var(--rcard); box-shadow: var(--heroshadow); }
.pf-front-logo { width: 180px; height: auto; filter: drop-shadow(var(--logoglow)); }
html[data-theme="light"] .pf-front-logo { filter: none; }
.pf-front h1 { margin: 0; padding: 0; font-family: var(--display); font-size: calc(var(--h1) + 12px); font-weight: var(--hw); line-height: 1.1; color: var(--ink);
               text-align: center; }
.pf-front h2 { margin: 0; padding: 0; font-family: var(--display); font-size: var(--h2); font-weight: var(--h2w); color: var(--ink); text-align: left; }
.pf-front p { margin: 0; color: var(--ink2); }
.pf-front-hero p { max-width: 520px; }
.pf-front a { color: var(--accenttext); }
a.pf-front-signin { display: inline-flex; align-items: center; justify-content: center; min-width: 180px; color: var(--primaryink); text-decoration: none; }
.pf-front-points { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pf-front-points li { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--card); border: 1px solid var(--line);
                      border-radius: var(--rcard); box-shadow: var(--shadow); }
.pf-front-points i { font-size: 26px; color: var(--accenttext); }
.pf-front-access { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--rcard); background: var(--soft); }
.pf-front-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--mute); }

/* A controller's check-in log (customer page, log pages) */
/* The log keeps its own dark panel in both themes, as in the mockup. */
.hub-log { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--rtile);
           background: var(--logbg); border: 1px solid var(--logbd); color: var(--logink); }
.hub .hub-log h3 { margin: 0; color: var(--loghead); font-family: var(--display); font-size: 14px; font-weight: var(--h2w); }
.hub-log .hub-lbl { color: var(--logtime); }
.hub .hub-log a { color: var(--loglink); }
.hub .hub-log a:hover { color: var(--loghead); }
.hub-log-empty { color: var(--logink); }
.hub-log-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px;
                 font-variant-numeric: tabular-nums; }
.hub-log-table th { text-align: left; padding: 6px 10px 6px 0; font-weight: 500; color: var(--logtime); border-bottom: 1px solid var(--logline); white-space: nowrap; }
.hub-log-table td { text-align: left; padding: 6px 10px 6px 0; vertical-align: top; white-space: nowrap; color: var(--logink); }
.hub-log-time { color: var(--logtime); }
.hub-log-info { margin-left: 6px; color: var(--loginfo); }
.hub-log-warn { margin-left: 6px; color: var(--logwarn); font-weight: 500; }
.hub-log-scroll { max-height: 640px; overflow-y: auto; }
.hub-log-card { margin-bottom: 16px; }
.hub-log-stats .hub-stat { padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--rtile); box-shadow: none; }
.hub-log-stats .hub-stat-number { font-size: var(--num); }

/* Profile */
.hub-profile-who { display: flex; align-items: center; gap: 14px; }
.hub-profile-avatar { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--chipbg); color: var(--chipink);
                      font-family: var(--display); font-size: 20px; font-weight: 700; }
.hub-profile-who h2 { margin: 0; }

/* User management */
.hub .hub-btn.danger { border-color: var(--badline); background: var(--badbg); color: var(--bad); }
.hub .hub-btn[disabled] { opacity: .55; cursor: not-allowed; }
.hub-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.hub-user-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.hub-user-head h1 { margin: 0; overflow-wrap: anywhere; }

/* Activity log */
.hub-activity-what { min-width: 320px; overflow-wrap: anywhere; }

/* Reply: files and signature */
.hub-files-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hub-files-pick .hub-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hub-files-pick input:focus-visible + .hub-btn { outline: 2px solid var(--accenttext); outline-offset: 2px; }
.hub-files-chosen { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hub-files-chosen:empty { display: none; }
.hub-files-chosen li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: var(--rtile); background: var(--btn); }
.hub-files-chosen li span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; }
.hub-files-chosen img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line2); }
.hub-files-chosen .hub-btn { min-height: 36px; padding: 0 12px; }
.hub-files-pick .hub-error { flex-basis: 100%; margin: 0; }
.hub-action-form.is-dropping textarea { outline: 2px dashed var(--accenttext); outline-offset: 2px; }
.hub-signature summary { cursor: pointer; font-size: 12.5px; color: var(--ink2); }
.hub-signature pre { margin: 8px 0 0; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px;
    border-radius: var(--rtile); background: var(--btn); border: 1px solid var(--line); color: var(--ink2); }

/* Preset requests */
.hub-swatches { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.hub-swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line2); }
.hub-preset-look .hub-swatch { width: 30px; height: 30px; border-radius: 8px; }
.hub-preset-name { font-weight: 600; min-width: 160px; }
.hub-preset-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.hub .hub-preset-intro { margin: 0 0 14px; }
.hub-preset-reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.hub-preset-review h2 { margin: 0; overflow-wrap: anywhere; }
.hub-preset-review .hub-user-head { margin: 0; }
.hub-preset-concern { margin: 0; padding: 8px 12px; border-radius: var(--rtile); background: var(--warnbg); color: var(--warn); font-size: 13px; }
.hub-preset-raw summary { cursor: pointer; font-size: 12.5px; color: var(--ink2); }
.hub-preset-raw pre { margin: 8px 0 0; padding: 10px 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
    font-size: 12px; border-radius: var(--rtile); background: var(--btn); border: 1px solid var(--line); color: var(--ink2); }
.hub-preset-decline { padding-top: 12px; border-top: 1px solid var(--line); }

/* Firmware source: the switch in the account menu and the line on the Firmware update page */
.pf-menu-hint { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--mute); }
.firmware-source { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,183,77,.36); background: rgba(255,183,77,.14); color: #ffcf8a; font-size: 14px; }
.firmware-source-live { border-color: rgba(255,107,107,.5); background: rgba(255,107,107,.14); color: #ffb3b3; }
