/* === MarkFact 57단계 Mobile UI/UX Stylesheet === */

.mf-mob-scope,
.mf-mob-scope *,
body[data-mf-preview-page="1"],
body[data-mf-preview-page="1"] * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.mf-mob-scope {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Malgun Gothic", sans-serif;
  color: #0f172a;
  word-break: keep-all;
}

.mf-mob-scope button,
.mf-mob-scope input,
.mf-mob-scope select {
  font: inherit;
}

/* Tailwind v4 preflight guards inside mobile scope */
.mf-mob-scope input[type="range"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  accent-color: #2563eb;
}

.mf-mob-scope input[type="checkbox"] {
  -webkit-appearance: checkbox;
  appearance: auto;
  background-color: #ffffff;
}

.mf-mob-scope select {
  -webkit-appearance: menulist;
  appearance: auto;
}

/* === Main App Responsive Integration (0% PC Impact >= 1024px) === */
@media (min-width: 1024px) {
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  body:not([data-mf-preview-page="1"]) {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background: #f4f6fa !important;
  }
  html:has(body:not([data-mf-preview-page="1"])) {
    height: 100dvh !important;
    overflow: hidden !important;
  }
  body:not([data-mf-preview-page="1"]) > aside.mf-review-note,
  body:not([data-mf-preview-page="1"]) > #root,
  body:not([data-mf-preview-page="1"]) .mf-cmp-circle-fab,
  body:not([data-mf-preview-page="1"]) .mf-cmp-empty-pop,
  body:not([data-mf-preview-page="1"]) .mf-cmp-float-root,
  body:not([data-mf-preview-page="1"]) .mf57-mob-wrap {
    display: none !important;
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root {
    display: flex !important;
    width: 100%;
    height: 100dvh;
    flex-direction: column;
    overflow: hidden;
    background: #f4f6fa;
    position: relative;
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .phone {
    width: 100% !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    position: relative !important;
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .ph-statusbar {
    display: none !important;
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .ph-bnav {
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px));
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .ph-floating-pill {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .phone[data-ux-mode="before"] .ph-floating-pill {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .ph-sheet,
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .ph-conv-modal {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .ph-backdrop {
    inset: 0 0 calc(58px + env(safe-area-inset-bottom, 0px)) 0;
  }
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root .phone[data-map-full="1"] .map-guard-wrap {
    inset: 0 0 calc(58px + env(safe-area-inset-bottom, 0px)) 0;
  }
}

/* === Preview Page Outer Shell (body[data-mf-preview-page="1"]) === */
html:has(body[data-mf-preview-page="1"]),
body[data-mf-preview-page="1"] {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Malgun Gothic", sans-serif;
  background: #dfe7f2;
  color: #0f172a;
  word-break: keep-all;
}

body[data-mf-preview-page="1"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-mf-preview-page="1"] button,
body[data-mf-preview-page="1"] input,
body[data-mf-preview-page="1"] select {
  font: inherit;
}

/* === Outer Preview Inspector Header === */
.preview-header {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  z-index: 40;
}

.preview-row {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.preview-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.preview-size-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ctrl-btn {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .14s ease;
}

.ctrl-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.ctrl-btn[aria-pressed="true"] {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.ctrl-btn.pc-link {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.ctrl-btn.pc-link:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}

.ctrl-btn.mode-switch[data-ux="after"][aria-pressed="true"] {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.ctrl-btn.mode-switch[data-ux="before"][aria-pressed="true"] {
  background: #b45309;
  border-color: #b45309;
  color: #ffffff;
}

.mob-inspector-toggle {
  display: none;
}

/* === Stage & Phone Bezel === */
.stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  overflow: auto;
  padding: 12px;
}

.phone-scaler {
  margin: auto;
  position: relative;
  flex-shrink: 0;
}

.phone {
  width: 390px;
  height: 844px;
  border-radius: 34px;
  background: #f4f6fa;
  box-shadow: 0 0 0 9px #1e293b, 0 0 0 11px #94a3b8, 0 24px 54px rgba(15, 23, 42, 0.26);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  container-type: inline-size;
  container-name: phoneview;
  transform-origin: top left;
}

/* === Inner Phone Status Bar & Top Chrome === */
.ph-statusbar {
  height: 28px;
  padding: 0 18px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  flex-shrink: 0;
  z-index: 25;
}

.ph-notch {
  width: 82px;
  height: 16px;
  border-radius: 999px;
  background: #0f172a;
}

.ph-disclaimer {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 12px;
  font-size: 11px;
  color: #475569;
  flex-shrink: 0;
}

.ph-disclaimer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-disclaimer summary::-webkit-details-marker {
  display: none;
}

.ph-disclaimer summary em {
  font-style: normal;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ph-disclaimer-body {
  padding: 6px 0 4px;
  line-height: 1.5;
  font-size: 11px;
  color: #334155;
}

.ph-disclaimer-body a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 700;
}

/* Legacy Stacked Chrome (Only shown in 'before' comparison mode) */
.ph-legacy-stack {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.phone[data-ux-mode="before"] .ph-legacy-stack {
  display: block;
}

.phone[data-ux-mode="before"] .ph-disclaimer summary {
  white-space: normal;
  line-height: 1.45;
  padding: 4px 0;
}

.ph-legacy-gnb2row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px 10px;
  background: #0f1e36;
}

.ph-legacy-gnb2row button {
  padding: 5px 3px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.ph-legacy-pillrow {
  display: flex;
  gap: 5px;
  padding: 6px 10px;
  overflow-x: auto;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  scrollbar-width: none;
}

.ph-legacy-pillrow::-webkit-scrollbar {
  display: none;
}

.ph-legacy-pillrow button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.ph-legacy-warn {
  margin: 6px 10px 6px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
}

/* Slim App Header */
.ph-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  z-index: 20;
}

.ph-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  cursor: pointer;
  flex-shrink: 0;
}

.ph-logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.ph-search {
  flex: 1;
  min-width: 0;
  position: relative;
}

.ph-search input {
  width: 100%;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  padding: 0 12px 0 31px;
  font-size: 14px;
  color: #0f172a;
  outline: none;
}

.ph-search input:focus {
  background: #ffffff;
  border-color: #2563eb;
}

.ph-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #64748b;
  pointer-events: none;
}

/* === Scrollable Phone Main Content === */
.ph-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 76px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  -webkit-overflow-scrolling: touch;
}

.ph-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.ph-card-accent {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #bfdbfe;
}

.ph-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 3px;
}

.ph-h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.ph-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

/* Quick Entry Funnel */
.qe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qe-toggle {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.qe-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin: 10px 0 5px;
}

.qe-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.qe-chip-row::-webkit-scrollbar {
  display: none;
}

.qe-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.qe-chip[aria-pressed="true"] {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
}

.qe-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.qe-cat-btn {
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.qe-cat-btn[aria-pressed="true"] {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

/* Brand Cards & 1:1 Compare */
.ab-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin: 10px 0 12px;
}

.ab-slot {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  min-width: 0;
}

.ab-slot.slot-a {
  background: #eff6ff;
  border-color: #93c5fd;
}

.ab-slot select {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  padding: 0;
  outline: none;
}

.ab-swap {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.metric-cmp {
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}

.metric-cmp-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.metric-val-a {
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
}

.metric-name {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.metric-val-b {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.dual-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  height: 7px;
}

.dual-half {
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.dual-half.left {
  justify-content: flex-end;
}

.dual-fill-a {
  background: #2563eb;
  height: 100%;
  border-radius: 999px;
}

.dual-fill-b {
  background: #475569;
  height: 100%;
  border-radius: 999px;
}

.brand-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

@container phoneview (min-width: 580px) {
  .brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.brand-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.brand-item.in-basket {
  background: #f8fbff;
  border-color: #93c5fd;
}

.brand-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.brand-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 3px;
}

.brand-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.brand-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #edf2f7;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.brand-meta span {
  display: block;
  font-size: 10.5px;
  color: #64748b;
}

.brand-meta strong {
  display: block;
  color: #0f172a;
  margin-top: 1px;
  font-weight: 800;
}

.brand-btn-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sm-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}

.sm-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.src-link {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: underline;
  white-space: nowrap;
}

/* KPI & Calculator & Map */
.kpi-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.kpi-box {
  padding: 11px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #2563eb;
  font-variant-numeric: tabular-nums;
}

.kpi-box span {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.kpi-box strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 3px;
}

.kpi-box small {
  display: block;
  font-size: 10.5px;
  color: #047857;
  margin-top: 2px;
  font-weight: 700;
}

.calc-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.calc-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.calc-row input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}

.calc-num-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.calc-num-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.calc-num-grid input {
  height: 38px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.map-frame {
  width: 100%;
  height: 250px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  margin-top: 10px;
  background: #e2e8f0;
}

/* === Pinned Floating Compare Pill / Legacy Circle FAB === */
.ph-floating-pill {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 66px;
  height: 44px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #1e293b;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  z-index: 26;
}

.ph-floating-pill span.pill-cta {
  background: #2563eb;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.phone[data-ux-mode="before"] .ph-floating-pill {
  left: auto;
  right: 14px;
  bottom: 16px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  padding: 0;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  font-size: 10.5px;
  background: #1d4ed8;
}

.phone[data-ux-mode="before"] .ph-floating-pill span.pill-cta {
  display: none;
}

/* === Bottom 5-Tab Navigation Bar & Dimmed Slide-Up Sheet === */
.ph-bnav {
  height: 58px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #cbd5e1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  padding: 2px 4px;
  flex-shrink: 0;
  z-index: 30;
}

.phone[data-ux-mode="before"] .ph-bnav {
  display: none;
}

.ph-btab {
  position: relative;
  height: 50px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  border-radius: 10px;
  transition: color .15s ease, transform .12s ease;
}

.ph-btab svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.ph-btab[data-active="1"] {
  color: #2563eb;
  font-weight: 800;
}

.ph-btab[data-active="1"] svg {
  stroke-width: 2.4;
}

.ph-btab-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #ffffff;
}

.ph-btab-center .ph-btab-ico-pill {
  width: 30px;
  height: 24px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  border: 1px solid #bfdbfe;
}

.ph-btab-center[data-active="1"] .ph-btab-ico-pill {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}

.funnel-next-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #1d4ed8;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.funnel-next-btn > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.ph-sheet-cta-banner {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.ph-funnel-step-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  padding: 0 2px;
}

.ph-funnel-step-bar span.on {
  color: #2563eb;
  font-weight: 800;
}

.ph-backdrop {
  display: none;
  position: absolute;
  inset: 28px 0 58px 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  z-index: 28;
}

.ph-backdrop[data-open="1"] {
  display: block;
}

.ph-sheet {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  max-height: 70%;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 10px 14px 16px;
  box-shadow: 0 -14px 34px rgba(15, 23, 42, 0.22);
  z-index: 29;
}

.ph-sheet[data-open="1"] {
  display: block;
}

.ph-sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 2px auto 10px;
}

.ph-sheet-grp + .ph-sheet-grp {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.ph-sheet-grp-title {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  margin: 0 0 6px;
}

.ph-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ph-sheet-btn {
  min-height: 42px;
  padding: 7px 10px;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ph-sheet-btn[data-active="1"] {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

/* === Conversion CTA Dock & Report/Consult Modal inside Phone === */
.conv-cta-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 15px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conv-cta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.conv-cta-head span {
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
}

.conv-cta-head small {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}

.conv-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  gap: 7px;
}

@container phoneview (max-width: 355px) {
  .conv-cta-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.conv-btn-pdf {
  min-height: 42px;
  padding: 0 8px;
  border-radius: 11px;
  border: 1px solid #93c5fd;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.conv-btn-consult {
  min-height: 42px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.ph-conv-modal {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  max-height: 78%;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 12px 15px 18px;
  box-shadow: 0 -16px 38px rgba(15, 23, 42, 0.26);
  z-index: 32;
}

.ph-conv-modal[data-open="1"] {
  display: block;
}

.ph-toast {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 76px;
  padding: 9px 13px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  z-index: 45;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
  display: none;
}

.ph-toast[data-show="1"] {
  display: block;
}

/* === Stage 1~4 Production UX Polish: Large Font, Brand Search Sheet, Card Diet, Map Fullscreen === */
.ph-font-btn {
  height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.ph-font-btn[aria-pressed="true"] {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* 3050 Large Text Accessibility Scale */
.phone[data-large-text="1"] .ph-h2 { font-size: 18px; }
.phone[data-large-text="1"] .ph-sub { font-size: 13.5px; line-height: 1.6; }
.phone[data-large-text="1"] .brand-title { font-size: 16.5px; }
.phone[data-large-text="1"] .hero-num-val { font-size: 18.5px !important; }
.phone[data-large-text="1"] .metric-val-a,
.phone[data-large-text="1"] .metric-val-b { font-size: 15px; }
.phone[data-large-text="1"] .metric-name { font-size: 12.5px; }
.phone[data-large-text="1"] .qe-chip { font-size: 13.5px; min-height: 38px; }
.phone[data-large-text="1"] .sm-btn { font-size: 13px; min-height: 38px; }
.phone[data-large-text="1"] .ph-btab { font-size: 11.5px; }

/* Tappable Brand Picker Trigger Slot (Stage 1) */
.ab-picker-btn {
  width: 100%;
  padding: 10px 11px;
  border-radius: 13px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  transition: border-color .15s, background .15s;
}

.ab-picker-btn.slot-a {
  background: #eff6ff;
  border-color: #60a5fa;
}

.ab-picker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
}

.ab-picker-btn:not(.slot-a) .ab-picker-top {
  color: #475569;
}

.ab-picker-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-search-box {
  position: relative;
  margin-bottom: 8px;
}

.picker-search-box input {
  width: 100%;
  height: 40px;
  border-radius: 11px;
  border: 1px solid #93c5fd;
  background: #f8fafc;
  padding: 0 12px 0 34px;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
}

.picker-search-box input:focus {
  background: #ffffff;
  border-color: #2563eb;
}

.picker-search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #2563eb;
}

.picker-option-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
}

.picker-option-btn[data-selected="1"] {
  background: #eff6ff;
  border-color: #2563eb;
}

/* Card Diet & Progressive Disclosure (Stage 2) */
.hero-2metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.hero-num-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.hero-num-val {
  display: block;
  font-size: 16.5px;
  font-weight: 900;
  color: #0f172a;
  margin-top: 2px;
  letter-spacing: -0.02em;
}

.hero-num-val.accent {
  color: #1d4ed8;
}

.card-more-details {
  border-top: 1px dashed #e2e8f0;
  padding-top: 6px;
  font-size: 12px;
  color: #475569;
}

.card-more-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #475569;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-more-details summary::-webkit-details-marker {
  display: none;
}

/* Map Scroll-Trap Guard & Fullscreen Mode (Stage 4) */
.map-guard-wrap {
  position: relative;
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.map-guard-wrap .map-frame {
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.map-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.map-lock-overlay[data-unlocked="1"] {
  display: none;
}

.map-toolbar-float {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 520;
  display: flex;
  gap: 5px;
}

.map-pill-btn {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

.map-pill-btn.primary {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.phone[data-map-full="1"] .map-guard-wrap {
  position: absolute;
  inset: 28px 0 58px 0;
  margin: 0;
  border-radius: 0;
  border: 0;
  z-index: 35;
  background: #e2e8f0;
  display: flex;
  flex-direction: column;
}

.phone[data-map-full="1"] .map-guard-wrap .map-frame {
  height: 100% !important;
  flex: 1;
}

/* Custom Leaflet SVG Pin */
.mf-mob-pin-icon {
  background: transparent;
  border: 0;
}

/* Prevent iOS Safari auto-zoom (<16px) on mobile form inputs */
@media (max-width: 640px) {
  .mf-mob-scope input[type="text"],
  .mf-mob-scope input[type="search"],
  .mf-mob-scope input[type="email"],
  .mf-mob-scope input[type="number"],
  .mf-mob-scope select,
  .mf-mob-scope textarea {
    font-size: 16px !important;
  }
}

/* Real Mobile Viewport (<600px) on Preview Page: Fullscreen Direct Experience */
@media (max-width: 600px) {
  body[data-mf-preview-page="1"] .preview-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
  body[data-mf-preview-page="1"] .preview-header[data-mob-open="1"] {
    display: flex;
  }
  body[data-mf-preview-page="1"] .mob-inspector-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: fixed;
    top: 6px;
    right: 10px;
    z-index: 55;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
  }
  body[data-mf-preview-page="1"] .stage {
    padding: 0;
    overflow: hidden;
  }
  body[data-mf-preview-page="1"] .phone-scaler {
    width: 100% !important;
    height: 100dvh !important;
    margin: 0;
  }
  body[data-mf-preview-page="1"] .phone {
    width: 100% !important;
    height: 100dvh !important;
    transform: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  body[data-mf-preview-page="1"] .ph-statusbar {
    display: none;
  }
  body[data-mf-preview-page="1"] .ph-disclaimer {
    padding-right: 88px;
  }
}

/* Print / PDF Save Styles */
@media print {
  .preview-header,
  .mob-inspector-toggle,
  .ph-statusbar,
  .ph-bnav,
  .ph-floating-pill,
  .ph-backdrop,
  .ph-sheet,
  .ph-conv-modal,
  .ph-toast {
    display: none !important;
  }
  body[data-mf-preview-page="1"],
  body[data-mf-preview-page="1"] .stage,
  body[data-mf-preview-page="1"] .phone-scaler,
  body[data-mf-preview-page="1"] .phone,
  body[data-mf-preview-page="1"] .ph-scroll,
  .mf-mob-scope,
  .mf-mob-scope .phone,
  .mf-mob-scope .ph-scroll {
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
}

@media print and (min-width: 1024px) {
  body:not([data-mf-preview-page="1"]) #mf-mobile-ux-root {
    display: none !important;
  }
}

@media print and (max-width: 1023px) {
  body:not([data-mf-preview-page="1"]) > aside.mf-review-note,
  body:not([data-mf-preview-page="1"]) > #root {
    display: none !important;
  }
}

/* === MarkFact Production Launch Mobile UX Polish === */
.qe-chip-row {
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  gap: 7px !important;
}
.qe-chip {
  min-height: 38px !important;
  padding: 0 13px !important;
  font-size: 12.5px !important;
}
.ph-search input {
  font-size: 13px !important;
  min-height: 38px !important;
}
.ph-large-btn {
  min-height: 38px !important;
}
.sm-btn, .ab-picker-btn {
  min-height: 42px !important;
}
.ph-main, .ph-scroll, .phone-body, .ph-view {
  padding-bottom: 138px !important;
}
.ph-float-bar {
  bottom: 66px !important;
  padding: 8px 12px !important;
}
