html[data-medaliza-ui-mode="mobile"] .medibill-sidebar,
html[data-medaliza-ui-mode="mobile"] .sidebar-backdrop,
html[data-medaliza-ui-mode="mobile"] .medibill-topbar {
  display: none !important;
}

html[data-medaliza-ui-mode="mobile"] .main-content {
  width: 100% !important;
  margin-left: 0 !important;
}

html[data-medaliza-ui-mode="mobile"] #app {
  max-width: none !important;
  padding: 0 !important;
}

.medaliza-mobile-shell {
  min-height: 100vh;
  max-width: 540px;
  margin: 0 auto;
  padding: 14px 14px calc(82px + env(safe-area-inset-bottom));
  color: #10275c;
  background: linear-gradient(180deg, #edf9ff, #f8fcff);
  font-family: "DM Sans", sans-serif;
}

.medaliza-mobile-shell *,
.medaliza-mobile-shell *::before,
.medaliza-mobile-shell *::after { box-sizing: border-box; }

.medaliza-mobile-shell-header { display: flex; align-items: center; gap: 10px; min-height: 54px; }
.medaliza-mobile-shell-header img { width: min(150px, 43vw); max-height: 50px; object-fit: contain; object-position: left center; }
.medaliza-mobile-shell-header div { min-width: 0; }
.medaliza-mobile-shell-header b,.medaliza-mobile-shell-header small { display: block; }
.medaliza-mobile-shell-header b { color: #0d2a61; font-size: 16px; }
.medaliza-mobile-shell-header small { margin-top: 2px; color: #6480a5; font-size: 11px; }
.medaliza-mobile-shell-header button,.medaliza-mobile-placeholder button,.medaliza-mobile-dashboard button { margin-left: auto; border: 1px solid #cfe5fb; border-radius: 11px; background: #fff; padding: 9px 11px; color: #0b70dd; font: 800 11px/1 "DM Sans", sans-serif; }

.medaliza-mobile-shell-content { display: grid; min-height: calc(100vh - 164px); place-items: center; }
.medaliza-mobile-shell-content:has(> .mdd) { display: block; min-height: 0; }
.mdd { width: 100%; min-width: 0; padding-top: 18px; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; color: #111b53; }
.mdd button { font: inherit; cursor: pointer; }
.mdd button:disabled { cursor: default; }
.mdd button:focus-visible,.mdd [tabindex]:focus-visible { outline: 2px solid #0879ed; outline-offset: 2px; }
.mdd svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.mdd-hero,.mdd-panel { border: 1px solid #e0effb; border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 3px 12px rgba(52,129,197,.08); }
.mdd-hero { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; overflow: hidden; min-height: 76px; background: linear-gradient(110deg,#fff 45%,#e2f4ff); }
.mdd-hero>div { position: relative; z-index: 1; padding-right: 24px; }
.mdd-hero h1 { margin: 0 0 4px; font-size: 17px; line-height: 1.25; letter-spacing: -.4px; }
.mdd-hero p { margin: 0; color: #647da8; font-size: 11px; line-height: 1.4; }
.mdd-user { display: grid; place-items: center; width: 42px; height: 44px; flex: 0 0 auto; color: #416091; border: 1px solid #e0effb; border-radius: 13px; background: #f7fbff; }
.mdd-user svg { width: 28px; height: 28px; }
.mdd .mdd-art { position: absolute; right: 0; bottom: 0; width: 90px; height: 72px; stroke: none; opacity: .65; }
.mdd-kpis { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.mdd-kpi { --kpi: #078bff; --wash: #e4f2ff; position: relative; display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 11px 10px 15px; min-height: 104px; border: 1px solid var(--wash); border-radius: 16px; background: linear-gradient(125deg,var(--wash),#fff); text-align: left; color: #10134f; box-shadow: 0 3px 9px rgba(32,103,167,.07); overflow: hidden; }
.mdd-kpi--green { --kpi: #06b98b; --wash: #def9ec; }
.mdd-kpi--violet { --kpi: #9738ec; --wash: #f0e5ff; }
.mdd-kpi--orange { --kpi: #ff960d; --wash: #fff0d6; }
.mdd-kpi--red { --kpi: #fb4769; --wash: #ffe4ea; }
.mdd-kpi--cyan { --kpi: #04b6ce; --wash: #dff7fc; }
.mdd-kpi-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 46px; border-radius: 15px; color: white; background: linear-gradient(140deg,#ffffff66,var(--kpi) 70%),var(--kpi); box-shadow: 0 5px 9px color-mix(in srgb,var(--kpi) 25%,transparent); }
.mdd-kpi-icon svg { width: 24px; height: 24px; stroke-width: 2; }
.mdd-kpi-copy { position: relative; z-index: 1; display: grid; gap: 4px; min-width: 0; flex: 1; }
.mdd-kpi-copy strong { font-size: 12px; line-height: 1.25; padding-right: 6px; }
.mdd-kpi-copy b { font-size: clamp(16px,3.8vw,23px); line-height: 1.15; letter-spacing: -.6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mdd-kpi-copy small { color: #607daa; font-size: 10px; line-height: 1.3; }
.mdd-chevron { position: absolute; top: 8px; right: 7px; color: var(--kpi); font-size: 21px; line-height: 1; }
.mdd-kpi:disabled .mdd-chevron { display: none; }
.mdd .mdd-wave { position: absolute; right: 2px; bottom: 0; width: 90px; height: 27px; stroke: var(--kpi); opacity: .4; stroke-width: 1.3; }
.mdd-panel { padding: 12px; min-width: 0; }
.mdd-panel header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.mdd-panel h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 15px; letter-spacing: -.3px; }
.mdd-panel h2 svg { color: #087eff; width: 20px; height: 20px; }
.mdd-panel header>div { display: flex; align-items: center; gap: 5px; }
.mdd-panel button,.mdd-period { display: inline-block; border: 1px solid #e0edfc; border-radius: 10px; padding: 7px 9px; color: #087cff; background: #fff; font-size: 10px; font-weight: 700; }
.mdd-period { color: #192758; }
.mdd-panel button:disabled { color: #7b8ba6; }
.mdd-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 13px 0 5px; color: #6881ad; font-size: 10px; }
.mdd-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #078bff; box-shadow: 0 0 0 3px #e2f1ff; }
.mdd-legend span:nth-child(2)::before { background: #04b984; box-shadow: 0 0 0 3px #e3f8ed; }
.mdd-legend span:nth-child(3)::before { background: #9b46f4; box-shadow: 0 0 0 3px #f1e8fe; }
.mdd-chart-summary { text-align: right; font-size: 10px; color: #5f7da7; }
.mdd-chart-summary b { color: #087eff; font-size: 17px; margin-right: 6px; }
.mdd .mdd-chart { display: block; width: 100%; height: auto; overflow: visible; }
.mdd-chart text { fill: #637ea8; stroke: none; font-size: 9px; }
.mdd-chart rect { stroke: none; }
.mdd-chart .mdd-grid { stroke: #dceafa; stroke-width: .7; stroke-dasharray: 2 2; }
.mdd-chart .mdd-line { stroke-width: 2; stroke: #078bff; }
.mdd-chart .mdd-line--1 { stroke: #04b984; }
.mdd-chart .mdd-line--2 { stroke: #9b46f4; }
.mdd-table-wrap { overflow-x: auto; margin-top: 10px; }
.mdd table { border-collapse: collapse; width: 100%; min-width: 410px; font-size: 10px; color: #617dab; }
.mdd th { background: #eaf5ff; color: #325b8d; font-weight: 700; text-align: left; }
.mdd th,.mdd td { padding: 9px 6px; border-bottom: 1px solid #e6f1fb; }
.mdd td:nth-child(4) { font-weight: 800; color: #111e50; white-space: nowrap; }
.mdd-status { display: inline-block; padding: 4px 7px; border-radius: 20px; background: #fff0d6; color: #95610a; white-space: nowrap; font-size: 9px; }
.mdd-status--paid { background: #d9f9e8; color: #159766; }
.mdd-empty,.mdd-error p { padding: 20px 6px; color: #647da8; font-size: 12px; text-align: center; }
.mdd-loading { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mdd-loading>div { min-height: 104px; border-radius: 16px; background: linear-gradient(115deg,#e4f1fc,#f8fcff,#e4f1fc); background-size: 200% 100%; animation: mdd-loading 1.5s linear infinite; }
@media(min-width: 480px) {
  .mdd-kpi-icon { width: 48px; height: 51px; }
  .mdd-kpi-copy strong { font-size: 14px; }
  .mdd-kpi-copy small { font-size: 12px; }
  .mdd-kpi-copy b { font-size: 24px; }
  .mdd-chevron { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--wash); border-radius: 50%; top: 8px; right: 5px; }
  .mdd-kpi-copy strong { padding-right: 16px; }
}
@keyframes mdd-loading { to { background-position: -200% 0; } }
@media(max-width: 380px) {
  .mdd { gap: 9px; }
  .mdd-kpi { padding: 10px 8px 14px; gap: 6px; min-height: 104px; }
  .mdd-kpi-icon { width: 30px; height: 37px; border-radius: 11px; }
  .mdd-kpi-icon svg { width: 21px; height: 21px; }
  .mdd-kpi-copy strong { font-size: 11px; }
  .mdd-kpi-copy small { font-size: 9px; }
  .mdd-hero { padding: 10px; gap: 8px; }
  .mdd-hero h1 { font-size: 14px; }
}
@media(prefers-reduced-motion: reduce) { .mdd-loading>div { animation: none; } }
.medaliza-mobile-dashboard,.medaliza-mobile-placeholder { width: 100%; max-width: 430px; padding: 28px 23px; border: 1px solid #d8eaff; border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 12px 28px rgba(23,79,144,.08); text-align: center; }
.medaliza-mobile-eyebrow { margin: 0; color: #137cf0; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.medaliza-mobile-dashboard h1,.medaliza-mobile-placeholder h1 { margin: 8px 0; color: #0c2458; font-size: 24px; }
.medaliza-mobile-dashboard p,.medaliza-mobile-placeholder p { margin: 0; color: #627da2; font-size: 13px; line-height: 1.55; }
.medaliza-mobile-dashboard div { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.medaliza-mobile-dashboard button { margin: 0; }
.medaliza-mobile-placeholder span { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 14px; background: #eaf6ff; color: #137cf0; font-size: 25px; }
.medaliza-mobile-placeholder button { margin: 18px 0 0; }

.medaliza-mobile-shell--billing { padding: 14px 0 calc(82px + env(safe-area-inset-bottom)); }
.medaliza-mobile-shell--billing .medaliza-mobile-shell-header { padding: 0 14px; }
.medaliza-mobile-shell--billing .medaliza-mobile-shell-content--billing { display: block; min-height: 0; }
.medaliza-mobile-shell--billing .medaliza-mobile-billing { min-height: 0; padding-bottom: 12px; }

.medaliza-mobile-shell-nav {
  --mnav-main-bg: #e7effc;
  --mnav-main-bg-2: #dfeafa;
  --mnav-main-border: #bacde8;
  --mnav-main-text: #24466f;
  --mnav-parent-open-bg: #d8e8ff;
  --mnav-parent-open-border: #7caeed;
  --mnav-parent-open-text: #1458a8;
  --mnav-main-active-start: #2479df;
  --mnav-main-active-end: #145fc4;
  --mnav-child-cluster-bg: #e2f6f1;
  --mnav-child-bg: #d9f1eb;
  --mnav-child-bg-2: #d1ece6;
  --mnav-child-border: #9fd5ca;
  --mnav-child-text: #17645d;
  --mnav-child-active-start: #16a096;
  --mnav-child-active-end: #087d77;
  position: fixed; z-index: 30; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); left: max(10px, env(safe-area-inset-left)); width: auto; max-width: 520px; margin: 0 auto; padding: 5px; border: 1px solid rgba(156,181,210,.55); border-radius: 22px; background: rgba(244,248,252,.94); box-shadow: 0 8px 24px rgba(26,88,147,.14); backdrop-filter: blur(14px);
}
.medaliza-mobile-shell-nav::before,.medaliza-mobile-shell-nav::after { content: ""; position: absolute; z-index: 1; top: 8px; bottom: 8px; width: 5px; pointer-events: none; }
.medaliza-mobile-shell-nav::before { left: 5px; background: linear-gradient(90deg,#f4f8fc,transparent); }
.medaliza-mobile-shell-nav::after { right: 5px; background: linear-gradient(270deg,#f4f8fc,transparent); }
.medaliza-mobile-shell-nav__scroller { min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; overflow-anchor: none; scroll-behavior: auto; scrollbar-width: none; border-radius: 16px; }
.medaliza-mobile-shell-nav__scroller::-webkit-scrollbar { display: none; }
.medaliza-mobile-shell-nav__track { display: flex; align-items: center; gap: 5px; width: max-content; padding: 3px; }
.medaliza-mobile-shell-nav__item { position: relative; flex: 0 0 auto; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 4px; border: 1px solid; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.medaliza-mobile-shell-nav__item--main { width: 76px; height: 56px; border-radius: 14px; border-color: var(--mnav-main-border); background: linear-gradient(155deg,var(--mnav-main-bg),var(--mnav-main-bg-2)); color: var(--mnav-main-text); box-shadow: 0 2px 4px rgba(36,70,111,.09); }
.medaliza-mobile-shell-nav__child-cluster { position: relative; display: flex; align-items: center; flex: 0 0 auto; gap: 4px; width: max-content; padding: 3px 3px 3px 7px; border: 1px solid var(--mnav-child-border); border-radius: 15px; background: var(--mnav-child-cluster-bg); box-shadow: inset 0 1px 3px rgba(23,100,93,.06); }
.medaliza-mobile-shell-nav__child-cluster::before { content: ""; position: absolute; left: 2px; top: 15px; bottom: 15px; width: 2px; border-radius: 2px; background: var(--mnav-child-border); }
.medaliza-mobile-shell-nav__item--child { width: 84px; height: 48px; border-radius: 11px; border-color: var(--mnav-child-border); background: linear-gradient(155deg,var(--mnav-child-bg),var(--mnav-child-bg-2)); color: var(--mnav-child-text); }
.medaliza-mobile-shell-nav__item--main:hover,.medaliza-mobile-shell-nav__item--main.is-open { border-color: var(--mnav-parent-open-border); background: var(--mnav-parent-open-bg); color: var(--mnav-parent-open-text); }
.medaliza-mobile-shell-nav__item--main.is-open::after { content: ""; position: absolute; right: 4px; top: 7px; width: 3px; height: 3px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.medaliza-mobile-shell-nav__item--child:hover { border-color: var(--mnav-child-text); background: var(--mnav-child-bg-2); }
.medaliza-mobile-shell-nav__child-cluster.is-entering { animation: medaliza-nav-enter .16s ease-out; }
@keyframes medaliza-nav-enter { from { opacity: 0; transform: translateX(-5px); } }
.medaliza-mobile-shell-nav__item:focus-visible { outline: 2px solid #0879ed; outline-offset: 2px; }
.medaliza-mobile-shell-nav__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medaliza-mobile-shell-nav__item--child .medaliza-mobile-shell-nav__icon { width: 17px; height: 17px; }
.medaliza-mobile-shell-nav__label { max-width: 100%; color: inherit; font: 700 10px/1.15 "DM Sans",sans-serif; text-align: center; white-space: normal; }
.medaliza-mobile-shell-nav__item--main.is-active { border-color: var(--mnav-main-active-end); background: linear-gradient(145deg,var(--mnav-main-active-start),var(--mnav-main-active-end)); box-shadow: 0 3px 7px rgba(20,95,196,.18); color: #fff; transform: translateY(-1px); }
.medaliza-mobile-shell-nav__item--child.is-active { border-color: var(--mnav-child-active-end); background: linear-gradient(145deg,var(--mnav-child-active-start),var(--mnav-child-active-end)); box-shadow: 0 2px 5px rgba(8,125,119,.18); color: #fff; transform: translateY(-1px); }

html[data-medaliza-ui-mode="mobile"] .medaliza-mobile-shell--billing .medaliza-mobile-billing { min-height: 0; }

@media (max-width: 360px) {
  .medaliza-mobile-shell { padding-right: 9px; padding-left: 9px; }
  .medaliza-mobile-shell-header img { width: min(128px, 42vw); }
  .medaliza-mobile-shell-header b { font-size: 14px; }
  .medaliza-mobile-shell-nav { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .medaliza-mobile-shell-nav__item { transition: none; animation: none; }
  .medaliza-mobile-shell-nav__child-cluster { animation: none; }
}
