/* ============================================================
   LIGHT TABLE: the Flippy look. An animator's desk at night.

   Loaded last, so it restyles the app without rewriting the older stylesheets.
   Design source: "Flippy UI Style Options" canvas, Light Table page.

   Rules of the look:
     Blue is for tools and main actions. Red is for what's selected, and warnings.
     Sheets hang from a lit peg bar. Frame cells show progress.
     Watch at the top, touch at the bottom.

   Sections:
     1. Fonts and tokens
     2. App shell: header, brand, bottom tabs
     3. Home
     4. Editor: preview, stage, tool deck, timeline, states
     5. Buttons, fields, toasts
     6. Sheets, tour, header menus
     7. Sliders and small sheet details
     8. Camera
     9. Gallery
    10. Account
    11. Splash
    12. Pro gate and paywall
    13. Export, Background, Submit and project sheets
    14. Sideways and wide screens
    15. Mouse and trackpad (hover and press, never on touch)
   ============================================================ */

/* ---------- 1. Fonts and tokens ---------- */
@font-face { font-family: 'Bebas Neue'; src: url('../fonts/BebasNeue-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/IBMPlexMono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/IBMPlexMono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/IBMPlexMono-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/IBMPlexMono-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --lt-desk: #0C1219;
  --lt-deck: #111B25;
  --lt-band: #0A1016;
  --lt-line: #2B3D4C;
  --lt-lit: #E9F6FC;
  --lt-strip: linear-gradient(180deg, #D5E8F1, #C3DCE8);
  --lt-strip-edge: #9CC4D6;
  --lt-ink: #3C6478;
  --lt-blue: #8FD8F2;
  --lt-red: #FF5C4D;
  --lt-text: #FFFFFF;
  --lt-body: #CFDCE4;
  --lt-dim: #8CA3B3;
  --lt-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --lt-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --lt-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  /* Full-screen layers have to clear the status bar too. iPhones report it through
     env(); Android reports it through --safe-area-top from MainActivity. */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-area-top, 0px));
  --lt-tabs: 54px;
  --lt-key: 52px;
  --lt-scrim: rgba(6, 10, 14, 0.66);
  --lt-pegs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='186' height='20' viewBox='0 0 186 20'%3E%3Cg fill='%230C1219'%3E%3Crect x='0' y='5.500' width='28' height='9' rx='4.500'/%3E%3Ccircle cx='93' cy='10' r='6'/%3E%3Crect x='158' y='5.500' width='28' height='9' rx='4.500'/%3E%3C/g%3E%3C/svg%3E");

  /* The app's own tokens, pointed at Light Table */
  --bg: var(--lt-desk);
  --bg2: var(--lt-desk);
  --bg3: var(--lt-band);
  --surface-bg: var(--lt-desk);
  --surface-bg-hover: var(--lt-desk);
  --border: var(--lt-line);
  --accent: var(--lt-blue);
  --accent2: var(--lt-blue);
  --text: var(--lt-text);
  --text-muted: var(--lt-body);
  --danger: var(--lt-red);
  --bevel-ll: transparent;
  --bevel-l: transparent;
  --bevel-d: transparent;
  --bevel-dd: transparent;
  --btn-bg: var(--lt-deck);
  --header-height: 46px;
  --site-header-height: 46px;
  --timeline-height: 76px;
  --thumb-chrome: 0px;
  --site-header-bg: var(--lt-desk);
  --site-header-fg: var(--lt-text);
  --site-header-bevel-light: transparent;
  --site-header-bevel-mid: transparent;
  --site-header-bevel-dark: transparent;
  --site-header-button-bg: transparent;

  /* Gallery tokens */
  --win98-bg: var(--lt-deck);
  --win98-dark: var(--lt-line);
  --win98-darker: var(--lt-body);
  --win98-title: var(--lt-text);
  --win98-title-fg: var(--lt-text);
  --body-bg: var(--lt-desk);
  --tile-bg: var(--lt-band);
  --tile-hover: var(--lt-band);
  --text-dim: var(--lt-body);
  --font: var(--lt-sans);
}

/* ---------- 2. App shell ---------- */
html { color-scheme: dark; }
html, body { background: var(--lt-desk); color: var(--lt-text); font-family: var(--lt-sans); }
body { font-size: 14px; }
::selection { background: var(--lt-blue); color: var(--lt-desk); }

#app { background: radial-gradient(120% 60% at 50% 30%, #16222E 0, var(--lt-desk) 62%); background-color: var(--lt-desk); }
#workspace-main, #workspace-tab-panels, #main-preview { background: transparent; }

#header.site-header {
  padding: 0 6px;
  background: transparent;
  border: 0;
  font-family: var(--lt-sans);
}
#btn-logo-menu.header-avatar-btn.site-logo-button,
#btn-logo-menu.header-avatar-btn.site-logo-button:active,
#btn-logo-menu.header-avatar-btn.site-logo-button.is-open {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--lt-blue);
}
#btn-logo-menu .hamburger-icon { width: 20px; height: 13px; display: flex; flex-direction: column; justify-content: space-between; }
#btn-logo-menu .hamburger-icon span { display: block; width: 100%; height: 1.5px; margin: 0; background: var(--lt-blue); border-radius: 0; box-shadow: none; }
#header-project-title, .header-tab-title {
  font-family: var(--lt-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  letter-spacing: 1.2px;
  padding-top: 2px;
  color: var(--lt-text);
}
#header-project-title { max-width: none; flex: 1 1 auto; min-width: 0; }
#header .btn-icon,
.site-header-actions #btn-help,
.site-header-actions #btn-fullscreen {
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--lt-blue);
}
.site-header-actions #btn-help svg { width: 22px; height: 22px; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.site-header-actions #btn-help svg line { stroke-width: 2.4; } /* the question mark's dot: a near-zero line that needs round caps */
.site-header-actions #btn-fullscreen svg { width: 20px; height: 20px; }
#btn-editor-back svg { stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#btn-login.header-auth-btn {
  height: 44px;
  min-height: 44px;
  min-width: 0;
  padding: 0 6px;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--lt-blue);
  font-family: var(--lt-mono);
  font-size: 13px;
  font-weight: 500;
}
.header-avatar-btn { background: none; border: 0; box-shadow: none; }
.header-user-avatar { width: 34px; height: 34px; border: 0; border-radius: 0; object-fit: cover; }
#btn-user-menu { position: relative; width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; }
#toolbar-pro-badge { position: absolute; right: 1px; bottom: 2px; }

/* Only shown while saving, floated so the title doesn't jump */
.autosave-status {
  margin-right: 10px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 0 4px 8px;
  background: var(--lt-desk);
  border: 0;
  box-shadow: none;
  color: var(--lt-dim);
  font-family: var(--lt-mono);
  font-size: 10px;
}

/* Brand header on Projects. The tab below says where you are, so the bar carries the name. */
#header-brand { display: none; flex: 1 1 auto; min-width: 0; align-items: center; gap: 9px; margin-left: 2px; }
#header-brand img { flex: none; display: block; width: 40px; height: 40px; }
#header-brand .brand-text { min-width: 0; display: flex; flex-direction: column; }
#header-brand b { color: var(--lt-text); font-family: var(--lt-display); font-size: 25px; font-weight: 400; line-height: 1; letter-spacing: 1.2px; }
#header-brand small { display: block; margin-top: 1px; line-height: 1; color: var(--lt-text); font-family: var(--lt-display); font-size: 13px; letter-spacing: 1.2px; white-space: nowrap; }
#header-brand small i { margin-right: 3px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 9.5px; font-style: normal; letter-spacing: 0; }
body.projects-tab-active #header-brand { display: flex; }

.header-tab-title { display: none; flex: 1 1 auto; min-width: 0; margin-left: 4px; }
body.gallery-tab-active #header-title-gallery, body.admin-tab-active #header-title-admin { display: block; }

#header-frame-count { display: none; flex: none; margin-right: 2px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11px; font-weight: 500; white-space: nowrap; }
body.editor-tab-active #header-frame-count:not(:empty) { display: block; }

/* Tabs live at the bottom, in thumb reach, in a console like the Editor's */
#workspace-tabs {
  position: fixed;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex: none;
  flex-direction: row;
  align-items: stretch;
  width: auto;
  height: calc(var(--lt-tabs) + var(--safe-bottom));
  min-width: 0;
  gap: 0;
  padding: 0 0 var(--safe-bottom);
  box-sizing: border-box;
  background: var(--lt-deck);
  box-shadow: inset 0 1px 0 var(--lt-line);
}
.workspace-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: var(--lt-tabs);
  margin: 0;
  padding: 0;
  color: var(--lt-dim);
  font-family: var(--lt-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
  writing-mode: horizontal-tb;
  transform: none;
  box-shadow: inset -1px 0 0 var(--lt-line), inset 0 1px 0 var(--lt-line);
}
.workspace-tab svg { display: block; width: 22px; height: 22px; color: var(--lt-blue); }
.workspace-tab:last-child { box-shadow: inset 0 1px 0 var(--lt-line); }
.workspace-tab::before, .workspace-tab::after { display: none !important; }
#tab-admin::before {
  content: '';
  display: block !important;
  position: static;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FD8F2' stroke-width='1.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 2.700v5.300c0 4.700-2.900 8-7 10-4.100-2-7-5.300-7-10V5.700z'/%3E%3C/svg%3E") center / contain no-repeat;
  box-shadow: none;
  transform: none;
}
.workspace-tab.active { width: auto; color: var(--lt-text); box-shadow: inset -1px 0 0 var(--lt-line), inset 0 1px 0 var(--lt-line), inset 0 -3px 0 var(--lt-red); }
.workspace-tab.active:last-child { box-shadow: inset 0 1px 0 var(--lt-line), inset 0 -3px 0 var(--lt-red); }
#tab-editor { display: none; }
#workspace-main { padding-left: 0; }
#timeline-wrapper { margin-left: 0; }

#btn-editor-back, #header-project-title, #autosave-status { display: none; }
body.editor-tab-active #btn-editor-back { display: flex; align-items: center; justify-content: center; flex: none; }
body.editor-tab-active #header-project-title { display: block; }
body.editor-tab-active #autosave-status.is-visible { display: inline; }
body.editor-tab-active #btn-logo-menu.header-avatar-btn.site-logo-button,
body.editor-tab-active #workspace-tabs,
body.editor-tab-active #btn-login,
body.editor-tab-active #toolbar-user { display: none !important; }
body.editor-tab-active #header .header-left { flex: 1 1 auto; min-width: 0; }
#header .header-left { flex: 1 1 auto; min-width: 0; }
#btn-new-project, #btn-open-project, #btn-rename-project, #btn-delete-project { display: none; }

/* Home needs the room the timeline would use, like the Gallery and Admin */
body.projects-tab-active #timeline-wrapper { display: none; }
body.projects-tab-active #inline-handle-svg,
body.projects-tab-active #handle-svg,
body.projects-tab-active #corner-loupe,
body.projects-tab-active #inline-corner-loupe,
body.projects-tab-active #onnx-progress-bar { display: none !important; }
@media (orientation: portrait) {
  body.projects-tab-active #workspace-main {
    flex: 0 1 calc(100% - var(--header-height));
    height: calc(100% - var(--header-height));
  }
}
@supports (height: 100dvh) {
  @media (orientation: portrait) {
    body.projects-tab-active #workspace-main {
      flex-basis: calc(100dvh - var(--header-height) - var(--safe-bottom));
      height: calc(100dvh - var(--header-height) - var(--safe-bottom));
    }
  }
}
/* Pages above the bottom tabs scroll clear of them */
#gallery-view, #admin-view { padding-bottom: calc(var(--lt-tabs) + var(--safe-bottom)); box-sizing: border-box; }

