/* Marketing Studio: раскладка, размеры и механика сняты с higgsfield.ai/marketing-studio (окно 1996px);
   цвета переведены в светлую тему Fable, акцент кнопки Generate — их лаймовый */
.app[data-route="marketing"] [data-page="marketing"] { display: flex; }
/* Переменные на уровне документа: окна и меню студии добавляются вне страницы */
:root { --ms-soft: #f6f6f6; --ms-ph: #ececec; --ms-ctl: rgb(0 0 0 / .05); --ms-line: rgb(0 0 0 / .08); --ms-lime: #d1fe17; --ms-ink: #131517; --ms-disp: "Space Grotesk", "Onest", var(--font); /* у Space Grotesk нет кириллицы — русские буквы берутся из Onest */ }
.ms { flex-direction: column; align-items: center; min-height: 100%; padding: 12px 16px 64px; font-size: 14px; line-height: 20px; }
body > #root > .ms { display: flex; --font: ui-sans-serif, system-ui, sans-serif; --ms-disp: "Space Grotesk", "Onest", var(--font); --main: #fcfcfc; --text: #0d0d0d; --muted: #8f8f8f; background: var(--main); color: var(--text); }
.ms button { cursor: pointer; }
.ms-up { font-family: var(--ms-disp); text-transform: uppercase; font-weight: 700; }

/* Верх: плашка, карусель 1182x274, заголовок */
.ms-hero { position: relative; width: 1182px; max-width: 100%; height: 274px; flex: none; }
.ms-pill { white-space: nowrap; position: absolute; top: 4px; left: 50%; z-index: 10; transform: translateX(-50%); height: 24px; padding: 0 10px; border: 1px solid var(--ms-line); border-radius: 9999px; background: linear-gradient(170deg, rgb(255 255 255 / .9), rgb(240 240 240 / .9)); font-size: 12px; line-height: 22px; letter-spacing: -.24px; color: var(--text); }
.ms-car { position: absolute; top: 0; left: 50%; width: 1182px; height: 274px; margin-left: -591px; }
.ms-slide { position: absolute; top: 0; left: 0; overflow: hidden; background: var(--ms-ph); transition: transform .6s cubic-bezier(.4, 0, .2, 1), width .6s cubic-bezier(.4, 0, .2, 1), height .6s cubic-bezier(.4, 0, .2, 1), opacity .6s; }
.ms-slide::after { content: ""; position: absolute; inset: 0; border: 1.6px solid var(--ms-line); pointer-events: none; }
.ms-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ms-tag { position: absolute; left: 8px; bottom: 10px; display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 9px; border: 1px solid rgb(0 0 0 / .08); border-radius: 9999px; background: rgb(255 255 255 / .6); backdrop-filter: blur(12px); color: rgb(13 13 13 / .5); font-size: 8px; line-height: 10px; }
.ms-slide.s1 .ms-tag { height: 24px; font-size: 10px; line-height: 14px; }
.ms-slide.s0 .ms-tag { height: 26px; font-size: 12px; line-height: 14px; color: var(--text); }
.ms-h1 { margin: 36px 0 0; font-size: 32px; line-height: 36px; letter-spacing: -1.28px; text-align: center; background: linear-gradient(#0d0d0d, #9a9a9a 90.278%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Панель ввода 896x112: режим (72) + поле (820) */
.ms-comp { display: flex; gap: 4px; width: 896px; max-width: 100%; margin-top: 28px; flex: none; }
.ms-mode { display: flex; flex-direction: column; gap: 2px; width: 72px; height: 112px; padding: 4px; border: 1px solid var(--ms-line); border-radius: 24px; background: #fff; }
.ms-mode button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; border-radius: 20px; color: var(--muted); font-size: 10px; line-height: 12px; font-weight: 700; }
.ms-mode button.on { background: var(--ms-ctl); color: var(--text); }
.ms-box { flex: 1; min-width: 0; height: 112px; padding: 4px; border: 1px solid var(--ms-line); border-radius: 24px; background: #fff; box-shadow: 0 4px 4px rgb(0 0 0 / .04); }
.ms-in { display: flex; gap: 6px; height: 100%; padding: 12px; border-radius: 20px; background: var(--ms-soft); }
.ms-left { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.ms-prompt { display: flex; gap: 6px; }
.ms-prompt textarea { flex: 1; min-width: 0; height: 40px; padding: 0 4px; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 20px; }
.ms-prompt textarea::placeholder { color: var(--muted); }
.ms-chip { position: relative; width: 28px; height: 28px; flex: none; border-radius: 6px; background: var(--ms-ph) center / cover; }
.ms-chip button { position: absolute; top: -4px; right: -4px; display: flex; width: 14px; height: 14px; align-items: center; justify-content: center; border-radius: 9999px; background: var(--text); color: #fff; }
.ms-row { position: relative; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.ms-scroll { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ms-ctl { display: flex; align-items: center; gap: 4px; flex: none; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--ms-ctl); font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap; }
.ms-ctl.sq { width: 28px; padding: 0; justify-content: center; }
.ms-ctl.label { cursor: default; }
.ms-ctl svg { color: var(--icon); }
.ms-ctl .ms-step { display: flex; color: var(--icon); }
.ms-ctl .ms-step:disabled { opacity: .35; cursor: default; }
.ms-arrow { position: absolute; top: 0; z-index: 2; box-shadow: 0 0 8px 6px var(--ms-soft); background: #ececec; }
.ms-ref { position: relative; width: 80px; height: 80px; flex: none; border-radius: 12px; background: linear-gradient(#f3f3f3, #dadada); box-shadow: 10px 34px 24px rgb(0 0 0 / .05), 8px 21px 6px rgb(0 0 0 / .01); overflow: hidden; cursor: pointer; }
.ms-ref-top { position: absolute; top: 6px; left: 6px; right: 6px; z-index: 1; display: flex; justify-content: space-between; transition: opacity .15s; }
.ms-ref .ms-add { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid rgb(0 0 0 / .15); border-radius: 9999px; background: rgb(255 255 255 / .6); backdrop-filter: blur(3px); }
.ms-ref .ms-lbl { position: absolute; left: 6px; bottom: 5px; font-size: 12px; line-height: 14px; color: var(--text); }
.ms-ref.full { background: var(--ms-ph) center / cover; }
.ms-ref.full::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / .45)); }
.ms-ref.full .ms-lbl { z-index: 1; color: #fff; }
.ms-ref.full .ms-ref-top { opacity: 0; }
.ms-ref.full:hover .ms-ref-top { opacity: 1; }
.ms-gen { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 120px; height: 80px; flex: none; border-radius: 12px; background: var(--ms-lime); color: var(--ms-ink); box-shadow: 10px 34px 24px rgb(0 0 0 / .1), 8px 21px 6px rgb(0 0 0 / .01), 0 6px 18px rgb(205 255 0 / .45); font-size: 12px; line-height: 18px; }
.ms-gen span { display: flex; align-items: center; gap: 2px; font-family: var(--ms-disp); font-size: 12px; line-height: 16px; font-weight: 500; }
.ms-gen:disabled { opacity: .5; cursor: default; }

/* Шаблоны: выровненные ряды, зазор 4px */
.ms-tpl { width: 100%; margin-top: 68px; display: flex; flex-direction: column; gap: 16px; }
.ms-tpl h2 { margin: 0; font-size: 20px; line-height: 24px; letter-spacing: -.8px; }
.ms-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; margin: -6px -16px -12px; padding: 0 16px; background: var(--main); }
.ms-cats { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ms-cat { display: flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; height: 32px; padding: 0 12px 0 9px; border: 1px solid transparent; border-radius: 9999px; background: rgb(0 0 0 / .04); color: var(--icon); font-size: 12px; line-height: 18px; font-weight: 600; }
.ms-cat.on { background: rgb(0 0 0 / .1); color: var(--text); }
.ms-media { display: flex; flex: none; gap: 2px; height: 32px; padding: 2px; border-radius: 9999px; background: var(--ms-ctl); }
.ms-media button { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 9999px; color: var(--icon); font-size: 12px; line-height: 12px; font-weight: 500; }
.ms-media button.on { background: rgb(0 0 0 / .1); color: var(--text); }
.ms-grid { display: flex; flex-direction: column; gap: 4px; }
.ms-grid > div { display: flex; gap: 4px; }
.ms-card { position: relative; flex: none; background: var(--ms-ph); overflow: hidden; }
.ms-card img, .ms-card video, .ms-rc-media img, .ms-rc-media video, .ms-style img, .ms-style video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ms-card::after { content: ""; position: absolute; inset: 0; border: 1.6px solid var(--ms-line); pointer-events: none; }
.ms-card .ms-ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 10px; background: rgb(0 0 0 / .4); color: #fff; text-align: left; opacity: 0; transition: opacity .15s; }
.ms-card:hover .ms-ov { opacity: 1; }
.ms-ov small { color: rgb(255 255 255 / .5); font-size: 12px; line-height: 16px; font-weight: 500; }
.ms-ov b { font-family: var(--ms-disp); font-size: 16px; line-height: 16px; letter-spacing: -1.2px; text-transform: uppercase; }

/* Окна: затемнение, лист снизу (Recreate), окно по центру (стиль, файлы) */
.ms-ov-bg { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .3); backdrop-filter: blur(12px); }
.ms-dlg { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); position: fixed; z-index: 71; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; font-size: 14px; line-height: 20px; }
.ms-x { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--ms-line); border-radius: 9999px; background: var(--ms-ctl); color: var(--text); }
.ms-sheet { top: 80px; bottom: 0; width: 1080px; max-width: calc(100vw - 32px); padding: 8px 8px 0; border-radius: 24px 24px 0 0; background: #fff; overflow: auto; }
.ms-rc { position: relative; display: flex; gap: 49px; padding: 11px 11px 18px; }
.ms-rc > .ms-x { position: absolute; top: 13px; right: 21px; }
.ms-rc-media { width: 608px; height: 608px; flex: none; border-radius: 12px; background: var(--ms-soft); display: flex; justify-content: center; }
.ms-rc-media span { position: relative; display: block; height: 100%; overflow: hidden; background: var(--ms-ph); }
.ms-rc-side { width: 356px; padding-top: 81px; display: flex; flex-direction: column; }
.ms-rc-side .ms-dialog-title { margin: 0 0 32px; font-size: 24px; line-height: 28px; letter-spacing: -1.2px; background: linear-gradient(#0d0d0d, rgb(13 13 13 / .45) 90.278%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ms-rc-side label { color: #828282; font-size: 14px; line-height: 16px; margin-bottom: 8px; }
.ms-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 144px; margin-bottom: 24px; border: 1px solid var(--ms-line); border-radius: 16px; background: rgb(0 0 0 / .03); font-size: 12px; line-height: 16px; font-weight: 500; background-position: center; background-size: cover; }
.ms-drop .ms-add { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid rgb(0 0 0 / .2); border-radius: 9999px; background: rgb(255 255 255 / .6); }
.ms-req { position: absolute; top: 4px; right: 4px; padding: 4px 8px; border-radius: 9999px; background: var(--ms-ctl); color: #8a8a8a; font-size: 10px; line-height: 14px; letter-spacing: .2px; }
.ms-edit { position: relative; margin-bottom: 24px; }
.ms-edit svg { position: absolute; top: 12px; left: 12px; color: var(--muted); }
.ms-edit textarea { width: 100%; height: 114px; padding: 10px 12px 10px 36px; border: 1px solid var(--ms-line); border-radius: 12px; outline: 0; resize: none; background: rgb(0 0 0 / .03); font: inherit; font-size: 14px; }
.ms-rcbtn { display: flex; align-items: center; justify-content: center; gap: 4px; height: 48px; border-radius: 12px; background: linear-gradient(rgb(255 255 20 / 0), rgb(255 255 20)), var(--ms-lime); box-shadow: inset 0 -3px 0 rgb(130 155 25), 0 6px 4px rgb(0 0 0 / .12); color: #1a1a1a; font-size: 16px; line-height: 20px; font-weight: 600; }
.ms-rcbtn:disabled { opacity: .5; cursor: default; }
.ms-more { margin: 0 1px; padding: 16px 20px 20px; border-radius: 16px 16px 0 0; background: var(--ms-soft); }
.ms-more .ms-dialog-title { margin: 0 0 16px; font-size: 20px; line-height: 24px; letter-spacing: -1.2px; }
.ms-style-dialog { width: 1080px; height: 820px; }
.ms-win { overflow: auto; top: 50%; transform: translate(-50%, -50%); padding: 8px; border: 1px solid var(--ms-line); border-radius: 24px; background: #fff; box-shadow: 0 16px 32px -8px rgb(0 0 0 / .19); }
.ms-win header { display: flex; align-items: center; justify-content: space-between; padding: 8px 9px 8px; }
.ms-win header .ms-dialog-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.ms-body { display: flex; min-height: 0; flex: 1; border-radius: 20px; background: var(--ms-soft); overflow: hidden; }
.ms-nav { min-width: 184px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px; background: rgb(0 0 0 / .03); }
.ms-nav p { margin: 0; padding: 2px 0; color: #8a8a8a; font-size: 12px; line-height: 16px; font-weight: 500; }
.ms-nav p + button, .ms-nav button + p { margin-top: 4px; }
.ms-nav button { display: flex; align-items: center; gap: 8px; white-space: nowrap; height: 36px; padding: 0 8px; border-radius: 8px; color: #828282; font-size: 14px; line-height: 16px; font-weight: 500; }
.ms-nav button.on { background: var(--ms-ctl); color: var(--text); }
.ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px; overflow: hidden auto; }
.ms-mhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; font-weight: 500; }
.ms-search { display: flex; align-items: center; gap: 8px; width: 208px; height: 32px; padding: 0 8px; border: 1px solid var(--ms-line); border-radius: 8px; background: #fff; color: var(--icon); }
.ms-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; }
.ms-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.ms-style { display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 12px; line-height: 16px; font-weight: 600; }
.ms-style span { position: relative; overflow: hidden; display: block; aspect-ratio: 3 / 4; border: 1px solid var(--ms-line); border-radius: 16px; background: var(--ms-ph); }
.ms-style.tall span { aspect-ratio: 9 / 16; }
.ms-style.on span { box-shadow: 0 0 0 2px var(--ms-lime), 0 0 0 3px rgb(0 0 0 / .15); }

/* Окно файлов (Assets) 960x598 */
.ms-ov-bg:has(+ #ms-assets) { z-index: 72; }
#ms-assets { z-index: 73; }
.ms-ov-bg:has(+ #ms-top) { z-index: 74; }
#ms-top { z-index: 75; }
.ms-assets { width: 960px; height: 598px; max-height: calc(100dvh - 24px); padding: 8px 4px 4px; }
.ms-tabs { display: flex; gap: 4px; padding: 4px 4px 8px 9px; }
.ms-tabs > button { height: 32px; padding: 0 8px; border-radius: 9999px; color: rgb(13 13 13 / .5); font-size: 12px; line-height: 16px; font-weight: 500; }
.ms-tabs > button.on { background: var(--text); color: #fff; }
.ms-tabs .ms-x { margin-left: auto; }
.ms-link { height: 32px; padding: 0 12px; border-radius: 9999px; background: rgb(0 0 0 / .08); font-size: 14px; line-height: 16px; font-weight: 500; }
.ms-sub { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 8px; border-radius: 16px 16px 0 0; background: rgb(0 0 0 / .03); }
.ms-sub div { display: flex; gap: 4px; }
.ms-sub div button { height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 9999px; color: rgb(13 13 13 / .5); font-size: 12px; font-weight: 500; }
.ms-sub div button.on { border-color: var(--ms-line); background: var(--ms-ctl); color: var(--text); }
.ms-sort { display: flex; align-items: center; gap: 4px; padding: 0 12px; color: #828282; font-weight: 500; }
.ms-files { flex: 1; display: grid; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); grid-auto-rows: auto; gap: 12px; align-content: start; padding: 14px; overflow: auto; border-radius: 0 0 16px 16px; background: rgb(0 0 0 / .03); }
.ms-files.solo { border-radius: 16px; padding: 8px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); grid-auto-rows: auto; gap: 12px; }
.ms-file { min-width: 0; aspect-ratio: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 10px; background: var(--ms-ph) center / cover; font-size: 12px; line-height: 16px; font-weight: 500; }
.ms-file.add { border: 1px solid var(--ms-line); background: rgb(0 0 0 / .03); }
.ms-file.add span { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid rgb(0 0 0 / .2); border-radius: 9999px; background: rgb(255 255 255 / .7); }
.ms-prod { display: flex; flex-direction: column; gap: 8px; min-width: 0; text-align: center; font-size: 12px; line-height: 18px; font-weight: 600; }
.ms-prod > span { display: block; position: relative; height: 142px; border-radius: 16px; background: var(--ms-ph) center / cover; cursor: pointer; }
.ms-dots { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9999px; background: rgb(105 105 105 / .7); color: #fff; backdrop-filter: blur(24px); opacity: 0; transition: opacity .15s; }
.ms-prod:hover .ms-dots, .ms-dots[aria-expanded="true"] { opacity: 1; }
.ms-prod.add > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ms-line); border-radius: 8px; background: rgb(0 0 0 / .03); font-weight: 500; }
.ms-prod.add i { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid rgb(0 0 0 / .2); border-radius: 9999px; background: rgb(255 255 255 / .7); }
.ms-av-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; color: #828282; font-weight: 500; }
.ms-av-head div { display: flex; gap: 4px; }
.ms-av-head div button { height: 24px; padding: 0 10px; border: 1px solid var(--ms-line); border-radius: 9999px; color: var(--text); font-size: 12px; font-weight: 500; }
.ms-av-head div button.on { background: var(--text); color: #fff; }
/* Прокручивается только сетка аватаров, заголовок с фильтрами стоит; полоса прокрутки скрыта (как у оригинала) */
.ms-assets .ms-main { overflow: hidden; }
.ms-avs { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); align-content: start; gap: 12px 8px; overflow-y: auto; scrollbar-width: none; }
.ms-av { display: flex; flex-direction: column; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 500; text-align: center; }
.ms-av > span { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 211 / 252; border: 2px solid transparent; border-radius: 12px; background: var(--ms-ph) center / cover; overflow: hidden; cursor: pointer; }
.ms-av:not(.new) > span::before { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .1); opacity: 0; transition: opacity .2s; }
.ms-av:hover > span::before { opacity: 1; }
.ms-av.on > span { border-color: var(--ms-lime); }
.ms-check { position: absolute; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 9999px; background: var(--ms-lime); color: var(--ms-ink); }
.ms-av.new > span { background: rgb(0 0 0 / .04); }
.ms-av.new i { display: flex; align-items: center; justify-content: center; width: 32px; height: 44px; border: 1px solid var(--ms-line); border-radius: 8px; background: rgb(255 255 255 / .7); transform: rotate(4deg); }
.ms-av .ms-pin, .ms-av .ms-sel { position: absolute; opacity: 0; transition: opacity .2s, transform .2s; }
.ms-av:hover .ms-pin, .ms-av:hover .ms-sel, .ms-av .ms-pin.on { opacity: 1; }
.ms-pin { top: 8px; left: 8px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid rgb(255 255 255 / .06); border-radius: 9999px; background: rgb(0 0 0 / .4); color: #fff; backdrop-filter: blur(2px); }
.ms-sel { left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; justify-content: center; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 9999px; background: var(--ms-lime); color: var(--ms-ink); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; transform: translateY(4px); }
.ms-av:hover .ms-sel { transform: none; }
.ms-av.on .ms-sel { border-color: rgb(0 0 0 / .1); background: rgb(255 255 255 / .8); backdrop-filter: blur(6px); }

/* Окно поверх окна файлов: «Новый аватар» 890x600 и «Ваш товар» 848x508 */
#ms-top { padding: 24px; border-radius: 16px; }
#ms-top header { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0; }
#ms-top header .ms-dialog-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.ms-round { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border-radius: 9999px; background: var(--ms-ctl); color: var(--muted); }
.ms-round:hover { background: rgb(0 0 0 / .1); color: var(--text); }
.ms-lab { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 14px; line-height: 20px; font-weight: 500; }
.ms-field { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--ms-line); border-radius: 8px; outline: 0; background: #fff; color: var(--text); font: inherit; font-size: 14px; line-height: 20px; font-weight: 400; }
span.ms-field { color: var(--icon); }
.ms-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.ms-side { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.ms-na { width: 890px; height: 600px; max-height: calc(100dvh - 24px); overflow: auto; }
.ms-na header { margin-bottom: 24px; }
.ms-na-pick { min-height: 320px; flex: 1; display: flex; gap: 16px; }
.ms-na-pick > button { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; padding: 16px; border-radius: 16px; background: rgb(0 0 0 / .04); text-align: center; transition: background .15s; }
.ms-na-pick > button:hover { background: rgb(0 0 0 / .06); }
.ms-na-pick b { font-size: 16px; line-height: 24px; font-weight: 600; }
.ms-na-pick small { color: var(--muted); font-size: 16px; line-height: 24px; font-weight: 500; }
.ms-na-ill { position: absolute; left: 0; right: 0; bottom: 96px; height: 200px; }
.ms-na-ill i { position: absolute; top: 0; left: calc(50% - 40px); width: 48px; height: 64px; border: 1.5px dashed rgb(0 0 0 / .2); border-radius: 10px; transform: rotate(-8deg); }
.ms-na-ill i + i { left: calc(50% - 6px); transform: rotate(6deg); }
.ms-na-ill em { position: absolute; top: 43px; left: 50%; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--ms-line); border-radius: 8px; background: #fff; box-shadow: 0 6px 16px rgb(0 0 0 / .08); color: var(--text); font-size: 13px; font-style: normal; white-space: nowrap; transform: translateX(-50%); }
.ms-na-ill em.wide { width: 228px; justify-content: space-between; }
.ms-na-bg { position: absolute; inset: 76px 24px 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow: hidden; }
.ms-na-bg i { aspect-ratio: 19 / 25; border-radius: 16px; background: rgb(0 0 0 / .025); }
.ms-na-gen { min-height: 320px; position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ms-na-faces { display: flex; align-items: center; height: 200px; margin-bottom: 24px; }
.ms-na-faces img { width: 138px; height: 182px; margin-right: -32px; border: 4px solid #fff; border-radius: 16px; object-fit: cover; }
.ms-na-faces img:nth-child(1) { width: 178px; border-radius: 9999px; transform: translateY(8px) rotate(8deg); }
.ms-na-faces img:nth-child(2) { transform: translateY(-4px) rotate(-4deg); }
.ms-na-faces img:nth-child(3) { width: 194px; height: 186px; transform: translateY(4px) rotate(2deg); }
.ms-na-faces img:nth-child(4) { margin-right: 0; transform: rotate(4deg); }
.ms-na-gen h3 { margin: 0; font-size: 28px; line-height: 36px; letter-spacing: -.56px; }
.ms-na-gen p { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; font-weight: 500; text-align: center; }
.ms-na-form { position: relative; display: flex; align-items: center; gap: 8px; height: 60px; flex: none; padding: 6px 6px 6px 16px; border: 2px solid rgb(0 0 0 / .04); border-radius: 16px; background: var(--ms-soft); }
.ms-na-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 20px; }
.ms-na-form button { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px; border: 1.5px solid rgb(0 0 0 / .04); border-radius: 12px; background: radial-gradient(79% 79% at 44% 124%, #ff1c8a, transparent), linear-gradient(transparent, rgb(255 255 255 / .32)), #ff005b; color: #fff; font-size: 12px; line-height: 18px; letter-spacing: -.48px; text-shadow: 0 0 8px rgb(255 255 255 / .45); }
.ms-na-form button:disabled { opacity: .6; cursor: default; }
.ms-na-form button span { display: flex; align-items: center; gap: 2px; }
.ms-na-up { flex: 1; min-height: 320px; display: flex; gap: 20px; margin-top: -4px; }
.ms-na-photo { width: 342px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed rgb(0 0 0 / .1); border-radius: 20px; background: rgb(0 0 0 / .04) center / cover; text-align: center; }
.ms-na-photo span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 8px; border: 1px solid rgb(0 0 0 / .2); border-radius: 9999px; background: rgb(255 255 255 / .7); }
.ms-na-photo b { font-size: 14px; line-height: 20px; font-weight: 500; }
.ms-na-photo small { color: var(--muted); font-size: 12px; line-height: 18px; }
.ms-na-create { height: 56px; border-radius: 12px; background: var(--text); color: #fff; font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -.4px; text-align: center; }
.ms-na-create:disabled { background: rgb(0 0 0 / .06); color: rgb(0 0 0 / .3); cursor: default; }
.ms-pd { width: 848px; }
#ms-top.ms-pd header .ms-dialog-title { font-size: 20px; line-height: 28px; letter-spacing: -.5px; }
.ms-pd header .ms-round { position: absolute; top: -12px; right: -12px; }
.ms-pd-body { display: flex; gap: 32px; height: 400px; margin-top: 32px; }
.ms-pd-left { width: 344px; flex: none; display: flex; flex-direction: column; gap: 16px; }
.ms-pd-view { position: relative; height: 344px; flex: none; border-radius: 20px; background: rgb(0 0 0 / .04); overflow: hidden; }
.ms-pd-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ms-pd-thumbs { display: flex; gap: 8px; margin-top: -2px; padding: 2px 2px 0 0; overflow-x: auto; scrollbar-width: none; }
.ms-pd-add { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--ms-ctl); }
.ms-pd-th { position: relative; width: 40px; height: 40px; flex: none; }
.ms-pd-th > button:first-child { width: 100%; height: 100%; border: 2px solid transparent; border-radius: 10px; background: var(--ms-ph) center / cover; }
.ms-pd-th.on > button:first-child { border-color: var(--text); }
.ms-pd-rm { position: absolute; top: -2px; right: -2px; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--ms-line); border-radius: 9999px; background: #fff; }
.ms-pd-fields { display: flex; flex-direction: column; gap: 20px; }
.ms-pd-fields textarea { height: 122px; resize: none; }
.ms-pd-btns { display: flex; gap: 6px; }
.ms-pd-save { flex: 1; height: 40px; border-radius: 12px; background: var(--text); color: #fff; font-size: 16px; line-height: 24px; font-weight: 600; text-align: center; }
.ms-pd-save:disabled { opacity: .4; cursor: default; }
.ms-pd-del { height: 40px; padding: 0 24px; border-radius: 12px; background: rgb(231 41 48 / .12); color: #e72930; font-size: 16px; line-height: 24px; font-weight: 600; }

/* Всплывающие меню (пропорции, длительность, фильтр, вид) — общее .menu сайта */
.ms-pop { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); z-index: 80; min-width: 0; padding: 0; overflow: auto; }
.ms-pmenu { min-width: 122px; padding: 2px; border-radius: 12px; }
.ms-pmenu .mi { min-height: 32px; padding: 0 8px; border-radius: 10px; }
.ms-pmenu .ms-danger { color: #e72930; }
.ms-pop h4 { margin: 0; padding: 8px 12px; color: #71717b; font-size: 12px; line-height: 18px; font-weight: 500; text-transform: uppercase; }
.ms-ratios { display: grid; grid-template-columns: 89px 89px; }
.ms-ratios button { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-top: 1px solid rgb(0 0 0 / .05); font-size: 14px; line-height: 20px; font-weight: 600; }
.ms-ratios button:nth-child(odd) { border-right: 1px solid rgb(0 0 0 / .05); }
.ms-ratios button.on, .ms-ratios button:hover { background: var(--ms-ctl); }
.ms-ratio { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
.ms-ratio i { border: 1.3px solid currentColor; border-radius: 2px; }
.ms-ratio.auto i { width: 12px; height: 12px; border-style: dashed; border-radius: 1px; }
.ms-dur { width: 334px; padding: 12px; }
.ms-dur h4 { padding: 0 0 8px; text-transform: none; }
.ms-dur button { display: flex; align-items: center; width: 100%; height: 36px; padding: 0 12px; border-left: 3px solid var(--text); border-radius: 8px; background: var(--ms-ctl); font-weight: 500; }
.ms-fpop { width: 220px; padding: 8px; }
.ms-fpop.view { width: 188px; }
.ms-fpop h4 { padding: 8px 8px 6px; text-transform: none; color: rgb(13 13 13 / .5); font-size: 12px; line-height: 16px; }
.ms-fpop .mi { min-height: 38px; font-weight: 500; }
.ms-fpop .sep { padding: 6px 0; }
.ms-size { position: relative; height: 32px; margin: 4px; border-radius: 8px; background: var(--ms-ctl); cursor: pointer; }
.ms-size i { position: absolute; inset: 0 auto 0 0; border-radius: 8px 0 0 8px; background: rgb(0 0 0 / .1); pointer-events: none; }
.ms-mini { position: relative; width: 28px; height: 16px; flex: none; border-radius: 9999px; background: rgb(0 0 0 / .15); }
.ms-mini::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 9999px; background: #fff; transition: transform .15s; }
.ms-mini.on { background: var(--text); }
.ms-mini.on::after { transform: translateX(12px); }

/* Навигация студии над страницей: Главная, Мои генерации, Избранное, Проекты ▾ */
.ms-topnav { display: flex; gap: 8px; align-items: center; align-self: stretch; flex-wrap: wrap; margin: 0 0 20px; }
.ms.proj .ms-topnav { margin: 12px 3px 16px; }
.ms-navtools { display: flex; gap: 4px; margin-left: auto; }
.ms-projs { width: 260px; max-height: 60vh; padding: 6px; overflow-y: auto; border-radius: 16px; }
.ms-projs .mi { min-height: 36px; padding: 6px 8px; border-radius: 10px; font-weight: 500; }
.ms-projs .mi.on { background: var(--ms-ctl); }
.ms-projs .sep, .ms-pmenu .sep { padding: 4px 6px; }
.ms-prow { position: relative; }
.ms-prow .mi { padding-right: 36px; }
.ms-pcov { width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--ms-ph) center / cover; }
.ms-pdots { position: absolute; top: 50%; right: 4px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; color: var(--icon); opacity: 0; transform: translateY(-50%); }
.ms-prow:hover .ms-pdots { opacity: 1; }
.ms-pdots:hover { background: var(--ms-ctl); }
.ms-toast { width: max-content; max-width: calc(100vw - 24px); position: fixed; top: 12px; left: 50%; z-index: 90; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--ms-line); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgb(0 0 0 / .12); font-size: 14px; line-height: 20px; font-weight: 500; transform: translateX(-50%); }
.ms-toast i { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 9999px; background: rgb(0 0 0 / .06); font-size: 12px; font-style: normal; font-weight: 700; }
.ms-toast.err i { background: rgb(231 41 48 / .12); color: #e72930; }
.ms-toast > button { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.ms-toast > button:hover { background: var(--ghost); }
/* Окна проекта: новый 480x270, редактирование 510, подтверждение удаления */
#ms-top.ms-np { width: 480px; padding: 16px; border-radius: 24px; }
#ms-top.ms-np .ms-dialog-title, #ms-top.ms-pe .ms-dialog-title, #ms-top.ms-cf .ms-dialog-title { font-size: 18px; line-height: 24px; }
#ms-np-name { height: 36px; margin: 40px 0 80px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 32px; line-height: 36px; font-weight: 600; text-align: center; }
#ms-np-name::placeholder { color: rgb(0 0 0 / .25); }
.ms-np .ms-na-create { height: 48px; }
#ms-top.ms-pe { width: 510px; max-height: calc(100dvh - 24px); gap: 24px; }
.ms-pe-sec { padding: 8px; border-radius: 20px; background: var(--ms-soft); }
.ms-pe-sec h3 { display: flex; align-items: center; gap: 6px; margin: 4px 4px 12px; color: var(--muted); font-size: 13px; line-height: 16px; font-weight: 500; }
.ms-pe-box { padding: 8px; border-radius: 16px; background: #fff; }
.ms-pe-box .ms-field { width: 100%; height: 40px; }
.ms-pe-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 120px; background: #fff center / cover; font-size: 14px; line-height: 20px; font-weight: 600; }
.ms-pe-cover span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--ms-line); border-radius: 9999px; color: var(--icon); }
.ms-pe-imgs { display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; gap: 8px; min-height: 160px; max-height: 300px; overflow-y: auto; }
.ms-pe-imgs p { grid-column: 1 / -1; margin: 64px 0; color: var(--muted); font-size: 14px; text-align: center; }
.ms-pe-imgs button { aspect-ratio: 1; border: 2px solid transparent; border-radius: 12px; background: var(--ms-ph) center / cover; }
.ms-pe-imgs button.on { border-color: var(--ms-lime); }
.ms-pe-save { height: 48px; flex: none; border-radius: 12px; background: var(--ms-lime); color: var(--ms-ink); font-size: 16px; line-height: 24px; font-weight: 600; text-align: center; }
#ms-top.ms-cf { width: 420px; gap: 12px; }
.ms-cf p { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.ms-cf-btns { display: flex; gap: 8px; margin-top: 12px; }
.ms-cf-btns button { flex: 1; height: 40px; border-radius: 12px; font-size: 14px; line-height: 20px; font-weight: 600; text-align: center; }
.ms-cf-no { background: var(--ms-ctl); }
.ms-cf-yes { background: #e72930; color: #fff; }

/* Проект: шапка, сетка результатов, панель ввода прижата к низу */
.ms.proj { padding: 0 9px 17px; align-items: stretch; }
.ms.proj .ms-land { display: none; }
.ms:not(.proj) .ms-proj { display: none; }
.ms-phead { display: flex; align-items: center; gap: 4px; min-height: 53px; padding: 0 3px 10px 4px; }
.ms-phead[hidden] { display: none; }
.ms-phead #ms-title { flex: 1; min-width: 0; overflow-wrap: anywhere; margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }
.ms-phead .ms-back { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text); }
.ms-phead .ms-back:hover { background: var(--ms-ctl); }
.ms-tool { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 1px solid rgb(0 0 0 / .1); border-radius: 8px; font-size: 14px; line-height: 16px; font-weight: 500; }
.ms-tool.on, .ms-tool[aria-expanded="true"] { background: var(--ms-ctl); }
.ms-res { display: grid; gap: 4px; align-items: start; }
.ms-res.masonry { display: flex; }
.ms-res.masonry > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ms-out { position: relative; display: block; width: 100%; background: var(--ms-ph); overflow: hidden; cursor: pointer; }
.ms-actions { position: absolute; top: 8px; right: 8px; z-index: 2; }
.ms-like, .ms-variant { position: absolute; top: 10px; right: 52px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9999px; background: rgb(0 0 0 / .4); color: #fff; backdrop-filter: blur(8px); opacity: 0; transition: opacity .15s, background-color .15s; }
.ms-variant { right: 92px; }
.ms-out:hover .ms-like, .ms-like:focus-visible, .ms-like.on, .ms-out:hover .ms-variant, .ms-variant:focus-visible { opacity: 1; }
.ms-like:hover, .ms-variant:hover { background: rgb(0 0 0 / .5); }
.ms-like.on svg { fill: #ff4d6d; stroke: #ff4d6d; }
.ms-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 50vh; text-align: center; }
.ms-empty[hidden] { display: none; }
.ms-empty span { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 12px; border: 1px solid var(--ms-line); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgb(0 0 0 / .06); color: var(--icon); }
.ms-empty b { font-size: 16px; line-height: 24px; font-weight: 600; }
.ms-empty small { color: var(--muted); font-size: 13px; line-height: 18px; }
.ms-res.square .ms-out { aspect-ratio: 1; }
.ms-out img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ms-out.wait::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .6) 50%, transparent 70%) 0 0 / 200% 100%; animation: ms-shine 1.4s linear infinite; }
@keyframes ms-shine { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.ms-seen { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 9999px; background: rgb(0 0 0 / .45); color: #fff; font-size: 12px; line-height: 16px; backdrop-filter: blur(6px); }
.ms.proj .ms-comp { position: sticky; bottom: 17px; z-index: 20; align-self: center; margin-top: auto; padding-top: 16px; }

.ms-out video{width:100%;height:100%;object-fit:cover;display:block}.ms-result-note{display:block;padding:20px;white-space:pre-wrap;overflow:auto;max-height:100%;font-size:14px}.ms-media-dialog{padding:24px;max-width:90vw}.ms-media-result{display:flex;flex-direction:column;gap:12px}.ms-media-result video{max-height:80vh;max-width:100%}

.ms-seo a { color:var(--text); text-decoration:underline; text-underline-offset:3px; }
.ms-seo { width:min(960px,100%); margin:64px auto 0; font-size:16px; line-height:1.65; }
.ms-seo section, .ms-seo nav { margin-top:40px; }
.ms-seo h2 { font-size:26px; line-height:1.3; margin-bottom:20px; }
.ms-seo h3 { font-size:18px; margin:24px 0 8px; }
.ms-seo p { margin:12px 0; }
.ms-seo ul { padding-left:20px; }
.ms-grid > .ms-preview-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; }
.ms-preview-grid figure { margin:0; }
.ms-preview-grid img { width:100%; height:auto; }
.ms-preview-grid figcaption { font-size:13px; line-height:1.4; margin-top:8px; }
.ms-chip.document { width: auto; max-width: 180px; padding: 8px 20px 8px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-gen:disabled { opacity: .5; cursor: progress; }

.ms-download { position: absolute; right: 16px; bottom: 16px; z-index: 2; }
/* Компоновка студии по доступной ширине, включая окна вне основного блока. */
@media (max-width: 960px) {
  .ms-comp { flex-direction: column; gap: 8px; }
  .ms-mode { flex-direction: row; width: fit-content; height: auto; border-radius: 16px; }
  .ms-mode button { flex-direction: row; gap: 6px; height: 36px; padding: 0 16px; font-size: 12px; }
  .ms-box { flex: auto; height: auto; }
  .ms-in { flex-wrap: wrap; gap: 12px; height: auto; }
  .ms-left { flex-basis: 100%; gap: 12px; }
  .ms-prompt { flex-wrap: wrap; }
  .ms-prompt textarea { flex-basis: 100%; height: 64px; font-size: 16px; line-height: 24px; }
  .ms-row { align-items: flex-start; overflow: visible; }
  .ms-scroll { flex-wrap: wrap; min-width: 0; overflow: visible; }
  .ms-ctl { min-height: 36px; height: auto; }
  .ms-ctl.sq { width: 36px; }
  .ms-step { min-width: 24px; min-height: 32px; align-items: center; justify-content: center; }
  .ms-gen { flex: 1; min-width: 100px; box-shadow: none; }
  .ms-ref { box-shadow: none; }
  .ms.proj .ms-comp { position: static; margin-top: 24px; }
  .ms-bar { height: auto; flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .ms-cats { flex-basis: 100%; }
  .ms-media { margin-left: auto; }
  .ms-rc { flex-direction: column; gap: 20px; padding-top: 48px; }
  .ms-rc > .ms-x { top: 4px; right: 4px; }
  .ms-rc-media { width: 100%; height: min(56vh, 440px); }
  .ms-rc-media span { max-width: 100%; }
  .ms-rc-media img, .ms-rc-media video { object-fit: contain; }
  .ms-rc-side { width: 100%; padding: 0; }
  .ms-rc-side .ms-dialog-title { margin-bottom: 20px; }
  .ms-styles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .ms-mhead, .ms-av-head { flex-wrap: wrap; gap: 12px; }
  .ms-search { flex: 1; min-width: 140px; }
  .ms-pd-body { height: auto; gap: 20px; }
  .ms-pd-left { width: 44%; }
  .ms-pd-view { height: auto; aspect-ratio: 1; }
  .ms-pd header .ms-round { position: static; }
  .ms-side { gap: 20px; }
  .ms-na-photo { width: 44%; }
}
@media (max-width: 600px) {
  .ms { padding-top: 20px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .ms.proj { padding: 16px 12px 24px; }
  .ms.proj .ms-topnav { margin: 0 0 16px; }
  .ms-topnav { gap: 6px; }
  .ms-topnav .ms-cat { min-height: 40px; }
  .ms-h1 { margin-top: 24px; font-size: 26px; line-height: 32px; letter-spacing: -.8px; }
  .ms-tpl { margin-top: 40px; }
  .ms-in { padding: 10px; gap: 8px; }
  .ms-ref { width: 72px; height: 80px; }
  .ms-dlg { border-radius: 20px; }
  .ms-sheet { top: 12px; max-width: calc(100vw - 16px); border-radius: 20px 20px 0 0; }
  .ms-win header, .ms-tabs, .ms-sub, .ms-av-head { flex-shrink: 0; }
  .ms-win header .ms-dialog-title { min-width: 0; overflow-wrap: anywhere; }
  .ms-tabs { position: relative; flex-wrap: wrap; padding-right: 44px; }
  .ms-tabs .ms-x { position: absolute; top: 4px; right: 4px; }
  .ms-tabs > button { min-height: 36px; }
  .ms-body { flex-direction: column; }
  .ms-nav { min-width: 0; flex-direction: row; align-items: center; padding: 8px; overflow-x: auto; }
  .ms-nav p, .ms-nav button { flex: none; }
  .ms-nav p + button, .ms-nav button + p { margin-top: 0; }
  .ms-main { min-height: 0; padding: 12px; }
  .ms-files { padding: 8px; gap: 8px; }
  .ms-av-head { margin-bottom: 12px; }
  .ms-av-head div button { height: 32px; }
  #ms-top { padding: 16px; }
  .ms-na { height: auto; min-height: min(520px, calc(100dvh - 24px)); overflow: auto; }
  .ms-na-pick { flex-direction: column; }
  .ms-na-pick > button { flex: none; min-height: 190px; }
  .ms-na-pick small { font-size: 14px; line-height: 20px; }
  .ms-na-ill { top: 16px; bottom: auto; height: 80px; }
  .ms-na-faces { height: 130px; max-width: 100%; margin: 8px 0 20px; }
  .ms-na-faces img:nth-child(n) { width: 27%; height: 120px; margin-right: -8px; }
  .ms-na-gen { padding-bottom: 24px; }
  .ms-na-gen h3 { font-size: 22px; line-height: 28px; text-align: center; }
  .ms-na-form { flex-wrap: wrap; height: auto; padding: 8px; }
  .ms-na-form input { flex-basis: 100%; height: 44px; }
  .ms-na-form button { width: 100%; justify-content: center; }
  .ms-na-up, .ms-pd-body { flex-direction: column; flex: none; }
  .ms-na-photo { width: 100%; min-height: 200px; }
  .ms-pd-body { margin-top: 20px; }
  .ms-pd-left { width: 100%; }
  #ms-top.ms-pe { gap: 16px; }
  #ms-np-name { width: 100%; min-width: 0; margin: 32px 0; font-size: 26px; }
  .ms-dlg input, .ms-dlg textarea { font-size: 16px; }
  .ms-seo { margin-top: 40px; }
  .ms-seo h2 { font-size: 22px; }
  .ms-phead { flex-wrap: wrap; }
  .ms-phead #ms-title { flex-basis: calc(100% - 40px); }
  .ms-navtools .ms-tool { height: 40px; }
  .ms-seen { max-width: 100%; font-size: 10px; }
}
@media (hover: none) {
  .ms-ref.full .ms-ref-top, .ms-dots, .ms-pdots, .ms-like, .ms-variant, .ms-pin { opacity: 1; }
}
