/* Mobile UI for login + admin. Activated by html.is-mobile from mobile-detect.js */

html.is-mobile {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.is-mobile body {
  overscroll-behavior-y: auto;
}

/* —— Login —— */
html.is-mobile .login-page {
  min-height: 100dvh;
  align-content: start;
  place-items: stretch;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 80% at 50% -10%, #2b3846 0%, transparent 55%),
    #151c24;
}

html.is-mobile .login-shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding-top: 28px;
}

html.is-mobile .login-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

html.is-mobile .login-brand .brand-card {
  width: 48px;
  height: 56px;
  font-size: 30px;
}

html.is-mobile .login-brand h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: .02em;
}

html.is-mobile .login-brand p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #b7c3ce;
}

html.is-mobile .login-form {
  padding: 22px 18px 20px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

html.is-mobile .login-form h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

html.is-mobile .login-form label {
  margin: 16px 0;
  font-size: 13px;
}

html.is-mobile .login-form input {
  height: 48px;
  margin-top: 8px;
  font-size: 16px;
  border-radius: 10px;
  padding: 0 14px;
}

html.is-mobile .login-form .primary-btn {
  height: 48px;
  margin-top: 12px;
  border-radius: 10px;
  font-size: 16px;
}

html.is-mobile .login-contact {
  margin-top: 22px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.7;
  color: #aeb9c4;
  word-break: break-all;
}

html.is-mobile .form-error {
  min-height: 22px;
  font-size: 13px;
}

/* —— Admin shell / topbar —— */
html.is-mobile .admin-shell {
  min-height: 100dvh;
  background: #eef1f4;
}

html.is-mobile .admin-shell > .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: auto;
  min-height: 52px;
  flex: none;
  flex-wrap: wrap;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  gap: 8px 10px;
}

html.is-mobile .admin-shell > .topbar .topbar-brand {
  flex: 1 1 auto;
  min-width: 0;
}

html.is-mobile .admin-shell > .topbar h1 {
  font-size: 15px;
  white-space: normal;
  line-height: 1.25;
}

html.is-mobile .admin-shell > .topbar .topbar-brand .brand-card {
  width: 24px;
  height: 28px;
  font-size: 15px;
}

html.is-mobile .admin-shell > .topbar .topbar-actions {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

html.is-mobile .admin-shell > .topbar .user-chip {
  display: none;
}

html.is-mobile .admin-shell > .topbar .topbar-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}

html.is-mobile .admin-main {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 12px 12px max(20px, env(safe-area-inset-bottom));
}

html.is-mobile .admin-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

html.is-mobile .admin-card {
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(16, 28, 39, .08);
}

html.is-mobile .admin-card h2 {
  font-size: 16px;
  padding: 14px 14px 12px;
}

html.is-mobile .admin-body {
  padding: 12px 14px 16px;
}

html.is-mobile .admin-body .notice {
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 12px;
}

html.is-mobile .admin-form,
html.is-mobile .contact-form,
html.is-mobile .security-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

html.is-mobile .admin-form label,
html.is-mobile .contact-form label,
html.is-mobile .security-form label {
  font-size: 12px;
}

html.is-mobile .admin-form input,
html.is-mobile .admin-form select,
html.is-mobile .contact-form input,
html.is-mobile .security-form input {
  height: 44px;
  margin-top: 6px;
  font-size: 16px;
  border-radius: 8px;
}

html.is-mobile .admin-form .generate-btn,
html.is-mobile .admin-form .dark-btn,
html.is-mobile .contact-form .dark-btn,
html.is-mobile .security-form .dark-btn {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  font-size: 15px;
  justify-self: stretch;
}

html.is-mobile .credential-preview {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

/* Desktop table hidden; card list shown */
html.is-mobile .admin-table-wrap {
  display: none;
}

html.is-mobile .admin-user-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

html.is-mobile .admin-user-card {
  border: 1px solid #d5dde5;
  border-radius: 10px;
  background: #f8fafb;
  padding: 12px;
}

html.is-mobile .admin-user-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

html.is-mobile .admin-user-card-head b {
  font-size: 16px;
  word-break: break-all;
}

html.is-mobile .admin-user-card-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #5c6975;
  line-height: 1.45;
}

html.is-mobile .admin-user-card-meta strong {
  color: #24313c;
  font-weight: 800;
}