/* ---------- 3. Home ---------- */
#projects-view { flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#home { width: 100%; max-width: 760px; margin: 0 auto; padding: 2px 0 calc(var(--lt-tabs) + 54px + var(--safe-bottom) + 12px); box-sizing: border-box; }
#btn-home-new {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--lt-tabs) + var(--safe-bottom));
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0;
  background: var(--lt-blue);
  border: 0;
  box-shadow: none;
  color: var(--lt-desk);
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#btn-home-new svg { width: 20px; height: 20px; stroke-linecap: round; }
#home-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
#home-list[hidden], #home-empty[hidden], #home-limit[hidden] { display: none; }
.home-row { position: relative; display: flex; align-items: center; height: 86px; padding: 0 4px 0 10px; box-sizing: border-box; background: none; box-shadow: inset 0 -1px 0 var(--lt-line); }
.home-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: var(--lt-text);
  font-family: var(--lt-mono);
  text-align: left;
  cursor: pointer;
}
.home-thumb { position: relative; flex: none; width: 122px; height: 70px; overflow: hidden; display: block; background: var(--lt-band); box-shadow: 0 0 0 1px var(--lt-line); }
.home-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; }
.home-thumb img.on { opacity: 1; }
.home-thumb.is-blank { display: flex; align-items: center; justify-content: center; color: var(--lt-dim); }
.home-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home-name { font-family: var(--lt-display); font-size: 22px; line-height: 1.05; letter-spacing: 0.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-frames, .home-date { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11px; line-height: 1.25; }
.home-more { flex: none; align-self: center; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0; background: none; border: 0; cursor: pointer; }
.home-more i { display: block; width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--lt-blue); }
#home-empty { padding: 16px 18px 0; }
#home-empty h1 { margin: 22px 0 0; color: var(--lt-text); font-family: var(--lt-display); font-size: 44px; font-weight: 400; line-height: 1; letter-spacing: 1.2px; }
#home-empty p { margin: 10px 0 0; color: var(--lt-body); font-size: 14.5px; line-height: 1.45; }
.home-empty-art { height: 270px; background: url('../flipjaw-marks.svg') no-repeat center / auto 270px, radial-gradient(closest-side at 50% 50%, rgba(143, 216, 242, 0.32), rgba(143, 216, 242, 0)); }
#home-limit { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; background: none; box-shadow: inset 0 -1px 0 var(--lt-line); }
#home-limit p { margin: 0; color: var(--lt-body); font-size: 14.5px; line-height: 1.45; }
#home-limit #home-limit-count { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
#home-limit.is-full #home-limit-count { color: var(--lt-red); }
#home-limit-cells { display: flex; gap: 3px; height: 12px; }
#home-limit-cells i { flex: 1 1 0; background: var(--lt-line); }
#home-limit-cells i.on { background: var(--lt-blue); }
#home-limit.is-full #home-limit-cells i.on { background: var(--lt-red); }
#home-limit .btn-secondary { min-height: 52px; margin-top: 4px; }
@media (min-width: 700px) {
  #home-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 4. Editor ---------- */
/* The console. Tool groups dissolve into one grid, so every button sits on the same lines. */
#tool-deck {
  position: relative;
  z-index: 8;
  flex: none;
  display: grid;
  grid-template-columns: 68px repeat(6, minmax(0, 1fr));
  grid-template-rows: var(--lt-key) var(--lt-key);
  background: var(--lt-deck);
  box-shadow: inset 0 1px 0 var(--lt-line);
}
#tool-deck .preview-overlay-actions,
#tool-deck .hover-btn-wrap { display: contents !important; }
#btn-detect-corners { grid-area: 1 / 1; }
#btn-corner-snap { grid-area: 1 / 2; }
#btn-rotate-ccw { grid-area: 1 / 3; }
#btn-camera { grid-area: 1 / 4; }
#btn-frame-add { grid-area: 1 / 5; }
#btn-frame-dup { grid-area: 1 / 6; }
#btn-frame-trash { grid-area: 1 / 7; }
#btn-detect-all { grid-area: 2 / 1; }
/* Lite: free Detect Alls left ("2 free"), or PRO once they're used up. */
.detect-all-badge {
  position: absolute; top: 3px; right: 3px; padding: 1px 3px;
  background: var(--lt-blue); color: var(--lt-desk);
  font: 600 8px/10px var(--lt-mono); white-space: nowrap; pointer-events: none;
}
.detect-all-badge.is-pro { background: var(--lt-red); }
#btn-play-pause { grid-area: 2 / 2; }
#btn-fps-hover { grid-area: 2 / 3; }
#btn-margin-hover { grid-area: 2 / 4; }
#btn-clear { grid-area: 2 / 5; }
#btn-download-gif { grid-area: 2 / 6 / auto / span 2; }

.preview-overlay-btn {
  position: relative;
  width: auto;
  height: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: inset -1px -1px 0 var(--lt-line);
  color: var(--lt-blue);
  font-family: var(--lt-mono);
  font-size: 19px;
  font-weight: 500;
  line-height: 22px;
}
.preview-overlay-btn::after {
  content: attr(data-label);
  color: var(--lt-dim);
  font-family: var(--lt-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
#btn-frame-trash, #btn-download-gif { box-shadow: inset 0 -1px 0 var(--lt-line); }
.preview-overlay-btn:hover { background: none; }
.preview-overlay-btn:active { background: rgba(143, 216, 242, 0.14); border: 0; }
.preview-overlay-btn svg { width: 22px; height: 22px; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.preview-overlay-btn.active { background: none; border: 0; box-shadow: inset -1px -1px 0 var(--lt-line), inset 0 -3px 0 var(--lt-red); color: var(--lt-text); }
.preview-overlay-btn.active::after { color: var(--lt-text); }
.preview-overlay-btn:disabled { opacity: 0.34; color: var(--lt-blue); }
.preview-overlay-danger:hover { color: var(--lt-blue); }
#btn-camera:not(:disabled), #btn-download-gif:not(:disabled) { background: var(--lt-blue); color: var(--lt-desk); }
#btn-camera:not(:disabled)::after, #btn-download-gif:not(:disabled)::after { color: var(--lt-desk); }
#btn-download-gif:disabled { background: rgba(143, 216, 242, 0.2); opacity: 1; color: rgba(143, 216, 242, 0.5); }
#btn-download-gif:disabled::after { color: rgba(143, 216, 242, 0.5); }
.preview-overlay-btn.detect-stop-active, .preview-overlay-btn.detect-stop-active:hover { background: var(--lt-red); color: var(--lt-desk); opacity: 1; }
.preview-overlay-btn.detect-stop-active::after { content: 'Stop'; color: var(--lt-desk); }
#btn-play-pause::after { content: 'Play'; }
#btn-play-pause.is-playing::after { content: 'Pause'; }
.hover-btn-wrap:has(> .hover-panel[style*="flex"]) > .preview-overlay-btn { box-shadow: inset -1px -1px 0 var(--lt-line), inset 0 -3px 0 var(--lt-red); color: var(--lt-text); }
.hover-btn-wrap:has(> .hover-panel[style*="flex"]) > .preview-overlay-btn::after { color: var(--lt-text); }
/* Frame tools wait for a frame, like the rest of the deck waits for frames */
#frame-preview-panel:not(.has-frame) ~ #tool-deck #frame-left-actions .preview-overlay-btn:not(.detect-stop-active) { opacity: 0.34; pointer-events: none; }

#frame-preview-panel { border: 0; }
#gif-preview-panel:hover, #frame-preview-panel:hover { background: transparent; }

/* Readouts */
.panel-label,
#frame-filename-overlay,
#gif-size-overlay {
  padding: 3px 6px;
  background: rgba(12, 18, 25, 0.78);
  border: 0;
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-weight: 500;
  font-size: 10px;
  line-height: 12px;
  letter-spacing: 0;
}
#panel-label-preview { display: flex; align-items: center; gap: 5px; top: 6px; left: 6px; transform: none; text-transform: none; }
#panel-label-preview::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lt-red); }
#frame-preview-panel .panel-label { top: 7px; left: 10px; padding: 0; transform: none; background: none; color: var(--lt-ink); font-weight: 600; line-height: 10px; }
#frame-filename-overlay { top: 7px; right: 10px; left: auto; bottom: auto; width: auto; max-width: calc(50% - 106px); padding: 0; transform: none; background: none; color: var(--lt-ink); font-weight: 600; line-height: 10px; }
#gif-size-overlay { top: auto; bottom: 6px; right: 6px; left: auto; transform: none; }

/* Preview */
#gif-preview-panel { --gif-left-clearance: 0px; --gif-right-clearance: 0px; padding: 0; background: var(--lt-band); }
#preview-canvas { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
#gif-status {
  position: absolute;
  inset: 0;
  gap: 0;
  overflow: hidden;
  color: var(--lt-body);
  font-family: var(--lt-sans);
  font-size: 14.5px;
}
.sample-gif-preview { width: 100%; height: 100%; max-width: none; object-fit: cover; }
#gif-status-text { font-size: 14.5px; line-height: 1.45; text-align: center; }
#gif-status-text:not(:empty) {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 9px 12px 28px;
  background: rgba(10, 16, 22, 0.88);
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 15px;
  text-align: left;
}
#gif-spinner { position: absolute; left: 12px; right: 12px; bottom: 9px; width: auto; }
/* A rebuild's progress over the preview that's still playing */
#gif-status.is-overlay { pointer-events: none; }
#gif-status.is-overlay .fp-logo { display: none; }

/* Stage: the lit table, with its peg bar */
#frame-preview-panel {
  --frame-left-clearance: 0px;
  --frame-right-clearance: 0px;
  z-index: 1;
  padding: 31px 15px 7px;
  background: var(--lt-lit);
  box-shadow: 0 0 34px rgba(160, 225, 255, 0.34), 0 0 90px rgba(120, 200, 255, 0.14);
}
#frame-preview-panel:hover { background: var(--lt-lit); }
#frame-preview-panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 24px;
  background: var(--lt-strip);
  box-shadow: 0 1px 0 var(--lt-strip-edge);
  pointer-events: none;
}
#frame-preview-panel::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 2px;
  width: 186px;
  height: 20px;
  margin-left: -93px;
  background: var(--lt-pegs) no-repeat center;
  pointer-events: none;
}
#frame-preview-panel #inline-adjust-wrap { inset: 31px 15px 7px 15px !important; background: transparent !important; overflow: visible !important; }
#frame-preview-panel #inline-adjust-canvas { box-shadow: 0 0 0 1px rgba(60, 100, 120, 0.25); }

/* Empty stage: blank table, field guide and center marks */
#frame-preview-status {
  --bg: var(--lt-lit);
  position: absolute;
  left: 15px;
  right: 15px;
  top: 31px;
  bottom: 7px;
  padding: 0 24px;
  justify-content: center;
  gap: 12px;
  border: 1px dashed #8FC6DC;
  color: var(--lt-ink);
  font-family: var(--lt-sans);
  font-size: 14.5px;
  font-weight: 500;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(143, 198, 220, 0.8) calc(50% - 0.5px), rgba(143, 198, 220, 0.8) calc(50% + 0.5px), transparent calc(50% + 0.5px)) center / 100% 100% no-repeat,
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(143, 198, 220, 0.8) calc(50% - 0.5px), rgba(143, 198, 220, 0.8) calc(50% + 0.5px), transparent calc(50% + 0.5px)) center / 100% 100% no-repeat;
}
#frame-preview-status-text { position: relative; padding: 2px 6px; background: var(--lt-lit); color: var(--lt-ink); font-size: 14.5px; line-height: 1.45; text-align: center; }
#frame-preview-status-text svg { color: var(--lt-ink); vertical-align: -3px; }
.preview-empty-icon { position: relative; color: var(--lt-ink); opacity: 1; width: 86px; height: auto; background: var(--lt-lit); }
/* A frame paging in shows nothing, not a flash of the empty message */
#frame-preview-status.is-loading .preview-empty-icon, #frame-preview-status.is-loading #frame-preview-status-text { visibility: hidden; }
#frame-processing-status { position: relative; flex-direction: column; gap: 12px; padding: 8px 12px; background: var(--lt-lit); }
#frame-processing-status, #frame-processing-text { color: var(--lt-ink); font-family: var(--lt-mono); font-size: 14px; font-weight: 500; }

/* Frame cells: fill in one by one. Numbers in the status text drive the fill where there are any. */
.spinner {
  --cell-off: var(--lt-line);
  --cell-on: var(--lt-blue);
  position: relative;
  width: 237px;
  max-width: 100%;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: repeating-linear-gradient(90deg, var(--cell-off) 0 12px, transparent 12px 15px);
  animation: none;
}
.spinner::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 12px;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--cell-on) 0 12px, transparent 12px 15px);
  animation: lt-cells 2.4s steps(16, end) infinite;
}
.spinner[data-progress]::after { width: var(--lt-progress, 0%); animation: none; }
#frame-processing-status .spinner { --cell-off: #C4DAE5; --cell-on: var(--lt-ink); }
@keyframes lt-cells { to { width: 240px; } }
@media (prefers-reduced-motion: reduce) { .spinner::after { width: 40%; animation: none; } }

/* Corner handles: round and translucent, in red pencil, so the page corner shows through */
#inline-handle-svg circle, #handle-svg circle {
  fill: var(--lt-red);
  fill-opacity: 0.2;
  stroke: var(--lt-red);
  stroke-width: 1.5;
}
.corner-cross { fill: none; stroke: var(--lt-red); stroke-width: 1.5; pointer-events: none; }
.corner-label-text {
  fill: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 9px;
  font-weight: 500;
  paint-order: stroke;
  stroke: rgba(12, 18, 25, 0.82);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.corner-handle { r: 15px; }
#inline-corner-poly, #corner-poly { stroke: var(--lt-red); stroke-width: 1.5; }
#inline-corner-mask-path, #corner-mask-path { fill: rgba(10, 16, 22, 0.32); }

#corner-loupe, #inline-corner-loupe {
  border: 2px solid var(--lt-red) !important;
  border-radius: 50% !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

/* Timeline */
#timeline-wrapper {
  background: var(--lt-band);
  border: 0;
  box-shadow: inset 0 1px 0 var(--lt-line), 0 120px 0 var(--lt-band);
}
#image-list { padding: 8px 6px 10px; gap: 6px; }
.image-item { padding: 0; }
.item-thumb { border: 0; background: var(--lt-band); box-shadow: 0 0 0 1px var(--lt-line); }
.frame-num {
  top: 0;
  left: 0;
  padding: 1px 4px;
  background: rgba(12, 18, 25, 0.82);
  border: 0;
  color: #D5E2EA;
  font-family: var(--lt-mono);
  font-weight: 500;
  font-size: 10px;
  line-height: 13px;
}
.image-item.selected-frame { outline: 2px solid var(--lt-red); outline-offset: 0; }
.image-item.selected-frame .frame-num { background: var(--lt-red); color: var(--lt-desk); }
#empty-state { padding: 0 20px; }
#empty-state p { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12px; font-weight: 500; }

