/* The redesigned agent Home (tms-home-v2.js). Design pack November 2026:
   page #F0F1F4, cards white with a #D5D8DF border, teal #0E8A99, DM Sans.
   Every grid track is minmax(0, …) so nothing can push the page sideways. */
.hv2 { --hv2-teal: #0E8A99; --hv2-teal-dark: #0A6E7E; --hv2-ink: #0F1C31; --hv2-body: #334155; --hv2-muted: #636C87;
  --hv2-line: #D5D8DF; --hv2-soft: #E7E9EE; --hv2-red: #ED1A25;
  --hv2-website: #4B86AE; --hv2-marketing: #E35A12; --hv2-customers: #0E8A99; --hv2-results: #2E8B57;
  max-width: 1120px; margin: 0 auto; padding: 4px 0 64px; color: var(--hv2-body); font-family: 'Inter', system-ui, sans-serif; }
body.hv2-page { background: #F0F1F4; }
.hv2 *, .hv2 *::before, .hv2 *::after { box-sizing: border-box; }
.hv2 a { color: inherit; }
.hv2 a.hv2-btn { color: var(--hv2-teal-dark); }
.hv2 a.hv2-btn--primary { color: #fff; }
.hv2 a:focus-visible, .hv2 button:focus-visible { outline: 2px solid var(--hv2-teal); outline-offset: 2px; }

.hv2-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.hv2-date { margin: 0 0 4px; font-size: 14px; color: var(--hv2-muted); }
.hv2-hello { margin: 0 0 4px; font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--hv2-ink); letter-spacing: -.01em; }
.hv2-summary { margin: 0; font-size: 16px; }

.hv2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--hv2-line); background: #fff; color: var(--hv2-teal-dark); font: 600 15px 'Inter', system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.hv2-btn:hover { background: #E6F5F6; }
.hv2-btn--primary { background: var(--hv2-teal); border-color: var(--hv2-teal); color: #fff; }
.hv2-btn--primary:hover { background: var(--hv2-teal-dark); border-color: var(--hv2-teal-dark); }
.hv2-btn:disabled { opacity: .7; cursor: default; }
.hv2-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #fff; color: var(--hv2-teal-dark); font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; }

.hv2-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hv2-h2 { margin: 0; font-size: 20px; color: var(--hv2-ink); }
.hv2-h2--small { font-size: 16px; }
.hv2-h3 { margin: 0 0 6px; font-size: 17px; color: var(--hv2-ink); }
.hv2-muted { margin: 2px 0 0; font-size: 14px; color: var(--hv2-muted); }
.hv2-link { color: var(--hv2-teal-dark) !important; font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.hv2-link:hover { text-decoration: underline; }
.hv2-error { margin: 10px 0 0; color: #B42318; font-weight: 600; }
.hv2-pad { padding: 12px 0; }

.hv2-shortcuts { margin: 0 0 22px; }
.hv2-shortcuts .hv2-row-head { margin-bottom: 10px; }
.hv2-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.hv2-tile { display: flex; align-items: center; min-height: 64px; padding: 12px 16px; background: #fff; border: 1px solid var(--hv2-line); border-radius: 14px;
  text-decoration: none; color: var(--hv2-ink); font-weight: 600; font-size: 15.5px; }
.hv2-tile:hover { border-color: var(--hv2-teal); }

.hv2-card { background: #fff; border: 1px solid var(--hv2-line); border-radius: 16px; padding: 20px; min-width: 0; margin: 0 0 18px; }
.hv2-edit .hv2-muted:first-child { margin: 0 0 12px; }
.hv2-edit__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.hv2-pick { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hv2-line);
  background: #fff; color: var(--hv2-ink); font: 500 15px 'Inter', system-ui, sans-serif; text-align: left; cursor: pointer; }
.hv2-pick--on { background: #E6F5F6; border-color: #9FD6DC; font-weight: 600; }
.hv2-pick__star { color: #E9B91A; font-size: 18px; line-height: 1; }
.hv2-pick:not(.hv2-pick--on) .hv2-pick__star { color: #8B92A0; }
.hv2-edit__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.hv2-two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
/* The enquiries card runs the full height of the column beside it; empty rows
   (.hv2-filler) share the spare space so the list's lines carry on to the bottom. */
.hv2-needs { display: flex; flex-direction: column; }
.hv2-needs .hv2-list { flex: 1; display: flex; flex-direction: column; }
.hv2-needs .hv2-list li { flex: none; }
.hv2-needs .hv2-list li.hv2-filler { flex: 1 1 0; min-height: 48px; }
.hv2-needs .hv2-empty { flex: 1; }
.hv2-two > .hv2-card { margin: 0; }
.hv2-two { margin-bottom: 18px; }
.hv2-entries { display: grid; gap: 14px; min-width: 0; }
.hv2-entry { margin: 0; border-left-width: 4px; }
.hv2-entry--website { border-left-color: var(--hv2-website); }
.hv2-entry--marketing { border-left-color: var(--hv2-marketing); }
.hv2-entry p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; }

.hv2-list { list-style: none; margin: 14px -20px -20px; padding: 0; }
.hv2-list li { border-top: 1px solid var(--hv2-soft); }
.hv2-enq, .hv2-todo { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 20px; text-decoration: none; }
.hv2-enq:hover, .hv2-todo:hover { background: #FAFAFB; }
.hv2-avatar { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: #F0F1F4; color: var(--hv2-body); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; }
.hv2-enq__mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hv2-enq__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hv2-ink); }
.hv2-enq__sub { font-size: 13.5px; color: var(--hv2-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv2-enq__right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hv2-enq__due { font-size: 13.5px; font-weight: 600; color: var(--hv2-teal-dark); }
.hv2-enq__due--late { color: #C4161F; }
.hv2-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.hv2-pill--new { background: #E6F5F6; color: #0A5B68; }
.hv2-pill--warn { background: #FBEFC2; color: #5C4706; }
.hv2-pill--alert { background: #FDE3E4; color: #A3141B; }
.hv2-empty { padding: 14px 0 0; }
.hv2-empty p { margin: 0 0 8px; }
.hv2-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; }
.hv2-dot--marketing { background: var(--hv2-marketing); }
.hv2-dot--website { background: var(--hv2-website); }

.hv2-loop .hv2-row-head { margin-bottom: 12px; }
.hv2-loop__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hv2-step { display: flex; flex-direction: column; gap: 6px; min-height: 76px; padding: 12px 14px; border: 1px solid var(--hv2-line); border-top-width: 3px;
  border-radius: 12px; text-decoration: none; }
.hv2-step:hover { background: #FAFAFB; }
.hv2-step--website { border-top-color: var(--hv2-website); }
.hv2-step--marketing { border-top-color: var(--hv2-marketing); }
.hv2-step--customers { border-top-color: var(--hv2-customers); }
.hv2-step--results { border-top-color: var(--hv2-results); }
.hv2-step__label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hv2-step--website .hv2-step__label { color: #1F4E6B; }
.hv2-step--marketing .hv2-step__label { color: #9C3A0B; }
.hv2-step--customers .hv2-step__label { color: #0E4A53; }
.hv2-step--results .hv2-step__label { color: #1E5E3A; }
.hv2-step__value { font-size: 14.5px; color: var(--hv2-body); }
.hv2-step__value strong { font-size: 18px; color: var(--hv2-ink); }
.hv2-num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; letter-spacing: 0; }
.hv2-num--website { background: #D8E6EF; color: #1F4E6B; }
.hv2-num--marketing { background: #FADCCE; color: #6E2E1B; }
.hv2-num--customers { background: #C5EAEE; color: #0E4A53; }
.hv2-num--results { background: #D3EBDD; color: #1E5E3A; }
.hv2-loop__note { margin-top: 12px; font-size: 13.5px; }

@media (max-width: 900px) {
  .hv2-two { grid-template-columns: minmax(0, 1fr); }
  .hv2-needs .hv2-list li.hv2-filler { display: none; }
  .hv2-loop__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hv2-hello { font-size: 26px; }
  .hv2-head .hv2-btn { width: 100%; }
  .hv2-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv2-enq { flex-wrap: wrap; }
  .hv2-enq__right { flex-direction: row; align-items: center; width: 100%; padding-left: 52px; justify-content: space-between; }
}

/* Loading skeleton (drawn before /api/dashboard/home answers). */
.hv2-skel { margin-top: 30px; }
.hv2-skel .hv2-tiles { margin-bottom: 22px; }
.hv2-skel__box { background: linear-gradient(90deg, #E7E9EE 0%, #F3F4F7 50%, #E7E9EE 100%); background-size: 200% 100%; border-radius: 14px; animation: hv2-shimmer 1.4s ease-in-out infinite; }
.hv2-skel__tile { height: 64px; }
.hv2-skel__card { height: 150px; border-radius: 16px; }
.hv2-skel__card--tall { height: 486px; }
@keyframes hv2-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .hv2-skel__box { animation: none; } }
.hv2-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Your emails (email-results-view.js) */
.hv2-mail__groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.hv2-mail__group { min-width: 0; }
.hv2-mail__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.hv2-mail__stat { display: flex; flex-direction: column-reverse; min-width: 0; padding: 8px 12px; border: 1px solid var(--hv2-line, #E4E7EC); border-radius: 10px; }
.hv2-mail__n { margin: 0; font-size: 18px; font-weight: 600; }
.hv2-mail__l { font-size: 12px; color: var(--hv2-muted, #475467); }
.hv2-mail__foot { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 4px; }
