/* ═══════════════════════════════════════════════════════════════════
   ACCOUNTS-BOARD.CSS: the Accounts Weekly board and Test Mode, for accounts-board.js.
   One sheet for both hosts, and not a twin (FIXES_QUEUE #60), as with map-shared.css:
   in portal.css it would add about 25 KB to every technician's stylesheet. The hub has
   an ordinary link, right after style.css, so nothing flashes. The portal loads it
   before the board's first draw, for a manager only (_abEnsureCss), and draws nothing
   until it has. Everything down to THE MANAGER'S BOARD came out of style.css as it
   stood, in the same order. No other hub page uses these rules.
   ═══════════════════════════════════════════════════════════════════ */

/* Hide subtitle on weekly view to save space */
#view-weekly .subtitle { display: none; }

/* ── Weekly tech tabs (jump-to-column shortcuts) ── */
.weekly-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 13px 5px 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.weekly-tab:hover {
  background: color-mix(in srgb, var(--tech-color, var(--accent)) 12%, var(--bg3));
  border-color: color-mix(in srgb, var(--tech-color, var(--accent)) 60%, transparent);
  color: var(--text);
}
.weekly-tab-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tech-color, linear-gradient(135deg, var(--accent), var(--accent2)));
  box-shadow: 0 0 6px color-mix(in srgb, var(--tech-color, transparent) 45%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.weekly-tab-meta {
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: .7rem;
  font-weight: 500;
  color: var(--text2);
}

/* ── KANBAN BOARD ── */
/* Only flex when this view is actually active */
#view-weekly.active {
  display: flex;
  flex-direction: column;
}
#view-weekly {
  /* Fit exactly inside .main-content's visible area (100vh − top-nav − padding-top).
     Padding-top is now 16px (compacted global), kept in sync below. */
  height: calc(100vh - var(--top-nav-h) - 16px);
  overflow-y: clip;
  overflow-x: visible;
}

/* Middle-mouse drag: cursor hint */
#kanban-scroll-wrapper.mm-dragging,
#tp-top-kanban.mm-dragging {
  cursor: grabbing !important;
  user-select: none;
}

#weekly-content {
  height: 100%;
}

#kanban-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-height: 180px;
  width: 100vw;
  margin-left: -40px;
  padding-left: 40px;
}

.kanban-board {
  display: flex;
  gap: 14px;
  align-items: stretch;
  height: 100%;
  padding-right: 200px;
}

/* Per-column scrollable body */
.kanban-col-body {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--tech-color, var(--accent)) transparent;
}
.kanban-col-body::-webkit-scrollbar {
  width: 4px;
}
.kanban-col-body::-webkit-scrollbar-thumb {
  background: var(--tech-color, var(--accent));
  border-radius: 4px;
}

.kanban-col {
  flex-shrink: 0;
  width: 190px;
  /* Subtle whole-column tint: a soft top-down gradient from the tech color
     into the base surface. Default falls back to the original surface. */
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--tech-color, transparent) 8%, var(--surface)) 0%,
      color-mix(in srgb, var(--tech-color, transparent) 3%, var(--surface)) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--tech-color, var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kanban-col-unassigned {
  opacity: .75;
  border-style: dashed;
  border-top: 1px dashed var(--border);
  background: var(--surface);
}

.kanban-col-header[draggable="true"] {
  cursor: grab;
}
.kanban-col-header[draggable="true"]:active {
  cursor: grabbing;
}

.kanban-col.col-drop-left  { border-left:  3px solid var(--tech-color, var(--accent)); }
.kanban-col.col-drop-right { border-right: 3px solid var(--tech-color, var(--accent)); }

.kanban-col-header {
  /* Glowing diagonal sweep in the tech color — replaces the old purple accent. */
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--tech-color, var(--accent)) 22%, transparent) 0%,
      color-mix(in srgb, var(--tech-color, var(--accent2)) 8%, transparent) 100%);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--tech-color, var(--border)) 25%, transparent);
  position: sticky;
  top: 0;
  z-index: 2;
}

