/* ============================================================================
   MOBILE & TABLET HYBRID DESIGN SYSTEM
   - Phone (<=680px): Konsept A (Kompakt Terminal) + Konsept B (RSI bar & Nested Glow)
   - Tablet (681px-1099px): Konsept C (10-Column Pro Quant Table + Optional 19-Col Sticky)
   - Desktop (>=1100px): Strictly untouched
   ============================================================================ */

/* Hidden on desktop by default */
.m-brand-pill,
.m-date-chip,
.m-filter-toggle,
.m-period-strip,
.m-bottom-nav,
.t-kbd-hints,
.t-cols-toggle {
  display: none;
}

/* Shared 6px HUD pulsing live dot */
.m-hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff9d;
  box-shadow: 0 0 8px #00ff9d;
  display: inline-block;
  flex-shrink: 0;
}

/* Dual-line glowing date + Turkish day chip */
.m-date-chip {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 12px rgba(0, 240, 255, 0.14);
  line-height: 1.12;
  flex-shrink: 0;
}
.m-date-chip .m-date-val {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.02em;
}
.m-date-chip .m-day-val {
  font-size: 12px;
  font-weight: 700;
  color: #00ff9d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================================
   TABLET MODE (681px - 1099px): Konsept C — 10-Column Pro Quant Table
   ============================================================================ */
@media (min-width: 681px) and (max-width: 1099px) {
  html, body {
    overflow-x: clip;
  }

  .m-date-chip {
    display: inline-flex;
  }

  .t-kbd-hints {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  @media (max-width: 920px) {
    .t-kbd-hints { display: none !important; }
  }
  .t-kbd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font: 700 12px/1.2 "JetBrains Mono", Consolas, monospace;
    color: #9ab0c7;
    white-space: nowrap;
  }
  .t-kbd b {
    color: #00f0ff;
  }

  .m-brand-pill {
    display: none !important;
  }
  .topline {
    height: 54px !important;
    padding: 0 4px;
    gap: 8px;
  }
  .topline .terminal-label {
    font-size: 12px !important;
    letter-spacing: 0.04em;
    color: #eef5ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topline .clock {
    display: none !important;
  }
  .sidebar-toggle {
    min-height: 40px;
    font-size: 12px !important;
    padding: 0 10px;
    white-space: nowrap;
  }
  .icon-button {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
  }
  .refresh-button {
    min-height: 40px;
    padding: 0 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  /* Keep topline accessible in US market mode on tablet so user can always navigate back */
  body.us-market-mode .topline {
    display: flex !important;
    flex: 0 0 52px;
    padding: 0 12px;
    background: var(--bg);
    border-bottom: 1px solid rgba(0, 240, 255, 0.22);
  }

  /* Restore real Pro Table on tablet (681-1099px), hide phone cards */
  #returns-view .table-container {
    display: block !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 240, 255, 0.24) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    background: #0d131a;
  }
  #returns-view #cards {
    display: none !important;
  }

  /* 10-column clean zero-scroll fit by default on tablet */
  #returns-view .table-container:not(.tablet-all-cols) colgroup,
  #returns-view .table-container:not(.tablet-all-cols) thead tr.column-groups {
    display: none !important;
  }
  #returns-view .table-container:not(.tablet-all-cols) table {
    table-layout: auto !important;
    width: 100% !important;
  }

  /* Show 10 essential columns: code, indices, risk, daily, weekly, month1, ytd, year1, rsi, stars */
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="name"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="name"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="longRank"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="longRank"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="month3"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="month3"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="month6"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="month6"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="year3"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="year3"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="year5"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="year5"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="peakDistance"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="peakDistance"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="volatility"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="volatility"],
  #returns-view .table-container:not(.tablet-all-cols) th[data-key="sharpe"],
  #returns-view .table-container:not(.tablet-all-cols) td[data-column="sharpe"] {
    display: none !important;
  }

  /* When user enables all 19 columns on tablet: smooth scroll with sticky left FON KODU */
  #returns-view .table-container.tablet-all-cols colgroup {
    display: none !important;
  }
  #returns-view .table-container.tablet-all-cols table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
  }
  #returns-view .table-container.tablet-all-cols th[data-key="code"],
  #returns-view .table-container.tablet-all-cols td[data-column="code"] {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #0d141d !important;
    border-right: 1px solid rgba(0, 240, 255, 0.28) !important;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.55);
  }
  #returns-view .table-container.tablet-all-cols th[data-key="code"] {
    z-index: 6;
    background: #13202e !important;
  }

  /* Crisp >=12px readable Pro Table typography on tablet */
  #returns-view #head th button {
    font-size: 12px !important;
    min-height: 46px !important;
    padding: 6px 4px !important;
    white-space: nowrap;
  }
  #returns-view #head th[data-key="indices"] button {
    white-space: normal !important;
    max-width: 74px;
    line-height: 1.15;
    margin: 0 auto;
  }
  #returns-view #head th button .arrow {
    position: static;
    margin-left: 2px;
    font-size: 12px !important;
  }
  #returns-view #rows tr,
  #returns-view #rows td {
    height: 48px !important;
  }
  #returns-view #rows td {
    padding: 4px 3px !important;
    font-size: 12px !important;
    overflow: visible !important;
  }
  #returns-view #rows .value-box {
    overflow: visible !important;
  }
  #returns-view #rows .cell-value,
  #returns-view #rows .return-cell .cell-value {
    font-size: 12px !important;
    padding: 4px 3px !important;
    letter-spacing: -0.02em;
  }
  #returns-view #rows td[data-column="indices"] {
    max-width: 82px;
  }
  #returns-view #rows td.index .cell-value {
    font-size: 12px !important;
    padding: 4px 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #returns-view #rows .fund-code strong {
    font-size: 13.5px !important;
  }
  #returns-view #rows .fund-logo {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    letter-spacing: -0.06em;
  }
  #returns-view #rows .risk[data-risk] {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }
  #returns-view #result-label {
    font-size: 12.5px !important;
    white-space: nowrap;
  }

  .t-cols-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 38px;
    padding: 0 11px;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.09);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: #00f0ff;
    font: 800 12px/1.2 Manrope, sans-serif;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }
  .t-cols-toggle.is-all {
    background: rgba(0, 255, 157, 0.11);
    border-color: rgba(0, 255, 157, 0.45);
    color: #00ff9d;
  }

  /* Upgrade readable UI text on tablet to >= 12px */
  .view-tabs > button,
  .view-tabs button span,
  .table-bar > div,
  .table-bar small,
  .table-date,
  .currency-switch button,
  .star-horizon-label,
  #star-horizon,
  .text-button,
  .unit-note,
  .metric-origin,
  .pagination,
  footer,
  #data-status,
  .filter-panel label > span {
    font-size: 12px !important;
  }
  .filter-panel {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 44px !important;
    border-radius: 12px 12px 0 0 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  .filter-panel input,
  .filter-panel select,
  .filter-panel .clear-button {
    height: 44px !important;
    font-size: 13px !important;
  }
  .filter-panel input::placeholder {
    font-size: 13px !important;
  }
}

