/*
 * Shared QuokkaPix shell contract.
 * Image is the visual reference. Surface-specific workspaces stay in styles.css
 * and video/video.css; shared chrome is controlled here.
 */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --shell-bg: #f3f7f3;
  --shell-surface: rgba(250, 253, 251, .88);
  --shell-surface-strong: #fcfffd;
  --shell-surface-muted: #edf4ef;
  --shell-border: rgba(66, 96, 83, .14);
  --shell-text: #16211d;
  --shell-muted: #607269;
  --shell-accent: #156f5e;
  --shell-accent-soft: rgba(21, 111, 94, .11);
  --shell-shadow: 0 24px 70px rgba(17, 29, 24, .1);
  --shell-radius-xl: 28px;
  --shell-radius-lg: 22px;
  --shell-radius-md: 16px;
  --shell-radius-sm: 12px;
  --shell-transition: 180ms ease;
  --shell-page-padding-inline: 10px;
  --shell-page-padding-bottom: 24px;
  --shell-topbar-top: 10px;
  --shell-topbar-height: 76px;
  --shell-topbar-padding-inline: 16px;
  --shell-stack-gap: 14px;
  --shell-dock-top: calc(var(--shell-topbar-top) + var(--shell-topbar-height) + var(--shell-stack-gap));

  /* Compatibility aliases used by both editor workspaces. */
  --bg: var(--shell-bg);
  --surface: var(--shell-surface);
  --surface-strong: var(--shell-surface-strong);
  --surface-muted: var(--shell-surface-muted);
  --surface-2: var(--shell-surface-muted);
  --border: var(--shell-border);
  --line: var(--shell-border);
  --text: var(--shell-text);
  --muted: var(--shell-muted);
  --accent: var(--shell-accent);
  --accent-soft: var(--shell-accent-soft);
  --shadow: var(--shell-shadow);
  --radius-xl: var(--shell-radius-xl);
  --radius-lg: var(--shell-radius-lg);
  --radius-md: var(--shell-radius-md);
  --radius-sm: var(--shell-radius-sm);
  --transition: var(--shell-transition);
  --topbar-top: var(--shell-topbar-top);
  --topbar-height: var(--shell-topbar-height);
  --topbar-padding-block: 0px;
  --topbar-padding-inline: var(--shell-topbar-padding-inline);
  --stack-gap: var(--shell-stack-gap);
  --dock-top: var(--shell-dock-top);
}

:root[data-theme="dark"] {
  --shell-bg: #111714;
  --shell-surface: rgba(20, 28, 24, .84);
  --shell-surface-strong: #16201c;
  --shell-surface-muted: #1c2722;
  --shell-border: rgba(223, 237, 229, .11);
  --shell-text: #edf4ef;
  --shell-muted: #9faea4;
  --shell-accent: #68cfb1;
  --shell-accent-soft: rgba(104, 207, 177, .12);
  --shell-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

body { font-family: "Manrope", sans-serif; }

.page-shell,
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  padding: 10px var(--shell-page-padding-inline) var(--shell-page-padding-bottom);
}

.topbar {
  position: sticky;
  top: var(--shell-topbar-top);
  z-index: 30;
  display: block;
  height: var(--shell-topbar-height);
  max-height: 100px;
  padding: 0 var(--shell-topbar-padding-inline);
  overflow: hidden;
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-radius-xl);
  background: rgba(250, 253, 251, .74);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: var(--shell-shadow);
}

:root[data-theme="dark"] .topbar { background: rgba(16, 23, 20, .72); }

.topbar__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-width: 0;
}

.topbar__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.brand-block {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--shell-text);
  text-decoration: none;
}

.brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

:root[data-theme="dark"] .brand-block { overflow: visible; }

