/* The supplier and customer portals (/portal). Built on base.css: the same tokens, type and controls as the app, with a
   calmer layout for people outside the business: one header, the company tree on the left, the sites on the right. */
.hub { min-height: 100vh; }
.hbar { background: var(--rail); color: #fff; }
.hbar .in { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hbar img { height: 30px; width: auto; border-radius: 4px; background: #fff; padding: 2px 4px; }
.hbar .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hbar .who b { font-size: 15px; font-weight: 600; }
.hbar .who span { font-size: 12.5px; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .sp { flex: 1; }
.hbar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); }
.hbar .btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.htabs { display: flex; gap: 2px; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.htabs button { background: none; border: 0; color: rgba(255, 255, 255, .72); font: inherit; font-weight: 500; padding: 10px 14px 11px; border-bottom: 3px solid transparent; cursor: pointer; }
.htabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--accent); }
.htabs button:hover { color: #fff; }
.htabs .n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.hmain { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
.hfoot { max-width: 1180px; margin: 0 auto; padding: 0 16px 28px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }

/* sites and services: the tree beside the selected company */
.hsplit { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.htree { position: sticky; top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px; max-height: calc(100vh - 24px); overflow: auto; }
.htree input[type=search] { width: 100%; margin-bottom: 8px; }
.htree ul { list-style: none; margin: 0; padding: 0; }
.htree ul ul { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.htree button { width: 100%; display: flex; gap: 8px; align-items: baseline; text-align: left; background: none; border: 0; border-radius: 6px; padding: 6px 8px; font: inherit; color: var(--ink); cursor: pointer; }
.htree button:hover { background: var(--bg2); }
.htree button[aria-current="true"] { background: var(--accentbg); color: var(--accent); font-weight: 600; }
.htree .k { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.htree .c { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.htree .f { color: var(--bad); font-weight: 600; font-size: 12px; }
.hphone { display: none; }

.hco h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.hco .path { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.hco .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.hsite { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); margin: 14px 0; overflow: hidden; }
.hsite > header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hsite > header h2 { font-size: 16px; margin: 0; }
.hsite > header .addr { font-size: 12.5px; color: var(--muted); }
.hsite > header .btn { margin-left: auto; }
.hitem { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.hitem:first-of-type { border-top: 0; }
.hitem .nm { font-weight: 500; }
.hitem .cct { font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.hitem .cct b { color: var(--ink); font-weight: 600; }
.hitem .act { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.hempty { padding: 14px 16px; color: var(--muted); font-size: 13px; }
.hterm { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.hterm .bar { height: 6px; border-radius: 3px; background: var(--bg2); overflow: hidden; }
.hterm .bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.hterm .bar i.late { background: var(--warn); }
.hfault { color: var(--bad); font-weight: 600; font-size: 12.5px; }

/* the fault form */
dialog.hdlg { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: var(--card); color: var(--ink); box-shadow: 0 24px 60px rgba(10, 14, 20, .3); }
dialog.hdlg::backdrop { background: rgba(14, 19, 27, .5); }
.hdlg form, .hdlg .body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.hdlg h2 { margin: 0; font-size: 19px; }
.hdlg .where { background: var(--bg2); border-radius: var(--radius); padding: 10px 12px; font-size: 13.5px; }
.hdlg fieldset { border: 0; margin: 0; padding: 0; }
.hdlg legend { font-weight: 600; margin-bottom: 6px; font-size: 13.5px; }
.hchips { display: flex; flex-wrap: wrap; gap: 6px; }
.hchips label { border: 1px solid var(--line2); border-radius: 18px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.hchips label:has(input:checked) { border-color: var(--accent); background: var(--accentbg); color: var(--accent); font-weight: 600; }
.hchips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hchips label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.hlist { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow: auto; }
.hlist label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }
.hlist label:has(input:checked) { border-color: var(--accent); background: var(--accentbg); }
.hlist input { margin-top: 3px; flex: none; }
.hlist small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.hpri .p1:has(input:checked) { border-color: var(--bad); background: var(--badbg); color: var(--bad); }
.hrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hdlg .btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.hdone { text-align: left; } .hdone .num { font-size: 26px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* faults and uploads lists */
.hcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; margin: 0 0 16px; }
.hcard h2 { font-size: 16px; margin: 0 0 10px; }
.hkinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.hkinds label { border: 1px solid var(--line2); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.hkinds label:has(input:checked) { border-color: var(--accent); background: var(--accentbg); }
.hkinds input { margin-top: 3px; }
.hkinds small { display: block; color: var(--muted); font-size: 12px; }
.hdrop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 2px dashed var(--line2); border-radius: var(--radius-lg); cursor: pointer; text-align: center; }
.hdrop.over, .hdrop:hover { border-color: var(--accent); background: var(--accentbg); }
.hdrop.got { border-style: solid; border-color: var(--ok); background: var(--okbg); }
.hst { font-size: 13px; min-height: 18px; }

@media (max-width: 820px) {
  .hsplit { grid-template-columns: 1fr; }
  .htree { display: none; }
  .hphone { display: block; margin-bottom: 12px; } .hphone select { width: 100%; }
  .hitem { grid-template-columns: 1fr; } .hitem .act { grid-row: auto; grid-column: 1; justify-content: flex-start; }
  .hrow { grid-template-columns: 1fr; }
  .hsite > header .btn { margin-left: 0; }
  .hbar .who span { max-width: 60vw; }
}
@media (prefers-reduced-motion: no-preference) { dialog.hdlg[open] { animation: hpop .16s ease-out; } @keyframes hpop { from { transform: translateY(8px); opacity: 0; } } }

/* 1.16.0: two-step sign-in, the warning before the deadline, and the new tabs */
.hwarn { background: var(--warnbg, #fff4e0); color: var(--ink); border-bottom: 1px solid var(--line); }
.hwarn .in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13.5px; }
.hok { background: var(--okbg); border: 1px solid var(--ok); color: var(--ink); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.hsteps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
.hqr { align-self: center; background: #fff; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); line-height: 0; }
.hqr svg { width: 200px; height: 200px; }
.hkey { display: block; margin-top: 6px; font-size: 15px; letter-spacing: .06em; user-select: all; }
.hthread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.hthread li { background: var(--bg2); border-radius: var(--radius); padding: 8px 12px; margin-right: 32px; }
.hthread li.me { background: var(--accentbg); margin: 0 0 0 32px; }
.hthread li.st { background: none; padding: 2px 12px; font-size: 12.5px; color: var(--muted); }
.hthread .by { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.hthread .tx { white-space: pre-line; overflow-wrap: anywhere; font-size: 13.5px; }
.hfiles { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 13.5px; }
.hstats { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.hstat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.hstat span { font-size: 12.5px; color: var(--muted); } .hstat b { font-size: 18px; font-variant-numeric: tabular-nums; } .hstat small { font-size: 12px; color: var(--muted); } .hstat small.bad { color: var(--bad); font-weight: 600; }
.hstat.big b { font-size: 26px; letter-spacing: -.01em; }
.hinline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .hinline .f { margin: 0; }
.hrow3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hrow2 { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; } .hrow2 input { flex: 1 1 200px; }
.hhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .hhead h2 { margin: 0; }
.horder, .hfaultc { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.horder:first-of-type, .hfaultc:first-of-type { border-top: 0; }
.horder .hd, .hfaultc .hd { display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; }
.horder .btnrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.t td.act { text-align: right; white-space: nowrap; } .t td.act .btn + .btn { margin-left: 6px; }
@media (max-width: 820px) { .hstats { grid-template-columns: 1fr 1fr; } .hstat.big { grid-column: 1 / -1; } .hrow3 { grid-template-columns: 1fr; } .t td.act { white-space: normal; } }
.t th.n, .t td.n { text-align: right; font-variant-numeric: tabular-nums; }
.htabs { overflow-x: auto; scrollbar-width: none; } .htabs::-webkit-scrollbar { display: none; }
.htabs button { white-space: nowrap; flex: none; }
.hmain { min-width: 0; } .tw { overflow-x: auto; }
/* staff viewing as the client (1.19.1): a banner, and nothing that changes anything */
.hview { background: #fff4d6; color: #5a4300; border-bottom: 1px solid #f0d58a; font-size: 13px; }
.hview .in { padding: 8px 16px; max-width: 1180px; margin: 0 auto; }
body.viewonly .hmain .act a[href^="/p/"] { display: none !important; }
.hview .hswitch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 0; }
.hview .hswitch label { display: flex; gap: 6px; align-items: center; } .hview .hswitch input { min-width: 220px; padding: 4px 8px; }

/* a service opens on its own (1.19.4) */
.hitem .hopen { all: unset; cursor: pointer; font-weight: 500; color: var(--ink); text-align: left; }
.hitem .hopen:hover { text-decoration: underline; } .hitem .hopen:focus-visible { outline: 2px solid var(--accent, #3b5bdb); outline-offset: 2px; border-radius: 3px; }
.hdl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; } .hdl dt { color: var(--muted); } .hdl dd { margin: 0; }

.hproof { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; }
.hproof p { margin: 0 0 8px; }
/* Your team > Can see: the Main Contact's choices for one user */
.hacc { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hacc legend { font-weight: 600; padding: 0 4px; }
.hacctree { list-style: none; margin: 4px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.hacctree ul { list-style: none; margin: 2px 0 4px; padding-left: 20px; border-left: 1px solid var(--line); }
.hacctree li { margin: 3px 0; }