.kanban-col-unassigned .kanban-col-header {
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid var(--border);
}

.kanban-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tech-color, linear-gradient(135deg, var(--accent), var(--accent2)));
  box-shadow: 0 0 10px color-mix(in srgb, var(--tech-color, var(--accent)) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.kanban-col-unassigned .kanban-avatar {
  background: var(--surface2);
  color: var(--text2);
  box-shadow: none;
}

.kanban-col-name {
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-col-sub {
  font-size: .7rem;
  color: var(--text2);
  margin-top: 2px;
}

/* ── Day lanes ── */
.kanban-lane {
  /* Subtle diagonal glow in the tech color, mirroring the column header but
     much softer — gives each day card a sleek, cohesive identity. */
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--tech-color, transparent) 7%, transparent) 0%,
      transparent 65%);
  border-bottom: 1px solid color-mix(in srgb, var(--tech-color, var(--border)) 18%, var(--border));
  transition: background var(--trans);
  cursor: default;
}

.kanban-lane:last-child {
  border-bottom: none;
}

.kanban-lane.drag-over {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--tech-color, var(--accent)) 22%, transparent) 0%,
      color-mix(in srgb, var(--tech-color, var(--accent)) 6%, transparent) 70%);
}

.kanban-lane-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: color-mix(in srgb, var(--tech-color, var(--text2)) 70%, var(--text));
  padding: 7px 10px 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-lane-hrs {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: color-mix(in srgb, var(--tech-color, #fff) 30%, #fff);
  background: color-mix(in srgb, var(--tech-color, rgba(255,255,255,.08)) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--tech-color, transparent) 30%, transparent);
  padding: 1px 6px;
  border-radius: 10px;
  opacity: .92;
}

.kanban-lane.drag-over .kanban-lane-label {
  color: var(--tech-color, var(--accent2));
}

/* Unassigned column keeps the neutral look — strip tech-color tints */
.kanban-col-unassigned .kanban-lane {
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.kanban-col-unassigned .kanban-lane-label {
  color: var(--text2);
}
.kanban-col-unassigned .kanban-lane-hrs {
  background: rgba(255,255,255,.08);
  border-color: transparent;
  color: rgba(255,255,255,.75);
}

.kanban-lane-cards {
  padding: 3px 8px 8px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Cards ── */
.kanban-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
  transition: border-color var(--trans), box-shadow var(--trans), opacity var(--trans), transform var(--trans);
  gap: 6px;
  position: relative;
}

.kanban-card.drag-above {
  border-top: 2px solid var(--accent);
}

.kanban-card.drag-below {
  border-bottom: 2px solid var(--accent);
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(108, 99, 255, .25);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: .3;
  cursor: grabbing;
  transform: scale(.97);
}

.kanban-card-name {
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.kanban-card-hrs {
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent2);
  flex-shrink: 0;
  background: rgba(167, 139, 250, .12);
  padding: 2px 6px;
  border-radius: 99px;
}

/* A client on a person who is not on the board, drawn in Unassigned (Operation Steel 5):
   the name it still carries, on a line of its own under the name. */
.kanban-card-orphan { flex-wrap: wrap; }
.kanban-card-note,
.tp-card-note {
  flex-basis: 100%;
  min-width: 0;
  font-size: .66rem;
  font-weight: 500;
  color: var(--warning);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-card-orphan { flex-wrap: wrap; }

/* H.1 — admin kanban card text stack (name on top, time subtitle below) */
.kanban-card-textstack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 1px;
  line-height: 1.2;
}
.kanban-card-time {
  font-size: .66rem;
  font-weight: 400;
  color: var(--accent);
  white-space: nowrap;
}

/* Accounts Weekly: tech jump dropdown (mobile only). Hidden by default
   on desktop where the full pill bar is used; shown on narrow viewports
   where the pill bar wraps onto multiple lines and eats screen space.
   Box dimensions + border tuned to match .tp-search-input so the two
   controls line up visually in the header. */
/* iOS Safari + Chrome both inject a min-height / extra chrome on
   <select> that ignores padding-based sizing. Force explicit height,
   strip native appearance with prefixes. The caret is the house arrow
   (HOUSE DROP-DOWN at the top of style.css and portal.css, the two
   sheets this one rides beside), so it matches every other drop-down. */
select.aw-tech-jump {
  display: none;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box;
  height: 34px;                  /* match the search input rendered height */
  min-width: 120px;
  padding: 0 28px 0 12px;        /* zero vertical padding — height drives it */
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.15);
  background-color: rgba(255,255,255,.06);
  color: var(--text);
  font-size: .8rem;
  line-height: 34px;             /* center option text vertically */
  cursor: pointer;
  outline: none;
  transition: border-color .15s, background .15s;
}
select.aw-tech-jump:focus {
  border-color: rgba(167,139,250,.5);
  background-color: rgba(255,255,255,.09);
}
/* Belt-and-suspenders: also override on the bare class in case
   anything else fights the select selector. */
.aw-tech-jump { height: 34px; }
@media (max-width: 768px) {
  select.aw-tech-jump { display: inline-block !important; }
  #weekly-tech-tabs { display: none !important; }
  /* Force matching heights on mobile — iOS Safari ignores padding on
     <select> and ends up taller than <input> by default. */
  #aw-search-input,
  select.aw-tech-jump { height: 36px !important; }
  select.aw-tech-jump { line-height: 36px; }
}

/* ── EOW card styles ── */
.kanban-card.kanban-card-eow-off {
  opacity: .4;
  padding: 3px 9px;
  min-height: 0;
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.06);
  cursor: default;
}
.kanban-card.kanban-card-eow-off:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255,255,255,.1);
}
.kanban-card.kanban-card-eow-off .kanban-card-name {
  font-size: .72rem;
}