/* Speed and Margin open upward from the deck, over the stage, so the preview stays in view */
#tool-deck .hover-panel,
#tool-deck .preview-overlay-left .hover-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: 100%;
  width: auto;
  min-width: 0;
  min-height: 60px;
  box-sizing: border-box;
  padding: 0 14px;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  background: var(--lt-deck);
  border: 0;
  box-shadow: inset 0 1px 0 var(--lt-line), 0 -14px 30px rgba(0, 0, 0, 0.35);
  color: var(--lt-text);
  z-index: 12;
}
.hover-panel-header { flex: none; flex-direction: column; align-items: flex-start; gap: 2px; }
.hover-panel-label { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
.hover-panel-value { min-width: 0; color: var(--lt-text); font-family: var(--lt-mono); font-size: 25px; font-weight: 500; line-height: 1; text-align: left; }
.hover-option { flex: 1; height: 46px; background: transparent; border: 0; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-text); font-family: var(--lt-mono); font-size: 13.5px; font-weight: 500; text-align: center; }
.hover-option:hover { background: transparent; }
.hover-option:active, .hover-option.active { background: var(--lt-blue); border: 0; box-shadow: none; color: var(--lt-desk); }

/* Phones held upright: preview, stage, deck, then the timeline at the very bottom */
@media (orientation: portrait) {
  #main-preview { padding: 0; gap: 3px; }
  #gif-preview-panel { flex: 225 1 0; min-height: 120px; max-height: calc(100vw / 1.73); overflow: hidden; }
  #frame-preview-panel { flex: 270 1 0; min-height: 180px; overflow: visible; }
}

/* ---------- 5. Buttons, fields, toasts ---------- */
.btn-secondary, .btn-primary, .btn-dialog {
  min-height: 52px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--lt-line);
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 600;
}
.btn-secondary:hover, .btn-primary:hover { background: transparent; }
.btn-secondary:active, .btn-primary:active { background: rgba(143, 216, 242, 0.14); border: 0; box-shadow: inset 0 0 0 1px var(--lt-line); }

/* The main action in a sheet */
#btn-confirm-ok, #win98-info-ok, #win98-err-ok, #share-warn-ok, #export-go, #loop-go, #rename-project-save, #bg-picker-ok,
#app-stats-ok, #getpro-ok, #paywall-subscribe, #pro-gate-login, #submit-gallery-send, #unlisted-ok, #win98-diag-send,
[data-ob="next"], #sheet-primary {
  background: var(--lt-blue) !important;
  color: var(--lt-desk) !important;
  box-shadow: none !important;
}
#confirm-modal.is-warning #btn-confirm-ok { background: var(--lt-red) !important; color: var(--lt-desk) !important; }

#toast, .panel-toast {
  padding: 8px 12px;
  background: var(--lt-deck);
  border: 0;
  box-shadow: 0 0 0 1px var(--lt-line), 0 10px 24px rgba(0, 0, 0, 0.45);
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 16px;
}

/* Messages over the preview sit along its bottom edge, like the export progress strip */
#gif-preview-panel .panel-toast {
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: auto;
  max-width: none;
  transform: none;
  padding: 7px 12px;
  background: rgba(10, 16, 22, 0.88);
  box-shadow: none;
  text-align: left;
  white-space: normal;
}
#gif-preview-panel .panel-toast[data-progress] { padding-bottom: 26px; }
#gif-preview-panel .panel-toast[data-progress]::before,
#gif-preview-panel .panel-toast[data-progress]::after {
  content: '';
  position: absolute;
  left: 12px;
  bottom: 8px;
  height: 12px;
}
#gif-preview-panel .panel-toast[data-progress]::before { right: 12px; background: repeating-linear-gradient(90deg, var(--lt-line) 0 12px, transparent 12px 15px); }
#gif-preview-panel .panel-toast[data-progress]::after { width: var(--lt-progress, 0); background: repeating-linear-gradient(90deg, var(--lt-blue) 0 12px, transparent 12px 15px); }

/* ---------- 6. Sheets: a page pinned to the peg bar ---------- */
.ad-sheet-overlay, #win98-error-popup, #win98-diagnostics-popup, #confirm-modal.overlay, #help-modal.overlay {
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  background: var(--lt-scrim) !important;
  color: var(--lt-text) !important;
  font-family: var(--lt-sans) !important;
  font-size: 14.5px !important;
}
[data-win98-panel], #win98-error-popup > div, #win98-diagnostics-popup > div, #confirm-modal-panel, #help-modal-panel {
  position: relative;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 560px !important;
  max-height: none !important;
  padding: 36px 14px calc(14px + var(--safe-bottom));
  overflow: visible !important;
  background: var(--lt-deck) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.5) !important;
  color: var(--lt-body);
  font-size: 14.5px;
  line-height: 1.45;
}
/* The lit strip */
[data-win98-panel]::before, #win98-error-popup > div::before, #win98-diagnostics-popup > div::before, #confirm-modal-panel::before, #help-modal-panel::before,
.profile-popup .win98-window::before, .ad-sheet-overlay > .win98-window::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 20px;
  background: var(--lt-strip);
  box-shadow: 0 1px 0 var(--lt-strip-edge);
  pointer-events: none;
}
/* The pegs */
[data-win98-panel]::after, #win98-error-popup > div::after, #win98-diagnostics-popup > div::after, #confirm-modal-panel::after, #help-modal-panel::after,
.profile-popup .win98-window::after, .ad-sheet-overlay > .win98-window::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 186px;
  height: 20px;
  margin-left: -93px;
  background: var(--lt-pegs) no-repeat center;
  pointer-events: none;
}

[data-win98-titlebar], #win98-err-titlebar, #win98-diagnostics-popup > div > div:first-child, #confirm-modal .panel-header, #help-modal .panel-header {
  display: block !important;
  min-height: 0;
  padding: 0 40px 10px 0 !important;
  background: none !important;
  border: 0 !important;
}
[data-win98-title], #win98-err-title, #win98-diag-title, #confirm-modal .panel-title, #help-modal .panel-title {
  display: block;
  color: var(--lt-text) !important;
  font-family: var(--lt-display) !important;
  font-size: 27px !important;
  font-weight: 400 !important;
  line-height: 1.05 !important;
  letter-spacing: 1.2px;
  text-transform: none;
}
[data-win98-close], #win98-err-close, #win98-diag-close, #confirm-modal .btn-close, #help-modal .btn-close {
  position: absolute;
  right: 4px;
  top: 24px;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--lt-blue) !important;
  font-size: 18px !important;
  line-height: 44px !important;
}

/* Sheet bodies. Older dialogs set colors inline, so the overrides need !important. */
[data-win98-body], #confirm-modal-body, #help-modal-body {
  max-height: calc(100dvh - 170px);
  padding: 0 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: none !important;
  color: var(--lt-body);
  font-size: 14.5px;
  line-height: 1.45;
}
[data-win98-body] [style*="color:#"], #win98-error-popup [style*="color:#"], #win98-diagnostics-popup [style*="color:#"] { color: var(--lt-body) !important; }
[data-win98-body] [style*="font-size:12px"] { font-size: 14.5px !important; }
[data-win98-body] [style*="font-size:11px"] { font-size: 12.5px !important; color: var(--lt-dim) !important; }
[data-win98-body] [style*="font-weight:bold"], #win98-err-head { color: var(--lt-text) !important; font-size: 14.5px !important; font-weight: 600 !important; }
[data-win98-body] a { color: var(--lt-blue) !important; }
[data-win98-body] .btn-secondary { min-height: 52px; }
[data-win98-body] div[style*="display:flex"]:has(> .btn-secondary) { gap: 8px !important; margin-top: 8px; padding-bottom: 2px; }
[data-win98-body] div[style*="display:flex"] > .btn-secondary,
#win98-error-popup div > button, #win98-diagnostics-popup div > button { flex: 1 1 0; min-width: 0 !important; }
[data-win98-body] div[style*="text-align"] > .btn-secondary { width: 100%; }
/* Main action on the right, closest to the thumb */
[data-win98-body] div:has(> #export-go), [data-win98-body] div:has(> #share-warn-ok), [data-win98-body] div:has(> #loop-go) { flex-direction: row-reverse; }
[data-win98-body] input[type="text"], [data-win98-body] input:not([type]), [data-win98-body] textarea, [data-win98-body] select {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px !important;
  background: var(--lt-band) !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 var(--lt-line);
  color: var(--lt-text) !important;
  font-family: var(--lt-sans) !important;
  font-size: 15px !important;
  outline: none;
}
[data-win98-body] input:focus, [data-win98-body] textarea:focus { box-shadow: inset 0 -2px 0 var(--lt-red); }
[data-win98-body] label { color: var(--lt-body); font-size: 14.5px; }
/* Checkboxes and radios, drawn so they match on every phone */
[data-win98-body] input[type="checkbox"], [data-win98-body] input[type="radio"], .acct-notif-chk {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 24px !important;
  height: 24px !important;
  margin: 0;
  box-sizing: border-box;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1.5px var(--lt-dim);
  cursor: pointer;
}
[data-win98-body] input[type="checkbox"]:checked, .acct-notif-chk:checked {
  background: var(--lt-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230C1219' stroke-width='2.400' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.500 12.500 4.500 4.500 8.500-9.500'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  box-shadow: none;
}
[data-win98-body] input[type="radio"] { width: 22px !important; height: 22px !important; border-radius: 50%; }
[data-win98-body] input[type="radio"]:checked { box-shadow: inset 0 0 0 1.5px var(--lt-blue), inset 0 0 0 6px var(--lt-deck), inset 0 0 0 11px var(--lt-blue); }

#confirm-modal-message { margin: 0; color: var(--lt-body); font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
#confirm-modal-footer { padding: 16px 0 2px; gap: 8px; background: none; border: 0; }
#confirm-modal-footer .btn-dialog { flex: 1 1 0; min-height: 52px; font-size: 14px; }
#confirm-modal.is-warning .panel-header { background: none; }

/* Error popups */
#win98-error-popup > div > div:nth-child(2), #win98-diagnostics-popup > div > div:nth-child(2) { padding: 0 !important; max-height: calc(100dvh - 240px) !important; }
#win98-error-popup > div > div:last-child, #win98-diagnostics-popup > div > div:last-child { padding: 14px 0 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
#win98-error-popup button:not(#win98-err-ok):not(#win98-err-close), #win98-diagnostics-popup button:not(#win98-diag-close):not(#win98-diag-send) {
  min-height: 52px;
  padding: 0 10px !important;
  background: none !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px var(--lt-line) !important;
  color: var(--lt-text) !important;
  font-family: var(--lt-mono) !important;
  font-size: 12.5px !important;
  font-weight: 600;
}
#win98-diag-send, #win98-err-ok { min-height: 52px; padding: 0 10px !important; border: 0 !important; font-family: var(--lt-mono) !important; font-size: 14px !important; font-weight: 600; }
#win98-error-popup #win98-err-ok { color: var(--lt-desk) !important; }
#win98-diag-send { flex: 1 1 100% !important; }
#win98-diag-preview { background: var(--lt-band) !important; border: 0 !important; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-blue) !important; font-family: var(--lt-mono); font-size: 12px; }

/* Guided tour */
#flippy-onboarding { font-family: var(--lt-sans) !important; }
#flippy-onboarding > div:nth-child(2) { border-radius: 0 !important; outline: 2px solid var(--lt-red) !important; box-shadow: 0 0 0 9999px rgba(6, 10, 14, 0.76) !important; }
#flippy-onboarding > div:nth-child(3) {
  background: var(--lt-deck) !important;
  border: 0 !important;
  box-shadow: 0 0 0 1px var(--lt-line) !important;
  color: var(--lt-body) !important;
  font-size: 14.5px !important;
}
#flippy-onboarding > div:nth-child(3)::before { content: ''; display: block; height: 16px; background: var(--lt-pegs) no-repeat center / 150px 16px, var(--lt-strip); box-shadow: 0 1px 0 var(--lt-strip-edge); }
#flippy-onboarding > div:nth-child(3) > div:nth-child(1) {
  padding: 12px 12px 0 !important;
  background: none !important;
  color: var(--lt-text) !important;
  font-family: var(--lt-display);
  font-size: 27px;
  font-weight: 400 !important;
  line-height: 1;
  letter-spacing: 1.2px;
}
#flippy-onboarding > div:nth-child(3) > div:nth-child(2) { padding: 8px 12px 2px !important; line-height: 1.45 !important; }
#flippy-onboarding > div:nth-child(3) > div:nth-child(3) { padding: 8px 12px 12px !important; }
#flippy-onboarding > div:nth-child(3) > div:nth-child(3) > span:first-child { color: var(--lt-dim) !important; font-family: var(--lt-mono); font-size: 11px !important; font-weight: 500; }
#flippy-onboarding .btn-secondary { min-height: 48px; padding: 0 12px; font-size: 14px; }

/* Header menus */
.header-user-menu {
  background: var(--lt-deck);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--lt-line), 0 18px 40px rgba(0, 0, 0, 0.5);
  padding: 0;
  min-width: 230px;
  z-index: 30;
}
.header-user-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  background: none;
  border: 0;
  box-shadow: inset 0 -1px 0 var(--lt-line);
  box-sizing: border-box;
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}
.header-user-menu-item:last-child { box-shadow: none; }
.header-user-menu-item:hover, .header-user-menu-item:active { background: rgba(143, 216, 242, 0.14); color: var(--lt-text); }
#btn-get-pro { background: var(--lt-blue); color: var(--lt-desk); }
.header-user-menu-email { padding: 13px 14px; box-shadow: inset 0 -1px 0 var(--lt-line); color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12.5px; }

