/* THE PIPELINE'S NEW TOP (19 Nov 2026, a PREVIEW — public/lore-pipeline-top.js). Every rule is under html.pl-top,
   which only that file sets, and only where the preview switch is on; with it off nothing here applies.
   Shared tokens only (styles.css / polish.css). */

/* The old rows: what was in them now lives in the bands; the rows themselves step out. */
html.pl-top .page-toolbar > .tb-row1,
html.pl-top .page-toolbar > .toolbar-filters { display: none !important; }
html.pl-top .page-toolbar { padding: var(--space-2, 8px) var(--space-4, 16px); gap: 0; }

html.pl-top .pl-top-wrap { display: flex; flex-direction: column; gap: var(--space-2, 8px); position: relative; }
html.pl-top .pt-band { display: flex; align-items: center; gap: var(--space-2, 8px); min-width: 0; }

/* Band 1 — the search takes the room; the three controls sit at its right. */
html.pl-top .pt-search { flex: 1 1 auto; min-width: 0; display: flex; }
html.pl-top .pt-search #oi-omnibox-host { flex: 1 1 auto; max-width: none !important; min-width: 0; }
html.pl-top .pt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1, 4px);
  height: 40px; min-width: 40px; padding: 0 var(--space-3, 12px); border-radius: var(--radius, 8px);
  border: 1px solid var(--border-2); background: var(--bg-card); color: var(--text);
  font: inherit; font-size: var(--fs-md, 13px); font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background var(--t-fast, .15s), border-color var(--t-fast, .15s), color var(--t-fast, .15s);
}
html.pl-top .pt-btn:hover { border-color: var(--text-3); }
html.pl-top .pt-btn.is-on { border-color: var(--accent); }
html.pl-top .pt-btn .pt-n:empty { display: none; }
html.pl-top .pt-btn .pt-n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full, 999px);
  background: var(--lore-primary, var(--accent)); color: var(--lore-primary-on, #fff);
  font-size: var(--fs-xs, 11px); font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
html.pl-top .pt-primary { background: var(--lore-primary, var(--accent)); border-color: var(--lore-primary, var(--accent)); color: var(--lore-primary-on, #fff); }
html.pl-top .pt-primary:hover { filter: brightness(1.06); border-color: var(--lore-primary, var(--accent)); }
html.pl-top .pt-quiet { background: transparent; }
html.pl-top .pt-new { display: inline-flex; flex-shrink: 0; }
html.pl-top .pt-new #pt-new-lead:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
html.pl-top .pt-new .pt-more { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 var(--space-2, 8px); margin-left: 1px; min-width: 32px; }
html.pl-top .pt-new .pt-more[hidden] { display: none; }
html.pl-top .pt-short { display: none; }

/* List | Board — one segmented pair, icon and name (the name shows from 1100px; it is always the button's name). */
html.pl-top .pt-view { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--radius, 8px); overflow: hidden; flex-shrink: 0; }
html.pl-top .pt-view .view-toggle-btn {
  display: inline-flex; align-items: center; gap: var(--space-1, 4px); height: 38px; min-width: 40px; padding: 0 var(--space-2, 8px);
  border: 0; border-radius: 0; background: var(--bg-card); color: var(--text-2); font-size: var(--fs-md, 13px); font-weight: 600;
  justify-content: center; transition: background var(--t-fast, .15s), color var(--t-fast, .15s);
}
html.pl-top .pt-view .view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--border-2); }
html.pl-top .pt-view .view-toggle-btn.active { background: var(--lore-primary, var(--accent)); color: var(--lore-primary-on, #fff); }
html.pl-top .pt-view .pt-toggle-l { display: none; }
@media (min-width: 1100px) { html.pl-top .pt-view .pt-toggle-l { display: inline; } }

/* Band 2 — the tabs on the left, then what is filtered, then the Overview line. */
html.pl-top .pt-band2 { min-height: 36px; }
html.pl-top .pt-tabs { display: flex; align-items: center; gap: var(--space-1, 4px); min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
html.pl-top .pt-tabs::-webkit-scrollbar { display: none; }
html.pl-top .pt-tabs .phase-toggle { background: transparent; padding: 0; gap: var(--space-1, 4px); height: auto; overflow: visible; }
html.pl-top .pt-tabs .ph-btn,
html.pl-top .pt-tabs .ph-pill {
  height: 36px; margin: 0; padding: 0 var(--space-3, 12px); border: 0; border-radius: 0; background: transparent;
  color: var(--text-2); font-size: var(--fs-base, 14px); font-weight: 600; box-shadow: none;
  border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
html.pl-top .pt-tabs .ph-btn:hover,
html.pl-top .pt-tabs .ph-pill:hover { color: var(--text); background: transparent; }
html.pl-top .pt-tabs .ph-btn.active,
html.pl-top .pt-tabs .ph-pill.active { color: var(--text); background: transparent; border-bottom-color: var(--lore-primary, var(--accent)); box-shadow: none; }
html.pl-top .pt-tabs .ph-plus { display: none !important; }   /* it is the arrow beside New lead now */
html.pl-top .pt-chips { display: flex; align-items: center; gap: var(--space-1, 4px); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
html.pl-top .pt-chips:empty { display: none; }
html.pl-top .pt-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--radius-full, 999px);
  border: 1px solid var(--accent); background: var(--accent-soft, transparent); color: var(--text);
  font: inherit; font-size: var(--fs-sm, 12px); font-weight: 600; cursor: pointer; white-space: nowrap;
}
html.pl-top .pt-ov { margin-left: auto; min-width: 0; }
html.pl-top .pt-ov .overview-strip { padding: 4px var(--space-2, 8px); gap: var(--space-2, 8px); flex-wrap: nowrap; border-radius: var(--radius, 8px); overflow: hidden; }
html.pl-top .pt-ov .ovb-label { color: var(--text-2); }
html.pl-top .pt-ov .ovb-toggle { margin-left: var(--space-1, 4px); }
html.pl-top .pt-extra { display: flex; gap: var(--space-1, 4px); }
html.pl-top .pt-extra:empty { display: none; }
/* The open Overview sits under the line that opens it. */
html.pl-top #overview-bar { border-top: 0; }
html.pl-top #overview-bar .overview-strip { display: none; }

/* The Filter panel. */
html.pl-top .pt-pop {
  position: absolute; z-index: 60; top: 48px; right: 0; width: 360px; max-width: calc(100vw - 24px);
  background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-3); padding: var(--space-3, 12px) var(--space-4, 16px) var(--space-4, 16px);
}
html.pl-top .pt-pop[hidden] { display: none; }
html.pl-top .pt-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2, 8px); }
html.pl-top .pt-pop-t { font-size: var(--fs-lg, 16px); font-weight: 700; color: var(--text); }
html.pl-top .pt-x { width: 40px; height: 40px; border: 0; background: transparent; color: var(--text-2); border-radius: var(--radius, 8px); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
html.pl-top .pt-x:hover { background: var(--border); }
html.pl-top .pt-pop-grid { display: grid; gap: var(--space-2, 8px); }
html.pl-top .pt-field { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: var(--space-2, 8px); }
html.pl-top .pt-field-l { font-size: var(--fs-md, 13px); color: var(--text-2); font-weight: 600; }
html.pl-top .pt-field .filter-select { display: block !important; width: 100%; max-width: none !important; height: 40px; font-size: var(--fs-base, 14px); color: var(--text); background: var(--bg-card); border-color: var(--border-2); }
html.pl-top .pt-pop-sec { margin-top: var(--space-3, 12px); }
html.pl-top .pt-pop-h { font-size: var(--fs-md, 13px); font-weight: 600; color: var(--text-2); margin-bottom: var(--space-1, 4px); }
html.pl-top .pt-pop-row { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); }
html.pl-top .pt-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 var(--space-3, 12px) !important;
  border: 1px solid var(--border-2) !important; border-radius: var(--radius, 8px) !important; background: var(--bg-card) !important;
  color: var(--text) !important; font: inherit; font-size: var(--fs-md, 13px) !important; font-weight: 600; cursor: pointer; width: auto !important;
}
html.pl-top .pt-toggle .pt-toggle-l { display: inline !important; }
/* A toggle the page hides when it does not apply (Flagged off the Bookings tab, On hold with nothing on hold) stays hidden: its own inline display wins. */
html.pl-top .pt-toggle.active, html.pl-top .pt-toggle.on, html.pl-top .pt-toggle[aria-pressed="true"] { border-color: var(--accent) !important; background: var(--accent-soft, transparent) !important; }
html.pl-top .pt-pop-foot { display: flex; justify-content: space-between; gap: var(--space-2, 8px); margin-top: var(--space-4, 16px); }

