/* ==========================================================================
   FiveMRides MLO Studio - scoped to .fms
   Shared Studio components (top bar, buttons, cards, rail, fields, viewport
   frame, toasts) come from fmr-studio-ui.css (.fsu-*), loaded first. This sheet
   keeps the MLO Studio layout: rail | tabs + panel | 3D viewport | properties,
   room lighting, export. Same spacing and tokens as the Shell Studio.
   ========================================================================== */

html.fms-lock, html.fms-lock body { overflow: hidden !important; }
.fms {
    position: fixed; inset: 0; z-index: 2147483000; height: 100vh; height: 100dvh;
    color: var(--fsu-text); font: 500 13px/1.45 var(--fsu-font);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(168, 85, 247, .10), transparent 60%),
        radial-gradient(900px 500px at 100% 120%, rgba(0, 240, 255, .06), transparent 60%),
        var(--fsu-bg);
    isolation: isolate; -webkit-font-smoothing: antialiased; text-align: left;
}
.fms *, .fms *::before, .fms *::after { box-sizing: border-box; }
.fms [hidden] { display: none !important; }
:where(.fms) button, :where(.fms) input, :where(.fms) select, :where(.fms) textarea { font: inherit; color: inherit; }
.fms button { text-transform: none; letter-spacing: normal; text-shadow: none; min-height: 0; min-width: 0; margin: 0; line-height: 1.2; }
.fms button:focus { outline: none; }
.fms button:focus-visible, .fms input:focus-visible, .fms [role=button]:focus-visible { outline: 2px solid rgba(0, 240, 255, .7); outline-offset: 2px; }
.fms a { color: var(--fsu-cyan); }
.fms a.fsu-btn { color: var(--fsu-text); text-decoration: none; }
.fms h1, .fms h2, .fms h3, .fms h4 { margin: 0; color: var(--fsu-text); letter-spacing: 0; text-transform: none; }
.fms p { margin: 0; }
.fms code { font: 600 11px/1.4 var(--fsu-mono); color: #bff6ff; background: rgba(0, 240, 255, .06); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.fms kbd { font: 600 9px/1 var(--fsu-mono); }
.fms ol, .fms ul { margin: 0; }
.fms-app { height: 100%; display: flex; flex-direction: column; position: relative; }

/* ------------------------------------------------------------------ top bar */
.fms-top { gap: 10px; }
.fms .fsu-brand { text-decoration: none; color: var(--fsu-text); }
.fms-project { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-left: 6px; padding-left: 14px; border-left: 1px solid var(--fsu-line); }
.fms .fms-name { width: min(300px, 24vw); height: 22px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--fsu-text); font: 700 14.5px/1 var(--fsu-display); outline: none; box-shadow: none; }
.fms .fms-name:hover:not(:disabled) { border-color: var(--fsu-line2); }
.fms .fms-name:focus { border-color: rgba(0, 240, 255, .55); background: var(--fsu-bg2); }
.fms .fms-name::placeholder { color: var(--fsu-dim); }
.fms-save { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fsu-muted); white-space: nowrap; }
.fms-save i { width: 6px; height: 6px; border-radius: 50%; background: var(--fsu-warn); }
.fms-save.is-saved i { background: var(--fsu-good); }
.fms-save.is-saving i { background: var(--fsu-cyan); animation: fms-pulse 1s infinite; }
.fms-save.is-error i { background: var(--fsu-bad); }
.fms-save.is-error { color: var(--fsu-bad); }
.fms-save.is-idle i { background: var(--fsu-dim); }
.fms-topbtns { display: flex; align-items: center; gap: 4px; }
.fms .fsu-credits { text-decoration: none; }