/* ============================================================================
   PHONE MODE (<=680px): Konsept A (Kompakt Terminal) + Konsept B (RSI Bar & Glow)
   ============================================================================ */
@media (max-width: 680px) {
  html, body {
    overflow-x: clip !important;
    max-width: 100vw;
  }

  main {
    margin-left: 0 !important;
    padding: 0 10px calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 100vw !important;
  }

  /* Reserve space for fixed bottom nav in full-height workspace modes */
  body.signals-mode main,
  body.today-mode main,
  body.us-today-mode main,
  body.kumanda-mode main,
  body.sidebar-collapsed.kumanda-mode main {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.us-market-mode main,
  body.sidebar-collapsed.us-market-mode main {
    padding: 0 0 calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.us-market-mode header.topline {
    display: none !important;
  }

  /* Keep topline crisp & sticky on phone */
  header.topline {
    position: sticky !important;
    top: 0;
    z-index: 45;
    height: 54px !important;
    padding: 0 10px !important;
    margin: 0 -10px !important;
    background: rgba(9, 13, 18, 0.96) !important;
    border-bottom: 1px solid rgba(0, 240, 255, 0.22) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center !important;
    gap: 8px;
  }

  .topline .terminal-label,
  .topline .clock {
    display: none !important;
  }

  .sidebar-toggle {
    order: 1;
    min-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    padding: 0 !important;
  }
  .sidebar-toggle > span:last-child {
    display: none !important;
  }

  .m-brand-pill {
    order: 2;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    min-width: 0;
  }
  .m-brand-pill strong {
    font-size: 13.5px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #eef5ff;
    white-space: nowrap;
  }

  .m-date-chip {
    display: inline-flex;
  }

  .topline > div:not(#mobile-brand-pill) {
    order: 3;
    display: flex !important;
    align-items: center;
    gap: 6px !important;
    margin-left: 0 !important;
  }
  .icon-button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 9px !important;
    font-size: 17px !important;
  }
  header.topline .refresh-button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    border-radius: 9px !important;
    font-size: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  header.topline .refresh-button span {
    font-size: 20px !important;
    line-height: 1;
  }
  header.topline .refresh-button::after {
    content: none !important;
  }

  /* View tabs >= 12px & >= 44px touch height */
  .view-tabs {
    gap: 14px !important;
    margin-top: 2px !important;
    margin-bottom: 10px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tabs > button {
    min-height: 44px;
    padding: 10px 0 !important;
    font-size: 12px !important;
    letter-spacing: 0.03em !important;
  }
  .view-tabs button span {
    font-size: 12px !important;
    padding: 2px 6px !important;
    margin-left: 4px !important;
  }

  /* Collapsible Filter Panel: single search row + FİLTRE (N) button by default! */
  #returns-view .filter-panel {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 8px !important;
    margin-top: 4px !important;
    border-radius: 12px !important;
    background: #0d131a !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  }
  #returns-view .filter-panel .search-field {
    flex: 1 1 160px !important;
    min-width: 0;
  }
  #returns-view .filter-panel .search-field > span {
    display: none !important;
  }
  #returns-view .filter-panel input {
    height: 44px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    background: #090d12 !important;
  }
  #returns-view .filter-panel input::placeholder {
    font-size: 13px !important;
  }
  #returns-view .filter-panel .search-field svg {
    top: 15px !important;
  }

  .m-filter-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: #121a24;
    border: 1px solid rgba(0, 240, 255, 0.36);
    color: #00f0ff;
    font: 800 12px/1 Manrope, sans-serif;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  }
  .m-filter-toggle.has-active {
    background: rgba(0, 255, 157, 0.12);
    border-color: rgba(0, 255, 157, 0.55);
    color: #00ff9d;
  }

  /* Hide the 4 selects & clear button until user opens FİLTRE */
  #returns-view .filter-panel:not(.filters-open) > label:not(.search-field),
  #returns-view .filter-panel:not(.filters-open) > #clear {
    display: none !important;
  }
  #returns-view .filter-panel.filters-open > label:not(.search-field) {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 140px;
  }
  #returns-view .filter-panel.filters-open > label:not(.search-field) > span {
    font-size: 12px !important;
    margin-bottom: 5px !important;
  }
  #returns-view .filter-panel.filters-open select {
    height: 44px !important;
    font-size: 13px !important;
    border-radius: 9px !important;
  }
  #returns-view .filter-panel.filters-open > #clear {
    width: 100% !important;
    height: 44px !important;
    border-radius: 9px !important;
    font-size: 14px !important;
  }

  /* Horizontal Period Selector Strip (Konsept A) */
  .m-period-strip {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 0 4px;
    -webkit-overflow-scrolling: touch;
  }
  .m-period-strip::-webkit-scrollbar { display: none; }

  .m-p-chip {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 9px;
    background: #0d131a;
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #9ab0c7;
    font: 800 12px/1 Manrope, sans-serif;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  .m-p-chip.active {
    background: rgba(0, 255, 157, 0.10);
    border-color: rgba(0, 255, 157, 0.55);
    color: #00ff9d;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 12px rgba(0, 255, 157, 0.16);
  }

  /* Compact Table Meta & Unit Bar (>=12px) */
  #returns-view .table-bar {
    padding: 8px 10px !important;
    margin-top: 4px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #0d131a !important;
    gap: 8px !important;
  }
  #returns-view .table-bar > div,
  #returns-view #result-label {
    font-size: 12px !important;
    gap: 6px !important;
  }
  #returns-view .table-bar small,
  #returns-view .table-bar .divider {
    display: none !important;
  }
  #returns-view .table-date {
    font-size: 12px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    padding-left: 8px !important;
    margin-left: 2px !important;
    color: #00f0ff !important;
  }
  #returns-view .currency-switch button {
    min-height: 38px;
    padding: 6px 9px !important;
    font-size: 12px !important;
  }
  #returns-view .star-horizon-label {
    font-size: 12px !important;
  }
  #returns-view #star-horizon {
    min-height: 38px;
    font-size: 12px !important;
  }
  #returns-view #download {
    min-height: 38px;
    font-size: 12px !important;
  }
  #returns-view .unit-note,
  #returns-view .metric-origin {
    display: none !important;
  }

  /* Hide desktop table, show Compact Hybrid Terminal Cards */
  #returns-view .table-container {
    display: none !important;
  }
  #returns-view #cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 8px 0 6px !important;
  }

  /* Hybrid Concept A + Concept B Compact Terminal Card */
  .m-term-card {
    background: linear-gradient(165deg, #101721 0%, #0b1017 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-top: 1px solid rgba(0, 240, 255, 0.24) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 6px 18px rgba(0, 0, 0, 0.45) !important;
    border-radius: 12px !important;
    padding: 9px 11px 8px !important;
    display: flex;
    flex-direction: column;
    gap: 7px;
    cursor: pointer;
    min-width: 0;
  }
  .m-term-card:active {
    border-color: rgba(0, 255, 157, 0.55) !important;
    transform: scale(0.992);
  }

  .mt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }
  .mt-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
  }
  .mt-left .fund-logo {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    flex-shrink: 0;
  }
  .mt-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }
  .mt-code-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .mt-code {
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #ffffff;
    letter-spacing: 0.02em;
    flex-shrink: 0;
  }
  .mt-code-line .risk[data-risk] {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    flex-shrink: 0;
  }
  .mt-idx {
    font-size: 12px !important;
    font-weight: 700;
    color: #00f0ff;
    background: rgba(0, 240, 255, 0.09);
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: 5px;
    padding: 0 5px;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mt-rsi {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 12px !important;
    font-weight: 700;
    white-space: nowrap;
  }
  .mt-name {
    font-size: 12px !important;
    color: #9ab0c7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mt-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 12px !important;
    color: #b7c8da;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mt-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    text-align: right;
  }
  .mt-main-ret {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 16px !important;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
  }
  .mt-main-lbl {
    font-size: 12px !important;
    font-weight: 700;
    color: #9ab0c7 !important;
    text-shadow: none !important;
  }
  .mt-sec-ret {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
  }

  /* Konsept B Thin Visual RSI Threshold Thermometer */
  .mt-rsi-bar {
    position: relative;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: visible;
  }
  .mt-rsi-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.2s ease;
  }
  .mt-rsi-notch {
    position: absolute;
    left: 40%;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 6px #ffffff;
    border-radius: 1px;
  }

  /* Pagination & Footer >= 12px and touch-friendly */
  .pagination {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    border-radius: 10px !important;
  }
  .pagination button {
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important;
  }
  footer,
  #data-status,
  .footer-brand,
  .footer-brand small {
    font-size: 12px !important;
  }
  .profile-note {
    font-size: 12px !important;
  }

  /* Fixed 5-Tab Bottom Navigation Bar */
  .m-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    min-height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    background: rgba(9, 13, 18, 0.98);
    border-top: 1px solid rgba(0, 240, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 -6px 20px rgba(0, 0, 0, 0.78);
  }
  .m-bn-btn {
    min-height: 48px;
    border: 0;
    background: transparent;
    color: #9ab0c7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font: 800 12px/1 Manrope, sans-serif;
    letter-spacing: 0.02em;
    border-radius: 8px;
    position: relative;
    padding: 4px 2px;
  }
  .m-bn-ico {
    font-size: 15px;
    line-height: 1;
  }
  .m-bn-btn.active {
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.09);
  }
  .m-bn-btn.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16%;
    right: 16%;
    height: 2px;
    border-radius: 2px;
    background: #00ff9d;
    box-shadow: 0 0 8px #00ff9d;
  }

  /* Signals & Today workspace phone legibility bump (>=12px) */
  #signals-workspace .signal-title .signal-kicker,
  #signals-workspace .signal-title p,
  #signals-workspace .signal-scope-note,
  #signals-workspace .signal-header-center #signal-source-time,
  #signals-workspace .signal-header-center .signal-days button > span,
  #signals-workspace .signal-header-center .signal-days button > strong,
  #signals-workspace .signal-header-center .signal-days button > small,
  #signals-workspace .signal-types button,
  #signals-workspace .signal-search-label input,
  #signals-workspace .signal-result-bar b,
  #signals-workspace .signal-result-bar .text-button {
    font-size: 12px !important;
  }
}