html.is-mobile .admin-user-card .admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

html.is-mobile .admin-user-card .admin-actions .small-btn {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  font-size: 13px;
}

html.is-mobile .admin-user-cards .empty-note {
  text-align: center;
  color: #8a959f;
  padding: 24px 8px;
  font-size: 13px;
}

html.is-mobile .pager {
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
}

html.is-mobile .pager .small-btn {
  flex: 1;
  height: 40px;
  border-radius: 8px;
}

html.is-mobile .pager #pageInfo {
  flex: 0 0 auto;
  font-size: 12px;
  text-align: center;
  min-width: 40%;
}

/* Modal */
html.is-mobile .modal-backdrop {
  padding: 16px;
  align-items: end;
}

html.is-mobile .modal {
  width: 100%;
  max-width: none;
  border-radius: 14px 14px 10px 10px;
  padding: 18px 16px max(16px, env(safe-area-inset-bottom));
}

html.is-mobile .modal h3 {
  font-size: 17px;
}

html.is-mobile .modal input,
html.is-mobile .modal select {
  height: 44px;
  font-size: 16px;
  border-radius: 8px;
}

html.is-mobile .modal-actions {
  gap: 8px;
}

html.is-mobile .modal-actions button {
  flex: 1;
  height: 44px;
  border-radius: 8px;
  font-size: 15px;
}

html.is-mobile .contact-form .save-row,
html.is-mobile .security-form .save-row {
  margin-top: 2px;
}

html.is-mobile .contact-form .save-row .dark-btn {
  width: 100%;
}

/* Toast (login/admin/app shared fallback) */
.toast{position:fixed;left:50%;bottom:28px;z-index:80;transform:translateX(-50%) translateY(12px);max-width:min(90vw,420px);padding:10px 16px;border-radius:8px;background:#17212a;color:#fff;font-size:13px;font-weight:750;box-shadow:0 10px 28px rgba(0,0,0,.28);opacity:0;pointer-events:none;transition:opacity .18s,transform .18s}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

html.is-mobile #toast {
  left: 50%;
  right: auto;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  width: min(88vw, 360px);
  text-align: center;
}

html.is-mobile #toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Desktop keeps card list hidden */
html:not(.is-mobile) .admin-user-cards {
  display: none;
}

/* —— App topbar: desktop keeps one-row toolbar —— */
html:not(.is-mobile) .app-shell > .topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

html:not(.is-mobile) .topbar-brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

html:not(.is-mobile) .topbar-menu-toggle,
html:not(.is-mobile) .topbar-drawer-backdrop,
html:not(.is-mobile) .topbar-drawer-head,
html:not(.is-mobile) .topbar-btn-label {
  display: none !important;
}

html:not(.is-mobile) .topbar-brand {
  margin-right: auto;
}

html:not(.is-mobile) .topbar-quick,
html:not(.is-mobile) .topbar-drawer,
html:not(.is-mobile) .topbar-drawer-panel,
html:not(.is-mobile) .topbar-actions {
  display: contents;
}

html:not(.is-mobile) .app-shell > .topbar .user-chip { order: 1; }
html:not(.is-mobile) .app-shell > .topbar #openOddsBtn { order: 2; }
html:not(.is-mobile) .app-shell > .topbar #openContactBtn { order: 3; }
html:not(.is-mobile) .app-shell > .topbar #magnifierBtn { order: 4; }
html:not(.is-mobile) .app-shell > .topbar #adminBtn { order: 5; }
html:not(.is-mobile) .app-shell > .topbar #undoBtn { order: 6; }
html:not(.is-mobile) .app-shell > .topbar #redoBtn { order: 7; }
html:not(.is-mobile) .app-shell > .topbar #exportBtn { order: 8; }
html:not(.is-mobile) .app-shell > .topbar #saveDataBtn { order: 9; }
html:not(.is-mobile) .app-shell > .topbar #clearAllBtn { order: 10; }
html:not(.is-mobile) .app-shell > .topbar #logoutBtn { order: 11; }

/* —— App topbar: mobile compact bar + sheet menu —— */
html.is-mobile .app-shell > .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: auto;
  min-height: 52px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  flex-wrap: nowrap;
}