/* ------------------------------------------------------------------ layout */
.fms-main { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 10px; grid-template-columns: 54px clamp(280px, 19.5vw, 340px) minmax(0, 1fr) clamp(272px, 19vw, 330px); }
.fms-left { min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.fms-right { min-height: 0; }
.fms-right > .fsu-card { min-width: 0; }
.fms-panel { flex: 1; min-height: 0; }
.fms-rail { align-self: start; }

.fms-tabbar { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 4px; border-radius: var(--fsu-r); border: 1px solid var(--fsu-line); background: var(--fsu-card-bg); }
.fms .fms-tabbar button { position: relative; box-shadow: none; display: grid; justify-items: center; gap: 4px; padding: 8px 2px 7px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--fsu-muted); cursor: pointer; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; transition: all .15s; }
.fms .fms-tabbar button .fsu-i { width: 18px; height: 18px; }
.fms .fms-tabbar button:hover { color: var(--fsu-text); background: rgba(255, 255, 255, .04); }
.fms .fms-tabbar button.is-on { color: #fff; background: linear-gradient(135deg, rgba(255, 47, 158, .26), rgba(168, 85, 247, .26)); border-color: rgba(255, 47, 158, .5); box-shadow: 0 0 16px rgba(255, 47, 158, .18); }
.fms-tabn { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--fsu-pink); color: #fff; font: 700 9.5px/16px var(--fsu-mono); font-style: normal; }
.fms-tabn:empty { display: none; }

/* fields */
.fms-field-label { display: block; font: 700 10.5px/1 var(--fsu-display); letter-spacing: .14em; text-transform: uppercase; color: var(--fsu-dim); margin: 2px 0 -3px; }
.fms .fms-input { width: 100%; height: 32px; padding: 0 10px; border-radius: var(--fsu-r-sm); border: 1px solid var(--fsu-line); background: var(--fsu-bg2); color: var(--fsu-text); outline: none; box-shadow: none; font-size: 12.5px; }
.fms select.fms-input { appearance: auto; }
.fms .fms-input:focus { border-color: rgba(0, 240, 255, .55); box-shadow: 0 0 0 3px rgba(0, 240, 255, .1); }
.fms .fms-mono { font: 600 12px var(--fsu-mono); }
.fms-row2 { display: flex; align-items: center; gap: 6px; }
.fms-row2 > .fms-input { flex: 1; min-width: 0; }
.fms-row2 .fms-field-label { margin: 0; flex: none; }
.fms-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fms-chips .fsu-chip { height: 26px; font-size: 11.5px; }
.fms-err { color: #fca5a5; font-size: 12px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; }
.fms-ok { color: #a7f3d0; font-size: 12px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; }
.fms-warn { color: #fcd34d; font-size: 12px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; }
.fms-err .fsu-i, .fms-ok .fsu-i, .fms-warn .fsu-i { width: 14px; height: 14px; margin-top: 1px; }
.fms-state { display: grid; justify-items: center; gap: 10px; padding: 26px 8px; text-align: center; color: var(--fsu-muted); font-size: 12.5px; }
.fms-state.is-bad { color: #fca5a5; }
.fms-state .fsu-i { width: 22px; height: 22px; }
.fms .fms-link { border: 0; background: none; padding: 0; color: var(--fsu-cyan); cursor: pointer; font-size: 12px; box-shadow: none; }
.fms .fms-danger:hover { border-color: rgba(248, 113, 113, .6); color: #fecaca; background: rgba(248, 113, 113, .08); }

/* objects list */
.fms-objects { min-height: 0; height: 100%; }
.fms-olist { flex: 1; min-height: 140px; overflow-y: auto; position: relative; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: #2a3448 transparent; outline: none; }
.fms-olist-sizer { position: relative; }
.fms-olist .fsu-row, .fms-ohead { position: absolute; left: 0; right: 0; height: 32px; }
.fms-ohead { display: flex; align-items: center; gap: 6px; padding: 0 6px; cursor: pointer; font: 700 10.5px/1 var(--fsu-display); letter-spacing: .12em; text-transform: uppercase; color: #c9d2e0; border-bottom: 1px solid var(--fsu-line); }
.fms-ohead .fsu-i { width: 13px; height: 13px; color: var(--fsu-dim); transition: transform .15s; }
.fms-ohead.is-col .fsu-i:first-child { transform: rotate(-90deg); }
.fms-ohead span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fms-ohead em { font: 600 10.5px var(--fsu-mono); font-style: normal; letter-spacing: 0; color: var(--fsu-cyan); }
.fms .fms-oh-sel { box-shadow: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--fsu-dim); cursor: pointer; opacity: 0; }
.fms-ohead:hover .fms-oh-sel { opacity: 1; }
.fms .fms-oh-sel:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.fms-orow { gap: 4px !important; }
.fms-orow.is-on { background: rgba(0, 229, 255, .09); box-shadow: inset 2px 0 0 #18e0ff; }
.fms-orow.is-hidden .fms-oname { opacity: .45; }
.fms-oname { flex: 1; min-width: 0; display: grid; line-height: 1.15; }
.fms-oname span { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dfe6f1; }
.fms-oname small { font: 500 10px var(--fsu-mono); color: var(--fsu-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-orow.is-on .fms-oname span { color: #bff6ff; }
.fms-orow.is-missing .fms-oname span { color: #ffd59a; }
.fms .fms-ob { box-shadow: none; display: grid; place-items: center; width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--fsu-dim); cursor: pointer; }
.fms .fms-ob .fsu-i { width: 14px; height: 14px; }
.fms .fms-ob:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.fms .fms-ob.is-lock { color: #fbbf24; }
.fms-tag { flex: none; font: 700 8.5px/1 var(--fsu-display); font-style: normal; letter-spacing: .12em; text-transform: uppercase; padding: 3px 5px 2px; border-radius: 5px; }
.fms-tag.is-new { color: #34d399; background: rgba(52, 211, 153, .1); }
.fms-tag.is-ch { color: #18e0ff; background: rgba(24, 224, 255, .1); }

/* rooms */
.fms-rooms { min-height: 100px; }
.fms-room { gap: 8px; }
.fms-room.is-on { background: rgba(0, 229, 255, .08); }
.fms-room-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: linear-gradient(135deg, #a855f7, #ff2f9e); }
.fms-room.is-on .fms-room-dot { background: #18e0ff; box-shadow: 0 0 8px #18e0ff; }
.fms-room-txt { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.fms-room-txt span { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-room-txt small { font-size: 10.5px; color: var(--fsu-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-sets { display: grid; gap: 6px; }
.fms-set { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 10px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); }
.fms-set > div { flex: 1; min-width: 0; display: grid; }
.fms-set b { font: 600 12px var(--fsu-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-set small { font-size: 10.5px; color: var(--fsu-dim); }

/* add */
.fms-add { min-height: 0; height: 100%; }
.fms-addbody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.fms-swapbar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: 10px; border: 1px solid rgba(0, 240, 255, .45); background: rgba(0, 240, 255, .07); font-size: 12px; color: #cffaff; }
.fms-swapbar span { flex: 1; min-width: 0; }
.fms-catchips { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; flex: none; }
.fms-catchips .fsu-chip { height: 26px; flex: none; font-size: 11.5px; display: inline-flex; align-items: center; gap: 4px; }
.fms-catchips .fsu-chip .fsu-i { width: 12px; height: 12px; }
.fms-catchips em { font-style: normal; font: 600 10px var(--fsu-mono); color: var(--fsu-dim); margin-left: 2px; }
.fms-catchips .is-on em { color: #ffd0e8; }
.fms-vgrid { flex: 1; min-height: 160px; overflow-y: auto; position: relative; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: #2a3448 transparent; }
.fms-vgrid-sizer { position: relative; }
.fms .fms-prop { position: absolute; display: grid; grid-template-rows: auto auto auto; gap: 2px; padding: 0 0 4px; cursor: pointer; color: var(--fsu-text); outline: none; }
.fms-prop-img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--fsu-line); background: radial-gradient(ellipse 70% 70% at 50% 60%, rgba(120, 70, 220, .16), transparent 70%), linear-gradient(180deg, #121828, #0a0d15); transition: border-color .15s, transform .15s var(--fsu-ease); }
.fms-prop-img img { width: 88%; height: 88%; object-fit: contain; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.fms-noimg { font: 700 18px var(--fsu-display); font-style: normal; color: var(--fsu-dim); text-transform: uppercase; }
.fms .fms-prop:hover .fms-prop-img, .fms .fms-prop:focus-visible .fms-prop-img { border-color: rgba(255, 47, 158, .55); transform: translateY(-2px); }
.fms .fms-prop b { font-size: 11px; font-weight: 600; line-height: 1.25; color: #cdd5e2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fms .fms-prop small { font: 500 9.5px var(--fsu-mono); color: var(--fsu-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms .fms-star { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; padding: 3px; border: 0; border-radius: 7px; background: rgba(6, 8, 14, .6); cursor: pointer; box-shadow: none; opacity: 0; transition: opacity .15s; }
.fms .fms-star svg { width: 100%; height: 100%; fill: none; stroke: #cdd5e2; stroke-width: 1.8; stroke-linejoin: round; }
.fms .fms-prop:hover .fms-star, .fms .fms-star.is-on { opacity: 1; }
.fms .fms-star.is-on svg { fill: #fbbf24; stroke: #fbbf24; }
.fms-byname-info { min-height: 20px; }

/* changes (W1) */
.fms-changes { min-height: 0; height: 100%; }
.fms-chlist { min-height: 120px; }
.fms .fms-chrow { align-items: flex-start; padding-top: 7px; padding-bottom: 7px; gap: 9px; }
.fms-chdot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; flex: none; background: #18e0ff; }
.fms-chrow.is-remove .fms-chdot { background: #f87171; }
.fms-chrow.is-add .fms-chdot { background: #34d399; }
.fms-chrow.is-swap .fms-chdot { background: #c084fc; }
.fms-chrow.is-mood .fms-chdot { background: #fbbf24; }
.fms-chtext { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fms-chtext span { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: #dfe6f1; }
.fms-chtext small { font: 500 10px var(--fsu-mono); color: var(--fsu-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms .fms-revert-all.is-confirm { color: #fecaca; }
.fms-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fms-sum div { display: grid; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--fsu-bg2); border: 1px solid var(--fsu-line); text-align: center; min-width: 0; }
.fms-sum b { font: 700 17px/1 var(--fsu-display); color: #fff; }
.fms-sum span { font-size: 9.5px; color: var(--fsu-dim); text-transform: uppercase; letter-spacing: .07em; }

/* ------------------------------------------------------------------ viewport */
.fms-vp { position: relative; }
.fms-vp-host { position: absolute; inset: 0; }
.fms-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.fms-overlay { position: absolute; inset: 0; pointer-events: none; }
.fms-vp-host[data-armed] { cursor: copy; }
.fms-views-pill { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2; background: rgba(8, 10, 17, .78); backdrop-filter: blur(10px); border-color: var(--fsu-line2); box-shadow: 0 8px 26px rgba(0, 0, 0, .35); }
.fms .fms-views-pill button { height: 30px; padding: 0 12px; }
.fms-vtools { position: absolute; top: 12px; right: 12px; z-index: 2; }
.fms-snap { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 12px; background: rgba(8, 10, 17, .78); border: 1px solid var(--fsu-line2); backdrop-filter: blur(10px); font-size: 11px; color: var(--fsu-muted); }
.fms .fms-snap select { height: 26px; padding: 0 4px; border-radius: 7px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); color: var(--fsu-text); font: 600 11px var(--fsu-mono); outline: none; }
.fms .fms-space { box-shadow: none; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); color: #cffaff; font: 600 11px var(--fsu-font); cursor: pointer; }
.fms-cut { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px; background: rgba(8, 10, 17, .8); border: 1px solid var(--fsu-line2); font-size: 12px; color: var(--fsu-muted); backdrop-filter: blur(10px); }
.fms .fms-cut input { width: 180px; accent-color: #00e5ff; }
.fms-cut output { font: 600 11px var(--fsu-mono); color: #9ff4ff; min-width: 52px; }
.fms-loadbar { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 2; display: grid; gap: 5px; width: min(420px, calc(100% - 40px)); padding: 9px 14px 10px; border-radius: 12px; background: rgba(8, 10, 17, .82); border: 1px solid var(--fsu-line2); backdrop-filter: blur(10px); font: 600 11px var(--fsu-mono); color: #b9c3d3; text-align: center; }
.fms-loadbar i, .fms-upbar i { display: block; height: 4px; border-radius: 9px; background: var(--fsu-panel3); overflow: hidden; }
.fms-loadbar em, .fms-upbar em { display: block; height: 100%; width: 0; border-radius: 9px; background: var(--fsu-grad); transition: width .3s var(--fsu-ease); }
.fms-notice { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 12px; width: min(680px, calc(100% - 32px)); padding: 10px 12px 10px 14px; border-radius: 14px; border: 1px solid rgba(251, 191, 36, .45); background: rgba(20, 16, 6, .92); backdrop-filter: blur(12px); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); color: #fde68a; font-size: 12.5px; line-height: 1.45; }
.fms-notice > .fsu-i { width: 18px; height: 18px; color: #fbbf24; }
.fms-notice p { flex: 1; min-width: 0; }
.fms-notice > div { display: flex; gap: 4px; flex: none; }
.fms-walkhelp { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-radius: 999px; background: rgba(8, 10, 17, .8); border: 1px solid rgba(0, 240, 255, .35); font-size: 12px; color: #cfd7e3; white-space: nowrap; }
.fms-walkhelp b { color: #9ff4ff; }
.fms-app[data-view="walk"] .fms-vp::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); pointer-events: none; }
.fms-app[data-view="walk"] .fms-snap, .fms-app[data-view="walk"] .fms-cut { display: none; }
.fms-hintbar { position: absolute; left: 60px; right: 120px; bottom: 12px; display: flex; justify-content: center; pointer-events: none; z-index: 2; }
.fms-hint { max-width: 760px; padding: 7px 14px; border-radius: 999px; background: rgba(8, 10, 17, .72); border: 1px solid var(--fsu-line); color: #b9c3d3; font-size: 12px; backdrop-filter: blur(8px); text-align: center; transition: border-color .3s, color .3s; }
.fms-hint:empty { display: none; }
.fms-hint.is-flash { border-color: rgba(52, 211, 153, .55); color: #d1fae5; }
.fms-tip { z-index: 3; }
.fms-fps { position: absolute; right: 14px; bottom: 16px; font: 600 10.5px var(--fsu-mono); color: var(--fsu-dim); z-index: 2; pointer-events: none; }
.fms-ro { position: absolute; left: 10px; right: 10px; bottom: 50px; padding: 8px 12px; border-radius: 10px; background: rgba(8, 10, 17, .85); border: 1px solid rgba(251, 191, 36, .4); color: #fde68a; font-size: 12px; text-align: center; z-index: 3; }
.fms-loading { z-index: 5; }
.fms-loading span { max-width: 460px; text-align: center; padding: 0 20px; }
.fms-empty { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.fms-empty-card { max-width: 420px; text-align: center; display: grid; justify-items: center; gap: 12px; padding: 28px 30px; border-radius: 22px; background: linear-gradient(160deg, rgba(26, 33, 49, .9), rgba(12, 16, 25, .92)); border: 1px solid var(--fsu-line2); box-shadow: var(--fsu-shadow); }
.fms-empty-icon { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: var(--fsu-grad); color: #fff; box-shadow: 0 12px 36px rgba(255, 47, 158, .35); }
.fms-empty-icon .fsu-i { width: 28px; height: 28px; }
.fms .fms-empty-card h2 { font: 700 24px/1.1 var(--fsu-display); }
.fms-empty-card p { color: var(--fsu-muted); line-height: 1.55; }

/* ------------------------------------------------------------------ right column */
.fms-props { min-height: 120px; }
.fms-selname { display: grid; gap: 4px; min-width: 0; }
.fms-selname b { font: 700 16px/1.2 var(--fsu-display); color: #fff; overflow-wrap: anywhere; }
.fms-selname code { justify-self: start; }
.fms-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.fms-badge { font: 700 9px/1 var(--fsu-display); font-style: normal; letter-spacing: .12em; text-transform: uppercase; padding: 4px 6px 3px; border-radius: 6px; color: #c9d2e0; background: rgba(255, 255, 255, .05); border: 1px solid var(--fsu-line2); }
.fms-badge.is-new { color: #34d399; border-color: rgba(52, 211, 153, .35); }
.fms-badge.is-ch { color: #18e0ff; border-color: rgba(24, 224, 255, .35); }
.fms-badge.is-warn { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.fms-badge.is-bad { color: #f87171; border-color: rgba(248, 113, 113, .4); }
.fms-xyz { display: grid; grid-template-columns: 62px repeat(3, minmax(0, 1fr)) 26px; gap: 5px; align-items: end; }
.fms-xyz > span { font: 700 10px/1 var(--fsu-display); letter-spacing: .12em; text-transform: uppercase; color: var(--fsu-dim); align-self: center; padding-top: 14px; }
.fms-xyz > em { font: 600 10px var(--fsu-mono); font-style: normal; color: var(--fsu-dim); align-self: center; padding-top: 14px; }
.fms .fms-xyz label { display: grid; gap: 2px; font-size: 9.5px; font-weight: 700; color: var(--fsu-dim); min-width: 0; }
.fms .fms-xyz input { width: 100%; height: 28px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); color: var(--fsu-text); font: 600 11.5px var(--fsu-mono); outline: none; box-shadow: none; }
.fms .fms-xyz input:focus { border-color: rgba(0, 240, 255, .55); }
.fms-xyz2 { grid-template-columns: 62px repeat(2, minmax(0, 1fr)) 26px; }
.fms-xyz label:nth-of-type(1) { color: #f87171; } .fms-xyz label:nth-of-type(2) { color: #34d399; } .fms-xyz label:nth-of-type(3) { color: #60a5fa; }
.fms-xyz2 label { color: var(--fsu-dim) !important; }
.fms-actgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fms-actgrid .fsu-btn { justify-content: flex-start; }
.fms-roomhint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(0, 240, 255, .35); background: rgba(0, 240, 255, .06); font-size: 12px; color: #cffaff; }
.fms-roomhint > .fsu-i { width: 15px; height: 15px; }
.fms-roomhint span { flex: 1; min-width: 140px; }
.fms-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; color: var(--fsu-muted); }
.fms-kv b { color: var(--fsu-text); font: 600 12px var(--fsu-mono); text-align: right; }
.fms-warns p, .fms-exwarn, .fms-exerr { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; line-height: 1.45; color: #fcd34d; }
.fms-exwarn { color: #cdd5e2; }
.fms-exwarn .fsu-i { color: var(--fsu-cyan); }
.fms-exerr { color: #fca5a5; }
.fms-warns .fsu-i, .fms-exwarn .fsu-i, .fms-exerr .fsu-i { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.fms-warns { display: grid; gap: 6px; }
.fms-moods { display: grid; grid-auto-rows: max-content; gap: 5px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.fms .fms-mood { box-shadow: none; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; gap: 1px 8px; align-items: center; align-content: center; min-height: 42px; flex: none; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); cursor: pointer; text-align: left; color: var(--fsu-text); }
.fms .fms-mood:hover { border-color: var(--fsu-line2); }
.fms .fms-mood.is-on { border-color: rgba(255, 47, 158, .6); background: rgba(255, 47, 158, .08); box-shadow: 0 0 14px rgba(255, 47, 158, .16); }
.fms-mood i { grid-row: 1 / 3; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #c9d2e0); }
.fms-mood.is-warm i { background: radial-gradient(circle at 35% 35%, #fff3df, #ff9f4a); }
.fms-mood.is-cold i { background: radial-gradient(circle at 35% 35%, #f0f7ff, #5aa0ff); }
.fms-mood.is-dark i { background: radial-gradient(circle at 35% 35%, #8a93a8, #232733); }
.fms-mood.is-bright i { background: radial-gradient(circle at 35% 35%, #ffffff, #fff7c2); box-shadow: 0 0 10px rgba(255, 255, 220, .6); }
.fms-mood.is-green i { background: radial-gradient(circle at 35% 35%, #efffe6, #5fbf5a); }
.fms-mood span { font-size: 12px; font-weight: 600; line-height: 1.25; }
.fms-mood small { line-height: 1.2; }
.fms-mood small { font: 500 10px var(--fsu-mono); color: var(--fsu-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* export */
.fms-exportcard { border-color: rgba(255, 47, 158, .28); background: linear-gradient(180deg, rgba(40, 18, 44, .55), rgba(14, 18, 27, .92)); }
.fms-exlines { list-style: none; padding: 0; display: grid; gap: 4px; }
.fms .fms-exlines li { position: relative; padding-left: 14px; font-size: 12px; color: #cdd5e2; line-height: 1.35; }
.fms-exlines li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #18e0ff; }
.fms-exlines li.is-remove::before { background: #f87171; } .fms-exlines li.is-add::before { background: #34d399; } .fms-exlines li.is-swap::before { background: #c084fc; } .fms-exlines li.is-mood::before { background: #fbbf24; }
.fms-exlines li.is-more::before { display: none; }
.fms-price { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #cdd5e2; }
.fms-price .fsu-i { width: 15px; height: 15px; color: var(--fsu-cyan); }
.fms-devnote { color: #fcd34d; }
.fms-progress { display: grid; justify-items: center; gap: 10px; padding: 6px 0; }
.fms-ring { position: relative; width: 108px; height: 108px; }
.fms-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fms-ring circle { fill: none; stroke: var(--fsu-panel3); stroke-width: 8; }
.fms-ring circle.is-val { stroke: #ff2f9e; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .6s var(--fsu-ease); filter: drop-shadow(0 0 6px rgba(255, 47, 158, .6)); }
.fms-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 22px var(--fsu-display); }
.fms-progress-msg { color: #cdd5e2; text-align: center; font-size: 12px; }
.fms-exdone { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--fsu-line); }
.fms-exdone-head { display: flex; align-items: center; gap: 8px; color: #a7f3d0; }
.fms-exdone-head .fsu-i { width: 18px; height: 18px; }
.fms-exdone-head b { font: 700 15px var(--fsu-display); }
.fms-exstats { display: flex; flex-wrap: wrap; gap: 5px; }
.fms-exstats span { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--fsu-line2); font: 600 10.5px var(--fsu-mono); color: var(--fsu-muted); }

/* ------------------------------------------------------------------ modals */
.fms-modal { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 10, .72); backdrop-filter: blur(4px); animation: fms-fade .2s; }
.fms-modal-card { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 18px; border: 1px solid var(--fsu-line2); background-color: var(--fsu-panel); background-image: var(--fsu-card-bg); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.fms-modal-card.is-over { border-color: var(--fsu-cyan); box-shadow: 0 0 0 4px rgba(0, 240, 255, .12), 0 30px 90px rgba(0, 0, 0, .6); }
.fms-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.fms .fms-modal-head h2 { font: 700 21px/1.15 var(--fsu-display); }
.fms-modal-body { padding: 4px 18px 18px; overflow-y: auto; display: grid; gap: 12px; }
.fms-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--fsu-line); }
.fms-modal-start .fms-modal-card { width: min(1080px, 100%); }
.fms-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.fms-start-new, .fms-start-list { display: grid; gap: 12px; align-content: start; }
.fms-steps { list-style: none; padding: 0; display: grid; gap: 6px; }
.fms .fms-steps li { display: flex; align-items: center; gap: 10px; font: 600 13px var(--fsu-font); color: var(--fsu-dim); }
.fms-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--fsu-font); background: var(--fsu-panel3); color: var(--fsu-muted); }
.fms .fms-steps li.is-on { color: #fff; }
.fms-steps li.is-on span { background: var(--fsu-grad); color: #fff; box-shadow: 0 0 14px rgba(255, 47, 158, .4); }
.fms .fms-steps li.is-done { color: var(--fsu-good); }
.fms-steps li.is-done span { background: rgba(52, 211, 153, .15); color: var(--fsu-good); }
.fms-send { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; padding: 16px; border-radius: 16px; border: 1px solid var(--fsu-line2); background: linear-gradient(160deg, rgba(26, 33, 49, .9), rgba(12, 16, 25, .9)); }
.fms-send-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--fsu-grad); color: #fff; box-shadow: 0 10px 30px rgba(255, 47, 158, .3); }
.fms-send-txt { display: grid; gap: 3px; }
.fms-send-txt b { font: 700 15px var(--fsu-display); }
.fms-send-txt small { color: var(--fsu-muted); font-size: 12px; line-height: 1.5; }
.fms-send label { grid-column: 1 / -1; justify-self: start; cursor: pointer; }
.fms-send label[aria-disabled] { opacity: .45; pointer-events: none; }
.fms-send-state { display: grid; gap: 10px; }
.fms-upbar { display: grid; gap: 6px; font: 600 11px var(--fsu-mono); color: #b9c3d3; }
.fms-ints { display: grid; gap: 6px; }
.fms .fms-int { box-shadow: none; display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); cursor: pointer; text-align: left; color: var(--fsu-text); }
.fms .fms-int:hover { border-color: var(--fsu-line2); }
.fms .fms-int.is-on { border-color: rgba(255, 47, 158, .6); background: rgba(255, 47, 158, .07); }
.fms .fms-int.is-off { opacity: .6; cursor: default; }
.fms-int b { font: 700 14px var(--fsu-display); }
.fms-int small { font-size: 11.5px; color: var(--fsu-muted); }
.fms-int.is-off small { color: #fca5a5; }
.fms-int code { justify-self: start; margin-top: 2px; }
.fms-plist { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; scrollbar-width: thin; }
.fms-proj { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1px solid var(--fsu-line); background: var(--fsu-bg2); }
.fms-proj.is-on { border-color: rgba(0, 240, 255, .45); }
.fms-proj-img { width: 88px; height: 55px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: var(--fsu-dim); background: radial-gradient(ellipse 70% 70% at 50% 60%, rgba(120, 70, 220, .2), transparent 70%), linear-gradient(180deg, #0f1320, #090b12); }
.fms-proj-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fms-proj-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fms-proj-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-proj-txt small { color: var(--fsu-dim); font-size: 11px; }
.fms-proj-act { display: flex; gap: 4px; align-items: center; }
.fms .fms-proj .is-confirm { color: var(--fsu-bad); }
.fms-modal-keys .fms-modal-card { width: min(900px, 100%); }
.fms-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; }
.fms .fms-keys h4 { font: 700 11.5px/1 var(--fsu-display); letter-spacing: .16em; text-transform: uppercase; color: var(--fsu-pink); margin-bottom: 8px; }
.fms-keys p { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: #cdd5e2; margin-bottom: 5px; }
.fms .fms-keys kbd { flex: none; min-width: 72px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--fsu-line2); background: var(--fsu-bg2); font-size: 10.5px; color: #fff; text-align: center; }

@keyframes fms-pulse { 50% { opacity: .35; } }
@keyframes fms-fade { from { opacity: 0; } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1500px) { .fms .fms-views-pill button span { display: none; } .fms .fms-views-pill button { padding: 0 10px; } }
@media (max-width: 1280px) {
    .fms-main { grid-template-columns: 50px 266px minmax(0, 1fr) 256px; gap: 8px; padding: 8px; }
    .fms .fms-topbtns .fsu-btn span { display: none; }
    .fms-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fms-snap > span { display: none; }
}
@media (max-width: 899px) {
    html.fms-lock, html.fms-lock body { overflow: auto !important; }
    .fms { overflow-y: auto; overflow-x: hidden; }
    .fms-app { height: auto; min-height: 100%; }
    .fms-main { display: flex; flex-direction: column; padding: 8px; gap: 8px; }
    .fms-rail, .fms-left, .fms-topbtns [data-act=undo], .fms-topbtns [data-act=redo], .fms-topbtns .fsu-vsep, .fms-topbtns [data-act=help], .fms-exportcard, .fms-snap, .fms-vtools [data-act=quality] { display: none !important; }
    .fms-vp { height: 58vh; min-height: 320px; flex: none; }
    .fms-right { overflow: visible; }
    .fms .fms-name { width: 40vw; }
    .fms-hintbar { display: none; }
    .fms-start { grid-template-columns: 1fr; }
    .fms-keys { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .fms-top { gap: 6px; padding: 0 8px; }
    .fms .fsu-brand b, .fms .fsu-beta, .fms .fsu-credits span, .fms-save span, .fms-fps { display: none; }
}
.fms-tag:not(.is-new):not(.is-ch) { color: var(--fsu-muted); background: rgba(255, 255, 255, .05); }
.fms-helpsw { font-size: 11.5px; }

/* textures (W3) */
.fms-tabbar { grid-template-columns: repeat(6, 1fr); }
.fms .fms-tabbar button { font-size: 9.5px; letter-spacing: 0; }
.fms-textures { min-height: 0; height: 100%; }
.fms-textures .fsu-search { flex: 1; }
.fms-texgrid { flex: 1; min-height: 140px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: #2a3448 transparent; }
.fms .fms-tex { box-shadow: none; display: grid; gap: 2px; padding: 0 0 2px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--fsu-text); min-width: 0; }
.fms-tex span { display: block; position: relative; height: 0; padding-bottom: 100%; border-radius: 9px; overflow: hidden; border: 1px solid var(--fsu-line); background: repeating-conic-gradient(#1a2131 0 25%, #0f1420 0 50%) 0 0 / 12px 12px; transition: border-color .15s, transform .15s var(--fsu-ease); }
.fms-tex img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.fms .fms-tex:hover span { border-color: rgba(255, 47, 158, .55); transform: translateY(-2px); }
.fms .fms-tex.is-on span { border-color: #18e0ff; box-shadow: 0 0 0 1px #18e0ff, 0 0 14px rgba(24, 224, 255, .3); }
.fms .fms-tex.is-rep span { border-color: rgba(52, 211, 153, .6); }
.fms-tex b { font: 600 9.5px var(--fsu-mono); color: #cdd5e2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-tex small { font-size: 9.5px; color: var(--fsu-dim); }
.fms-texsel { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--fsu-line2); background: var(--fsu-bg2); }
.fms-texsel-img { position: relative; width: 96px; height: 96px; border-radius: 9px; overflow: hidden; background: repeating-conic-gradient(#1a2131 0 25%, #0f1420 0 50%) 0 0 / 12px 12px; }
.fms-texsel-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fms-texsel-img .fms-tag { position: absolute; left: 5px; top: 5px; }
.fms-texsel-txt { display: grid; gap: 2px; align-content: start; min-width: 0; }
.fms-texsel-txt b { font: 600 12px var(--fsu-mono); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fms-texsel-txt small { font-size: 11px; color: var(--fsu-muted); line-height: 1.35; }
.fms-texsel-act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.fms-texsel-act label { cursor: pointer; }
.fms-texsel .fsu-note, .fms-texerr { grid-column: 1 / -1; }
.fms-chrow.is-tex .fms-chdot { background: #ff2f9e; }
.fms-exlines li.is-tex::before { background: #ff2f9e; }

/* collision (W4) */
.fms-colcard { min-height: 0; height: 100%; }
.fms-colbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fms .fms-colbtns .fsu-btn.is-on { border-color: rgba(0, 240, 255, .6); color: #cffaff; background: rgba(0, 240, 255, .1); }
.fms-colsel { display: grid; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .05); }
.fms-colsel.is-cuts { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .05); }
.fms-colsel .fms-xyz { grid-template-columns: 58px repeat(3, minmax(0, 1fr)) 26px; }
.fms-collist { min-height: 90px; }
.fms-coldot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.fms-coldot.is-box { background: #34d399; } .fms-coldot.is-cut { background: #f87171; } .fms-coldot.is-obj { background: #fbbf24; }
.fms-colsw { font-size: 12px; }
.fms-chrow.is-col .fms-chdot { background: #34d399; }
.fms-exlines li.is-col::before { background: #34d399; }

/* own models (W5), text and signs (W6) */
.fms .fms-srcseg .fsu-chip { height: 26px; font-size: 11.5px; }
.fms-mgrid { flex: 1; min-height: 120px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; scrollbar-width: thin; }
.fms .fms-mcard { position: relative; display: grid; gap: 2px; cursor: pointer; min-width: 0; }
.fms-mcard .fms-prop-img { display: grid; place-items: center; }
.fms-mcard b { font-size: 11px; font-weight: 600; color: #cdd5e2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-mcard small { font-size: 10px; color: var(--fsu-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fms-mcard.is-error small { color: #fca5a5; }
.fms-mcard.is-error .fms-prop-img { color: #f87171; }
.fms .fms-mcard:hover .fms-star { opacity: 1; }
.fms .fms-mdel .fsu-i { width: 14px; height: 14px; color: #fecaca; }
.fms .fms-mdel.is-confirm { background: rgba(248, 113, 113, .8); }
.fms-modal-model .fms-modal-card { width: min(560px, 100%); }
.fms-mdl { display: grid; gap: 12px; }
.fms-rules { list-style: none; padding: 0; display: grid; gap: 8px; }
.fms .fms-rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #cdd5e2; line-height: 1.45; }
.fms-rules .fsu-i { width: 16px; height: 16px; color: var(--fsu-cyan); margin-top: 2px; }
.fms-send-sm { cursor: pointer; }
.fms-textform, .fms-textedit { display: grid; gap: 8px; }
.fms-textedit { padding: 10px; border-radius: 12px; border: 1px solid rgba(255, 47, 158, .35); background: rgba(255, 47, 158, .05); }
.fms-textrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fms .fms-colorin { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fsu-muted); }
.fms .fms-colorin input { width: 38px; height: 26px; padding: 0; border: 1px solid var(--fsu-line2); border-radius: 7px; background: none; cursor: pointer; }
.fms .fms-slider { flex: 1; display: grid; grid-template-columns: auto 1fr 30px; align-items: center; gap: 8px; font-size: 12px; color: var(--fsu-muted); min-width: 140px; }
.fms .fms-slider input { width: 100%; accent-color: #ff2f9e; }
.fms-slider output { font: 600 11px var(--fsu-mono); color: var(--fsu-text); text-align: right; }
.fms .fms-tex.is-fixed span { opacity: .55; }
.fms .fms-tex.is-fixed b { color: var(--fsu-dim); }

/* toasts sit over the viewport, never over the export card */
.fms .fsu-toasts { right: auto; left: calc(54px + clamp(280px, 19.5vw, 340px) + 40px); bottom: 64px; justify-items: start; }
.fms .fsu-toast { max-width: 460px; }
@media (max-width: 1280px) { .fms .fsu-toasts { left: 340px; } }
@media (max-width: 899px) { .fms .fsu-toasts { left: 12px; right: 12px; } }
.fms .fms-nocol { color: #fbbf24; font-weight: 700; }
