/* Stone City • screen presentation.
   A named layer lets these deliberate palette and surface overrides beat the
   earlier unlayered, important legacy theme without escalating specificity. */
@layer stone-city {
@media screen and (forced-colors: none) {

html[data-hub-theme="dark"] {
  --sc-text: #faf5ec;
  --sc-sub: #e1d9cc;
  --sc-muted: #c6bdb2;
  --sc-gold: #e6c48a;
  --sc-gold-light: #f7dfab;
  --sc-line: rgb(210 187 158 / 26%);
  --sc-edge: rgb(226 208 180 / 36%);
  --sc-inset: rgb(255 240 212 / 8%);
  --sc-solid: #302326;
  --sc-active: linear-gradient(130deg, #743747, #622538 57%, #461c2b);
  --sc-glass: linear-gradient(134deg, rgb(239 219 193 / 10%), rgb(100 51 64 / 8%) 41%, rgb(27 21 22 / 12%)), rgb(30 24 26 / 76%);
  --sc-control: linear-gradient(140deg, rgb(213 189 172 / 15%), rgb(153 125 121 / 10%)), #342a2c;
  --sc-brass: linear-gradient(135deg, #f8eacf, #ecd8af 22%, #c5a773 48%, #e4c99a 68%, #ae9268);
  --sc-shadow: inset 0 1px 0 var(--sc-inset), 0 8px 22px rgb(18 6 10 / 14%);
  --sc-gutter: clamp(16px, 1.8vw, 32px);
  --sc-radius: clamp(17px, 1.55vw, 27px);
  --sc-padding: clamp(16px, 1.8vw, 30px);
  --hub-text: var(--sc-text) !important;
  --hub-muted: var(--sc-muted) !important;
  --hub-control-text: var(--sc-sub) !important;
  --data-label: var(--sc-sub) !important;
  --dt-text: var(--sc-text) !important;
  --dt-muted: var(--sc-muted) !important;
  --dt-line: var(--sc-line) !important;
  --dt-panel: var(--sc-solid) !important;
  --dt-focus: var(--sc-gold-light) !important;
  --dt-red: var(--sc-gold) !important;
  --text: var(--sc-text) !important;
  --foreground: var(--sc-text) !important;
  --paper: var(--sc-solid) !important;
  --card: var(--sc-solid) !important;
  --popover: var(--sc-solid) !important;
  --line: var(--sc-line) !important;
  --red: var(--sc-gold) !important;
  --red-soft: #48242d !important;
  --ring: var(--sc-gold-light) !important;
  --muted: var(--sc-muted) !important;
  color-scheme: dark;
  background: #21171a !important;
}

/* A fixed photographic underlay remains in place as long reports scroll. */
html[data-hub-theme="dark"] body {
  isolation: isolate;
  background: transparent !important;
  color: var(--sc-text) !important;
}
html[data-hub-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(110deg, rgb(28 12 17 / 20%), rgb(34 15 18 / 8%) 58%, rgb(26 12 16 / 20%)),
              #261a1e url("/brand/stone-city.webp") center 47% / cover no-repeat;
  transform: scale(1.055);
}
html[data-hub-theme="dark"] body:has(.welcome-screen)::before {
  transform: scaleX(-1);
}
html[data-hub-theme="dark"] :is(.app-shell, .main-shell, .main-content) {
  background: transparent !important;
  color: var(--sc-text) !important;
  --overview-line: var(--sc-line) !important;
  --overview-soft: rgb(235 220 200 / 5%) !important;
  --workspace-line: var(--sc-line) !important;
  --hub-guide-line: var(--sc-line) !important;
}
html[data-hub-theme="dark"] :is(h1,h2,h3,h4,h5,h6,strong,.metric-number,.month-total,.personal-total,.alp-cell,.agent-link,.entry-total,.team-hub-kpi-value,.hub-profile-alp) {
  color: var(--sc-text) !important;
}
html[data-hub-theme="dark"] :is(p,dt,small,.muted,.metric-label,.metric-foot,.app-footer,.period-caption,.hub-production-range,.hub-chart-prompt,.hub-chart-footer span,.hub-chart-date,.hub-profile-note,.team-hub-context span,.hub-current-period-note,.team-hub-panel-note,.hub-elite-dates) {
  color: var(--sc-sub) !important;
}
html[data-hub-theme="dark"] :is(.eyebrow,.hub-elite-kicker,.hub-story-eyebrow,.workspace-tag,.section-number,.hub-help-step,.hub-production-kicker,.hub-current-report-today,.hub-profile-note strong,.hub-hierarchy-role) {
  color: var(--sc-gold) !important;
}
html[data-hub-theme="dark"] :is(.page-heading h1, .welcome-screen h1, .guide-header h1) {
  font-weight: 620 !important;
  letter-spacing: -.046em !important;
  line-height: 1.12 !important;
  text-transform: none !important;
  text-shadow: 0 2px 10px rgb(18 8 12 / 50%) !important;
}
html[data-hub-theme="dark"] .page-heading h1 {
  font-size: clamp(32px, 3.8vw, 62px) !important;
}
html[data-hub-theme="dark"] :is(.page-heading p,.breadcrumb,.workspace-tag,.source-strip,.app-footer) {
  text-shadow: 0 1px 5px #25151a !important;
}
html[data-hub-theme="dark"] ::selection {
  background: #74354a;
  color: var(--sc-text);
}

/* Top-level glass sheets. Subsections inside each sheet keep a single surface. */
html[data-hub-theme="dark"] :is(.sidebar,.panel,.kpi-grid,.team-hub-kpis,.hub-elite,.guide-header,.team-hub-controls,.hub-scope-toolbar,.hub-period-pair,.hub-story-dialog,.modal,.modal-card,.hub-global-report-state) {
  background: var(--sc-glass) !important;
  border: 1px solid var(--sc-edge) !important;
  border-radius: var(--sc-radius) !important;
  box-shadow: var(--sc-shadow) !important;
  color: var(--sc-text) !important;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
html[data-hub-theme="dark"] :is(.main-content > .panel,.overview-middle > .panel,.overview-middle > .hub-org-targets,.averages-grid > .panel,
.entry-main > .panel,.entry-side > .panel,.settings-grid > .panel,.hub-help-panel,.team-hub > .panel,.team-hub-insights > .panel,
.team-hub-kpis,.team-hub-controls,.hub-elite,.kpi-grid,.hub-global-report-state) {
  padding: var(--sc-padding) !important;
  min-width: 0;
}
html[data-hub-theme="dark"] :is(.overview-middle > .panel,.overview-middle > .hub-org-targets,.averages-grid > .panel,.settings-grid > .panel,.entry-main > .panel,.entry-side > .panel,.team-hub-insights > .panel) {
  border: 1px solid var(--sc-edge) !important;
  border-radius: var(--sc-radius) !important;
}
html[data-hub-theme="dark"] .overview-middle {
  gap: var(--sc-gutter) !important;
  align-items: start;
}
html[data-hub-theme="dark"] .overview-middle.hub-global-chart-only {
  grid-template-columns: minmax(0,1fr) !important;
}
html[data-hub-theme="dark"] :is(.panel .panel,.team-hub-leaderboard > .hub-elite,.hub-org-targets > .hub-official-targets,.hub-period-pair > .hub-period-panel,.metric-card,.team-hub-kpi) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-hub-theme="dark"] :is(.main-content > .panel,.hub-agent-help > .panel,.team-hub > .panel,.team-hub > .hub-scope-toolbar) {
  margin-block: 0 var(--sc-gutter) !important;
}
html[data-hub-theme="dark"] :is(.panel-heading,.hub-production-heading,.team-hub-section-heading,.daily-report-heading) {
  background: transparent !important;
  border-color: var(--sc-line) !important;
}
html[data-hub-theme="dark"] :is(.table-footer,.info-footer,.team-hub-context,.team-hub-footnote,.team-hub-basis,.entry-source,.source-strip,.approval-guide,.access-identity,.entry-person,.entry-actions,.team-hub-heading,.team-hub-toolbar,.hub-elite-stage,.hub-elite-stage-note,.hub-story-toggle,.hub-profile-pagination,.app-footer) {
  background: transparent !important;
  border-color: var(--sc-line) !important;
}
html[data-hub-theme="dark"] :is(.metric-foot,.team-hub-kpi-note,.hub-current-period-status,.table-footer,.hub-period-note,.team-hub-footnote,.guide-header p,.hub-help-results) {
  color: var(--sc-muted) !important;
}

/* Brand and shell. Reuse the official monochrome mark on its natural luminance. */
html[data-hub-theme="dark"] .brand-logo {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  mix-blend-mode: screen;
}
html[data-hub-theme="dark"] .brand-logo img {
  filter: sepia(.7) saturate(.7) !important;
}
@supports (mask-mode: luminance) {
  html[data-hub-theme="dark"] .brand-logo { mix-blend-mode: normal; }
  html[data-hub-theme="dark"] .brand-logo img { opacity: 0 !important; }
  html[data-hub-theme="dark"] .brand-logo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--sc-brass);
    mask-image: url("/brand/5ive-star-logo.png");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 150% auto;
    mask-mode: luminance;
    pointer-events: none;
  }
}
html[data-hub-theme="dark"] .sidebar {
  background: linear-gradient(135deg,rgb(234 211 181 / 10%),transparent 40%), rgb(33 22 26 / 82%) !important;
  padding: clamp(16px,1.7vw,28px) 12px !important;
  overflow-y: auto !important;
  scrollbar-color: #8b7967 transparent;
}
html[data-hub-theme="dark"] .sidebar .brand { border-color: var(--sc-line) !important; }
html[data-hub-theme="dark"] .sidebar-note {
  color: var(--sc-sub) !important;
  border-color: var(--sc-line) !important;
  background: rgb(78 52 57 / 35%) !important;
}
html[data-hub-theme="dark"] .sidebar-note .star-line { color: var(--sc-gold) !important; }
html[data-hub-theme="dark"] .sidebar-bottom {
  border-top: 1px solid var(--sc-line) !important;
  margin-top: auto !important;
  padding-top: 12px !important;
}
html[data-hub-theme="dark"] :is(.nav-item,.profile-button) {
  color: var(--sc-sub) !important;
  border-radius: 14px !important;
  min-height: 44px;
}
html[data-hub-theme="dark"] :is(.nav-item.active,.nav-item[aria-current="page"]) {
  background: var(--sc-active) !important;
  box-shadow: inset 0 0 0 1px var(--sc-edge) !important;
  color: var(--sc-text) !important;
}
html[data-hub-theme="dark"] :is(.nav-item,.profile-button):hover {
  background-color: rgb(224 194 153 / 12%) !important;
}
html[data-hub-theme="dark"] :is(.topbar,.topbar-right,.breadcrumb) {
  color: var(--sc-sub) !important;
  background: transparent !important;
  border-color: var(--sc-line) !important;
}
html[data-hub-theme="dark"] :is(.tiny-dot,.nav-active-dot,.caption-dot,.sync-state:not(.offline) .tiny-dot) {
  background: var(--sc-gold) !important;
}
html[data-hub-theme="dark"] :is(.avatar,.owner-avatar,.agent-avatar,.approval-shield,.help-icon,.import-icon,.access-icon,.metric-symbol,.daily-report-heading-icon) {
  color: var(--sc-gold-light) !important;
  background: linear-gradient(140deg,#574148,#3b292e) !important;
  border-color: var(--sc-edge) !important;
  box-shadow: none !important;
}
html[data-hub-theme="dark"] :is(.avatar,.owner-avatar) { border-radius: 50% !important; }

@media (min-width: 761px) {
  html[data-hub-theme="dark"] .sidebar {
    --rail: clamp(184px, 16vw, 248px);
    inset: var(--sc-gutter) auto var(--sc-gutter) var(--sc-gutter) !important;
    width: var(--rail) !important;
    max-height: calc(100dvh - 2 * var(--sc-gutter)) !important;
  }
  html[data-hub-theme="dark"] .main-shell {
    margin-left: calc(clamp(184px,16vw,248px) + var(--sc-gutter)) !important;
  }
  html[data-hub-theme="dark"] .topbar {
    height: auto !important;
    min-height: 62px;
    border: 0 !important;
    padding: 18px var(--sc-gutter) 0 !important;
  }
  html[data-hub-theme="dark"] .main-content {
    padding: 16px var(--sc-gutter) 0 !important;
  }
}
@media (max-width: 760px) {
  html[data-hub-theme="dark"] body::before { background-position: 67% center; }
  html[data-hub-theme="dark"] .sidebar {
    border-radius: 0 20px 20px 0 !important;
    background-color: #2f2127 !important;
    max-height: 100dvh;
  }
  html[data-hub-theme="dark"] .topbar {
    background: rgb(31 22 25 / 94%) !important;
  }
  html[data-hub-theme="dark"] .sidebar-scrim { background: rgb(17 9 12 / 62%) !important; }
  html[data-hub-theme="dark"] .page-heading { gap: 14px !important; }
  html[data-hub-theme="dark"] .main-content {
    padding: 22px clamp(12px,3.7vw,22px) 0 !important;
  }
}

/* Fields and actions keep the original native focus, input types and hit areas. */
html[data-hub-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea,.currency-input,.date-control,.search-control,.search-box,.team-hub-search,.hub-current-report-date) {
  background: var(--sc-control) !important;
  color: var(--sc-text) !important;
  -webkit-text-fill-color: var(--sc-text) !important;
  border-color: #948278 !important;
  border-radius: 12px !important;
}
html[data-hub-theme="dark"] :is(.currency-input,.date-control,.search-control,.search-box,.team-hub-search) input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-hub-theme="dark"] :is(input,textarea)::placeholder {
  color: var(--sc-muted) !important;
  -webkit-text-fill-color: var(--sc-muted) !important;
}
html[data-hub-theme="dark"] input:-webkit-autofill {
  box-shadow: 0 0 0 1000px #3a2c31 inset !important;
  -webkit-text-fill-color: var(--sc-text) !important;
}
html[data-hub-theme="dark"] option {
  color: var(--sc-text) !important;
  background: var(--sc-solid) !important;
}
html[data-hub-theme="dark"] :is(.field > span,.daily-report-field > span,.team-hub-selector > span) { color: var(--sc-sub) !important; }
html[data-hub-theme="dark"] :is(input[type="checkbox"],input[type="radio"],input[type="range"]) { accent-color: #9b5060 !important; }
html[data-hub-theme="dark"] :is(.btn,.icon-button,.google-button,.guide-tools button,.hub-production-report,.hub-subteam-link,.hub-story-close,.hub-elite-replay,.hub-org-edit,.hub-global-period button) {
  color: var(--sc-text) !important;
  background: var(--sc-control) !important;
  border: 1px solid var(--sc-edge) !important;
  border-radius: 15px !important;
  box-shadow: inset 0 1px 0 var(--sc-inset) !important;
}
html[data-hub-theme="dark"] :is(.btn.primary,.hub-story-trigger,.hub-story-download.primary,.hub-org-save) {
  background: var(--sc-active) !important;
  border-color: #ab8d67 !important;
  color: #fff7e8 !important;
  border-radius: 999px !important;
}
html[data-hub-theme="dark"] :is(.btn,.icon-button,.google-button,.guide-tools button,.hub-production-report,.hub-subteam-link,.hub-story-close,.hub-elite-replay):hover:not(:disabled) {
  border-color: var(--sc-gold) !important;
  box-shadow: inset 0 0 0 1px rgb(229 199 145 / 22%) !important;
}
html[data-hub-theme="dark"] :is(.text-button,.link-button,.guide-tools a,.hub-help-actions a,.hub-elite-kicker,.red) {
  color: var(--sc-gold-light) !important;
}
html[data-hub-theme="dark"] :is(.segmented,.hub-period-tabs,.hub-scope-switch,.hub-current-report-tabs,.team-hub-periods) {
  background: rgb(42 28 33 / 80%) !important;
  border: 1px solid var(--sc-edge) !important;
  border-radius: 17px !important;
}
html[data-hub-theme="dark"] :is(.segmented,.hub-period-tabs,.hub-scope-switch,.team-hub-periods) button {
  color: var(--sc-sub) !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-hub-theme="dark"] :is(.segmented,.hub-period-tabs,.hub-scope-switch,.team-hub-periods) button:is(.selected,[aria-pressed="true"]) {
  color: var(--sc-text) !important;
  background: var(--sc-active) !important;
  box-shadow: inset 0 0 0 1px var(--sc-edge) !important;
}
html[data-hub-theme="dark"] :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible {
  outline: 3px solid var(--sc-gold-light) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px #42272b !important;
}
html[data-hub-theme="dark"] :is(button,input,select,textarea):disabled {
  color: var(--sc-sub) !important;
  -webkit-text-fill-color: var(--sc-sub) !important;
}

/* Production, targets, standings, and the reporting tables. */
html[data-hub-theme="dark"] .hero-metric::before,
html[data-hub-theme="dark"] .team-hub-kpi:first-child::before { background: var(--sc-brass) !important; }
html[data-hub-theme="dark"] :is(.hero-metric .metric-number,.hub-chart-readout strong,.hub-current-period-summary dd,.team-hub-context strong,.hub-official-values strong,.hub-org-record-value) { color: var(--sc-gold-light) !important; }
html[data-hub-theme="dark"] :is(.hub-chart-readout,.hub-chart-prompt,.hub-chart-tooltip,.hub-production-range,.hub-chart-day,.hub-chart-day:before,.hub-elite-header,.hub-elite-summary,.hub-elite-honor,.hub-elite-honor-inner,.hub-elite-identity) {
  background: transparent !important;
  border-color: var(--sc-line) !important;
  box-shadow: none !important;
}
html[data-hub-theme="dark"] .hub-chart-bars::before {
  background: repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),rgb(213 190 162 / 24%) calc(25% - 1px),rgb(213 190 162 / 24%) 25%) !important;
  border-color: var(--sc-edge) !important;
}
html[data-hub-theme="dark"] :is(.hub-chart-bar,.progress-track > div,.horizontal-track > i,.source-bar .bar-fill) {
  background: linear-gradient(180deg,#a84055,#682637) !important;
  box-shadow: inset 0 1px 0 #d58c8a !important;
}
html[data-hub-theme="dark"] :is(.is-selected .hub-chart-bar,.hub-chart-day:hover .hub-chart-bar) {
  background: var(--sc-brass) !important;
  box-shadow: inset 0 1px 0 #f5e5bf !important;
}
html[data-hub-theme="dark"] .hub-chart-day.is-selected { background: rgb(183 145 91 / 15%) !important; }
html[data-hub-theme="dark"] .is-zero .hub-chart-bar { background: #c6b99e !important; }
html[data-hub-theme="dark"] :is(.hub-chart-scale strong,.hub-chart-tooltip strong,.hub-chart-dash,.hub-chart-scale span,.hub-chart-tooltip span) { color: var(--sc-sub) !important; }
html[data-hub-theme="dark"] :is(.progress-track,.horizontal-track) { background: rgb(198 171 145 / 27%) !important; }
html[data-hub-theme="dark"] svg text { fill: var(--sc-sub) !important; }
html[data-hub-theme="dark"] .hub-elite {
  --seal-text: var(--sc-text) !important;
  --medal-fill: linear-gradient(135deg,#5c4a41,#342b28) !important;
}
html[data-hub-theme="dark"] .hub-elite :is(.champion,.silver,.bronze,.ruby) {
  --seal-text: var(--sc-text) !important;
  --medal-fill: linear-gradient(135deg,#5b4b40,#352a28) !important;
  --tier-color: #c8b393 !important;
}
html[data-hub-theme="dark"] .hub-elite .champion {
  --seal-text: var(--sc-gold-light) !important;
  --medal-fill: linear-gradient(135deg,#713c3f,#442329) !important;
  --tier-color: #e2bd7e !important;
}
html[data-hub-theme="dark"] .hub-elite :is(.hub-elite-bar,.hub-elite-medal,.hub-elite-seal) {
  background: linear-gradient(135deg,#5b4d45,#403530 62%,#302826) !important;
  color: var(--sc-text) !important;
  border-color: #a99780 !important;
  box-shadow: inset 0 1px 0 rgb(247 224 189 / 27%) !important;
}
html[data-hub-theme="dark"] .hub-elite .champion :is(.hub-elite-bar,.hub-elite-medal,.hub-elite-seal) {
  background: var(--sc-active) !important;
  color: var(--sc-gold-light) !important;
  border-color: var(--sc-gold) !important;
}
html[data-hub-theme="dark"] .hub-elite :is(.hub-elite-name,.hub-elite-amount,.hub-elite-initials,.hub-elite-position,.hub-elite-engraving,.hub-elite-honor-value strong,.hub-elite-honor-copy strong) { color: var(--sc-text) !important; }
html[data-hub-theme="dark"] .hub-elite .champion :is(.hub-elite-position,.hub-elite-amount,.hub-elite-engraving) { color: var(--sc-gold-light) !important; }
html[data-hub-theme="dark"] .hub-elite :is(.hub-elite-honor-copy small,.hub-elite-honor-value small,.hub-elite-summary span,.hub-elite-summary small) { color: var(--sc-muted) !important; }
html[data-hub-theme="dark"] :is(table,thead,tbody,tfoot,th,td,tbody tr) {
  color: var(--sc-sub) !important;
  background: transparent !important;
  border-color: var(--sc-line) !important;
}
html[data-hub-theme="dark"] :is(thead th,tfoot td,tfoot th) {
  background: #372a2c !important;
  color: var(--sc-text) !important;
}
html[data-hub-theme="dark"] tbody tr:nth-child(even) { background: rgb(244 222 192 / 3%) !important; }
html[data-hub-theme="dark"] tbody tr:hover { background: rgb(222 193 147 / 10%) !important; }
html[data-hub-theme="dark"] :is(.agent-table,.roster-table,.daily-report-table,.team-hub-table) tbody :is(th,td):first-child { background: #2f2527 !important; }
html[data-hub-theme="dark"] .roster-table tbody :is(th,td):nth-child(2) { background: #2f2527 !important; }
html[data-hub-theme="dark"] :is(.hub-chart-scroll,.table-scroll,.daily-report-table-wrap,.team-hub-table-wrap,.hub-profile-table-wrap,.hub-help-table-scroll) { scrollbar-color: #95816c #302326 !important; }
html[data-hub-theme="dark"] :is(.status-pill.pending,.count-badge,.small-tag,.hub-archived-tag,.hub-current-report-date,.hub-production-range,.team-hub-period-tag,.hub-subteam-link small) {
  color: var(--sc-sub) !important;
  background: #423336 !important;
  border-color: var(--sc-edge) !important;
}
html[data-hub-theme="dark"] :is(.status-pill.posted,.success-notice,.hub-join-status,.hub-reactivate-success) {
  color: #c4e6ca !important; background: #243c31 !important; border-color: #73917d !important;
}
html[data-hub-theme="dark"] :is(.status-pill.partial,.inline-warning,.setup-notice) {
  color: #f1d59e !important; background: #443424 !important; border-color: #a28b5e !important;
}
html[data-hub-theme="dark"] :is(.inline-error,.error-notice,.hub-join-error,.hub-reactivate-error,.hub-current-report-error) {
  color: #ffe2db !important; background: #542930 !important; border-color: #bd827d !important;
}

/* Dailies, private Team Hub, and settings share the same form material. */
html[data-hub-theme="dark"] :is(.entry-total,.personal-stats,.hub-profile-rate,.hub-profile-rates article,
.hub-profile-total-strip,.hub-official-values > div,.hub-subteam-links,.hub-hierarchy-list,.hub-hierarchy-node,
.hub-hierarchy-row,.hub-org-admin,.team-hub-member,.team-hub-member > div,.team-hub-members > li,
.hub-help-question,.hub-help-steps li,.hub-help-grid article,.hub-join-request,.hub-archive-row,.import-panel .source-fact) {
  border-color: var(--sc-line) !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-hub-theme="dark"] :is(.section-number,.hub-help-step,.small-tag,.team-hub-position) {
  color: var(--sc-gold-light) !important;
}
html[data-hub-theme="dark"] .hub-agent-help > .panel {
  padding: var(--sc-padding) !important;
  margin: 0 0 var(--sc-gutter) !important;
}
html[data-hub-theme="dark"] :is(.hub-guide-heading,.hub-scope-toolbar,.hub-team-relationships) {
  padding: 14px var(--sc-padding) !important;
}
html[data-hub-theme="dark"] :is(.team-hub .hub-scope-toolbar,.hub-team-relationships) {
  gap: 12px;
  min-width: 0;
}
html[data-hub-theme="dark"] .hub-period-pair { padding: 0 var(--sc-padding) !important; }
html[data-hub-theme="dark"] .hub-period-pair > .hub-period-panel { margin-block: 0 !important; }
html[data-hub-theme="dark"] .report-window-state { color: var(--sc-sub) !important; }
html[data-hub-theme="dark"] .guide-header {
  margin: var(--sc-gutter) auto !important;
  width: min(calc(100% - 2 * var(--sc-gutter)),1160px) !important;
  text-align: left;
}
html[data-hub-theme="dark"] body > .hub-agent-help { width: min(100%,1200px); margin-inline: auto !important; }
html[data-hub-theme="dark"] :is(.guide-header a,.hub-help-panel summary,.hub-hierarchy-count,.hub-hierarchy-team-size,.hub-subteam-link strong,.team-hub-search svg) { color: var(--sc-gold-light) !important; }
html[data-hub-theme="dark"] :is(.guide-header p,.hub-help-panel p,.hub-help-panel th,.hub-help-panel td,.hub-join-note,.hub-archive-note) { color: var(--sc-sub) !important; }

/* Dialog content gets an opaque base. A native dialog stays in the top layer. */
html[data-hub-theme="dark"] :is(.modal,.modal-card,.dialog,.drawer,.popover,[role="menu"],[role="listbox"],.hub-story-dialog) {
  background: linear-gradient(135deg,#433038,#302327 67%,#2a2123) !important;
  color: var(--sc-text) !important;
  border-color: #a08c78 !important;
  box-shadow: 0 24px 84px rgb(19 7 11 / 48%), inset 0 1px 0 var(--sc-inset) !important;
}
html[data-hub-theme="dark"] :is(.modal-overlay,.modal-backdrop,.dialog-scrim) { background: rgb(27 13 19 / 70%) !important; }
html[data-hub-theme="dark"] .hub-story-dialog::backdrop { background: rgb(23 11 17 / 73%) !important; backdrop-filter: blur(5px); }
html[data-hub-theme="dark"] :is(.hub-story-header,.hub-story-layout,.hub-story-preview,.hub-story-options) {
  border-color: var(--sc-line) !important;
  background: transparent !important;
}
html[data-hub-theme="dark"] .hub-story-preview {
  background: radial-gradient(ellipse at 48% 42%,rgb(201 162 109 / 15%),transparent 69%) !important;
}
html[data-hub-theme="dark"] .hub-story-preview img { border-color: var(--sc-edge) !important; background: #301d25 !important; }
html[data-hub-theme="dark"] .hub-story-placeholder { background: linear-gradient(145deg,#432832,#251d20) !important; }
html[data-hub-theme="dark"] :is(.hub-story-date,.hub-story-context,.hub-story-dialog .hub-story-options p,.hub-story-size,.hub-story-option-note,.hub-story-placeholder-mark) { color: var(--sc-sub) !important; }

/* Freestanding Google sign-in and approval screens. The original form elements
   stay in their source order and remain keyboard reachable at every width. */
html[data-hub-theme="dark"] #root:has(> .welcome-screen) {
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(20px,6vh,70px) clamp(20px,7.8vw,148px);
}
html[data-hub-theme="dark"] .welcome-screen {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  align-items: stretch !important;
  justify-content: center !important;
  text-align: left !important;
  gap: 18px !important;
  width: min(100%,590px) !important;
  max-width: none !important;
  min-height: unset !important;
  height: auto !important;
  margin: 0 0 0 auto !important;
  padding: clamp(24px,3.7vw,65px) !important;
  background: transparent !important;
  border-radius: 30px !important;
  color: var(--sc-text) !important;
}
html[data-hub-theme="dark"] .welcome-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--sc-glass);
  border: 1px solid var(--sc-edge);
  border-radius: inherit;
  box-shadow: var(--sc-shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
html[data-hub-theme="dark"] .welcome-screen h1 {
  font-size: clamp(33px,3.4vw,56px) !important;
  margin-block: 0 !important;
  text-wrap: balance;
}
html[data-hub-theme="dark"] .welcome-screen > p {
  color: var(--sc-sub) !important;
  margin: 0 !important;
  font-size: clamp(16px,1.4vw,21px) !important;
  line-height: 1.55 !important;
  max-width: 46ch;
}
html[data-hub-theme="dark"] :is(.welcome-actions,.access-links) {
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 12px;
}
html[data-hub-theme="dark"] :is(.welcome-approval,.access-card,.access-pending,.hub-access-pending) {
  background: rgb(64 45 49 / 67%) !important;
  border: 1px solid var(--sc-line) !important;
  color: var(--sc-sub) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  max-width: 100% !important;
}
html[data-hub-theme="dark"] .welcome-actions .google-button { width: 100%; min-height: 52px !important; }
html[data-hub-theme="dark"] .welcome-screen .eyebrow {
  color: var(--sc-gold) !important;
  letter-spacing: .13em !important;
  font-size: 13px !important;
}
@media (min-width:1000px) {
  html[data-hub-theme="dark"] .welcome-screen { width: clamp(460px,43vw,640px) !important; min-height: min(460px,70vh) !important; }
  html[data-hub-theme="dark"] .welcome-screen > .brand-logo-welcome {
    position: fixed !important;
    left: clamp(42px,8.5vw,172px) !important;
    top: calc(50vh - 130px) !important;
    width: clamp(108px,13vw,198px) !important;
    height: clamp(108px,13vw,198px) !important;
    margin: 0 !important;
  }
  html[data-hub-theme="dark"] .welcome-screen > .eyebrow {
    position: fixed !important;
    left: clamp(46px,8.8vw,178px) !important;
    top: calc(50vh + clamp(12px,5.5vw,85px)) !important;
    width: 29vw;
    color: var(--sc-text) !important;
    font-size: clamp(24px,2.5vw,44px) !important;
    font-weight: 650 !important;
    letter-spacing: -.032em !important;
    line-height: 1.2;
    text-shadow: 0 2px 12px #201318 !important;
  }
}
@media (max-width:999px) {
  html[data-hub-theme="dark"] .welcome-screen { margin-inline: auto !important; }
  html[data-hub-theme="dark"] .welcome-screen > .brand-logo-welcome { width: 64px !important; height: 64px !important; }
}
@media (max-width:600px) {
  html[data-hub-theme="dark"] #root:has(> .welcome-screen) { padding: 18px 12px; }
  html[data-hub-theme="dark"] .welcome-screen { padding: 22px 18px !important; border-radius: 22px !important; }
  html[data-hub-theme="dark"] .hub-scope-toolbar { padding: 12px !important; }
  html[data-hub-theme="dark"] :is(.hub-period-pair,.team-hub-kpis) { padding-inline: 12px !important; }
  html[data-hub-theme="dark"] :is(.panel .table-scroll,.panel .team-hub-table-wrap,.panel .daily-report-table-wrap,.panel .hub-profile-table-wrap) { max-width: 100%; min-width: 0; }
  html[data-hub-theme="dark"] .hub-current-report-tabs { gap: 3px; }
  html[data-hub-theme="dark"] .hub-story-dialog { border-radius: 18px !important; }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-hub-theme="dark"] {
    --sc-glass: #302528;
  }
  html[data-hub-theme="dark"] :is(.sidebar,.panel,.kpi-grid,.team-hub-kpis,.guide-header,.hub-elite,.hub-period-pair,.hub-scope-toolbar,.team-hub-controls) {
    background: #302528 !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
}
}

/* The global select wrapper carries the border, background, and icon; its
   child remains a native date-period selector with a transparent face. */
@layer stone-city {
@media screen and (forced-colors: none) {
  html[data-hub-theme="dark"] .hub-global-picker { max-width: 100%; }
  html[data-hub-theme="dark"] .hub-global-select {
    background: var(--sc-control) !important;
    color: var(--sc-text) !important;
    border-color: var(--sc-edge) !important;
    min-height: 44px !important;
    border-radius: 999px !important;
  }
  html[data-hub-theme="dark"] .hub-global-select select {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding-inline: 1.62rem 1.36rem !important;
    color: var(--sc-text) !important;
    -webkit-text-fill-color: var(--sc-text) !important;
  }
  html[data-hub-theme="dark"] .hub-global-select > svg { color: var(--sc-gold) !important; }
  html[data-hub-theme="dark"] .hub-edit-range { min-height: 44px; color: var(--sc-gold-light) !important; }
  html[data-hub-theme="dark"] .hub-period-dialog {
    background: linear-gradient(140deg,#422c33,#2c2024) !important;
    color: var(--sc-text) !important;
    border-color: #aa9074 !important;
  }
  html[data-hub-theme="dark"] .hub-period-dialog::backdrop { background: rgb(23 11 17 / 73%) !important; }
}
}

.hub-global-picker,.hub-global-select{display:inline-flex;align-items:center;gap:.45rem;min-width:0}
.hub-global-select{position:relative;isolation:isolate;padding:.12rem .72rem;min-height:2.55rem;border:1px solid #b9966c80;border-radius:1rem;background:#50232ddc;color:#f6ead5}
.hub-global-select svg,.hub-select-chevron{position:absolute;pointer-events:none}
.hub-global-select select{appearance:none;background:transparent;border:0;box-shadow:none;color:inherit;font:inherit;font-size:.92rem;font-weight:650;padding:.45rem 1.35rem .45rem 1.55rem;cursor:pointer;min-width:6.7rem}
.hub-global-select select option{background:#321d25;color:#f9f1e6}
.hub-select-chevron{right:.85rem;top:calc(50% - .2rem);width:.42rem;height:.42rem;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
.hub-global-select:focus-within,.hub-edit-range:focus-visible{outline:2px solid #eed396;outline-offset:2px}
.hub-edit-range{padding:.36rem .52rem;background:transparent;border:0;text-decoration:underline;color:#edcea4;cursor:pointer}
.hub-global-dates{padding:1rem;display:grid;gap:1rem}
.hub-global-dates .field input{width:100%}
@media(max-width:850px){.topbar .sync-state{display:none}.topbar-right{gap:.35rem}.topbar{gap:.5rem}.topbar .breadcrumb{min-width:0;overflow:hidden}.topbar .breadcrumb>span,.topbar .breadcrumb>strong{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}}
@media(max-width:520px){.topbar .breadcrumb>span,.topbar .breadcrumb>strong,.topbar .breadcrumb>svg{display:none}.topbar .topbar-divider{display:none}.topbar .topbar-right{flex-shrink:0}.hub-global-select{min-height:2.7rem}.hub-global-select select{font-size:1rem}.hub-edit-range{max-width:4rem;line-height:1.1}}
.hub-period-dialog{width:min(27rem,calc(100vw - 2rem));max-height:90dvh;box-sizing:border-box;margin:auto;padding:0;border:1px solid #bc976e80;border-radius:1.25rem;background:#2c1e23;color:#f6efe7;box-shadow:0 1.5rem 5rem #13080db3;color-scheme:dark}
.hub-period-dialog::backdrop{background:rgb(18 12 16 / .72)}
.hub-period-dialog-inner{padding:1.4rem}
.hub-period-dialog-title{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.hub-period-dialog-title h2{margin:0;font-size:1.28rem}
.hub-period-dialog .hub-global-dates{padding:1rem 0 0}
.overview-middle.hub-global-chart-only,.averages-grid.hub-global-trending{grid-template-columns:minmax(0,1fr)}
