/* HiveLogic UI system: the one shared set of controls.

   Buttons, icon buttons, chips, menus and menu items, text links, toasts.
   Same height, radius, type and focus ring everywhere. Colours and type sizes
   come from the tokens in index.html (--ink, --line, --card, --canvas, --rail,
   --gold*, --slate, --mut) and the two button fills the app already used
   (#2f5d8a primary, #b5453a destructive). Nothing here introduces a new colour
   or a new font size: 12.5px is a control, 11px is a compact control or chip.

   Two ways to use it:
     1. New markup: .hl-btn + one of .hl-btn-primary / -quiet / -danger,
        .hl-btn-icon, .hl-btn-sm, .hl-chip, .hl-menu / .hl-menu-item, .hl-link.
     2. Existing markup: the legacy classes below (.btn, .btn-ghost, .btn-save,
        .gbtn, .iconbtn, .chip2, .lnk ...) are mapped onto the same rules, so the
        whole app moves together without touching every screen.

   Every selector is prefixed "html body" so it outranks the screen-level
   stylesheets that fetched views inject later with a bare class name.
   Loaded last in index.html. */

:root {
  --hl-h: 36px;               /* control height */
  --hl-h-sm: 30px;            /* compact control and chip height */
  --hl-r: 9px;                /* control radius */
  --hl-r-lg: 14px;            /* surface radius: menus, popups */
  --hl-primary: #2f5d8a;      /* white text 6.9:1 */
  --hl-primary-hover: #264d73;
  --hl-danger: #b5453a;       /* white text 5.3:1 */
  --hl-danger-hover: #9a3a30;
  --hl-lift: 0 1px 2px rgba(22, 30, 46, .14);
  --hl-pop: 0 14px 36px rgba(22, 30, 46, .22);
  /* The page type scale. Screens that carry their own stylesheet (Company Setup,
     Bookkeeping) take sizes from here instead of inventing one per label. */
  --hl-fs-page: 26px;         /* page title */
  --hl-fs-lede: 14px;         /* the sentence under a title */
  --hl-fs-body: 13px;         /* running text and values */
  --hl-fs-label: 12px;        /* section and field labels */
  --hl-fs-micro: 11px;        /* chips, hints, column heads */
}
/* Phones and touch tablets (768, 1024): every control is a 44px tap. The two height tokens drive buttons, chips, inputs, selects and the top bar chips,
   so one rule here does it for every screen that uses them. */
