/* mylabelmaker phone layer, part 2: home (Templates | My labels), More,
   Data, ZPL Viewer, paywall tokens and the shared segmented control.
   Every rule is scoped to html.mlm-mobile (under 768px), so desktop and
   tablets never match. The DOM it styles is built by js/mobile-home.js. */

/* ==== Segmented control (every .tgal-facets / .mlm-seg on the phone) >> ====
   White pill track, 3px padding, 2px gap, 42px segments, 15/600. One black
   pill slides behind the labels; the label colours cross-fade. */
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: none;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line, #e2e6ed);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface, #fff);
    isolation: isolate;
}
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) > :is(button, [role="tab"], [role="radio"]) {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-pill, 999px);
    background: transparent;
    color: var(--ink-2, #3f3f46);
    font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
    transition: color 0.15s ease;
}
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) > :is(.is-on, [aria-selected="true"], [aria-checked="true"], .active) {
    background: var(--ink, #0f0f12);
    color: #fafafa;
}
/* With the sliding pill in place the selected segment is transparent. */
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg).mlm-seg-ready > :is(button, [role="tab"], [role="radio"]) { background: transparent; }
/* The whole half is the tap target (50px tall with the track padding). */
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) > :is(button, [role="tab"], [role="radio"])::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    top: -4px;
    bottom: -4px;
}
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) > :is(button, [role="tab"], [role="radio"]):focus-visible { outline: 2px solid #0f0f12; outline-offset: 2px; }
html.mlm-mobile .mlm-seg-pill {
    position: absolute;
    z-index: 0;
    left: 0;
    top: 3px;
    height: 42px;
    border-radius: var(--radius-pill, 999px);
    background: var(--ink, #0f0f12);
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease;
}
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) .mlm-seg-n {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--surface-2, #f6f7fa);
    color: var(--ink-3, #71717a);
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease;
}
html.mlm-mobile :is(.editor-shell, body) :is(.tgal-facets, .mlm-seg) > :is(.is-on, [aria-selected="true"]) .mlm-seg-n { background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.86); }
@media (prefers-reduced-motion: reduce) {
    html.mlm-mobile .mlm-seg-pill { transition: none; }
}
/* ==== << Segmented control ==== */

/* ==== Phone home: Templates | My labels (v4-01, v4-13) >> ==== */
html.mlm-mobile .mlm-vh {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
    outline: none;
}
html.mlm-mobile .editor-shell .tgal-card { padding-top: 0; }
html.mlm-mobile .editor-shell .tgal-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: calc(var(--mlm-safe-t, 0px) + 8px) 16px 12px;
    background: var(--bg);
}
html.mlm-mobile .editor-shell .tgal-head-text,
html.mlm-mobile .editor-shell .tgal-close,
html.mlm-mobile .editor-shell .mlm-tgal-folder,
html.mlm-mobile .editor-shell .tgal-head > .tgal-facets:not(.mlm-home-switch) { display: none; }
html.mlm-mobile .editor-shell .tgal-head > .mlm-home-switch { order: -1; flex: 0 0 auto; }
html.mlm-mobile .editor-shell .tgal-card[data-mlm-tab="templates"] .mlm-mine-search,
html.mlm-mobile .editor-shell .tgal-card[data-mlm-tab="mine"] .tgal-search:not(.mlm-mine-search),
html.mlm-mobile .editor-shell .tgal-card[data-mlm-tab="mine"] .tgal-chips-wrap,
html.mlm-mobile .editor-shell .tgal-card[data-mlm-tab="mine"] .tgal-body,
html.mlm-mobile .editor-shell .tgal-card:not([data-mlm-tab="mine"]) .mlm-mine { display: none; }

/* Search: 46px white pill, 16px text, 20px icon. */
html.mlm-mobile .editor-shell .tgal-search {
    width: auto;
    height: 46px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface);
    box-sizing: border-box;
}
html.mlm-mobile .editor-shell .tgal-search svg { left: 15px; width: 20px; height: 20px; stroke-width: 1.8; }
html.mlm-mobile .editor-shell .tgal-search input { padding: 0 16px 0 44px; font-size: 16px; }