/* The Directory menu (opened from the workspace nav). */
.pt-dir {
  position: fixed; z-index: 1400; width: 300px; max-width: calc(100vw - 16px); padding: var(--space-1, 4px);
  background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--radius-lg, 12px); box-shadow: var(--shadow-3);
}
.pt-dir.is-center { top: 72px; left: 50%; transform: translateX(-50%); }
.pt-dir-h { padding: var(--space-2, 8px) var(--space-3, 12px) var(--space-1, 4px); font-size: var(--fs-md, 13px); font-weight: 700; color: var(--text-2); }
.pt-dir button {
  display: flex; align-items: center; gap: var(--space-3, 12px); width: 100%; min-height: 48px; padding: var(--space-2, 8px) var(--space-3, 12px);
  border: 0; border-radius: var(--radius, 8px); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.pt-dir button:hover, .pt-dir button:focus-visible { background: var(--accent-soft, var(--border)); }
.pt-dir button svg { flex-shrink: 0; color: var(--text-2); }
.pt-dir b { display: block; font-size: var(--fs-base, 14px); font-weight: 600; }
.pt-dir small { display: block; font-size: var(--fs-sm, 12px); color: var(--text-2); }

/* The four new-lead counts over the list: one quiet line, not four tiles. */
html.pl-top .intake-stats-row { flex-wrap: wrap !important; gap: 4px var(--space-4, 16px) !important; padding: 4px 4px 10px !important; align-items: baseline; }
html.pl-top .intake-stats-row::before { content: "New leads"; font-size: var(--fs-md, 13px); font-weight: 600; color: var(--text-2); }
html.pl-top .intake-stat-pill {
  flex: 0 0 auto !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important;
  text-align: left !important; display: inline-flex; align-items: baseline; gap: 4px; flex-direction: row-reverse; justify-content: flex-end;
}
html.pl-top .intake-stat-pill .isp-n { font-size: var(--fs-base, 14px) !important; font-weight: 700 !important; color: var(--text) !important; }
html.pl-top .intake-stat-pill .isp-l { font-size: var(--fs-md, 13px) !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--text-2) !important; }
html.pl-top .intake-stat-pill .isp-sub { display: none !important; }