@media (max-width: 600px), (pointer: coarse) and (max-width: 1100px) {
  :root { --hl-h: 44px; --hl-h-sm: 44px; }
}
/* Phones: the controls that carry their own height (found by the 390 audit, docs/ua/mobile-audit.md) get the same 44px tap. */
@media (max-width: 600px), (pointer: coarse) and (max-width: 1100px) {
  html body :is(.eb-link, .pg-retry, #cc-map-leg-btn, .rs-chip, .ml-btn, .bb-btn, .gr-btn, .co-btn, .jp-btn, .ef-sl-chip, .eqtab, .ef-ghost, .ef-green,
    .ef-sl-q, .cdb-sel, #cdb-q, #jwb-q, .ep-btn-sm, .back, .lg-btn, .tpl-btn, .eis-fill, .hlset-tab, .vtab, .dv-btn, .cb-btn, .lnk2, .ef-tlink, .ld-btn, .ce-btn, .mt-btn, .eis-lbtn, .ep-btn) {
    min-height: 44px !important; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  }
  html body :is(#view-reports, #view-estimates, #view-clients, #view-developer) :is(button, select, input:not([type=checkbox]):not([type=radio])) { min-height: 44px; }
  html body #snapshot h3 a[onclick] { min-height: 44px; display: inline-flex; align-items: center; }
  html body #snapshot span[onclick] { min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; }
  html body :is(.toggle > span, .vi-x, .hlm-x, .hl-qhelp) { min-height: 44px; min-width: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
  html body .jp-sort, html body #jp-sort { min-height: 44px; }
  /* Checkboxes on touch screens: the box a thumb lands on is 44px, the drawn box stays about 22px (appearance off, the square is drawn inside). */
  html body :is(#ef-page, #view-estimates, #view-clients) input[type=checkbox] {
    -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 44px; height: 44px; margin: 0; background: transparent; border: 0; cursor: pointer;
  }
  html body :is(#ef-page, #view-estimates, #view-clients) input[type=checkbox]::before {
    content: ""; position: absolute; inset: 11px; border: 2px solid var(--mut, #5f6578); border-radius: 5px; background: var(--card, #fff); box-sizing: border-box;
  }
  html body :is(#ef-page, #view-estimates, #view-clients) input[type=checkbox]:checked::before { background: var(--hl-primary, #2f4a6d); border-color: var(--hl-primary, #2f4a6d); }
  html body :is(#ef-page, #view-estimates, #view-clients) input[type=checkbox]:checked::after {
    content: ""; position: absolute; left: 16px; top: 12px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
  }
  html body :is(#ef-page, #view-estimates, #view-clients) input[type=checkbox]:focus-visible { outline: 3px solid var(--hl-primary, #2f4a6d); outline-offset: -4px; border-radius: 8px; }
  html body :is(#ef-page, #view-estimates, #view-clients) input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
  html body #ef-page .ef-int-badge { min-height: 44px; }
  html body :is(.chip2) { min-width: 44px; }
  html body :is(.rs-chip, .pg-retry, [data-jp-status]) { min-width: 44px; }
  html body :is(.ask-enter, #cc-health-state, #cc-greet-weather, .ep-note-add) { min-height: 44px !important; min-width: 44px !important; box-sizing: border-box; display: inline-flex; align-items: center; }
}
body.hl-dark {
  --hl-primary: #3b5b8c;      /* white text 6.5:1 */
  --hl-primary-hover: #456aa1;
  --hl-lift: 0 1px 2px rgba(0, 0, 0, .45);
  --hl-pop: 0 14px 36px rgba(0, 0, 0, .55);
}

/* ---- Buttons: base (secondary) ---------------------------------------- */
html body .hl-btn,
html body .btn,
html body .btn-ghost,
html body .btn-save,
html body .btn-primary,
html body .btn-danger,
html body .gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-sizing: border-box; min-height: var(--hl-h); padding: 0 16px; margin: 0;
  border: 1px solid var(--line); border-radius: var(--hl-r);
  background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 12.5px; font-weight: 800; line-height: 1.2; letter-spacing: 0;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  box-shadow: var(--hl-lift);
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
html body .btn { margin-right: 6px; }
html body .hl-btn:hover,
html body .btn:hover,
html body .btn-ghost:hover,
html body .gbtn:hover { background: var(--canvas); border-color: var(--gold); }
html body .hl-btn:active,
html body .btn:active,
html body .btn-ghost:active,
html body .btn-save:active,
html body .btn-primary:active,
html body .btn-danger:active,
html body .gbtn:active { transform: translateY(1px); box-shadow: none; }
html body .hl-btn:disabled, html body .hl-btn[aria-disabled="true"],
html body .btn:disabled, html body .btn-ghost:disabled, html body .btn-save:disabled,
html body .btn-primary:disabled, html body .btn-danger:disabled, html body .gbtn:disabled {
  opacity: .5; cursor: not-allowed; box-shadow: none; transform: none;
}

/* Compact: dense toolbars and table rows */
html body .hl-btn-sm,
html body .btn-sm,
html body .gbtn {
  min-height: var(--hl-h-sm); padding: 0 12px; font-size: 11px; gap: 6px;
}
html body .gbtn { margin-left: 6px; }

/* ---- File inputs: the real <input type=file> stays (keyboard, screen reader,
   camera capture); only its button wears the shared button style. ---------- */
html body input[type="file"] { font-family: var(--sans); font-size: 12.5px; color: var(--mut); }
html body input[type="file"]::file-selector-button {
  box-sizing: border-box; min-height: var(--hl-h); padding: 0 16px; margin: 0 12px 0 0;
  border: 1px solid var(--line); border-radius: var(--hl-r);
  background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 12.5px; font-weight: 800; line-height: 1.2;
  box-shadow: var(--hl-lift); cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
html body input[type="file"]:hover::file-selector-button { background: var(--canvas); border-color: var(--gold); }
html body input[type="file"]:disabled::file-selector-button { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---- Primary ----------------------------------------------------------- */
html body .hl-btn-primary,
html body .btn.primary,
html body .btn-save,
html body .btn-primary,
html body .gbtn.go {
  background: var(--hl-primary); border-color: var(--hl-primary); color: #fff;
}
html body .hl-btn-primary:hover,
html body .btn.primary:hover,
html body .btn-save:hover,
html body .btn-primary:hover,
html body .gbtn.go:hover { background: var(--hl-primary-hover); border-color: var(--hl-primary-hover); color: #fff; }
html body .btn.primary span { color: inherit; }

/* ---- Destructive: outlined by default, .solid for the confirm step ------- */
html body .hl-btn-danger,
html body .btn-danger,
html body .gbtn.aiu-danger {
  background: var(--card); border-color: var(--hl-danger); color: var(--red);
}
html body .hl-btn-danger:hover,
html body .btn-danger:hover,
html body .gbtn.aiu-danger:hover { background: var(--red-bg); border-color: var(--hl-danger); color: var(--red); }
html body .hl-btn-danger.solid,
html body .btn-danger.solid,
html body .btn-danger.confirm,
html body .btn-save.danger {
  background: var(--hl-danger); border-color: var(--hl-danger); color: #fff;
}
html body .hl-btn-danger.solid:hover,
html body .btn-danger.solid:hover,
html body .btn-danger.confirm:hover,
html body .btn-save.danger:hover { background: var(--hl-danger-hover); border-color: var(--hl-danger-hover); color: #fff; }
body.hl-dark .hl-btn-danger, body.hl-dark .btn-danger { border-color: var(--red); }

/* ---- Quiet: no frame until hovered ------------------------------------- */
html body .hl-btn-quiet,
html body .btn-link {
  background: transparent; border-color: transparent; box-shadow: none; color: var(--gold-ink);
  text-decoration: none; padding: 0 12px; min-height: var(--hl-h-sm); font-size: 12.5px;
}
html body .hl-btn-quiet:hover,
html body .btn-link:hover { background: var(--canvas); border-color: transparent; color: var(--ink); }

/* ---- Icon button -------------------------------------------------------- */
html body .hl-btn-icon,
html body .iconbtn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative;
  box-sizing: border-box; width: var(--hl-h); height: var(--hl-h); min-height: 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--hl-r);
  background: var(--card); color: var(--slate);
  font-family: var(--sans); font-size: 16px; font-weight: 800; line-height: 1;
  cursor: pointer; box-shadow: var(--hl-lift);
  transition: background-color .12s, border-color .12s, color .12s;
}
html body .hl-btn-icon:hover,
html body .iconbtn:hover { background: var(--canvas); border-color: var(--gold); color: var(--ink); }
html body .hl-btn-icon:active, html body .iconbtn:active { transform: translateY(1px); box-shadow: none; }
html body .hl-btn-icon svg, html body .iconbtn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
html body .iconbtn .dot { top: -6px; right: -6px; border: 2px solid var(--canvas); box-sizing: content-box; }
body.hl-dark .iconbtn { color: var(--slate); }

/* Raw <button>s elsewhere carried a heavy raised shadow from the old depth
   pass. Calm it down to the same lift the system uses. */
html body button { box-shadow: var(--hl-lift); }
html body button:disabled { box-shadow: none; }

/* ---- Chips: filters, segments, tags ------------------------------------ */
html body .hl-chip,
html body .chip2 {
  display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box;
  min-height: var(--hl-h-sm); padding: 0 12px; margin: 0;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--card); color: var(--slate);
  font-family: var(--sans); font-size: 11px; font-weight: 800; line-height: 1;
  white-space: nowrap; cursor: pointer; box-shadow: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
html body .hl-chip:hover, html body .chip2:hover { background: var(--canvas); border-color: var(--gold); color: var(--ink); }
html body .hl-chip.on, html body .chip2.on { background: var(--rail); border-color: var(--rail); color: #fff; }
body.hl-dark .hl-chip.on, body.hl-dark .chip2.on { background: var(--gold-bg); border-color: var(--gold); color: var(--ink); }

/* Top-bar chips (company, clock): same family as .hl-chip but standing alone */
html body .hl-tbchip {
  display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box;
  min-height: var(--hl-h); padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 12.5px; font-weight: 800; line-height: 1;
  white-space: nowrap; cursor: pointer; box-shadow: var(--hl-lift); user-select: none;
  transition: background-color .12s, border-color .12s;
}
html body .hl-tbchip:hover { background: var(--canvas); border-color: var(--gold); }
html body .hl-tbchip b { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html body .hl-tbchip .hl-tbchip-caret { font-size: 11px; color: var(--mut); }
html body .hl-tbchip .hl-tbchip-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--mut); flex: none; }

/* ---- Menus and dropdowns ----------------------------------------------- */
html body .hl-menu {
  box-sizing: border-box; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--hl-r-lg);
  box-shadow: var(--hl-pop); padding: 6px; font-family: var(--sans);
}
html body .hl-menu-label {
  padding: 8px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--mut);
}
html body .hl-menu-item {
  display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%;
  min-height: var(--hl-h); padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); text-align: left; text-decoration: none;
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; line-height: 1.3;
  cursor: pointer; box-shadow: none;
}
html body .hl-menu-item:hover, html body .hl-menu-item:focus-visible { background: var(--canvas); }
html body .hl-menu-item.on { background: var(--gold-bg); color: var(--ink); font-weight: 800; }
html body .hl-menu-item .hl-menu-item-end { margin-left: auto; }
html body .hl-menu-sep { height: 1px; margin: 6px 4px; background: var(--line); border: 0; }
html body .hl-menu-note { padding: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.45; color: var(--slate); }
html body .hl-menu-note.bad { color: var(--red); }

/* Existing dropdown surfaces, same family */
html body .askdrop, html body .hlcb-menu {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--hl-r-lg); box-shadow: var(--hl-pop);
}
html body .askrow { min-height: var(--hl-h); align-items: center; }

/* ---- Text-link buttons -------------------------------------------------- */
html body .hl-link,
html body .lnk,
html body .lnk2 {
  display: inline; padding: 0; border: 0; background: none; box-shadow: none; min-height: 0;
  font-family: inherit; font-size: inherit; font-weight: 800; line-height: inherit;
  color: var(--gold-ink); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
html body .hl-link:hover, html body .lnk:hover, html body .lnk2:hover { color: var(--ink); }
html body .lnk2 { font-size: 11px; }

/* ---- Toast -------------------------------------------------------------- */
html body .toast {
  display: flex; align-items: center; gap: 10px; box-sizing: border-box; min-height: 44px;
  padding: 10px 18px; border-radius: var(--hl-r-lg);
  background: var(--rail); color: #fff; border: 1px solid rgba(255, 255, 255, .12);
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; line-height: 1.45;
  box-shadow: var(--hl-pop);
}
html body .toast span { color: #7ddba8; font-weight: 800; }
body.hl-dark .toast { background: var(--card); border-color: var(--line); color: var(--ink); }

/* ---- Top bar -------------------------------------------------------------- */
html body .hl-tbchip .hl-tbchip-ic { display: inline-flex; color: var(--mut); }
html body .hl-tbchip .hl-tbchip-ic svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
html body .hl-tbmenu { position: absolute; top: calc(100% + 6px); z-index: 9000; }
html body .hl-tbmenu-co { left: 0; width: 320px; }
html body .hl-tbmenu-clock { right: 0; width: 280px; padding: 14px; }

/* The theme toggle's glyph is text set by hl-theme.js (kept for the page and
   its tests). Draw a matching line icon over it so it reads like its neighbours. */
html body #hltheme { font-size: 0; color: var(--slate); }
html body #hltheme::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--hl-ico-moon) center / contain no-repeat; mask: var(--hl-ico-moon) center / contain no-repeat;
}
body.hl-dark #hltheme::before { -webkit-mask-image: var(--hl-ico-sun); mask-image: var(--hl-ico-sun); }
:root {
  --hl-ico-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E");
  --hl-ico-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
}

/* Search box: same height and radius as the controls beside it */
html body .ask { border-radius: var(--hl-r); box-shadow: var(--hl-lift); }
html body .ask input { text-overflow: ellipsis; }
html body .ask-enter { min-height: 24px; border-radius: 6px; box-shadow: none; }
html body .avatar { flex: none; box-shadow: var(--hl-lift); }

/* ---- Top bar layout (desktop) -------------------------------------------
   One grid of 36px controls on an 8px gap.
   Wide screens (2000px and up): one row.
     back | greeting | status chips | company | clock | search (grows) | icons | avatar
   Everything narrower: two rows, nothing hidden and nothing overlapping.
     row 1: back | greeting | status chips ............. icons | avatar
     row 2: company | clock | search (grows to the avatar's edge)
   The greeting wrapper dissolves (display: contents) so its two children
   take part in the same flex flow. Phone width has its own header (see the
   max-width:600px block in index.html). */
@media (min-width: 601px) {
  html body .topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 8px 0 10px; margin-bottom: 16px;
  }
  html body .topbar > * { min-width: 0; margin: 0; }
  html body .topbar .greet { display: contents; }
  html body .topbar > #hl-back-btn { order: 1; }
  html body .topbar .greet-main { order: 2; flex: 0 1 auto; min-width: 0; max-width: 300px; margin: 0 8px 0 4px; }
  html body .topbar .greet-status { order: 3; flex: 0 1 auto; min-width: 0; }
  html body .topbar > .tb-co { order: 4; position: relative; flex: 0 1 auto; margin-left: 8px; }
  html body .topbar > #hltopclock { order: 5; position: relative; flex: 0 0 auto; }
  html body .topbar > .ask { order: 6; flex: 1 1 280px; min-width: 220px; margin: 0; }
  html body .topbar > .iconbtn, html body .topbar > .avatar { order: 7; width: var(--hl-h); height: var(--hl-h); flex: none; }
  html body .topbar > .avatar { order: 8; margin-left: 4px; }
  html body .topbar::after { display: none; }
}
@media (min-width: 601px) and (max-width: 1999px) {
  html body .topbar > #hl-back-btn { order: 1; }
  html body .topbar .greet-main { order: 2; }
  html body .topbar .greet-status { order: 3; }
  html body .topbar > .iconbtn { order: 4; }
  html body .topbar > .iconbtn.tb-first { margin-left: auto; }
  html body .topbar > .avatar { order: 5; }
  html body .topbar::after { content: ""; display: block; order: 6; flex: 0 0 100%; height: 0; }
  html body .topbar > .tb-co { order: 7; margin-left: 0; max-width: 100%; }
  html body .topbar > #hltopclock { order: 8; }
  html body .topbar > .ask { order: 9; flex: 1 1 260px; }
}

/* Greeting: name over date and time. The help "?" sits at the end of the second line. */
html body .topbar .greet-main { display: grid; grid-template-columns: minmax(0, max-content) auto; align-items: center; column-gap: 8px; row-gap: 0; white-space: nowrap; }
html body .topbar .greet-main b { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html body .topbar .greet-main span { margin-top: 0; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html body .topbar .greet-main .hl-qhelp {
  flex: none; box-sizing: border-box; width: 20px; height: 20px; margin: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--mut); border-radius: 50%; background: transparent; color: var(--mut); box-shadow: none;
  font: 800 11px/1 var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
html body .topbar .greet-main .hl-qhelp:hover { background: var(--canvas); border-color: var(--gold); color: var(--ink); }

/* Status chips (health, weather, sync): one height, one shape, one gap. Static: no glow, no pulse. */
html body .topbar .greet-status { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
html body .topbar .greet-status > * {
  box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 28px; margin: 0; padding: 0 12px; border-radius: 99px; vertical-align: baseline;
  font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .06em; line-height: 1;
  text-shadow: none; animation: none;
}
html body .topbar .greet-status > .cstat { box-shadow: none; border-width: 1px; border-style: solid; }
html body .topbar .greet-status > .cstat::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }
html body .topbar .greet-status > #cc-greet-weather,
html body .topbar .greet-status > #cc-sync-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html body .topbar .greet-status > #cc-sync-status { background: var(--card); border: 1px solid var(--line); color: var(--mut) !important; }
html body .topbar .greet-status > #cc-greet-weather:hover { transform: none; background: var(--canvas); }
body.hl-dark .topbar .greet-status > .cstat.steady { background: var(--green-bg); color: var(--green-ink); border-color: var(--green-ink); }
body.hl-dark .topbar .greet-status > .cstat.risk { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
body.hl-dark .topbar .greet-status > .cstat.danger { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* Company and clock chips: the company name takes the room it needs and only
   ellipsises when the row runs out (the tooltip carries the full name). */
html body .hl-tbchip { max-width: 100%; }
html body .topbar .tb-co { max-width: 420px; }
html body .topbar .tb-co .hl-tbchip { max-width: 100%; }
html body .hl-tbchip b, html body .hl-tbchip #hltopclock-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html body .hl-tbchip #hltopclock-label { font-variant-numeric: tabular-nums; }
html body .hl-tbchip .hl-tbchip-caret { font-size: 10px; flex: none; }
html body .hl-tbchip .hl-tbchip-ic { flex: none; }
html body .hl-tbchip:focus-visible { border-color: var(--gold); }

/* Search: same height as everything else, placeholder always readable, one focus ring around the whole box. */
html body .topbar .ask { align-items: center; min-height: var(--hl-h); box-sizing: border-box; padding: 0 6px 0 14px; gap: 10px; }
html body .topbar .ask input { min-width: 0; background: transparent !important; }
html body .topbar .ask input:focus-visible { outline: none !important; }
html body .topbar .ask:focus-within { border-color: #0284c7; box-shadow: 0 0 0 3px rgba(2, 132, 199, .35); }
html body .topbar .ask-enter { flex: none; }

/* Icon buttons: identical 36px squares. The count badge sits on the top-right corner, never wider than the 8px gap allows on the outside. */
html body .topbar .iconbtn .dot {
  top: -6px; right: -6px; box-sizing: border-box; min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--canvas); border-radius: 99px; line-height: 1; font-size: 11px; font-weight: 800;
  pointer-events: none;
}
body.hl-dark .topbar .iconbtn .dot { color: #0e1320; }
html body .topbar .avatar { font-family: var(--sans); padding: 0; transition: border-color .12s, box-shadow .12s; }
html body .topbar .avatar:hover { box-shadow: 0 0 0 3px var(--gold-bg); }

html body .hl-menu-item-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Small status tag inside a menu row or card (ACTIVE, NEW, ON) */
html body .hl-badge-ok {
  display: inline-block; padding: 2px 8px; border-radius: 99px; vertical-align: middle;
  background: var(--green-bg); color: var(--green-ink);
  font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .04em;
}

/* ---- Notifications panel (bell) ------------------------------------------- */
html body .hl-bell {
  position: fixed; top: 74px; right: 26px; width: 380px; max-width: calc(100vw - 32px);
  max-height: min(72vh, 600px); overflow-y: auto; padding: 0; z-index: 9000;
}
html body .hl-bell-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
html body .hl-bell-head b { font-size: 13px; font-weight: 800; color: var(--ink); }
html body .hl-bell-section {
  padding: 8px 16px; background: var(--canvas); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink);
}
html body .hl-bell-digest { cursor: pointer; }
html body .hl-bell-row {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
html body .hl-bell-row.is-click { cursor: pointer; }
html body .hl-bell-row.is-click:hover { background: var(--canvas); }
html body .hl-bell-row.is-unread { background: var(--gold-bg); }
html body .hl-bell-ic { font-size: 16px; line-height: 1.2; }
html body .hl-bell-body { flex: 1; min-width: 0; }
html body .hl-bell-title { font-size: 12.5px; font-weight: 800; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
html body .hl-bell-sub { margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--slate); overflow-wrap: anywhere; }
html body .hl-bell-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
html body .hl-bell-unread { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--red); flex: none; }
html body .hl-bell-tag {
  flex: none; padding: 3px 8px; border-radius: 99px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--gold-bg); color: var(--gold-ink);
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
html body .hl-bell-tag.is-hot { background: var(--red-bg); border-color: var(--red); color: var(--red); }
html body .hl-bell-draft { margin-top: 10px; padding: 10px 12px; border-radius: var(--hl-r); background: var(--canvas); border: 1px solid var(--line); }
html body .hl-bell-draft-label { margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); }
html body .hl-bell-draft-body { white-space: pre-wrap; word-break: break-word; }
html body .hl-bell-draft-warn { margin-top: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--gold-bg); color: var(--gold-ink); font-size: 12.5px; font-weight: 700; }
html body .hl-bell-field {
  display: block; width: 100%; box-sizing: border-box; margin-bottom: 6px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
}
html body textarea.hl-bell-field { resize: vertical; }
html body .hl-bell-empty { padding: 24px 16px; text-align: center; }
html body .hl-bell-foot { padding: 10px 16px; font-size: 11px; font-weight: 600; text-align: center; color: var(--mut); }

/* ---- Clock dropdown ---------------------------------------------------------- */
html body .hl-clock-state { font-size: 12.5px; font-weight: 800; color: var(--ink); }
html body .hl-clock-state + .hl-btn-block { margin-top: 12px; }
html body .hl-clock-warn { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #FFF3DC; color: #6b4a06; font-size: 12px; font-weight: 600; line-height: 1.4; max-width: 260px; }
html body .hl-clock-label { display: block; margin: 12px 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
html body .hl-clock-select {
  width: 100%; box-sizing: border-box; min-height: var(--hl-h); padding: 0 10px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--hl-r); background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
}
html body .hl-clock-actions { display: flex; gap: 8px; }
html body .hl-clock-actions .hl-btn, html body .hl-btn-block { flex: 1; width: 100%; }

/* ---- Left navigation ------------------------------------------------------- */
/* Every row, parent or child, is the same height with a transparent border, so
   the active row's frame never nudges its neighbours. */
html body .rail .nav {
  box-sizing: border-box; min-height: 38px; border: 1px solid transparent;
  border-radius: var(--hl-r); font-size: 13px; line-height: 1.25;
  transition: background-color .12s, border-color .12s;
}
html body .rail .nav[style*="padding-left:26px"] { min-height: 34px; padding-left: 26px; font-size: 12px; }
html body .rail .nav.on { border-color: rgba(181, 201, 213, .55); }
html body .rail .nav:focus-visible { outline-offset: -2px; }
html body .nav-expand-all {
  margin: 2px 8px 10px; padding: 7px 0; text-align: center; cursor: pointer; user-select: none;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 99px; background: rgba(255, 255, 255, .04);
  color: #c4d0e2; font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: .06em;
  transition: background-color .12s, border-color .12s;
}
html body .nav-expand-all:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .24); color: #fff; }

/* Phone: a long label wraps inside its button instead of pushing the page wider. */
@media (max-width: 600px) {
  html body .hl-btn, html body .btn, html body .btn-ghost, html body .btn-save,
  html body .btn-primary, html body .btn-danger, html body .gbtn {
    white-space: normal; max-width: 100%; text-align: center; padding-top: 6px; padding-bottom: 6px;
  }
}

/* ==== Modals and popups ========================================================
   One look for every dialog: dimmed overlay, a panel with a header (title, optional
   subtitle, icon close), a body, and a footer with the actions on the right and the
   primary action last. Existing dialog classes are mapped onto it. */
html body .hl-modal-overlay {
  position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(22, 30, 46, .55); backdrop-filter: blur(4px);
}
html body .hl-modal,
html body .nl, html body .dtm, html body .ldm, html body .epvm, html body .hldoc-dialog {
  box-sizing: border-box; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--hl-r-lg);
  box-shadow: 0 24px 64px rgba(10, 15, 25, .45); font-family: var(--sans);
}
html body .hl-modal { width: 560px; max-width: 96%; max-height: 88vh; overflow-y: auto; }
/* Dialogs take focus when they open; the panel itself never needs a ring. */
html body :is(.hl-modal, .nl, .dtm, .ldm, .epvm, .hldoc-dialog, .dw)[tabindex]:focus,
html body :is(.hl-modal, .nl, .dtm, .ldm, .epvm, .hldoc-dialog, .dw):focus-visible { outline: none !important; }

/* Header */
html body .hl-modal-head, html body .nl-head, html body .dt-head, html body .ld-head {
  display: flex; align-items: center; gap: 12px; box-sizing: border-box; padding: 16px 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
html body .hl-modal-head { position: sticky; top: 0; z-index: 2; }
html body .hl-modal-title, html body .nl-head h1, html body .dt-head h1, html body .ld-head h1,
html body .hldoc-dialog h3 {
  margin: 0; font-size: 16px; font-weight: 800; letter-spacing: 0; line-height: 1.3; color: var(--ink);
}
html body .nl-head p { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--slate); }
html body .hldoc-dialog h3 { margin-bottom: 14px; }

/* Close: a 32px icon button, same on every dialog */
html body .hl-modal-x, html body .hlm-x, html body .dt-head .x, html body .ld-head .x {
  display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box;
  width: 32px; height: 32px; margin: 0 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: var(--hl-r);
  background: transparent; color: var(--slate); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
html body .hl-modal-x:hover, html body .hlm-x:hover, html body .dt-head .x:hover, html body .ld-head .x:hover {
  background: var(--canvas); border-color: var(--line); color: var(--ink);
}

/* Body and footer */
html body .hl-modal-body { padding: 18px 20px; }
html body .nl-foot, html body .dt-foot, html body .hl-modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; box-sizing: border-box;
  padding: 12px 20px; background: var(--card); border-top: 1px solid var(--line);
}
html body .nl-foot { justify-content: space-between; }
html body .nl-head .acts { gap: 8px; }

/* Dialogs whose body sat on the canvas colour keep that, in both themes */
html body .nl, html body .dtm, html body .ldm { background: var(--canvas); }
html body .dt-sent { background: var(--card); }
html body .nl-foot .d { color: var(--mut); }
html body .nl-foot .d i { color: var(--green-ink); font-style: normal; }
html body #hl-settings-save { margin-top: 14px; }
/* Dialog headers with many actions: the title keeps its width, the actions wrap below. */
html body .nl-head { flex-wrap: wrap; }
html body .nl-head > div:first-child { flex: 1 1 240px; }
html body .nl-head .acts { flex: 0 1 auto; }

/* Do Work and the quick-action forms: same panel as every other dialog, and they follow the theme */
html body .dw, html body .fm { background: var(--card); border: 1px solid var(--line); border-radius: var(--hl-r-lg); color: var(--ink); }
html body .dw-title { padding: 18px 20px 4px; }
html body .dw-title b { letter-spacing: 0; }
html body .dw-title span { font-size: 12px; color: var(--slate); }
html body .dw-a { background: var(--canvas); border-radius: var(--hl-r-lg); font-size: 12px; box-shadow: none; }
html body .dw-a:hover { background: var(--card); border-color: var(--gold); box-shadow: var(--hl-pop); }
html body .fm-head b { font-size: 16px; letter-spacing: 0; }
html body .fm-head .x { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--hl-r); color: var(--slate); font-size: 16px; }
html body .fm-head .x:hover { background: var(--canvas); color: var(--ink); }
html body .fm-foot { background: var(--card); gap: 8px; }

/* The create/save actions that had their own colours (orange, green) read as the one primary */
html body .fm-save, html body .nc-create, html body .cdb-new {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box;
  min-height: var(--hl-h); padding: 0 16px; border: 1px solid var(--hl-primary); border-radius: var(--hl-r);
  background: var(--hl-primary); color: #fff; font-family: var(--sans); font-size: 12.5px; font-weight: 800;
  white-space: nowrap; cursor: pointer; box-shadow: var(--hl-lift);
}
html body .fm-save:hover, html body .nc-create:hover, html body .cdb-new:hover { background: var(--hl-primary-hover); border-color: var(--hl-primary-hover); }

/* ==== Busiest screens: page-specific button and chip families, same system ====
   Estimates (.ef-*), Command Center states, Invoicing and list filters. */
html body .ef-ghost, html body .cc-state-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box;
  min-height: var(--hl-h); padding: 0 16px; margin: 0; border: 1px solid var(--line); border-radius: var(--hl-r);
  background: var(--card); color: var(--ink); font-family: var(--sans); font-size: 12.5px; font-weight: 800; line-height: 1.2;
  white-space: nowrap; cursor: pointer; box-shadow: var(--hl-lift);
}
html body .ef-ghost:hover, html body .cc-state-btn:hover { background: var(--canvas); border-color: var(--gold); }
html body .ef-green {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box;
  min-height: var(--hl-h); padding: 0 16px; margin: 0; border: 1px solid var(--hl-primary); border-radius: var(--hl-r);
  background: var(--hl-primary); color: #fff; font-family: var(--sans); font-size: 12.5px; font-weight: 800; line-height: 1.2;
  white-space: nowrap; cursor: pointer; box-shadow: var(--hl-lift);
}
html body .ef-green:hover { background: var(--hl-primary-hover); border-color: var(--hl-primary-hover); }
html body .eqtab, html body .ivx-chip {
  display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: var(--hl-h-sm); padding: 0 12px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--slate);
  font-family: var(--sans); font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: none;
}
html body .eqtab:hover, html body .ivx-chip:hover { background: var(--canvas); border-color: var(--gold); color: var(--ink); }
html body .eqtab.on, html body .ivx-chip.on, html body .ivx-chip.active { background: var(--rail); border-color: var(--rail); color: #fff; }
body.hl-dark .eqtab.on, body.hl-dark .ivx-chip.on, body.hl-dark .ivx-chip.active { background: var(--gold-bg); border-color: var(--gold); color: var(--ink); }
html body .map-expand {
  box-sizing: border-box; width: var(--hl-h-sm); height: var(--hl-h-sm); border-radius: var(--hl-r);
  background: var(--card); border: 1px solid var(--line); color: var(--slate); box-shadow: var(--hl-lift);
}
html body .map-expand:hover { background: var(--canvas); border-color: var(--gold); color: var(--ink); }
/* Segmented view tabs (Production board / Margin list, Open & drafts / All recent) */
html body .vtab { min-height: var(--hl-h-sm); display: inline-flex; align-items: center; padding: 0 16px; border-radius: var(--hl-r); font-size: 12px; }
html body .vtab.on { background: var(--card); color: var(--ink); }
/* A table-row or card action that was a bare button gets the same lift */
html body select { min-height: var(--hl-h-sm); }

/* ==== Page type scale: title, lede, label, hint =============================
   Sentence case in the UI font. Uppercase and monospace are for codes and
   figures, never for a sentence or a label. */
html body .hl-lede { font-family: var(--sans); font-size: var(--hl-fs-lede); font-weight: 600; line-height: 1.5; letter-spacing: 0; text-transform: none; color: var(--slate); margin: 0 0 20px; max-width: 70ch; }
html body .hl-label { font-family: var(--sans); font-size: var(--hl-fs-label); font-weight: 700; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--slate); }
html body .hl-hint { font-family: var(--sans); font-size: var(--hl-fs-micro); font-weight: 600; line-height: 1.55; letter-spacing: 0; text-transform: none; color: var(--mut); }
html body .hl-figure { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* A finished empty state: icon, one line of what, one line of why, one next step */
html body .hl-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; box-sizing: border-box; padding: 40px 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--hl-r-lg); color: var(--ink); }
html body .hl-empty-ico { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--gold-bg); color: var(--gold-ink, var(--gold-deep)); margin-bottom: 4px; }
html body .hl-empty-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body .hl-empty-t { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0; }
html body .hl-empty-s { font-size: var(--hl-fs-body); font-weight: 600; line-height: 1.55; color: var(--slate); max-width: 46ch; margin: 0; }

/* ==== Sub Control: the "call this sub" popup ===================================
   Opens when every automatic try to reach a sub went unanswered (app-sub-live-call.js).
   Built on the shared modal above; only the contents are new. */
html body .hlsc { width: 480px; display: flex; flex-direction: column; overflow: hidden; }
html body .hlsc .hl-modal-head { align-items: flex-start; }
html body .hlsc .hl-modal-head > div { flex: 1; min-width: 0; }
html body .hlsc .hl-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
html body .hlsc .hl-modal-foot { position: sticky; bottom: 0; }
html body .hlsc-count { display: block; margin-top: 2px; font-size: var(--hl-fs-micro); font-weight: 700; color: var(--slate); }
html body .hlsc-who { font-size: 20px; font-weight: 800; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
html body .hlsc-job { margin-top: 2px; font-size: var(--hl-fs-body); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
html body .hlsc-jobmeta { margin-top: 2px; font-size: var(--hl-fs-body); color: var(--ink); overflow-wrap: anywhere; }
html body .hlsc-openjob { display: inline-block; margin-top: 6px; font-size: var(--hl-fs-body); font-weight: 700; color: var(--accent, var(--slate)); text-decoration: underline; text-underline-offset: 2px; }
html body .hlsc-docs { display: grid; gap: 6px; }
html body .hlsc-doc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
html body .hlsc-doc-t { font-size: var(--hl-fs-body); font-weight: 700; color: var(--ink); }
html body .hlsc-pill { flex-shrink: 0; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; font-size: 12px; font-weight: 700; white-space: nowrap; }
html body .hlsc-pill.is-ok { color: var(--green-ink); }
html body .hlsc-pill.is-warn { color: var(--warn-ink); }
html body .hlsc-pill.is-bad { color: var(--red); }
html body .hlsc-pill.is-quiet { color: var(--slate); }
html body .hlsc-need { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--red); border-radius: 10px; font-size: var(--hl-fs-body); line-height: 1.45; color: var(--ink); }
html body .hlsc-need b { color: var(--red); }
html body .hlsc-copyreq { display: block; margin-top: 8px; }
html body .hlsc-fold { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
html body .hlsc-fold > summary { cursor: pointer; padding: 10px 0; font-size: var(--hl-fs-body); font-weight: 700; color: var(--ink); }
html body .hlsc-fold[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
html body .hlsc-cert, html body .hlsc-hist { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: var(--hl-fs-body); color: var(--ink); }
html body .hlsc-cert-main, html body .hlsc-hist-main { min-width: 0; overflow-wrap: anywhere; }
html body .hlsc-cert-sub { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
html body .hlsc-hist-ans { flex-shrink: 0; font-size: 12px; color: var(--slate); text-align: right; }
html body .hlsc-more { margin: 6px 0 10px; }
html body .hlsc-more-end { margin: 6px 0 10px; }
html body .hlsc-hist-h { margin: 8px 0 2px; font-size: var(--hl-fs-label); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
html body .hlsc-soft { padding: 8px 0; font-size: var(--hl-fs-body); color: var(--slate); }
html body .hlsc-soft-inline { font-size: 12px; color: var(--slate); }
html body .hlsc-when-big { margin-top: 6px; font-size: 15px; font-weight: 800; color: var(--ink); }
html body .hlsc-call { display: flex; width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; align-items: center; gap: 14px; box-sizing: border-box; margin: 16px 0 4px; padding: 14px 16px; min-height: 56px; border-radius: var(--hl-r-lg); background: var(--hl-primary); color: #fff; text-decoration: none; }
html body .hlsc-call:hover { background: var(--hl-primary-hover); }
html body .hlsc-call:focus-visible { outline: 3px solid var(--gold-ink, var(--hl-primary)); outline-offset: 2px; }
html body .hlsc-call b { display: block; font-size: 18px; font-weight: 800; letter-spacing: .01em; }
html body .hlsc-call small { display: block; margin-top: 1px; font-size: var(--hl-fs-micro); font-weight: 700; opacity: .92; }
html body .hlsc-call-ic { font-size: 24px; line-height: 1; }
html body .hlsc-call.is-connecting { cursor: progress; opacity: .92; }
html body .hlsc-call.is-started { background: var(--green-ink, var(--hl-primary)); }
html body .hlsc-spin { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: hlsc-spin .8s linear infinite; }
@keyframes hlsc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html body .hlsc-spin { animation: none; } }
html body .hlsc-callfail { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 8px 0 4px; padding: 12px 14px; border-radius: var(--hl-r); background: var(--red-bg); border: 1px solid var(--red); color: var(--ink); font-size: var(--hl-fs-body); line-height: 1.45; }
html body .hlsc-callfail > div { min-width: 0; }
html body .hlsc-callfail b { display: block; font-weight: 800; }
html body .hlsc-callfail span { display: block; font-weight: 600; overflow-wrap: anywhere; }
html body .hlsc-callfail .hl-btn { flex: none; text-decoration: none; min-height: 44px; }
html body .hlsc-trouble { margin: 8px 0 0; font-size: var(--hl-fs-label); color: var(--slate); }
html body .hlsc-trouble summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; cursor: pointer; font-weight: 700; color: var(--slate); list-style: none; }
html body .hlsc-trouble summary::-webkit-details-marker { display: none; }
html body .hlsc-trouble summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .12s; }
html body .hlsc-trouble[open] summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { html body .hlsc-trouble summary::before { transition: none; } }
html body .hlsc-trouble summary:focus-visible { outline: 3px solid var(--hl-primary); outline-offset: 2px; border-radius: 4px; }
html body .hlsc-trouble-link { display: inline-block; margin: 2px 0 0; padding: 8px 0; font-weight: 700; color: var(--ink); text-decoration: underline; }
html body .hlsc-trouble-note { display: block; font-weight: 600; line-height: 1.4; }
html body .hlsc-nophone { margin: 16px 0 4px; padding: 12px 14px; border-radius: var(--hl-r); background: var(--red-bg); border: 1px solid var(--red); color: var(--ink); font-size: var(--hl-fs-body); font-weight: 600; line-height: 1.5; }
html body .hlsc-reach { display: block; }
html body .hlsc-pick { margin: 14px 0 0; }
html body .hlsc-pick .hlsc-label { margin-top: 0; }
html body .hlsc-pick select { width: 100%; box-sizing: border-box; min-height: 44px; }
html body .hlsc-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 0; }
html body .hlsc-acts.is-one { grid-template-columns: 1fr; }
html body .hlsc-fm[hidden] { display: none; }
html body .hlsc-act { display: block; font: inherit; text-align: left; cursor: pointer; box-sizing: border-box; min-height: 48px; min-width: 0; padding: 8px 12px; border-radius: var(--hl-r); border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; }
html body .hlsc-act b { display: block; font-size: 14px; font-weight: 800; }
html body .hlsc-act small { display: block; margin-top: 1px; font-size: var(--hl-fs-label); font-weight: 600; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .hlsc-act:hover:not(:disabled) { background: var(--canvas); }
html body .hlsc-act:disabled { cursor: progress; opacity: .75; }
html body .hlsc-act:focus-visible { outline: 3px solid var(--hl-primary); outline-offset: 2px; }
html body .hlsc-add { display: block; margin: 16px 0 0; padding: 14px; border-radius: var(--hl-r); border: 1px solid var(--line); background: var(--canvas); }
html body .hlsc-add-t { font-size: 15px; font-weight: 800; color: var(--ink); }
html body .hlsc-add-p { margin: 4px 0 0; font-size: var(--hl-fs-body); font-weight: 600; line-height: 1.5; color: var(--ink); }
html body .hlsc-field { margin-top: 10px; }
html body .hlsc-field .hlsc-label { margin: 0 0 6px; }
html body .hlsc-in { display: block; width: 100%; box-sizing: border-box; min-height: 44px; }
html body .hlsc-in.is-bad { border-color: var(--red); }
html body .hlsc-fm { margin-top: 4px; font-size: var(--hl-fs-label); font-weight: 600; line-height: 1.4; color: var(--slate); }
html body .hlsc-fm.is-bad { color: var(--red-ink, var(--red)); font-weight: 700; }
html body .hlsc-fm-form { margin-top: 10px; padding: 10px 12px; border-radius: var(--hl-r); background: var(--red-bg); border: 1px solid var(--red); color: var(--ink); font-size: var(--hl-fs-body); }
html body .hlsc-add-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
html body .hlsc-add-btns .hl-btn { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
html body .hlsc-dup { margin-top: 12px; padding: 12px 14px; border-radius: var(--hl-r); border: 1px solid var(--gold-ink, var(--hl-primary)); background: var(--gold-bg); color: var(--ink); font-size: var(--hl-fs-body); line-height: 1.45; }
html body .hlsc-dup b { display: block; font-weight: 800; overflow-wrap: anywhere; }
html body .hlsc-dup span { display: block; margin-top: 2px; font-weight: 600; }
html body .hlsc-dup-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
html body .hlsc-dup-btns .hl-btn { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; }
html body .hlsc-h { margin: 18px 0 8px; font-size: var(--hl-fs-label); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
html body .hlsc-quiet { margin: 0; font-size: var(--hl-fs-body); font-weight: 600; color: var(--slate); }
html body .hlsc-attempts { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--hl-r); }
html body .hlsc-attempts li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 12px; font-size: var(--hl-fs-label); color: var(--ink); }
html body .hlsc-attempts li + li { border-top: 1px solid var(--line); }
html body .hlsc-when { flex: 1 1 140px; font-weight: 700; }
html body .hlsc-attempts li.hlsc-more { font-weight: 600; color: var(--slate); }
html body .hlsc-ch { padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); font-size: var(--hl-fs-micro); font-weight: 700; color: var(--slate); }
html body .hlsc-ch.is-ok { border-color: var(--green-ink); color: var(--green-ink); }
html body .hlsc-opts { display: grid; gap: 8px; }
html body .hlsc-opt { display: block; width: 100%; box-sizing: border-box; padding: 11px 14px; text-align: left; font-family: var(--sans); color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: var(--hl-r); cursor: pointer; min-height: 48px; }
html body .hlsc-opt b { display: block; font-size: 14px; font-weight: 800; }
html body .hlsc-opt small { display: block; margin-top: 1px; font-size: var(--hl-fs-label); font-weight: 600; color: var(--slate); }
html body .hlsc-opt:hover { background: var(--canvas); }
html body .hlsc-opt.is-on { border-color: var(--hl-primary); background: var(--gold-bg); box-shadow: inset 0 0 0 1px var(--hl-primary); }
html body .hlsc-opt:focus-visible { outline: 3px solid var(--hl-primary); outline-offset: 2px; }
html body .hlsc-label { display: block; margin: 14px 0 6px; font-size: var(--hl-fs-label); font-weight: 800; color: var(--ink); }
html body .hlsc-err { flex: none; margin: 0 20px 12px; padding: 10px 12px; border-radius: var(--hl-r); background: var(--red-bg); border: 1px solid var(--red); color: var(--ink); font-size: var(--hl-fs-body); font-weight: 700; }
html body .hlsc-err[hidden] { display: none; }
@media (max-width: 520px) {
  html body #hlsubcall.hl-modal-overlay { align-items: flex-end; padding: 0; }
  html body .hlsc { width: 100%; max-width: 100%; max-height: 94vh; border-radius: var(--hl-r-lg) var(--hl-r-lg) 0 0; }
}

/* Top bar: "Add receipt", next to the clock chip. Receipts do not need a job, so this is on every screen. */
html body .hl-tbchip.hlra-tb { background: var(--hl-primary); border-color: var(--hl-primary); color: #fff; flex: 0 0 auto; position: relative; }
html body .hl-tbchip.hlra-tb:hover { background: var(--hl-primary-hover); border-color: var(--hl-primary-hover); }
html body .hl-tbchip.hlra-tb svg { width: 16px; height: 16px; flex: none; }
html body .hl-tbchip.hlra-tb:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
html body .hl-tbchip.hlra-tb .hlra-tb-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #fff; color: var(--hl-primary); font-size: 11px; font-weight: 800; }
html body .hl-tbchip.hlra-tb .hlra-tb-n { cursor: pointer; transition: box-shadow .12s; }
html body .hl-tbchip.hlra-tb .hlra-tb-n:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
html body .hl-tbchip.hlra-tb .hl-tbchip-caret { color: rgba(255, 255, 255, .85); }
/* Receipts menu: one button, three doors. Desktop = dropdown under the button; phone = bottom sheet. */
html body .hlrm { position: relative; flex: 0 0 auto; }
html body .hlrm-drop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 9000; width: 320px; padding: 6px; }
html body .hlrm-drop[hidden] { display: none; }
html body .hlrm-item { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font-family: var(--sans); cursor: pointer; box-shadow: none; min-height: 0; }
html body .hlrm-item:hover, html body .hlrm-item:focus-visible { background: var(--canvas); outline: none; }
html body .hlrm-item:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
html body .hlrm-item:hover, html body .hlrm-item:active { box-shadow: none; transform: none; }
html body .hlrm-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--gold-bg); color: var(--hl-primary); }
html body .hlrm-ic svg { width: 18px; height: 18px; }
html body .hlrm-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html body .hlrm-tx b { font-size: 13.5px; font-weight: 800; line-height: 1.25; }
html body .hlrm-tx span { font-size: 12px; font-weight: 500; line-height: 1.35; color: var(--slate); }
html body .hlrm-item[hidden] { display: none; }
html body .hlrm-n { margin-left: auto; flex: none; font-style: normal; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; background: var(--hl-primary); color: #fff; font-size: 12px; font-weight: 800; }
html body .hlrm-n[hidden] { display: none; }
html body .hlrm-scrim { display: none; }
@media (max-width: 600px) {
  html body .hlrm-scrim { position: fixed; inset: 0; z-index: 99990; background: rgba(15, 23, 42, .45); }
  html body .hlrm.open .hlrm-scrim { display: block; }
  html body .hlrm-drop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 99991; width: 100%; max-height: 80vh; overflow: auto; border-radius: var(--hl-r-lg) var(--hl-r-lg) 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); }
  html body .hlrm-drop::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 4px auto 10px; }
  html body .hlrm-item { min-height: 56px; }
}
@media (min-width: 601px) {
  html body .topbar > .hlrm { order: 5; }
}
@media (min-width: 601px) and (max-width: 1999px) {
  html body .topbar > .hlrm { order: 8; }
}
@media (max-width: 600px) {
  html body .topbar > .hlrm { flex: none; }
  html body .hlrm > #hl-add-receipt { padding: 0 11px; min-height: 44px; min-width: 44px; justify-content: center; }
  html body .hlrm > #hl-add-receipt .hl-tbchip-caret { display: none; }
  html body .hlrm > #hl-add-receipt .hlra-tb-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Bell: per-row "mark read" check. */
html body .hl-bell-mark {
  flex: none; width: 32px; height: 32px; margin: -6px 0; border: 0; border-radius: 8px; background: none;
  color: var(--green-ink, #1b7a50); font-size: 16px; font-weight: 800; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
html body .hl-bell-mark.is-dismiss { color: var(--slate); font-size: 14px; margin: -6px -8px -6px 0; }
html body .hl-bell-mark:hover { background: var(--canvas); }
html body .hl-bell-mark:focus-visible { outline: 2px solid var(--green-ink, #1b7a50); outline-offset: 1px; }
