/* Phone shell — Android-style imitation of the pixel OS.
   Figma O2YnRjvTtomRNOgAbAD4qK: screens "Mobile · …" in sections main / ISS, components
   System bar, Top app bar, File (Type=Folder), Folder · Open, Bottom sheet, Image viewer.
   Everything is scoped under html.is-mobile (set in index.html before the shells start). */

html.is-mobile { height: 100%; }
html.is-mobile body { height: 100%; overflow: hidden; touch-action: manipulation; }
html.is-mobile #desktop, html.is-mobile #start, html.is-mobile .taskbar { display: none !important; }

/* ---------- phone frame ---------- */
.ph {
  position: fixed; inset: 0;
  height: 100dvh;
  overflow: hidden;
  --nav-h: 48px;
  --scrim: rgba(23, 15, 26, 0.45);
  --plum: #2a1e2e;
}
.ph-layer { position: absolute; left: 0; right: 0; top: 0; bottom: var(--nav-h); }
.ph button { touch-action: manipulation; }

/* pixel plates: 4px / 8px stepped corners */
.px-cut4 { clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px); }
.px-cut8 { clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 4px 8px, 4px 4px, 8px 4px); }
.m-g { display: block; width: 24px; height: 24px; flex: none; }

/* ---------- System bar · Status (32h) — home screen and recents only ---------- */
.m-status {
  height: 32px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  color: var(--text-on-dark);
}
.m-status time { font-family: var(--font-display); font-size: 14px; line-height: 16px; font-variant-numeric: tabular-nums; }
.m-status .ind { display: flex; align-items: center; gap: 8px; }
.m-status svg { display: block; }

/* ---------- System bar · Navigation (48h): back · home · recents ---------- */
.m-nav {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  color: var(--text-on-dark);
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.m-nav.is-light { color: var(--text-primary); background: var(--surface-base); box-shadow: inset 0 2px 0 var(--border-subtle); } /* thin, light divider from the app content */
.m-nav.is-plum { background: var(--plum); }
.m-nav button { position: relative; width: 72px; height: 48px; display: grid; place-items: center; color: inherit; }
.m-nav button::before { content: ""; position: absolute; left: 12px; right: 12px; top: 4px; bottom: 4px; background: transparent; }
.m-nav button:active::before { background: var(--control-glass-hover); }
.m-nav.is-light button:active::before { background: var(--control-ghost-pressed); }
.m-nav svg { position: relative; }

/* ---------- Home screen ---------- */
.m-home { display: flex; flex-direction: column; }
.m-apps { position: relative; flex: 1 1 0; min-height: 0; }
/* File (367:2224) Size=Mobile — 92 wide, padding 4/4/6, gap 4, icon 64 */
.m-file {
  position: absolute; width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 4px 6px;
}
.m-file::before { content: ""; position: absolute; inset: 0; background: transparent; }
.m-file.is-pressed::before { background: var(--control-glass-pressed); }
.m-file.is-pressed { --ring: var(--control-glass-pressed-border); }
.m-file:focus-visible { --ring: var(--control-focus-ring); }
.m-file .art { position: relative; width: 64px; height: 64px; }
.m-file .art img { width: 64px; height: 64px; }
.m-file .m-label {
  position: relative; width: max-content; max-width: 100px; flex: none;
  padding: 1px 6px;
  font-weight: 600; font-size: 13px; line-height: 16px;
  color: var(--text-on-dark); text-align: center;
  overflow-wrap: break-word; white-space: pre-line;
}
.m-file .m-label::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(42, 30, 46, 0.3025); }
.m-file .m-label { z-index: 0; }
/* Type=Folder — pixel rounded square (8px steps) with a 2×2 preview of what is inside */
.m-fold { display: block; }
.m-fold-plate { position: absolute; inset: 0; background: var(--text-on-dark); opacity: .32; }
.m-file.is-pressed .m-fold-plate { opacity: .55; }
.m-fold-grid { position: absolute; inset: 0; padding: 6px; display: grid; grid-template-columns: 24px 24px; grid-auto-rows: 24px; gap: 4px; }
.m-fold-grid i { display: block; width: 24px; height: 24px; background-size: cover; background-position: center; image-rendering: pixelated; }
.m-file .m-fold-grid i img { width: 24px; height: 24px; }
/* minis get their own small pixel rounding (2px steps — smaller than the folder's 4/8) */
.m-fold-grid i { clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px); }
.m-fold-grid i.ph-case { background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), url("../assets/img/case-placeholder.png") center / cover no-repeat; }

