.mobile-trend-heading,
.mobile-trend-session-count,
.mobile-trend-record-list { display: none; }
.mobile-trend-chart-scroll { display: contents; }

@media (max-width: 768px) {
  body[data-mobile-app-view="assessment"] #panel-4.active {
    padding-bottom: calc(var(--mobile-app-nav-height) + 18px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .mobile-trend-page { min-width: 0; }
  .mobile-trend-heading {
    display: block;
    padding: 10px 0 12px;
    border-bottom: 1px solid var(--mobile-app-line);
  }
  .mobile-trend-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--mobile-app-blue);
    font: 800 9px/1 var(--mono);
    letter-spacing: .14em;
  }
  .mobile-trend-heading h1 {
    margin: 0;
    color: var(--mobile-app-black);
    font-size: var(--mobile-content-page-title-size);
    line-height: 1.25;
    letter-spacing: -.025em;
  }
  .mobile-trend-range {
    margin: 8px 0 0;
    color: var(--mobile-app-black);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
  }
  .mobile-trend-mode-note {
    margin: 3px 0 0;
    color: var(--mobile-app-gray);
    font-size: 11px;
    line-height: 1.5;
  }

  .mobile-trend-page > .trend-tab-bar {
    display: flex;
    min-width: 0;
    margin: 0 -8px 10px;
    padding: 10px 8px 4px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .mobile-trend-page > .trend-tab-bar::-webkit-scrollbar { display: none; }
  .mobile-trend-page .trend-tab-btn {
    min-width: max-content;
    min-height: 44px;
    padding: 0 16px;
    flex: 0 0 auto;
    border-radius: 4px;
    font-size: 12px;
  }
  .mobile-trend-page .trend-tab-btn.active {
    border-color: var(--mobile-app-blue);
    color: #fff;
    background: var(--mobile-app-blue);
  }

  .mobile-trend-history-v01 .history-v01-shell > .trend-tab-bar {
    display: flex;
    min-width: 0;
    margin: 0 -8px 10px;
    padding: 10px 8px 4px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .mobile-trend-history-v01 .history-v01-shell > .trend-tab-bar::-webkit-scrollbar { display: none; }
  .mobile-trend-history-v01 .history-v01-list { gap: 0; }
  .mobile-trend-history-v01 .history-v01-metric {
    padding: 16px 0 18px;
    border: 0;
    border-bottom: 1px solid var(--mobile-app-line);
    border-radius: 0;
    background: transparent;
  }
  .mobile-trend-history-v01 .history-v01-metric > h3 { font-size: 15px; }
  .mobile-trend-history-v01 .history-v01-sides { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mobile-trend-history-v01 .history-v01-side {
    padding: 11px 12px;
    border-color: var(--mobile-app-line);
    background: #fff;
  }
  .mobile-trend-history-v01 .history-v01-current,
  .mobile-trend-history-v01 .history-v01-previous {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .mobile-trend-history-v01 .history-v01-current span,
  .mobile-trend-history-v01 .history-v01-previous span:first-child,
  .mobile-trend-history-v01 .history-v01-state { overflow-wrap: anywhere; }

  .mobile-trend-page .sm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
  }
  .mobile-trend-page .sm-card,
  .mobile-trend-page .sm-card.sm-wide {
    min-width: 0;
    grid-column: auto;
    padding: 16px 0 18px;
    border: 0;
    border-bottom: 1px solid var(--mobile-app-line);
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
  .mobile-trend-page .sm-card-header {
    min-width: 0;
    padding: 0 0 9px;
    align-items: flex-start;
    gap: 12px;
  }
  .mobile-trend-page .sm-card-title {
    min-width: 0;
    color: var(--mobile-app-black);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .mobile-trend-page .sm-card-ref {
    max-width: 42%;
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1.4;
    text-align: right;
    white-space: normal;
  }
  .mobile-trend-page .sm-data-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    padding: 0 0 10px;
    gap: 7px 16px;
    border: 0;
  }
  .mobile-trend-page .sm-data-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, auto) minmax(0, 1fr);
    min-width: 0;
    min-height: 28px;
    align-items: baseline;
    gap: 6px;
  }
  .mobile-trend-page .sm-side-lbl { width: auto; }
  .mobile-trend-page .sm-val { min-width: 0; }
  .mobile-trend-page .sm-val.is-mobile-missing { color: var(--mobile-app-gray) !important; font-weight: 600; }
  .mobile-trend-page .sm-delta { min-width: 0; overflow-wrap: anywhere; }

  .mobile-trend-chart-scroll {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }
  .mobile-trend-page .sm-canvas {
    max-width: none;
  }
  .mobile-trend-page[data-mobile-trend-mode="baseline"] .mobile-trend-chart-scroll { display: none; }
  .mobile-trend-page[data-mobile-trend-mode="baseline"] .sm-delta { display: none; }

  .mobile-trend-page .sm-toggle {
    min-height: 48px;
    margin-top: 8px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--mobile-app-line);
    border-radius: 0;
    color: var(--mobile-app-black);
    background: transparent;
    font-size: 14px;
  }
  .mobile-trend-page .sm-toggle:hover { background: transparent; }
  .mobile-trend-session-count {
    display: inline;
    margin-left: auto;
    padding-right: 8px;
    color: var(--mobile-app-gray);
    font-size: 11px;
    font-weight: 600;
  }
  .mobile-trend-page .sm-summary,
  .mobile-trend-page .sm-summary.open {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
  .mobile-trend-page .sm-summary:not(.open) { display: none; }
  .mobile-trend-page .sm-summary.open { display: block; }
  .mobile-trend-page .sm-tbl { display: none; }
  .mobile-trend-record-list { display: block; }
  .mobile-trend-record {
    padding: 16px 0;
    border-bottom: 1px solid var(--mobile-app-line);
  }
  .mobile-trend-record-header {
    display: flex;
    margin-bottom: 10px;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .mobile-trend-record-header strong { font-size: 15px; }
  .mobile-trend-record-header span { color: var(--mobile-app-gray); font: 10px var(--mono); }
  .mobile-trend-record-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 44px;
    padding: 8px 0;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(15,23,42,.06);
  }
  .mobile-trend-record-row:last-child { border-bottom: 0; }
  .mobile-trend-record-row > strong {
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .mobile-trend-record-values {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: var(--mobile-app-black);
    font: 11px var(--mono);
    text-align: right;
  }
  .mobile-trend-record-values .is-mobile-missing { color: var(--mobile-app-gray); }
  .mobile-trend-page .trend-placeholder {
    padding: 30px 0;
    border-bottom: 1px solid var(--mobile-app-line);
    text-align: left;
  }

  @media (min-width: 600px) {
    .mobile-trend-history-v01 .history-v01-sides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}

@media (min-width: 600px) and (max-width: 768px) {
  body[data-mobile-app-view="assessment"] #panel-4.active { padding-inline: 24px; }
  .mobile-trend-page .sm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
  }
  .mobile-trend-page .sm-card,
  .mobile-trend-page .sm-card.sm-wide { grid-column: auto; }
}