/* Larger screens: sheets become centered cards */
@media (min-width: 700px) and (min-height: 560px) {
  .ad-sheet-overlay, #win98-error-popup, #win98-diagnostics-popup, #confirm-modal.overlay, #help-modal.overlay { align-items: center !important; }
}

/* ---------- 7. Sliders and small sheet details ---------- */
.hover-range { flex: 1; width: auto; min-width: 0; height: 44px; align-self: center; background: none; }
.hover-range::-webkit-slider-runnable-track { height: 10px; background: repeating-linear-gradient(90deg, rgba(143, 216, 242, 0.55) 0 1px, transparent 1px 6px); border: 0; box-shadow: none; }
.hover-range::-moz-range-track { height: 10px; background: repeating-linear-gradient(90deg, rgba(143, 216, 242, 0.55) 0 1px, transparent 1px 6px); border: 0; }
.hover-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -7px; background: var(--lt-red); border: 0; border-radius: 50%; box-shadow: 0 0 0 3px var(--lt-deck); }
.hover-range::-moz-range-thumb { width: 24px; height: 24px; background: var(--lt-red); border: 0; border-radius: 50%; }
[data-win98-body] button[data-project-id] { display: block !important; height: auto; min-height: 62px; padding: 10px 12px !important; background: none; box-shadow: inset 0 0 0 1px var(--lt-line); font-size: 14.5px; line-height: 1.3; }
[data-win98-body] ul { margin-left: 0 !important; padding-left: 0 !important; list-style: none; }
[data-win98-body] li { position: relative; padding-left: 28px; }
[data-win98-body] li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.14em;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FD8F2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.500 12.500 5 5L19.500 7'/%3E%3C/svg%3E") no-repeat center / contain;
}
#btn-replay-tour { width: 100%; min-height: 52px; }

/* ---------- 8. Camera ---------- */
#camera-overlay.overlay { background: var(--lt-band); }
#camera-panel { background: var(--lt-band); border: 0; border-radius: 0; box-shadow: none; }
#btn-camera-close,
body.native-camera-fullscreen #btn-camera-close {
  width: 44px;
  height: 44px;
  font-size: 18px;
  background: rgba(10, 16, 22, 0.86);
  border: 0;
  border-radius: 0;
  color: var(--lt-text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Zoom: a flat strip. On a phone held upright it shares the close key's row, off the picture. */
#camera-zoom {
  gap: 0;
  padding: 0;
  background: rgba(10, 16, 22, 0.86);
  border: 0;
  border-radius: 0;
  color: var(--lt-text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#camera-zoom button { border-radius: 0; color: var(--lt-blue); }
#camera-zoom button svg { stroke-width: 1.8; }
#camera-zoom input[type="range"] { -webkit-appearance: none; appearance: none; accent-color: var(--lt-red); }
#camera-zoom input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: rgba(143, 216, 242, 0.55); border: 0; }
#camera-zoom input[type="range"]::-moz-range-track { height: 3px; background: rgba(143, 216, 242, 0.55); border: 0; }
#camera-zoom input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; background: var(--lt-red); border: 0; border-radius: 50%; box-shadow: none; }
#camera-zoom input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; background: var(--lt-red); border: 0; border-radius: 50%; }
#camera-zoom output { min-width: 48px; font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; }

/* The guide: blue pencil corners and two binding holes */
#camera-guide-frame {
  border: 0;
  border-radius: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M2 42V2h40' fill='none' stroke='%238FD8F2' stroke-width='3'/%3E%3C/svg%3E") 0 0 / 44px 44px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M42 42V2H2' fill='none' stroke='%238FD8F2' stroke-width='3'/%3E%3C/svg%3E") 100% 0 / 44px 44px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M2 2v40h40' fill='none' stroke='%238FD8F2' stroke-width='3'/%3E%3C/svg%3E") 0 100% / 44px 44px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M42 2v40H2' fill='none' stroke='%238FD8F2' stroke-width='3'/%3E%3C/svg%3E") 100% 100% / 44px 44px no-repeat;
}
#camera-guide-frame::before, #camera-guide-frame::after { border-color: var(--lt-text); }

#camera-feedback {
  max-width: calc(100% - 24px);
  padding: 0;
  background: none !important;
  border-radius: 0;
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: normal;
}
#camera-feedback.good { color: var(--lt-blue); }
#camera-feedback.warn { color: var(--lt-text); }
#camera-feedback.bad { color: var(--lt-red); }

.btn-capture {
  width: 78px;
  height: 78px;
  background: none;
  border: 3px solid var(--lt-lit);
  border-radius: 50%;
  box-sizing: border-box;
}
.btn-capture:hover, .btn-capture:active { background: none; }
.capture-inner { width: 62px; height: 62px; background: var(--lt-lit); box-shadow: none; }
.btn-torch { width: 48px; height: 48px; background: none; border: 0; border-radius: 0; color: var(--lt-blue); }
.btn-torch:hover { background: none; color: var(--lt-blue); }
.btn-torch.active { background: none; color: var(--lt-red); }

/* Sideways, the capture button stands on its own */
@media (orientation: landscape) {
  #camera-controls,
  body.native-camera-fullscreen #camera-controls {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (orientation: portrait) {
  /* Free version: 3:4 view on the page, status under it */
  #camera-panel {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    grid-template-rows: 44px minmax(0, 1fr) auto;
    padding: calc(12px + var(--safe-top)) 0 calc(14px + var(--safe-bottom));
    background: var(--lt-band);
  }
  #btn-camera-close { margin-right: 14px; }
  #camera-view-wrap { overflow: visible; margin-bottom: 26px; }
  #camera-video { overflow: hidden; }
  #camera-zoom { top: -44px; left: 12px; width: min(calc(100% - 72px), 300px); transform: none; }
  #camera-feedback { left: 12px; right: 12px; bottom: -26px; max-width: none; transform: none; }
  #camera-controls {
    display: grid;
    grid-template-columns: 1fr 78px 1fr;
    justify-items: center;
    align-items: center;
    width: 100%;
    padding: 0 0 calc(10px + var(--safe-bottom));
    background: none;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .btn-torch { grid-column: 1; margin: 0; }
  .btn-capture { grid-column: 2; margin: 0; }
  .camera-control-spacer { grid-column: 3; margin: 0; }

  /* Pro: fullscreen feed with a dark control bar */
  body.native-camera-fullscreen { --lt-camera-bar: calc(118px + var(--safe-bottom)); }
  body.native-camera-fullscreen #camera-panel { padding: 0; background: transparent; }
  body.native-camera-fullscreen #camera-view-wrap { margin: 0; overflow: hidden; }
  body.native-camera-fullscreen #camera-zoom { top: calc(var(--safe-top) + 12px); }
  body.native-camera-fullscreen #camera-view-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--lt-camera-bar);
    background: var(--lt-band);
  }
  /* The guide sits in the clear space between the close button and the bar */
  body.native-camera-fullscreen #camera-guide-frame {
    top: calc((100% - var(--lt-camera-bar) + var(--safe-top) + 56px) / 2);
    width: min(78cqw, calc((100cqh - var(--lt-camera-bar) - var(--safe-top) - 72px) / 1.7));
  }
  body.native-camera-fullscreen #camera-controls {
    display: grid;
    grid-template-columns: 1fr 78px 1fr;
    justify-items: center;
    align-items: center;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    height: var(--lt-camera-bar);
    padding: 22px 0 calc(18px + var(--safe-bottom));
    background: none;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.native-camera-fullscreen .btn-torch { order: 0; margin: 0; }
  body.native-camera-fullscreen .btn-capture { order: 0; margin: 0; }
  body.native-camera-fullscreen .camera-control-spacer { order: 0; margin: 0; }
  body.native-camera-fullscreen #camera-feedback {
    left: 12px;
    right: 12px;
    bottom: calc(var(--lt-camera-bar) - 22px);
    max-width: none;
    transform: none;
    z-index: 1;
  }
}

/* ---------- 9. Gallery ---------- */
#gallery-view { background: transparent; color: var(--lt-text); font-family: var(--lt-sans); font-size: 14.5px; }
/* The long name stays on one line on a narrow phone */
#header-title-gallery { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 400px) { #header-title-gallery { font-size: 23px; } }

/* The views stay put. The search row below them slides away as you scroll. */
#gallery-views { position: sticky; top: 0; z-index: 6; display: flex; overflow-x: auto; scrollbar-width: none; background: var(--lt-desk); box-shadow: inset 0 -1px 0 var(--lt-line); }
#gallery-views::-webkit-scrollbar { display: none; }
.gallery-view-tab { flex: 1 0 auto; height: 44px; padding: 0 11px; background: none; border: 0; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.gallery-view-tab.active { color: var(--lt-text); box-shadow: inset 0 -3px 0 var(--lt-red); }
.gallery-toolbar { top: 44px; display: flex; align-items: stretch; justify-content: flex-start; gap: 0; margin-bottom: 0; padding: 0; background: var(--lt-desk); box-shadow: inset 0 -1px 0 var(--lt-line); }
.gallery-toolbar .gallery-search-bar { flex: 1; min-width: 0; width: auto; display: flex; align-items: center; gap: 0; padding: 0; }
.gallery-refresh-btn, .gallery-controls { display: none !important; }
#gallery-sort-btn { flex: none; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 8px 0 12px; background: none; border: 0; box-shadow: inset 1px 0 0 var(--lt-line); color: var(--lt-text); font-family: var(--lt-mono); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
#gallery-sort-btn svg { width: 16px; height: 16px; color: var(--lt-blue); transition: transform 0.14s linear; }
#gallery-sort-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
#gallery-layout-btn { flex: none; width: 48px; height: 46px; display: grid; place-items: center; padding: 0; background: none; border: 0; box-shadow: inset 1px 0 0 var(--lt-line); color: var(--lt-blue); cursor: pointer; }
#gallery-layout-btn svg { width: 22px; height: 22px; }
#gallery-menu-scrim { position: fixed; inset: 0; z-index: 160; background: rgba(7, 11, 16, 0.62); }
#gallery-sort-menu { position: fixed; right: 0; z-index: 161; width: min(272px, 100%); background: var(--lt-deck); box-shadow: 0 0 0 1px var(--lt-line); }
.gallery-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 0 12px 0 14px; background: none; border: 0; box-shadow: inset 0 -1px 0 var(--lt-line); color: var(--lt-text); text-align: left; font-family: var(--lt-mono); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.gallery-menu-item:last-child { box-shadow: none; }
.gallery-menu-item.on { color: var(--lt-blue); }
.gallery-menu-item.is-sub { color: var(--lt-body); font-weight: 400; }
.gallery-menu-item svg { flex: none; width: 19px; height: 19px; color: var(--lt-blue); }
#search-input {
  order: 1;
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 40px;
  background: var(--lt-band) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FD8F2' stroke-width='1.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.200 16.200 21 21M18 11a7 7 0 1 1-14 0 7 7 0 0 1 14 0z'/%3E%3C/svg%3E") no-repeat 12px center / 20px 20px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--lt-text);
  font-family: var(--lt-sans);
  font-size: 15px;
}
#search-input::placeholder { color: var(--lt-dim); }
#search-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--lt-red); }
.gallery-refresh-btn {
  order: 2;
  flex: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--lt-blue);
  font-size: 20px;
}
.gallery-refresh-btn:hover { background: none; }
.gallery-refresh-btn:active { background: rgba(143, 216, 242, 0.14); }
.gallery-controls { display: flex; align-items: stretch; gap: 0; margin-top: 2px; box-shadow: inset 0 1px 0 var(--lt-line); }
.gallery-toolbar .filter-controls { flex: 1 1 0; min-width: 0; }
.gallery-toolbar .sort-controls { flex: 1.25 1 0; min-width: 0; display: flex; align-items: stretch; gap: 0; }
.gallery-toolbar .sort-controls label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sort-select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 28px 0 12px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FD8F2' stroke-width='1.800' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.500 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px 16px;
  border: 0;
  border-radius: 0;
  box-shadow: inset -1px 0 0 var(--lt-line);
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 13.5px;
  font-weight: 500;
}
.sort-dir-btn { flex: none; width: 52px; height: 46px; background: none; border: 0; box-shadow: none; color: var(--lt-blue); font-size: 18px; }
.sort-dir-btn:hover:not(.active) { background: none; }
.sort-dir-btn.active { background: var(--lt-blue); color: var(--lt-desk); }

.gallery-main > .scope-pills { padding: 8px 10px 0; }
.gallery-main > .anim-grid { width: 100%; margin-left: 0; margin-right: 0; padding: 8px; box-sizing: border-box; }
.gallery-main > .anim-grid.is-large { padding: 0; }
/* Two columns unless the layout button asks for one. The large cards keep a 340px minimum so a
   title and a name fit on one row. The count also matters to the code: one column opens a
   flipbook in the feed, more than one opens the window, and two or more use the WebP. */
