/* Canonical CSS owner: shell. Historical layers consolidated 2026-08-02. */
.metric:last-child {
  border-right: 0px;
}

@keyframes metric-update {
  0% {
    opacity: 0.42;

    transform: translateY(4px);
  }

  55% {
    color: var(--blue-dark);
  }

  100% {
    opacity: 1;

    transform: translateY(0px);
  }
}

@keyframes view-enter {
  0% {
    opacity: 0;

    transform: translateY(7px);
  }

  100% {
    opacity: 1;

    transform: translateY(0px);
  }
}

.workspace-heading > span {
  color: var(--text-muted);

  font-size: 12px;
}

.status-bar > :last-child {
  text-align: right;
}

.module-tab:active {
  transform: scale(0.985);
}

.nav-label-mobile {
  display: none;
}

body.sidebar-collapsed .nav-group:first-of-type {
  margin-top: 10px;
}

body.sidebar-collapsed .nav-group + .nav-group {
  margin-top: 12px;

  padding-top: 12px;

  border-top: 1px solid var(--border);
}

@media (min-width: 768px) and (max-width: 1279px) {
  .header-actions {
    grid-column: 3;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .nav-group:first-of-type {
    margin-top: 10px;
  }

  .nav-group + .nav-group {
    margin-top: 12px;

    padding-top: 12px;

    border-top: 1px solid var(--border);
  }
}

@media (max-width: 767px) {
  .market-tape {
    display: none;
  }

  .header-command-group.is-open {
    display: flex;

    animation: command-menu-enter var(--motion-medium) var(--ease-out) both;
  }

  .module-nav .module-tab span {
    display: block;

    max-width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
  }

  body.sidebar-collapsed .module-nav .module-tab span {
    display: block;

    max-width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
  }

  .nav-label-desktop {
    display: none !important;
  }

  .nav-label-mobile {
    display: block !important;
  }

  .status-bar {
    display: none;
  }

  body:is(
    [data-active-view="screenerView"],
    [data-active-view="screenerTrackingView"],
    [data-active-view="mentorView"],
    [data-active-view="heavenView"],
    [data-active-view="reviewWorkspaceView"]
  ) .overview-strip {
    display: none;
  }
}

.market-breadth-panel .workspace-heading {
  padding: 0px;
}

.market-breadth-panel .workspace-heading > div span {
  display: block;

  margin-top: 3px;

  color: var(--text-secondary);

  font-size: 11px;
}

.market-breadth-panel .workspace-heading > strong {
  color: var(--text-primary);

  font-size: 16px;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 220px 1fr;
  }

  .market-tape {
    grid-area: 2 / 1 / auto / -1;

    padding-top: 8px;

    border-top: 1px solid var(--line);
  }

  .header-actions {
    justify-self: end;
  }

  .overview-strip {
    grid-template-columns: minmax(190px, 1.3fr) repeat(3, minmax(100px, 1fr));
  }

  .metric {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .app-header {
    grid-template-columns: 1fr;

    gap: 10px;
  }

  .market-tape {
    grid-area: auto / 1;

    justify-self: stretch;
  }

  .header-actions {
    grid-area: auto / 1;

    justify-self: stretch;

    overflow-x: auto;
  }

  .module-nav {
    padding: 0px 8px;
  }

  .app-main {
    padding: 10px 8px 18px;
  }

  .overview-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric {
    padding: 10px;
  }

  .metric-value {
    font-size: 17px;
  }

  .section-toolbar {
    align-items: flex-start;

    flex-direction: column;
  }

  .status-bar {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 520px) {
  .market-tape {
    gap: 12px;

    overflow-x: auto;
  }

  .overview-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title-group {
    align-items: flex-start;

    flex-direction: column;

    gap: 3px;
  }
}

.trade-journal-section > .workspace-heading {
  padding: 16px 16px 0px;
}

.metric-value.small {
  font-size: 14px;
}

.section-toolbar h2 {
  margin: 0px;

  letter-spacing: 0px;

  white-space: nowrap;

  color: var(--text-primary);

  font-size: 18px;

  font-weight: 770;
}

@media (min-width: 768px) and (max-width: 1279px) {
  body.sidebar-collapsed .module-nav {
    width: 68px;

    padding: 8px 7px 12px;
  }

  .module-tab.active::before {
    inset: 8px auto 8px -7px;
  }

  .overview-strip {
    grid-template-columns: minmax(210px, 1.3fr) repeat(5, minmax(90px, 0.7fr));
  }
}

@media (max-width: 767px) {
  .header-command-group {
    position: fixed;

    z-index: 55;

    display: none;

    align-items: stretch;

    flex-direction: column;

    gap: 3px;

    background: var(--surface);

    box-shadow: var(--shadow);

    top: 104px;

    right: 10px;

    width: 210px;

    padding: 7px;

    border-color: var(--border);

    border-radius: 8px;
  }

  .module-nav .module-tab .lucide {
    width: 20px;

    height: 20px;
  }

  .module-nav .module-tab.active::before {
    display: none;
  }

  .module-nav .module-tab.mobile-active::before {
    display: none;
  }

  .module-nav .module-tab.active {
    background: rgb(238, 245, 252);

    color: var(--action);
  }

  .module-nav .module-tab.mobile-active {
    background: rgb(238, 245, 252);

    color: var(--action);
  }

  .overview-strip .metric:nth-of-type(5) {
    grid-area: 3 / 1 / auto / 2;

    border-bottom: 0px;
  }

  .overview-strip .metric:nth-of-type(6) {
    grid-area: 3 / 2 / auto / 4;

    border-right: 0px;

    border-bottom: 0px;
  }

  .metric-value {
    font-size: 16px;
  }

  .metric-value.small {
    font-size: 12px;
  }

  .section-toolbar {
    min-height: 58px;

    align-items: flex-start;

    padding: 11px 13px;
  }

  .section-title-group {
    align-items: flex-start;

    flex-wrap: wrap;

    gap: 4px 8px;
  }

  .section-title-group h2 {
    font-size: 18px;
  }

  .section-toolbar h2 {
    font-size: 18px;
  }

  .section-subtitle {
    width: 100%;

    font-size: 11px;
  }

  .workspace-heading {
    min-height: 52px;

    padding: 9px 13px;
  }
}

.module-tab:focus-visible {
  outline-color: rgba(29, 101, 193, 0.48);
}

body.sidebar-collapsed .module-tab {
  justify-content: center;

  padding: 0px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .module-tab span {
    display: none;
  }

  .nav-group-label {
    display: none;
  }

  .module-tab {
    justify-content: center;

    padding: 0px;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .module-tab span {
    display: none;
  }

  .nav-group-label {
    display: none;
  }

  .module-tab {
    justify-content: center;

    padding: 0px;
  }
}

@media (max-width: 767px) {
  .header-date-group .icon-button {
    width: 30px;

    min-width: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .module-tab {
    animation: auto ease 0s 1 normal none running none;

    transition: none;
  }
}

.metric-value {
  max-width: 100%;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  font-size: 20px;

  font-weight: 760;

  font-variant-numeric: tabular-nums;
}

.market-item strong.metric-changed {
  animation: metric-update 560ms var(--ease-out);
}

.metric-value.metric-changed {
  animation: metric-update 560ms var(--ease-out);
}

.market-breadth-panel .workspace-heading > strong.metric-changed {
  animation: metric-update 560ms var(--ease-out);
}

.metric {
  flex-direction: column;

  justify-content: center;

  min-width: 0px;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 11px 15px;

  border-right-color: var(--border);
}

@media (max-width: 767px) {
  .metric {
    gap: 2px;

    min-height: 0px;

    padding: 8px 10px;

    border-right: 1px solid var(--border);

    border-bottom: 1px solid var(--border);
  }
}

.metric-label {
  white-space: nowrap;

  color: var(--text-secondary);

  font-size: 11px;
}

@media (max-width: 767px) {
  .metric-label {
    font-size: 10.5px;
  }
}

.market-item.up strong {
  color: var(--danger);
}

.market-item.down strong {
  color: var(--success);
}

.module-tab:hover {
  background: var(--xb-gray-50);

  color: var(--text-primary);
}

.module-tab.active .lucide {
  stroke-width: 2.15;

  color: var(--primary);
}

body.sidebar-collapsed .app-main {
  margin-left: 0px;
}

.overview-toggle .lucide {
  width: 14px;

  height: 14px;
}

.workspace-view.active-view {
  display: block;
}

.workspace-view.active-view.view-entering {
  animation: 240ms ease 0s 1 normal both running xb-view-enter;
}

.section-title-group {
  display: flex;

  align-items: baseline;

  gap: 9px;

  min-width: 0px;
}

@media (max-width: 1280px) {
  .overview-strip {
    grid-template-columns: minmax(160px, 1.15fr) repeat(5, minmax(64px, 0.5fr)) minmax(150px, 1fr) 82px;

    padding: 0px 10px;
  }

  .overview-strip .metric {
    padding: 0px 8px;
  }

  .overview-toggle span {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-main {
    margin-left: 0px;
  }

  .workspace-view {
    padding: 10px 10px 84px;
  }

  .overview-strip {
    grid-template-columns: minmax(150px, 1.3fr) repeat(3, minmax(58px, 0.5fr));

    padding: 0px 8px;
  }

  .overview-strip .metric:nth-of-type(n+4) {
    display: none;
  }

  .overview-toggle {
    justify-content: center;
  }

  .overview-strip[data-overview-expanded="true"] {
    grid-template-columns: repeat(3, 1fr);

    padding: 8px;
  }

  .overview-strip[data-overview-expanded="true"] .metric:nth-of-type(n) {
    min-height: 54px;

    display: flex;

    border-bottom: 1px solid var(--border);
  }

  .overview-strip[data-overview-expanded="true"] .overview-toggle {
    min-height: 54px;
  }

  .section-toolbar {
    align-items: flex-start;

    flex-wrap: wrap;
  }

  .section-title-group {
    align-items: flex-start;

    flex-direction: column;

    gap: 2px;
  }
}

@media (max-width: 767px) {
  .module-nav .market-sub-tab {
    display: none;
  }

  .module-nav .nav-group-label {
    display: none;
  }

  .module-nav .nav-group {
    display: contents;

    margin: 0px;

    padding: 0px;

    border: 0px;
  }

  body.sidebar-collapsed .module-nav .nav-group {
    display: contents;

    margin: 0px;

    padding: 0px;

    border: 0px;
  }

  .module-nav .module-tab.mobile-primary-tab {
    display: flex;
  }

  body.sidebar-collapsed .module-nav .module-tab.mobile-primary-tab {
    display: flex;
  }

  .overview-strip {
    min-height: 108px;

    grid-template-columns: 1.3fr 1fr 1fr;

    grid-template-rows: 54px 54px;

    margin-bottom: 8px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);
  }

  .overview-strip .metric:nth-of-type(1) {
    grid-area: 1 / 2;
  }

  .overview-strip .metric:nth-of-type(2) {
    border-right: 0px;

    grid-area: 1 / 3;
  }

  .overview-strip .metric:nth-of-type(3) {
    grid-area: 2 / 2;
  }

  .overview-strip .metric:nth-of-type(4) {
    border-right: 0px;

    grid-area: 2 / 3;

    display: flex;
  }

  .overview-strip .metric:nth-of-type(n+5) {
    display: none;
  }

  .overview-strip .metric {
    min-height: 54px;
  }

  .overview-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-view.active-view.view-entering {
    animation: auto ease 0s 1 normal none running none !important;

    transition: none !important;
  }
}

.brand-mark {
  place-items: center;

  font-weight: 800;

  display: block;

  flex: 0 0 36px;

  border: 1px solid var(--r2-line);

  border-radius: 7px;

  background: transparent;

  color: var(--action);

  font-size: 0px;

  overflow: hidden;

  width: 27px;

  height: 27px;
}

.market-item {
  color: var(--text-muted);

  font-size: 12px;

  white-space: nowrap;
}

.market-item strong {
  margin-left: 5px;

  color: var(--text-primary);

  font-variant-numeric: tabular-nums;

  font-size: 12px;

  white-space: nowrap;
}

.header-date-group .lucide {
  width: 14px;

  height: 14px;
}

.header-actions > .icon-button:hover {
  border-color: transparent;

  background: var(--control-hover);

  color: var(--primary);
}

.header-actions > .icon-button .lucide {
  width: 15px;

  height: 15px;

  stroke-width: 1.8;
}

.module-tab {
  cursor: pointer;

  white-space: nowrap;

  width: 100%;

  min-width: 0px;

  display: flex;

  align-items: center;

  border: 0px;

  background: transparent;

  text-align: left;

  color: var(--text-secondary);

  transition: color var(--duration-fast), background var(--duration-fast);

  min-height: 34px;

  gap: 8px;

  padding: 0px 10px;

  border-radius: var(--radius-md);

  font-size: 12.5px;

  font-weight: 500;
}

.module-tab .lucide {
  flex: 0 0 17px;

  width: 15px;

  height: 15px;

  stroke-width: 1.75;

  color: var(--text-tertiary);
}

.module-tab.active {
  border: 0px;

  background: var(--surface-selected);

  color: var(--primary);

  box-shadow: none;

  position: relative;

  font-weight: var(--font-weight-semibold);
}

.module-tab.active::before {
  content: "";

  width: 3px;

  position: absolute;

  inset: 8px auto 8px 0px;

  border-radius: 0px 3px 3px 0px;

  background: var(--primary);
}

.status-bar #statusText {
  display: block;

  flex: 1 1 0%;

  text-align: left;
}

.status-bar #updatedAt {
  display: block;

  flex: 1 1 0%;

  text-align: right;
}

.status-bar #updatedAt[data-tone="warning"] {
  color: var(--warning);
}

.status-bar .risk-note {
  display: block;

  flex: 1 1 0%;

  margin: 0px;

  text-align: center;
}

.status-bar .ok {
  color: var(--down);
}

.section-toolbar {
  justify-content: space-between;

  display: flex;

  gap: 12px;

  margin: 0px 0px 10px;

  padding: 0px;

  border: 0px;

  background: transparent;

  min-height: 34px;
}

.section-title-group h2 {
  margin: 0px;

  color: var(--text-primary);

  line-height: 1.25;

  font-size: 17px;

  font-weight: 800;
}

.section-subtitle {
  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  color: var(--text-tertiary);

  font-size: 11.5px;
}

@media (min-width: 1280px) and (max-width: 1510px) {
  .market-tape {
    gap: 10px;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .app-header {
    padding-left: 8px;

    grid-template-columns: 176px minmax(0px, 1fr) auto;
  }

  .app-header .market-tape {
    display: flex;
  }

  .module-nav {
    padding: 8px 7px 12px;

    width: 64px;
  }
}

@media (max-width: 767px) {
  body.sidebar-collapsed {
    display: block;

    min-height: 100dvh;

    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .app-header {
    grid-template-columns: minmax(0px, 1fr) auto;

    gap: 8px;

    border-bottom-color: var(--border);

    background: rgba(255, 255, 255, 0.98);

    width: 100%;

    height: var(--mobile-header-height);

    min-height: var(--mobile-header-height);

    position: relative;

    display: flex;

    align-items: center;

    padding: var(--mobile-shell-pad) 10px;
  }

  .brand-mark {
    width: 34px;

    height: 34px;
  }

  .header-actions {
    grid-area: 1 / 2;

    position: static;

    inset: auto;

    display: flex;

    justify-content: flex-start;

    gap: var(--space-4);
  }

  .header-date-group {
    gap: 1px;

    height: 36px;

    min-width: 0px;

    flex: 1 1 auto;
  }

  .header-date-group > .icon-button {
    display: none;
  }

  .header-date-group .date-input {
    min-width: 0px;

    font-size: 11.5px;

    width: 100%;

    flex: 1 1 0%;
  }

  .header-actions > .icon-button {
    width: 36px;

    min-width: 36px;

    min-height: 36px;
  }

  .module-nav {
    backdrop-filter: saturate(150%) blur(10px);

    width: 100%;

    height: calc(64px + env(safe-area-inset-bottom));

    min-height: 64px;

    position: fixed;

    inset: auto 0px 0px;

    z-index: 45;

    display: grid;

    grid-template-columns: repeat(5, minmax(0px, 1fr));

    align-items: stretch;

    padding: 4px 4px max(4px, env(safe-area-inset-bottom));

    overflow: hidden;

    border-top: 1px solid var(--border);

    border-right: 0px;

    background: rgba(255, 255, 255, 0.98);

    box-shadow: rgba(16, 24, 40, 0.08) 0px -5px 18px;
  }

  body.sidebar-collapsed .module-nav {
    backdrop-filter: saturate(150%) blur(10px);

    width: 100%;

    height: calc(64px + env(safe-area-inset-bottom));

    min-height: 64px;

    position: fixed;

    inset: auto 0px 0px;

    z-index: 45;

    display: grid;

    grid-template-columns: repeat(5, minmax(0px, 1fr));

    align-items: stretch;

    padding: 4px 4px max(4px, env(safe-area-inset-bottom));

    overflow: hidden;

    border-top: 1px solid var(--border);

    border-right: 0px;

    background: rgba(255, 255, 255, 0.98);

    box-shadow: rgba(16, 24, 40, 0.08) 0px -5px 18px;
  }

  .module-nav .module-tab {
    text-align: center;

    border-radius: 6px;

    display: none;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: 3px;

    padding: 3px 2px;

    font-size: 10px;

    min-height: 54px;
  }

  body.sidebar-collapsed .module-nav .module-tab {
    text-align: center;

    border-radius: 6px;

    display: none;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: 3px;

    padding: 3px 2px;

    font-size: 10px;

    min-height: 54px;
  }

  .app-main {
    width: 100%;

    min-height: calc(-176px + 100dvh);

    margin: 0px;

    padding: 10px 8px 20px;
  }

  .workspace-view {
    margin-top: 0px;

    border-radius: 7px;

    padding: 0px 0px 76px;
  }
}

.brand-glyph {
  font-family: "Songti SC", SimSun, serif;

  font-size: 14px;

  font-weight: 800;

  line-height: 1;
}

.workspace-view:not(#heavenView) .section-toolbar:first-child {
  min-height: 32px;

  margin-bottom: 10px;
}

@media (min-width: 901px) {
  .workspace-view:not(#heavenView) {
    padding: 14px 16px 22px;
  }

  .workspace-view:not(#heavenView) > .section-toolbar:first-child {
    min-height: 34px;

    margin: 0px 0px 10px;
  }
}

.workspace-view:not(#heavenView) .section-title-group {
  gap: 9px;
}

.workspace-view:not(#heavenView) .section-title-group h2 {
  font-size: 17px;

  font-weight: 800;
}

.workspace-view:not(#heavenView) .section-subtitle {
  color: rgb(152, 161, 178);

  font-size: 11.5px;
}

.workspace-heading {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 12px;

  margin-bottom: 10px;

  border-bottom-color: var(--border);

  min-height: 42px;

  padding: 9px 14px;
}

.workspace-heading h3 {
  margin: 0px;

  color: var(--text-primary);

  font-size: 14px;

  font-weight: 750;
}

body.sidebar-collapsed {
  grid-template-columns: 64px minmax(0px, 1fr);
}

.sidebar-brand {
  height: var(--size-topbar);

  min-height: var(--size-topbar);

  display: flex;

  align-items: center;

  gap: 8px;

  margin: 0px -8px 7px;

  padding: 0 16px;

  border-bottom: 1px solid var(--r2-line-soft);

  white-space: nowrap;
}

.sidebar-brand-mark {
  width: 26px;

  height: 26px;

  flex: 0 0 26px;

  display: grid;

  place-items: center;

  border-radius: 7px;

  background: var(--r2-blue);

  color: var(--on-action);

  font-size: 14px;

  font-weight: 700;
}

.sidebar-brand strong {
  color: var(--r2-ink);

  font-size: 15px;

  font-weight: 700;
}

.nav-group {
  flex-direction: column;

  gap: 1px;

  display: block;

  margin: 0px;

  padding: 0px;

  border: 0px;
}

body.sidebar-collapsed .module-nav .nav-group {
  display: block;

  margin: 0px;

  padding: 0px;

  border: 0px;
}

.nav-group + .nav-group {
  margin-top: 0px;

  padding-top: 0px;

  border: 0px;
}

body.sidebar-collapsed .module-nav .nav-group + .nav-group {
  margin-top: 0px;

  padding-top: 0px;

  border: 0px;
}

.nav-group-label {
  display: flex;

  align-items: center;

  height: auto;

  padding: 12px 10px 4px;

  color: var(--text-3);

  font-size: var(--fs-aux);

  font-weight: 600;

  letter-spacing: .04em;
}

.module-nav .module-tab {
  width: 100%;

  min-height: 36px;

  display: flex;

  align-items: center;

  justify-content: flex-start;

  gap: 8px;

  margin: 0px 0px 1px;

  padding: 7px 10px;

  border: 0px;

  border-radius: var(--radius-md);

  background: transparent;

  color: var(--text-2);

  font-size: var(--fs-table);

  font-weight: 400;
}

.module-nav .module-tab .lucide {
  width: 16px;

  height: 16px;

  flex: 0 0 16px;

  opacity: 0.75;

  stroke-width: 1.8;
}

.module-nav .module-tab:hover {
  background: var(--hover);

  color: var(--text-1);
}

.module-nav .module-tab.active {
  background: var(--selected);

  color: var(--accent);

  font-weight: 600;
}

.module-nav .module-tab.mobile-active {
  background: var(--selected);

  color: var(--accent);

  font-weight: 600;
}

.module-nav .module-tab.active::before {
  display: block;
}

.module-nav .module-tab.mobile-active::before {
  display: block;
}

body.sidebar-collapsed .module-nav {
  position: fixed;

  inset: 0px auto 0px 0px;

  z-index: 60;

  height: 100vh;

  display: flex;

  flex-direction: column;

  padding: 0px 8px 8px;

  overflow: hidden auto;

  border-right: 1px solid var(--r2-line);

  background: var(--surface);

  width: 64px;

  padding-inline: 7px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;

  margin-inline: -7px;

  padding-inline: 0px;
}

body.sidebar-collapsed .module-tab span {
  display: none;
}

body.sidebar-collapsed .nav-group-label {
  display: none;
}

body.sidebar-collapsed .sidebar-brand strong {
  display: none;
}

body.sidebar-collapsed .module-nav .module-tab {
  width: 100%;

  min-height: 34px;

  display: flex;

  align-items: center;

  gap: 8px;

  margin: 0px 0px 1px;

  padding: 7px 10px;

  border: 0px;

  border-radius: 7px;

  background: transparent;

  color: var(--text-secondary);

  font-size: 13px;

  font-weight: 400;

  justify-content: center;

  padding-inline: 0px;
}

.market-tape .market-item {
  color: var(--r2-sub);
}

.market-tape .market-item strong {
  color: var(--r2-ink);

  font-weight: 600;
}

.market-tape .market-item.up strong {
  color: var(--r2-up);
}

.market-tape .market-item.down strong {
  color: var(--r2-down);
}

.header-actions {
  place-self: center end;

  grid-area: 1 / 3;

  min-width: 0px;

  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 6px;

  margin-left: auto;
}

.header-date-group {
  box-shadow: none;

  min-height: 32px;

  height: 30px;

  display: flex;

  align-items: center;

  gap: 2px;

  padding: 0px 3px;

  border: 1px solid var(--r2-line);

  border-radius: 7px;

  background: var(--control-surface);
}

.header-date-group .date-input {
  font-weight: 650;

  width: 118px;

  height: 28px;

  padding: 0px 4px;

  border: 0px;

  background: transparent;

  color: var(--r2-ink);

  font-size: 12px;
}

.header-actions > .icon-button {
  width: 30px;

  min-height: 30px;

  height: 30px;

  padding: 0px;

  border: 1px solid var(--r2-line);

  border-radius: 7px;

  background: var(--control-surface);

  color: var(--text-secondary);

  box-shadow: none;
}

.header-date-group .icon-button {
  width: 30px;

  min-height: 30px;

  height: 30px;

  padding: 0px;

  border-radius: 7px;

  background: var(--control-surface);

  color: var(--text-secondary);

  box-shadow: none;

  border: 0px;
}

.header-actions .icon-button:hover {
  border-color: var(--r2-blue-line);

  color: var(--r2-blue);
}

.header-actions .icon-button .lucide {
  width: 15px;

  height: 15px;
}

.header-command-group {
  display: flex;

  align-items: center;

  gap: 6px;
}

.app-main {
  background: var(--surface-canvas);

  grid-area: 2 / 2;

  width: auto;

  min-width: 0px;

  min-height: 0px;

  margin: 0px;

  padding: 0 var(--page-pad-x) var(--page-pad-y);

  overflow: auto;
}

.overview-strip {
  position: relative;

  gap: 0px;

  grid-template-columns: minmax(178px, 1.15fr) repeat(5, minmax(68px, 0.52fr)) minmax(168px, 0.9fr) 92px;

  height: var(--summary-height);

  min-height: var(--summary-height);

  display: flex;

  align-items: stretch;

  margin: 0px -16px;

  padding: 0px 16px;

  overflow-x: auto;

  overflow-y: hidden;

  scrollbar-width: none;

  border-top: 0px;

  border-right: 0px;

  border-left: 0px;

  border-image: none;

  border-bottom: 1px solid var(--r2-line);

  border-radius: 0px;

  background: var(--surface);

  box-shadow: none;
}

.overview-strip::-webkit-scrollbar {
  display: none;
}

.overview-strip .row {
  display: flex;

  align-items: center;

  gap: 18px;

  padding: 7px var(--page-pad-x);

  flex-shrink: 0;

  font-size: 12px;

  color: var(--sub);
}

.overview-strip .row b {
  color: var(--ink);

  font-weight: 600;
}

.overview-strip .emo {
  display: inline-flex;

  align-items: center;

  gap: 6px;
}

.overview-strip .emo .dot {
  width: 8px;

  height: 8px;

  border-radius: 50%;

  background: var(--up);
}

.overview-strip .toggle {
  margin-left: auto;

  color: var(--blue);

  font-size: 12px;
}

.overview-strip .full {
  display: none;

  grid-template-columns: repeat(7, 1fr);

  gap: 1px;

  background: var(--line-soft);

  border-top: 1px solid var(--line-soft);
}

.overview-strip.open .full {
  display: grid;
}

.overview-strip .full .cell {
  background: var(--surface);

  padding: 10px 16px;
}

.overview-strip .full .k {
  font-size: 11px;

  color: var(--faint);
}

.overview-strip .full .v {
  font-size: 18px;

  font-weight: 700;

  margin-top: 2px;
}

.overview-strip .metric {
  background: transparent;

  min-width: 0px;

  min-height: 33px;

  display: flex;

  flex: 0 0 auto;

  flex-direction: row;

  align-items: center;

  gap: 6px;

  padding: 0px 10px;

  border: 0px;
}

.overview-strip .metric-label {
  color: var(--r2-sub);

  font-size: 11px;

  white-space: nowrap;
}

.overview-strip .metric-value {
  font-variant-numeric: tabular-nums;

  color: var(--r2-ink);

  font-size: 12px;

  font-weight: 600;

  white-space: nowrap;
}

.overview-strip .metric-value.small {
  overflow: hidden;

  text-overflow: ellipsis;

  font-size: 11.5px;
}

.overview-strip .metric-value.up {
  color: var(--r2-up);
}

.overview-strip .metric-value.down {
  color: var(--r2-down);
}

.overview-strip .metric-value.warning {
  color: var(--r2-amber);
}

.overview-toggle {
  display: inline-flex;

  align-items: center;

  justify-content: flex-end;

  gap: 4px;

  background: transparent;

  cursor: pointer;

  min-width: max-content;

  min-height: 33px;

  margin-left: auto;

  padding: 0px;

  border: 0px;

  color: var(--r2-blue);

  font-size: 12px;
}

.overview-strip[data-overview-expanded="true"] .metric-value {
  font-size: 18px;
}

.workspace-view {
  display: none;

  overflow: hidden;

  width: auto;

  max-width: none;

  margin: 0;

  border-width: 0px;

  border-style: none;

  border-image: none;

  padding: var(--page-pad-y) 0 24px;

  border-color: transparent;

  border-radius: 0;

  background: transparent;

  box-shadow: none;
}

.status-bar {
  grid-template-columns: 1fr auto 1fr;

  gap: 16px;

  position: fixed;

  right: 0px;

  bottom: 0px;

  left: var(--sidebar-width);

  z-index: 55;

  grid-area: 3 / 2;

  width: auto;

  min-height: var(--statusbar-height);

  height: var(--statusbar-height);

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 0 var(--page-pad-x);

  border-top: 1px solid var(--line);

  background: var(--header-bg);

  color: var(--text-3);

  font-size: var(--fs-aux);
}

body.sidebar-collapsed .status-bar {
  left: 64px;
}

.redesigned-page-head .section-title-group {
  display: flex;

  align-items: baseline;

  gap: 12px;
}

.redesigned-page-head .section-title-group h2 {
  color: var(--r2-ink);

  font-size: 17px;

  font-weight: 800;
}

.redesigned-page-head .section-subtitle {
  color: var(--r2-faint);

  font-size: 12px;

  font-weight: 400;
}

.redesigned-page-head .section-subtitle b {
  font-weight: 400;
}

@media (max-width: 1180px) {
  .market-tape .market-item:nth-child(n+3) {
    display: none;
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  .module-nav {
    width: 64px;

    padding-inline: 7px;
  }

  .sidebar-brand {
    justify-content: center;

    margin-inline: -7px;

    padding-inline: 0px;
  }

  .module-nav .module-tab span {
    display: none;
  }

  .module-nav .nav-group-label {
    display: none;
  }

  .sidebar-brand strong {
    display: none;
  }

  .module-nav .module-tab {
    justify-content: center;

    padding-inline: 0px;
  }
}

@media (max-width: 767px), (max-width: 1023px) and (max-height: 600px) {
  .redesigned-page-head .section-title-group {
    width: 100%;

    flex-wrap: wrap;
  }

  .status-bar {
    display: none;
  }
}

@media (min-width: 768px) {
  .app-main {
    min-height: 0px;

    overscroll-behavior: contain;
  }
}

@media (min-width: 901px) {
  .workspace-view:is(#auctionView, #themeLibraryView, #popularityView, #dragonView) {
    width: auto;

    margin: 0;

    padding: var(--page-pad-y) var(--page-pad-x) 22px;

    overflow: visible;

    border: 0px;

    border-radius: 0px;

    background: transparent;

    box-shadow: none;
  }
}

.module-nav {
  grid-area: 2 / 1 / 4;

  min-height: 480px;

  align-self: start;

  align-items: stretch;

  gap: 0px;

  border-bottom: 0px;

  scrollbar-width: thin;

  inset: 0px auto 0px 0px;

  height: 100vh;

  padding: 0px 8px 8px;

  overflow: hidden auto;

  position: fixed;

  width: var(--sidebar-width);

  background: var(--header-bg);

  border-right: 1px solid var(--line);

  display: flex;

  flex-direction: column;

  z-index: 60;
}

.module-nav .sidebar-brand {
  height: var(--size-topbar);

  min-height: var(--size-topbar);

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 0 16px;

  border-bottom: 1px solid var(--line-soft);
}

.module-nav .sidebar-brand .sidebar-brand-mark {
  width: 26px;

  height: 26px;

  border-radius: 7px;

  background: var(--blue);

  color: var(--text-inverse);

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 14px;

  font-weight: 700;
}

.module-nav .sidebar-brand b {
  font-size: 15px;
}

.nav {
  flex: 1 1 0%;

  overflow-y: auto;

  padding: 8px;
}

.nav .group {
  font-size: 11px;

  color: var(--faint);

  padding: 12px 10px 4px;
}

.nav .item {
  display: flex;

  align-items: center;

  gap: 8px;

  padding: 7px 10px;

  border-radius: 7px;

  color: rgb(55, 65, 81);

  font-size: 13px;

  margin-bottom: 1px;

  cursor: default;
}

.nav .item .ico {
  width: 16px;

  text-align: center;

  opacity: 0.75;
}

.nav .item.active {
  background: var(--blue-soft);

  color: var(--blue);

  font-weight: 600;
}

.nav .item.dis {
  opacity: 0.55;
}

.main {
  margin-left: var(--sidebar-width);

  min-width: 0;

  overflow-x: hidden;
}

@media (min-width: 1280px) {
  .main {
    min-width: 1080px;
  }
}

.app-header {
  grid-template-columns: 200px minmax(260px, 1fr) auto;

  grid-area: 1 / 2;

  width: auto;

  min-height: var(--topbar-height);

  box-shadow: none;

  backdrop-filter: none;

  position: sticky;

  top: 0px;

  z-index: 50;

  background: var(--header-bg);

  border-bottom: 1px solid var(--border);

  display: flex;

  align-items: center;

  gap: var(--header-cluster-gap);

  padding: 0 var(--header-pad-x);

  height: var(--topbar-height);
}

.market-tape {
  overflow: hidden;

  grid-area: 1 / 2;

  align-self: center;

  min-width: 0px;

  white-space: nowrap;

  display: flex;

  align-items: center;

  gap: 14px;

  font-size: 12px;

  color: var(--sub);
}

.market-tape b {
  font-weight: 600;
}

.market-tape .up {
  color: var(--up);
}

.market-tape .down {
  color: var(--down);
}

.workspace-view.page:not(#heavenView) {
  margin-top: 0px;

  border: 0px;

  border-radius: 0px;

  background: transparent;

  box-shadow: none;
}

.workspace-view.page:not(#heavenView) > :last-child {
  margin-bottom: 0px;
}

.overview-strip[data-overview-expanded="true"] {
  height: 70px;

  min-height: 76px;

  display: grid;

  grid-template-columns: repeat(7, minmax(110px, 1fr)) auto;

  padding: 0px;

  gap: 0px;

  padding-inline: var(--page-pad-x);

  background: var(--card);
}

.overview-strip[data-overview-expanded="true"] .metric {
  min-height: 76px;

  flex-direction: column;

  align-items: flex-start;

  justify-content: center;

  gap: 4px;

  padding: 10px 16px;

  border-right: 1px solid var(--line-soft);

  background: transparent;
}

.overview-strip[data-overview-expanded="true"] .overview-toggle {
  justify-content: center;

  padding: 0px 12px;

  border-right: 0px;

  background: transparent;
}

@media (min-width: 768px) {
  body:is([data-active-view="sentimentCycleView"], [data-active-view="yesterdayView"]) .app-main {
    height: var(--workspace-height);

    min-height: 0px;

    display: flex;

    flex-direction: column;

    overflow: hidden;
  }

  body:is([data-active-view="sentimentCycleView"], [data-active-view="yesterdayView"]) .app-main .overview-strip {
    flex: 0 0 auto;
  }

  body:is([data-active-view="auctionView"], [data-active-view="themeLibraryView"], [data-active-view="popularityView"], [data-active-view="mentorView"], [data-active-view="rotationView"]) .app-main {
    height: var(--workspace-height);

    min-height: 0px;

    display: flex;

    flex-direction: column;

    overflow: hidden;
  }

  body:is([data-active-view="auctionView"], [data-active-view="themeLibraryView"], [data-active-view="popularityView"], [data-active-view="mentorView"], [data-active-view="rotationView"]) .app-main .overview-strip {
    flex: 0 0 auto;
  }

  body:is([data-active-view="auctionView"], [data-active-view="themeLibraryView"], [data-active-view="popularityView"], [data-active-view="mentorView"], [data-active-view="rotationView"]) .workspace-view.active-view {
    min-height: 0px;

    flex: 1 1 auto;

    overflow: hidden;
  }

  :root body:is([data-active-view="sentimentCycleView"], [data-active-view="rotationView"], [data-active-view="screenerView"], [data-active-view="ladderView"], [data-active-view="reviewWorkspaceView"]) .app-main {
    height: var(--workspace-height);

    min-height: 0px;

    display: block;

    overflow: hidden auto;
  }
}

@media (max-width: 767px), (max-width: 1023px) and (max-height: 600px) {
  body.sidebar-collapsed {
    display: block;

    padding-bottom: var(--mobile-nav-height);
  }

  .main {
    width: 100%;

    min-width: 0px;

    margin-left: 0px;
  }

  .app-header {
    position: sticky;

    width: 100%;

    height: auto;

    min-height: var(--mobile-header-height);

    padding: var(--mobile-shell-pad);
  }

  .app-header .market-tape {
    display: flex;
  }

  .header-actions {
    width: 100%;
  }

  .header-command-group {
    position: fixed;

    top: calc(var(--mobile-header-height) + var(--space-4));

    right: var(--mobile-shell-pad);

    display: none;
  }

  .header-command-group.is-open {
    display: flex;
  }

  .module-nav {
    display: flex;

    inset: auto 0px 0px;

    width: 100%;

    height: var(--mobile-nav-height);

    min-height: var(--mobile-nav-height);

    max-height: var(--mobile-nav-height);

    flex-direction: row;

    justify-content: space-around;

    padding: 0px;

    overflow: hidden;

    border-right: 0px;

    border-bottom: 0px;

    border-left: 0px;

    border-image: none;

    border-top: 1px solid var(--line);
  }

  body.sidebar-collapsed .module-nav {
    display: flex;

    inset: auto 0px 0px;

    width: 100%;

    height: var(--mobile-nav-height);

    min-height: var(--mobile-nav-height);

    max-height: var(--mobile-nav-height);

    flex-direction: row;

    justify-content: space-around;

    padding: 0px;

    overflow: hidden;

    border-right: 0px;

    border-bottom: 0px;

    border-left: 0px;

    border-image: none;

    border-top: 1px solid var(--line);
  }

  .module-nav .market-sub-tab {
    display: none;
  }

  .module-nav .nav-group-label {
    display: none;
  }

  .sidebar-brand {
    display: none;
  }

  .module-nav .nav-group {
    display: contents;
  }

  body.sidebar-collapsed .module-nav .nav-group {
    display: contents;
  }

  .module-nav .module-tab {
    display: none;
  }

  body.sidebar-collapsed .module-nav .module-tab {
    display: none;
  }

  .module-nav .module-tab.mobile-primary-tab {
    min-height: var(--mobile-tab-height);

    display: flex;

    flex: 1 1 0%;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: var(--space-4);

    padding: var(--space-4);

    font-size: var(--font-aux);
  }

  body.sidebar-collapsed .module-nav .module-tab.mobile-primary-tab {
    min-height: var(--mobile-tab-height);

    display: flex;

    flex: 1 1 0%;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: var(--space-4);

    padding: var(--space-4);

    font-size: var(--font-aux);
  }

  .module-nav .module-tab.mobile-primary-tab span {
    display: inline;
  }

  .module-nav .module-tab.active::before,
  .module-nav .module-tab.mobile-active::before {
    display: none;
  }

  .module-nav .module-tab.mobile-primary-tab .nav-label-desktop {
    display: none;
  }

  .module-nav .module-tab.mobile-primary-tab .nav-label-mobile {
    display: inline;
  }

  .app-main {
    margin: 0px;

    width: 100%;

    height: auto;

    min-height: 0px;

    display: block;

    padding: 0 var(--mobile-shell-pad) var(--mobile-page-pad);

    overflow: visible;
  }

  body:is([data-active-view="auctionView"], [data-active-view="themeLibraryView"], [data-active-view="popularityView"], [data-active-view="dragonView"], [data-active-view="mentorView"], [data-active-view="rotationView"]) .app-main {
    width: 100%;

    height: auto;

    min-height: 0px;

    display: block;

    padding: 0 var(--mobile-shell-pad) var(--mobile-page-pad);

    overflow: visible;
  }

  .overview-strip {
    margin-inline: calc(var(--mobile-shell-pad) * -1);

    padding-inline: var(--mobile-shell-pad);

    overflow-x: auto;

    scrollbar-width: none;
  }

  .overview-strip::-webkit-scrollbar {
    display: none;
  }

  .overview-strip .row {
    width: max-content;

    min-width: 100%;

    padding: 0px;
  }

  .overview-strip .metric:nth-of-type(n+4) {
    display: none;
  }

  .overview-toggle {
    display: none;
  }

  .workspace-view.page:not(#heavenView) {
    width: 100%;

    height: auto;

    padding: var(--mobile-page-pad) 0;

    overflow: visible;
  }
}

:root[data-theme="dark"] :is(html, body, .main, .app-main) {
  background: var(--canvas);

  color: var(--text-primary);
}

:root[data-theme="dark"] :is(.module-nav, .app-header, .status-bar) {
  border-color: var(--border);

  background: var(--header-bg);

  color: var(--text-primary);

  box-shadow: none;
}

:root[data-theme="dark"] .overview-strip {
  border-color: var(--border);

  background: transparent;

  color: var(--text-primary);

  box-shadow: none;
}

:root[data-theme="dark"] .app-header {
  background: var(--header-bg);
}

:root[data-theme="dark"] :is(.sidebar-brand, .module-nav .sidebar-brand, .nav-group, .sidebar-collapse-button, .header-date-group) {
  border-color: var(--line-soft);

  background-color: var(--surface);
}

:root[data-theme="dark"] .module-tab:hover {
  background: var(--surface-muted);

  color: var(--text-primary);
}

:root[data-theme="dark"] .module-tab.active {
  background: var(--action-soft);

  color: var(--action);
}

:root[data-theme="dark"] :is(.workspace-view.page:not(#heavenView), .page) {
  background: transparent;

  color: var(--text-primary);
}

:root[data-theme="dark"] :is(.card, .panel, .performance-stage-card, .market-ladder-tier, .market-ladder-insight-card, .rotation-trajectory-card, .rotation-detail-card, .auction-primary-card, .auction-side-card, .theme-directory-card-v2, .theme-market-card-v2, .theme-members-card-v2, .popularity-table-card-v2, .dragon-trader-detail, .curated-strategy-card, .mentor-sidebar, .mentor-chat-panel, .review-card) {
  border-color: var(--border);

  background-color: var(--surface);

  color: var(--text-primary);

  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] :is(#limitPool, #brokenView, #downView, #yesterdayView, #performanceView, #sentimentCycleView, #ladderView, #rotationView, #auctionView, #themeLibraryView, #popularityView, #dragonView, #screenerView, #mentorView, #reviewWorkspaceView) :is(.table-frame, .tbl-wrap, .redesigned-card, .panel, .card) {
  border-color: var(--border);

  background-color: var(--surface);

  color: var(--text-primary);
}

:root[data-theme="dark"] :is(#auctionView, #screenerView) {
  --action: #6ca8e8;

  --action-hover: #8bbcf0;

  --action-soft: #23364a;

  --border: #343a40;

  --border-strong: #474f57;

  --line: var(--border);

  --line-strong: var(--border-strong);

  --surface-muted: #202428;

  border-color: var(--border);

  background: var(--canvas);

  color: var(--text-primary);
}

@media (min-width: 768px) {
  .header-actions > .icon-button {
    min-width: 31px;
  }

  .module-nav {
    box-shadow: none;
  }
}

@media (min-width: 901px) {
  .section-toolbar {
    align-items: center;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .main,
  body.sidebar-collapsed .main {
    width: calc(100% - var(--sidebar-compact-width));
    min-width: 0;
    margin-left: var(--sidebar-compact-width);
  }

  .module-nav,
  body.sidebar-collapsed .module-nav {
    width: var(--sidebar-compact-width);
    padding-right: 7px;
    padding-left: 7px;
  }

  .status-bar,
  body.sidebar-collapsed .status-bar {
    left: var(--sidebar-compact-width);
  }
}

/* Canonical mobile shell. Page-specific responsive rules remain with each page. */
.mobile-page-context,
.mobile-command-shortcuts,
.mobile-command-backdrop {
  display: none;
}

@media (max-width: 767px) {
  .mobile-shell,
  .mobile-shell.sidebar-collapsed {
    display: block;
    min-height: 100dvh;
    padding-bottom: var(--mobile-content-bottom);
  }

  body.mobile-shell .main,
  body.mobile-shell.sidebar-collapsed .main {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    margin-left: 0;
  }

  body.mobile-shell .app-header {
    position: sticky;
    top: 0;
    z-index: var(--mobile-layer-header);
    width: 100%;
    height: var(--mobile-header-height);
    min-height: var(--mobile-header-height);
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-4) var(--mobile-shell-pad);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-shadow: none;
  }

  body.mobile-shell.mobile-command-open .app-header {
    z-index: var(--mobile-layer-menu);
  }

  body.mobile-shell .mobile-page-context {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 0;
  }

  body.mobile-shell .mobile-page-context span {
    color: var(--text-tertiary);
    font-size: var(--font-size-aux);
    line-height: 1.2;
  }

  body.mobile-shell .mobile-page-context strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-bold);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-shell .market-tape,
  body.mobile-shell .header-actions > :is(.global-search-button, .theme-toggle, .alert-button, .assistant-button) {
    display: none;
  }

  body.mobile-shell .header-actions {
    position: static;
    width: auto;
    min-width: 0;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-4);
    margin: 0;
  }

  body.mobile-shell .header-date-group {
    width: var(--mobile-date-width);
    height: var(--mobile-touch-size);
    min-height: var(--mobile-touch-size);
    padding: 0 var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--control-surface);
  }

  body.mobile-shell .header-date-group > .icon-button {
    display: none;
  }

  body.mobile-shell .header-date-group .date-input {
    width: 100%;
    height: calc(var(--mobile-touch-size) - 2px);
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-semibold);
  }

  body.mobile-shell .app-header .header-actions > .header-menu-button {
    width: var(--mobile-touch-size);
    min-width: var(--mobile-touch-size);
    height: var(--mobile-touch-size);
    min-height: var(--mobile-touch-size);
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--control-surface);
  }

  body.mobile-shell .header-command-group {
    position: fixed;
    inset: auto var(--mobile-shell-pad) var(--mobile-content-bottom);
    z-index: var(--mobile-layer-menu);
    width: auto;
    max-height: calc(100dvh - var(--mobile-header-height) - var(--mobile-content-bottom) - var(--space-16));
    display: none;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: var(--space-8);
    padding: var(--space-12);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-overlay);
    box-shadow: var(--shadow-float);
  }

  body.mobile-shell .header-command-group.is-open {
    display: grid;
  }

  body.mobile-shell .mobile-command-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
  }

  body.mobile-shell .header-command-group .mobile-command-shortcuts > .mobile-command-shortcut {
    min-width: 0;
    min-height: var(--mobile-touch-size);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-8) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: var(--font-size-caption);
  }

  body.mobile-shell .header-command-group > .command-button,
  body.mobile-shell .header-command-group .account-button {
    width: 100%;
    max-width: none;
    min-height: var(--mobile-touch-size);
    justify-content: flex-start;
  }

  body.mobile-shell .header-command-group .account-button > span,
  body.mobile-shell .header-command-group .account-role-badge span {
    display: inline;
  }

  body.mobile-shell .header-command-group .account-dropdown {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    margin-top: var(--space-8);
  }

  body.mobile-shell .mobile-command-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: var(--mobile-layer-backdrop);
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--backdrop);
  }

  body.mobile-shell .module-nav,
  body.mobile-shell.sidebar-collapsed .module-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: var(--mobile-layer-nav);
    width: 100%;
    height: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom));
    min-height: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom));
    max-height: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    gap: 0;
    padding: var(--space-4) var(--space-4) max(var(--space-4), var(--mobile-safe-bottom));
    overflow: hidden;
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--surface-overlay);
    box-shadow: var(--elevation-raised);
  }

  body.mobile-shell .module-nav :is(.sidebar-brand, .nav-group-label, .market-sub-tab, .sidebar-collapse-button),
  body.mobile-shell.sidebar-collapsed .module-nav :is(.sidebar-brand, .nav-group-label, .market-sub-tab, .sidebar-collapse-button) {
    display: none;
  }

  body.mobile-shell .module-nav .nav-group,
  body.mobile-shell.sidebar-collapsed .module-nav .nav-group {
    display: contents;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.mobile-shell .module-nav .module-tab,
  body.mobile-shell.sidebar-collapsed .module-nav .module-tab {
    display: none;
  }

  body.mobile-shell .module-nav .module-tab.mobile-primary-tab,
  body.mobile-shell.sidebar-collapsed .module-nav .module-tab.mobile-primary-tab {
    position: relative;
    min-width: 0;
    min-height: var(--mobile-tab-height);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-4);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-tertiary);
    font-size: var(--font-size-aux);
    font-weight: var(--font-weight-medium);
  }

  body.mobile-shell .module-nav .module-tab.mobile-primary-tab .lucide {
    width: var(--mobile-nav-icon-size);
    height: var(--mobile-nav-icon-size);
  }

  body.mobile-shell .module-nav .module-tab.mobile-primary-tab:is(.active, .mobile-active) {
    background: var(--action-soft);
    color: var(--action);
    font-weight: var(--font-weight-semibold);
  }

  body.mobile-shell .module-nav .module-tab.mobile-primary-tab span,
  body.mobile-shell.sidebar-collapsed .module-nav .module-tab.mobile-primary-tab span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-shell .module-nav .module-tab.mobile-primary-tab .nav-label-desktop {
    display: none;
  }

  body.mobile-shell .module-nav .module-tab.mobile-primary-tab .nav-label-mobile {
    display: block;
  }

  body.mobile-shell .app-main,
  body.mobile-shell.sidebar-collapsed .app-main,
  body.mobile-shell:is([data-active-view]) .app-main {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - var(--mobile-header-height) - var(--mobile-content-bottom));
    display: block;
    margin: 0;
    padding: 0 var(--mobile-page-pad) var(--mobile-page-pad);
    overflow: visible;
    background: var(--surface-canvas);
  }

  body.mobile-shell .overview-strip,
  body.mobile-shell .overview-strip[data-overview-expanded="true"] {
    width: calc(100% + var(--mobile-page-pad) + var(--mobile-page-pad));
    height: var(--mobile-tab-height);
    min-height: var(--mobile-tab-height);
    display: flex;
    margin: 0 calc(var(--mobile-page-pad) * -1);
    padding: 0 var(--mobile-page-pad);
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: none;
  }

  body.mobile-shell .overview-strip::-webkit-scrollbar {
    display: none;
  }

  body.mobile-shell .overview-strip .row {
    width: max-content;
    min-width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding: 0;
  }

  body.mobile-shell .overview-strip .sentiment-block,
  body.mobile-shell .overview-strip .metric,
  body.mobile-shell .overview-strip[data-overview-expanded="true"] .metric {
    min-width: max-content;
    min-height: var(--mobile-touch-size);
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-8);
    border: 0;
    background: transparent;
  }

  body.mobile-shell .overview-strip .metric:nth-of-type(n) {
    display: flex;
  }

  body.mobile-shell .workspace-view,
  body.mobile-shell .workspace-view.page:not(#heavenView),
  body.mobile-shell:is([data-active-view]) .workspace-view.active-view {
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: var(--mobile-page-pad) 0 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.mobile-shell .status-bar {
    display: none;
  }
}

@media (max-width: 359px) {
  .header-date-group {
    width: calc(var(--mobile-date-width) - var(--space-16));
  }

  .mobile-page-context span {
    display: none;
  }
}

/* Generic page title slot in the shell header. Kept hidden so each page owns
   its own in-view title header (mentor renders one inside #mentorView). */
.app-page-context {
  min-width: var(--header-page-context-min);
  max-width: var(--header-page-context-max);
  flex: 0 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  display: flex;
}

.app-header .app-page-context,
.main .app-header .app-page-context {
  min-width: var(--header-page-context-min);
  max-width: var(--header-page-context-max);
  overflow: hidden;
}

.main .app-header .app-page-context span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#themeModeText {
  display: none;
}