/* every pressed tile / label plate gets the 4px stepped corners */
.m-file::before, .m-file .m-label::before, .m-cf::before, .m-ai::before, .m-ib::before, .m-li::before {
  clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px);
}
/* pixel squash on press (same as desktop) */
.ph .is-pressed .art { transform: scale(1.03125, 0.96875); }
/* tap: the whole squash → bounce always plays (200ms), then the icon opens */
.ph .is-tap .art { animation: m-tap 200ms steps(1, end); }
@keyframes m-tap {
  0%   { transform: scale(1.0625, 0.9375); }
  40%  { transform: scale(0.9375, 1.0625); }
  70%  { transform: scale(1.03125, 0.96875); }
  100% { transform: none; }
}
.m-file.is-tap::before { background: var(--control-glass-pressed); }
.m-file.is-tap { --ring: var(--control-glass-pressed-border); }
.m-file.is-tap .m-fold-plate { opacity: .55; }
.m-cf.is-tap, .m-ai.is-tap { --tile: var(--control-ghost-pressed); }

/* ---------- transitions between screens ---------- */
.m-zoom-in { animation: m-zoom 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes m-zoom { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.m-folder-open .scrim { animation: m-fade 180ms ease-out; }
.m-folder-open.is-leaving .m-fo { transform: scale(.9); opacity: 0; transition: transform 140ms ease-in, opacity 140ms ease-in; }
.m-folder-open.is-leaving .scrim { opacity: 0; transition: opacity 140ms ease-in; }
.m-app.m-grow { transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease-out; will-change: transform; }
.m-app.is-leaving { transform: scale(.92); opacity: 0; transition: transform 180ms ease-in, opacity 180ms ease-in; pointer-events: none; }
.m-recents { animation: m-fade 180ms ease-out; }
.m-recents .m-rc-card { animation: m-rc-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes m-rc-in { from { transform: scale(1.18); opacity: 0; } }
.m-recents.is-leaving { opacity: 0; transition: opacity 160ms ease-in; pointer-events: none; }

/* ---------- Folder · Open ---------- */
.m-folder-open { z-index: 20; display: flex; align-items: center; justify-content: center; padding: 0 8px 48px; }
.m-folder-open .scrim { position: absolute; inset: 0; background: rgba(20, 13, 26, 0.55); }
.m-fo { position: relative; width: 100%; max-width: 396px; display: flex; flex-direction: column; gap: 20px; }
.m-fo-title { margin: 0; text-align: center; font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 28px; color: var(--text-on-dark); }
.m-fo-panel { background: var(--surface-base); padding: 16px 12px; }
.m-fo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 4px; }
.m-fo-grid.is-apps { grid-template-columns: repeat(3, 1fr); }
.anim-in { animation: m-in 120ms steps(3, end); }
@keyframes m-in { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* Case file (647:1759) Size=Mobile — thumb 168×94, padding 8/8/10, gap 6 */
.m-cf {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; min-width: 0; text-align: center;
}
.m-cf::before { content: ""; position: absolute; inset: 0; background: var(--tile, transparent); }
.m-cf.is-pressed { --tile: var(--control-ghost-pressed); }
.m-cf .thumb { position: relative; display: block; width: 100%; aspect-ratio: 168 / 94.5; background-size: cover; background-position: center; }
.m-cf .thumb.placeholder { background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), url("../assets/img/case-placeholder.png") center / contain no-repeat, #c8c2c4; image-rendering: pixelated; }
.m-cf .name { position: relative; font-weight: 700; font-size: 16px; line-height: 18px; color: var(--text-primary); }
/* app tile inside a folder (games) */
.m-ai { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; }
.m-ai::before { content: ""; position: absolute; inset: 0; background: var(--tile, transparent); }
.m-ai.is-pressed { --tile: var(--control-ghost-pressed); }
.m-ai .art, .m-ai .art img { position: relative; width: 64px; height: 64px; }
.m-ai .name { position: relative; font-weight: 700; font-size: 16px; line-height: 18px; color: var(--text-primary); text-align: center; }

/* ---------- Apps (full screen, no status bar) ---------- */
.m-app { z-index: 10; display: flex; flex-direction: column; background: var(--surface-base); }
.m-app[hidden] { display: none; }
/* app bar floats over the content so it can slide away on scroll; the content starts below it */
.m-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.m-app.bars-hidden .m-top { transform: translateY(-100%); }
.m-app .m-scroll { padding-top: 68px; }
.ph.nav-hidden .m-nav { transform: translateY(100%); }
.m-nav { transition: background-color 160ms ease-out, color 160ms ease-out, transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.ph.nav-hidden .m-app { bottom: 0; }
.m-appbar { height: 64px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 4px; background: var(--surface-base); }
.m-app[data-app="notepad"] .m-appbar { background: var(--app-notepad); }
.m-appbar .title {
  flex: 1 1 0; min-width: 0; margin: 0;
  font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 22px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-div { height: 4px; flex: none; background: var(--border-strong); }
.m-scroll { position: relative; flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.m-scroll::-webkit-scrollbar { display: none; }

/* Icon button (677:6018) Size=Mobile — 48×48, glyph 24 */
.m-ib { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; color: var(--icon-primary); }
.m-ib::before { content: ""; position: absolute; inset: 0; background: var(--tile, transparent); }
.m-ib:active { --tile: var(--control-ghost-pressed); }
.m-ib:focus-visible { --ring: var(--control-focus-ring); }
.m-ib svg { position: relative; }
.m-ib.on-dark { color: var(--text-on-dark); }
.m-ib.on-dark:active { --tile: var(--control-glass-hover); }
.m-app[data-app="notepad"] .m-ib:active { --tile: var(--control-on-accent-pressed); }

/* Notepad */
.m-np { padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; color: var(--text-primary); }
.m-np h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 41px; }
.m-np p { margin: 0; font-size: 16px; line-height: 24px; }

/* ---------- Recent apps ---------- */
.m-recents { z-index: 30; display: flex; flex-direction: column; background: var(--bg-sky-middle) url("../assets/img/wallpaper.webp") center / cover no-repeat; }
.m-rc-track {
  flex: 1 1 0; min-height: 0;
  display: flex; align-items: center; gap: 16px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  padding: 0 calc(50% - var(--card-w) / 2);
  touch-action: none;          /* every gesture is handled in js/mobile.js (sideways scroll, swipe up, tap) */
}
.m-rc-track::-webkit-scrollbar { display: none; }
.m-rc-card { flex: none; width: var(--card-w); display: flex; flex-direction: column; gap: 12px; transition: transform 180ms ease-out, opacity 180ms ease-out; }
.m-rc-head { display: flex; align-items: center; gap: 8px; color: var(--text-on-dark); font-weight: 700; font-size: 16px; line-height: 18px; }
.m-rc-head img { width: 32px; height: 32px; }
.m-rc-prev { position: relative; width: var(--card-w); height: var(--card-h); overflow: hidden; cursor: pointer; }
.m-rc-prev .clone { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
/* stepped mask + 4px outline with corner pixels — nothing behind shows through the corners */
.m-rc-prev { clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px); }
.m-rc-prev::after {
  content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none; --c: var(--border-strong);   /* above the cloned app (z 10) */
  background:
    linear-gradient(var(--c), var(--c)) 4px 0 / calc(100% - 8px) 4px no-repeat,
    linear-gradient(var(--c), var(--c)) 4px 100% / calc(100% - 8px) 4px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 4px / 4px calc(100% - 8px) no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 4px / 4px calc(100% - 8px) no-repeat,
    linear-gradient(var(--c), var(--c)) 4px 4px / 4px 4px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 4px) 4px / 4px 4px no-repeat,
    linear-gradient(var(--c), var(--c)) 4px calc(100% - 4px) / 4px 4px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 4px) calc(100% - 4px) / 4px 4px no-repeat;
}
.m-rc-empty { margin: auto; color: var(--text-on-dark); font-weight: 600; font-size: 16px; line-height: 24px; opacity: .8; }

/* ---------- Bottom sheet (Содержание) ---------- */
.m-sheet-wrap { z-index: 40; }
.m-sheet-wrap .scrim { position: absolute; inset: 0; background: var(--scrim); animation: m-fade 160ms ease-out; }
@keyframes m-fade { from { opacity: 0; } }
.m-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 85%; touch-action: none;
  transition: transform 160ms ease-out;
  display: flex; flex-direction: column;
  background: var(--surface-base);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% 100%, 0 100%, 0 8px, 4px 8px, 4px 4px, 8px 4px);
  animation: m-sheet-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.m-sheet.is-out { transform: translateY(100%); transition: transform 160ms ease-in; }
@keyframes m-sheet-in { from { transform: translateY(100%); } }
.m-sheet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; --c: var(--border-strong);
  background:
    linear-gradient(var(--c), var(--c)) 8px 0 / calc(100% - 16px) 4px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 8px / 4px 100% no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 8px / 4px 100% no-repeat,
    linear-gradient(var(--c), var(--c)) 4px 4px / 4px 4px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 4px) 4px / 4px 4px no-repeat;
}
.m-grip { flex: none; display: flex; justify-content: center; padding: 12px 0 8px; }
.m-grip i { display: block; width: 40px; height: 4px; background: var(--text-muted); }
.m-sheet-head { flex: none; display: flex; align-items: center; padding: 0 4px 0 20px; }
.m-sheet-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 22px; color: var(--text-primary); }
.m-sheet-list { overflow-y: auto; padding: 0 16px 8px; }
/* List item (662:5035) Size=Mobile — min 56, padding 8/12/8/16 */
.m-li {
  position: relative; display: flex; align-items: center; width: 100%; min-height: 56px; padding: 8px 12px 8px 16px;
  font-weight: 700; font-size: 16px; line-height: 18px; color: var(--text-primary); text-align: left;
}
.m-li::before { content: ""; position: absolute; inset: 0; background: var(--tile, transparent); }
.m-li span { position: relative; }
.m-li:active { --tile: var(--control-ghost-pressed); }
.m-li.is-selected { --tile: var(--control-ghost-selected); }