/* A phone: one row — search, Filter, New; the tabs scroll inside their own row; List | Board is in Filter. */
@media (max-width: 759px) {
  html.pl-top .page-toolbar { padding: var(--space-2, 8px) var(--space-3, 12px) 0; }
  html.pl-top .pt-btn { height: 44px; min-width: 44px; padding: 0 var(--space-2, 8px); }
  html.pl-top .pt-view { display: none; }
  html.pl-top .pt-long { display: none; }
  html.pl-top .pt-short { display: inline; }
  html.pl-top .pt-new .pt-more { display: none; }   /* on a phone New opens the add menu itself when there is more */
  html.pl-top .pt-tabs { flex: 1 1 auto; }
  html.pl-top .pt-tabs .ph-btn, html.pl-top .pt-tabs .ph-pill { height: 44px; }
  html.pl-top .pt-ov { display: none; }
  html.pl-top .pt-chips { display: none; }   /* a phone shows the count on Filter instead */
  html.pl-top .pt-band2 { overflow: hidden; }
  html.pl-top .pt-pop { z-index: 1350; position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0; padding-bottom: calc(var(--space-4, 16px) + env(safe-area-inset-bottom, 0px)); max-height: 85vh; overflow-y: auto; }
  html.pl-top .pt-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  html.pl-top .pt-toggle, html.pl-top .pt-x { height: 44px; min-height: 44px; }
  html.pl-top .pt-x { width: 44px; }
  html.pl-top .pt-search #search { min-height: 44px; }
  html.pl-top .pt-field .filter-select { height: 44px; }
  html.pl-top .intake-stats-row::before { flex-basis: 100%; }
}