.kanban-eow-badge {
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  flex-shrink: 0;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.kanban-eow-badge.eow-off {
  background: rgba(148,163,184,.15);
  color: #94a3b8;
}
.kanban-eow-badge.eow-on {
  background: rgba(56,189,248,.12);
  color: #38bdf8;
}

/* ── Accounts Weekly week badge ── */
.aw-week-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.aw-week-badge-1 {
  background: rgba(56,189,248,.15);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,.25);
}
.aw-week-badge-2 {
  background: rgba(251,191,36,.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,.25);
}

/* ── Drop hint ── */
.kanban-drop-hint {
  font-size: .7rem;
  color: var(--text2);
  opacity: 0;
  text-align: center;
  padding: 2px 0;
  transition: opacity var(--trans);
  pointer-events: none;
}

.kanban-lane.drag-over .kanban-drop-hint {
  opacity: .7;
  color: var(--accent2);
}

/* ═══════════════════════════════════════════
   ROUTE PLANNER (TEST MODE)
═══════════════════════════════════════════ */
#test-planner-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  /* TEST MODE — deliberately tinted pink + framed so it is unmistakable
     against the live Accounts Weekly board and can't be confused. */
  background:
    linear-gradient(rgba(255, 20, 147, .06), rgba(255, 20, 147, .06)),
    var(--bg);
  box-shadow: inset 0 0 0 3px rgba(255, 20, 147, .5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  /* Pink-tinted banner so the top bar reads "test mode" at a glance. */
  background:
    linear-gradient(rgba(255, 20, 147, .12), rgba(255, 20, 147, .12)),
    var(--bg2);
  border-bottom: 2px solid rgba(255, 20, 147, .45);
  flex-shrink: 0;
  gap: 16px;
}

.tp-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text2);
}

.tp-badge {
  background: #FF1493;
  color: #fff;
  border: 1px solid rgba(255, 20, 147, .5);
  box-shadow: 0 0 0 3px rgba(255, 20, 147, .18);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tp-close {
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .25);
  color: var(--danger);
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans);
  flex-shrink: 0;
}