/* ---------- Image viewer ---------- */
.m-viewer { z-index: 50; background: var(--plum); overflow: hidden; touch-action: none; animation: m-fade 140ms ease-out; }
.mv-stage { position: absolute; inset: 0; overflow: hidden; }
.mv-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.mv-img.is-anim { transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.mv-top { position: absolute; left: 0; right: 0; top: 0; height: 64px; display: flex; align-items: center; justify-content: flex-end; padding: 0 4px; transition: background-color 160ms; }
.mv-count { font-weight: 600; font-size: 13px; line-height: 16px; color: var(--text-on-dark); opacity: .7; font-variant-numeric: tabular-nums; }
.mv-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 4px; transition: opacity 160ms; }
.mv-cap { margin: 0; font-weight: 700; font-size: 16px; line-height: 18px; color: var(--text-on-dark); }
.mv-hint { margin: 0; font-weight: 600; font-size: 13px; line-height: 16px; color: var(--text-on-dark); opacity: .6; }
.mv-zoombar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: rgba(42, 30, 46, .8); opacity: 0; pointer-events: none; transition: opacity 160ms; }
.mv-level { font-weight: 600; font-size: 13px; line-height: 16px; color: var(--text-on-dark); font-variant-numeric: tabular-nums; }
/* Minimap: 2px frame (on-dark 30%), plum mat, full-brightness thumbnail; everything outside the viewport is dimmed */
.mv-map { position: relative; padding: 4px; background: var(--plum); box-shadow: inset 0 0 0 2px rgba(255, 244, 214, .3); }
.mv-map-in { position: relative; overflow: hidden; }
.mv-map img { display: block; width: 100%; height: 100%; object-fit: fill; }
.mv-vp { position: absolute; box-shadow: 0 0 0 999px rgba(42, 30, 46, .6), inset 0 0 0 2px var(--text-on-dark); }
.m-viewer.is-zoomed .mv-top { background: rgba(42, 30, 46, .8); }
.m-viewer.is-zoomed .mv-bottom { opacity: 0; }
.m-viewer.is-zoomed .mv-zoombar { opacity: 1; }