.app-page-context strong {
  overflow: hidden;
  color: var(--text-1);
  font-size: var(--fs-page-title);
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-page-context span {
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-caption);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Canonical B-147 merged header. */
.app-header .overview-strip,
.app-header .overview-strip[data-overview-expanded="true"] {
  position: static;
  display: flex;
  flex: 1 0 auto;
  align-items: stretch;
  width: auto;
  height: auto;
  min-width: max-content;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-header .market-tape {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  min-width: max-content;
  gap: 0;
  overflow: visible;
  white-space: nowrap;
}

.tape-metric {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: max-content;
  padding: 0 var(--header-tape-metric-pad-x);
}

.app-header .tape-metric,
.app-header .tape-sentiment.sentiment-block {
  flex: 0 0 auto;
  min-width: max-content;
}

.tape-metric + .tape-metric::before,
.tape-metric + .overview-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 26px;
  background: var(--border);
  transform: translateY(-50%);
}

.tape-metric .metric-label {
  color: var(--text-3);
  font-size: var(--fs-aux);
}

.tape-metric-value,
.tape-metric .metric-value {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: visible;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.tape-metric .metric-value.up,
.tape-detail-item .up {
  color: var(--up);
}

.tape-metric .metric-value.down,
.tape-detail-item .down {
  color: var(--down);
}

.tape-metric .metric-value.warning,
.tape-detail-item .warning {
  color: var(--warn);
}

@media (min-width: 1440px) and (max-width: 1599px) {
  .app-header .overview-strip .tape-sentiment.sentiment-block {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
}

.app-header .overview-strip .tape-sentiment .metric-label,
.app-header .overview-strip .tape-sentiment .sentiment-text {
  font-size: var(--fs-caption);
  font-weight: 500;
  line-height: 18px;
}

.app-header .overview-strip .tape-sentiment > .sentiment-gauge {
  position: absolute;
  display: none;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.tape-sentiment .sentiment-text,
.tape-detail-item .sentiment-text {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-caption);
  font-style: normal;
  font-weight: 500;
  line-height: 18px;
}

.tape-sentiment .sentiment-text.is-hot,
.tape-detail-item .sentiment-text.is-hot {
  background: var(--up-soft);
  color: var(--up);
}

.tape-sentiment .sentiment-text.is-strong,
.tape-detail-item .sentiment-text.is-strong {
  background: var(--accent-soft);
  color: var(--accent);
}

.tape-sentiment .sentiment-text.is-cold,
.tape-detail-item .sentiment-text.is-cold {
  background: var(--down-soft);
  color: var(--down);
}

.app-header .overview-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  min-height: 28px;
  margin-left: var(--header-tape-toggle-gap);
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-label);
}

.app-header .overview-toggle:hover {
  background: var(--hover);
  color: var(--text-1);
}

.app-header .overview-toggle .lucide {
  width: 14px;
  height: 14px;
}

.tape-detail {
  position: absolute;
  top: calc(var(--topbar-height) + 1px);
  right: 0;
  left: 0;
  z-index: 45;
  display: none;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 16px;
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  box-shadow: var(--shadow-raised);
}

.overview-strip[data-overview-expanded="true"] .tape-detail {
  display: grid;
}

.tape-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
}

