/* All rules are conditional on the phone controller; desktop is untouched. */
html.tj-mobile-active{--tj-required-ink:#805000;--tj-required-line:#bb873c}
html.tj-mobile-active[data-tj-theme="dark"]{--tj-required-ink:#ffd18a;--tj-required-line:#98733f}
html.tj-mobile-active .tj-mobile-builder-screen{padding:0!important;margin:0!important;min-width:0}
html.tj-mobile-active .tj-mobile-builder-screen:before,html.tj-mobile-active .tj-mobile-builder-screen>*:not(.tj-mobile-builder){display:none!important}
html.tj-mobile-active .tj-mobile-builder{--mb-accent:var(--olive,#626b4e);--mb-border:var(--line,#deded3);--mb-card:var(--paper,#fffefa);--mb-ink:var(--ink,#30322e);display:block!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;min-width:0;box-shadow:none!important;color:var(--mb-ink)}
html.tj-mobile-active .tj-mobile-builder *{box-sizing:border-box}
html.tj-mobile-active .tj-mb-toolbar{position:sticky;top:0;z-index:49;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 0 14px;background:var(--cream,#f6f4ef);border-bottom:1px solid var(--mb-border)}
html.tj-mobile-active .tj-mb-toolbar>div{min-width:0;display:flex;flex-direction:column;gap:2px}
html.tj-mobile-active .tj-mb-toolbar strong{font-size:15px;line-height:1.35;font-weight:600;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-name-trigger{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;width:100%;min-height:44px;padding:0 17px 0 0;border:0;background:transparent;color:var(--mb-ink);text-align:left;touch-action:manipulation}
html.tj-mobile-active .tj-mb-edit-name{position:absolute;right:0;top:50%;transform:translateY(-50%);font-size:16px;color:var(--muted)}
html.tj-mobile-active .tj-mb-tools{width:44px;height:44px;padding:0;min-height:44px;font-size:22px;letter-spacing:1px}
html.tj-mobile-active .tj-mb-room{font-size:12px;color:var(--muted,#70736a)}
html.tj-mobile-active .tj-mb-content{padding:20px 0 0;min-width:0;overflow:visible;max-height:none;height:auto}
html.tj-mobile-active .tj-mb-heading{font:400 29px/1.15 Georgia,'Times New Roman',serif;margin:0 0 18px;letter-spacing:-.025em;color:var(--mb-ink)}
html.tj-mobile-active .tj-mb-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:46px;min-width:44px;border:1px solid var(--mb-border);border-radius:7px;padding:10px 13px;font-family:inherit;font-size:14px;font-weight:550;line-height:1.35;color:var(--mb-ink);background:var(--mb-card);text-align:center;touch-action:manipulation}
html.tj-mobile-active .tj-mb-button:disabled,html.tj-mobile-active .tj-mb-variant:disabled,html.tj-mobile-active .tj-mb-categories button:disabled{opacity:.5;cursor:default}
html.tj-mobile-active .tj-mb-back{padding:10px 4px 10px 0;border-color:transparent;background:transparent}
html.tj-mobile-active .tj-mb-name-button{padding-inline:11px}
html.tj-mobile-active .tj-mb-primary{background:var(--mb-ink);border-color:var(--mb-ink);color:var(--mb-card);width:100%;min-height:50px;font-size:15px}
html.tj-mobile-active .tj-mb-footer{position:sticky;bottom:0;z-index:35;display:block;margin:20px 0 0;padding:10px 0 max(10px,env(safe-area-inset-bottom));background:var(--cream,#f6f4ef);border-top:1px solid var(--mb-border)}
html.tj-mobile-active .tj-mb-settings{display:grid;gap:12px;margin:0 0 18px}
html.tj-mobile-active .tj-mb-settings>div,html.tj-mobile-active .tj-mb-segments{display:flex;gap:7px;min-width:0}
html.tj-mobile-active .tj-mb-settings button,html.tj-mobile-active .tj-mb-segments button{flex:1;min-width:44px;min-height:44px;padding:10px 6px;border:1px solid var(--mb-border);border-radius:7px;color:var(--mb-ink);background:var(--mb-card);font-size:14px;touch-action:manipulation}
html.tj-mobile-active .tj-mb-settings button:disabled{opacity:.35}
html.tj-mobile-active .tj-mb-settings button[aria-pressed=true],html.tj-mobile-active .tj-mb-segments button[aria-pressed=true],html.tj-mobile-active .tj-mb-mechanisms button[aria-pressed=true],html.tj-mobile-active .tj-mb-box-tabs button[aria-pressed=true],html.tj-mobile-active .tj-mb-variant[aria-pressed=true]{border-color:var(--mb-accent);box-shadow:inset 0 0 0 1px var(--mb-accent);background:color-mix(in srgb,var(--mb-card) 92%,var(--mb-accent))}
html.tj-mobile-active .tj-mb-box-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:0 0 14px}
html.tj-mobile-active .tj-mb-box-tabs button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-height:58px;padding:7px 3px;border:1px solid var(--mb-border);border-radius:8px;color:var(--mb-ink);background:var(--mb-card);font-size:12px;line-height:1.3;touch-action:manipulation}
html.tj-mobile-active .tj-mb-box-tabs small{font-size:12px;color:var(--muted)}
html.tj-mobile-active .tj-mb-helper{font-size:13px;line-height:1.5;color:var(--muted,#70736a);margin:12px 0 14px;min-width:0;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-target-label{font-size:14px;font-weight:600;margin:0 0 18px;color:var(--mb-accent)}
html.tj-mobile-active .tj-mb-targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch}
html.tj-mobile-active .tj-mb-slot{position:relative;display:flex;flex-direction:column;align-items:center;gap:9px;min-width:0;min-height:177px;margin:0;padding:12px 9px;border:1px solid var(--mb-border);border-radius:9px;background:var(--mb-card);color:var(--mb-ink);font-size:14px;line-height:1.4;overflow:visible}
html.tj-mobile-active .tj-mb-slot.is-whole{grid-column:1/-1}
html.tj-mobile-active .tj-mb-slot-position{font-size:12px;color:var(--muted);align-self:flex-start}
html.tj-mobile-active .tj-mb-slot-caption{font-size:13px;text-align:center;line-height:1.4;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-slot-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;width:100%;margin-top:auto}
html.tj-mobile-active .tj-mb-slot-actions .tj-mb-button{flex:1;padding:8px 10px;font-size:12px;min-height:44px}
html.tj-mobile-active .tj-mb-empty{justify-content:space-between;border-style:dashed;touch-action:manipulation}
html.tj-mobile-active .tj-mb-plus{font-size:33px;font-weight:300;line-height:1;display:grid;place-items:center;width:53px;height:53px;color:var(--mb-accent);background:color-mix(in srgb,var(--mb-card) 91%,var(--mb-accent));border-radius:50%;margin:8px 0}
html.tj-mobile-active .tj-mb-art{position:relative;display:block;width:88px;height:88px;flex:none;overflow:hidden;pointer-events:none}
html.tj-mobile-active .tj-mb-art.is-half{width:44px}
html.tj-mobile-active .tj-mb-art>.normalized-sketch,html.tj-mobile-active .tj-mb-art>.custom-key-sketch,html.tj-mobile-active .tj-mb-art>.home-key-sketch{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:hidden}
html.tj-mobile-active .tj-mb-art .normalized-sketch img{position:absolute;max-width:none}
html.tj-mobile-active .tj-mb-art .normalized-sketch svg{display:block;width:100%;height:100%}
html.tj-mobile-active .tj-mb-art>.reserved-box{position:absolute;inset:0;display:grid;place-items:center;border:1px dashed var(--mb-border);font-size:12px}
html.tj-mobile-active .tj-mb-quick-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
html.tj-mobile-active .tj-mb-quick-actions .tj-mb-button{flex:1 1 135px;font-size:13px}
html.tj-mobile-active .tj-mb-error{display:block;width:100%;margin:14px 0;padding:11px 13px;border:1px solid color-mix(in srgb,var(--red,#a65b46) 55%,var(--mb-border));border-radius:7px;color:var(--red,#a65b46);font-size:13px;line-height:1.5;overflow-wrap:break-word}
html.tj-mobile-active .tj-mb-details{border-top:1px solid var(--mb-border);padding-top:13px;margin-top:16px;font-size:13px;min-width:0;max-width:100%;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-details>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;min-height:44px;max-width:100%;padding:8px 2px;line-height:1.45;list-style:none;cursor:pointer}
html.tj-mobile-active .tj-mb-details>summary::-webkit-details-marker{display:none}
html.tj-mobile-active .tj-mb-details>summary::after{content:"";display:block;width:8px;height:8px;flex:none;margin-right:4px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg)}
html.tj-mobile-active .tj-mb-details[open]>summary::after{transform:rotate(225deg)}
html.tj-mobile-active .tj-mb-details .allocation-panel{margin:0!important;padding:12px!important}
html.tj-mobile-active .tj-mb-details .allocation-row{display:flex;align-items:flex-start;flex-wrap:wrap;gap:4px 10px;min-width:0;max-width:100%}
html.tj-mobile-active .tj-mb-details .allocation-row>span{flex:1 1 135px;min-width:0;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-details .allocation-row>strong{flex:none;max-width:100%;white-space:normal}
html.tj-mobile-active .tj-mb-status{font-size:12px;line-height:1.4;color:var(--muted);margin:13px 0 0}
html.tj-mobile-active .tj-mb-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
html.tj-mobile-active .tj-mb-categories>button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-content:center;align-items:center;text-align:left;min-height:88px;padding:12px;border:1px solid var(--mb-border);border-radius:9px;background:var(--mb-card);color:var(--mb-ink);touch-action:manipulation}
html.tj-mobile-active .tj-mb-categories strong{font-size:14px;font-weight:550;line-height:1.4;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-categories small{grid-column:1;font-size:12px;color:var(--muted)}
html.tj-mobile-active .tj-mb-categories>button>span:last-child{grid-column:2;grid-row:1/3;font-size:18px}
html.tj-mobile-active .tj-mb-quota{display:inline-flex;align-items:center;gap:6px;max-width:100%;min-width:0;font-size:12px;font-weight:600;line-height:1.4;color:var(--muted)}
html.tj-mobile-active .tj-mb-quota.is-missing,html.tj-mobile-active .tj-mb-quota.is-excess{color:var(--tj-required-ink)}
html.tj-mobile-active .tj-mb-quota-mark{display:inline-grid;place-items:center;width:15px;height:15px;flex:none;border:1px solid currentColor;border-radius:50%;font-size:10px;font-weight:700;line-height:1}
html.tj-mobile-active .tj-mb-quota.is-complete .tj-mb-quota-mark{border-color:transparent}
html.tj-mobile-active .tj-mb-categories>button>.tj-mb-quota{grid-column:1;grid-row:auto}
html.tj-mobile-active .tj-mb-categories>button[data-mb-quota="missing"],html.tj-mobile-active .tj-mb-categories>button[data-mb-quota="excess"],html.tj-mobile-active .tj-mb-variant[data-mb-quota="missing"]:not([aria-pressed="true"]),html.tj-mobile-active .tj-mb-variant[data-mb-quota="excess"]:not([aria-pressed="true"]){border-color:var(--tj-required-line)}
html.tj-mobile-active .tj-mb-group-quota{margin:-7px 0 12px;min-width:0}
html.tj-mobile-active .tj-mb-group-quota:empty{display:none}
html.tj-mobile-active .tj-mb-group-quota .tj-mb-quota{font-size:13px}
html.tj-mobile-active .tj-mb-categories>button[disabled][data-mb-quota]:not([data-mb-quota="optional"]),html.tj-mobile-active .tj-mb-variant[disabled][data-mb-quota]:not([data-mb-quota="optional"]){opacity:1}
html.tj-mobile-active .tj-mb-categories>button[disabled][data-mb-quota]:not([data-mb-quota="optional"])>strong,html.tj-mobile-active .tj-mb-categories>button[disabled][data-mb-quota]:not([data-mb-quota="optional"])>.tj-mb-category-arrow,html.tj-mobile-active .tj-mb-variant[disabled][data-mb-quota]:not([data-mb-quota="optional"])>.tj-mb-art,html.tj-mobile-active .tj-mb-variant[disabled][data-mb-quota]:not([data-mb-quota="optional"])>strong{opacity:.5}
html.tj-mobile-active .tj-mb-variants{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;scrollbar-width:none;padding:3px 2px 12px;margin:12px -2px 0;overscroll-behavior-x:contain;touch-action:pan-x pan-y;max-height:none;height:auto}
html.tj-mobile-active .tj-mb-variants::-webkit-scrollbar{display:none}
html.tj-mobile-active .tj-mb-variant{flex:0 0 calc((100% - 14px)/2.2);min-width:130px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:10px;min-height:215px;padding:14px 10px;border:1px solid var(--mb-border);border-radius:9px;background:var(--mb-card);color:var(--mb-ink);scroll-snap-align:start;touch-action:pan-x pan-y}
html.tj-mobile-active .tj-mb-variant>.tj-mb-art{height:96px;width:96px}
html.tj-mobile-active .tj-mb-variant>.tj-mb-art.is-half{width:48px}
html.tj-mobile-active .tj-mb-variant strong{font-size:13px;font-weight:550;line-height:1.4;text-align:center;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-variant small{font-size:12px;color:var(--muted);line-height:1.35}
html.tj-mobile-active .tj-mb-variant .tj-mb-unavailable{font-size:11px;color:var(--red);margin-top:auto}
html.tj-mobile-active .tj-mb-variant-info{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--mb-border);margin:6px 0 0;padding:8px 0;font-size:13px;color:var(--muted)}
html.tj-mobile-active .tj-mb-variant-info .extra-info{position:relative;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-color:transparent;background:transparent;font-size:14px}
html.tj-mobile-active .tj-mb-variant-info .extra-info:before{content:'';position:absolute;inset:7px;border:1px solid currentColor;border-radius:50%;pointer-events:none}
html.tj-mobile-active .tj-mb-choice-group{border:0;margin:0 0 16px;padding:0;min-width:0}
html.tj-mobile-active .tj-mb-choice-group legend{font-size:13px;font-weight:600;margin-bottom:9px;padding:0}
html.tj-mobile-active .tj-mb-mechanisms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
html.tj-mobile-active .tj-mb-mechanisms>div{display:flex;align-items:center;gap:5px;min-width:0}
html.tj-mobile-active .tj-mb-mechanisms>div>button{flex:1;min-width:0;min-height:46px;padding:8px 6px;border:1px solid var(--mb-border);border-radius:7px;color:var(--mb-ink);background:var(--mb-card);font-size:13px;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-mechanisms .extra-info{position:relative;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-color:transparent;background:transparent;font-size:14px}
html.tj-mobile-active .tj-mb-mechanisms .extra-info:before{content:'';position:absolute;inset:7px;border:1px solid currentColor;border-radius:50%;pointer-events:none}
html.tj-mobile-active .tj-mb-preview{display:flex;justify-content:center;align-items:center;min-width:0;padding:18px 5px;margin-bottom:20px;border:1px solid var(--mb-border);border-radius:9px;background:color-mix(in srgb,var(--mb-card) 87%,var(--mb-accent))}
html.tj-mobile-active .tj-mb-preview .frame-preview{position:relative!important;display:block!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:var(--frame-ratio)!important;margin:0!important;padding:0!important;flex:none!important}
html.tj-mobile-active .tj-mb-preview.is-vertical .frame-preview{width:min(150px,100%)!important}
html.tj-mobile-active .tj-mb-preview-legend{min-width:0;max-width:100%}
html.tj-mobile-active .tj-mb-preview-legend .box-legend{display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--mb-border);padding:13px 0;font-size:13px;line-height:1.5;min-width:0;max-width:100%;overflow-wrap:anywhere}
html.tj-mobile-active .tj-mb-preview-legend .box-legend strong{font-weight:600}
html.tj-mobile-active .tj-mb-label{display:block;font-size:14px;font-weight:550;line-height:1.5;margin:18px 0 8px}
html.tj-mobile-active .tj-mb-input{display:block;width:100%;min-width:0;min-height:48px;padding:12px;border:1px solid var(--mb-border);border-radius:7px;background:var(--mb-card);color:var(--mb-ink);font-size:16px;line-height:1.5}
html.tj-mobile-active .tj-mb-input:focus{outline:2px solid var(--mb-accent);outline-offset:2px}
html.tj-mobile-active .tj-mobile-builder .mechanism-repairs{margin-top:14px;font-size:13px}
html.tj-mobile-active .tj-mobile-builder .mechanism-repairs h4{font-size:15px}
html.tj-mobile-active .tj-mobile-builder .mechanism-repairs select{width:100%;min-height:46px;margin-top:8px}
html.tj-mobile-active .tj-mb-face-controls select{display:block;width:100%;max-width:100%;min-height:48px;margin:8px 0 14px}
html.tj-mobile-active .tj-mb-face-controls h4{font-size:15px;line-height:1.4;margin:10px 0}
html.tj-mobile-active .tj-mb-face-controls .help{font-size:13px;line-height:1.5}
html.tj-mobile-active.tj-mobile-keyboard .tj-mb-footer{position:static}
html.tj-mobile-active .tj-mobile-builder .usb-series-tip{font-size:13px;padding:12px;margin-top:12px}
@media (max-width:340px){
 html.tj-mobile-active .tj-mb-toolbar{gap:7px}
 html.tj-mobile-active .tj-mb-toolbar strong{font-size:14px}
 html.tj-mobile-active .tj-mb-categories>button{padding:10px}
 html.tj-mobile-active .tj-mb-categories strong{font-size:13px}
 html.tj-mobile-active .tj-mb-mechanisms{grid-template-columns:1fr}
}