/* ---------- GridSync case on the phone (mobile variants of the Case comp blocks) ---------- */
.m-case {
  --type-display-xl-size: 36px; --type-display-xl-lh: 41px;
  --type-display-size: 28px;    --type-display-lh: 34px;
  --type-title-size: 22px;      --type-title-lh: 28px;
  --type-display-sm-size: 18px; --type-display-sm-lh: 22px;
  --type-lead-size: 18px;       --type-lead-lh: 24px;
}
.m-case .case { padding: 24px 16px 40px; }
.m-case .case .cs-root { width: auto; gap: 48px; padding-bottom: 0; }
.m-case .case .cs-sec { width: auto; min-width: 0; }
.m-case .case .w-800, .m-case .case .w-829, .m-case .case .w-720 { width: auto; }
.m-case .case .shot-mat { cursor: zoom-in; }
/* 01 · Overview */
.m-case .case .ov-header { flex-direction: column; align-items: stretch; gap: 24px; }
.m-case .case .ov-shot { width: 100%; height: auto; aspect-ratio: 360 / 204; }
.m-case .case .ov-row { flex-direction: column; gap: 8px; }
.m-case .case .ov-row > :first-child { width: auto; }
/* 02 · Meta — 2×2 */
.m-case .case .meta-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.m-case .case .meta-col, .m-case .case .meta-col:first-child { padding: 0; }
.m-case .case .meta-cols > .div-v, .m-case .case .numbers > .div-v { display: none; }
/* Design process — phases one under another, the loop does not map to a column */
.m-case .case .proc-phases { flex-direction: column; gap: 12px; }
.m-case .case .proc-loop { display: none; }
/* carousels (03 · Context crops, 06 · Twin iterations) — 300 wide cards, snap, dots under */
.m-case .case .ctx-crops, .m-case .case .twins {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 -16px; padding: 0 16px; width: auto;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none;
}
.m-case .case .ctx-crops::-webkit-scrollbar, .m-case .case .twins::-webkit-scrollbar { display: none; }
.m-case .case .ctx-crop, .m-case .case .twins > .shot { flex: 0 0 300px; height: auto !important; scroll-snap-align: start; }
.m-case .case .ctx-crop .shot-mat { flex: none; height: 198px; }
.m-case .case .twins > .shot .shot-mat { flex: none; height: 300px; }
.m-case .case .ctx-arrow { display: none; }
.m-dots { display: flex; justify-content: center; gap: 6px; margin-top: -12px; }
.m-dots i { display: block; width: 6px; height: 6px; background: var(--text-primary); opacity: .3; transition: width 120ms, opacity 120ms; }
.m-dots i.is-on { width: 16px; opacity: 1; }
/* 04 · Problem, 05 · Sources, 11 · Different — stacked */
.m-case .case .pains, .m-case .case .diff-points { flex-direction: column; align-items: stretch; }
.m-case .case .sources { flex-direction: column; gap: 24px; }
/* row items were flex: 1 1 0 (+ overflow hidden) — in a column that collapses them to 0 */
.m-case .case .pain, .m-case .case .diff-point, .m-case .case .source, .m-case .case .cmp-point,
.m-case .case .proc-phase, .m-case .case .needs-main, .m-case .case .needs-side, .m-case .case .ov-title { flex: none; }
/* 05 · User — dossier in one column, stamp on the card */
.m-case .case .sheet { flex-direction: column; gap: 16px; padding: 16px; }
.m-case .case .photo-col { align-items: flex-start; }
.m-case .case .field-row { flex-direction: column; gap: 4px; }
.m-case .case .field-row > :first-child { width: auto; }
.m-case .case .stamp-box { right: 12px; top: 40px; }
/* 05 · Needs */
.m-case .case .needs { flex-direction: column; gap: 24px; }
.m-case .case .needs-side { width: auto; }
/* 05 · User journey — preview + "open full screen" */
.m-case .case .uf-toolbar { height: auto; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 4px 4px 16px; }
.m-case .case .uf-name { width: auto; }
.m-case .case .uf-right { justify-content: space-between; gap: 8px; }
.m-case .case .uf-hint > p { width: auto; }
.m-case .case .uf-hint > svg { display: none; }
.m-case .case .uf-right .ibtn { width: 48px; height: 48px; color: var(--icon-primary); }
.m-case .case .uf-right .ibtn::before { clip-path: none; }
.m-case .case .uf-canvas { height: 360px; }
.m-case .case .uf-viewer.is-full { position: fixed; left: 0; right: 0; top: 0; bottom: var(--nav-h); z-index: 60; background: var(--surface-base); }
.m-case .case .uf-viewer.is-full .uf-canvas { flex: 1 1 0; height: auto; border-radius: 0; }
.m-case .case .uf-viewer.is-full .uf-toolbar { border-radius: 0; }
/* 06 · Progress */
.m-case .case .stage-head { flex-wrap: wrap; row-gap: 4px; }
.m-case .case .stages { gap: 40px; }
.m-case .case .stage > .shot { height: auto !important; }
.m-case .case .stage > .shot .shot-mat { flex: none; }
/* 07 · Solution — one monitor across the width + Было/Стало switch + the active points as a list */
.m-case .case .cmp { width: 100%; height: auto; display: flex; flex-direction: column; gap: 16px; }
.m-case .case .cmp-stage { position: relative; width: 100%; }
.m-case .case .cmp .mon { left: 0 !important; top: 0 !important; transform: scale(var(--cmp-s, .4)) !important; opacity: 1 !important; transition: opacity 200ms; }
.m-case .case .cmp[data-state="before"] .mon-new, .m-case .case .cmp[data-state="after"] .mon-old { opacity: 0 !important; }
.m-case .case .cmp-tabs { position: relative; left: auto; top: auto !important; width: 100%; height: 48px; }
.m-case .case .tabs-track { width: calc(100% - 4px); height: 44px; }
.m-case .case .tabs-knob { left: 4px; top: 4px; width: calc(50% - 4px); height: 40px; }
.m-case .case .cmp[data-state="after"] .tabs-knob { left: 50%; }
.m-case .case .tabs-opt { top: 15px; width: 50%; text-align: center; }
.m-case .case .tabs-opt:first-of-type { left: 0 !important; }
.m-case .case .tabs-opt:last-of-type { left: 50% !important; }
.m-case .case .cmp-points { position: static; width: auto; flex-direction: column; gap: 16px; }
.m-case .case .cmp[data-state="before"] .cmp-points-after, .m-case .case .cmp[data-state="after"] .cmp-points-before { display: none; }
/* 10 · Results */
.m-case .case .business { padding: 20px 16px; }
.m-case .case .numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.m-case .case .stat, .m-case .case .stat.stat-first { padding: 0; }
/* 13 · Thanks */
.m-case .case .outro { width: 100%; height: auto; aspect-ratio: 952 / 256; }
.m-case .case .case-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.m-case .case .next-case { align-items: stretch; }
.m-case .case .next-case > p { width: auto; }
.m-case .case .next-cases { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.m-case .case .next-cases .case-file { width: auto; padding: 8px 8px 10px; gap: 6px; }
.m-case .case .next-cases .case-file .thumb { width: 100%; height: auto; aspect-ratio: 168 / 94.5; clip-path: none; }

/* ---------- Arcade cabinet · Asteroids (Figma: "Mobile · Asteroids · ожидание / игра") ---------- */
.m-arcade { background: #3b2a33; }                       /* palette/plum/800 — the cabinet */
.m-nav.is-arcade { background: #3b2a33; color: var(--text-on-dark); }
.m-marquee {
  position: relative; height: 64px; flex: none;
  display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 16px;
  background: var(--plum);
  /* rows of small sign lights, top and bottom */
  background-image:
    repeating-linear-gradient(90deg, transparent 0 6px, #4a3446 6px 10px, transparent 10px 22px, #e89a3c 22px 26px, transparent 26px 32px),
    repeating-linear-gradient(90deg, transparent 0 6px, #e89a3c 6px 10px, transparent 10px 22px, #4a3446 22px 26px, transparent 26px 32px);
  background-size: 100% 2px, 100% 2px; background-position: 0 6px, 0 56px; background-repeat: no-repeat;
}
.m-marquee::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--plum); }
.mq-title {
  margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 36px; letter-spacing: 2px;
  color: #ffb547; text-shadow: 2px 2px 0 #d65a3c;
}
.m-arcade-screen { position: relative; flex: none; width: 100%; aspect-ratio: 1 / 1; margin-top: 4px; overflow: hidden; background: var(--game-space); touch-action: none; }
.m-arcade-panel {
  position: relative; flex: 1 1 0; min-height: 0;
  display: flex; align-items: center; justify-content: center; padding: 6px 0 0;
  box-shadow: inset 0 4px 0 var(--plum), inset 0 6px 0 #4a3446;
}
.m-sticks { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0 16px; }   /* 16px from the screen edges */
.m-stick { position: relative; width: 144px; height: 144px; touch-action: none; cursor: pointer; }
.m-stick svg { position: absolute; display: block; }
.m-stick .base, .m-stick .ring { left: 0; top: 0; }
.m-stick .ring { color: #7a6474; opacity: .8; }
.m-stick.is-firing .ring { color: #d65a3c; opacity: 1; }
.m-stick .knob { left: 40px; top: 40px; transition: transform 90ms ease-out; pointer-events: none; }
.m-stick.is-active .knob { transition: none; }
/* the game inside: HUD on the phone — hearts with LVL under them on the left, score on the right */
.ast.is-touch .ast-points { position: absolute; right: 16px; top: 16px; margin: 0; font-family: var(--font-display); font-size: 18px; line-height: 24px; color: var(--text-on-dark); font-variant-numeric: tabular-nums; pointer-events: none; }
.ast.is-touch .ast-points[hidden] { display: none; }
.ast.is-touch .ast-title { font-size: 40px; line-height: 48px; }
.ast.is-touch .ast-screen { gap: 16px; }
.ast-touch-help { margin: 0; font-weight: 600; font-size: 13px; line-height: 20px; color: var(--text-on-dark); opacity: .75; }
.m-arcade-screen { cursor: pointer; }
/* the blinking СТАРТ on the screen — the whole screen is the button (Mobile/Heading/S) */
.ast-tap { margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 18px; line-height: 22px; color: #ffb547; animation: ast-blink 1s steps(1, end) infinite; }
.ast-tap svg { display: block; }
@media (prefers-reduced-motion: reduce) { .ast-tap { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  .anim-in, .m-sheet, .m-sheet-wrap .scrim, .m-viewer { animation: none; }
  .mv-img.is-anim { transition: none; }
}

/* ---------- Pond on the phone: ← → on the left, ↑ ↓ on the right, 16px from the screen edges ---------- */
.m-dpad { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0 20px; }   /* 16px + the 4px outline */
.m-dpad-pair { display: flex; gap: 12px; }
.m-dpad-pair.is-v { flex-direction: column; }
.m-dpad-b {
  position: relative; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px;
  margin: 0; padding: 0; border: 0; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none;
  color: #ffb547; background: #4a3446;
  /* pixel bevel: light top/left, dark bottom/right, outline around */
  box-shadow: inset 4px 4px 0 #5a4a58, inset -4px -4px 0 #2a1e2e, 0 0 0 4px #2a1e2e;
}
.m-dpad-b svg { display: block; }
.m-dpad-b.is-pressed { color: #ffe7a3; background: #3b2a33; box-shadow: inset 4px 4px 0 #2a1e2e, 0 0 0 4px #2a1e2e; }
.m-dpad-b.is-pressed svg { transform: translate(2px, 2px); }
/* the square screen gives way so the ↑ ↓ column (2 × 72 + 12 gap + outlines) always fits above the navigation bar */
.m-pond .m-arcade-screen { align-self: center; width: min(100%, calc(100dvh - 64px - 4px - 48px - 188px)); }