.tp-close:hover {
  background: rgba(239, 68, 68, .22);
}

/* ── Body ── */
.tp-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top section — fills entire body. Faint pink wash keeps the TEST MODE
   tint visible behind the board instead of being covered by --bg2. */
.tp-top-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 20, 147, .04), rgba(255, 20, 147, .04)),
    var(--bg2);
}


/* ── Section labels ── */
.tp-section-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text2);
  padding: 8px 14px 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.tp-section-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  opacity: .7;
}

/* ── Kanban boards ── */
.tp-top-kanban {
  flex: 1;
  display: flex;
  align-items: flex-start;
  /* columns sit at top, don't stretch full height */
  gap: 8px;
  overflow-x: auto;
  /* scroll left-right when many techs */
  overflow-y: hidden;
  padding: 10px 12px;
}

.tp-bottom-kanban {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* ── Columns ── */
.tp-col {
  flex-shrink: 0;
  width: 190px;
  max-height: 100%;
  /* cap column to container height … */
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--tech-color, transparent) 8%, var(--bg3)) 0%,
      color-mix(in srgb, var(--tech-color, transparent) 3%, var(--bg3)) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--tech-color, var(--accent));
  border-radius: var(--radius-sm);
  overflow-y: auto;
  /* … then scroll vertically inside */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--tech-color, var(--accent)) transparent;
}
.tp-col::-webkit-scrollbar { width: 4px; }
.tp-col::-webkit-scrollbar-thumb { background: var(--tech-color, var(--accent)); border-radius: 4px; }

.tp-col-unassigned {
  opacity: .8;
  border-top: 1px dashed var(--border);
  background: var(--bg3);
}

.tp-route-col {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
}

.tp-col-header {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--tech-color, var(--accent)) 22%, transparent) 0%,
      color-mix(in srgb, var(--tech-color, var(--accent2)) 8%, transparent) 100%);
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--tech-color, var(--border)) 25%, transparent);
  flex-shrink: 0;
}
.tp-col-unassigned .tp-col-header {
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid var(--border);
}

.tp-route-header {
  background: rgba(255, 20, 147, .08);
  border-bottom-color: var(--border2);
}

.tp-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tech-color, linear-gradient(135deg, var(--accent), var(--accent2)));
  box-shadow: 0 0 8px color-mix(in srgb, var(--tech-color, transparent) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.tp-col-unassigned .tp-avatar {
  background: var(--surface2);
  color: var(--text2);
  box-shadow: none;
}

.tp-col-meta {
  flex: 1;
  min-width: 0;
}

.tp-col-name {
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Lanes ── */
.tp-lane {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--tech-color, transparent) 7%, transparent) 0%,
      transparent 65%);
  border-bottom: 1px solid color-mix(in srgb, var(--tech-color, var(--border)) 18%, var(--border));
  transition: background var(--trans);
}
.tp-col-unassigned .tp-lane {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.tp-lane:last-child {
  border-bottom: none;
}

.tp-lane.tp-drag-over {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--tech-color, var(--accent)) 22%, transparent) 0%,
      color-mix(in srgb, var(--tech-color, var(--accent)) 6%, transparent) 70%);
}

.tp-lane-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: color-mix(in srgb, var(--tech-color, var(--text2)) 70%, var(--text));
  padding: 5px 8px 2px;
}
.tp-col-unassigned .tp-lane-label {
  color: var(--text2);
}

.tp-lane.tp-drag-over .tp-lane-label {
  color: var(--tech-color, var(--accent2));
}

.tp-lane-cards {
  padding: 2px 6px 6px;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Cards ── */
.tp-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: grab;
  user-select: none;
  transition: border-color var(--trans), box-shadow var(--trans), opacity var(--trans);
  font-size: .78rem;
}

.tp-card:hover {
  border-color: color-mix(in srgb, var(--tech-color, var(--accent)) 60%, var(--border));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--tech-color, var(--accent)) 30%, transparent);
}