.anim-grid { grid-template-columns: repeat(auto-fill, minmax(min(46%, 240px), 1fr)); gap: 12px 8px; }
.anim-grid.is-large { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0; }
.anim-tile {
  aspect-ratio: auto;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
}
.anim-tile:hover { transform: none; box-shadow: none; }
.anim-grid.is-large .anim-tile, .anim-grid.is-large .anim-tile:hover { box-shadow: inset 0 -1px 0 var(--lt-line); }
.anim-tile video, .anim-tile img.tile-media {
  height: auto;
  aspect-ratio: 1.73 / 1;
  background: var(--lt-band);
  box-shadow: none;
}
.anim-tile .tile-overlay, .anim-tile:hover .tile-overlay {
  position: static;
  display: block;
  height: auto;
  padding: 6px 2px 0;
  box-sizing: border-box;
  background: none;
  opacity: 1;
}
.anim-grid.is-large .tile-overlay, .anim-grid.is-large .anim-tile:hover .tile-overlay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 45px;
  padding: 0 12px;
}
.tile-title { min-width: 0; color: var(--lt-text); font-family: var(--lt-display); font-size: 20px; font-weight: 400; line-height: 1.05; letter-spacing: 0.6px; }
.anim-grid.is-large .tile-title { flex: 1; font-size: 22px; line-height: 1; letter-spacing: 0.8px; }
.tile-creator { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 4px 0 0; overflow: hidden; color: var(--lt-body); font-family: var(--lt-mono); font-size: 12px; font-weight: 400; line-height: 20px; white-space: nowrap; }
.tile-creator-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tile-creator .pro-badge { flex: none; }
.tile-creator .tile-avatar { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; object-fit: cover; background: var(--lt-ink); color: var(--lt-lit); font-size: 8.5px; font-weight: 600; line-height: 1; }
.anim-grid.is-large .tile-creator { flex: 0 1 auto; max-width: 60%; margin: 0; }
.pro-badge {
  padding: 1px 3px;
  background: var(--lt-red);
  border-radius: 0;
  color: var(--lt-desk);
  font-family: var(--lt-mono);
  font-size: 8px;
  font-weight: 600;
  line-height: 10px;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}
.anim-tile.selected, .anim-tile.selected:hover { outline: 0; box-shadow: none; }
.anim-tile.selected .tile-overlay { display: none; }

.scope-pill { min-height: 44px; padding: 0 2px 0 10px; background: none; border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-text); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; }
.scope-pill-clear { width: 36px; height: 36px; background: none; border: 0; border-radius: 0; color: var(--lt-red); font-size: 15px; font-weight: 500; }
.scope-pill-clear:active { background: rgba(255, 92, 77, 0.16); }

/* Pull to refresh: the feed slides down, and the frame cells fill in the gap above it */
#gallery-view.is-pull-armed { overscroll-behavior-y: none; }
#gallery-pull { position: relative; height: 0; pointer-events: none; }
.gallery-pull-box { position: absolute; left: 0; right: 0; top: 0; height: var(--gallery-pull, 0px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; overflow: hidden; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap; }
.gallery-pull-box .spinner { flex: none; }
#gallery-pull.is-settling .gallery-pull-box { transition: height 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.anim-grid.is-settling { transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* The Animators list. The grid keeps its columns, so tile media stays right for the layout. */
#gallery-layout-btn[hidden] { display: none; }
.gallery-main > .anim-grid.is-people { padding: 0; gap: 0; }
.creator-section { grid-column: 1 / -1; margin: 0; padding: 14px 12px 8px; box-shadow: inset 0 -1px 0 var(--lt-line); color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11.5px; font-weight: 500; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; }
.creator-row { grid-column: 1 / -1; min-width: 0; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--lt-line); color: var(--lt-text); }
.creator-row .creator-top { width: 100%; box-sizing: border-box; padding: 0 12px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.creator-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.creator-row .creator-top > svg { flex: none; width: 18px; height: 18px; color: var(--lt-blue); }
.creator-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; object-fit: cover; background: var(--lt-ink); color: var(--lt-lit); font-family: var(--lt-mono); font-size: 14px; font-weight: 600; }
.creator-text { display: block; flex: 1; min-width: 0; }
.creator-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--lt-mono); font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.creator-name > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.creator-name .pro-badge { position: static; flex: none; }
.creator-stat { display: block; min-height: 17px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12px; line-height: 1.4; }
/* Three thumbnails and part of a fourth, so the strip shows that it scrolls */
.creator-thumbs { display: flex; gap: 4px; margin-top: 10px; padding-left: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-left: 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--lt-line) transparent; -webkit-overflow-scrolling: touch; }
.creator-thumbs::after { content: ''; flex: none; width: 8px; }
.creator-thumb { flex: none; width: 29%; padding: 0; background: var(--lt-band); border: 0; scroll-snap-align: start; cursor: pointer; }
.creator-thumb img { display: block; width: 100%; aspect-ratio: 480 / 278; object-fit: cover; }
.creator-more { aspect-ratio: 480 / 278; display: flex; align-items: center; justify-content: center; gap: 2px; background: none; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-blue); font-family: var(--lt-mono); font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; }
.creator-more svg { flex: none; width: 16px; height: 16px; }
@media (hover: none) {
  .creator-thumbs { scrollbar-width: none; }
  .creator-thumbs::-webkit-scrollbar { display: none; }
}

/* An animator's page, over the Gallery, so the Gallery keeps its place */
body.creator-page-open #gallery-view { visibility: hidden; }
#creator-page { position: fixed; inset: 0; z-index: 125; display: none; flex-direction: column; box-sizing: border-box; padding: var(--safe-top) var(--safe-right) 0 var(--safe-left); background: var(--lt-desk); color: var(--lt-text); font-family: var(--lt-sans); }
#creator-page.is-open { display: flex; }
.creator-bar { flex: none; display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 6px; box-shadow: inset 0 -1px 0 var(--lt-line); }
.creator-bar h1 { flex: 1; min-width: 0; margin: 0 0 0 4px; font-family: var(--lt-display); font-size: 27px; font-weight: 400; line-height: 1; letter-spacing: 0.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#creator-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: var(--safe-bottom); }
#creator-head { padding: 12px 14px 14px; box-shadow: inset 0 -1px 0 var(--lt-line); }
#creator-head .creator-top { gap: 12px; }
#creator-head .creator-avatar { width: 64px; height: 64px; font-size: 20px; }
.creator-follow { flex: none; height: 44px; padding: 0 14px; background: var(--lt-blue); border: 0; color: var(--lt-desk); font-family: var(--lt-mono); font-size: 13px; font-weight: 600; cursor: pointer; }
.creator-follow.is-on { background: none; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-blue); }
.creator-bio { margin: 12px 0 0; color: var(--lt-body); font-size: 14.5px; line-height: 1.45; }
#creator-grid { width: 100%; margin: 0; padding: 8px; box-sizing: border-box; }
#creator-grid.is-large { padding: 0; }
#creator-grid .tile-creator { display: none; }  /* the page already says whose these are */
#creator-sentinel { height: 1px; }