/* Chips: round filter chip first, then the category chips (38px, 44px hit). */
html.mlm-mobile .editor-shell .tgal-chips-wrap { padding: 0 0 4px; background: var(--bg); }
html.mlm-mobile .editor-shell .tgal-chips { align-items: center; gap: 8px; padding: 3px 16px; scroll-padding: 0 16px; }
html.mlm-mobile .editor-shell .tgal-chip { height: 38px; padding: 0 8px 0 14px; font-size: 14px; font-weight: 550; }
html.mlm-mobile .editor-shell .mlm-filter-chip {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}
html.mlm-mobile .editor-shell .mlm-filter-chip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}
html.mlm-mobile .editor-shell .mlm-filter-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .editor-shell .mlm-filter-chip.has-filter { background: var(--ink); border-color: var(--ink); color: #fafafa; }

/* Sections and cards. */
html.mlm-mobile .editor-shell .tgal-body {
    padding: 0 16px calc(52px + 8px + 24px + var(--mlm-safe-b, 0px));
    background: var(--bg);
    scroll-padding-bottom: calc(52px + 8px + 24px + var(--mlm-safe-b, 0px));
}
html.mlm-mobile .editor-shell .tgal-section-title {
    align-items: baseline;
    margin: 0 -16px;
    padding: 16px 16px 10px;
    background: var(--bg);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
html.mlm-mobile .editor-shell .tgal-section-n { display: none; }
html.mlm-mobile .editor-shell .tgal-see-all {
    min-height: 0;
    margin-right: -8px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
    line-height: 1.2;
}
html.mlm-mobile .editor-shell .tgal-see-all svg { width: 12px; height: 12px; }
html.mlm-mobile .editor-shell .tgal-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 0 0 8px; }
html.mlm-mobile .editor-shell .tgal-item { padding: 6px; border-radius: 16px; transition: scale 0.12s ease; }
html.mlm-mobile .editor-shell .tgal-item:hover { transform: none; box-shadow: none; border-color: var(--line); }
html.mlm-mobile .editor-shell .tgal-well { height: 124px; aspect-ratio: auto; padding: 10px; border-radius: 12px; background: var(--bg); }
html.mlm-mobile .editor-shell .tgal-well img { filter: drop-shadow(0 2px 5px rgba(15, 15, 18, 0.10)); }
html.mlm-mobile .editor-shell .tgal-item:hover .tgal-well img { transform: none; }
html.mlm-mobile .editor-shell .tgal-meta { gap: 2px; padding: 9px 6px 5px; }
html.mlm-mobile .editor-shell .tgal-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile .editor-shell .tgal-size { font-size: 13px; color: var(--ink-3); }
html.mlm-mobile .editor-shell .tgal-count { margin: 4px 0 -4px; }

/* Press feedback (0.97, the desktop .12s button timing). */
html.mlm-mobile .editor-shell :is(.tgal-item, .tgal-chip, .mlm-filter-chip, .mlm-mine-open, .mlm-tgal-new, .tgal-see-all):active { scale: 0.97; }
html.mlm-mobile .editor-shell :is(.tgal-chip, .mlm-filter-chip, .mlm-mine-open, .tgal-see-all) { transition: scale 0.12s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }

/* My labels. */
html.mlm-mobile .editor-shell .mlm-mine {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 16px calc(52px + 8px + 24px + var(--mlm-safe-b, 0px));
    background: var(--bg);
}
html.mlm-mobile .mlm-cap {
    margin: 16px 0 8px;
    font: 600 13px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink-3, #71717a);
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-cap { margin-top: 4px; }
html.mlm-mobile .editor-shell .mlm-mine-list {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    overflow: hidden;
}
html.mlm-mobile .editor-shell .mlm-mine-row { position: relative; display: flex; align-items: center; }
html.mlm-mobile .editor-shell .mlm-mine-row + .mlm-mine-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 84px;
    right: 0;
    border-top: 1px solid var(--line);
}
html.mlm-mobile .editor-shell .mlm-mine-open {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 8px 0 8px 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
}
html.mlm-mobile .editor-shell .mlm-mine-thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    background: var(--bg);
    box-sizing: border-box;
}
html.mlm-mobile .editor-shell .mlm-mine-thumb svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 3px rgba(15, 15, 18, 0.12));
}
html.mlm-mobile .editor-shell .mlm-mine-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
html.mlm-mobile .editor-shell .mlm-mine-name { font-size: 16px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile .editor-shell .mlm-mine-meta { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile .editor-shell .mlm-mine-more {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    margin-right: 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html.mlm-mobile .editor-shell .mlm-mine-more:active { background: rgb(212, 216, 224); }
html.mlm-mobile .mlm-ic-dots { width: 20px; height: 20px; fill: currentColor; stroke: none; }
html.mlm-mobile .editor-shell .mlm-mine-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 48px 24px;
    text-align: center;
}
html.mlm-mobile .editor-shell .mlm-mine-empty strong { font-size: 17px; font-weight: 700; color: var(--ink); }
html.mlm-mobile .editor-shell .mlm-mine-empty span { font-size: 15px; color: var(--ink-3); }

/* Floating Blank label / New label pill. */
html.mlm-mobile .editor-shell .tgal-card .mlm-tgal-new {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mlm-safe-b, 0px) + 8px);
    translate: -50% 0;
    transform: none;
    z-index: 7;
    height: 52px;
    padding: 0 24px 0 20px;
    border: 0;
    border-radius: var(--radius-pill, 999px);
    background: var(--ink);
    color: #fafafa;
    font: 600 16px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 14px 30px rgba(15, 15, 18, 0.30), 0 3px 8px rgba(15, 15, 18, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: scale 0.12s ease;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-tgal-new svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Progressive blur: five blur layers, each masked to a band, plus a tint. */
html.mlm-mobile .editor-shell .mlm-home-fade {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(128px + var(--mlm-safe-b, 0px));
    z-index: 6;
    pointer-events: none;
}
html.mlm-mobile .editor-shell .mlm-home-fade > * { position: absolute; inset: 0; }
html.mlm-mobile .editor-shell .mlm-home-fade > i:nth-child(1) { -webkit-backdrop-filter: blur(1px) saturate(1.6); backdrop-filter: blur(1px) saturate(1.6); -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%); mask-image: linear-gradient(to bottom, transparent 0%, #000 20%); }
html.mlm-mobile .editor-shell .mlm-home-fade > i:nth-child(2) { -webkit-backdrop-filter: blur(2px) saturate(1.6); backdrop-filter: blur(2px) saturate(1.6); -webkit-mask-image: linear-gradient(to bottom, transparent 15%, #000 40%); mask-image: linear-gradient(to bottom, transparent 15%, #000 40%); }
html.mlm-mobile .editor-shell .mlm-home-fade > i:nth-child(3) { -webkit-backdrop-filter: blur(4px) saturate(1.6); backdrop-filter: blur(4px) saturate(1.6); -webkit-mask-image: linear-gradient(to bottom, transparent 35%, #000 60%); mask-image: linear-gradient(to bottom, transparent 35%, #000 60%); }
html.mlm-mobile .editor-shell .mlm-home-fade > i:nth-child(4) { -webkit-backdrop-filter: blur(8px) saturate(1.6); backdrop-filter: blur(8px) saturate(1.6); -webkit-mask-image: linear-gradient(to bottom, transparent 55%, #000 80%); mask-image: linear-gradient(to bottom, transparent 55%, #000 80%); }
html.mlm-mobile .editor-shell .mlm-home-fade > i:nth-child(5) { -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); -webkit-mask-image: linear-gradient(to bottom, transparent 75%, #000 100%); mask-image: linear-gradient(to bottom, transparent 75%, #000 100%); }
html.mlm-mobile .editor-shell .mlm-home-fade > b { background: linear-gradient(to bottom, rgba(238, 242, 248, 0) 0%, rgba(238, 242, 248, 0.35) 45%, rgba(238, 242, 248, 0.70) 100%); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html.mlm-mobile .editor-shell .mlm-home-fade > i { display: none; }
    html.mlm-mobile .editor-shell .mlm-home-fade > b { background: linear-gradient(to bottom, rgba(238, 242, 248, 0) 0%, rgba(238, 242, 248, 0.75) 50%, rgba(238, 242, 248, 0.92) 100%); }
}
@media (prefers-reduced-transparency: reduce) {
    html.mlm-mobile .editor-shell .mlm-home-fade > i { display: none; }
    html.mlm-mobile .editor-shell .mlm-home-fade > b { background: linear-gradient(to bottom, rgba(238, 242, 248, 0) 0%, rgba(238, 242, 248, 0.75) 50%, rgba(238, 242, 248, 0.92) 100%); }
}

/* Home and ZPL Viewer motion: desktop tgal-rise in, desktop mlm-modal-out out. */
html.mlm-mobile .editor-shell .tgal.is-closing .tgal-card,
html.mlm-mobile .editor-shell .zpl-job.is-closing .zpl-job-card { animation: mlm-modal-out 0.16s cubic-bezier(0.4, 0, 1, 1) forwards; }
html.mlm-mobile .editor-shell .canvas-workspace.mlm-canvas-in { animation: tgal-fade 0.18s ease-out; }
@media (prefers-reduced-motion: reduce) {
    html.mlm-mobile .editor-shell :is(.tgal-item, .tgal-chip, .mlm-filter-chip, .mlm-mine-open, .mlm-tgal-new, .tgal-see-all):active { scale: none; }
    html.mlm-mobile .editor-shell .tgal.is-closing .tgal-card,
    html.mlm-mobile .editor-shell .zpl-job.is-closing .zpl-job-card { animation: mlm-fade-out 0.12s ease-in forwards; }
}

/* Sheets opened over a full-screen view (home, ZPL Viewer) sit above it. */
html.mlm-mobile .editor-shell.mlm-fs-open > #mlmScrim { z-index: 1005; }
html.mlm-mobile .editor-shell.mlm-fs-open .mlm-sheet:not(.mlm-sheet-plain) { z-index: 1010 !important; }

/* Filter sheet. */
html.mlm-mobile .mlm-filter-sheet.hidden { display: none !important; }
html.mlm-mobile .mlm-filter-sheet .mlm-cap { margin-top: 4px; }
html.mlm-mobile .mlm-filter-help { margin: 12px 2px 8px; font-size: 15px; line-height: 1.45; color: var(--ink-3); }
/* ==== << Phone home ==== */

/* ==== Phone action sheet, grouped rows and sheet buttons >> ==== */
html.mlm-mobile .mlm-action-sheet.hidden { display: none !important; }
html.mlm-mobile .mlm-action-note { margin: 0 2px 16px; font-size: 15px; line-height: 1.45; color: var(--ink-3); }
html.mlm-mobile .mlm-group {
    border-radius: 16px;
    background: var(--surface-2, #f6f7fa);
    overflow: hidden;
}
html.mlm-mobile .mlm-grow {
    position: relative;
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: 500 16px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: left;
}
html.mlm-mobile .mlm-grow + .mlm-grow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 48px;
    right: 0;
    border-top: 1px solid var(--line, #e2e6ed);
}
html.mlm-mobile .mlm-grow > svg:first-child { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-2); }
html.mlm-mobile .mlm-grow .mlm-grow-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile .mlm-grow .mlm-grow-value { flex: 0 1 auto; min-width: 0; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); font-size: 15px; }
html.mlm-mobile .mlm-grow .mlm-chev { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: #a1a1aa; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .mlm-grow:active { background: rgb(212, 216, 224); }
html.mlm-mobile .mlm-grow:disabled { opacity: 0.4; }
html.mlm-mobile .mlm-grow.is-danger,
html.mlm-mobile .mlm-grow.is-danger > svg:first-child { color: #dc2626; }
html.mlm-mobile .mlm-btn {
    width: 100%;
    min-height: 52px;
    margin: 0 0 8px;
    border: 1px solid transparent;
    border-radius: 14px;
    font: 600 17px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: scale 0.12s ease;
}
html.mlm-mobile .mlm-btn:active { scale: 0.97; }
html.mlm-mobile .mlm-btn-primary { background: var(--ink, #0f0f12); color: #fafafa; }
html.mlm-mobile .mlm-btn-danger { background: #dc2626; color: #fff; }
html.mlm-mobile .mlm-btn-secondary { min-height: 48px; background: var(--surface, #fff); border-color: var(--line-strong, #cdd2dc); color: var(--ink, #0f0f12); }
html.mlm-mobile .mlm-btn-ghost { min-height: 48px; margin: 0; background: transparent; color: var(--ink-2, #3f3f46); }
html.mlm-mobile .mlm-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) {
    html.mlm-mobile .mlm-btn:active { scale: none; }
}
/* ==== << Phone action sheet ==== */

/* ==== Phone ZPL Viewer, full screen (v4-14, v4-15) >> ==== */
/* The wrapper js/mobile-home.js puts around the textarea is invisible
   when the screen is wider (it only exists after a phone visit). */
html:not(.mlm-mobile) .mlm-only-wrap { display: contents; }
html.mlm-mobile .editor-shell .zpl-job { align-items: flex-start; }
html.mlm-mobile .editor-shell .zpl-job-card {
    display: flex;
    flex-direction: column;
    height: calc(100% - var(--mlm-kb, 0px));
    max-height: none;
    overflow: hidden;
    padding-top: var(--mlm-safe-t, 0px);
    background: var(--bg);
}
html.mlm-mobile .editor-shell .zpl-job-head {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-areas: "close title open";
    align-items: center;
    gap: 8px;
    height: 60px;
    padding: 0 12px;
    box-sizing: border-box;
}
html.mlm-mobile .editor-shell .zpl-job-head-text { grid-area: title; min-width: 0; text-align: center; }
html.mlm-mobile .editor-shell .zpl-job-head h2 { margin: 0; font: 700 17px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; letter-spacing: -0.01em; color: var(--ink); }
html.mlm-mobile .editor-shell .zpl-job-help,
html.mlm-mobile .editor-shell .zpl-job-toolbar,
html.mlm-mobile .editor-shell .zpl-job-downloads,
html.mlm-mobile .editor-shell .zpl-job-col-bar { display: none; }
/* Close and Open: 44px round .header-icon-btn look. */
html.mlm-mobile .editor-shell .zpl-job-head :is(#zplJobCloseBtn, #zplJobOpenBtn) {
    width: 44px;
    height: 44px;
    min-width: 0;
    padding: 0;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
html.mlm-mobile .editor-shell #zplJobCloseBtn { grid-area: close; }
html.mlm-mobile .editor-shell #zplJobOpenBtn { grid-area: open; }
html.mlm-mobile .editor-shell #zplJobOpenBtn::before { display: none; }
html.mlm-mobile .editor-shell .zpl-job-head :is(#zplJobCloseBtn, #zplJobOpenBtn) svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .editor-shell .mlm-zpl-open-ic { display: inline-flex; }
html.mlm-mobile .editor-shell .zpl-job-head :is(#zplJobCloseBtn, #zplJobOpenBtn):active {
    color: var(--ink);
    background: rgb(212, 216, 224);
    box-shadow: inset 0 1px 3px rgba(15, 15, 18, 0.18);
}
html.mlm-mobile :is(.editor-shell, body) #mlmZplSeg { flex: 0 0 auto; width: auto; margin: 4px 16px 0; }

/* Settings row and its in-place editor. */
html.mlm-mobile .editor-shell .mlm-zpl-settings {
    flex: 0 1 auto;
    min-height: 54px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 12px 16px 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}
html.mlm-mobile .editor-shell .mlm-zpl-sum {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 4px 0 16px;
    cursor: pointer;
}
html.mlm-mobile .editor-shell .mlm-zpl-sum > svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .editor-shell .mlm-zpl-sum-text { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile .editor-shell .mlm-zpl-settings.is-empty .mlm-zpl-sum-text { font-weight: 600; }
html.mlm-mobile .editor-shell .mlm-zpl-edit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-pill, 999px);
    background: transparent;
    color: var(--ink-2);
    font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html.mlm-mobile .editor-shell .mlm-zpl-edit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
html.mlm-mobile .editor-shell .mlm-zpl-settings.is-open .mlm-zpl-edit svg { transform: rotate(180deg); }
html.mlm-mobile .editor-shell .mlm-zpl-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line);
}
html.mlm-mobile .editor-shell .mlm-zpl-panel[hidden] { display: none !important; }
html.mlm-mobile .editor-shell .mlm-zpl-dims { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
html.mlm-mobile .editor-shell .mlm-zpl-dims .zpl-job-dim {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
    font: 600 13px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-3);
}
html.mlm-mobile .editor-shell .mlm-zpl-dims .zpl-job-dim-wrap { height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: none; background: var(--surface); }
html.mlm-mobile .editor-shell .mlm-zpl-dims .zpl-job-dim-wrap input { width: 100%; font-size: 16px; }
html.mlm-mobile .editor-shell .mlm-zpl-settings.is-empty .zpl-job-dim-wrap:has(input:placeholder-shown) { border-color: var(--ink); }
html.mlm-mobile .editor-shell .mlm-zpl-panel #zplJobUnitSeg { box-shadow: none; overflow: hidden; }
html.mlm-mobile .editor-shell .mlm-zpl-panel #zplJobUnitSeg .zpl-job-unit { min-width: 0; height: 42px; border-radius: var(--radius-pill, 999px); font-size: 15px; }
html.mlm-mobile .editor-shell .mlm-zpl-panel .zpl-job-copies {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font: 500 16px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
}
html.mlm-mobile .editor-shell .mlm-zpl-panel .zpl-job-stepper { height: auto; padding: 0; gap: 8px; border: 0; background: transparent; box-shadow: none; }
html.mlm-mobile .editor-shell .mlm-zpl-panel .zpl-job-step {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
}
html.mlm-mobile .editor-shell .mlm-zpl-panel .zpl-job-step:active { background: rgb(212, 216, 224); box-shadow: inset 0 1px 3px rgba(15, 15, 18, 0.18); }
html.mlm-mobile .editor-shell .mlm-zpl-panel .zpl-job-copies input { width: 48px; height: 44px; border: 0; background: transparent; font-size: 17px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
html.mlm-mobile .editor-shell .mlm-zpl-panel .zpl-job-pq { margin: 0; font-size: 15px; color: var(--ink-3); }

/* Body: Code or Preview, scrolling inside itself. */
html.mlm-mobile .editor-shell .zpl-job-body {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 16px 16px;
    gap: 0;
}
html.mlm-mobile .editor-shell .zpl-job-col { min-height: 0; display: flex; flex-direction: column; }
html.mlm-mobile .editor-shell .zpl-job-col:first-child {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    overflow: hidden;
}
html.mlm-mobile .editor-shell .mlm-zpl-codehead {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 48px;
    padding: 0 6px 0 16px;
    border-bottom: 1px solid var(--line);
}
html.mlm-mobile .editor-shell .mlm-zpl-count { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
html.mlm-mobile .editor-shell .mlm-zpl-pill {
    position: relative;
    height: 32px;
    margin: 0 4px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface);
    color: var(--ink-2);
    font: 600 14px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: scale 0.12s ease;
}
html.mlm-mobile .editor-shell .mlm-zpl-pill::after { content: ""; position: absolute; left: -7px; right: -7px; top: -7px; bottom: -7px; }
html.mlm-mobile .editor-shell .mlm-zpl-pill:active { scale: 0.97; background: var(--surface-2); }
html.mlm-mobile .editor-shell .mlm-zpl-code { position: relative; display: block; }
html.mlm-mobile .editor-shell .mlm-zpl-code::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: var(--surface-2);
    border-right: 1px solid var(--line);
}
html.mlm-mobile .editor-shell .mlm-zpl-mirror,
html.mlm-mobile .editor-shell .mlm-zpl-code #zplJobInput {
    box-sizing: border-box;
    margin: 0;
    padding: 12px 14px 12px 52px;
    border: 0;
    font: 400 16px/24px "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
    tab-size: 4;
}
html.mlm-mobile .editor-shell .mlm-zpl-mirror {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    color: var(--ink-3);
    counter-reset: mlmln;
}
html.mlm-mobile .editor-shell .mlm-zpl-ln { position: relative; counter-increment: mlmln; }
html.mlm-mobile .editor-shell .mlm-zpl-ln::before {
    content: counter(mlmln);
    position: absolute;
    left: -52px;
    width: 32px;
    text-align: right;
    font-size: 13px;
    color: #a1a1aa;
}
html.mlm-mobile .editor-shell .mlm-zpl-mirror em { font-style: normal; color: var(--ink); }
html.mlm-mobile .editor-shell .mlm-zpl-code #zplJobInput {
    position: relative;
    display: block;
    width: 100%;
    min-height: 240px;
    resize: none;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: var(--ink);
}
html.mlm-mobile .editor-shell .mlm-zpl-code #zplJobInput::placeholder { color: var(--ink-3); -webkit-text-fill-color: var(--ink-3); }
html.mlm-mobile .editor-shell .mlm-zpl-code #zplJobInput::selection { background: rgba(59, 130, 246, 0.25); }
html.mlm-mobile .editor-shell .zpl-job-preview {
    flex: 0 0 auto;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background-color: var(--bg);
    background-image: radial-gradient(rgba(15, 15, 18, 0.10) 1px, transparent 1px);
    background-size: 14px 14px;
    overflow: hidden;
}
html.mlm-mobile .editor-shell .zpl-job-preview-img { max-width: 100%; max-height: 58dvh; box-shadow: 0 12px 32px rgba(15, 15, 18, 0.10); }
html.mlm-mobile .editor-shell .zpl-job-preview-empty,
html.mlm-mobile .editor-shell .zpl-job-preview-note { font-size: 15px; }
html.mlm-mobile .editor-shell .mlm-zpl-pills { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
html.mlm-mobile .editor-shell .mlm-zpl-pills[hidden] { display: none !important; }
html.mlm-mobile .editor-shell .mlm-zpl-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface);
    color: var(--ink-2);
    font: 600 13px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
html.mlm-mobile .editor-shell .mlm-zpl-tag.is-ok { color: #15803d; }
html.mlm-mobile .editor-shell .mlm-zpl-tag svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .editor-shell .zpl-job-body .zpl-job-nav { align-self: center; margin-top: 8px; height: 44px; padding: 0 4px; border: 1px solid var(--line); border-radius: var(--radius-pill, 999px); background: var(--surface); }
html.mlm-mobile .editor-shell .zpl-job-body .zpl-job-nav-btn { width: 44px; height: 44px; border-radius: 50%; font-size: 20px; }

/* Sticky action bar above the safe area (and above the keyboard). */
html.mlm-mobile .editor-shell .zpl-job-foot {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 12px 16px calc(var(--mlm-safe-b, 0px) + 12px);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
html.mlm-mobile .editor-shell.mlm-kb .zpl-job-foot { padding-bottom: 12px; }
html.mlm-mobile .editor-shell .zpl-job-foot .zpl-job-error {
    grid-column: 1 / -1;
    order: -1;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 15px;
}
html.mlm-mobile .editor-shell .zpl-job-foot :is(.mlm-zpl-dl, #zplJobPrintBtn) {
    min-height: 52px;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border-radius: 14px;
    font: 600 17px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: scale 0.12s ease;
}
html.mlm-mobile .editor-shell .zpl-job-foot .mlm-zpl-dl { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
html.mlm-mobile .editor-shell .zpl-job-foot .mlm-zpl-dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .editor-shell .zpl-job-foot #zplJobPrintBtn { border: 1px solid var(--ink); background: var(--ink); color: #fafafa; }
html.mlm-mobile .editor-shell .zpl-job-foot #zplJobPrintBtn::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9V4h10v5'/%3E%3Cpath d='M5 14h14v5H5z'/%3E%3Cpath d='M5 9h14a2 2 0 0 1 2 2v3H3v-3a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9V4h10v5'/%3E%3Cpath d='M5 14h14v5H5z'/%3E%3Cpath d='M5 9h14a2 2 0 0 1 2 2v3H3v-3a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
html.mlm-mobile .editor-shell .zpl-job-foot :is(.mlm-zpl-dl, #zplJobPrintBtn):disabled { opacity: 0.4; }
html.mlm-mobile .editor-shell .zpl-job-foot :is(.mlm-zpl-dl, #zplJobPrintBtn):not(:disabled):active { scale: 0.97; }
@media (prefers-reduced-transparency: reduce) {
    html.mlm-mobile .editor-shell .zpl-job-foot { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* ==== << Phone ZPL Viewer ==== */

/* ==== Phone More sheet (v4-06) >> ==== */
html.mlm-mobile .mlm-more-sheet.hidden { display: none !important; }
html.mlm-mobile .mlm-more-sheet > .mlm-cap:first-of-type { margin-top: 0; }
html.mlm-mobile .mlm-more-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
html.mlm-mobile .mlm-more-tile {
    min-width: 0;
    height: 76px;
    padding: 0 2px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-2, #f6f7fa);
    color: var(--ink, #0f0f12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 600 12px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: scale 0.12s ease;
}
html.mlm-mobile .mlm-more-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .mlm-more-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.mlm-mobile :is(.mlm-more-tile, .mlm-more-half):active { scale: 0.97; background: rgb(212, 216, 224); }
html.mlm-mobile .mlm-more-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
html.mlm-mobile .mlm-more-half {
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: var(--surface-2, #f6f7fa);
    color: var(--ink, #0f0f12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 600 16px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: scale 0.12s ease;
}
html.mlm-mobile .mlm-more-half svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-2); }
html.mlm-mobile .mlm-switch {
    position: relative;
    flex: 0 0 51px;
    width: 51px;
    height: 31px;
    border-radius: 999px;
    background: var(--line-strong, #cdd2dc);
    transition: background 0.15s ease;
}
html.mlm-mobile .mlm-switch::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(15, 15, 18, 0.18);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
html.mlm-mobile [aria-checked="true"] > .mlm-switch { background: var(--ink, #0f0f12); }
html.mlm-mobile [aria-checked="true"] > .mlm-switch::after { transform: translateX(20px); }
html.mlm-mobile .mlm-grid-bg { margin-top: 8px; border-radius: 16px; background: var(--surface-2, #f6f7fa); }
html.mlm-mobile .mlm-grid-swatch { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong, #cdd2dc); }
/* Short phones (iPhone SE): the whole sheet fits without scrolling. */
@media (max-height: 700px) {
    html.mlm-mobile .mlm-more-sheet .mlm-cap { margin: 12px 0 6px; }
    html.mlm-mobile .mlm-more-tile { height: 68px; gap: 6px; }
    html.mlm-mobile .mlm-more-sheet .mlm-grow { min-height: 46px; }
    html.mlm-mobile .mlm-more-foot { margin-top: 12px; }
    html.mlm-mobile .mlm-more-half { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
    html.mlm-mobile :is(.mlm-more-tile, .mlm-more-half):active { scale: none; }
    html.mlm-mobile .mlm-switch::after { transition: none; }
}
/* ==== << Phone More sheet ==== */

/* ==== Phone Data sheet (v4-08) >> ====
   A panel above the live label: no scrim, capped so the label shows. */
html.mlm-mobile #variablePickerPopover.mlm-sheet { max-height: min(64dvh, calc(100dvh - var(--mlm-safe-t, 0px) - 160px - var(--mlm-kb, 0px))) !important; }
html.mlm-mobile #variablePickerPopover .batch-source { display: flex; flex-direction: column; gap: 12px; border: 0; background: transparent; padding: 0; }
html.mlm-mobile #variablePickerPopover .batch-source-body { padding: 0; border: 0; background: transparent; display: flex; flex-direction: column; gap: 12px; }
html.mlm-mobile #variablePickerPopover .batch-source-foot { padding: 0; border: 0; background: transparent; }
html.mlm-mobile :is(.editor-shell, body) #variablePickerPopover .batch-tabs.mlm-seg { margin: 0; }
html.mlm-mobile :is(.editor-shell, body) #variablePickerPopover .batch-tabs.mlm-seg .batch-tab { min-height: 0; height: 42px; font-size: 15px; box-shadow: none; }
html.mlm-mobile #variablePickerPopover .batch-drop {
    min-height: 132px;
    gap: 6px;
    border: 0;
    border-radius: 16px;
    background: var(--surface-2, #f6f7fa);
}
html.mlm-mobile #variablePickerPopover .batch-drop-title { font-size: 17px; font-weight: 600; color: var(--ink); }
html.mlm-mobile #variablePickerPopover .batch-drop-sub { font-size: 15px; color: var(--ink-3); }
html.mlm-mobile #variablePickerPopover .batch-drop-icon { width: 24px; height: 24px; }
html.mlm-mobile #variablePickerPopover .batch-choice { display: none; }
html.mlm-mobile #variablePickerPopover .batch-input,
html.mlm-mobile #variablePickerPopover .batch-textarea { font-size: 16px; border-radius: 12px; }
html.mlm-mobile #variablePickerPopover .mlm-data-done {
    position: sticky;
    bottom: 0;
    margin: 0;
    box-shadow: 0 -12px 12px -4px var(--surface, #fff);
}
/* No file yet: the loaded block and Done stay hidden. */
html.mlm-mobile #variablePickerPopover:not(.mlm-data-loaded) .mlm-data-loaded-ui,
html.mlm-mobile #variablePickerPopover:not(.mlm-data-loaded) .mlm-data-done { display: none; }
/* Rows loaded: header, column list, mode and Done; the source picker hides. */
html.mlm-mobile #variablePickerPopover.mlm-data-loaded .variable-popover-header,
html.mlm-mobile #variablePickerPopover.mlm-data-loaded .batch-tabs,
html.mlm-mobile #variablePickerPopover.mlm-data-loaded .batch-pane { display: none !important; }
html.mlm-mobile #variablePickerPopover .mlm-data-head { display: flex; align-items: center; gap: 12px; min-height: 52px; }
html.mlm-mobile #variablePickerPopover .mlm-data-ic {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(21, 128, 61, 0.10);
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html.mlm-mobile #variablePickerPopover .mlm-data-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile #variablePickerPopover .mlm-data-titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html.mlm-mobile #variablePickerPopover .mlm-data-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
html.mlm-mobile #variablePickerPopover .mlm-data-sub { font-size: 15px; font-weight: 500; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile #variablePickerPopover .mlm-data-replace-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font: 600 16px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html.mlm-mobile #variablePickerPopover .mlm-data-loaded-ui .mlm-cap { margin: 8px 0 8px; }
html.mlm-mobile #variablePickerPopover .mlm-data-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
html.mlm-mobile #variablePickerPopover .mlm-data-row {
    position: relative;
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 16px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
}
html.mlm-mobile #variablePickerPopover .mlm-data-row + .mlm-data-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
html.mlm-mobile #variablePickerPopover .mlm-data-row:active { background: var(--surface-2); }
html.mlm-mobile #variablePickerPopover .mlm-data-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html.mlm-mobile #variablePickerPopover .mlm-data-row-name { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile #variablePickerPopover .mlm-data-row-meta { font-size: 13px; color: var(--ink-3); }
html.mlm-mobile #variablePickerPopover .mlm-data-row-val { flex: 0 1 auto; min-width: 0; max-width: 48%; font-size: 15px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mlm-mobile .mlm-col-chip {
    display: inline-block;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.10);
    color: #3b82f6;
    font: 500 14px/1.2 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
html.mlm-mobile #variablePickerPopover .mlm-data-row-chev { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: #a1a1aa; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile #variablePickerPopover .mlm-data-add { color: var(--ink-2); }
html.mlm-mobile #variablePickerPopover .mlm-data-add > svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* Dashed outlines and {column} tags over linked items. */
html.mlm-mobile .mlm-data-marks { position: fixed; left: 0; top: 0; z-index: 55; overflow: hidden; pointer-events: none; }
html.mlm-mobile .mlm-data-marks[hidden] { display: none; }
html.mlm-mobile .mlm-mark {
    position: absolute;
    box-sizing: border-box;
    border: 1.5px dashed #3b82f6;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.06);
}
html.mlm-mobile .mlm-mark span {
    position: absolute;
    left: -1.5px;
    bottom: 100%;
    max-width: 180px;
    margin-bottom: 2px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #3b82f6;
    color: #fff;
    font: 600 11px/1.3 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* The row pill sits under the label while the Data sheet is open. */
html.mlm-mobile .editor-shell.mlm-data-open .batch-nav-cluster:not([hidden]) {
    display: flex !important;
    position: fixed;
    left: 50%;
    bottom: auto;
    transform: translateX(-50%);
    z-index: 56;
}
html.mlm-mobile .editor-shell.mlm-data-open .batch-navigator {
    min-height: 44px;
    height: 44px;
    gap: 2px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface);
    box-shadow: none;
}
/* Children: the editor row pill (.mlm-row-label, #mlmBatchMore) decides what shows. */
html.mlm-mobile .editor-shell.mlm-data-open .batch-navigator .batch-nav-step { position: relative; width: 36px; height: 36px; border-radius: 50%; }
html.mlm-mobile .editor-shell.mlm-data-open .batch-navigator .batch-nav-step::after { content: ""; position: absolute; inset: -4px; }
html.mlm-mobile .editor-shell.mlm-data-open .batch-navigator .batch-nav-step:disabled { opacity: 0.4; }
html.mlm-mobile .editor-shell.mlm-data-open .batch-nav-label { padding: 0 6px; font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-variant-numeric: tabular-nums; color: var(--ink); }
/* ==== << Phone Data sheet ==== */

/* ==== Phone paywall: token alignment only (v4-12) >> ====
   CSS only. The wording, price, #payTestPay link and the flow are untouched. */
html.mlm-mobile .editor-shell .pay-test-card,
html.mlm-mobile .editor-shell .pay-test-card.is-paid {
    border-radius: 24px 24px 0 0;
    padding: 0 16px calc(var(--mlm-safe-b, 0px) + 16px);
}
html.mlm-mobile .editor-shell .pay-test-close { right: 28px; }
html.mlm-mobile .editor-shell .pay-test-price {
    padding: 14px 16px;
    border: 0;
    border-radius: 16px;
    background: var(--surface-2);
}
html.mlm-mobile .editor-shell .pay-test-pay { height: 52px; border-radius: 14px; }
html.mlm-mobile .editor-shell .pay-test-actions .pay-test-restore { height: 48px; border-radius: 14px; }
html.mlm-mobile .editor-shell .pay-test-why { border-radius: 16px; }
/* ==== << Phone paywall ==== */
/* No hairline under the chips row on the phone home (v4-01). */
html.mlm-mobile .editor-shell .tgal-card .tgal-chips-wrap { border-bottom: 0; }

/* Grid & background (phone): switch rows, a grid-size stepper and the
   background colour row, grouped like the More sheet. */
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle,
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 0;
    padding: 0 16px;
    background: var(--surface-2, #f6f7fa);
    border: 0;
    font: 500 16px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    box-sizing: border-box;
}
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle:first-of-type { border-radius: 16px 16px 0 0; margin-top: 4px; }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle + .grid-popover-toggle,
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle + .grid-popover-row { box-shadow: inset 0 1px 0 var(--line, #e2e6ed); }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-row { border-radius: 0 0 16px 16px; }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle span,
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-label { flex: 1 1 auto; font-size: 16px; color: var(--ink); }
html.mlm-mobile #labelGridPopover.mlm-sheet hr,
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-divider { display: none; }
/* Checkbox drawn as the More-sheet switch. */
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle input[type="checkbox"] {
    order: 2;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 51px;
    width: 51px;
    height: 31px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: var(--line-strong, #cdd2dc);
    transition: background 0.15s ease;
    cursor: pointer;
}
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(15, 15, 18, 0.18);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle input[type="checkbox"]:checked { background: var(--ink, #0f0f12); }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle input[type="checkbox"]:checked::after { transform: translateX(20px); }
/* Grid size: − value px + */
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-row .grid-popover-num {
    flex: 0 0 48px;
    width: 48px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-num::-webkit-inner-spin-button,
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-suffix { order: 9; flex: 0 0 auto; color: var(--ink-3); font-size: 14px; margin-left: -6px; }
html.mlm-mobile #labelGridPopover.mlm-sheet .mlm-grid-step {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line, #e2e6ed);
    border-radius: 50%;
    background: var(--surface, #fff);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html.mlm-mobile #labelGridPopover.mlm-sheet .mlm-grid-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
html.mlm-mobile #labelGridPopover.mlm-sheet .mlm-grid-step:active { background: rgb(212, 216, 224); }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-row .grid-popover-suffix { order: 0; }
html.mlm-mobile #labelGridPopover.mlm-sheet .mlm-grid-bg { margin-top: 12px; }

/* Preview mode (phone): only the label. The top bar, tab bar, selection card,
   zoom and row pills go; a Close preview pill sits where the tab bar was. */
html.mlm-mobile .mlm-preview-close { display: none; }
html.mlm-mobile .editor-shell.preview-mode .mlm-preview-close {
    position: fixed;
    left: 50%;
    bottom: max(12px, var(--mlm-safe-b));
    transform: translateX(-50%);
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px 0 16px;
    border: 1px solid var(--line, #e2e6ed);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--ink, #0f0f12);
    font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-shadow: 0 10px 28px rgba(15, 15, 18, 0.12), 0 2px 6px rgba(15, 15, 18, 0.06);
}
html.mlm-mobile .editor-shell.preview-mode .mlm-preview-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
html.mlm-mobile .editor-shell.preview-mode .mlm-preview-close:active { transform: translateX(-50%) scale(0.97); }
html.mlm-mobile .editor-shell.preview-mode .editor-header,
html.mlm-mobile .editor-shell.preview-mode #mlmDock,
html.mlm-mobile .editor-shell.preview-mode #mlmSelBar,
html.mlm-mobile .editor-shell.preview-mode .zoom-pill,
html.mlm-mobile .editor-shell.preview-mode .mlm-fit-chip,
html.mlm-mobile .editor-shell.preview-mode .batch-nav-cluster,
html.mlm-mobile .editor-shell.preview-mode .float-toolbar-zone { display: none !important; }
/* Close preview: a round eye button, the size of the top bar buttons. */
html.mlm-mobile .editor-shell.preview-mode .mlm-preview-close { width: 52px; height: 52px; padding: 0; justify-content: center; gap: 0; border-radius: 50%; }
html.mlm-mobile .editor-shell.preview-mode .mlm-preview-close svg { width: 22px; height: 22px; stroke-width: 1.7; }
/* Preview is on, so the eye button is filled black (pressed state). */
html.mlm-mobile .editor-shell.preview-mode .mlm-preview-close {
    background: var(--ink, #0f0f12);
    border-color: var(--ink, #0f0f12);
    color: #fff;
    box-shadow: 0 10px 28px rgba(15, 15, 18, 0.24), 0 2px 6px rgba(15, 15, 18, 0.12);
}

/* Home in proportion with the 44px top bar and the sheets: its content is
   drawn at 85% (switcher, search, chips, sections, cards, My labels rows).
   The search field is scaled back to 16px; the floating pill matches the
   top bar's Print pill (44px, 15px text). */
html.mlm-mobile .editor-shell .tgal-card > :is(.tgal-head, .tgal-chips-wrap, #mlmHomeTemplates, #mlmHomeMine) { zoom: 0.85; }
html.mlm-mobile .editor-shell .tgal-card :is(input:not([type="checkbox"]):not([type="radio"]), #mlm-zoom-fix) { font-size: 18.8px !important; }
html.mlm-mobile .editor-shell .tgal-card .mlm-tgal-new {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 20px 0 16px !important;
    font-size: 15px !important;
    gap: 6px;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-tgal-new svg { width: 18px; height: 18px; }
html.mlm-mobile .editor-shell .tgal-card .mlm-tgal-new,
html.mlm-mobile .editor-shell .tgal-card .mlm-tgal-new * { font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; }

/* Simpler home top (phone): a quiet two-tab switch, one search field with the
   filter inside it, and small name-only category chips. */
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch {
    min-height: 44px;
    height: 44px;
    padding: 3px;
    border: 0;
    background: rgba(15, 15, 18, 0.06);
    box-shadow: none;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch .tgal-facet { height: 38px; font-size: 15px; font-weight: 600; color: var(--ink-2, #3f3f46); }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch .tgal-facet.is-on { color: var(--ink, #0f0f12); }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch .mlm-seg-pill {
    background: var(--surface, #fff) !important;
    height: 38px !important;
    box-shadow: 0 1px 3px rgba(15, 15, 18, 0.12), 0 0 0 1px rgba(15, 15, 18, 0.04);
}
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch .mlm-seg-n { background: rgba(15, 15, 18, 0.08); color: var(--ink-2, #3f3f46); }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch .mlm-seg-n[hidden] { display: none; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search {
    position: relative;
    height: 44px;
    min-height: 44px;
    border: 1px solid var(--line, #e2e6ed);
    box-shadow: none;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search:not(.mlm-mine-search) input { padding-right: 48px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--ink-2, #3f3f46);
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip:active { background: var(--surface-2, #f6f7fa); }
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip.is-on,
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip[aria-pressed="true"] { background: var(--ink, #0f0f12); color: #fafafa; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chip { height: 34px; min-height: 34px; padding: 0 14px; font-size: 14px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chip .tgal-chip-n { display: none; }

/* Home top: title + one round My labels / Templates button (no tabs). */
html.mlm-mobile .editor-shell .tgal-card .mlm-home-switch { display: none !important; }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    margin: 0 0 6px;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-home-bar-title {
    font: 700 30px/1.1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.025em;
    color: var(--ink, #0f0f12);
}
/* Templates <-> My labels: a small white text pill on the right of the
   title, with the saved-label count in a black badge. (One rule; it was
   restyled three times over.) */
html.mlm-mobile .editor-shell .tgal-card .mlm-home-toggle {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    height: 44px;
    padding: 0 16px;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--ink, #0f0f12);
    box-shadow: 0 1px 2px rgba(15, 15, 18, 0.06), 0 6px 18px rgba(15, 15, 18, 0.07), 0 0 0 1px rgba(15, 15, 18, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 600 16px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.01em;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-home-toggle:active { background: rgb(212, 216, 224); color: var(--ink); }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-toggle-ico { display: inline-flex; }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-toggle-n {
    position: static;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--ink, #0f0f12);
    color: #fff;
    font: 700 12px/22px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    text-align: center;
    box-sizing: border-box;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-home-toggle-n[hidden] { display: none; }

/* Quieter search and chips on the phone home: a soft grey filled search field
   (no border, rounded rectangle) and borderless grey chips, black when on. */
html.mlm-mobile .editor-shell .tgal-card .tgal-search {
    height: 46px !important;
    min-height: 46px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: rgba(15, 15, 18, 0.06) !important;
    box-shadow: none !important;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search:focus-within { background: rgba(15, 15, 18, 0.08) !important; box-shadow: none !important; outline: none; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search input { background: transparent !important; color: var(--ink, #0f0f12); }
html.mlm-mobile .editor-shell .tgal-card .tgal-search input::placeholder { color: var(--ink-3, #71717a); }
html.mlm-mobile .editor-shell .tgal-card .tgal-search > svg { color: var(--ink-3, #71717a); width: 20px; height: 20px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip { width: 38px; height: 38px; color: var(--ink-3, #71717a); }
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip svg { width: 20px; height: 20px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chips-wrap { border: 0 !important; box-shadow: none !important; margin-top: 2px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chips { gap: 6px !important; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chip {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(15, 15, 18, 0.06) !important;
    color: var(--ink-2, #3f3f46) !important;
    font: 600 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    box-shadow: none !important;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-chip[aria-pressed="true"] { background: var(--ink, #0f0f12) !important; color: #fff !important; }

/* ==== Phone home top, refined (2026-11-14) ====
   Premium cues: generous space above the header, a large tight title, one
   calm round button, a white search field with a soft lift instead of a
   heavy fill, and quiet hairline pills. (Values are drawn at 85%.) */
html.mlm-mobile .editor-shell .tgal-head {
    gap: 16px;
    padding: calc(var(--mlm-safe-t, 0px) + 34px) 20px 6px;
}
html.mlm-mobile .editor-shell .tgal-card .mlm-home-bar { min-height: 54px; margin: 0 0 4px; }
html.mlm-mobile .editor-shell .tgal-card .mlm-home-bar-title {
    font: 700 36px/1.05 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.035em;
}
/* Search: white, a whisper of an edge and a soft lift; the filter sits after a hairline. */
html.mlm-mobile .editor-shell .tgal-card .tgal-search {
    height: 54px !important;
    min-height: 54px !important;
    padding-left: 18px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: var(--surface, #fff) !important;
    box-shadow: 0 1px 2px rgba(15, 15, 18, 0.05), 0 8px 24px rgba(15, 15, 18, 0.06), 0 0 0 1px rgba(15, 15, 18, 0.05) !important;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search:focus-within {
    background: var(--surface, #fff) !important;
    box-shadow: 0 1px 2px rgba(15, 15, 18, 0.05), 0 8px 24px rgba(15, 15, 18, 0.08), 0 0 0 1.5px var(--ink, #0f0f12) !important;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search > svg { width: 21px; height: 21px; color: var(--ink-3, #71717a); }
html.mlm-mobile .editor-shell .tgal-card .tgal-search input::placeholder { color: #9a9aa3; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search:not(.mlm-mine-search) input { padding-right: 60px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip {
    right: 6px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: var(--ink-2, #3f3f46);
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: rgba(15, 15, 18, 0.1);
}
/* Pills: quiet white with a hairline, solid ink when selected, more air. */
html.mlm-mobile .editor-shell .tgal-card .tgal-chips-wrap { margin: 2px 0 6px; padding-left: 4px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chips { gap: 8px !important; padding: 2px 16px 6px !important; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chip {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 18px !important;
    background: var(--surface, #fff) !important;
    color: var(--ink-2, #3f3f46) !important;
    box-shadow: 0 0 0 1px rgba(15, 15, 18, 0.08) !important;
    font: 550 15px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    letter-spacing: -0.005em;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-chip[aria-pressed="true"] {
    background: var(--ink, #0f0f12) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(15, 15, 18, 0.18) !important;
}
/* Align the header with the content gutters and keep the search text close to its icon. */
html.mlm-mobile .editor-shell .tgal-head { padding-left: 16px; padding-right: 16px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chips { padding-left: 16px !important; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chips-wrap { padding-left: 0; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search { gap: 10px !important; }
/* Search text starts just after the magnifier. */
html.mlm-mobile .editor-shell .tgal-card .tgal-search { padding-left: 0 !important; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search > svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search input { padding-left: 50px !important; width: 100%; height: 100%; }
/* "12 templates for ..." stays for screen readers only; the section headings
   already group the results. */
html.mlm-mobile .editor-shell .tgal-card .tgal-count {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
/* Search: a full capsule, 46px on screen (the home head is at zoom 0.85). */
html.mlm-mobile .editor-shell .tgal-card .tgal-search {
    height: calc(46px / 0.85) !important;
    min-height: calc(46px / 0.85) !important;
    border-radius: 999px !important;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-search > svg { left: 20px; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search input { padding-left: 52px !important; }
html.mlm-mobile .editor-shell .tgal-card .tgal-search .mlm-filter-chip { right: 6px; width: 42px; height: 42px; border-radius: 50%; }

/* My labels as the Templates grid: a section heading with the count, then
   two-column cards (picture well, name, size · edited), ⋯ on the picture. */
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-sec {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0;
    padding: 16px 0 10px;
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-sec[hidden] { display: none; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-sec-title {
    margin: 0;
    font: 700 19px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.01em;
    color: var(--ink, #0f0f12);
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-count { font: 600 14px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink-2, #3f3f46); }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 8px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-list[hidden] { display: none !important; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card {
    position: relative;
    display: block;
    padding: 6px;
    border: 1px solid var(--line, #e2e6ed);
    border-radius: 16px;
    background: var(--surface, #fff);
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card::before { display: none !important; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-thumb {
    flex: none;
    width: 100%;
    height: 124px;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 12px;
    background: var(--bg, #eef2f8);
    display: flex;
    align-items: center;
    justify-content: center;
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-thumb :is(img, svg) {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(15, 15, 18, 0.10));
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-text { gap: 2px; padding: 9px 6px 5px; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-name { font-size: 15px; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-meta { font-size: 13px; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-more {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 3px rgba(15, 15, 18, 0.14);
}
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card .mlm-mine-more::after { content: ""; position: absolute; inset: -6px; }
html.mlm-mobile .editor-shell .mlm-mine .mlm-mine-card.is-current { border-color: var(--ink, #0f0f12); }
/* Chips show how many templates each type has, quietly inside the pill. */
html.mlm-mobile .editor-shell .tgal-card .tgal-chip { gap: 7px !important; padding: 0 12px 0 16px !important; }
html.mlm-mobile .editor-shell .tgal-card .tgal-chip .tgal-chip-n {
    display: inline-flex !important;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(15, 15, 18, 0.06);
    color: var(--ink-3, #71717a);
    font: 600 12.5px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
html.mlm-mobile .editor-shell .tgal-card .tgal-chip[aria-pressed="true"] .tgal-chip-n { background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.86); }
html.mlm-mobile [aria-checked="true"] > .mlm-switch::after { transform: translateX(74.07%); }
html.mlm-mobile #labelGridPopover.mlm-sheet .grid-popover-toggle input[type="checkbox"]:checked::after { transform: translateX(74.07%); }

/* Settings footer: Help & tour and Support us are black buttons. */
html.mlm-mobile .mlm-more-half { background: var(--ink, #0f0f12); color: #fff; }
html.mlm-mobile .mlm-more-half svg { color: #fff; }
html.mlm-mobile .mlm-more-half:active { background: #2a2a30; }

/* ---- 44px tap targets on the phone (look unchanged) ----
   The home, sheet bodies and the selection bar are drawn at zoom 0.85, so a
   44px box there shows as 37px. --mlm-hit is the CSS size that lands on 44
   screen px in each place; every hit area below uses it. */
html.mlm-mobile { --mlm-hit: 44px; }
html.mlm-mobile .editor-shell .tgal-card > :is(.tgal-head, .tgal-chips-wrap, #mlmHomeTemplates, #mlmHomeMine),
html.mlm-mobile .mlm-sheet > *:not(.mlm-grab):not(.mlm-sheet-head),
html.mlm-mobile .editor-shell #mlmSelBar > * { --mlm-hit: calc(44px / 0.85); }
/* An invisible box centred on the control. */
html.mlm-mobile :is(
    .mlm-home-toggle, .mlm-mine-more, .tgal-chip, .tgal-see-all,
    #mlmTaDec, #mlmTaInc, .mlm-sheet-close, .mlm-sheet-back, #avnacPanelClose,
    #mlmSbDone, .mlm-sheet-done, .mlm-shape-chip, #mlmDateChips button
) { position: relative; }
html.mlm-mobile .editor-shell :is(.tgal-card .mlm-filter-chip, .tgal-chip, .tgal-see-all, .mlm-sheet-done, #mlmTaDec, #mlmTaInc)::after,
html.mlm-mobile :is(.mlm-home-toggle, .mlm-mine-more, .mlm-sheet-close, .mlm-sheet-back, #mlmSbDone, .mlm-shape-chip, #mlmDateChips button)::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: max(100%, var(--mlm-hit)) !important;
    height: max(100%, var(--mlm-hit)) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    transform: translate(-50%, -50%) !important;
}
html.mlm-mobile .editor-shell #avnacPanelClose::after {
    width: max(100%, var(--mlm-hit)) !important;
    height: max(100%, var(--mlm-hit)) !important;
}
/* Chips in a row: taller hit area, but no wider than the chip, so a tap
   never lands on the neighbour. Short chips get a real 44px width. */
html.mlm-mobile .editor-shell :is(.tgal-chip, .mlm-shape-chip, #mlmDateChips button)::after { width: 100% !important; }
html.mlm-mobile :is(.mlm-shape-chip, #mlmDateChips button) { min-width: var(--mlm-hit); }
/* Text sheet B/I/U and alignment sit about 4px apart: 44px tall, and as wide
   as the button plus the gap, so neighbours never overlap. */
html.mlm-mobile #mlmTextAddSheet :is(#mlmTaB, #mlmTaI, #mlmTaU, #mlmTaL, #mlmTaC, #mlmTaR) { position: relative; }
html.mlm-mobile #mlmTextAddSheet :is(#mlmTaB, #mlmTaI, #mlmTaU, #mlmTaL, #mlmTaC, #mlmTaR)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(100% + 4px);
    height: max(100%, var(--mlm-hit));
    transform: translate(-50%, -50%);
}
/* Fields, list rows and footer buttons: a real 44px. */
html.mlm-mobile .mlm-sheet .mlm-grow,
html.mlm-mobile .mlm-sheet .mlm-row,
html.mlm-mobile .mlm-sheet :is(.mlm-outline, .mlm-quiet, .mlm-more-half),
html.mlm-mobile .mlm-sheet input:is([type="number"], [type="search"], [type="text"]),
html.mlm-mobile .editor-shell :is(#shapeSearch, .picker-search) { min-height: var(--mlm-hit); }
/* Search fields inside sheets are 48px at zoom 0.85 (41 on screen). */
html.mlm-mobile .mlm-sheet :is(.picker-search, #shapeSearch, #batchSheetUrl, #panelQrInput, .color-popover-hex) { height: max(48px, var(--mlm-hit)) !important; }
/* Chip rows scroll sideways, which also clips the chips' hit areas top and
   bottom. Extra padding, cancelled by a negative margin, makes room for them
   without moving anything. */
html.mlm-mobile .editor-shell .tgal-card .tgal-chips { padding-top: 8px !important; padding-bottom: 8px !important; margin-top: -6px !important; margin-bottom: -2px !important; }
html.mlm-mobile .mlm-shape-chips { padding-top: 10px; padding-bottom: 10px; margin-top: -10px; margin-bottom: -6px; }
/* More compact controls in sheets: segmented buttons, steppers, chips. */
html.mlm-mobile :is(#mlmPrintChange, #variablePickerCloseBtn, .mlm-grid-step, .mlm-stepper button, .table-stepper button) { position: relative; }
html.mlm-mobile .mlm-sheet :is(.mlm-seg button, .batch-tab, .mlm-chips button)::after,
html.mlm-mobile .editor-shell .mlm-sheet :is(.mlm-seg button, .batch-tab, .mlm-chips button)::after,
html.mlm-mobile .editor-shell :is(#mlmPrintChange, #variablePickerCloseBtn, .mlm-grid-step, .mlm-stepper button, .table-stepper button)::after,
html.mlm-mobile :is(#mlmPrintChange, #variablePickerCloseBtn, .mlm-grid-step, .mlm-stepper button, .table-stepper button)::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: max(100%, var(--mlm-hit)) !important;
    height: max(100%, var(--mlm-hit)) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    transform: translate(-50%, -50%) !important;
}
/* Side by side: taller, never wider than the button. */
html.mlm-mobile .mlm-sheet :is(.mlm-seg button, .batch-tab, .mlm-chips button)::after,
html.mlm-mobile .editor-shell .mlm-sheet :is(.mlm-seg button, .batch-tab, .mlm-chips button)::after { width: 100% !important; }
/* The stepper clipped its round buttons (and their hit areas) at the bottom. */
html.mlm-mobile .mlm-sheet .table-stepper { overflow: visible; }
/* Segment buttons clipped their own hit areas; the labels fit without it. */
html.mlm-mobile .mlm-sheet :is(.mlm-seg button, .batch-tab) { overflow: visible !important; }
/* Date format chips scroll sideways: room for their hit areas, nothing moves. */
html.mlm-mobile .mlm-sheet #mlmDateChips { padding-top: 6px !important; padding-bottom: 8px !important; margin-top: -6px !important; margin-bottom: -6px !important; }
/* Upload / Google Sheet / Paste: the older coarse-pointer rule has id weight
   (its :is list holds ids), so :not(#_) matches that weight. */
html.mlm-mobile .editor-shell .batch-tab:not(#_)::after {
    height: max(100%, var(--mlm-hit)) !important;
    width: 100% !important;
}

/* ---- Tab bar: Settings pinned at the right end (outside the scroller) ---- */
html.mlm-mobile #mlmDock { display: flex; align-items: center; }
html.mlm-mobile #mlmDock .mlm-dock-row { flex: 1 1 auto; min-width: 0; }
html.mlm-mobile #mlmDock > #mlmMoreTab { flex: 0 0 64px; width: 64px; margin-right: 6px; position: relative; }
html.mlm-mobile #mlmDock > #mlmMoreTab::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 14px;
    bottom: 14px;
    width: 1px;
    background: var(--line, #e2e6ed);
}

/* Settings footer: Help & tour stays the one black button; Support us is an
   outline button with its heart, so each view has a single black button. */
html.mlm-mobile .mlm-more-half[data-more="support"] {
    background: var(--surface, #fff);
    color: var(--ink, #0f0f12);
    box-shadow: inset 0 0 0 1px var(--line-strong, #cdd2dc);
}
html.mlm-mobile .mlm-more-half[data-more="support"] svg { color: #e11d48; }
html.mlm-mobile .mlm-more-half[data-more="support"]:active { background: var(--surface-2, #f6f7fa); }

/* Data sheet: "Not linked" never gets cut off; the item name gives way instead. */
html.mlm-mobile #variablePickerPopover .mlm-data-row-val.is-none { flex: 0 0 auto; max-width: none; }

/* Shape names wrap to two lines instead of "Rounded re…". */
html.mlm-mobile .editor-shell #panel-shape .shape-row-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Reduce transparency (iOS setting): a solid tab bar instead of frosted glass. */
@media (prefers-reduced-transparency: reduce) {
    html.mlm-mobile #mlmDock,
    html.mlm-mobile #mlmDock .mlm-dock-row {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    html.mlm-mobile #mlmDock { background: var(--surface, #fff) !important; }
}
html.mlm-mobile #mlmDock .mlm-dock-row .mlm-dock-item { flex: 0 0 var(--mlm-tab-w, 68px); width: var(--mlm-tab-w, 68px); }