:root[data-theme="dark"] .brand-block::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 18px;
  width: min(50vw, 392px);
  height: 62%;
  border-radius: 999px;
  background: radial-gradient(circle at 24% 50%, rgba(140, 208, 255, .28), transparent 42%), radial-gradient(circle at 54% 50%, rgba(255, 255, 255, .15), transparent 48%), radial-gradient(circle at 76% 48%, rgba(104, 207, 177, .1), transparent 38%);
  filter: blur(18px);
  opacity: .98;
  pointer-events: none;
  transform: translateY(-50%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 82%, transparent 100%);
}

:root[dir="rtl"][data-theme="dark"] .brand-block::after {
  right: 18px;
  left: auto;
  -webkit-mask-image: linear-gradient(270deg, transparent 0%, #000 10%, #000 82%, transparent 100%);
  mask-image: linear-gradient(270deg, transparent 0%, #000 10%, #000 82%, transparent 100%);
}

:root[data-theme="dark"] .brand-logo {
  filter: brightness(1.1) contrast(1.05) drop-shadow(0 1px 0 rgba(255, 255, 255, .24)) drop-shadow(0 0 18px rgba(126, 199, 255, .12)) drop-shadow(0 12px 34px rgba(102, 182, 255, .2));
}

.product-switch {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--shell-surface-muted) 82%, transparent);
  transform: translate(-50%, -50%);
}

.product-switch__item {
  min-width: 0;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--shell-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.product-switch__item:hover { color: var(--shell-text); }
.product-switch__item.is-active { background: var(--shell-surface); color: var(--shell-accent); box-shadow: 0 5px 16px rgba(20, 36, 30, .1); }

.language-pill,
.theme-fab {
  border: 1px solid var(--shell-border);
  background: rgba(250, 253, 251, .72);
  color: var(--shell-text);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 12px 28px rgba(17, 29, 24, .08);
}

:root[data-theme="dark"] .language-pill,
:root[data-theme="dark"] .theme-fab { background: rgba(16, 23, 20, .74); }

.language-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 999px; cursor: pointer; }
.language-pill__label { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--shell-accent-soft); color: var(--shell-accent); font-size: .82rem; font-weight: 800; }
.language-pill__text { font-size: .92rem; font-weight: 700; }
.theme-fab { display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border-radius: 999px; color: var(--shell-accent); cursor: pointer; }
.theme-fab__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--shell-accent-soft); color: var(--shell-accent); font-size: 1.08rem; font-weight: 800; }

.privacy-pill,
.hint-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--shell-accent-soft); color: var(--shell-accent); font-size: .88rem; font-weight: 700; }