/* The flipbook view: the art takes over, and the feed goes away */
#flipbook-view { position: fixed; inset: 0; z-index: 130; display: none; flex-direction: column; box-sizing: border-box; padding-top: var(--safe-top); color: var(--lt-text); font-family: var(--lt-sans); -webkit-user-select: none; user-select: none; --fb-bar: 46px; --fb-ease: cubic-bezier(0.2, 0.8, 0.2, 1); }
#flipbook-view.is-open { display: flex; }
.fb-veil { position: absolute; inset: 0; background: var(--lt-desk); opacity: 0; transition: opacity 0.26s linear; }
#flipbook-view.is-live .fb-veil { opacity: 1; }
.fb-bar, .fb-scrub, .fb-ctrl, .fb-info { position: relative; opacity: 0; transition: opacity 0.09s linear, transform 0.3s var(--fb-ease); }
#flipbook-view.is-live .fb-bar, #flipbook-view.is-live .fb-scrub, #flipbook-view.is-live .fb-ctrl, #flipbook-view.is-live .fb-info { opacity: 1; transition: opacity 0.2s linear 0.06s, transform 0.3s var(--fb-ease); }
#flipbook-view.is-live.is-drop .fb-bar, #flipbook-view.is-live.is-drop .fb-scrub, #flipbook-view.is-live.is-drop .fb-ctrl, #flipbook-view.is-live.is-drop .fb-info { opacity: 0; transition: opacity 0.09s linear; }
.fb-bar { flex: none; display: flex; align-items: center; gap: 2px; height: var(--fb-bar); padding: 0 6px; }
.fb-bar h1 { flex: 1; min-width: 0; margin: 0 0 0 4px; font-family: var(--lt-display); font-size: 27px; font-weight: 400; line-height: 1; letter-spacing: 0.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: var(--lt-blue); cursor: pointer; }
.fb-icon svg { width: 22px; height: 22px; }
.fb-stage { position: relative; z-index: 1; flex: none; transition: transform 0.3s var(--fb-ease); will-change: transform; }
.fb-art { position: relative; aspect-ratio: 1.73 / 1; background: var(--lt-band); transform-origin: 0 0; touch-action: none; cursor: pointer; transition: transform 0.32s var(--fb-ease), opacity 0.2s linear; }
.fb-art video, .fb-art canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.fb-art canvas[hidden] { display: none; }
.fb-badge { position: absolute; left: 8px; top: 8px; padding: 3px 5px; background: var(--lt-red); color: var(--lt-desk); font-family: var(--lt-mono); font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.12s linear; pointer-events: none; }
#flipbook-view.is-paused .fb-badge { opacity: 1; }
.fb-scrub { height: 52px; background: var(--lt-deck); box-shadow: inset 0 -1px 0 var(--lt-line); touch-action: none; cursor: ew-resize; }
.fb-track { position: absolute; left: 12px; top: 0; display: block; width: calc(100% - 24px); height: 100%; }
.fb-head { position: absolute; left: 12px; top: 5px; bottom: 5px; width: 3px; margin-left: -1.5px; background: var(--lt-red); pointer-events: none; will-change: transform; }
.fb-head::before { content: ""; position: absolute; left: 50%; top: -1px; width: 13px; height: 10px; margin-left: -6.5px; background: var(--lt-red); transition: transform 0.1s linear; }
#flipbook-view.is-grabbing .fb-head::before { transform: scale(1.3); }
.fb-ctrl { display: flex; align-items: center; height: 48px; padding: 0 4px; background: var(--lt-deck); box-shadow: inset 0 -1px 0 var(--lt-line); }
#fb-play { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px 0 8px; background: none; border: 0; color: var(--lt-text); font-family: var(--lt-mono); font-size: 13px; font-weight: 500; cursor: pointer; }
#fb-play svg { width: 20px; height: 20px; color: var(--lt-blue); }
.fb-gap { flex: 1; }
.fb-stepper { display: flex; align-items: center; }
#fb-readout { color: var(--lt-body); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
#flipbook-view.is-grabbing #fb-readout { color: var(--lt-text); }
.fb-share { flex: none; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 8px; background: none; border: 0; color: var(--lt-body); font-family: var(--lt-mono); font-size: 12px; font-weight: 500; line-height: 1; cursor: pointer; }
.fb-share svg { width: 20px; height: 20px; color: var(--lt-blue); }
.fb-info { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px calc(12px + var(--safe-bottom)); }
.fb-who { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; }
.fb-who .fb-creator { flex: 1; min-width: 0; }
.fb-creator-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fb-creator img, .fb-creator svg, .fb-creator .pro-badge, .fb-creator-initials { flex: none; }
.fb-keys { flex: none; display: flex; }
.fb-pick, .fb-remove { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; background: none; border: 0; box-shadow: inset 0 0 0 1px var(--lt-line); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; line-height: 1; cursor: pointer; }
.fb-pick { margin-top: 8px; color: var(--lt-blue); }
.fb-pick.is-on svg { fill: currentColor; }
.fb-remove { color: var(--lt-red); }
.fb-card + .fb-remove { margin-top: 8px; }
.fb-pick svg, .fb-remove svg { width: 18px; height: 18px; }
.fb-creator { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; background: none; border: 0; color: var(--lt-text); text-align: left; font-family: var(--lt-mono); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.fb-creator img { width: 34px; height: 34px; object-fit: cover; }
.fb-creator-initials { display: grid; place-items: center; width: 34px; height: 34px; background: var(--lt-ink); color: var(--lt-lit); font-size: 12px; font-weight: 600; }
.fb-creator svg { width: 16px; height: 16px; color: var(--lt-blue); }
.fb-creator .pro-badge { position: static; }
.fb-meta { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12px; line-height: 1.3; }
.fb-message { margin: 0; color: var(--lt-body); font-size: 14.5px; line-height: 1.45; -webkit-user-select: text; user-select: text; }
.fb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-tag { min-height: 32px; padding: 0 9px; background: none; border: 0; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-blue); font-family: var(--lt-mono); font-size: 11.5px; font-weight: 500; cursor: pointer; }
.fb-card { flex: none; display: block; width: 100%; padding: 11px 12px; background: var(--lt-deck); border: 0; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-body); text-align: left; cursor: pointer; }
.fb-card-top { display: flex; justify-content: space-between; font-family: var(--lt-mono); font-size: 12px; font-weight: 500; line-height: 1; }
.fb-card-top b { color: var(--lt-blue); font-weight: 500; }
.fb-card-peek { display: block; margin-top: 9px; overflow: hidden; font-size: 14px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.fb-key { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; width: 66px; height: 52px; padding: 0; background: none; border: 0; color: var(--lt-body); font-family: var(--lt-mono); font-size: 11px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; cursor: pointer; }
.fb-key svg { width: 22px; height: 22px; color: var(--lt-blue); }
.fb-key.is-on svg { fill: currentColor; }
#fb-like.is-on svg { color: var(--lt-red); }

/* Comments rise under the art, which stays on screen and keeps playing */
.fb-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--safe-top) + var(--fb-sheet-top, 300px)); z-index: 3; display: flex; flex-direction: column; background: var(--lt-deck); box-shadow: 0 -1px 0 var(--lt-line); transform: translateY(102%); visibility: hidden; transition: transform 0.3s var(--fb-ease), visibility 0s linear 0.3s; will-change: transform; }
#flipbook-view.sheet-open .fb-sheet { transform: none; visibility: visible; transition: transform 0.3s var(--fb-ease), visibility 0s; }
#flipbook-view.sheet-open .fb-bar { transform: translateY(-100%); opacity: 0; }
#flipbook-view.sheet-open .fb-stage { transform: translateY(calc(-1 * var(--fb-bar))); }
.fb-sheet-head { flex: none; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 4px 14px; box-shadow: inset 0 -1px 0 var(--lt-line); touch-action: none; cursor: grab; }
.fb-sheet-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; background: var(--lt-ink); }
.fb-sheet-head h2 { margin: 0; font-family: var(--lt-display); font-size: 24px; font-weight: 400; line-height: 1; letter-spacing: 0.8px; }
.fb-comments { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; -webkit-user-select: text; user-select: text; }
.fb-comments .comment-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; padding: 10px 14px; }
.fb-avatar { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; object-fit: cover; background: var(--lt-ink); color: var(--lt-lit); font-family: var(--lt-mono); font-size: 12px; font-weight: 600; }
.fb-comments .comment-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fb-comments .comment-author { padding: 0; background: none; border: 0; color: var(--lt-body); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.fb-when { flex: 1; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12px; }
.fb-comments .comment-body { margin-top: 3px; color: var(--lt-text); font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.fb-comments .comment-delete-btn { width: 32px; height: 32px; }
.fb-frame-link { padding: 0; background: none; border: 0; color: var(--lt-blue); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.fb-none { padding: 26px 18px; color: var(--lt-dim); font-size: 14.5px; text-align: center; }
.fb-none b { display: block; margin-bottom: 4px; color: var(--lt-text); font-family: var(--lt-display); font-size: 24px; font-weight: 400; line-height: 1; letter-spacing: 0.8px; }
.fb-comment-form { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(8px + var(--safe-bottom)); background: var(--lt-band); box-shadow: inset 0 1px 0 var(--lt-line); }
#fb-comment-input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; background: var(--lt-deck); border: 0; border-radius: 0; color: var(--lt-text); font-family: var(--lt-sans); font-size: 16px; -webkit-user-select: text; user-select: text; }
#fb-comment-input::placeholder { color: var(--lt-dim); }
#fb-comment-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--lt-red); }
.fb-login-note { flex: 1; color: var(--lt-body); font-size: 14.5px; }
.fb-post { flex: none; height: 44px; padding: 0 14px; background: var(--lt-blue); border: 0; color: var(--lt-desk); font-family: var(--lt-mono); font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-post:disabled { background: var(--lt-line); color: var(--lt-dim); cursor: default; }
.fb-toast { position: absolute; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 4; max-width: calc(100% - 32px); padding: 9px 12px; background: var(--lt-lit); color: var(--lt-desk); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; line-height: 1.2; text-align: center; transform: translateX(-50%); opacity: 0; transition: opacity 0.16s linear; pointer-events: none; }
.fb-toast.is-on { opacity: 1; }

/* Sideways phone: the art takes the screen, with the scrubber along the bottom */
@media (orientation: landscape) and (max-height: 520px) {
  #flipbook-view.is-open .fb-bar, #flipbook-view.is-open .fb-info { display: none; }
  .fb-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) 48px; transform: none !important; }
  .fb-art { grid-column: 1 / -1; justify-self: center; height: 100%; min-height: 0; max-width: 100%; }
  .fb-ctrl { display: contents; }
  .fb-gap { display: none; }
  #fb-play { grid-column: 1; grid-row: 2; }
  .fb-scrub { grid-column: 2; grid-row: 2; height: 48px; box-shadow: none; }
  .fb-stepper { grid-column: 3; grid-row: 2; }
}
/* Wider screens: the same view in a centered column */
@media (min-width: 760px) and (min-height: 521px) {
  .fb-bar, .fb-stage, .fb-info, .fb-sheet { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
  .fb-sheet { left: 50%; right: auto; margin-left: -360px; }
}
@media (prefers-reduced-motion: reduce) {
  #flipbook-view, #flipbook-view * { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* Flipbook detail: in the feed on phones, a window on wider screens */
.inline-detail { margin-top: 0; }
.inline-detail-shade { background: none; border: 0; box-shadow: none; color: var(--lt-text); }
.inline-detail-info { padding: 10px 14px 0; gap: 10px; }
.inline-detail-loading { padding: 12px 14px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12px; }
.inline-detail-info h2, .detail-right h2 { color: var(--lt-text); font-family: var(--lt-display); font-size: 32px; font-weight: 400; line-height: 1; letter-spacing: 1.2px; }
.detail-creator { min-height: 44px; gap: 9px; color: var(--lt-text); font-family: var(--lt-mono); font-size: 14px; font-weight: 500; }
.detail-creator img { width: 30px; height: 30px; border: 0; border-radius: 0; }
.detail-meta { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11.5px; }
.inline-detail-info p, #detail-message { color: var(--lt-body); font-size: 14.5px; line-height: 1.45; }
.tag-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; background: none; border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-blue); font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; }
.tag-chip:hover { background: none; color: var(--lt-blue); }
.detail-actions { display: flex; align-items: stretch; gap: 0; height: 52px; background: var(--lt-deck); box-shadow: inset 0 1px 0 var(--lt-line), inset 0 -1px 0 var(--lt-line); }
.btn-like {
  flex: 1 1 0;
  width: auto !important;
  height: 52px !important;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: inset -1px 0 0 var(--lt-line);
  color: var(--lt-blue);
  font-family: var(--lt-mono);
  font-size: 15px;
  font-weight: 500;
}
.btn-like:first-child { flex: 1.3 1 0; }
.btn-like:last-child { box-shadow: none; }
.btn-like.liked { background: none; color: var(--lt-red); }
.btn-like.bookmarked { background: none; color: var(--lt-text); box-shadow: inset 0 -3px 0 var(--lt-red); }
.btn-like svg { width: 22px; height: 22px; }
.inline-detail-comments, .comments-section { padding: 14px 14px 8px; border-top: 0; color: var(--lt-text); }
.detail-right .comments-section { padding-left: 0; padding-right: 0; }
.inline-detail-comments h3, .comments-section h3 { margin-bottom: 8px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
.comment-item { padding: 8px 0; border-bottom: 0; font-size: 14px; line-height: 1.4; }
.comment-item .comment-author { color: var(--lt-text); font-family: var(--lt-mono); font-size: 13.5px; font-weight: 500; }
.comment-item .comment-body { color: var(--lt-body); }
.comment-delete-btn { width: 44px; height: 44px; background: none; border: 0; color: var(--lt-blue); }
.inline-detail-comments textarea, #comment-form textarea {
  min-height: 46px;
  padding: 10px 12px;
  background: var(--lt-band);
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 var(--lt-line);
  color: var(--lt-text);
  font-family: var(--lt-sans);
}
.inline-detail-comments textarea:focus, #comment-form textarea:focus { outline: none; box-shadow: inset 0 -2px 0 var(--lt-red); }
.inline-detail-comments .btn-post, #comment-form button {
  min-height: 46px;
  margin-top: 8px;
  padding: 0 18px;
  background: var(--lt-blue);
  border: 0;
  box-shadow: none;
  color: var(--lt-desk);
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 600;
}
.btn-load-more { min-height: 48px; background: none; border: 0; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-text); font-family: var(--lt-mono); font-size: 14px; font-weight: 600; }

.detail-window { background: var(--lt-desk); border: 0; box-shadow: none; }
.detail-left, .detail-right { background: transparent; color: var(--lt-text); }
.detail-delete-animation { background: var(--lt-deck); border: 0; color: var(--lt-blue); }

/* Shared small windows */
.win98-window { background: var(--lt-deck); border: 0; box-shadow: none; color: var(--lt-body); }
.win98-titlebar { background: none; color: var(--lt-text); font-family: var(--lt-display); font-size: 27px; font-weight: 400; line-height: 1.05; letter-spacing: 1.2px; }
.win98-close { width: 44px; height: 44px; background: none; border: 0; color: var(--lt-blue); font-size: 18px; }

/* Creator profile: a sheet */
.profile-backdrop, .overlay-backdrop { background: var(--lt-scrim); }
.profile-popup, #gallery-view .profile-popup {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  transform: none !important;
  font-family: var(--lt-sans);
  z-index: 40;
}
.profile-popup .win98-window { position: relative; padding: 36px 14px calc(14px + var(--safe-bottom)); }
.profile-popup .win98-titlebar { padding: 0; }
.profile-popup .win98-titlebar span { display: none; }
.profile-popup .win98-close { position: absolute; right: 4px; top: 24px; }
.profile-popup-body { padding: 0; gap: 8px; background: none; color: var(--lt-body); font-size: 14.5px; }
.profile-popup-body img { width: 64px; height: 64px; border: 0; }
.profile-popup-body .pp-name { color: var(--lt-text); font-family: var(--lt-display); font-size: 32px; font-weight: 400; line-height: 1; letter-spacing: 1.2px; }
.profile-popup-body .pp-bio { color: var(--lt-body); font-size: 14.5px; }
.profile-popup-body .pp-stats { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
.profile-popup-body a { align-self: center; padding: 14px 8px; color: var(--lt-blue); font-family: var(--lt-mono); font-size: 13.5px !important; font-weight: 500; }
.btn-subscribe {
  align-self: stretch;
  min-height: 52px;
  background: var(--lt-blue);
  border: 0;
  box-shadow: none;
  color: var(--lt-desk);
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 600;
}
.btn-subscribe.subscribed { background: none; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-text); }

/* Empty, offline and error states */
.gallery-empty, .gallery-offline, .gallery-load-error { grid-column: 1 / -1; padding: 0 18px; color: var(--lt-text); text-align: left; }
.gallery-empty b { display: block; font-weight: 400; }
.gallery-empty span { display: block; margin-top: 8px; color: var(--lt-body); font-family: var(--lt-sans); font-size: 14.5px; line-height: 1.45; letter-spacing: 0; }
.gallery-empty .btn-secondary { display: block; width: 100%; min-height: 52px; margin-top: 16px; }
.gallery-empty {
  padding-top: 18px;
  font-family: var(--lt-display);
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: 1.2px;
}
.gallery-empty::before {
  content: '';
  display: block;
  height: 230px;
  margin-bottom: 18px;
  background: url('../flipjaw-marks.svg') no-repeat center / auto 230px, radial-gradient(closest-side at 50% 50%, rgba(143, 216, 242, 0.32), rgba(143, 216, 242, 0));
}
.gallery-offline { padding-top: 70px; }
.gallery-offline-title { margin-bottom: 12px; font-family: var(--lt-display); font-size: 44px; font-weight: 400; line-height: 1; letter-spacing: 1.2px; }
.gallery-offline-msg { max-width: none; margin: 0 0 18px; color: var(--lt-body); font-size: 14.5px; line-height: 1.45; }
.gallery-offline-retry, .gallery-load-error button {
  min-height: 52px;
  padding: 0 26px;
  background: var(--lt-blue);
  border: 0;
  box-shadow: none;
  color: var(--lt-desk);
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 600;
}
.pending-review-tile { background: var(--lt-deck); border: 0; box-shadow: none; color: var(--lt-text); }
.pending-review-tile .pending-title { color: var(--lt-text); font-size: 14.5px; }
.pending-review-tile .pending-status, .pending-review-tile .pending-date { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11px; }
.tile-unlisted-badge { background: var(--lt-desk); border: 0; border-radius: 0; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 11px; }

/* ---------- 10. Account ---------- */
.ad-sheet-overlay > .win98-window {
  position: relative;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 560px;
  max-height: calc(100dvh - 30px) !important;
  padding: 36px 14px calc(14px + var(--safe-bottom));
  background: var(--lt-deck);
}
.ad-sheet-overlay > .win98-window .win98-titlebar { display: block; padding: 0 40px 10px 0; background: none !important; }
.ad-sheet-overlay > .win98-window .win98-close { position: absolute; right: 4px; top: 24px; }
.ad-sheet-overlay > .win98-window > div[style*="padding"] { padding: 0 !important; background: none !important; }
.ad-sheet-overlay > .win98-window p { margin: 0; color: var(--lt-body) !important; font-size: 14.5px !important; line-height: 1.45; }
.ad-sheet-overlay > .win98-window p[style*="#800000"] { color: var(--lt-red) !important; font-weight: 500; }
.ad-sheet-overlay > .win98-window [style*="font-size:11px"] { color: var(--lt-dim) !important; font-size: 12.5px !important; }
.ad-sheet-overlay > .win98-window [data-canvas] { display: block; }
.ad-sheet-overlay > .win98-window, .ad-sheet-overlay > .win98-window p { font-family: var(--lt-sans); }
.ad-sheet-overlay > .win98-window div[style*="display:flex"]:has(> .btn-auth) { flex-wrap: wrap; width: 100%; gap: 8px !important; }
.btn-auth {
  flex: 1 1 130px;
  min-height: 52px;
  padding: 0 10px;
  background: none !important;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--lt-line);
  color: var(--lt-text) !important;
  font-family: var(--lt-mono);
  font-size: 14px;
  font-weight: 600;
}
.btn-auth[data-confirm] { background: var(--lt-red) !important; color: var(--lt-desk) !important; box-shadow: none; }
.btn-auth[data-apply] { background: var(--lt-blue) !important; color: var(--lt-desk) !important; box-shadow: none; }

