:root {
  font-family: system-ui, "PingFang SC", sans-serif;
  color: #252935;
  background: #f5f6f8;
  font-size: 12px;
  --border: #dfe3e9;
  --muted: #68758a;
  --accent: #a94308;
}
* { box-sizing: border-box; }
body { margin: 0; }
.workspace-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 12px;
  padding: 0 clamp(12px, 1.8vw, 26px);
  background: white;
  border-bottom: 1px solid var(--border);
}
.workspace-nav nav { display: flex; overflow: auto; max-width: 100%; }
.workspace-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0 13px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.workspace-nav a[aria-current="page"] { color: var(--accent); border-color: #d86618; }
.workspace-nav small { font-size: 8px; letter-spacing: .13em; }
#sync { margin: 0 0 0 auto; color: var(--muted); font-size: 11px; }
main { margin: 10px clamp(12px, 1.8vw, 26px) 20px; }
section { border: 1px solid var(--border); border-radius: 8px; background: white; overflow: hidden; }
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
select, input {
  min-width: 0;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: white;
  color: #252935;
  font: inherit;
}
.controls select { max-width: 146px; }
.search { flex: 1 1 162px; }
.search input { flex: 1; min-width: 100px; }
:focus-visible { outline: 2px solid #b94b04; outline-offset: 1px; }
#total { margin: 0; padding: 7px 10px; font-weight: 600; }
.table-wrap { overflow: auto; max-height: calc(100dvh - 188px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; line-height: 16px; }
th, td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #e8ebef;
}
th:last-child, td:last-child { border-right: 0; }
th { position: sticky; top: 0; z-index: 1; white-space: nowrap; background: #fbfcfd; color: var(--muted); font-weight: 600; }
td { white-space: nowrap; }
td.title { white-space: normal; min-width: 210px; }
tbody tr:hover { background: #fff7ed; }
.value-tag { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #f1e5ff; color: #7a1a9a; }
.value-tag[data-tone="1"] { background: #dcfce7; color: #166534; }
.value-tag[data-tone="2"] { background: #dceaff; color: #2451a6; }
.value-tag[data-tone="3"] { background: #fce6f0; color: #a3225c; }
.value-tag[data-tone="4"] { background: #d9f7f3; color: #166055; }
.value-tag[data-tone="5"] { background: #fff0d9; color: #955417; }
.grid-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; }
.grid-footer span:last-child { display: flex; gap: 4px; }
button { font: inherit; color: inherit; border: 1px solid var(--border); border-radius: 5px; background: white; padding: 4px 8px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
th button { border: 0; padding: 1px 0; background: transparent; font-weight: inherit; }
th button:hover { color: var(--accent); }
.summary { margin-top: 12px; }
h2 { margin: 9px 10px; font-size: 13px; }
.access-form { max-width: 390px; margin: 12vh auto; padding: 26px; background: white; display: grid; gap: 18px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.access-form label { display: grid; }
.access-form button { background: #b64d0d; color: white; }
@media (max-width: 650px) {
  .workspace-nav a { padding: 0 8px; min-height: 40px; }
  .workspace-nav small { display: none; }
  #sync { padding: 4px 0; }
  .controls select { max-width: 120px; }
}

/* The shared view follows the local lead grid's navigation, facets and table bands. */
:root { --surface:#fff; --text:#252935; --selection:#fdf0e0; --orange:#d85e0e; }
.workspace-nav { gap: 8px 14px; }
.workspace-nav nav { gap:clamp(12px,2vw,30px); }
.workspace-nav a { min-height:56px; padding:0 3px; gap:12px; font-size:14px; }
.workspace-nav small { font-size:9px; letter-spacing:.19em; }
.page-tools {display:flex; align-items:center; gap:8px; margin:0 0 11px;}
.search-box { flex:0 1 440px; margin-right:auto; position:relative; }
.search-box .search-icon { position:absolute; left:12px; font-size:22px; line-height:1; }
.search-box kbd { position:absolute; right:10px; padding:1px 3px; border:1px solid var(--border); border-radius:4px; pointer-events:none; }
.page-search {width:100%; min-height:34px; padding:5px 42px 5px 35px;}
.page-tools button, .grid-tools button, .grid-tools select, .grid-picker summary { min-height:29px; border-radius:6px; white-space:nowrap; }
.facet-panel {position:relative; padding:10px 72px 10px 13px; background:var(--surface); border:1px solid var(--border); border-radius:8px; margin-bottom:9px;}
.facet-mode { position:absolute; right:10px; top:8px; }
.facet-row {display:flex; align-items:baseline; gap:10px; min-height:34px;}
.facet-label {color:var(--muted); flex:0 0 65px;}
.facet-values {display:flex; align-items:center; flex-wrap:wrap; gap:3px 5px;}
.facet-choice {border-color:transparent; border-radius:6px; min-height:30px; padding-inline:10px;}
.facet-choice small {color:var(--muted); font-size:10px; margin-left:9px; font-variant-numeric:tabular-nums;}
button.selected, .facet-choice.selected {background:var(--selection); color:var(--accent);}
.facet-choice.selected small {color:var(--orange);}
.grid-tools, .grid-period, .grid-actions {display:flex; flex-wrap:wrap; align-items:center; gap:4px;}
.grid-tools {position:relative; padding:9px 12px; gap:8px 12px; justify-content:space-between; border-bottom:1px solid var(--border);}
.lead-grid {overflow:visible; display:flex; flex-direction:column; max-height:calc(100dvh - 167px);}
.grid-scroll {flex:1 1 auto; max-height:none; min-height:100px;}
.lead-grid:fullscreen {border:none; border-radius:0; max-height:none; background:var(--surface);}
.lead-grid:fullscreen .grid-scroll {height:100%; }
.grid-tools .text-button {border-color:transparent; color:var(--orange);}
.muted {color:var(--muted);}
.record-stats {color:var(--accent); border:1px solid var(--border); padding:6px 8px; border-radius:6px; font-weight:500;}
.grid-picker {position:relative;}
.grid-picker summary {display:flex; align-items:center; cursor:pointer; list-style:none; border:1px solid var(--border); padding:4px 9px; background:var(--surface);}
.picker-panel {position:absolute; top:calc(100% + 4px); left:0; z-index:12; display:grid; gap:7px; min-width:155px; padding:10px; border:1px solid var(--border); border-radius:7px; background:var(--surface); box-shadow:0 8px 20px #1a2b4020;}
.column-toggle .picker-panel {left:auto; right:0; width:225px; max-height:58vh; overflow:auto;}
.picker-panel input[type=checkbox] {min-height:0;}
.workbench-grid {table-layout:fixed; width:max-content; min-width:100%; outline:none;}
.workbench-grid th, .workbench-grid td {padding:7px 9px; line-height:18px;}
.workbench-grid th {height:40px; z-index:3; background:var(--surface); user-select:none;}
.workbench-grid td {height:33px; overflow:hidden; text-overflow:ellipsis; background:var(--surface);}
.workbench-grid td.wrap-cell {white-space:pre-wrap; overflow-wrap:anywhere;}
.workbench-grid .frozen {position:sticky; left:0; box-shadow:2px 0 3px #0000000a;}
.workbench-grid td.frozen {z-index:2;}
.workbench-grid th.frozen {z-index:4;}
.workbench-grid .sold-row td {background:#fff2cb;}
.workbench-grid tbody tr:hover td {background:#f9fafb;}
.workbench-grid .sold-row:hover td {background:#fff0bf;}
.workbench-grid td.grid-selected {background:var(--selection)!important; outline:1px solid #ed8c35; outline-offset:-1px;}
.workbench-grid .column-sort {max-width:calc(100% - 20px); overflow:hidden; text-overflow:ellipsis; vertical-align:middle;}
.workbench-grid .column-filter-button {padding:0 3px; margin-left:4px;}
.workbench-grid .column-display {margin-left:7px; padding:0 5px; border:1px solid var(--border);}
.column-resize {position:absolute; right:0; top:0; bottom:0; width:7px; cursor:col-resize; touch-action:none;}
.column-resize:hover {background:#f3c5a4;}
.workbench-grid a, .trace-jump { color:#3e70bb; }
.trace-jump {margin-left:6px;}
.local-field {color:var(--muted);}
.value-tag {border-radius:6px; padding:2px 8px; font-weight:550;}
.value-tag[data-tone=positive] {background:#e2eee9;color:#368362;}
.value-tag[data-tone=negative] {background:#f5e6e6;color:#be4e52;}
.value-tag[data-tone=muted] {background:#ebedef;color:#728095;}
.value-tag[data-tone=rose] {background:#f4e8ed;color:#ba557c;}
.value-tag[data-tone=blue] {background:#e7ecf7;color:#4f73b8;}
.column-filter {position:fixed; inset:auto; width:260px; max-width:calc(100vw - 16px); z-index:15; margin:0; border:1px solid var(--border); border-radius:8px; box-shadow:0 10px 25px #1a2b4028; padding:11px; color:var(--text);}
.column-filter[open] {display:grid; gap:8px;}
.filter-values { max-height:min(300px,35dvh); display:flex; flex-wrap:wrap; gap:3px; overflow:auto; align-content:start; }
.filter-values button {text-align:left; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.filter-actions {display:flex; justify-content:flex-end; gap:5px;}
.grid-footer {border-top:1px solid var(--border); justify-content:space-between; flex-wrap:wrap; gap:8px; }
.page-nav {display:flex; gap:4px; align-items:center; margin-left:auto;}
.page-nav input { width:50px; }
.selected-summary {white-space:nowrap;}
@media (max-width:650px) {
  .workspace-nav a {font-size:12px; min-height:42px;}
  .facet-panel {padding-left:8px;}
  .facet-label {flex-basis:40px;}
  .lead-grid {max-height:none;}
  .grid-scroll {max-height:65dvh;}
}

.overview-view {padding:13px; --accent-soft:#fff7ef; --bg:#f3f4f7; --hover:#fcf7f1;}
.xhs-overview-controls,.xhs-overview-controls fieldset,.overview-tools,.overview-filters {display:flex;align-items:center;flex-wrap:wrap;gap:7px;}
.xhs-overview-controls {padding-bottom:12px;border-bottom:1px solid var(--border);margin-bottom:12px;justify-content:space-between;}
.xhs-overview-controls fieldset {border:0;padding:0;margin:0;}
.overview-view button,.overview-view select {min-height:32px;padding:4px 10px;}
.overview-view button.selected {background:#da640e;color:white;border-color:#da640e;}
.overview-message {margin:0;color:var(--muted);}
.overview-message:empty {display:none;}
.overview-card {border:0;overflow:visible;}
.overview-card:fullscreen {padding:14px;background:var(--surface);}
.overview-card:fullscreen .review-overview-scroll {max-height:calc(100dvh - 100px);}
.overview-tools {margin-bottom:10px;}
.overview-tools strong {font-size:14px;margin-right:auto;}
.overview-filters {margin-bottom:8px;}
.overview-filters button:nth-child(2) {margin-right:7px;}
.overview-card [hidden] {display:none!important;}
.overview-card[data-hide-previous=true] [data-compare-period=previous],
.overview-card[data-hide-previous=true] [data-compare-period=beforePrevious],
.overview-card[data-hide-same=true] [data-compare-period=sameMonth] {display:none;}
.review-overview-scroll {overflow:auto;max-height:calc(100dvh - 210px);}
.review-overview-table table {min-width:890px;table-layout:fixed;}
.review-overview-table :is(td,th) {white-space:normal;vertical-align:top;padding:10px 8px;overflow-wrap:anywhere;}
.review-overview-table thead th {padding-block:11px;background:var(--surface);color:var(--text);}
.review-overview-table tbody th {position:static;color:var(--text);background:transparent;}
.review-overview-table col:nth-child(1) {width:12%}.review-overview-table col:nth-child(2) {width:8%}.review-overview-table col:nth-child(3) {width:11%}.review-overview-table col:nth-child(4) {width:17%}.review-overview-table col:nth-child(5) {width:14%}.review-overview-table col:nth-child(6) {width:12%}.review-overview-table col:nth-child(7) {width:26%}
.review-overview-table .review-total {background:#fef8f2;}
.review-overview-table .review-previous-row {background:#f7f7f9;color:var(--muted);}
.review-overview-table .review-previous-row th {color:var(--muted);}
.review-overview-table .review-channel-name {border-left:3px solid #df680e;padding-left:7px;font-weight:650;}
.review-overview-table .review-previous-row .review-channel-name {border-color:#e0e3e8;}
.review-overview-table .review-previous-label {display:block;color:var(--muted);margin-top:4px;font-size:10px;}
.review-overview-table .review-metric {display:flex;align-items:baseline;flex-wrap:wrap;gap:4px;margin-bottom:7px;}
.review-overview-table .review-metric span,.review-overview-table small {color:var(--muted);}
.review-overview-table .review-ratio {display:block;flex-basis:100%;font-size:10px;}
.review-overview-table .review-breakdown {margin-top:6px;font-size:10px;}
.review-overview-table .review-detail-item {display:inline-block;margin-right:4px;}
.review-overview-table .review-change {display:inline-block;margin-left:4px;font-size:10px;}
.review-overview-table .review-change.up {color:#248353;}
.review-overview-table .review-change.down,.review-overview-table .review-emphasis {color:#c8333d;}
.review-overview-table .review-change.neutral {color:var(--muted);}
.review-overview-table .review-deal-toggle {border:0;color:var(--muted);min-height:0;padding:0 3px;background:transparent;}
.review-overview-table .meeting-product-conversion {margin-block:5px;}
.review-overview-table .meeting-product-conversion small {display:block;}
.review-overview-table .review-cost-line {margin-top:8px;}
@media (max-width:650px) {.overview-view{padding:8px}.xhs-overview-controls{align-items:flex-start}}

/* Contain all scrolling inside the data panes; navigation, filters and pager stay put. */
html:has(.team-workbench), body.team-workbench {height:100%;overflow:hidden;overscroll-behavior:none;}
.team-workbench {height:100dvh;display:flex;flex-direction:column;min-width:0;}
.team-workbench > .workspace-nav {flex:0 0 auto;}
.team-workbench > main {flex:1 1 0;min-height:0;min-width:0;display:flex;flex-direction:column;margin-bottom:10px;}
#channel-content:not([hidden]) {
  display:flex;flex:1 1 0;flex-direction:column;min-height:0;min-width:0;
}
#channel-content > .page-tools,#channel-content > .facet-panel {flex:0 0 auto;}
#channel-content > .lead-grid {
  flex:1 1 0;min-height:0;max-height:none;min-width:0;
}
.lead-grid > :is(.grid-tools,.grid-footer) {flex:0 0 auto;}
.lead-grid > .grid-scroll {min-height:0;max-height:none;overscroll-behavior:contain;}
#channel-content > .overview-view {
  display:flex;flex:1 1 0;flex-direction:column;min-height:0;overflow:hidden;
}
.overview-view > :is(.xhs-overview-controls,.overview-message) {flex:0 0 auto;}
.overview-view > .overview-card:not([hidden]),.overview-view > .overview-card > div:has(.review-overview-scroll),
.overview-card .meeting-linked-overview {
  display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;
}
.overview-view .review-overview-scroll {flex:1 1 0;max-height:none;min-height:0;overscroll-behavior:contain;}
.overview-view .overview-tools,.overview-view .overview-filters {flex:0 0 auto;}
@media (max-height:450px) {
  .team-workbench > main {margin-top:4px;margin-bottom:4px;}
  .team-workbench .page-tools,.team-workbench .facet-panel {margin-bottom:4px;}
  .team-workbench .facet-panel {max-height:100px;overflow:auto;}
}

/* Overview detail tables share the workbench row and comparison styles. */
.grid-scroll .empty-cell {color:var(--muted);}
.overview-card .meeting-xhs {--accent:#df680e;--accent-soft:#fff0e2;--bg:#f5f6f8;}
.overview-view .meeting-xhs-scroll {overflow:auto;border:1px solid var(--border);border-radius:7px;}
.overview-card .meeting-xhs-table {width:100%;min-width:960px!important;}
.overview-card .meeting-material-table {min-width:1060px!important;}
.overview-card .meeting-product-table .account-breakdown {font-size:10px;line-height:1.55;}
.overview-card .meeting-xhs-table thead th {position:sticky;top:0;z-index:1;}
.overview-card .meeting-xhs-table tbody th small {display:block;margin-top:5px;line-height:1.6;}
.overview-card .meeting-xhs-table tbody th a {color:#a94308;}
.overview-card .meeting-xhs-table .meeting-material-cover {cursor:default;}
.overview-card .meeting-xhs-filter {
  display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 10px;
  flex:0 0 auto;position:relative;padding-right:80px;
}
.overview-card .account-filter-divider {height:22px;border-left:1px solid var(--border);margin-inline:4px;}
.overview-card .meeting-xhs-filter button small {margin-inline:3px;font-weight:500;}
.overview-card .meeting-xhs-filter button.primary small {color:inherit;}
.overview-card .meeting-xhs-filter .meeting-deals-only {margin-left:auto;}
.overview-card .meeting-xhs-search {width:min(300px,100%);min-height:32px;margin-left:auto;padding:6px 9px;border:1px solid var(--border);border-radius:6px;}
.overview-card .overview-material-filter {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;padding-right:0;}
.overview-card .overview-material-options,.overview-card .overview-material-actions {display:flex;align-items:center;gap:6px;}
.overview-card .overview-material-options {flex-wrap:wrap;}
.overview-card .overview-material-actions {justify-content:flex-end;white-space:nowrap;}
@media (max-width:520px) {
  .overview-card .overview-material-filter {grid-template-columns:1fr;}
}
.overview-card .meeting-xhs-pagination {display:flex;justify-content:flex-end;align-items:center;gap:7px;padding-top:7px;}
.overview-card .meeting-material-table .meeting-cover-preview {display:inline-block;height:auto;max-width:100%;cursor:default;}
.overview-card .meeting-material-table .meeting-cover-preview img {display:block;width:auto;height:auto;max-width:100%;max-height:165px;object-fit:contain;}
.overview-card .meeting-material-table .meeting-cover-strip {display:flex;flex-wrap:wrap;gap:4px;}
.overview-card .meeting-material-table .material-browser-inline a {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.overview-card col.overview-width-8 {width:8%;}
.overview-card col.overview-width-9 {width:9%;}
.overview-card col.overview-width-10 {width:10%;}
.overview-card col.overview-width-11 {width:11%;}
.overview-card col.overview-width-12 {width:12%;}
.overview-card col.overview-width-13 {width:13%;}
.overview-card col.overview-width-16 {width:16%;}
.overview-card col.overview-width-18 {width:18%;}
.overview-card col.overview-width-26 {width:26%;}
.overview-card col.overview-width-28 {width:28%;}
.overview-card col.overview-width-35 {width:35%;}
.overview-card col.overview-width-44 {width:44%;}

.overview-period-label label {display:flex;align-items:center;gap:6px;}
.overview-period-label input {min-height:32px;padding:4px 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font:inherit;}
.week-period-button {white-space:nowrap;}
dialog.review-week-picker {
  position:fixed;inset:auto;margin:0;width:300px;max-width:calc(100vw - 20px);padding:12px;overflow:auto;
  border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);
  box-shadow:0 8px 30px #20232933;z-index:200;
}
.review-week-picker .week-calendar-head {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:13px;}
.review-week-picker .icon-btn {width:28px;height:28px;min-height:0;padding:0;}
.review-week-picker :is(.week-calendar-days,.week-calendar-row) {display:grid;grid-template-columns:repeat(7,1fr);text-align:center;}
.review-week-picker .week-calendar-days {color:var(--muted);padding:6px 0;}
.review-week-picker .week-calendar-row {
  width:100%;background:transparent;border:1px solid transparent;border-radius:6px;padding:9px 0;
  cursor:pointer;color:var(--text);font:inherit;margin:2px 0;
}
.review-week-picker .week-calendar-row:enabled:is(:hover,:focus-visible,.selected) {background:var(--selection);border-color:var(--accent);color:var(--accent);}
.review-week-picker .week-calendar-row:disabled {opacity:.38;cursor:default;}
.review-week-picker .other-month {opacity:.45;}
.review-week-picker p {margin:8px 0 0;font-size:11px;color:var(--muted);text-align:center;}
