/* V4 — standalone stylesheet. The conceptual shift from V3 -> V4 is described in README.md.
   This file is self-contained (V3 design system + V2 login rules + V4 drop-planner additions)
   so the V4 folder can be deployed on its own. */
:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #243128;
  --muted: #6a756d;
  --line: #dbe2dd;
  --green: #2f7a55;
  --green-strong: #1f6b46;
  --green-soft: #e2f2e9;
  --red: #ce5d56;
  --red-soft: #f9e3df;
  --amber: #ddaE42;
  --amber-soft: #fff0c8;
  --blue: #315f8f;
  --blue-soft: #e7f0fb;
  --shadow: 0 14px 36px rgba(30, 40, 34, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 900;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(31, 107, 70, .18);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.nav-location-group {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-location-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.nav-location {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.nav-location select {
  width: 245px;
  height: 29px;
  padding: 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.user-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.user-icon {
  width: 19px;
  height: 19px;
  display: inline-block;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 36%, var(--muted) 0 23%, transparent 24%),
    radial-gradient(ellipse at 50% 87%, var(--muted) 0 34%, transparent 35%),
    #eef2ef;
}

.logout-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.logout-icon:hover {
  color: var(--green-strong);
  background: #eef7f2;
}

.logout-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.container {
  max-width: 1510px;
  margin: 0 auto;
  padding: 18px 26px 34px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 27px;
}

h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.page-heading,
.section-heading,
.offset-heading,
.filter-head,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-heading {
  margin-bottom: 12px;
}

.page-heading p,
.section-heading p,
.offset-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.month-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.calendar-card {
  padding: 15px 18px 14px;
}

.total-pill,
.status-pill,
.soft-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill {
  color: var(--green-strong);
  border-color: rgba(47, 122, 85, .2);
  background: #edf7f1;
}

.communications-chart {
  height: 305px;
  margin-top: 12px;
  padding-top: 4px;
}

.bar-plot {
  height: 292px;
  display: grid;
  grid-template-columns: repeat(31, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to bottom, transparent 33%, rgba(219, 226, 221, .65) 33%, rgba(219, 226, 221, .65) calc(33% + 1px), transparent calc(33% + 1px)),
    linear-gradient(to bottom, transparent 66%, rgba(219, 226, 221, .65) 66%, rgba(219, 226, 221, .65) calc(66% + 1px), transparent calc(66% + 1px));
}

.bar-item {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 24px 22px 1fr 39px;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.bar-value {
  align-self: end;
  justify-self: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 3px 9px rgba(30, 40, 34, .08);
}

.bar-offset {
  align-self: center;
  justify-self: center;
  min-width: 25px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(49, 95, 143, .18);
}

.bar-offset.negative {
  background: #9b6630;
}

.bar-offset.empty {
  visibility: hidden;
}

.bar {
  width: 100%;
  max-width: 31px;
  justify-self: center;
  border-radius: 9px 9px 3px 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32);
  transition: transform .12s ease, filter .12s ease;
}

.bar.low {
  background: linear-gradient(180deg, #db746d, var(--red));
}

.bar.mid {
  background: linear-gradient(180deg, #ecc45f, var(--amber));
}

.bar.high {
  background: linear-gradient(180deg, #48a873, var(--green));
}

.bar-day {
  align-self: start;
  justify-self: center;
  padding-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  font-weight: 850;
  text-align: center;
}

.bar-item:hover .bar {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.bar-item.selected .bar {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.bar-item.selected .bar-day {
  color: var(--blue);
  font-weight: 950;
}

.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin-top: 10px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.swatch.red {
  background: var(--red);
}

.swatch.amber {
  background: var(--amber);
}

.swatch.green {
  background: var(--green);
}

.offset-key {
  min-width: 24px;
  padding: 2px 4px;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.step-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.offset-card {
  display: grid;
  grid-template-columns: 250px minmax(480px, 1fr) 260px;
  gap: 22px;
  align-items: center;
  margin-top: 14px;
  padding: 16px 18px;
}

.selected-day,
.offset-result {
  display: grid;
  gap: 5px;
}

.selected-day {
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.selected-day strong,
.offset-result strong {
  font-size: 20px;
}

.selected-day > span:last-child,
.offset-result > span:last-of-type {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.offset-heading {
  align-items: flex-start;
  margin-bottom: 5px;
}

#offset-value {
  min-width: 76px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

#offset-slider {
  width: 100%;
  height: 28px;
  margin: 4px 0 0;
  accent-color: var(--blue);
}

.offset-ticks {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}

.offset-result {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.primary-button {
  min-height: 38px;
  margin-top: 5px;
  padding: 9px 13px;
  border: 1px solid var(--green);
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 17px rgba(31, 107, 70, .16);
}

.primary-button.saved {
  background: var(--green-strong);
}

.communications-section {
  margin-top: 17px;
}

.table-title {
  margin-bottom: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.client-card {
  overflow: hidden;
}

.table-toolbar {
  min-height: 46px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.select-all input,
.client-checkbox {
  accent-color: var(--green);
}

.client-table {
  max-height: 470px;
  overflow: auto;
}

.client-head,
.client-row {
  display: grid;
  grid-template-columns: 30px minmax(145px, .85fr) 50px 85px 102px 112px minmax(250px, 1.35fr);
  gap: 10px;
  align-items: center;
  min-width: 850px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
}

.client-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8faf8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.client-row {
  min-height: 58px;
  background: #fff;
  font-size: 13px;
}

.client-checkbox {
  width: 16px;
  height: 16px;
  justify-self: center;
}

.client-row:nth-child(odd) {
  background: #fbfcfb;
}

.client-name strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.client-name span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.age-cell {
  font-weight: 900;
}

.step-pill,
.contact-pill,
.recall-group {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
}

.step-pill,
.contact-pill {
  flex-direction: column;
  align-items: flex-start;
  white-space: nowrap;
}

.step-pill small,
.contact-pill small {
  margin-top: 1px;
  opacity: .72;
  font-size: 9px;
}

.step-pill.pre {
  color: #76510c;
  background: var(--amber-soft);
}

.step-pill.post {
  color: var(--blue);
  background: var(--blue-soft);
}

.contact-pill.sms {
  color: #1e6c4a;
  background: #e1f3e9;
}

.contact-pill.email {
  color: #315f8f;
  background: #e7f0fb;
}

.contact-pill.phone {
  color: #754a8f;
  background: #f0e7f7;
}

.contact-pill.post {
  color: #865e04;
  background: #fff0c7;
}

.recall-group {
  white-space: normal;
}

.recall-group.optical {
  color: #315f8f;
  background: #e7efff;
}

.recall-group.aud {
  color: #9c3d60;
  background: #ffe8ef;
}

.recall-group.cl {
  color: #2d714e;
  background: #e3f3ea;
}

.recall-group.diag {
  color: #865e04;
  background: #fff0c7;
}

.filters-card {
  max-height: 518px;
  overflow: auto;
}

.filter-head,
.filter-block {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.filter-head h2 {
  margin: 0;
}

.filter-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.filter-block-head h3 {
  margin: 0;
}

.range-value {
  color: var(--green);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.range-filter {
  position: relative;
  height: 52px;
  padding-top: 4px;
}

/* Inset by half the handle width so thumb outer edges align with card content. */
.range-slider {
  position: relative;
  height: 27px;
  margin: 0 13.5px;
}

.filter-track,
.filter-fill {
  height: 7px;
  border-radius: 999px;
}

.filter-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  background: #dfe5e1;
}

.filter-fill {
  position: absolute;
  top: 10px;
  background: var(--green);
}

.filter-handle {
  position: absolute;
  top: 0;
  width: 27px;
  height: 27px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 5px 12px rgba(31, 107, 70, .2);
  transform: translateX(-50%);
}

.filter-handle.min {
  left: 0;
}

.filter-handle.max {
  left: 100%;
}

.filter-labels {
  display: flex;
  justify-content: space-between;
  margin: 8px 13.5px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.category {
  border-bottom: 1px solid var(--line);
}

.category:last-child {
  border-bottom: 0;
}

.category summary {
  position: relative;
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 38px 0 14px;
  list-style: none;
  font-weight: 900;
  cursor: pointer;
}

.category summary.recall-category-summary {
  grid-template-columns: 20px 1fr auto;
}

.category summary input {
  margin: 0;
  accent-color: var(--green);
}

.category summary::-webkit-details-marker {
  display: none;
}

.category summary::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.category[open] summary::after {
  transform: rotate(225deg);
}

.category-count {
  color: var(--muted);
  font-size: 11px;
}

.option-list {
  display: grid;
  gap: 6px;
  padding: 0 14px 13px;
}

.option-list label {
  min-height: 32px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.option-list label > span:first-of-type {
  min-width: 0;
  line-height: 1.25;
}

.option-list label > span:last-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.option-list input {
  accent-color: var(--green);
}

@media (max-height: 900px) {
  .communications-chart {
    height: 270px;
  }

  .bar-plot {
    height: 258px;
  }

  .bar {
    max-height: 185px;
  }

  .client-table {
    max-height: 405px;
  }

  .filters-card {
    max-height: 453px;
  }
}


/* ---------- Login screen (merged from V2 so V4 is standalone) ---------- */
a { color: inherit; }

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.field select,
.field input {
  width: 100%;
  height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.login-page {
  min-width: 0;
  min-height: 100vh;
  display: block;
  padding: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(47, 122, 85, .13), transparent 27%),
    radial-gradient(circle at 84% 82%, rgba(49, 95, 143, .12), transparent 26%),
    var(--bg);
}

.login-page .top-nav {
  width: 100%;
  justify-self: stretch;
  align-self: start;
}

.login-main {
  width: 100%;
  min-height: calc(100vh - 62px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: 430px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 64px rgba(30, 40, 34, .12);
}

.login-card .primary-button {
  width: 100%;
  margin-top: 6px;
}

.login-help {
  margin: 14px 0 0;
  color: #9aa39d;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.login-help a {
  color: #7f9187;
  font-weight: 750;
  text-decoration: none;
}

.login-help a:hover {
  text-decoration: underline;
}

/* ---------- Working day / drop context strip ---------- */
.context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f7faf8);
  box-shadow: var(--shadow);
}

.context-bar .today {
  display: flex;
  align-items: center;
  gap: 10px;
}

.today-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.today-calendar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--green-strong);
}

.context-bar .today strong {
  font-size: 18px;
}

.context-bar .today span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drop-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

/* ---------- Status row (diary gappiness, recommendation, target) ---------- */
.status-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.status-tile {
  padding: 16px 18px;
}

.status-tile .eyebrow {
  display: block;
  margin-bottom: 8px;
}

.status-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
}

.status-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip.gappy {
  color: var(--red);
  background: var(--red-soft);
}

.status-chip.ideal {
  color: var(--green-strong);
  background: var(--green-soft);
}

.status-chip.full {
  color: #865e04;
  background: var(--amber-soft);
}

.status-tile .metric {
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.status-tile .metric small {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.status-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.4;
}

/* 7-day diary sparkline */
.spark {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  height: 60px;
  margin-top: 12px;
}

.spark .spark-day {
  display: grid;
  grid-template-rows: 1fr 14px;
  align-items: end;
  gap: 4px;
  text-align: center;
}

.spark .spark-bar {
  width: 100%;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #48a873, var(--green));
}

.spark .spark-bar.none {
  background: linear-gradient(180deg, #e3a7a2, var(--red));
}

.spark .spark-bar.low {
  background: linear-gradient(180deg, #ecc45f, var(--amber));
}

.spark label {
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
}

/* Recommended-release tile */
.reco {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reco-number {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(49, 95, 143, .22);
}

.reco-number.is-hold {
  width: auto;
  min-width: 64px;
  flex: 0 0 auto;
  padding: 8px 18px;
}

.reco-number b {
  font-size: 28px;
  line-height: 1;
}

.reco-number.is-hold b {
  letter-spacing: -.02em;
}

.reco-number span {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: .85;
}

/* Weekly target progress */
.target-bar {
  height: 12px;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: #e6ece8;
  overflow: hidden;
}

.target-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #48a873, var(--green-strong));
}

.target-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

/* ---------- Drop control (replaces the V3 offset slider) ---------- */
.drop-card {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) 280px;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
}

.drop-stepper-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.horizon-readout {
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.day-stepper {
  display: flex;
  gap: 8px;
}

.day-stepper button {
  flex: 1;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 950;
  line-height: 1;
  transition: border-color .12s ease, background .12s ease, transform .1s ease;
}

.day-stepper button small {
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.day-stepper button:hover {
  transform: translateY(-1px);
}

.day-stepper button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.day-stepper button.recommended::after {
  content: "Rec";
  margin-top: 2px;
  font-size: 8px;
  font-weight: 900;
  color: var(--blue);
}

.drop-hero {
  padding: 16px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.drop-hero .count {
  font-size: 46px;
  font-weight: 950;
  line-height: 1;
  color: var(--green-strong);
}

.drop-hero p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drop-hero .primary-button {
  width: 100%;
}

/* ---------- Queue chart states ---------- */
.bar.released {
  background: linear-gradient(180deg, #c7d2cb, #aab7b0);
  opacity: .65;
}

.bar.queued {
  background: linear-gradient(180deg, #d7e6dd, #b9d0c4);
  opacity: .8;
}

.bar-item.in-drop .bar {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.bar-item.in-drop .bar-day {
  color: var(--blue);
  font-weight: 950;
}

.bar-state {
  align-self: center;
  justify-self: center;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--blue);
}

.bar-state.muted {
  color: var(--muted);
}

.bar-state.empty {
  visibility: hidden;
}

.legend .pointer-key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 3px solid var(--blue);
}

.legend .released-key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #aab7b0;
}

/* ---------- Breakdown pills (drop composition) ---------- */
.breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.breakdown .chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  color: var(--ink);
}

.breakdown .chip b {
  font-weight: 950;
}

.breakdown .chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.sms { background: #1e6c4a; }
.dot.email { background: #315f8f; }
.dot.phone { background: #754a8f; }
.dot.post { background: #865e04; }

/* ---------- Confirmation screen ---------- */
.confirm-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.confirm-check {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 30px;
  font-weight: 900;
}

.confirm-hero h1 {
  margin: 0;
}

.confirm-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.summary-tile {
  padding: 16px 18px;
}

.summary-tile .eyebrow {
  display: block;
  margin-bottom: 8px;
}

.summary-tile .big {
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.summary-tile .big small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.audit-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: var(--blue-soft);
  color: #20405e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.ghost-button {
  min-height: 38px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ghost-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#pause-toggle .icon-play {
  display: none;
}

#pause-toggle[data-paused="true"] .icon-pause {
  display: none;
}

#pause-toggle[data-paused="true"] .icon-play {
  display: block;
}

a.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ---------- Gear / settings icon button ---------- */
.icon-ghost-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
}

.icon-ghost-button:hover {
  color: var(--ink);
  border-color: var(--green);
}

.icon-ghost-button svg {
  width: 19px;
  height: 19px;
}

/* ---------- Modal (weekly target settings) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 38, 31, .42);
  backdrop-filter: blur(2px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 540px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(20, 28, 22, .28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.modal-head p {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.modal-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--red);
}

.modal-body {
  padding: 6px 22px 4px;
  overflow-y: auto;
}

.target-list-head {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 12px;
  padding: 12px 4px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.target-row {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 12px;
  align-items: center;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
}

.target-branch {
  font-size: 14px;
  font-weight: 850;
}

.target-input {
  height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-align: right;
}

.target-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
}

.modal-hint {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .primary-button,
.modal-actions .ghost-button {
  margin-top: 0;
}

/* ---------- Settings modal: nav gear + sidebar (sync · targets · account) ---------- */
.nav-settings {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.nav-settings:hover {
  color: var(--green-strong);
  background: #eef7f2;
}

.nav-settings svg {
  width: 19px;
  height: 19px;
}

.modal.settings-modal {
  max-width: 720px;
}

.settings-layout {
  display: flex;
  flex: 1;
  min-height: 0;          /* allow the scrollable main pane to shrink */
}

.settings-sidebar {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 850;
  text-align: left;
}

.settings-tab svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.settings-tab:hover {
  background: #f1f5f2;
  color: var(--ink);
}

.settings-tab.is-active {
  background: var(--green-soft);
  color: var(--green-strong);
}

.settings-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px 22px 20px;
}

.settings-pane[hidden] {
  display: none;
}

.settings-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.sync-row:first-of-type {
  border-top: 0;
}

.sync-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sync-meta strong {
  font-size: 14px;
  font-weight: 850;
}

.sync-meta span {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.sync-btn {
  flex: 0 0 auto;
  margin-top: 0;
}

.sync-result {
  margin: 2px 0 6px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 12.5px;
  font-weight: 800;
}

.sync-result.error {
  background: var(--red-soft);
  color: var(--red);
}

.sync-result[hidden] {
  display: none;
}

.settings-pane .target-list {
  max-height: 46vh;
  overflow-y: auto;
}

.pane-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pane-actions .primary-button {
  margin-top: 0;
}

.account-email {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
  font-size: 14px;
  font-weight: 850;
}

/* ---------- Manual diary-status band selector (set by booking team) ---------- */
.band-select {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.band-select button {
  flex: 1;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 950;
  line-height: 1.05;
  transition: border-color .12s ease, background .12s ease, transform .1s ease;
}

.band-select button small {
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.band-select button:hover {
  transform: translateY(-1px);
}

.band-select button.active[data-band="gappy"] {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.band-select button.active[data-band="ideal"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
}

.band-select button.active[data-band="full"] {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #865e04;
}

.band-select button.active small {
  color: inherit;
  opacity: .85;
}

.source-note {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  font-style: italic;
}

/* ---------- Estate overview ---------- */
.estate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.estate-toolbar .run-stat {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.estate-toolbar .run-stat b {
  color: var(--ink);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-controls label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.toolbar-controls select {
  height: 38px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.estate-card {
  overflow: hidden;
}

.estate-head,
.estate-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) 168px 78px 132px 132px 188px 86px 26px;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.estate-head {
  background: #f8faf8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.estate-row {
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: background .12s ease;
}

.estate-row:nth-child(even) {
  background: #fbfcfb;
}

.estate-row:hover {
  background: #eef7f2;
}

.estate-row:last-child {
  border-bottom: 0;
}

.estate-branch strong {
  display: block;
  font-size: 14px;
}

.estate-branch span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.estate-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.estate-status small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rec-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.rec-pill.hold {
  background: #eef0ee;
  color: var(--muted);
}

.drop-comms {
  font-size: 18px;
  font-weight: 950;
}

.drop-comms small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.drop-comms.none {
  color: var(--muted);
  font-size: 15px;
}

.today-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.today-pill.pending {
  background: #f1f4f1;
  color: var(--muted);
}

.today-pill.done {
  background: var(--green-soft);
  color: var(--green-strong);
}

.today-pill.hold {
  background: var(--amber-soft);
  color: #865e04;
}

.mini-target {
  display: grid;
  gap: 4px;
}

.mini-bar {
  height: 8px;
  border-radius: 999px;
  background: #e6ece8;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #48a873, var(--green-strong));
}

.mini-target span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.estate-last {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.estate-row .chev {
  justify-self: end;
  color: var(--muted);
  font-weight: 900;
}

.summary-tile .big.red { color: var(--red); }
.summary-tile .big.green { color: var(--green-strong); }
.summary-tile .big.amber { color: #865e04; }

/* ---------- Branch pause / hold ---------- */
.status-chip.paused {
  background: #eceeed;
  color: #5d6862;
}

.today-pill.paused {
  background: #eceeed;
  color: #5d6862;
}

.estate-row.is-paused {
  background: #fafbfa;
}

.estate-row.is-paused .estate-branch strong,
.estate-row.is-paused .drop-comms {
  color: #8a938d;
}

.pause-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 13px 18px;
  border: 1px solid #e3d6b5;
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: var(--amber-soft);
  color: #76510c;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.pause-banner[hidden] {
  display: none;
}

.pause-banner .primary-button {
  flex: 0 0 auto;
  margin: 0;
}

.primary-button.disabled,
.primary-button[aria-disabled="true"] {
  pointer-events: none;
  color: #8b948f;
  background: #e8ece8;
  border-color: #d7ded8;
  box-shadow: none;
}

/* ---------- Tooltips (CSS-only, no JS) ---------- */
/* Add data-tip="..." to any element to give it a hover/focus tooltip. */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 260px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: .1px;
  text-align: left;
  white-space: normal;
  text-transform: none;
  box-shadow: 0 12px 28px rgba(30, 40, 34, .26);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Help-icon tooltips drop below-right so a top-right placement never clips. */
.help-icon[data-tip]::after {
  bottom: auto;
  top: calc(100% + 9px);
  left: auto;
  right: 0;
  transform: translateX(0) translateY(-4px);
}

.help-icon[data-tip]:hover::after,
.help-icon[data-tip]:focus-visible::after {
  transform: translateX(0) translateY(0);
}

/* The small ⓘ / ? affordance */
.help-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  cursor: help;
}

.help-icon:hover,
.help-icon:focus-visible {
  color: var(--green-strong);
  border-color: rgba(47, 122, 85, .35);
  background: #f1f8f4;
  outline: none;
}

/* Card header row: title/eyebrow left, help icon top-right */
.tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tile-head .eyebrow {
  margin: 0;
}

.tile-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tile-head .icon-ghost-button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.tile-head .icon-ghost-button svg {
  width: 16px;
  height: 16px;
}

/* a dotted underline hint that an inline label carries a tooltip */
.has-tip {
  text-decoration: underline dotted var(--line);
  text-underline-offset: 3px;
  cursor: help;
}