.tp-card.tp-dragging {
  opacity: .3;
  cursor: grabbing;
}

.tp-card-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

/* A moved EOW card has a pill, the hours and the restore arrow beside its name,
   which left the name about 45 px. The name takes the first line whole. */
.tp-card-two-lines { flex-wrap: wrap; }
.tp-card-two-lines .tp-card-name { flex-basis: 100%; }
.tp-card-two-lines .tp-reset-btn { margin-left: auto; }

.tp-card-hrs {
  font-size: .7rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--tech-color, var(--accent2)) 35%, #fff);
  background: color-mix(in srgb, var(--tech-color, var(--accent2)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tech-color, transparent) 28%, transparent);
  padding: 1px 5px;
  border-radius: 99px;
  flex-shrink: 0;
}

/* ── Drop hint ── */
.tp-drop-hint {
  font-size: .68rem;
  color: var(--text3);
  opacity: 0;
  text-align: center;
  padding: 2px 0;
  pointer-events: none;
  transition: opacity var(--trans);
}

.tp-lane.tp-drag-over .tp-drop-hint {
  opacity: .8;
  color: var(--tech-color, var(--accent2));
}

/* ── Legend ── */
.tp-map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tp-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .73rem;
  color: var(--text2);
  font-weight: 500;
}

.tp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── TP Header Actions ────────────────────────────────────── */
.tp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tp-action-btn {
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid;
  transition: background var(--trans), color var(--trans);
}
.tp-reset-all-btn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
  color: var(--text2);
}
.tp-reset-all-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.tp-apply-btn {
  background: rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.35);
  color: #4ade80;
}
.tp-apply-btn:hover { background: rgba(34,197,94,.25); }
.tp-apply-btn:disabled { background: rgba(34,197,94,.15); opacity: .7; cursor: default; }