.acct-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 14px; align-items: start; }
.acct-avatar-label { grid-row: 1 / span 2; width: 84px; height: 84px; border: 0; }
.acct-avatar { border: 0; border-radius: 0; background: var(--lt-blue); }
.acct-avatar-edit { right: auto; left: 0; bottom: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--lt-lit); border: 0; color: var(--lt-desk); }
.acct-info { display: contents; }
.acct-row { grid-column: 2; min-height: 44px; gap: 2px; align-items: center; }
.acct-name { color: var(--lt-text); font-family: var(--lt-display); font-size: 30px; font-weight: 400; line-height: 1; letter-spacing: 1.2px; padding-top: 3px; }
.acct-bio-wrap { grid-column: 2; align-items: center; gap: 2px; }
.acct-bio { color: var(--lt-body); font-size: 14.5px; }
.acct-edit-btn { flex: none; width: 44px; height: 44px; color: var(--lt-blue); font-size: 17px; }
.acct-stats { grid-column: 1 / -1; display: flex; gap: 0; margin-top: 14px; box-shadow: inset 0 1px 0 var(--lt-line), inset 0 -1px 0 var(--lt-line); }
.acct-stat {
  flex: 1 1 0;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  box-shadow: inset -1px 0 0 var(--lt-line);
  color: var(--lt-dim);
  font-family: var(--lt-mono);
  font-size: 10px;
  font-weight: 500;
}
.acct-stat:last-child { box-shadow: none; }
.acct-stat b { color: var(--lt-text); font-family: var(--lt-mono); font-size: 22px; font-weight: 500; line-height: 1; }
.acct-gallery-links { grid-column: 1 / -1; flex-direction: column; flex-wrap: nowrap !important; gap: 0 !important; margin-top: 0 !important; }
.acct-gallery-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0;
  background: none;
  box-shadow: inset 0 -1px 0 var(--lt-line);
  color: var(--lt-text) !important;
  font-family: var(--lt-mono);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}
.acct-gallery-links a::after { content: '\203A'; color: var(--lt-dim); font-size: 22px; font-weight: 400; }
.acct-anim-pic { grid-column: 1 / -1; flex-direction: column; flex-wrap: nowrap !important; gap: 0 !important; margin-top: 0 !important; }
.acct-anim-pic .acct-link {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 0;
  background: none; border: 0; box-shadow: inset 0 -1px 0 var(--lt-line); cursor: pointer;
  color: var(--lt-text); font-family: var(--lt-mono); font-size: 14.5px; font-weight: 500; text-align: left;
}
.acct-anim-pic .acct-link[hidden] { display: none; }
.acct-notif { margin-top: 14px; padding: 0; border: 0; }
.acct-notif-label { min-height: 44px; gap: 12px; color: var(--lt-body); font-size: 14.5px; }
.acct-notif-note { color: var(--lt-dim); font-size: 12.5px; }
.acct-danger { margin-top: 12px; padding: 0 0 6px; border: 0; }
.acct-delete { display: flex; align-items: center; justify-content: center; width: 100%; background: none !important; box-shadow: inset 0 0 0 1px var(--lt-red); color: var(--lt-red) !important; }
.acct-field-input { background: var(--lt-band); border: 0; color: var(--lt-text); font-family: var(--lt-sans); font-size: 15px; padding: 8px 10px; }
.acct-list-body { background: none; color: var(--lt-text); }
.acct-list-row { min-height: 54px; gap: 10px; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--lt-line); color: var(--lt-text); font-size: 14.5px; text-decoration: none; }

/* ---------- 11. Splash ---------- */
#splash-overlay {
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 92px) 24px calc(var(--safe-bottom) + 46px);
  box-sizing: border-box;
  background: radial-gradient(90% 56% at 50% 34%, #16222E 0, var(--lt-desk) 66%);
  background-color: var(--lt-desk);
  color: var(--lt-text);
  font-family: var(--lt-sans);
}
.lt-splash-brand { position: relative; display: flex; flex-direction: column; align-items: center; }
.lt-splash-art { position: relative; width: 278px; height: 278px; }
.lt-splash-art::before { content: ''; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(143, 216, 242, 0.34), rgba(143, 216, 242, 0)); }
.lt-splash-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.lt-splash-name { position: relative; margin-top: -2px; color: var(--lt-text); font-family: var(--lt-display); font-size: 104px; line-height: 1; letter-spacing: 3px; }
.lt-splash-pro { position: absolute; left: 100%; top: 12px; display: none; margin-left: 6px; padding: 3px 7px 1px; background: var(--lt-red); color: var(--lt-desk); font-size: 30px; line-height: 1; letter-spacing: 1.2px; }
#splash-overlay.is-pro .lt-splash-pro { display: block; }
.lt-splash-tag { margin-top: 6px; color: var(--lt-blue); font-family: var(--lt-mono); font-size: 12px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; }
.lt-splash-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#splash-status { min-height: 16px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 12px; font-weight: 500; }
.lt-splash-bar { width: 177px; height: 12px; background: repeating-linear-gradient(90deg, var(--lt-line) 0 12px, transparent 12px 15px); }
#splash-bar { height: 12px; background: repeating-linear-gradient(90deg, var(--lt-blue) 0 12px, transparent 12px 15px); transition: width 0.2s steps(3, end); }
.lt-splash-by { display: flex; align-items: baseline; gap: 8px; margin-top: 44px; }
.lt-splash-by span { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 16px; }
.lt-splash-by b { font-family: var(--lt-display); font-size: 36px; font-weight: 400; line-height: 1; letter-spacing: 1.5px; }

/* ---------- 12. Pro gate and paywall ---------- */
#win98-paywall-popup [data-win98-panel] {
  width: 100% !important;
  max-width: 560px !important;
  height: 100dvh;
  padding: 0 14px;
  background: var(--lt-desk) !important;
  box-shadow: none !important;
}
#win98-paywall-popup [data-win98-panel]::before, #win98-paywall-popup [data-win98-panel]::after { display: none; }
#win98-paywall-popup.ad-sheet-overlay { align-items: stretch !important; }
#win98-paywall-popup [data-win98-titlebar] {
  position: relative;
  height: calc(100px + var(--safe-top));
  margin: 0 -14px 6px;
  padding: calc(12px + var(--safe-top)) 120px 0 14px !important;
  box-sizing: border-box;
  background: url('../flipjaw-marks.svg') no-repeat right 8px bottom 0 / 96px 96px !important;
}
#win98-paywall-popup [data-win98-title] { font-size: 42px !important; line-height: 0.95 !important; letter-spacing: 1.5px; }
#win98-paywall-popup [data-win98-body] { max-height: none; overflow: visible; }
#win98-paywall-popup [data-win98-body] > div:first-child { color: var(--lt-text) !important; font-family: var(--lt-display); font-size: 32px !important; font-weight: 400 !important; line-height: 1; letter-spacing: 1.2px; }
#win98-paywall-popup [data-win98-body] ul { margin-bottom: 10px !important; font-size: 14.5px; line-height: 1.5 !important; }
#win98-paywall-popup [data-win98-body] button[data-plan] {
  min-height: 52px;
  padding: 0 12px !important;
  background: none !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px var(--lt-line) !important;
  color: var(--lt-text) !important;
  font-family: var(--lt-mono) !important;
  font-size: 14.5px !important;
}
#win98-paywall-popup button[data-plan] span { color: inherit !important; font-size: inherit; }
#win98-paywall-popup button[data-plan] [data-dot] { display: none; }
#win98-paywall-popup button[data-plan]:has([data-dot][style*="#000080"]),
#win98-paywall-popup button[data-plan]:has([data-dot][style*="rgb(0, 0, 128)"]) { background: var(--lt-blue) !important; box-shadow: none !important; color: var(--lt-desk) !important; }
#win98-paywall-popup button[data-plan] span[style*="font-size:10px"] { font-size: 11px !important; font-weight: 400; }
#win98-paywall-popup button[data-plan] span[style*="background:#000080"] { padding: 2px 4px !important; background: var(--lt-red) !important; color: var(--lt-desk) !important; font-family: var(--lt-mono); font-size: 9px !important; font-weight: 600; }
#win98-paywall-popup [data-win98-body] a { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--lt-mono); font-size: 12.5px; font-weight: 500; }
#win98-paywall-popup [data-win98-body] div[style*="font-size:10px"], #win98-paywall-popup [data-win98-body] p { color: var(--lt-dim) !important; font-size: 12px !important; line-height: 1.35; }

/* Sign-in gate: Flipjaw glowing on the desk, with the sheet on top */
#pro-gate-signin.ad-sheet-overlay, #pro-gate-loading.ad-sheet-overlay { background: radial-gradient(90% 56% at 50% 30%, #16222E 0, var(--lt-desk) 66%) !important; background-color: var(--lt-desk) !important; }
#pro-gate-signin::before, #pro-gate-loading::before {
  content: 'Flippy';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 300px);
  color: var(--lt-text);
  font-family: var(--lt-display);
  font-size: 78px;
  line-height: 1;
  letter-spacing: 3px;
  text-align: center;
}
#pro-gate-signin::after, #pro-gate-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 62px);
  width: 236px;
  height: 236px;
  margin-left: -118px;
  background: url('../flipjaw-marks.svg') center / contain no-repeat, radial-gradient(closest-side, rgba(143, 216, 242, 0.34), rgba(143, 216, 242, 0));
}
.lt-gate-pro { position: absolute; left: calc(50% + 86px); top: calc(var(--safe-top) + 310px); padding: 3px 6px 1px; background: var(--lt-red); color: var(--lt-desk); font-family: var(--lt-display); font-size: 24px; line-height: 1; letter-spacing: 1.2px; }
#pro-gate-signin [data-win98-titlebar], #pro-gate-loading [data-win98-titlebar] { display: none !important; }
#pro-gate-signin [data-win98-body] > div:first-child { color: var(--lt-text) !important; font-family: var(--lt-display); font-size: 27px !important; font-weight: 400 !important; line-height: 1.05; letter-spacing: 1.2px; }
#pro-gate-signin [data-win98-body] > div:nth-child(2) { margin-bottom: 14px !important; }
#pro-gate-loading [data-win98-panel] { padding-bottom: calc(var(--safe-bottom) + 90px); background: none !important; box-shadow: none !important; }
#pro-gate-loading [data-win98-panel]::before, #pro-gate-loading [data-win98-panel]::after { display: none; }
#pro-gate-loading [data-win98-body] > div { padding: 0 !important; color: var(--lt-dim) !important; font-family: var(--lt-mono); font-size: 12px !important; text-align: center; }