html.is-mobile .app-shell > .topbar .topbar-brand {
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

html.is-mobile .app-shell > .topbar .topbar-brand .brand-card {
  width: 24px;
  height: 28px;
  font-size: 15px;
  flex: 0 0 auto;
}

html.is-mobile .topbar-brand-text {
  min-width: 0;
}

html.is-mobile .app-shell > .topbar h1 {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.is-mobile .app-shell > .topbar .topbar-sub {
  display: none;
}

html.is-mobile .topbar-quick {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

html.is-mobile .topbar-quick .topbar-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

html.is-mobile .topbar-quick #openOddsBtn {
  padding: 0 8px;
  max-width: 118px;
}

html.is-mobile .topbar-quick #openOddsBtn small,
html.is-mobile .topbar-quick #openOddsBtn .topbar-odds-full {
  display: none;
}

html.is-mobile .topbar-menu-toggle {
  background: #276cf4;
  border-color: #5f95f5;
  font-weight: 800;
}

html.is-mobile .topbar-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
}

html.is-mobile.topbar-menu-open .topbar-drawer,
html.is-mobile .app-shell.topbar-menu-open .topbar-drawer {
  pointer-events: auto;
  visibility: visible;
}

html.is-mobile .topbar-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 12, 18, .48);
  opacity: 0;
  transition: opacity .18s ease;
}

html.is-mobile.topbar-menu-open .topbar-drawer-backdrop,
html.is-mobile .app-shell.topbar-menu-open .topbar-drawer-backdrop {
  opacity: 1;
}

html.is-mobile .topbar-drawer-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 640px);
  overflow: auto;
  padding: 14px 14px max(16px, env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: #121a22;
  color: #fff;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .35);
  transform: translateY(110%);
  transition: transform .22s ease;
}

html.is-mobile.topbar-menu-open .topbar-drawer-panel,
html.is-mobile .app-shell.topbar-menu-open .topbar-drawer-panel {
  transform: translateY(0);
}

html.is-mobile .topbar-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

html.is-mobile .topbar-drawer-head strong {
  font-size: 16px;
}

html.is-mobile .topbar-drawer-head .topbar-btn {
  height: 34px;
  border-radius: 8px;
}

html.is-mobile .topbar-drawer .user-chip {
  display: block;
  max-width: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1c2630;
  color: #d5dee6;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

html.is-mobile .topbar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

html.is-mobile .topbar-actions .topbar-btn {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  justify-content: center;
}

html.is-mobile .topbar-actions .magnifier-toggle {
  width: 100%;
  gap: 8px;
}

html.is-mobile .topbar-actions .topbar-btn-label {
  display: inline;
}

html.is-mobile .topbar-actions .topbar-logout,
html.is-mobile .topbar-actions #adminBtn:not(.hidden) {
  grid-column: 1 / -1;
}

html.is-mobile .topbar-actions .topbar-logout {
  background: #3a2227;
  border-color: #8d3a44;
  color: #ffb4bc;
}

/* —— App home mobile stack layout —— */
html.is-mobile {
  width: 100%;
  max-width: 100%;
  height: auto !important;
  overflow: visible !important;
}

html.is-mobile body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  height: auto !important;
  overflow: visible !important;
  overscroll-behavior-y: auto !important;
  -webkit-overflow-scrolling: touch;
  position: static !important;
}