/* ── Ghost cards (source of moved clients) ───────────────── */
.tp-ghost-card {
  opacity: .55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  border: 1px dashed rgba(255,255,255,.18);
  margin-bottom: 3px;
  cursor: default;
}
.tp-ghost-name {
  text-decoration: line-through;
  font-size: .72rem;
  color: var(--text2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-reset-btn {
  font-size: .78rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text2);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.4;
  transition: background .12s;
}
.tp-reset-btn:hover { background: rgba(255,255,255,.18); color: var(--text); }

/* ── Moved card ──────────────────────────────────────────── */
.tp-moved-card {
  border-left: 3px solid currentColor;
}

/* ── Mini-map floating ───────────────────────────────────── */
.tp-mini-map {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 290px;
  height: 230px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: var(--bg2);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 9100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tp-mini-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.tp-mini-map-title {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .5px;
}
.tp-mini-map-expand {
  font-size: .9rem;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
.tp-mini-map-expand:hover { color: var(--text); background: rgba(255,255,255,.08); }

/* ── Apply Changes Modal ─────────────────────────────────── */
.tp-apply-modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 32px 28px 24px;
  max-width: 440px;
  width: 90%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.tp-apply-icon { font-size: 2.2rem; margin-bottom: 12px; }
.tp-apply-modal h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.tp-apply-modal p { color: var(--text2); font-size: .88rem; margin-bottom: 10px; line-height: 1.5; }
/* Every planned move, from and to. It scrolls inside the dialog, and gives up
   its height first, so the buttons stay on screen with dozens of moves. */
.tp-apply-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 6px 10px;
  flex: 0 1 auto;
  min-height: 56px;
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tp-apply-list li { padding: 3px 0; overflow-wrap: anywhere; }
.tp-apply-btns {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* ── Compact ghost card (source placeholder) ─────────────── */
.tp-ghost-compact {
  padding: 2px 6px;
  min-height: unset;
  gap: 4px;
  margin-bottom: 2px;
  border-width: 1px;
}
.tp-ghost-compact .tp-ghost-name {
  font-size: .65rem;
}

/* ── Open Map button — centered in TP header ─────────────── */
.tp-map-open-btn {
  background: rgba(96,165,250,.12);
  border-color: rgba(96,165,250,.30);
  color: #60a5fa;
  margin: 0 auto;
}
.tp-map-open-btn:hover { background: rgba(96,165,250,.22); }

/* ── TP client search ─────────────────────────────────────── */
.tp-search-wrap {
  position: relative;
  flex: 0 0 200px;
}
.tp-search-input {
  width: 100%;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: .8rem;
  outline: none;
  transition: border-color .15s, background .15s;
}
.tp-search-input:focus {
  border-color: rgba(167,139,250,.5);
  background: rgba(255,255,255,.09);
}
.tp-search-input::placeholder { color: var(--text2); }

/* ── Pulsing highlighted card ─────────────────────────────── */
@keyframes tp-pulse-card {
  0%,100% { box-shadow: 0 0 0 2px #a78bfa; background: rgba(167,139,250,.15); }
  50%      { box-shadow: 0 0 0 5px rgba(167,139,250,.25); background: rgba(167,139,250,.28); }
}
.tp-highlighted {
  border-left: 3px solid #a78bfa !important;
  animation: tp-pulse-card 1.1s ease-in-out infinite;
  cursor: pointer;
}

/* ── Accounts Weekly highlighted card ────────────────────── */
@keyframes aw-pulse-card {
  0%,100% { box-shadow: 0 0 0 2px #a78bfa; background: rgba(167,139,250,.15); }
  50%      { box-shadow: 0 0 0 5px rgba(167,139,250,.25); background: rgba(167,139,250,.28); }
}
.kanban-card.aw-highlighted {
  border-left: 3px solid #a78bfa !important;
  animation: aw-pulse-card 1.1s ease-in-out infinite;
  cursor: pointer;
}

/* ── UNDO TOAST ─────────────────────────────── */
#aw-undo-toast {
  display: none;
  position: fixed;
  top: calc(var(--top-nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  backdrop-filter: blur(14px);
  padding: 8px 16px;
  font-size: .82rem;
  color: var(--text);
  white-space: nowrap;
  z-index: 500;
}
#aw-undo-btn {
  background: rgba(124,58,237,.18);
  border: 1px solid rgba(124,58,237,.4);
  color: var(--accent2);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 600;
  padding: 3px 12px;
  cursor: pointer;
  font-family: inherit;
}
#aw-undo-btn:hover { background: rgba(124,58,237,.3); }
/* A bar with notes on the move: the lines under the label, the button beside them. */
#aw-undo-notes {
  grid-column: 1;
  grid-row: 2;
  margin-top: 3px;
  white-space: normal;
  max-width: min(420px, 70vw);
  font-size: .74rem;
  color: #fbbf24;
  line-height: 1.3;
}
#aw-undo-toast:has(#aw-undo-notes) { grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; row-gap: 0; }
/* Centred from the middle of the screen, the bar with notes would shrink to half a phone's
   width: it takes the width its words need instead, never past the screen less a margin.
   A desktop is wide enough that this changes nothing there. */
#aw-undo-toast:has(#aw-undo-notes) { width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; }
#aw-undo-toast:has(#aw-undo-notes) #aw-undo-label { grid-column: 1; grid-row: 1; white-space: normal; }
#aw-undo-toast:has(#aw-undo-notes) #aw-undo-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
/* The hub's "Add to <name>'s time off", under the "needs coverage" note it acts on. */
#aw-undo-cover {
  display: block;
  margin-top: 5px;
  background: rgba(251,191,36,.14);
  border: 1px solid rgba(251,191,36,.45);
  color: #fbbf24;
  border-radius: var(--radius-sm);
  font-size: .74rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  max-width: 100%;
  text-align: left;
}
#aw-undo-cover:hover { background: rgba(251,191,36,.26); }
/* The portal has no hub top bar to sit under. */
.pm-mgr-desktop #aw-undo-toast { top: 66px; }
/* Test Mode's Apply dialog: the notes under a planned move. */
.tp-apply-note { margin-top: 2px; font-size: .74rem; color: #fbbf24; line-height: 1.3; }

/* ═══════════════════════════════════════════════════════════
   ACCOUNTS WEEKLY — Custom autocomplete + mobile fixes
   ═══════════════════════════════════════════════════════════ */

/* Custom suggestion dropdown */
.aw-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 200;
  overflow: hidden;
}
.aw-suggestion-item {
  padding: 11px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text1);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.aw-suggestion-item:last-child { border-bottom: none; }
.aw-suggestion-item:active,
.aw-suggestion-item:hover { background: var(--accent-soft, rgba(99,102,241,0.12)); }

@media (max-width: 768px) {
  /* Horizontal scroll with snap — each column is phone-width */
  .kanban-board {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    display: flex !important;
    flex-wrap: nowrap !important;
    padding-bottom: 12px;
  }
  .kanban-col {
    scroll-snap-align: start;
    min-width: calc(100vw - 48px);
    flex-shrink: 0;
  }
}
@media (max-width: 480px) {
  /* Kanban columns: fully full-width */
  .kanban-col {
    min-width: calc(100vw - 32px);
  }
}
@media (max-width: 768px) {
  /* Prevent iOS zoom on Accounts Weekly search input */
  #aw-search-input {
    font-size: 16px;
  }
  #view-weekly { height: calc(100dvh - var(--top-nav-h) - var(--safe-top) - 12px); }
  /* The kanban wrapper's full-bleed was tuned for the desktop 40px gutter;
     the phone gutter is 16px — realign so the board isn't shoved off-edge. */
  #kanban-scroll-wrapper { margin-left: -16px; padding-left: 16px; }
  /* Horizontal strips: edge-bounce stays local instead of dragging the page
     sideways or chaining up. */
  .kanban-board,
  #kanban-scroll-wrapper { overscroll-behavior-x: contain; }
}

/* ═══════════════════════════════════════════════════════════════════
   THE MANAGER'S BOARD (the portal only: nothing on the hub matches these).
   The portal's own colours, plus the few names only the hub's stylesheet defines,
   at the hub's values.
   ═══════════════════════════════════════════════════════════════════ */
#portal-panel-aw,
.pm-aw-carousel {
  --warning: #F59E0B;
  --surface2: rgba(255, 255, 255, 0.07);
  --text3: #5E5F78;
}

/* The page: one column, the board taking what the head leaves. */
.mgr-aw-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.mgr-aw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-bottom: 8px;
}
.mgr-aw-title { min-width: 0; }
.mgr-aw-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
}
.mgr-aw-sub {
  font-size: .76rem;
  color: var(--text2);
  margin-top: 2px;
}
.mgr-aw-readonly {
  font-size: .72rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

/* style.css sets this on every input; portal.css does not. */
#portal-panel-aw .tp-search-input { font-family: inherit; }

/* The chips row: the hub's look, with its inline styles here. */
#portal-panel-aw #weekly-tech-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-bottom: 8px;
}

/* The hub's board runs edge to edge under its gutters. This one stays in its panel. */
#portal-panel-aw #kanban-scroll-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin-left: 0;
  padding-left: 0;
  padding-bottom: 8px;
}
#portal-panel-aw .kanban-board { padding-right: 14px; }
/* The bar under the board, dark as the rest of the portal's. */
#portal-panel-aw #kanban-scroll-wrapper {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) rgba(255,255,255,.04);
}
#portal-panel-aw #kanban-scroll-wrapper::-webkit-scrollbar { height: 8px; }
#portal-panel-aw #kanban-scroll-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 4px; }
#portal-panel-aw #kanban-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }

/* Nothing here can be picked up. */
.kanban-board-readonly .kanban-card,
.pm-aw-slide .kanban-card { cursor: pointer; }
/* ...and on a board that moves, a card the trial holds back. */
.kanban-card-still { cursor: pointer; }

/* The phone carousel: one column to a slide, the whole width of the phone. The column
   body scrolls under its header, as on the hub. */
.pm-aw-slide { overflow: hidden; }
.pm-aw-slide .kanban-col {
  width: 100%;
  min-width: 0;
  height: 100%;
  scroll-snap-align: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
  /* No live blur on a phone: it changes no pixel here, and a card's popup would blur a
     blurred backdrop, the shape portal.css's note at #unable-popup-overlay calls a known
     Android WebView crash. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.pm-aw-slide .kanban-col-header { padding: 14px 16px 12px; }
.pm-aw-slide .kanban-avatar { width: 40px; height: 40px; font-size: .82rem; }
.pm-aw-slide .kanban-col-name { font-size: .95rem; }
.pm-aw-slide .kanban-col-sub { font-size: .72rem; }
.pm-aw-slide .kanban-col-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pm-aw-slide .kanban-lane-label { padding: 9px 14px 4px; font-size: .68rem; }
.pm-aw-slide .kanban-lane-cards { padding: 3px 12px 10px; min-height: 12px; gap: 6px; }
.pm-aw-slide .kanban-card { padding: 12px 14px; border-radius: 10px; }
.pm-aw-slide .kanban-card:active { border-color: var(--accent2); }
.pm-aw-slide .kanban-card-name { font-size: .88rem; white-space: normal; }
.pm-aw-slide .kanban-card-hrs { font-size: .78rem; }
.pm-subpage-title .aw-week-badge { margin-left: 6px; display: inline-block; white-space: nowrap; }

/* The phone's row: who, and Find client, half each, so the box costs the column no
   height. The list takes the whole width, for a long name. Two equal grid columns,
   not flex: 1 1 0, because a flex item can't shrink below its own padding, so the
   drop-down's room for the house arrow (style.css / portal.css HOUSE DROP-DOWN)
   was added on top of its half and Find client lost it (cut off at 320). */
.pm-aw-pills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pm-aw-pills .pm-aw-select { width: auto; min-width: 0; }
.pm-aw-search { min-width: 0; position: relative; }
/* 16 px, so iOS doesn't zoom the page on focus, as the Log's boxes hold it. Only the
   words in an empty box stay small, so they fit half a 320 px phone. */
.pm-aw-search .tp-search-input {
  height: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}
.pm-aw-search .tp-search-input::placeholder { font-size: .9rem; }
.pm-aw-search .aw-suggestions {
  left: auto;
  width: calc(100vw - 32px);
  max-height: 45vh;
  overflow-y: auto;
}

/* A short window: a phone held sideways. Past 768 px wide that is the desktop shell,
   and the store apps can open that way too. The cards keep the height: the line under
   the title and the chips go (a sideways swipe reaches every column), and the column
   heads tighten, on the phone's slides too. */
@media (max-height: 500px) {
  .mgr-aw-sub,
  #portal-panel-aw #weekly-tech-tabs { display: none; }
  .mgr-aw-head { margin-bottom: 4px; }
  #portal-panel-aw .kanban-col-header,
  .pm-aw-slide .kanban-col-header { padding: 6px 12px; }
  #portal-panel-aw .kanban-avatar,
  .pm-aw-slide .kanban-avatar { width: 28px; height: 28px; font-size: .65rem; }
  /* The panel clips what runs past it, so Find client's list scrolls inside it. */
  #portal-panel-aw .aw-suggestions { max-height: 40vh; overflow-y: auto; }
}

/* A finger on the desktop page: a phone held sideways, or a tablet. The same two things
   as the phone's slide: no live blur, and a box iOS won't zoom on, at the height it had,
   so the larger words cost the column no cards. */
@media (pointer: coarse) {
  #portal-panel-aw .kanban-col { backdrop-filter: none; -webkit-backdrop-filter: none; }
  #portal-panel-aw .tp-search-input { font-size: 16px; padding-top: 4.5px; padding-bottom: 4.5px; }
}
