:root {
  --mf-phone-navy: #102a3d;
  --mf-phone-blue: #0b5f9f;
  --mf-phone-gold: #e39a00;
  --mf-phone-bg: #f4f7fa;
  --mf-phone-line: #d7e1e9;
  --mf-phone-muted: #647789;
}

[data-mf-mobile-shell] {
  display: none !important;
}

[hidden] {
  display: none !important;
}

html.mf-phone-app {
  overflow-x: hidden;
  background: var(--mf-phone-bg);
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

html.mf-phone-app body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  background: var(--mf-phone-bg);
}

html.mf-phone-app body.mf-phone-menu-open {
  overflow: hidden;
}

html.mf-phone-app body > header,
html.mf-phone-app body > footer {
  display: none !important;
}

html.mf-phone-app .mf-phone-header {
  position: sticky;
  top: 0;
  z-index: 600;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: calc(64px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid rgba(215, 225, 233, .94);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 18px rgba(16, 42, 61, .07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mf-phone-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 2px 0;
}

.mf-phone-brand img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 142px;
  object-fit: contain;
}

html.mf-phone-app .mf-phone-menu-button,
html.mf-phone-app .mf-phone-close {
  display: inline-flex !important;
  width: auto !important;
  min-width: 46px;
  min-height: 46px;
  margin: 0 !important;
  padding: 0 13px !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--mf-phone-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: var(--mf-phone-navy) !important;
  box-shadow: none !important;
  font: inherit;
  font-weight: 800;
}

.mf-phone-menu-icon {
  font-size: 1.2rem;
  line-height: 1;
}

html.mf-phone-app .mf-phone-layer {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: block !important;
  pointer-events: none;
}

html.mf-phone-app .mf-phone-backdrop {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(7, 24, 36, .58) !important;
  box-shadow: none !important;
  pointer-events: auto;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mf-phone-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: min(88vw, 380px);
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  box-shadow: -20px 0 54px rgba(16, 42, 61, .25);
  pointer-events: auto;
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .22s ease, visibility .22s;
}

.mf-phone-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.mf-phone-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(74px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid var(--mf-phone-line);
}

.mf-phone-drawer-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--mf-phone-navy);
}

.mf-phone-drawer-brand img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--mf-phone-line);
  border-radius: 13px;
  background: var(--mf-phone-bg);
}

.mf-phone-drawer-brand div,
.mf-phone-user div {
  display: grid;
  min-width: 0;
}

.mf-phone-drawer-brand strong {
  font-size: 1.06rem;
}

.mf-phone-drawer-brand small,
.mf-phone-user small {
  color: var(--mf-phone-muted);
  font-size: .76rem;
}

html.mf-phone-app .mf-phone-close {
  width: 44px !important;
  min-width: 44px;
  min-height: 44px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #edf2f6 !important;
  font-size: 1.55rem;
}

.mf-phone-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 14px 2px;
  padding: 12px;
  border-radius: 13px;
  background: var(--mf-phone-bg);
  color: var(--mf-phone-navy);
}

