/* Mobile settings page — settings UI + live phone preview. Console-scoped. */

.mob-wrap { max-width: 1180px; margin: 0 auto; padding: 1.25rem clamp(.85rem, 3vw, 1.75rem) 4rem; }
.mob-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.2rem; }
.mob-head .ic { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
    font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, var(--pp-primary, #4f46e5), #8b5cf6); }
.mob-head h1 { font-size: 1.4rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.mob-head p { margin: .2rem 0 0; color: var(--pp-text-muted, #94a3b8); font-size: .9rem; max-width: 60ch; }
.mob-saved { margin-left: auto; font-size: .8rem; color: var(--pp-text-muted, #94a3b8); display: inline-flex; align-items: center; gap: .35rem; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.mob-saved.show { opacity: 1; } .mob-saved.show .bi { color: #16a34a; }

/* Two-column: scrollable settings (left) + full-height preview (right).
   On desktop the wrap fills the viewport height; only the left column scrolls,
   so the phone preview stays put and updates live. Mobile falls back to normal
   document flow (whole page scrolls). */
.mob-layout { display: flex; gap: 1.6rem; align-items: flex-start; }
.mob-settings { flex: 1 1 auto; min-width: 0; }
.mob-preview-col { flex: 0 0 300px; text-align: center; }
.mob-preview-cap { margin-top: .6rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pp-text-muted, #94a3b8); }

@media (min-width: 992px) {
    .main-area > .right-workspace.w-100 { height: 100%; min-height: 0; }
    .mob-wrap { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; padding-bottom: 1.1rem; }
    .mob-head { flex: 0 0 auto; }
    .mob-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
    .mob-settings { overflow-y: auto; min-height: 0; padding-right: .7rem; padding-bottom: 1.6rem; }
    .mob-preview-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    /* Thin, on-theme scrollbar for the settings column. */
    .mob-settings::-webkit-scrollbar { width: 9px; }
    .mob-settings::-webkit-scrollbar-thumb { background: var(--pp-border-strong, #3a4459); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
    .mob-settings { scrollbar-width: thin; }
}

.mob-master { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; border-radius: 16px;
    background: var(--pp-surface, #141824); border: 1px solid var(--pp-border, #242a3a); margin-bottom: 1.4rem; }
.mob-master .t, .mob-card .cb .t, .mob-panel .t { font-weight: 700; }
.mob-master .d, .mob-card .cb .d, .mob-panel .d { color: var(--pp-text-muted, #94a3b8); font-size: .83rem; margin-top: .1rem; line-height: 1.45; }

.mob-sec-h { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    color: var(--pp-text-muted, #94a3b8); margin: 1.4rem .25rem .6rem; }
.mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.mob-card { display: flex; align-items: flex-start; gap: .8rem; padding: .95rem 1rem; border-radius: 14px;
    background: var(--pp-surface, #141824); border: 1px solid var(--pp-border, #242a3a); }
.mob-card .cic, .mob-panel .cic { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    font-size: 1.1rem; color: var(--pp-primary, #818cf8); background: color-mix(in srgb, var(--pp-primary, #4f46e5) 14%, transparent); }
.mob-card .cb { flex: 1 1 auto; min-width: 0; }
.mob-card .cb .t { font-size: .94rem; }

.mob-panel { padding: 1rem 1.15rem; border-radius: 16px; background: var(--pp-surface, #141824); border: 1px solid var(--pp-border, #242a3a); }
.mob-row { display: flex; align-items: center; gap: 1rem; }
.mob-inline { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.mob-inline label { font-size: .84rem; color: var(--pp-text, #e5e7eb); display: inline-flex; align-items: center; gap: .5rem; }
.mob-inline select, .mob-tab-row select, .mob-tab-row input, .mob-fields input { background: var(--pp-input-bg, #0b1120); border: 1px solid var(--pp-border, #242a3a); color: var(--pp-text, #e5e7eb); border-radius: 8px; height: 34px; padding: 0 .5rem; font-size: .88rem; }
.mob-check { cursor: pointer; }
.mob-hint { font-size: .78rem; color: var(--pp-text-muted, #94a3b8); }

.mob-seg { display: inline-flex; background: var(--pp-surface-sunken, #0b1120); border: 1px solid var(--pp-border, #242a3a); border-radius: 11px; padding: 3px; }
.mob-seg-btn { border: 0; background: none; color: var(--pp-text-muted, #94a3b8); font-weight: 600; font-size: .85rem; padding: .4rem .9rem; border-radius: 8px; cursor: pointer; }
.mob-seg-btn.is-active { background: var(--pp-primary, #4f46e5); color: #fff; }

.mob-btn { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .86rem; font-weight: 600;
    background: var(--pp-primary, #4f46e5); color: #fff; border: 0; border-radius: 9px; padding: .5rem .8rem; margin-top: .6rem; }
.mob-btn.ghost { background: transparent; color: var(--pp-text-muted, #cbd5e1); border: 1px solid var(--pp-border, #242a3a); }
.mob-btn.ghost.is-active { background: var(--pp-primary, #4f46e5); color: #fff; border-color: var(--pp-primary, #4f46e5); }
.mob-fields input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--pp-border, #242a3a); border-radius: 8px; background: var(--pp-surface, #11151f); cursor: pointer; }

/* Custom tabs editor */
.mob-tabs-editor { display: flex; flex-direction: column; gap: .5rem; }
.mob-tab-row { display: flex; align-items: center; gap: .55rem; padding: .5rem; border: 1px solid var(--pp-border, #242a3a); border-radius: 11px; background: var(--pp-surface-sunken, #0b1120); }
.mob-tab-row.dragging { opacity: .55; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
.mob-tab-row.drag-over { border-color: var(--pp-primary, #4f46e5); }
.mob-tab-row .mt-grip { flex: 0 0 auto; cursor: grab; color: var(--pp-text-muted, #94a3b8); font-size: 1.05rem; line-height: 1; padding: 0 .1rem; touch-action: none; }
.mob-tab-row .mt-grip:active { cursor: grabbing; }
.mob-tab-row .mt-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
    background: color-mix(in srgb, var(--pp-primary, #4f46e5) 16%, transparent); color: var(--pp-primary, #818cf8); font-size: 1.05rem; border: 1px solid transparent; }
.mob-tab-row .mt-ico:hover { border-color: var(--pp-primary, #4f46e5); }
.mob-tab-row .mt-fields { flex: 1 1 auto; display: grid; grid-template-columns: 1fr; gap: .35rem; min-width: 0; }
.mob-tab-row .mt-del { border: 0; background: none; color: #ef4444; font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 .3rem; }

/* Icon picker gallery (modal overlay) */
.mob-iconpick { position: fixed; inset: 0; z-index: 1080; display: none; align-items: center; justify-content: center; padding: 1rem;
    background: rgba(2, 6, 23, .55); }
.mob-iconpick.open { display: flex; }
.mob-iconpick-box { width: min(560px, 96vw); max-height: 82vh; display: flex; flex-direction: column; border-radius: 16px;
    background: var(--pp-surface, #141824); border: 1px solid var(--pp-border, #242a3a); box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; }
.mob-iconpick-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--pp-border, #242a3a); }
.mob-iconpick-head strong { font-size: .95rem; }
.mob-iconpick-head .x { margin-left: auto; border: 0; background: none; color: var(--pp-text-muted, #94a3b8); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.mob-iconpick-search { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--pp-border, #242a3a); }
.mob-iconpick-search i { color: var(--pp-text-muted, #94a3b8); }
.mob-iconpick-search input { flex: 1 1 auto; height: 36px; border: 1px solid var(--pp-border, #242a3a); background: var(--pp-input-bg, #0b1120); color: var(--pp-text, #e5e7eb); border-radius: 9px; padding: 0 .6rem; font-size: .9rem; }
.mob-iconpick-grid { overflow-y: auto; padding: .8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: .4rem; }
.mob-iconpick-grid button { aspect-ratio: 1/1; border: 1px solid var(--pp-border, #242a3a); background: var(--pp-surface-sunken, #0b1120); color: var(--pp-text, #e5e7eb); border-radius: 10px; font-size: 1.25rem; cursor: pointer; display: grid; place-items: center; }
.mob-iconpick-grid button:hover { border-color: var(--pp-primary, #4f46e5); color: var(--pp-primary, #818cf8); background: color-mix(in srgb, var(--pp-primary, #4f46e5) 10%, transparent); }
.mob-iconpick-empty { padding: 2rem; text-align: center; color: var(--pp-text-muted, #94a3b8); font-size: .88rem; grid-column: 1 / -1; }

/* iOS switch */
.mob-sw { position: relative; flex: 0 0 auto; width: 46px; height: 28px; cursor: pointer; }
.mob-sw.sm { width: 40px; height: 24px; }
.mob-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.mob-sw .track { position: absolute; inset: 0; border-radius: 999px; background: var(--pp-border-strong, #3a4459); transition: background .18s; }
.mob-sw .thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .18s; }
.mob-sw.sm .thumb { width: 18px; height: 18px; }
.mob-sw input:checked ~ .track { background: var(--pp-primary, #4f46e5); }
.mob-sw input:checked ~ .thumb { transform: translateX(18px); }
.mob-sw.sm input:checked ~ .thumb { transform: translateX(16px); }

.mob-fields { display: grid; grid-template-columns: 1fr auto; gap: .8rem 1rem; margin-top: 1rem; align-items: end; }
.mob-fields label { display: block; font-size: .78rem; font-weight: 700; color: var(--pp-text-muted, #94a3b8); margin-bottom: .3rem; }
.mob-fields input[type=text] { width: 100%; height: 40px; }
.mob-fields input[type=color] { width: 52px; height: 40px; border-radius: 10px; border: 1px solid var(--pp-border, #242a3a); background: var(--pp-input-bg, #0b1120); cursor: pointer; padding: 3px; }

.mob-icon-up { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--pp-border, #242a3a); }
.mob-icon-prev { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
    background: color-mix(in srgb, var(--pp-primary, #4f46e5) 12%, transparent); color: var(--pp-primary, #818cf8); font-size: 1.6rem; border: 1px solid var(--pp-border, #242a3a); }
.mob-icon-prev img { width: 100%; height: 100%; object-fit: cover; }
.mob-icon-up .mob-btn { margin-top: 0; }

.mob-note { display: flex; gap: .55rem; align-items: flex-start; margin-top: 1.4rem; padding: .8rem .95rem; border-radius: 12px;
    font-size: .84rem; color: var(--pp-text-muted, #94a3b8); background: color-mix(in srgb, var(--pp-primary, #4f46e5) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--pp-primary, #4f46e5) 22%, transparent); }
.mob-note i { color: var(--pp-primary, #818cf8); margin-top: 1px; }

body.mob-disabled .mob-sec-h, body.mob-disabled .mob-grid, body.mob-disabled .mob-panel { opacity: .45; pointer-events: none; }

/* ══ Live phone preview ══ */
.mob-phone { width: 290px; height: 590px; margin: 0 auto; border-radius: 42px; padding: 12px;
    background: #0b0f18; border: 1px solid #2a3346; box-shadow: 0 30px 70px rgba(0,0,0,.5), inset 0 0 0 2px #1a2233; position: relative; }
.mp-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 110px; height: 22px; background: #0b0f18; border-radius: 0 0 14px 14px; z-index: 3; }
.mp-screen { position: relative; height: 100%; border-radius: 31px; overflow: hidden; display: flex; flex-direction: column;
    background: var(--pp-bg, #f6f9fd); color: #0f172a; }
.mp-topbar { flex: 0 0 auto; height: 46px; display: flex; align-items: center; gap: .5rem; padding: 0 .8rem; background: #fff; border-bottom: 1px solid #e6e9f0; }
.mp-topbar .mp-brand { font-weight: 800; font-size: .9rem; flex: 1 1 auto; }
.mp-topbar .mp-burger { color: #64748b; } .mp-topbar .mp-av { width: 24px; height: 24px; border-radius: 50%; background: var(--pp-primary, #4f46e5); color: #fff; font-size: .7rem; display: grid; place-items: center; font-weight: 700; }
.mp-body { flex: 1 1 auto; position: relative; padding: .85rem; overflow: hidden; }
.mp-title { font-size: 1.3rem; font-weight: 800; margin-bottom: .7rem; }
.mp-card { background: #fff; border-radius: 14px; padding: .8rem; margin-bottom: .7rem; box-shadow: 0 1px 3px rgba(2,6,23,.06); }
.mp-l { height: 9px; border-radius: 5px; background: #e9edf3; margin: .35rem 0; }
.mp-l.w35 { width: 35%; } .mp-l.w40 { width: 40%; } .mp-l.w50 { width: 50%; } .mp-l.w60 { width: 60%; } .mp-l.w80 { width: 80%; } .mp-l.w90 { width: 90%; }
.mp-fab { position: absolute; right: .8rem; bottom: .8rem; width: 44px; height: 44px; border-radius: 50%; background: var(--pp-primary, #4f46e5); color: #fff; display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 8px 18px color-mix(in srgb, var(--pp-primary,#4f46e5) 45%, transparent); }
.mp-edge { position: absolute; top: 50%; transform: translateY(-50%); width: 20px; height: 40px; background: color-mix(in srgb, var(--pp-primary,#4f46e5) 78%, transparent); color: #fff; display: grid; place-items: center; font-size: .8rem; opacity: .6; }
.mp-edge-l { left: 0; border-radius: 0 10px 10px 0; } .mp-edge-r { right: 0; border-radius: 10px 0 0 10px; }
.mp-tabbar { flex: 0 0 auto; display: flex; background: #fff; border-top: 1px solid #e6e9f0; }
.mp-tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: .45rem 0 .5rem; color: #64748b; font-size: .58rem; font-weight: 600; min-width: 0; }
.mp-tab i { font-size: 1.15rem; }
.mp-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-tab.is-active { color: var(--pp-primary, #4f46e5); }
.mp-tabbar.no-labels .mp-tab span { display: none; }
.mp-tabbar.no-labels .mp-tab i { font-size: 1.3rem; }

/* Active-tab icon effects (preview shows them looping so they're visible) */
.mp-tabbar.fx-pop    .mp-tab.is-active i { animation: mpPop 1.6s ease-in-out infinite; }
.mp-tabbar.fx-bounce .mp-tab.is-active i { animation: mpBounce 1.4s ease-in-out infinite; }
.mp-tabbar.fx-pulse  .mp-tab.is-active i { animation: mpPulse 1.4s ease-in-out infinite; }
.mp-tabbar.fx-glow   .mp-tab.is-active i { animation: mpGlow 1.6s ease-in-out infinite; }
.mp-tabbar.fx-wiggle .mp-tab.is-active i { animation: mpWiggle 1.2s ease-in-out infinite; }
@keyframes mpPop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.28); } }
@keyframes mpBounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-5px); } 60% { transform: translateY(-2px); } }
@keyframes mpPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .7; } }
@keyframes mpGlow { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 6px currentColor); } }
@keyframes mpWiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

@media (max-width: 991.98px) {
    .mob-layout { flex-direction: column; }
    .mob-preview-col { flex: none; width: 100%; margin-top: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .mp-tabbar [class*="fx-"] .mp-tab.is-active i, .mp-tab.is-active i { animation: none !important; }
}

/* ── Component flavour matrix ── */
.mob-flav { display: flex; flex-direction: column; }
.mob-flav-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--pp-border, #242a3a); }
.mob-flav-row:last-child { border-bottom: 0; }
.mob-flav-tx { flex: 1 1 auto; min-width: 0; }
.mob-flav-tx .t { font-weight: 700; font-size: .92rem; }
.mob-flav-tx .d { color: var(--pp-text-muted, #94a3b8); font-size: .78rem; margin-top: .1rem; line-height: 1.4; }
.mob-flav-sel { flex: 0 0 auto; min-width: 120px; background: var(--pp-input-bg, #0b1120); border: 1px solid var(--pp-border, #242a3a); color: var(--pp-text, #e5e7eb); border-radius: 8px; height: 36px; padding: 0 .5rem; font-size: .88rem; }

/* ── QR "open on your phone" panel ── */
.mob-qr-panel { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; }
.mob-qr { flex: 0 0 auto; background: #fff; border-radius: 14px; padding: 10px; line-height: 0; box-shadow: 0 1px 3px rgba(0,0,0,.18); min-width: 90px; min-height: 90px; display: grid; place-items: center; }
.mob-qr canvas { display: block; border-radius: 6px; }
.mob-qr-side { flex: 1 1 220px; min-width: 0; }
.mob-qr-side .d { color: var(--pp-text-muted, #94a3b8); font-size: .85rem; }
.mob-qr-side label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .25rem; }
.mob-qr-side input { width: 100%; background: var(--pp-input-bg, #0b1120); border: 1px solid var(--pp-border, #242a3a); color: var(--pp-text, #e5e7eb); border-radius: 8px; height: 38px; padding: 0 .6rem; font-size: .88rem; }
.mob-qr-side .mob-btn { margin-top: .55rem; }

/* ── Hint badges (?/!) + tooltips ── */
.mob-tip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%;
    margin-left: .4rem; font-size: 11px; font-weight: 800; line-height: 1; cursor: help; vertical-align: middle; position: relative; user-select: none;
    background: var(--pp-surface-sunken, #0b1120); color: var(--pp-text-muted, #94a3b8); border: 1px solid var(--pp-border, #242a3a); }
.mob-tip.warn { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #f59e0b; border-color: color-mix(in srgb, #f59e0b 45%, transparent); }
.mob-tip:hover, .mob-tip:focus-visible, .mob-tip.show { background: var(--pp-primary, #4f46e5); color: #fff; border-color: var(--pp-primary, #4f46e5); outline: none; }
.mob-tip.warn:hover, .mob-tip.warn.show { background: #f59e0b; color: #1a1205; border-color: #f59e0b; }
.mob-tip::after { content: attr(data-tip); position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: min(280px, 70vw); text-align: left; white-space: normal;
    background: var(--pp-surface-raised, #0f172a); color: var(--pp-text, #e5e7eb); border: 1px solid var(--pp-border, #242a3a);
    padding: .55rem .7rem; border-radius: 9px; font-size: .75rem; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none;
    box-shadow: 0 12px 34px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .14s ease; z-index: 60; }
.mob-tip::before { content: ""; position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-bottom-color: var(--pp-surface-raised, #0f172a); opacity: 0; transition: opacity .14s ease; z-index: 60; }
.mob-tip:hover::after, .mob-tip:hover::before, .mob-tip.show::after, .mob-tip.show::before,
.mob-tip:focus-visible::after, .mob-tip:focus-visible::before { opacity: 1; }

/* ── Push setup guide (collapsible) ── */
.mob-guide { margin-top: .9rem; border-top: 1px solid var(--pp-border, #242a3a); padding-top: .7rem; }
.mob-guide > summary { cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--pp-primary, #818cf8); display: flex; align-items: center; gap: .4rem; list-style: none; }
.mob-guide > summary::-webkit-details-marker { display: none; }
.mob-guide[open] > summary { margin-bottom: .7rem; }
.mob-guide ol { margin: .2rem 0 .7rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .55rem; }
.mob-guide li { font-size: .83rem; line-height: 1.5; color: var(--pp-text, #e5e7eb); }
.mob-guide code { background: var(--pp-surface-sunken, #0b1120); border: 1px solid var(--pp-border, #242a3a); border-radius: 5px; padding: .05rem .35rem; font-size: .8em; }
.mob-guide-note { font-size: .8rem; color: var(--pp-text-muted, #94a3b8); background: var(--pp-surface-sunken, #0b1120); border-radius: 8px; padding: .55rem .7rem; margin: .2rem 0 .7rem; display: flex; gap: .5rem; align-items: flex-start; }
.mob-guide-links { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.mob-guide-links a { font-size: .8rem; color: var(--pp-primary, #818cf8); text-decoration: none; }
.mob-guide-links a:hover { text-decoration: underline; }