.tape-detail-item:hover {
  background: var(--hover);
}

.tape-detail-date,
.overview-strip[data-overview-expanded="true"] .tape-detail-date {
  display: flex;
  flex-direction: column;
}

.tape-detail-item span {
  color: var(--text-3);
  font-size: var(--fs-aux);
}

.tape-detail-item strong {
  color: var(--text-1);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.app-header .header-actions {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--header-action-gap);
  margin-left: auto;
  overflow: visible;
}

.app-header .header-date-group {
  height: 32px;
  min-height: 32px;
  gap: 2px;
  margin-right: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-header .header-date-group .icon-button,
.app-header .header-actions > .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
  box-shadow: none;
}

.app-header .header-actions > .icon-button:hover,
.app-header .header-date-group .icon-button:hover {
  background: var(--hover);
  color: var(--text-1);
}

.app-header .header-date-group .date-input {
  width: auto;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-1);
  font-size: var(--fs-label);
  font-variant-numeric: tabular-nums;
}

.app-header .header-actions > .icon-button .lucide,
.app-header .header-date-group .lucide {
  width: 16px;
  height: 16px;
}

.app-header .alert-button {
  position: relative;
}

.app-header .alert-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--up);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
}

#heavenView.workspace-view,
#heavenReadingDialog {
  --color-action-base: #2563eb;
  --color-action: #2563eb;
  --color-action-base-hover: #1d4ed8;
  --color-action-hover: #1d4ed8;
  --color-action-base-soft: #eff4ff;
  --color-action-soft: #eff4ff;
  --action: #2563eb;
  --action-hover: #1d4ed8;
  --action-soft: #eff4ff;
  --accent: #2563eb;
  --primary: #2563eb;
  --blue: #2563eb;
  --r2-blue: #2563eb;
  --focus-ring: rgba(37, 99, 235, .16);
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --surface-hover: #f8faff;
  --surface-selected: #eff4ff;
  --size-radius-sm: 5px;
  --size-radius-md: 7px;
}