.mf-phone-menu-scroll {
  flex: 1;
  padding: 5px 14px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mf-phone-menu-label {
  margin: 16px 8px 6px;
  color: var(--mf-phone-muted);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mf-phone-links {
  display: grid;
  gap: 4px;
}

.mf-phone-links a,
html.mf-phone-app .mf-phone-links button {
  display: flex !important;
  width: 100% !important;
  min-height: 48px;
  margin: 0 !important;
  padding: 10px 12px !important;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--mf-phone-navy) !important;
  box-shadow: none !important;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: .96rem;
  font-weight: 750;
}

.mf-phone-links a > span,
.mf-phone-links button > span {
  display: grid;
  width: 25px;
  color: var(--mf-phone-blue);
  place-items: center;
  font-size: 1.15rem;
}

.mf-phone-links a[aria-current="page"] {
  border-color: #c9e0f0 !important;
  background: #e9f4fb !important;
  color: var(--mf-phone-blue) !important;
}

html.mf-phone-app .mf-phone-tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 700;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(66px + env(safe-area-inset-bottom));
  padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(199, 212, 223, .92);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -8px 28px rgba(16, 42, 61, .1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mf-phone-tabbar a,
html.mf-phone-app .mf-phone-tabbar button {
  display: flex !important;
  min-width: 0;
  width: auto !important;
  min-height: 54px;
  margin: 0 !important;
  padding: 4px 3px !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--mf-phone-muted) !important;
  box-shadow: none !important;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
}

.mf-phone-tabbar a[aria-current="page"] {
  background: #e9f4fb !important;
  color: var(--mf-phone-blue) !important;
}

.mf-phone-tabbar span {
  font-size: 1.32rem;
  line-height: 1;
}

.mf-phone-tabbar small {
  max-width: 100%;
  overflow: hidden;
  font-size: .68rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.mf-phone-app main {
  width: calc(100% - 24px) !important;
  max-width: 760px;
  margin: 0 auto !important;
  padding: 18px 0 28px !important;
  overflow-x: hidden;
}

html.mf-phone-app h1 {
  font-size: clamp(1.35rem, 6.5vw, 1.8rem);
  line-height: 1.18;
}

html.mf-phone-app h2 {
  line-height: 1.25;
}

html.mf-phone-app input:not([type="checkbox"]):not([type="radio"]),
html.mf-phone-app select,
html.mf-phone-app textarea {
  max-width: 100% !important;
  min-height: 46px;
  font-size: 16px !important;
}

html.mf-phone-app button,
html.mf-phone-app .btn,
html.mf-phone-app [class*="btn-"] {
  min-height: 44px;
}

html.mf-phone-app table {
  display: block;
  width: 100% !important;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html.mf-phone-app th,
html.mf-phone-app td {
  min-width: 108px;
}

html.mf-phone-app .modal-content,
html.mf-phone-app .modal-content.modal-wide {
  width: calc(100% - 20px) !important;
  max-width: none !important;
  max-height: calc(100dvh - 24px);
  margin: 12px auto !important;
  padding: 18px !important;
  overflow-y: auto;
  border-radius: 18px;
}

.mf-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.mf-eyebrow {
  margin: 0 0 4px;
  color: var(--mf-phone-blue);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.mf-lead {
  max-width: 700px;
  margin: 4px 0 0;
  color: var(--mf-phone-muted);
}

.mf-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mf-heading-actions form {
  margin: 0;
}

.mf-device-grid {
  display: grid;
  gap: 12px;
}

.mf-device-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--mf-phone-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 42, 61, .08);
}

.mf-device-card.is-current {
  border-color: #8fc4e9;
  box-shadow: 0 0 0 3px rgba(11, 95, 159, .08), 0 10px 26px rgba(16, 42, 61, .08);
}

.mf-device-icon {
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #e8f3fb;
  color: var(--mf-phone-blue);
  font-size: 1.65rem;
  font-weight: 900;
  place-items: center;
}

.mf-device-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mf-device-title h2,
.mf-device-copy p {
  margin: 2px 0;
}

.mf-device-title h2 {
  font-size: 1.05rem;
}

.mf-device-meta {
  color: var(--mf-phone-muted);
  font-size: .82rem;
}

.mf-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  place-items: end center;
  background: rgba(7, 24, 36, .64);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.mf-install-sheet {
  position: relative;
  width: min(100%, 480px);
  padding: 24px;
  border-radius: 22px;
  background: #fff;
  color: var(--mf-phone-navy);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.mf-install-appicon {
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid var(--mf-phone-line);
  border-radius: 17px;
}

.mf-install-sheet h2 {
  margin: 12px 36px 12px 0;
  font-size: 1.25rem;
}

.mf-install-sheet ol {
  display: grid;
  gap: 10px;
  padding-left: 22px;
}

html.mf-phone-app .mf-install-close,
.mf-install-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid !important;
  width: 42px !important;
  height: 42px;
  min-height: 42px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #edf2f6 !important;
  color: var(--mf-phone-navy) !important;
  font-size: 1.45rem;
  place-items: center;
}

html.mf-phone-app .mf-page-heading {
  display: grid;
  align-items: start;
  gap: 14px;
}

html.mf-phone-app .mf-heading-actions,
html.mf-phone-app .mf-heading-actions form,
html.mf-phone-app .mf-heading-actions a,
html.mf-phone-app .mf-heading-actions button {
  width: 100%;
}

html.mf-phone-app .mf-device-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding: 14px;
  border-radius: 16px;
}

html.mf-phone-app .mf-device-card > form {
  grid-column: 1 / -1;
  width: 100%;
}

html.mf-phone-app .mf-device-card > form button {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .mf-phone-drawer {
    transition: none;
  }
}