/* ============================================================================
   LIGHT THEME COHERENCE FOR MOBILE & TABLET HYBRID ELEMENTS
   ============================================================================ */
html[data-theme="light"] .m-date-chip {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.14);
}
html[data-theme="light"] .m-date-chip .m-date-val {
  color: #0284c7;
}
html[data-theme="light"] .m-date-chip .m-day-val {
  color: #059669;
}
@media (max-width: 680px) {
  html[data-theme="light"] header.topline {
    background: rgba(248, 250, 252, 0.96) !important;
    border-bottom-color: #cbd5e1 !important;
  }
}
html[data-theme="light"] .m-brand-pill strong {
  color: #0f172a;
}
html[data-theme="light"] .m-term-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  border-top-color: #059669 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .mt-code {
  color: #0f172a;
}
html[data-theme="light"] .mt-name,
html[data-theme="light"] .mt-sub {
  color: #475569;
}
html[data-theme="light"] .mt-idx {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #7dd3fc;
}
html[data-theme="light"] .mt-main-ret,
html[data-theme="light"] .mt-sec-ret {
  background: #0b1520;
  padding: 2px 6px;
  border-radius: 5px;
}
html[data-theme="light"] .mt-rsi-bar {
  background: #e2e8f0;
}
html[data-theme="light"] .mt-rsi-notch {
  background: #0f172a;
  box-shadow: none;
}
html[data-theme="light"] .m-bottom-nav {
  background: rgba(255, 255, 255, 0.98);
  border-top-color: #cbd5e1;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.10);
}
html[data-theme="light"] .m-bn-btn {
  color: #475569;
}
html[data-theme="light"] .m-bn-btn.active {
  color: #047857;
  background: rgba(5, 150, 105, 0.10);
}
html[data-theme="light"] .m-bn-btn.active::before {
  background: #059669;
  box-shadow: none;
}
html[data-theme="light"] .m-filter-toggle,
html[data-theme="light"] .m-p-chip,
html[data-theme="light"] .t-cols-toggle {
  background: #ffffff;
  color: #0f172a;
  border-color: #94a3b8;
}
html[data-theme="light"] .m-p-chip.active,
html[data-theme="light"] .m-filter-toggle.has-active {
  background: #ecfdf5;
  border-color: #059669;
  color: #047857;
}