.mode-dock { position: sticky; top: var(--shell-dock-top); z-index: 28; margin-top: 14px; }
.action-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(74px, 1fr); grid-template-columns: none; grid-template-rows: 1fr; grid-auto-rows: 1fr; gap: 10px; width: 100%; margin: 0; padding: 12px; overflow-x: auto; overflow-y: hidden; border: 1px solid rgba(255, 255, 255, .28); border-radius: 30px; background: rgba(255, 255, 255, .5); backdrop-filter: blur(22px) saturate(135%); scroll-snap-type: x proximity; scroll-padding-inline: 12px; overscroll-behavior-x: contain; scrollbar-width: none; -ms-overflow-style: none; }
.action-strip::-webkit-scrollbar { display: none; }
:root[data-theme="dark"] .action-strip { background: rgba(16, 23, 20, .62); }
.action-chip { --chip-content-shift-y: 0px; position: relative; display: grid; min-width: 0; min-height: 88px; padding: 14px 8px 11px; overflow: hidden; align-content: center; justify-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 24px; background: transparent; color: var(--shell-muted); font-weight: 800; text-align: center; scroll-snap-align: start; transition: transform var(--shell-transition), background var(--shell-transition), color var(--shell-transition), border-color var(--shell-transition), box-shadow var(--shell-transition), opacity var(--shell-transition); }
.action-chip:hover { color: var(--shell-text); transform: translateY(-1px); }
.action-chip.active,
.action-chip.is-active { border-color: rgba(255, 255, 255, .66); background: rgba(255, 255, 255, .92); color: var(--shell-text); box-shadow: 0 14px 28px rgba(17, 29, 24, .1); }
.action-chip__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(255, 255, 255, .34); color: var(--shell-text); font-size: 1.58rem; line-height: 1; transform: translateY(var(--chip-content-shift-y)); }
.action-chip__label { max-width: 100%; overflow: hidden; font-size: .88rem; line-height: 1.15; text-overflow: ellipsis; white-space: normal; transform: translateY(var(--chip-content-shift-y)); }
.action-chip--accent { background: linear-gradient(135deg, rgba(225, 138, 79, .12), rgba(19, 106, 87, .08)); }
.action-chip__ribbon { position: absolute; top: 2px; left: 50%; z-index: 1; box-sizing: border-box; width: 66px; min-height: 17px; padding: 3px 4px 2px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: linear-gradient(135deg, rgba(225, 138, 79, .96), rgba(19, 106, 87, .94)); color: #fff; font-size: .5rem; font-weight: 800; letter-spacing: .012em; line-height: 1; text-align: center; text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 14px rgba(19, 106, 87, .16); pointer-events: none; transform: translateX(-50%); }
:root[data-theme="dark"] .action-chip { border-color: rgba(223, 237, 229, .08); color: #c4d3ca; }
:root[data-theme="dark"] .action-chip__icon { background: rgba(255, 255, 255, .08); color: #edf4ef; }
:root[data-theme="dark"] .action-chip.active,
:root[data-theme="dark"] .action-chip.is-active { border-color: rgba(104, 207, 177, .2); background: rgba(28, 38, 34, .96); color: #f5fbf7; box-shadow: 0 16px 30px rgba(0, 0, 0, .26); }
:root[data-theme="dark"] .action-chip.active .action-chip__icon,
:root[data-theme="dark"] .action-chip.is-active .action-chip__icon { background: rgba(104, 207, 177, .16); color: #f5fbf7; }
.session-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 12px; }
.session-toolbar__mode { justify-self: center; min-height: 52px; padding: 12px 20px; font-size: .98rem; font-weight: 800; text-align: center; box-shadow: 0 16px 34px rgba(19, 106, 87, .12); }
.mode-switch { display: inline-flex; padding: 5px; border: 1px solid var(--shell-border); border-radius: 999px; background: rgba(255, 255, 255, .7); backdrop-filter: blur(16px); }
.mode-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 999px; color: var(--shell-muted); font-weight: 700; }
.mode-pill.active { background: #17352e; color: #fff; box-shadow: 0 10px 24px rgba(23, 53, 46, .16); }
:root[data-theme="dark"] .mode-switch { background: rgba(24, 33, 29, .84); }
:root[data-theme="dark"] .hint-chip { background: rgba(104, 207, 177, .14); color: #dff8ef; }
:root[data-theme="dark"] .mode-pill.active { background: rgba(104, 207, 177, .16); color: #eff9f4; box-shadow: 0 12px 26px rgba(0, 0, 0, .24); }

.ghost-button,
.primary-button,
.download-button,
.start-button,
.secondary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: transform var(--shell-transition), background var(--shell-transition), color var(--shell-transition), border-color var(--shell-transition), box-shadow var(--shell-transition), opacity var(--shell-transition);
}

.ghost-button { border: 1px solid var(--shell-border); background: transparent; color: var(--shell-muted); }
.ghost-button:hover { transform: translateY(-1px); }
:root[data-theme="dark"] .ghost-button { border-color: rgba(223, 237, 229, .14); background: rgba(24, 33, 29, .4); color: #d7e6df; }

.language-list { display: grid; gap: 12px; min-height: 0; margin-top: 18px; padding-inline-end: 4px; overflow-y: auto; overscroll-behavior: contain; }
.language-option { display: grid; gap: 4px; width: 100%; padding: 16px; border: 1px solid var(--shell-border); border-radius: 18px; background: rgba(255, 255, 255, .74); color: var(--shell-text); text-align: left; cursor: pointer; transition: transform var(--shell-transition), background var(--shell-transition), border-color var(--shell-transition); }
.language-option:hover { transform: translateY(-1px); }
:root[dir="rtl"] .language-option { text-align: right; }
.language-option strong { font-size: 1rem; }
.language-option span { color: var(--shell-muted); }
.language-option.active { border-color: rgba(19, 106, 87, .36); background: rgba(19, 106, 87, .1); }
:root[data-theme="dark"] .language-option { background: rgba(24, 33, 29, .84); }
:root[data-theme="dark"] .language-option span { color: #c6d4cc; }

.trust-footer { margin-top: 18px; }
.trust-footer__inner { display: grid; justify-items: center; gap: 12px; padding: 16px 20px 18px; border: 1px solid var(--shell-border); border-radius: 22px; background: color-mix(in srgb, var(--shell-surface) 76%, transparent); backdrop-filter: blur(18px) saturate(125%); color: var(--shell-muted); text-align: center; }
.trust-footer__text { max-width: 920px; margin: 0; color: var(--shell-muted); font-size: 14px; line-height: 1.6; }
.trust-footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: 14px; }
.trust-footer__legal a,
.trust-footer__link { color: var(--shell-accent); font-weight: 800; text-decoration: none; }
.trust-footer__legal a:hover,
.trust-footer__link:hover { text-decoration: underline; }
.trust-footer__divider { color: rgba(96, 116, 107, .66); }
:root[data-theme="dark"] .trust-footer__inner { background: rgba(16, 23, 20, .66); }
:root[data-theme="dark"] .trust-footer__link { color: #dff8ef; }

@media (max-width: 900px) {
  :root {
    --shell-dock-top: calc(var(--shell-topbar-top) + var(--shell-topbar-height) + 60px);
  }

  .topbar { overflow: visible; border-radius: 24px; }
  .product-switch { top: calc(100% + 10px); left: 50%; width: min(300px, calc(100vw - 20px)); padding: 4px; background: color-mix(in srgb, var(--shell-surface-strong) 92%, transparent); box-shadow: 0 12px 28px rgba(17, 29, 24, .08); transform: translateX(-50%); }
  .product-switch__item { flex: 1 1 auto; padding: 9px 7px; font-size: clamp(10px, 2.9vw, 12px); }
  .mode-dock { margin-top: 60px; }

  .action-strip {
    grid-auto-flow: column;
    grid-auto-columns: 108px;
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-rows: 1fr;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 10px;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .action-strip::-webkit-scrollbar { display: none; }
  .action-chip { grid-row: 1; min-height: 102px; scroll-snap-align: start; }
  .trust-footer__inner { justify-items: center; padding: 16px 20px 18px; text-align: center; }
  .trust-footer__pill { display: none; }
  .trust-footer__text,
  .trust-footer__legal { font-size: 14px; }
}

@media (max-width: 760px) {
  .action-strip { grid-auto-columns: 96px; gap: 10px; padding: 10px; }
  .action-chip { min-height: 88px; padding: 16px 8px 10px; }
  .session-toolbar { grid-template-columns: 1fr; }
  .mode-switch { grid-column: auto; width: 100%; }
  .mode-pill { flex: 1; }
  .session-toolbar__mode { width: 100%; justify-self: stretch; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .ghost-button { flex: 1 1 0; }
}

@media (max-width: 640px) {
  :root {
    --shell-topbar-height: 60px;
    --shell-topbar-padding-inline: 10px;
  }

  .topbar { border-radius: 22px; }
  .topbar__main { gap: 8px; }
  .language-pill { min-height: 44px; padding: 0 10px; gap: 8px; }
  .language-pill__label { width: 28px; height: 28px; }
  .language-pill__text { display: none; }
  .theme-fab { width: 44px; height: 44px; }
  .theme-fab__icon { width: 28px; height: 28px; }
}
