/* Phone preview — toggle in ✦ Look → Phone */

html[data-md-phone-preview="1"] {
  background: #141418;
}

html[data-md-phone-preview="1"]::before {
  content: "📱 Phone preview";
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

html[data-md-phone-preview="1"] body.tv-body {
  max-width: 390px;
  margin: 36px auto 24px;
  border-radius: 28px;
  box-shadow:
    0 0 0 10px #0a0a0c,
    0 0 0 11px rgba(255, 255, 255, 0.08),
    0 32px 80px rgba(0, 0, 0, 0.55);
  min-height: calc(100vh - 60px);
  overflow-x: hidden;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

html[data-md-phone-preview="1"] .tv-wrap {
  width: min(var(--tv-container), 100% - 24px);
}

html[data-md-phone-preview="1"] .tv-page__grid {
  grid-template-columns: 1fr;
}

html[data-md-phone-preview="1"] .tv-side {
  position: static;
}

html[data-md-phone-preview="1"] .tv-header__inner {
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

html[data-md-phone-preview="1"] .tv-logo__brand {
  font-size: 0.88rem;
  padding: 8px 11px;
  letter-spacing: 0.2em;
}

html[data-md-phone-preview="1"] .tv-nav {
  display: none;
}

html[data-md-phone-preview="1"] .tv-nav.tv-nav--drawer-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(390px - 24px);
  max-width: calc(100vw - 24px);
  z-index: 120;
  padding: 14px;
  gap: 8px;
  border-radius: 16px;
  background: var(--tv-surface-solid);
  border: 1px solid var(--tv-line-soft);
  box-shadow: var(--tv-shadow);
}

html[data-md-phone-preview="1"] .tv-mobile-bar {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

html[data-md-phone-preview="1"] .tv-search {
  order: 3;
  flex: 1 1 100%;
  max-width: none;
}

html[data-md-phone-preview="1"] .tv-search.tv-search--collapsed {
  display: none;
}

html[data-md-phone-preview="1"] .tv-search.tv-search--mobile-open {
  display: flex;
}

html[data-md-phone-preview="1"] .tv-search input {
  font-size: 16px;
}

html[data-md-phone-preview="1"] .tv-hero {
  min-height: 320px;
  border-radius: 16px;
}

html[data-md-phone-preview="1"] .tv-hero__content {
  padding: 28px 22px 32px;
  max-width: none;
}

html[data-md-phone-preview="1"] .tv-hero__content h1 {
  font-size: clamp(1.55rem, 7vw, 2rem);
}

html[data-md-phone-preview="1"] .tv-hero__content h1 br {
  display: none;
}

html[data-md-phone-preview="1"] .tv-hero__actions {
  flex-direction: column;
}

html[data-md-phone-preview="1"] .tv-hero__actions .tv-btn {
  width: 100%;
}

html[data-md-phone-preview="1"] .tv-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

html[data-md-phone-preview="1"] .tv-stats {
  grid-template-columns: repeat(2, 1fr);
}

html[data-md-phone-preview="1"] .tv-cats {
  grid-template-columns: repeat(2, 1fr);
}

html[data-md-phone-preview="1"] .tv-cards {
  grid-template-columns: 1fr !important;
}

html[data-md-phone-preview="1"] .tv-how {
  grid-template-columns: 1fr;
}

html[data-md-phone-preview="1"] .tv-section__head {
  flex-direction: column;
  align-items: flex-start;
}

html[data-md-phone-preview="1"] .tv-footer__grid {
  grid-template-columns: 1fr;
  text-align: center;
}

html[data-md-phone-preview="1"] .tv-bottom-nav {
  display: flex !important;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 390px;
  max-width: 100vw;
  border-radius: 0 0 28px 28px;
}

html[data-md-phone-preview="1"] .md-style-lab {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: max(12px, calc(50% - 195px + 12px));
}

html[data-md-phone-preview="1"] .md-section-tools {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

html[data-md-phone-preview="1"] .tv-grain {
  display: none;
}

html[data-md-phone-preview="1"] .tv-promo-strip .tv-btn {
  width: 100%;
}