html.is-mobile .app-shell {
  display: block !important;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  max-height: none !important;
  min-height: 100dvh;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

html.is-mobile .main-grid {
  display: flex !important;
  flex-direction: column;
  flex: none !important;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 6px;
  box-sizing: border-box;
  overflow-x: clip !important;
  overflow-y: visible !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

html.is-mobile .main-left,
html.is-mobile .main-grid > .formula-panel,
html.is-mobile .panel,
html.is-mobile .inline-odds-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

html.is-mobile .main-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: auto !important;
  max-height: none !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

html.is-mobile .main-left > .inline-odds-panel { order: 0; }
html.is-mobile .main-left > .notebook-panel {
  order: 1;
  flex: 0 0 auto;
  height: 220px;
  min-height: 180px;
  max-height: 34vh;
  overflow: hidden;
}

html.is-mobile .main-left > .entry-panel {
  order: 2;
  flex: 0 0 auto;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
}

html.is-mobile .main-left > .road-panel {
  order: 3;
  flex: 0 0 auto;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
}

html.is-mobile .main-grid > .formula-panel {
  order: 4;
  grid-column: auto !important;
  grid-row: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 420px;
  flex: 0 0 auto;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

html.is-mobile .panel {
  border-radius: 8px;
}

html.is-mobile .panel-head {
  height: auto;
  min-height: 32px;
  padding: 6px 8px;
  gap: 4px;
}

html.is-mobile .panel-head h2 {
  font-size: 12px;
}

html.is-mobile .panel-head .hint {
  font-size: 9px;
  max-width: 46%;
}

html.is-mobile .notebook-panel .panel-head {
  height: auto;
  min-height: 32px;
}

html.is-mobile .notebook-panel .panel-head h2 {
  font-size: 13px;
}

html.is-mobile .notebook-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

html.is-mobile .notebook,
html.is-mobile .notebook-panel .notebook {
  min-width: 520px !important;
  width: max-content;
  max-width: none;
}

html.is-mobile .notebook th,
html.is-mobile .notebook td {
  height: 28px;
  font-size: 10px !important;
  padding: 0 4px !important;
}

html.is-mobile .notebook .table-card {
  font-size: 11px !important;
}

html.is-mobile .notebook .result-pill {
  height: 18px;
  min-width: 28px;
  font-size: 10px;
}

html.is-mobile .entry-panel .quick-entry {
  padding: 4px 5px 6px;
}

html.is-mobile .entry-panel .entry-tab {
  height: 26px;
  font-size: 11px;
}

html.is-mobile .entry-layout {
  grid-template-columns: 1fr 1fr !important;
  gap: 4px;
  padding: 3px 5px 0;
}

html.is-mobile .entry-layout .mini-card {
  height: 28px !important;
}

html.is-mobile .entry-layout .mini-score {
  width: 22px !important;
  height: 22px !important;
  font-size: 11px !important;
}

html.is-mobile .rank-pad {
  display: grid !important;
  grid-auto-flow: row;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  grid-auto-columns: unset;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  touch-action: manipulation;
  padding: 2px 0 4px;
}

html.is-mobile .rank-pad .rank-card {
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 5 / 7.6;
  border-radius: 14px;
}

html.is-mobile .rank-card .rank-number {
  inset: 20% 0 18% !important;
  font-size: clamp(18px, 7.2vw, 32px) !important;
}

html.is-mobile .rank-card .card-corner {
  font-size: clamp(11px, 3.6vw, 15px) !important;
}

html.is-mobile .rank-card .card-corner .corner-count {
  font-size: clamp(8px, 2.4vw, 10px) !important;
}

html.is-mobile .rank-card .top-left {
  padding: 5px 0 0 6px !important;
}

html.is-mobile .rank-card .top-right {
  padding: 5px 6px 0 0 !important;
}

html.is-mobile .rank-card .bottom-left {
  padding: 0 0 5px 6px !important;
}

html.is-mobile .rank-card .bottom-right {
  padding: 0 6px 5px 0 !important;
}

html.is-mobile .rank-card.ace-card {
  border: 2px solid var(--gold) !important;
  box-shadow: 0 0 0 1px rgba(198, 139, 24, .22), 0 2px 6px rgba(20, 30, 40, .12);
}

html.is-mobile .rank-card .ace-mark {
  position: absolute !important;
  left: 50% !important;
  top: 2px !important;
  z-index: 10 !important;
  transform: translateX(-50%) !important;
  padding: 1px 4px !important;
  border-radius: 3px;
  background: var(--gold) !important;
  color: #fff !important;
  font-size: clamp(8px, 2.5vw, 10px) !important;
  font-weight: 900 !important;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

html.is-mobile .bottom-controls {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  padding: 6px 0 2px !important;
  box-sizing: border-box;
}

html.is-mobile .bottom-controls button {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 36px !important;
  font-size: 11px !important;
  box-shadow: 0 1px 3px rgba(22, 34, 45, .12);
}

html.is-mobile .bottom-controls .nav-control {
  font-size: 16px !important;
}

html.is-mobile .bottom-controls .side-control {
  width: 100% !important;
  max-width: none !important;
  border-radius: 8px !important;
  font-size: 9px !important;
  line-height: 1.1;
  padding: 0 1px !important;
}

html.is-mobile .bottom-controls .side-control.active,
html.is-mobile .bottom-controls .result-pill.active {
  outline-width: 2px;
  outline-offset: 0;
}

html.is-mobile .entry-meta {
  gap: 6px;
  padding: 0 2px 2px;
}

html.is-mobile .entry-meta .clear-current {
  height: 24px;
  padding: 0 8px;
  font-size: 10px;
}

html.is-mobile .entry-meta .auto-label {
  font-size: 10px;
}

html.is-mobile .road-panel .panel-head-actions .hint {
  display: none;
}

html.is-mobile .road-board-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  gap: 6px;
  padding: 0 6px 8px;
  box-sizing: border-box;
  overflow: hidden;
  grid-template-columns: none !important;
}

html.is-mobile .road-main-block,
html.is-mobile .road-derived-block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  border: 1px solid #d5dde5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

html.is-mobile .road-block-label {
  display: block;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  color: #4d5a66;
  background: #f3f5f7;
  border-bottom: 1px solid #dfe5ea;
}

html.is-mobile .road-main-block .road-grid-wrap {
  width: 100%;
  max-width: 100%;
  height: 132px;
  border-right: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: manipulation;
}

html.is-mobile .road-grid {
  --cell: 22px;
  height: 132px !important;
  grid-template-rows: repeat(6, var(--cell));
}

html.is-mobile .road-mark {
  width: 16px;
  height: 16px;
  transform: translate(3px, 3px);
  border-width: 3px;
  font-size: 7px;
}

html.is-mobile .road-derived-block .derived-roads {
  width: 100%;
  max-width: 100%;
  height: 132px;
  grid-template-rows: repeat(3, 44px);
}

html.is-mobile .derived-road-wrap {
  height: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: manipulation;
}

html.is-mobile .inline-odds-panel {
  padding: 6px 8px 5px;
}

html.is-mobile .inline-odds-progress {
  height: 30px;
  border-radius: 8px;
}

html.is-mobile .inline-odds-title {
  font-size: 11px;
}

html.is-mobile .inline-odds-labels {
  font-size: 11px;
  padding: 4px 2px 2px;
}

html.is-mobile .inline-odds-ev {
  font-size: 11px !important;
  gap: 8px !important;
  flex-wrap: wrap;
}

html.is-mobile .inline-odds-ev b {
  font-size: 12px !important;
}

html.is-mobile .formula-recommendation,
html.is-mobile .main-grid > .formula-panel .formula-recommendation {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  margin: 6px !important;
  padding: 8px 10px !important;
  gap: 6px 10px !important;
  border-width: 2px;
  overflow: hidden;
  box-sizing: border-box;
  width: auto;
  max-width: calc(100% - 12px);
}

html.is-mobile .recommendation-title {
  font-size: 14px !important;
}

html.is-mobile .recommendation-metric {
  font-size: 11px !important;
}

html.is-mobile .recommendation-metric b {
  font-size: 15px !important;
}

html.is-mobile .recommendation-choice {
  width: 52px !important;
  height: 52px !important;
  font-size: 18px !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
}

html.is-mobile .recommendation-votes {
  gap: 10px;
  font-size: 10px;
}

html.is-mobile .recommendation-trail,
html.is-mobile .formula-outcomes,
html.is-mobile .formula-sequence-view {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: manipulation;
}

html.is-mobile .main-grid > .formula-panel .formula-track-wrap,
html.is-mobile .formula-track-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto !important;
  flex: 1 1 auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

html.is-mobile .formula-track,
html.is-mobile .main-grid > .formula-panel .formula-track {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 8px !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 6px !important;
  box-sizing: border-box;
}

html.is-mobile .formula-card,
html.is-mobile .main-grid > .formula-panel .formula-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 0 !important;
  padding: 10px !important;
  box-sizing: border-box;
}

html.is-mobile .formula-card-head {
  grid-template-columns: minmax(0, 1fr) 36px auto 34px !important;
  gap: 4px !important;
}

html.is-mobile .formula-card-head h3 {
  font-size: 14px !important;
}

html.is-mobile .formula-toggle {
  width: 36px;
  height: 22px;
}

html.is-mobile .formula-toggle.on span {
  transform: translateX(14px);
}

html.is-mobile .formula-pick {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

html.is-mobile .formula-gear {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

html.is-mobile .formula-stat-line {
  font-size: 12px;
  margin-top: 6px;
}

html.is-mobile .formula-stat-line b {
  font-size: 14px;
}

html.is-mobile .topbar-quick #openOddsBtn {
  max-width: 68px;
}
