/* M1 Crown Standard — desktop + mobile web app */

.m1-view-toggle {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex-wrap: wrap;
  align-items: center;
}
.m1-view-toggle button {
  height: 36px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
}
.m1-view-toggle button.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.m1-view-toggle .hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.m1-view { display: none; width: 100%; }
.m1-view.active { display: block; }

/* Full-screen mobile app preview */
body.m1-mode-mobile {
  overflow: hidden;
  height: 100dvh;
}
body.m1-mode-mobile .mock-banner,
body.m1-mode-mobile .concept-label,
body.m1-mode-mobile .concept-title,
body.m1-mode-mobile .concept-desc,
body.m1-mode-mobile .m1-view-toggle {
  display: none !important;
}
.m1-mobile-root.active {
  position: fixed;
  inset: 0;
  z-index: 300;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  margin: 0;
  border: none;
  box-shadow: none;
}
.m1-mobile-exit {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 12px;
  z-index: 20;
}
.m1-mobile-exit button {
  height: 36px;
  padding: 0 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.95);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  box-shadow: 0 2px 8px rgba(16,24,40,.12);
}

/* Desktop panel — fluid max width */
.m1-desktop .mps-panel {
  width: 100%;
  max-width: 440px;
}
.m1-desktop .picker-showcase {
  align-items: stretch;
}
.m1-desktop .picker-showcase-label { align-self: flex-start; }

/* ─── Mobile web app shell ─── */
.m1-mobile-root {
  --sheet-radius: 20px 20px 0 0;
  background: #e8eef4;
}

.m1-mobile-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  overflow: hidden;
}

.m1-mobile-top {
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
}

.m1-mobile-top .logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.m1-mobile-search {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
}

.m1-mobile-filters {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.m1-mobile-filters::-webkit-scrollbar { display: none; }
.m1-mobile-filters .pill { min-height: 40px; flex-shrink: 0; }

.m1-mobile-map {
  flex: 0 0 auto;
  height: clamp(72px, 14vh, 120px);
  min-height: 72px;
  background: linear-gradient(180deg, #dce4ec 0%, #c5d0dc 100%);
  position: relative;
}
.m1-mobile-map-pin {
  position: absolute;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Bottom sheet */
.m1-mobile-sheet {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border-radius: var(--sheet-radius);
  box-shadow: 0 -8px 32px rgba(16, 24, 40, 0.14);
  margin-top: -12px;
  position: relative;
  z-index: 10;
  max-width: 100vw;
  overflow: hidden;
}

.m1-sheet-handle {
  width: 36px;
  height: 4px;
  background: #D0D5DD;
  border-radius: 4px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}

.m1-sheet-head {
  padding: 0 16px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}
.m1-sheet-head .mps-brand-head {
  margin-bottom: 10px;
  padding-bottom: 0;
  border: none;
}
.m1-sheet-head .slider-tabs.pill-tabs {
  padding: 0;
}

.m1-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 8px;
  min-height: 0;
}

.m1-sheet-scroll .histogram {
  margin: 8px 0 4px;
  height: 48px;
}

.m1-sheet-scroll .dual-track-block .slider-track-wrap {
  padding: 28px 4px 22px;
}

.m1-sheet-scroll .slider-thumb {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
}

.m1-sheet-scroll .slider-thumb-label {
  top: -32px;
  font-size: 11px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m1-mobile-sheet .lg-input-row {
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.m1-mobile-sheet .lg-input-dash { display: none; }
.m1-mobile-sheet .lg-input-box input {
  height: 48px;
  font-size: 16px; /* prevents iOS zoom */
}

.m1-sheet-footer {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}
.m1-sheet-footer .btn-reset {
  min-height: 48px;
  min-width: 88px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--ink);
  font-weight: 600;
}
.m1-sheet-footer .btn-done {
  flex: 1;
  min-height: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
}

.m1-mobile-status {
  padding: 6px 16px 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
}
.m1-mobile-status strong { color: var(--ink); }

/* Prevent horizontal clip on small screens */
@media (max-width: 480px) {
  .concept-title { font-size: 20px; }
  .concept-desc { font-size: 12px; }
  .mock-banner { font-size: 11px; padding: 8px 12px; }
  .m1-view-toggle { padding: 0 12px 10px; }
  .m1-view-toggle .hint { width: 100%; margin-left: 0; margin-top: 4px; }
}

@media (min-width: 481px) {
  body:not(.m1-mode-mobile) .m1-mobile-root {
    max-width: 430px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(16,24,40,.12);
  }
}

/* Smoke test badge (hidden in production mockup review) */
.m1-smoke-pass {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #2d6a4f;
  background: rgba(45,106,79,.12);
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 8px;
}