:root[data-theme="dark"] #heavenView.workspace-view,
:root[data-theme="dark"] #heavenReadingDialog {
  --action: #6ca8e8;
  --action-hover: #8bbcf0;
  --action-soft: #23364a;
  --accent: #6ca8e8;
  --primary: #6ca8e8;
  --blue: #6ca8e8;
  --r2-blue: #6ca8e8;
  --canvas: #121416;
  --surface: #1b1e21;
  --surface-muted: #202428;
  --border: #343a40;
  --border-strong: #474f57;
  --text-primary: #e8eaed;
  --text-secondary: #adb5bd;
  --text-tertiary: #7f8993;
  --market-up: #f06d73;
  --market-up-soft: #40262a;
  --focus-ring: rgba(108, 168, 232, .22);
}

@media (min-width: 1024px) and (max-width: 1599px) {
  .tape-optional {
    display: none;
  }
}

@media (max-width: 1440px) {
  .app-page-context {
    display: none;
  }
}

@media (max-width: 1023px) {
  .app-header {
    gap: 8px;
    height: var(--mobile-header-height);
    min-height: var(--mobile-header-height);
    padding: 0 10px;
  }

  .app-header .overview-strip,
  .app-header .overview-strip[data-overview-expanded="true"] {
    flex: 0 0 auto;
    width: auto;
  }

  .app-header .market-tape .tape-metric {
    display: none;
  }

  .app-header .overview-toggle {
    width: var(--mobile-touch-size);
    min-width: var(--mobile-touch-size);
    height: var(--mobile-touch-size);
    min-height: var(--mobile-touch-size);
    margin-left: 0;
    justify-content: center;
  }

  .app-header .overview-toggle span {
    display: none;
  }

  .tape-detail,
  .overview-strip[data-overview-expanded="true"] .tape-detail {
    top: calc(var(--mobile-header-height) + 1px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tape-detail-date,
  .overview-strip[data-overview-expanded="true"] .tape-detail-date {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  body.mobile-shell .app-header .overview-strip,
  body.mobile-shell .app-header .overview-strip[data-overview-expanded="true"] {
    width: auto;
    height: auto;
    min-height: 0;
    display: flex;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body.mobile-shell .app-header .market-tape {
    display: flex;
    overflow: visible;
  }

  body.mobile-shell .app-header .overview-toggle {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .app-header .header-menu-button {
    display: none;
  }

  .app-header .header-command-group {
    position: static;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: var(--header-command-gap);
    width: auto;
    max-width: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .app-header .header-command-group .command-button,
  .app-header .header-command-group .account-button {
    width: auto;
    justify-content: center;
  }

  .app-header .header-command-group .account-menu-shell {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .app-header .header-command-group .account-role-badges {
    display: inline-flex;
    flex-wrap: nowrap;
    min-height: 32px;
  }

  .app-header .header-command-group .account-dropdown {
    left: auto;
    right: 0;
  }
}

body[data-active-view="heavenView"] .app-header .overview-strip,
body[data-active-view="heavenView"] .app-header .overview-strip[data-overview-expanded="true"],
body.mobile-shell[data-active-view="heavenView"] .app-header .overview-strip,
body.mobile-shell[data-active-view="heavenView"] .app-header .overview-strip[data-overview-expanded="true"] {
  display: none;
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
}