/* ---------- 13. Export, Background, Submit and project sheets ---------- */
/* The Export sheet: three ways out */
#win98-output-popup [data-win98-titlebar] { min-height: 30px; padding: 2px 44px 0 98px !important; }
.export-thumb { position: absolute; left: 14px; top: 34px; width: 86px; height: 50px; object-fit: cover; background: var(--lt-band); box-shadow: 0 0 0 1px var(--lt-line); }
.export-name { min-height: 22px; margin: 0 40px 0 98px; padding-bottom: 8px; color: var(--lt-dim); font-family: var(--lt-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.export-name + .export-option { box-shadow: inset 0 1px 0 var(--lt-line), inset 0 -1px 0 var(--lt-line); }
.export-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 0 4px 0 0; box-sizing: border-box; background: none; border: 0; box-shadow: inset 0 -1px 0 var(--lt-line); color: var(--lt-text); text-align: left; cursor: pointer; }
.export-option:last-child { box-shadow: none; }
.export-option:disabled { opacity: 0.4; cursor: default; }
.export-option-icon { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--lt-line); color: var(--lt-blue); }
.export-option-icon svg { width: 24px; height: 24px; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.export-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.export-option-text b { font-family: var(--lt-mono); font-size: 16px; font-weight: 500; line-height: 1.1; }
.export-option-text small { color: var(--lt-dim); font-family: var(--lt-sans); font-size: 12.5px; line-height: 1.25; }
.export-option-go { flex: none; width: 16px; height: 16px; color: var(--lt-dim); }

/* Share GIF: the build runs in the sheet, then the GIF plays in the same spot */
#win98-share-gif-popup [data-win98-body] > div,
#win98-share-gif-popup [data-win98-body] li { color: var(--lt-body) !important; font-size: 14.5px; }
#win98-share-gif-popup [data-win98-body] b { color: var(--lt-text); font-weight: 500; }
#win98-share-gif-popup [data-win98-body] ul { margin-bottom: 12px !important; }
#share-gif-stage { flex-direction: column; gap: 12px; min-height: 140px !important; padding: 8px !important; background: var(--lt-band) !important; }
#share-gif-stage .spinner { width: 192px; }
#share-gif-status { color: var(--lt-body) !important; font-family: var(--lt-mono); font-size: 12.5px !important; font-variant-numeric: tabular-nums; }
#share-gif-size { color: var(--lt-dim) !important; font-family: var(--lt-mono); font-size: 12px !important; }
#share-gif-go:not(:disabled) { background: var(--lt-blue); box-shadow: none; color: var(--lt-desk); }
#share-gif-go:disabled { opacity: 0.45; }

/* Background sheet */
#win98-bg-popup [data-win98-body] > div > span { color: var(--lt-dim) !important; font-family: var(--lt-mono); font-size: 10px !important; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
#win98-bg-popup .bg-swatch { width: 50px !important; height: 50px !important; border: 0 !important; border-radius: 0 !important; box-shadow: inset 0 0 0 1px var(--lt-line); }
#win98-bg-popup .bg-swatch.active { outline: 2px solid var(--lt-red); outline-offset: 2px; }
#win98-bg-popup #bg-margin-btn-group { gap: 0 !important; }
#win98-bg-popup .hover-option { min-height: 46px; background: none; }
#win98-bg-popup .hover-option.active { background: var(--lt-blue); }

/* Phones keep the header short: fullscreen lives in the menu there */
@media (max-width: 600px) { #btn-fullscreen { display: none !important; } }
@media (min-width: 601px) { #btn-fullscreen-menu { display: none !important; } }

/* Submit To Gallery: a full page, so the keyboard never pushes it under the Dynamic Island */
#win98-submit-popup.ad-sheet-overlay { align-items: stretch !important; }
#win98-submit-popup [data-win98-panel] {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: calc(var(--safe-top) + 12px) 14px calc(var(--safe-bottom) + 14px);
  background: var(--lt-desk) !important;
  box-shadow: none !important;
}
#win98-submit-popup [data-win98-panel]::before, #win98-submit-popup [data-win98-panel]::after { display: none; }
#win98-submit-popup [data-win98-close] { top: calc(var(--safe-top) + 4px); }
#win98-submit-popup [data-win98-body] { flex: 1 1 auto; min-height: 0; max-height: none; }
#submit-preview-video { width: 100% !important; height: auto !important; margin: 0 !important; background: var(--lt-band) !important; border: 0 !important; box-shadow: 0 0 0 1px var(--lt-line) !important; }
#win98-submit-popup label[style*="flex-direction:column"] { color: var(--lt-dim); font-family: var(--lt-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
#win98-submit-popup label[style*="flex-direction:column"] input, #win98-submit-popup label[style*="flex-direction:column"] textarea { background: var(--lt-band) !important; text-transform: none; letter-spacing: 0; }
#win98-submit-popup label[style*="flex-start"] { color: var(--lt-body); font-size: 13.5px !important; }
#submit-progress-bar { background: var(--lt-blue) !important; }
#submit-progress-wrap > div:last-child { height: 12px !important; padding: 0 !important; background: var(--lt-line) !important; border: 0 !important; }

/* Small state details */
#comment-form p, .id-comment-form p { color: var(--lt-dim) !important; font-size: 12.5px !important; }

/* Project options sheet */
.home-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 54px;
  margin-bottom: 10px;
  padding: 0 12px;
  background: none;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--lt-line);
  color: var(--lt-text);
  font-family: var(--lt-mono);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.home-option svg { flex: none; color: var(--lt-blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-option.is-danger, .home-option.is-danger svg { color: var(--lt-red); }
#home-option-cancel { width: 100%; min-height: 52px; margin-top: 6px; background: none; }

/* ---------- 14. Sideways and wide screens ---------- */
@media (orientation: landscape) {
  #main-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 3px; }
  #gif-preview-panel, #frame-preview-panel { min-height: 0; border: 0; }
  /* One row of tools under the two panels */
  #tool-deck { grid-column: 1 / -1; grid-template-columns: repeat(14, minmax(0, 1fr)); grid-template-rows: var(--lt-key); }
  #btn-detect-corners, #btn-corner-snap, #btn-rotate-ccw, #btn-camera, #btn-frame-add, #btn-frame-dup, #btn-frame-trash,
  #btn-detect-all, #btn-play-pause, #btn-fps-hover, #btn-margin-hover, #btn-clear { grid-area: auto; grid-row: 1; }
  #btn-detect-corners { grid-column: 1; }
  #btn-detect-all { grid-column: 2; }
  #btn-corner-snap { grid-column: 3; }
  #btn-rotate-ccw { grid-column: 4; }
  #btn-camera { grid-column: 5; }
  #btn-frame-add { grid-column: 6; }
  #btn-frame-dup { grid-column: 7; }
  #btn-frame-trash { grid-column: 8; box-shadow: inset -1px -1px 0 var(--lt-line); }
  #btn-play-pause { grid-column: 9; }
  #btn-fps-hover { grid-column: 10; }
  #btn-margin-hover { grid-column: 11; }
  #btn-clear { grid-column: 12; }
  #btn-download-gif { grid-area: 1 / 13 / auto / span 2; }
  #frame-preview-status { padding: 0 12px; }
}
/* Short sideways phones keep the panels tall enough to work in */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --lt-key: 46px; --timeline-height: 64px; }
  .preview-overlay-btn::after { font-size: 9px; }
}
/* Wide screens: tabs move into the header, where a mouse expects them */
@media (min-width: 900px) and (min-height: 560px) {
  #workspace-tabs { position: static; flex: 0 0 auto; height: 44px; padding: 0; margin: 0 12px; background: none; box-shadow: none; gap: 6px; }
  .workspace-tab, .workspace-tab:last-child { flex: none; flex-direction: row; gap: 7px; height: 44px; padding: 0 12px; box-shadow: none; font-size: 12.5px; }
  .workspace-tab.active, .workspace-tab.active:last-child { box-shadow: inset 0 -3px 0 var(--lt-red); }
  #gallery-view, #admin-view { padding-bottom: 0; }
  #btn-home-new { position: static; width: 100%; margin-bottom: 8px; }
  #home { padding-bottom: 24px; }
  .gallery-main > .anim-grid, .gallery-main > .anim-grid.is-large { padding: 14px; gap: 14px; }
  /* Centred under the tabs once the screen is wider than the grid's 1600px cap */
  .gallery-main > .anim-grid { margin-left: auto; margin-right: auto; }
  /* Animators: one full-width row each, so a row's thumbnails run across the screen */
  .creator-thumb { width: 220px; }
}
/* All five Gallery tabs fit on a 360-wide phone */
@media (max-width: 379px) {
  .gallery-view-tab { padding: 0 7px; }
}
/* Narrow phones: labels keep their room */
@media (max-width: 374px) {
  #tool-deck { grid-template-columns: 66px repeat(6, minmax(0, 1fr)); }
  .preview-overlay-btn::after { font-size: 9.5px; }
}

/* Inline "PRO" tag on Lite-locked options (export dialog, margin panel, submit, Home rows). */
.pro-badge.pro-tag { position: static; display: inline-block; vertical-align: middle; margin-left: 4px; box-shadow: none; }

/* Home: import a .flippy project file */
#btn-home-import {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 46px; margin: 10px 0 0; padding: 0;
  background: none; border: 1px dashed var(--lt-line); box-shadow: none;
  color: var(--lt-blue); font-family: var(--lt-mono); font-size: 13px; font-weight: 600; cursor: pointer;
}
#btn-home-import svg { flex: none; }

/* Website (web build): the Gallery is the whole page. The tab bar appears only
   for admins, once the Admin tab has been added (body.has-admin-tab). */
body.web-site #workspace-tabs { display: none; }
body.web-site.has-admin-tab #workspace-tabs { display: flex; }
body.web-site:not(.has-admin-tab) #gallery-view { padding-bottom: var(--safe-bottom); }

/* Waiting phrases (wait-phrases.js): a quick fade each time the status line swaps text */
@keyframes wait-swap-in { from { opacity: 0; } to { opacity: 1; } }
.wait-swap { animation: wait-swap-in 0.35s ease-out; }
@media (prefers-reduced-motion: reduce) { .wait-swap { animation: none; } }

/* ---------- 15. Mouse and trackpad ----------
   The look above is built for touch. These rules only switch on for a mouse or trackpad
   (hover: hover and pointer: fine), so phones and tablets look exactly as before.
   One recipe everywhere:
     plain buttons: a faint blue wash, and dim text turns white
     tabs: dim text turns white (no wash, so only the selected tab looks selected)
     outlined buttons: the outline turns blue
     filled buttons: a touch brighter, and darker while pressed
     red (danger) buttons: the same, in red
     flipbook tiles: the picture brightens, gets a blue edge, and the title turns blue */
@media (hover: hover) and (pointer: fine) {
  :root {
    --lt-hover: rgba(143, 216, 242, 0.09);
    --lt-press: rgba(143, 216, 242, 0.18);
    --lt-hover-red: rgba(255, 92, 77, 0.10);
    --lt-press-red: rgba(255, 92, 77, 0.20);
  }

  /* There's no pulling with a mouse, so the toolbar shows a Refresh button instead. */
  .gallery-toolbar .gallery-refresh-btn { display: grid !important; place-items: center; width: 48px; height: 46px; padding: 0; box-shadow: inset 1px 0 0 var(--lt-line); cursor: pointer; transition: background-color 0.12s linear; }
  .gallery-toolbar .gallery-refresh-btn svg { width: 21px; height: 21px; }
  .gallery-toolbar .gallery-refresh-btn:hover { background: var(--lt-hover); }
  .gallery-toolbar .gallery-refresh-btn:active { background: var(--lt-press); }

  :is(.workspace-tab, .gallery-view-tab, #gallery-sort-btn, #gallery-layout-btn, .gallery-menu-item,
      .header-user-menu-item, #btn-login.header-auth-btn, #btn-user-menu, .sort-dir-btn:not(.active),
      .fb-icon, .fb-share, #fb-play, .fb-key, .fb-creator, .creator-row .creator-top, .creator-more,
      .comment-delete-btn, .fb-comments .comment-author,
      .fb-pick, .fb-tag, .fb-card, .tag-chip, .btn-load-more, .scope-pill, .creator-follow.is-on,
      .btn-secondary, .btn-primary, .fb-remove, .scope-pill-clear) {
    cursor: pointer;
    transition: background-color 0.12s linear, color 0.12s linear, box-shadow 0.12s linear, filter 0.12s linear;
  }

  /* Plain buttons. Tabs only brighten their text: a wash would look more selected than the
     selected tab, which is marked by its underline alone. */
  :is(#gallery-sort-btn, #gallery-layout-btn, .gallery-menu-item,
      .header-user-menu-item, #btn-login.header-auth-btn, #btn-user-menu, .sort-dir-btn:not(.active),
      .fb-icon, .fb-share, #fb-play, .fb-key, .fb-creator, .creator-row .creator-top, .creator-more,
      .comment-delete-btn):hover {
    background: var(--lt-hover);
  }
  :is(.workspace-tab, .gallery-view-tab, .fb-share, .fb-key, .fb-comments .comment-author, .header-user-menu-item):hover {
    color: var(--lt-text);
  }
  :is(#gallery-sort-btn, #gallery-layout-btn, .gallery-menu-item,
      .header-user-menu-item, #btn-login.header-auth-btn, #btn-user-menu, .sort-dir-btn:not(.active),
      .fb-icon, .fb-share, #fb-play, .fb-key, .fb-creator, .creator-row .creator-top, .creator-more,
      .comment-delete-btn):active {
    background: var(--lt-press);
  }
  .fb-comments .comment-author:hover { text-decoration: underline; text-underline-offset: 2px; }

  /* Outlined buttons */
  :is(.fb-pick, .fb-tag, .fb-card, .tag-chip, .btn-load-more, .scope-pill, .creator-follow.is-on,
      .btn-secondary, .btn-primary):not(:disabled):hover {
    background: var(--lt-hover);
    box-shadow: inset 0 0 0 1px var(--lt-blue);
    color: var(--lt-blue);
  }
  :is(.fb-card, .btn-load-more, .scope-pill, .btn-secondary, .btn-primary):not(:disabled):hover { color: var(--lt-text); }
  :is(.fb-pick, .fb-tag, .fb-card, .tag-chip, .btn-load-more, .scope-pill, .creator-follow.is-on,
      .btn-secondary, .btn-primary):not(:disabled):active {
    background: var(--lt-press);
  }

  /* Red buttons */
  :is(.fb-remove, .scope-pill-clear):hover { background: var(--lt-hover-red); }
  .fb-remove:hover { box-shadow: inset 0 0 0 1px var(--lt-red); }
  :is(.fb-remove, .scope-pill-clear):active { background: var(--lt-press-red); }

  /* Filled buttons */
  :is(.fb-post, .creator-follow:not(.is-on)):not(:disabled) { transition: filter 0.12s linear; }
  :is(.fb-post, .creator-follow:not(.is-on)):not(:disabled):hover { filter: brightness(1.1); }
  :is(.fb-post, .creator-follow:not(.is-on)):not(:disabled):active { filter: brightness(0.88); }

  /* Flipbook tiles and an animator's thumbnails */
  .anim-tile :is(video, img.tile-media), .creator-thumb img { transition: filter 0.15s linear, outline-color 0.15s linear; outline: 1px solid transparent; outline-offset: -1px; }
  .anim-tile:hover :is(video, img.tile-media), .creator-thumb:hover img { filter: brightness(1.12); outline-color: var(--lt-blue); }
  .anim-tile:active :is(video, img.tile-media), .creator-thumb:active img { filter: brightness(0.92); }
  .anim-tile .tile-title { transition: color 0.12s linear; }
  .anim-tile:hover .tile-title { color: var(--lt-blue); }
  .anim-grid.is-large .anim-tile:hover { background: var(--lt-hover); }
}
