    @font-face {
      font-family: "Manrope";
      src: url("../Manrope-Variable.ttf") format("truetype");
      font-style: normal;
      font-weight: 200 800;
      font-display: swap;
    }

    :root {
      /* Shared typography and icon scale for Telegram and the website. */
      --text-caption: 12px;
      --text-small: 14px;
      --text-body: 16px;
      --text-heading-small: 18px;
      --text-heading: 20px;
      --text-title: 24px;
      --text-display: 28px;
      --text-amount: 32px;
      --text-balance: 40px;
      --icon-small: 16px;
      --icon-default: 20px;
      --icon-large: 24px;
      --bg-gradient: #FFFFFF;
      --surface-warm: #202020;
      --topbar-bg: #171717;
      --topbar-text: #FFFFFF;
      --topbar-subtext: #A7A7A7;
      --topbar-button-bg: #383838;
      --topbar-button-text: #FFFFFF;
      --font-ui: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --accent-pearl: #EAE7E5;
      --accent-pearl-hover: #E1DEDC;
      --accent-pearl-border: #D4D0CD;
      --accent-pearl-text: #262625;
      --feedback-star-fill: #F3C64A;
      --feedback-star-stroke: #DDA51F;
      --active-gradient: #EAE7E5;
      --photo-option-gradient: linear-gradient(112deg, #FFFBF5 0%, #FAF2E7 54%, #F5E8D5 100%);
      --action-gradient: linear-gradient(110deg, #F0D5A2 0%, #E2C18D 52%, #C09E6B 100%);
      --panel-bg: #FFFFFF;
      --panel-border: rgba(38, 38, 37, 0.10);
      --text-main: #262625;
      --text-muted: #686663;
      --text-subtle: #878480;
      --dock-bg: #FFFFFF;
      --sheet-bg: #FFFFFF;
      --sheet-sub-bg: #EAE7E5;
      --pill-bg: rgba(0, 0, 0, 0.025);
      --pill-border: rgba(0, 0, 0, 0.035);
      --btn-back-bg: rgba(0, 0, 0, 0.04);
      --btn-back-hover: rgba(0, 0, 0, 0.08);
      --radius-xl: 24px;
      --page-surface-radius: 24px;
      --page-surface-bg: #FFFFFF;
      --page-surface-backdrop: #000000;
      --sheet-backdrop: rgba(0, 0, 0, .65);
      --radius-lg: 18px;
      --radius-md: 14px;
      --shadow-dock: none;
      --shadow-soft: none;
      --page-gutter: clamp(12px, 3.6vw, 20px);
      --edge-gap: 12px;
      --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
      --page-top: max(var(--edge-gap), var(--safe-top));
      --curtain-gap: calc(var(--page-top) + var(--topbar-height, 0px));
      --page-bottom: max(var(--edge-gap), env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
      --safe-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px));
      --safe-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px));
      --app-height: 100vh;
      --album-width: min(420px, calc(100vw - var(--safe-left) - var(--safe-right) - 40px));
      --dock-layout-gap: 14px;
      --dock-clearance: calc(82px + var(--page-bottom));
    }

    body:is(:not(.is-website), .is-vk-mini) { --page-surface-bg: #F9F6F4; }

    @supports (height: 100dvh) {
      :root { --app-height: 100dvh; }
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      font-family: var(--font-ui);
      background: var(--bg-gradient);
      background-attachment: fixed;
      color: var(--text-main);
      height: var(--app-height);
      min-height: 0;
      overflow: hidden;
      padding-left: var(--safe-left);
      padding-right: var(--safe-right);
      -webkit-font-smoothing: antialiased;
      letter-spacing: -0.01em;
      transition: background 0.3s ease, color 0.3s ease;
    }

    .app-preloader {
      position: fixed;
      inset: 0;
      background: #fff;
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 1;
      visibility: visible;
      transition: opacity .25s cubic-bezier(.16,1,.3,1), visibility .25s ease;
    }

    .app-preloader.fade-out {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .preloader-loader {
      position: relative;
      width: clamp(140px, 42vw, 165px);
      display: flex;
      align-items: center;
    }

    .preloader-logo-window {
      position: relative;
      width: 100%;
      animation: preloader-logo-enter .75s cubic-bezier(.2, .75, .25, 1) both,
        preloader-logo-breathe 2.8s ease-in-out .75s infinite;
      will-change: transform;
    }

    .preloader-brand {
      display: block;
      width: 100%;
      height: auto;
      user-select: none;
      -webkit-user-drag: none;
    }

    @keyframes preloader-logo-enter {
      from { opacity: 0; transform: translateY(5px) scale(.94); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes preloader-logo-breathe {
      0%, 100% { opacity: .88; transform: scale(.99); }
      50% { opacity: 1; transform: scale(1); }
    }

    .app {
      width: 100%;
      max-width: 460px;
      margin: 0 auto;
      height: var(--app-height);
      min-height: 0;
      display: block;
      overflow: hidden;
      position: relative;
      background: var(--page-surface-backdrop);
    }

    .app-topbar {
      position: absolute;
      top: var(--page-top);
      left: 0;
      right: 0;
      z-index: 1;
      background: var(--topbar-bg);
      overflow: hidden;
      height: 50px;
    }

    .app.is-topbar-open {
      --curtain-gap: var(--topbar-height, 0px);
    }

    .app.is-topbar-open .app-topbar {
      top: 0;
      height: calc(var(--page-top) + clamp(250px, 34vh, 300px));
      background: var(--topbar-bg);
    }

    .app:not(.is-topbar-open) { --curtain-gap: 0px; }
    .app:not(.is-topbar-open) .app-topbar { display: none; }
    .app:not(.is-topbar-open) .topbar-balance { display: none; }
    .app:not(.is-topbar-open) .topbar-intro,
    .app:not(.is-topbar-open) .topbar-background { display: none; }
    .topbar-background { position: absolute; inset: 0; overflow: hidden; }
    .app.has-intro-media.is-topbar-open .app-topbar { overflow: visible; }
    .app.has-intro-media.is-topbar-open .topbar-background { bottom: -24px; }
    .topbar-background img,
    .topbar-background video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--topbar-media-position, center center); }
    .topbar-background::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.62));
    }
    .app.has-intro-media { --topbar-text: #FFFFFF; --topbar-subtext: #E5E5E5; --topbar-button-bg: rgba(24,24,24,.78); }
    .topbar-balance {
      position: absolute;
      z-index: 4;
      top: calc(var(--page-top) + 5px);
      right: max(var(--page-gutter), var(--safe-right));
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 40px;
      padding: 0 13px;
      border: 0;
      border-radius: 999px;
      background: #FFFFFF;
      color: #202020;
      font: 650 var(--text-small) var(--font-ui);
      cursor: pointer;
    }
    .topbar-balance[hidden] { display: none; }
    .topbar-balance svg { width: 18px; height: 18px; }

    .topbar-intro {
      position: relative;
      z-index: 1;
      height: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: calc(var(--page-top) + 14px) 22px 20px;
      color: var(--topbar-text);
      text-align: center;
    }
    .topbar-intro[data-position^="left "] { align-items: flex-start; text-align: left; }
    .topbar-intro[data-position^="right "] { align-items: flex-end; text-align: right; }
    .topbar-intro[data-position$=" top"] { justify-content: flex-start; }
    .topbar-intro[data-position$=" bottom"] { justify-content: flex-end; }
    .topbar-intro-title {
      max-width: 400px;
      font-size: clamp(23px, 6vw, 30px);
      font-weight: 780;
      line-height: 1.15;
      letter-spacing: -.045em;
    }
    .topbar-intro-description {
      max-width: 360px;
      color: var(--topbar-subtext);
      font-size: var(--text-small);
      line-height: 1.45;
    }
    .topbar-help-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      min-height: 44px;
      margin-top: 8px;
      padding: 0 19px;
      border: 0;
      border-radius: 999px;
      background: var(--topbar-button-bg);
      color: var(--topbar-button-text);
      font: 650 var(--text-small) var(--font-ui);
      cursor: pointer;
    }
    .topbar-help-button svg {
      width: 17px;
      height: 17px;
      flex: none;
    }
    .topbar-help-button[hidden] { display: none; }

    .quick-categories {
      width: var(--album-width);
      min-width: 0;
      margin: 0 auto;
      flex: 0 0 auto;
      display: flex;
      align-items: flex-start;
      justify-content: flex-start;
      gap: 3px;
      padding: 1px 2px 4px;
      overflow-x: auto;
      overflow-y: hidden;
      direction: ltr;
      scroll-snap-type: x mandatory;
      scroll-behavior: auto;
      overflow-anchor: none;
      overscroll-behavior-x: none;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }

    .quick-categories[hidden] { display: none; }
    .quick-categories::-webkit-scrollbar { display: none; }
    .quick-categories-frame { position: relative; min-width: 0; }

    .catalog-section-rail {
      position: relative;
      top: 0;
      z-index: 20;
      width: calc(100% + 2 * var(--page-gutter));
      margin: 0 calc(-1 * var(--page-gutter));
      padding: 12px var(--page-gutter) 8px;
      scroll-padding-inline: var(--page-gutter);
      background: var(--page-surface-bg);
      border-radius: var(--page-surface-radius) var(--page-surface-radius) 0 0;
    }

    .quick-category-btn {
      width: clamp(88px, 25vw, 100px);
      flex: 0 0 clamp(88px, 25vw, 100px);
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--text-main);
      font: inherit;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      cursor: pointer;
      scroll-snap-align: none;
    }

    .quick-category-btn.is-page-start { scroll-snap-align: start; scroll-snap-stop: always; }
    .catalog-section-navigation { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 0; }
    .catalog-section-navigation[hidden], .category-pages[hidden] { display: none; }
    .category-pages {
      width: calc(100% + 2 * var(--page-gutter));
      margin: 0 calc(-1 * var(--page-gutter));
      padding: 0 var(--page-gutter) 8px;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0;
      background: var(--page-surface-bg);
    }
    .category-page-dot {
      width: 20px;
      height: 24px;
      flex: 0 0 20px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: transparent;
      cursor: pointer;
    }
    .category-page-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #A6A6A6; }
    .category-page-dot.active::before { width: 8px; height: 8px; background: var(--text-main); }
    .category-page-dot:focus-visible { outline: 2px solid var(--text-main); outline-offset: -3px; }

    .category-rail-arrow { display: none; }
    @media (hover: hover) and (min-width: 768px) {
      .quick-categories-frame .quick-categories {
        padding-inline: max(46px, var(--page-gutter));
        scroll-padding-inline: max(46px, var(--page-gutter));
      }
      .category-rail-arrow {
        position: absolute;
        z-index: 22;
        top: 50%;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #FFFFFF;
        box-shadow: 0 7px 22px rgba(38, 38, 37, .16);
        color: var(--text-main);
        cursor: pointer;
        transform: translateY(-50%);
        transition: opacity .16s ease, background .16s ease, transform .16s ease;
      }
      .category-rail-arrow[hidden] { display: none; }
      .category-rail-arrow.is-prev { left: max(8px, var(--page-gutter)); }
      .category-rail-arrow.is-next { right: max(8px, var(--page-gutter)); }
      .category-rail-arrow svg { width: 22px; height: 22px; }
      .category-rail-arrow:hover:not(:disabled) { background: #FFFFFF; transform: translateY(-50%) scale(1.06); }
      .category-rail-arrow:focus-visible { outline: 2px solid var(--text-main); outline-offset: 3px; }
      .category-rail-arrow:disabled { opacity: .3; cursor: default; box-shadow: none; }
    }

    .quick-category-art {
      width: 86px;
      height: 80px;
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
    }

    .quick-category-art img {
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      box-sizing: border-box;
      padding: 5px;
      object-fit: contain;
      transform: scale(var(--category-icon-scale, 1));
      display: block;
      pointer-events: none;
    }

    .quick-category-art svg {
      width: 28px;
      height: 28px;
      display: block;
      pointer-events: none;
    }

    /* Keep the blending backdrop inside the artwork, including during taps. */
    body:is(:not(.is-website), .is-vk-mini) .quick-category-art { background: var(--page-surface-bg); }
    body:is(:not(.is-website), .is-vk-mini) :is(.quick-category-art, .catalog-suggestion-icon) img { mix-blend-mode: multiply; }

    .quick-category-label {
      width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--text-main);
      font-size: var(--text-caption);
      font-weight: 500;
      line-height: 1.2;
      letter-spacing: -.1px;
    }

    body:is(:not(.is-website), .is-vk-mini:not(.website-workspace)) .quick-category-btn { gap: 0; }
    body:is(:not(.is-website), .is-vk-mini:not(.website-workspace)) .quick-category-label { margin-top: -8px; font-size: 13px; font-weight: 550; }
    body.is-vk-mini.website-workspace .quick-category-btn { gap: 5px; }
    body.is-vk-mini.website-workspace .quick-category-label { font-size: 13px; }

    .quick-category-btn:active .quick-category-label { color: #9C7C48; }

    .quick-category-art { color: var(--text-muted); }
    .quick-category-btn.active .quick-category-art { color: #9C7C48; }

    .catalog-suggestion {
      width: calc(100% + 2 * var(--page-gutter));
      min-height: 82px;
      margin: -12px calc(-1 * var(--page-gutter)) 4px;
      padding: 10px var(--page-gutter) 18px;
      display: flex;
      align-items: center;
      gap: 13px;
      border: 0;
      border-bottom: 1px solid #E9EAEB;
      border-radius: 0 0 var(--page-surface-radius) var(--page-surface-radius);
      background: var(--page-surface-bg);
      color: var(--text-main);
      text-align: left;
      font: inherit;
      cursor: pointer;
    }
    .catalog-suggestion[hidden] { display: none; }
    .catalog-suggestion-icon {
      width: 48px;
      height: 48px;
      flex: 0 0 48px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      background: transparent;
    }
    .catalog-suggestion-icon svg { width: 26px; height: 26px; }
    .catalog-suggestion-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
    .catalog-suggestion-copy strong { font-size: var(--text-small); font-weight: 800; line-height: 1.3; }
    .catalog-suggestion-icon img { width: 100%; height: 100%; object-fit: contain; }
    .catalog-suggestion-copy small { font-size: var(--text-caption); color: var(--text-muted); }
    #catalogTitlebar.has-suggestion { border-bottom: 0; }

    .faq-list { width: 100%; }
    .faq-item { border-bottom: 1px solid var(--panel-border); }
    .faq-question {
      width: 100%;
      min-height: 58px;
      padding: 14px 2px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      font-size: var(--text-small);
      font-weight: 500;
      line-height: 1.45;
      border: 0;
      background: transparent;
      color: var(--text-main);
      font-family: var(--font-ui);
      text-align: left;
      cursor: pointer;
    }
    .faq-chevron {
      width: 23px;
      height: 23px;
      flex: 0 0 23px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: #ECEEF0;
      color: #7E8790;
      transition: transform .18s ease;
    }
    .faq-chevron svg { width: 14px; height: 14px; }
    .faq-item.is-open .faq-chevron { transform: rotate(180deg); }
    .faq-answer {
      display: grid;
      grid-template-rows: 0fr;
      opacity: 0;
      transition: grid-template-rows .26s cubic-bezier(.2,.75,.25,1), opacity .2s ease;
    }
    .faq-item.is-open .faq-answer { grid-template-rows: 1fr; opacity: 1; }
    .faq-answer-inner { min-height: 0; overflow: hidden; }
    .faq-answer p { padding: 0 26px 17px 2px; color: var(--text-muted); font-size: var(--text-small); line-height: 1.55; }
    @media (prefers-reduced-motion: reduce) {
      .faq-answer, .faq-chevron { transition: none; }
    }
    .header-back-btn {
      position: absolute;
      left: max(4px, calc((100% - var(--album-width)) / 2 + 4px));
      top: calc((100% - var(--edge-gap)) / 2);
      transform: translateY(-50%);
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: #F3F3F3;
      border: 1px solid rgba(38,38,37,.04);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--text-main);
      transition: all .2s cubic-bezier(.16,1,.3,1);
    }

    .header-back-btn:active {
      transform: translateY(-50%);
      background: #EAE7E5;
    }

    .header-back-btn svg {
      width: 13px;
      height: 13px;
    }

    .app-content {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: grid;
      grid-template: minmax(0, 1fr) / minmax(0, 1fr);
      min-width: 0;
      min-height: 0;
      background: transparent;
      border-radius: 0;
      overflow: hidden;
      transition: none;
      z-index: 2;
    }

    .view-content {
      display: flex;
      flex-direction: column;
      grid-area: 1 / 1;
      gap: 12px;
      min-width: 0;
      min-height: 0;
      width: 100%;
      padding: 0 var(--page-gutter);
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior-y: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      opacity: 1;
      transition: none;
      overflow-anchor: none;
    }

    #viewStudio {
      padding: 0;
      gap: 0;
      background: transparent;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: auto;
    }

    .catalog-curtain-gap {
      flex: 0 0 var(--curtain-gap);
      height: var(--curtain-gap);
      position: relative;
    }

    #viewHistory,
    #viewHelp,
    .catalog-sheet,
    #viewBalance {
      width: 100%;
      background: var(--page-surface-bg);
      border-radius: var(--page-surface-radius) var(--page-surface-radius) 0 0;
    }

    .catalog-sheet {
      min-height: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 0 var(--page-gutter) var(--dock-clearance);
    }

    .catalog-sheet > * { flex-shrink: 0; }

    #viewBalance,
    #viewHistory,
    #viewHelp {
      position: relative;
      padding-top: var(--curtain-gap);
    }

    #viewDetail > *,
    #viewBalance > *,
    #viewHistory > *,
    #viewHelp > *,
    #viewStudio > * { flex-shrink: 0; }

    .view-content::-webkit-scrollbar { display: none; }

    .view-content.is-switching {
      opacity: 1;
    }

    .catalog-titlebar {
      position: relative;
      top: 0;
      z-index: 20;
      margin: 0 calc(-1 * var(--page-gutter));
      padding: 0 calc(var(--page-gutter) + 44px);
      min-height: 56px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--page-surface-bg);
      border-bottom: 1px solid #F0F1F2;
    }

    .catalog-titlebar[hidden] { display: none; }

    :is(#viewBalance, #viewHistory, #viewHelp) > .balance-back-row,
    #catalogTitlebar {
      position: sticky;
      top: 0;
      z-index: 20;
      background: var(--page-surface-bg);
      border-radius: var(--page-surface-radius) var(--page-surface-radius) 0 0;
    }

    :is(#viewBalance, #viewHistory, #viewHelp) > .balance-back-row::before,
    :is(#viewBalance, #viewHistory, #viewHelp) > .balance-back-row::after,
    #catalogTitlebar::before,
    #catalogTitlebar::after {
      content: '';
      position: absolute;
      top: 0;
      width: var(--page-surface-radius);
      height: var(--page-surface-radius);
      pointer-events: none;
    }
    :is(#viewBalance, #viewHistory, #viewHelp) > .balance-back-row::before,
    #catalogTitlebar::before { left: 0; background: radial-gradient(circle at bottom right, transparent var(--page-surface-radius), var(--page-surface-backdrop) calc(var(--page-surface-radius) + .5px)); }
    :is(#viewBalance, #viewHistory, #viewHelp) > .balance-back-row::after,
    #catalogTitlebar::after { right: 0; background: radial-gradient(circle at bottom left, transparent var(--page-surface-radius), var(--page-surface-backdrop) calc(var(--page-surface-radius) + .5px)); }

    .catalog-back-btn {
      position: absolute;
      left: var(--page-gutter);
      width: 44px;
      height: 44px;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: transparent;
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform .16s ease, opacity .16s ease;
    }

    .catalog-back-btn:active { opacity: .7; }
    .catalog-back-btn[hidden] { display: none; }
    .catalog-back-btn svg { width: var(--icon-large); height: var(--icon-large); }

    .catalog-title {
      max-width: 100%;
      font-size: var(--text-heading-small);
      font-weight: 600;
      letter-spacing: -.2px;
      color: var(--text-main);
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .catalog-title.is-category { font-size: var(--text-heading-small); }

    .album-wrapper {
      position: relative;
      width: 100%;
      height: clamp(340px, 46vh, 430px);
      min-height: 340px;
      min-width: 0;
      display: grid;
      grid-template: minmax(0, 1fr) / minmax(0, 1fr);
      gap: 0;
      overflow: hidden;
    }

    .popular-catalog-section {
      position: relative;
      width: 100%;
      min-width: 0;
      margin-bottom: 14px;
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .popular-catalog-section[hidden] {
      display: none;
    }

    .popular-swipe-pagination {
      position: absolute;
      right: calc((100% - var(--album-width)) / 2 + 14px);
      bottom: 14px;
      z-index: 6;
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 5px 8px;
      border-radius: 999px;
      background: rgba(14, 16, 24, .45);
      backdrop-filter: blur(14px) saturate(180%);
      -webkit-backdrop-filter: blur(14px) saturate(180%);
      border: 1px solid rgba(255, 255, 255, .32);
    }

    .popular-swipe-dot {
      width: 5px;
      height: 5px;
      flex: 0 0 5px;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: rgba(255, 255, 255, .5);
      cursor: pointer;
      transition: width .2s cubic-bezier(.16,1,.3,1), background .2s ease;
    }

    .popular-swipe-dot.active {
      width: 14px;
      flex-basis: 14px;
      background: #FFFFFF;
    }

    .album-selection-footer {
      width: var(--album-width);
      max-width: 100%;
      margin: 0 auto;
    }

    .album-selection-footer[hidden] {
      display: none;
    }

    .album-wrapper.has-inline-variants {
      grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
      gap: 8px;
    }

    .album-swipe-viewport {
      width: 100%;
      min-width: 0;
      min-height: 0;
      display: flex;
      align-items: stretch;
      gap: 12px;
      overflow-x: scroll;
      overflow-y: hidden;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      padding: 0 max(0px, calc((100% - var(--album-width)) / 2));
      -webkit-overflow-scrolling: touch;
      position: relative;
    }

    .popular-swipe .album-swipe-viewport {
      padding-inline: 0;
    }

    .popular-swipe .album-page-slot {
      width: 100%;
      flex: 0 0 100%;
    }

    .album-swipe-viewport::-webkit-scrollbar,
    .album-variants-track::-webkit-scrollbar,
    .month-track::-webkit-scrollbar,
    .sheet-scroll-body::-webkit-scrollbar {
      display: none;
    }

    .album-page-slot {
      width: var(--album-width);
      min-height: 0;
      scroll-snap-align: center;
      display: grid;
      grid-template: minmax(0, 1fr) / minmax(0, 1fr);
      flex-shrink: 0;
    }

    .album-page-card {
      width: 100%;
      min-height: 0;
      border-radius: var(--radius-xl);
      position: relative;
      overflow: hidden;
      background: transparent;
      cursor: pointer;
      user-select: none;
      transform-origin: center center;
      will-change: transform, opacity;
      transition: transform .22s cubic-bezier(.16,1,.3,1), opacity .2s cubic-bezier(.16,1,.3,1);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 22px 18px;
      border: none !important;
    }

    .album-img-layer,
    .hero-img-bg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 20%;
      pointer-events: none;
      background: transparent;
      transition: opacity .18s ease;
    }

    .album-img-layer {
      z-index: 1;
    }

    .album-img-before,
    .hero-before {
      z-index: 2;
      clip-path: inset(0 100% 0 0);
      transition: none !important;
    }

    .compare-divider-line {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 1.5px;
      background: rgba(255,255,255,.95);
      box-shadow: 0 0 8px rgba(0,0,0,.35);
      z-index: 4;
      pointer-events: none;
      opacity: 0;
      transform: translateX(-50%);
      transition: opacity .14s ease;
    }

    .album-page-scrim,
    .hero-gradient,
    .subtheme-scrim {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .album-page-scrim {
      background: linear-gradient(180deg, rgba(20,24,38,0) 35%, rgba(15,18,30,.5) 65%, rgba(10,12,20,.9) 100%);
      z-index: 3;
    }

    .compare-toggle-chip {
      position: absolute;
      top: 14px;
      right: 14px;
      z-index: 6;
      height: 30px;
      padding: 2px 3px;
      border-radius: 999px;
      background: rgba(14,16,24,.45);
      backdrop-filter: blur(14px) saturate(180%);
      -webkit-backdrop-filter: blur(14px) saturate(180%);
      border: 1px solid rgba(255,255,255,.32) !important;
      display: flex;
      align-items: center;
      gap: 2px;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0,0,0,.16);
      transition: transform .16s ease, background .2s ease;
      user-select: none;
    }

    .compare-toggle-chip:active {
      opacity: .85;
    }

    .compare-chip-label {
      font-size: var(--text-caption);
      font-weight: 500;
      padding: 3.5px 8px;
      border-radius: 999px;
      color: rgba(255,255,255,.85);
      transition: all .25s cubic-bezier(.16,1,.3,1);
      line-height: 1;
    }

    .compare-chip-label.active {
      background: rgba(255,255,255,.92);
      color: #141722;
      box-shadow: 0 1px 4px rgba(0,0,0,.15);
    }

    #heroCompareToggleChip {
      top: 12px;
      left: 12px;
      right: auto;
    }

    .hero-close-btn {
      position: absolute;
      top: 12px;
      right: 12px;
      z-index: 8;
      width: 28px;
      height: 28px;
      padding: 0;
      border: 1px solid rgba(255,255,255,.32);
      border-radius: 50%;
      background: rgba(14,16,24,.45);
      backdrop-filter: blur(14px) saturate(180%);
      -webkit-backdrop-filter: blur(14px) saturate(180%);
      color: #FFFFFF;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0,0,0,.16);
      transition: transform .24s cubic-bezier(.32,.72,0,1), background .2s ease, opacity .18s ease;
    }

    .hero-close-btn:active { opacity: .85; }
    .hero-close-btn svg { width: 14px; height: 14px; }

    .album-card-content {
      position: relative;
      z-index: 5;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding-right: 0;
      pointer-events: none;
    }

    .album-card-tag,
    .hero-tag {
      font-size: var(--text-caption);
      font-weight: 500;
      color: #F4EFEA;
      margin-bottom: 2px;
    }

    .album-card-title {
      font-size: var(--text-heading);
      font-weight: 600;
      color: #fff;
      letter-spacing: -.2px;
      line-height: 1.25;
      display: flex;
      align-items: center;
      gap: 4px;
      text-shadow: 0 1px 4px rgba(0,0,0,.6);
    }

    .album-selection-footer {
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 64px;
      gap: 8px;
      align-items: stretch;
    }

    .album-variants-track {
      min-width: 0;
      display: flex;
      align-items: stretch;
      gap: 7px;
      overflow-x: auto;
      overflow-y: hidden;
      overscroll-behavior-x: contain;
      scroll-snap-type: x proximity;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      padding: 1px;
    }

    .album-variant-btn {
      position: relative;
      width: 78px;
      height: 96px;
      flex: 0 0 78px;
      padding: 0;
      overflow: hidden;
      scroll-snap-align: start;
      border: 0;
      border-radius: 15px;
      background: #EEECE9;
      color: #FFFFFF;
      cursor: pointer;
      opacity: .68;
      transition: transform .18s cubic-bezier(.16,1,.3,1), opacity .18s ease;
    }

    .album-variant-btn:active {
      opacity: .85;
    }

    .album-variant-btn.active {
      opacity: 1;
    }

    .album-variant-btn img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      pointer-events: none;
    }

    .album-settings-btn {
      min-width: 0;
      height: 96px;
      padding: 0 2px;
      border: 0;
      border-radius: 0;
      background: transparent;
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: inherit;
      font-size: var(--text-caption);
      font-weight: 550;
      cursor: pointer;
      transition: transform .18s cubic-bezier(.16,1,.3,1), opacity .18s ease;
    }

    .album-settings-btn:active:not(:disabled) {
      opacity: .85;
    }

    .album-settings-btn:disabled {
      opacity: .42;
      cursor: default;
    }

    .grid-view-container {
      display: block;
      flex: 1 1 0;
      min-height: 0;
      width: 100%;
      padding: 0 var(--page-gutter) var(--dock-clearance);
      scroll-padding-bottom: var(--dock-clearance);
      box-sizing: border-box;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      scrollbar-width: none;
    }

    .grid-view-container::-webkit-scrollbar {
      display: none;
    }

    #viewDetail,
    #viewBalance {
      padding-bottom: 0;
      scroll-padding-bottom: var(--dock-clearance);
    }

    .view-scroll-end {
      display: block;
      width: 100%;
      min-height: var(--dock-clearance);
      flex: 0 0 var(--dock-clearance);
      pointer-events: none;
    }

    .categories-vertical-grid,
    .subthemes-grid-2col {
      display: grid;
      gap: 12px 10px;
      width: 100%;
      box-sizing: border-box;
    }

    .categories-vertical-grid {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      width: 100%;
    }

    .categories-vertical-grid.favorites-is-empty {
      display: block;
    }

    .categories-vertical-grid.catalog-shelf-list {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 24px;
    }

    .catalog-shelf {
      width: 100%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .catalog-shelf-header {
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .catalog-shelf-title {
      min-width: 0;
      margin: 0;
      color: var(--text-main);
      font-size: var(--text-heading-small);
      font-weight: 600;
      line-height: 1.15;
      letter-spacing: -.4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    body:is(:not(.is-website), .is-vk-mini) :is(.catalog-shelf-title, .catalog-title.is-category) {
      font-size: var(--text-heading-small);
      font-weight: 600;
      line-height: 1.25;
      letter-spacing: -.02em;
    }

    .catalog-shelf-more {
      min-height: 44px;
      flex: 0 0 auto;
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 3px;
      font-family: inherit;
      font-size: var(--text-caption);
      font-weight: 500;
      cursor: pointer;
      transition: opacity .16s ease, transform .16s ease;
    }

    .catalog-shelf-more:active {
      opacity: .55;
    }
    body:not(.is-website) .catalog-shelf-more { gap: 6px; font-size: var(--text-small); font-weight: 550; }

    .catalog-shelf-more svg {
      width: var(--icon-small);
      height: var(--icon-small);
    }

    .catalog-shelf-track {
      min-width: 0;
      margin-right: calc(-1 * var(--page-gutter));
      padding-right: var(--page-gutter);
      display: flex;
      align-items: flex-start;
      gap: 9px;
      overflow-x: auto;
      overflow-y: hidden;
      overscroll-behavior-x: contain;
      scroll-snap-type: x proximity;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }

    .catalog-shelf-track::-webkit-scrollbar {
      display: none;
    }

    .catalog-shelf-viewport { position: relative; min-width: 0; }
    .catalog-shelf-arrow { display: none; }
    @media (hover: hover) and (min-width: 700px) {
      .catalog-shelf-viewport .catalog-shelf-track {
        margin-right: 0;
        padding-inline: 48px;
        scroll-padding-inline: 48px;
      }
      .catalog-shelf-arrow {
        position: absolute;
        z-index: 5;
        top: 50%;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #FFFFFF;
        box-shadow: 0 7px 22px rgba(38, 38, 37, .16);
        color: var(--text-main);
        cursor: pointer;
        transform: translateY(-50%);
        transition: opacity .16s ease, background .16s ease, transform .16s ease;
      }
      .catalog-shelf-arrow[hidden] { display: none; }
      .catalog-shelf-arrow.is-prev { left: 8px; }
      .catalog-shelf-arrow.is-next { right: 8px; }
      .catalog-shelf-arrow svg { width: 22px; height: 22px; }
      .catalog-shelf-arrow:hover:not(:disabled) { background: #FFFFFF; transform: translateY(-50%) scale(1.06); }
      .catalog-shelf-arrow:focus-visible { outline: 2px solid var(--text-main); outline-offset: 3px; }
      .catalog-shelf-arrow:disabled { opacity: .3; cursor: default; box-shadow: none; }
    }

    .catalog-shelf-card {
      width: calc((100% - 9px) / 2);
      flex: 0 0 calc((100% - 9px) / 2);
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
      scroll-snap-align: start;
      cursor: pointer;
    }

    .catalog-shelf-card:focus-visible {
      outline: 2px solid var(--text-main);
      outline-offset: 3px;
      border-radius: 14px;
    }

    .catalog-shelf-photo {
      position: relative;
      width: 100%;
      aspect-ratio: 171 / 213;
      overflow: hidden;
      border: 0;
      border-radius: 14px;
      background: transparent;
      transition: transform .16s ease;
    }

    .catalog-shelf-card:active .catalog-shelf-photo {
      opacity: .9;
    }

    .catalog-shelf-card-title {
      display: none;
    }

    /* Новинки: крупнее и с подписью поверх фото */
    .catalog-shelf-card.is-new {
      width: calc((100% - 9px) / 2);
      flex: 0 0 calc((100% - 9px) / 2);
    }

    .catalog-shelf-card.is-new .catalog-shelf-photo {
      aspect-ratio: 171 / 213;
      border-radius: 16px;
    }

    .catalog-shelf-card.is-new .catalog-shelf-card-title {
      display: none;
    }

    .catalog-card-overlay-title {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 3;
      padding: 24px 10px 9px;
      color: #FFFFFF;
      font-size: var(--text-small);
      font-weight: 550;
      line-height: 1.2;
      text-wrap: balance;
      text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
      pointer-events: none;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .catalog-card-overlay-title::before {
      content: '';
      position: absolute;
      inset: 0;
      z-index: -1;
      background: linear-gradient(180deg, rgba(10, 12, 18, 0) 0%, rgba(10, 12, 18, .62) 100%);
      -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 55%);
      mask-image: linear-gradient(180deg, transparent 0, #000 55%);
    }

    .catalog-category-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px 9px;
      width: 100%;
    }

    .catalog-category-grid .catalog-shelf-card,
    .catalog-category-grid .catalog-shelf-card.is-new {
      width: 100%;
      flex: 1 1 auto;
    }

    .catalog-category-grid .catalog-shelf-photo {
      aspect-ratio: 171 / 213;
    }

    .catalog-standalone-grid {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px 10px;
    }

    .categories-grid-column {
      display: flex;
      flex-direction: column;
      gap: 12px;
      flex: 1 1 0;
      width: 0;
      min-width: 0;
    }

    .subthemes-grid-2col {
      grid-template-columns: repeat(2, 1fr);
    }

    .category-slot-item {
      display: flex;
      flex-direction: column;
      gap: 5px;
      width: 100%;
      cursor: pointer;
      min-width: 0;
    }

    .category-photo-box {
      width: 100%;
      height: auto;
      aspect-ratio: 171 / 213;
      border-radius: var(--radius-lg);
      position: relative;
      overflow: hidden;
      background: transparent;
      border: none !important;
      transition: transform .16s ease;
    }

    .category-photo-box:active {
      opacity: .9;
    }

    .cat-card-bg-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 20%;
      display: block;
      pointer-events: none;
    }

    .cat-photo-album-badge {
      position: absolute;
      top: 7px;
      right: 7px;
      z-index: 8;
      min-width: 22px;
      height: 22px;
      padding: 0 5px;
      border-radius: 999px;
      background: rgba(14,16,24,.45);
      backdrop-filter: blur(14px) saturate(180%);
      -webkit-backdrop-filter: blur(14px) saturate(180%);
      border: 1px solid rgba(255,255,255,.32);
      color: #fff;
      font-size: var(--text-caption);
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3.5px;
      line-height: 1;
      box-shadow: 0 4px 14px rgba(0,0,0,.16);
    }

    .cat-photo-album-badge svg {
      width: 9px;
      height: 9px;
      stroke: currentColor;
      stroke-width: 1.5;
      fill: none;
    }

    .cat-title-under {
      font-size: var(--text-caption);
      font-weight: 450;
      color: var(--text-main);
      line-height: 1.25;
      text-align: left;
      padding: 0 2px;
      display: none;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    #viewDetail.story-sheet {
      position: fixed;
      inset: calc(var(--safe-top) + 16px) 0 0;
      width: calc(100% - var(--safe-left) - var(--safe-right));
      max-width: 460px;
      height: calc(var(--app-height) - var(--safe-top) - 16px);
      max-height: none;
      margin: 0 auto;
      padding: 0;
      gap: 0;
      border: 0;
      outline: none;
      border-radius: var(--page-surface-radius) var(--page-surface-radius) 0 0;
      background: #FFFFFF;
      color: var(--text-main);
      overflow: hidden;
    }

    .story-sheet::backdrop { background: var(--sheet-backdrop); opacity: 1; transition: opacity .26s ease; }
    .story-sheet.is-closing::backdrop { opacity: 0; }
    #viewDetail > .story-sheet-body {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 0 var(--page-gutter) 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .story-sheet-body > * { flex-shrink: 0; }
    .story-sheet-body .view-scroll-end { min-height: 12px; flex-basis: 12px; }
    .story-sheet-actions { padding: 8px var(--page-gutter) var(--page-bottom); background: #FFFFFF; }
    .story-sheet-actions .dock-action-capsule { width: 100%; flex: 0 0 auto; }

    .hero-preview-block {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .hero-banner {
      width: calc(100% + 2 * var(--page-gutter));
      margin: 0 calc(-1 * var(--page-gutter));
      aspect-ratio: 4 / 3;
      border-radius: 0 0 16px 16px;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 0;
      background: transparent;
      border: none !important;
      user-select: none;
    }

    .hero-image-error { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #F5F5F5; color: var(--text-muted); font-size: var(--text-small); }
    .hero-image-error[hidden], #heroCompareToggleChip[hidden] { display: none; }
    .hero-image-error button { padding: 9px 16px; border: 1px solid #DDDDDD; border-radius: 999px; background: #FFFFFF; color: var(--text-main); font: inherit; cursor: pointer; }
    .hero-img-bg { transition: none; }
    .has-story-photo-transition { position: relative; }
    .hero-img-bg.story-photo-outgoing,
    .fullscreen-viewer-img.story-photo-outgoing { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
    .hero-banner { touch-action: pan-y pinch-zoom; }
    .hero-photo-dots { position: absolute; z-index: 6; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; padding: 0 3px; border-radius: 999px; background: #00000024; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
    .hero-photo-dots[hidden] { display: none; }
    .hero-photo-arrow { display: none !important; }
    .hero-photo-dot { display: grid; place-items: center; width: 20px; height: 24px; padding: 0; border: 0; outline: none; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .hero-photo-dot::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #FFFFFF85; transition: width .2s ease, height .2s ease, background .2s ease; }
    .hero-photo-dot.active::after { width: 6px; height: 6px; background: #FFFFFF; }
    @media (prefers-reduced-motion: reduce) { .hero-photo-dot::after { transition: none; } }

    .hero-content {
      padding: 0 2px;
      pointer-events: none;
      text-align: left;
    }

    .vk-story-back-btn { display: none; }

    .hero-title {
      font-size: var(--text-heading);
      font-weight: 600;
      color: var(--text-main);
      letter-spacing: -.2px;
      margin-bottom: 0;
      line-height: 1.2;
    }

    .hero-description { margin-top: 8px; pointer-events: auto; }
    .hero-description[hidden] { display: none; }
    .hero-description > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; color: var(--text-muted); font-size: var(--text-small); font-weight: 500; line-height: 1.4; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .hero-description > summary::-webkit-details-marker { display: none; }
    .hero-description > summary svg { flex: none; width: 16px; height: 16px; transition: transform .18s ease; }
    .hero-description[open] > summary svg { transform: rotate(180deg); }
    .hero-description > summary:focus-visible { outline: 2px solid #b49a70; outline-offset: 2px; border-radius: 6px; }
    @media (prefers-reduced-motion: reduce) { .hero-description > summary svg { transition: none; } }

    .hero-desc {
      margin-top: 8px;
      font-size: var(--text-body);
      font-weight: 400;
      color: var(--text-muted);
      line-height: 1.5;
      white-space: pre-wrap;
    }
    .hero-desc p { margin: 0; }
    .hero-desc strong { font-weight: 650; }

    .section-panel,
    .tariff-balance-banner {
      background: var(--panel-bg);
      border: 1px solid var(--panel-border);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-soft);
    }

    #viewBalance .tariff-balance-banner {
      margin-top: 0;
    }
    .balance-back-row { position: relative; flex: 0 0 56px; min-height: 56px; margin: 0 calc(-1 * var(--page-gutter)); padding: 0 calc(var(--page-gutter) + 44px); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #F0F1F2; }
    .balance-back-row .catalog-back-btn { left: var(--page-gutter); top: 6px; }
    .balance-back-row h1,
    .faq-page-header h1 { font-size: var(--text-heading-small); font-weight: 600; line-height: 1.3; }

    .section-panel {
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* One settings card system for the site and Telegram sheet. */
    #storySheetBody {
      --settings-card-bg: #F6F5F3;
      --settings-card-border: rgba(38, 38, 37, .07);
      --settings-card-radius: var(--radius-lg);
    }
    #storySheetBody > .section-panel {
      padding: 14px;
      gap: 10px;
      background: var(--settings-card-bg);
      border-color: var(--settings-card-border);
      border-radius: var(--settings-card-radius);
      box-shadow: none;
    }
    #storySheetBody .panel-label {
      color: var(--text-main);
      font-size: var(--text-body);
      line-height: 1.4;
    }
    #storySheetBody .age-header-row { gap: 12px; }
    #storySheetBody .age-desc,
    #storySheetBody .gender-desc { margin: 0; line-height: 1.5; }
    #storySheetBody .options-pill-track {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(0, 1fr);
      padding: 4px;
      gap: 4px;
      border-radius: var(--radius-md);
      background: rgba(38, 38, 37, .045);
    }
    #storySheetBody .option-pill-btn {
      padding: 8px 5px;
      border-radius: 10px;
      background: transparent;
      border-color: transparent;
    }
    #storySheetBody .option-pill-btn.active {
      background: var(--photo-option-gradient);
      border-color: rgba(201, 166, 116, .20);
      box-shadow: 0 1px 3px rgba(38, 38, 37, .06);
    }
    #storySheetBody .name-input,
    #storySheetBody .month-pill { background: var(--panel-bg); }
    #storySheetBody .month-pill.active { background: var(--photo-option-gradient); }
    #storySheetBody .option-pill-btn:focus-visible,
    #storySheetBody .month-pill:focus-visible { outline: 2px solid var(--accent-pearl-border); outline-offset: 2px; }

    .story-photo-guide { position: relative; width: 100%; gap: 8px; background: var(--pill-bg); }
    .story-photo-guide[hidden] { display: none; }
    .story-photo-guide h3 { color: var(--text-main); font-size: var(--text-small); font-weight: 600; line-height: 1.4; }
    .story-photo-details { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
    .story-photo-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .story-photo-copy { height: 4.5em; overflow: hidden; color: var(--text-muted); font-size: var(--text-small); line-height: 1.5; -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 1.5em), transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 1.5em), transparent 100%); }
    .story-photo-guide.is-expanded .story-photo-copy { height: auto; -webkit-mask-image: none; mask-image: none; }
    .story-photo-chevron { flex: 0 0 14px; width: 14px; height: 14px; transition: transform .18s ease; }
    .story-photo-guide.is-expanded .story-photo-chevron { transform: rotate(180deg); }
    .story-photo-list { margin-top: 10px; padding-left: 17px; list-style-type: disc; }
    .story-photo-list li + li { margin-top: 10px; }
    .story-photo-list li::marker { color: var(--text-subtle); }
    @media (prefers-reduced-motion: reduce) { .story-photo-chevron { transition: none; } }

    .story-guide-sheet { max-width: 460px; padding: 20px 18px calc(22px + var(--page-bottom)); gap: 14px; }
    .story-guide-modal-header { font-size: var(--text-heading-small); font-weight: 700; touch-action: none; cursor: grab; }
    .story-guide-modal-body { padding: 0; }
    .story-guide-fact + .story-guide-fact { margin-top: 14px; }
    .story-guide-fact h3 { margin-bottom: 3px; color: var(--text-main); font-size: var(--text-small); font-weight: 700; }
    .story-guide-fact p { color: var(--text-muted); font-size: var(--text-caption); line-height: 1.5; }
    .story-guide-fact p + p { margin-top: 10px; }
    .story-guide-terms { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--panel-border); color: var(--text-muted); font-size: var(--text-caption); line-height: 1.4; }
    .story-guide-terms strong { color: var(--text-main); font-weight: 650; }
    .story-guide-sheet > .credits-modal-btn { flex: 0 0 auto; width: 100%; }

    .panel-header-row,
    .age-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .panel-label {
      font-size: var(--text-small);
      font-weight: 600;
      color: var(--text-muted);
    }

    .gender-desc {
      margin: -2px 0 0;
      color: var(--text-muted);
      font-size: var(--text-small);
      line-height: 1.4;
    }

    .tariff-balance-label {
      font-size: var(--text-caption);
      font-weight: 500;
      color: var(--text-muted);
    }

    .age-desc {
      font-size: var(--text-small);
      font-weight: 400;
      color: var(--text-muted);
      line-height: 1.4;
      margin-bottom: 4px;
    }

    .name-input {
      width: 100%;
      box-sizing: border-box;
      padding: 9px 11px;
      border-radius: 10px;
      border: 1px solid var(--pill-border);
      background: var(--pill-bg);
      color: var(--text-main);
      font: inherit;
      font-size: var(--text-body);
      outline: none;
      transition: border-color .2s ease, opacity .2s ease;
    }

    .name-input:focus {
      border-color: var(--accent-pearl-border);
    }

    .name-input:disabled {
      opacity: .45;
    }

    .birth-detail-field { display: flex; flex-direction: column; gap: 6px; }
    .birth-detail-field[hidden], #birthDetailsSection[hidden] { display: none; }
    .birth-detail-field label { font-size: var(--text-small); font-weight: 500; color: var(--text-muted); }
    .field-error { font-size: var(--text-caption); line-height: 1.4; color: #C0392B; }
    .field-error[hidden] { display: none; }
    .birth-date-inputs { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 8px; }
    .birth-date-inputs .name-input { min-width: 0; }

    .switch {
      position: relative;
      display: inline-block;
      width: 36px;
      height: 20px;
      flex-shrink: 0;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: rgba(140,145,160,.25);
      transition: .2s cubic-bezier(.16,1,.3,1);
      border-radius: 20px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 14px;
      width: 14px;
      left: 3px;
      bottom: 3px;
      background: #fff;
      transition: .2s cubic-bezier(.16,1,.3,1);
      border-radius: 50%;
      box-shadow: 0 1px 3px rgba(0,0,0,.12);
    }

    input:checked + .slider {
      background: var(--text-main);
    }

    input:checked + .slider:before {
      transform: translateX(16px);
    }

    .month-select { display: none; }
    .month-track {
      min-width: 0;
      display: flex;
      gap: 6px;
      overflow-x: auto;
      scrollbar-width: none;
      padding: 2px 1px;
      scroll-behavior: smooth;
    }

    .month-track.disabled {
      opacity: .3;
      pointer-events: none;
    }

    .month-pill,
    .option-pill-btn,
    .tariff-card {
      cursor: pointer;
      user-select: none;
    }

    .month-pill {
      flex: 0 0 auto;
      min-height: 44px;
      display: flex;
      align-items: center;
      padding: 6px 11px;
      border-radius: 9px;
      background: var(--pill-bg);
      border: 1px solid var(--pill-border);
      color: var(--text-muted);
      font-size: var(--text-small);
      font-weight: 450;
      transition: transform .26s cubic-bezier(.32,.72,0,1), background .18s ease;
    }

    .month-pill.active,
    .option-pill-btn.active {
      background: var(--photo-option-gradient);
      color: var(--accent-pearl-text);
      border-color: rgba(201,166,116,.20);
      font-weight: 500;
    }

    .tariff-card.selected {
      background: var(--photo-option-gradient);
      color: var(--accent-pearl-text);
      border-color: rgba(201,166,116,.20);
      font-weight: 500;
    }

    .options-pill-track {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      width: 100%;
    }

    .option-pill-btn {
      flex: 1 1 60px;
      min-width: 0;
      min-height: 44px;
      padding: 8px 5px;
      border-radius: var(--radius-md);
      background: var(--pill-bg);
      border: 1px solid var(--pill-border);
      color: var(--text-main);
      font-size: var(--text-small);
      font-weight: 450;
      text-align: center;
      transition: all .2s cubic-bezier(.16,1,.3,1);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2.5px;
      font-family: inherit;
    }

    .option-pill-btn:active {
      opacity: .85;
    }

    .option-pill-sub {
      font-size: var(--text-caption);
      color: var(--text-muted);
      font-weight: 400;
    }

    .generation-photo-section { padding: 0; }
    .generation-photo-upload { position: relative; }
    .generation-photo-choose { position: relative; width: 100%; min-height: 140px; padding: 22px 16px; border: 1px solid var(--settings-card-border); border-radius: var(--settings-card-radius); background: var(--settings-card-bg); color: var(--text-main); font: inherit; cursor: pointer; }
    .generation-photo-choose::before { content: ""; position: absolute; inset: 6px; border: 1px dashed rgba(38, 38, 37, .12); border-radius: 12px; pointer-events: none; }
    .generation-photo-choose:focus-visible { outline: 2px solid var(--text-main); outline-offset: 3px; }
    .generation-photo-choose:disabled { cursor: wait; opacity: .65; }
    .generation-photo-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: var(--text-body); font-weight: 600; line-height: 1.4; }
    .generation-photo-empty svg { width: 44px; height: 44px; padding: 11px; border: 1px solid var(--settings-card-border); border-radius: 50%; background: var(--panel-bg); color: var(--text-muted); }
    .generation-photo-selected { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: var(--text-caption); color: var(--text-muted); }
    .generation-photo-selected img { display: block; width: 100%; height: 170px; object-fit: contain; border-radius: 12px; }
    .generation-photo-empty[hidden], .generation-photo-selected[hidden] { display: none; }
    .generation-photo-remove { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid #E8E8E8; border-radius: 50%; background: #FFFFFF; color: var(--text-main); cursor: pointer; }
    .generation-photo-remove svg { width: 14px; height: 14px; }
    .generation-photo-remove[hidden] { display: none; }
    .generation-photo-error { margin: 10px 4px 0; color: #B52B2B; font-size: var(--text-caption); line-height: 1.45; }
    .generation-photo-error[hidden] { display: none; }
    .dock-action-capsule.is-generating::before { content: ''; flex: 0 0 15px; width: 15px; height: 15px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: generation-upload-spin .8s linear infinite; }
    @keyframes generation-text-shimmer { from { background-position: 100% 50%; } to { background-position: 0% 50%; } }
    @keyframes generation-upload-spin { to { transform: rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) {
      .dock-action-capsule.is-generating::before { animation: none; }
    }

    .app-dock {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      min-width: 0;
      padding: 0;
background: transparent;
      pointer-events: none;
      z-index: 10;
      transition: opacity .2s ease, transform .26s cubic-bezier(.32,.72,0,1);
    }

    /* While a text field is focused on phones, collapse the dock to just the
       primary action button so the keyboard area stays usable and the action
       never disappears. */
    .app-dock.is-input-focused .dock-pill-side,
    .app-dock.is-input-focused .dock-pill-right {
      display: none;
    }

    .bottom-dock-wrapper {
      position: relative;
      pointer-events: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 8px;
      width: 100%;
      margin: 0;
      padding: 3px max(var(--page-gutter), var(--safe-left)) calc(3px + var(--page-bottom)) max(var(--page-gutter), var(--safe-right));
      background: var(--page-surface-bg);
      border: 0;
      border-top: 1px solid rgba(38, 38, 37, .08);
      border-radius: 0;
    }

    .dock-pill-side,
    .dock-pill-right {
      pointer-events: auto;
      background: transparent;
      border: none;
      box-shadow: none;
      height: 46px;
      padding: 0;
      display: flex;
      align-items: center;
      gap: 3px;
      flex-shrink: 0;
      transition: background 0.3s ease, border-color 0.3s ease;
    }

    .dock-pill-side { flex: 1; justify-content: center; gap: 8px; }
    .dock-pill-side > .dock-tab-btn { flex: 1; max-width: 160px; }
    .dock-nav-label { font-size: var(--text-caption); line-height: 1.1; }
    button:focus-visible { outline: 2px solid var(--text-main); outline-offset: 3px; }

    .dock-tab-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border-radius: 16px;
      background: transparent;
      border: none;
      color: var(--text-subtle);
      cursor: pointer;
      transition: all .2s cubic-bezier(.16,1,.3,1);
      flex-shrink: 0;
      font-family: inherit;
      font-size: var(--text-small);
      font-weight: 500;
      gap: 3px;
      flex-direction: column;
    }

    .dock-tab-btn svg {
      width: 20px;
      height: 20px;
    }

    .dock-tab-btn:active {
      opacity: .7;
    }

    .dock-tab-btn.active {
      background: transparent;
      color: var(--text-main);
    }

    .dock-balance-pill-btn {
      width: auto;
      min-width: 48px;
      padding: 4px 12px;
      border-radius: 16px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }

    .dock-section-selector-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      height: 44px;
      padding: 0 15px;
      border-radius: 999px;
      background: var(--active-gradient);
      border: 1.5px solid var(--accent-pearl-border);
      color: var(--accent-pearl-text);
      font-size: var(--text-small);
      font-weight: 500;
      cursor: pointer;
      transition: all .2s cubic-bezier(.16,1,.3,1);
      white-space: nowrap;
      font-family: inherit;
    }

    .dock-section-selector-btn:active {
      opacity: .85;
    }

    .dock-section-selector-btn svg {
      transition: transform .22s ease;
      width: 12px;
      height: 12px;
    }

    .dock-section-selector-btn.open svg {
      transform: rotate(180deg);
    }

    .dock-action-capsule {
      pointer-events: auto;
      flex: 1 0 100%;
      order: -1;
      min-width: 0;
      height: 52px;
      background: var(--action-gradient);
      border: 0;
      border-radius: 16px;
      color: #201A13;
      font-size: var(--text-small);
      font-weight: 550;
      text-shadow: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      cursor: pointer;
      box-shadow: none;
      user-select: none;
      white-space: nowrap;
      padding: 0 17px;
      font-family: inherit;
      transition: opacity .18s ease, transform .28s cubic-bezier(.32,.72,0,1), background .18s ease;
    }

    .dock-action-capsule:active:not(:disabled) {
      background: linear-gradient(110deg, #E8C991 0%, #D4B27B 52%, #AD895B 100%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
    }

    .dock-action-capsule:disabled {
      opacity: .6;
      cursor: default;
    }

    .dock-cost-chip {
      font-size: var(--text-small);
      font-weight: 500;
      color: inherit;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .dock-cost-value {
      font-size: var(--text-small);
      line-height: 1;
    }

    .dock-cost-chip svg {
      width: 14px;
      height: 14px;
      flex: 0 0 14px;
      display: block;
    }

    .sections-sheet-overlay,

    .tariff-free-note { display: block; margin-top: 7px; color: var(--text-muted, #666); font-size: var(--text-caption); line-height: 1.5; }
    .tariff-free-note[hidden] { display: none; }

    .sections-sheet-overlay,
    .sheet-modal-overlay,
    .fullscreen-modal-overlay {
      position: fixed;
      inset: 0;
      background: var(--sheet-backdrop);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity .26s ease, visibility .26s ease;
    }

    .sections-sheet-overlay {
      z-index: 1100;
    }

    .sheet-modal-overlay {
      z-index: 1200;
      transition-duration: .26s;
    }

    .fullscreen-modal-overlay {
      z-index: 2000;
      background: rgba(5,6,10,.94);
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      padding: var(--page-top) max(16px, var(--safe-right)) var(--page-bottom) max(16px, var(--safe-left));
    }

    .sections-sheet-overlay.open,
    .sheet-modal-overlay.open,
    .fullscreen-modal-overlay.open {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .sections-sheet-box,
    .sheet-modal-content {
      width: 100%;
      max-width: 440px;
      background: var(--sheet-bg);
      border: 1px solid var(--panel-border);
      box-shadow: 0 -10px 32px rgba(0,0,0,.2);
      transform: translateY(100%);
      transition: transform .26s cubic-bezier(.16,1,.3,1), background .3s ease;
    }

    .sections-sheet-box {
      border-radius: 28px 28px 0 0;
      padding: 22px 18px calc(34px + env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .sheet-modal-content {
      max-height: calc(var(--app-height) - var(--page-top));
      border-radius: 26px 26px 0 0;
      padding: 16px 14px calc(26px + env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .credits-modal {
      gap: 10px;
    }

    .help-sheet {
      max-width: 520px;
      height: min(88dvh, 820px);
      background: #FFFFFF;
      border-color: var(--panel-border);
      color: var(--text-main);
    }

    .contact-overlay {
      top: var(--contact-viewport-top, 0px);
      left: var(--contact-viewport-left, 0px);
      right: auto;
      bottom: auto;
      width: var(--contact-viewport-width, 100%);
      height: var(--contact-viewport-height, 100dvh);
      align-items: stretch;
      background: #FFFFFF;
      transition: none;
    }
    .contact-overlay .contact-sheet,
    .contact-overlay.open .contact-sheet {
      width: 100%;
      max-width: none;
      height: 100%;
      max-height: none;
      padding: 0;
      gap: 0;
      border: 0;
      border-radius: 0;
      box-shadow: none;
      background: #FFFFFF;
      color: var(--text-main);
      transform: none;
      transition: none;
    }
    .contact-overlay .contact-header {
      flex: 0 0 auto;
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) 44px;
      align-items: center;
      min-height: 62px;
      padding: 8px max(14px, var(--safe-right)) 8px max(14px, var(--safe-left));
      border-bottom: 1px solid var(--panel-border);
    }
    .contact-header .sheet-main-title { text-align: center; font-size: var(--text-heading-small); font-weight: 600; }
    .contact-back-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--text-main); cursor: pointer; }
    .contact-back-btn svg { width: 22px; height: 22px; }
    .contact-overlay:not(.is-story) .contact-story-close { display: none; }
    .contact-story-footer { display: none; }
    .contact-sheet .contact-sheet-body { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
    .contact-history { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 18px max(16px, var(--safe-right)) 18px max(16px, var(--safe-left)); }
    .contact-history[hidden] { display: none; }
    .contact-message { display: flex; flex-direction: column; align-self: flex-start; max-width: 88%; padding: 11px 13px; border-radius: 15px 15px 15px 5px; background: #f4f4f4; font-size: var(--text-small); line-height: 1.45; overflow-wrap: anywhere; }
    .contact-message.is-user { align-self: flex-end; border-radius: 15px 15px 5px 15px; background: #f5ead9; }
    .contact-message b { margin-bottom: 3px; font-size: var(--text-caption); }
    .contact-message img { display: block; max-width: 180px; max-height: 180px; margin-top: 8px; border-radius: 9px; object-fit: contain; }
    .contact-closed { display: flex; flex-direction: column; align-items: center; align-self: center; gap: 6px; max-width: 290px; margin: auto 0 10px; text-align: center; color: var(--text-muted); font-size: var(--text-caption); line-height: 1.45; }
    .contact-closed-mark { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 4px; border-radius: 50%; background: #f2f2f2; color: #292929; font-size: var(--text-heading-small); }
    .contact-closed strong { color: var(--text-main); font-size: var(--text-small); }
    .contact-attach[hidden], .contact-file-name[hidden] { display: none; }
    .contact-form { display: flex; flex: 0 0 auto; flex-direction: column; gap: 8px; min-width: 0; padding: 10px max(14px, var(--safe-right)) max(12px, var(--page-bottom)) max(14px, var(--safe-left)); border-top: 1px solid var(--panel-border); background: #FFFFFF; }
    .contact-form label { font-size: var(--text-small); font-weight: 650; }
    .contact-form textarea {
      width: 100%;
      min-height: 48px;
      max-height: 116px;
      padding: 12px 14px;
      border: 1px solid var(--panel-border);
      border-radius: 14px;
      background: #F7F7F6;
      color: var(--text-main);
      font: var(--text-body) var(--font-ui);
      line-height: 1.4;
      resize: none;
    }
    .contact-composer { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
    .contact-composer textarea { flex: 1 1 auto; min-width: 0; }
    .contact-chat-attach { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 48px; color: var(--text-muted); cursor: pointer; }
    .contact-chat-attach svg { width: 21px; height: 21px; }
    .contact-chat-attach[hidden] { display: none; }
    .contact-attach { min-height: 48px; padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 14px; cursor: pointer; }
    .contact-attach span { float: right; color: var(--text-muted); font-size: var(--text-caption); font-weight: 400; }
    #contactFile { position: absolute; width: 1px; height: 1px; opacity: 0; }
    .contact-file-name { overflow-wrap: anywhere; font-size: var(--text-caption); color: var(--text-muted); }
    .contact-file-name:empty { display: none; }
    .contact-status { min-height: 0; margin: 0; color: var(--text-muted); font-size: var(--text-caption); line-height: 1.45; }
    .contact-status:empty { display: none; }
    .contact-status.is-error { color: #B44037; }
    .contact-send { flex: 0 0 auto; min-width: 92px; height: 48px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--action-gradient); color: #201A13; font: 550 var(--text-small) var(--font-ui); cursor: pointer; }
    .contact-send:disabled { opacity: .65; cursor: default; }
    .contact-overlay:not(.is-story) .contact-story-fields,
    .contact-overlay:not(.is-story) #contactMessageLabel { display: none; }
    .contact-overlay:not(.is-story) .contact-form { margin-top: auto; }
    .contact-story-fields { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
    .contact-overlay.is-story {
      top: var(--contact-viewport-top, 0px);
      left: var(--contact-viewport-left, 0px);
      right: auto;
      bottom: auto;
      width: var(--contact-viewport-width, 100%);
      height: var(--contact-viewport-height, var(--app-height));
      align-items: flex-end;
      background: var(--sheet-backdrop);
      transition: opacity .26s ease, visibility .26s ease;
    }
    .contact-overlay.is-story .contact-sheet {
      width: 100%;
      max-width: 520px;
      height: auto;
      max-height: calc(var(--contact-viewport-height, var(--app-height)) - var(--page-top));
      padding: 16px 14px calc(26px + env(safe-area-inset-bottom, 0px));
      gap: 12px;
      border: 1px solid var(--panel-border);
      border-radius: 26px 26px 0 0;
      box-shadow: 0 -10px 32px rgba(0,0,0,.2);
      transform: translateY(100%);
      transition: transform .26s cubic-bezier(.16,1,.3,1);
    }
    .contact-overlay.is-story.open .contact-sheet { transform: translateY(0); }
    .contact-overlay.is-story .contact-header { display: flex; min-height: 0; padding: 2px 4px 10px; border: 0; }
    .contact-overlay.is-story .contact-header .sheet-main-title { text-align: left; font-size: var(--text-body); font-weight: 500; }
    .contact-overlay.is-story .contact-back-btn,
    .contact-overlay.is-story .contact-header-spacer,
    .contact-overlay.is-story .contact-chat-attach { display: none; }
    .contact-overlay.is-story .contact-story-close { display: flex; }
    .contact-overlay.is-story .contact-sheet-body { flex: 0 1 auto; overflow-y: auto; padding: 2px 2px 4px; }
    .contact-overlay.is-story .contact-form { flex: 0 0 auto; gap: 11px; padding: 0; border: 0; }
    .contact-overlay.is-story .contact-story-fields,
    .contact-overlay.is-story .contact-composer { display: contents; }
    .contact-overlay.is-story #contactMessageLabel { order: 0; }
    .contact-overlay.is-story #contactMessage { order: 1; min-height: 110px; max-height: none; }
    .contact-overlay.is-story .contact-attach { order: 2; }
    .contact-overlay.is-story .contact-file-name { order: 3; }
    .contact-overlay.is-story .contact-status { order: 4; }
    .contact-overlay.is-story #contactSendButton { display: none; }
    .contact-overlay.is-story .contact-story-footer { display: block; flex: 0 0 auto; padding: 0 2px; }
    .contact-overlay.is-story .contact-story-footer .contact-send { width: 100%; }
    .help-sheet .sheet-header-row { padding: 2px 4px 10px; }
    .help-sheet .sheet-main-title { font-size: var(--text-heading); font-weight: 750; }
    .help-sheet .sheet-close-btn { background: #F1F1F1; color: var(--text-main); }
    .help-sheet-body { padding: 0 2px 20px; }
    .help-sheet-intro { margin: 0 4px 18px; color: var(--text-muted); font-size: var(--text-small); line-height: 1.5; }
    .help-steps { display: flex; flex-direction: column; gap: 24px; }
    .help-step-visual {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      aspect-ratio: 1.75;
      overflow: hidden;
      border-radius: 17px;
      background: #FFFFFF;
    }
    .help-step-visual img { width: 100%; height: 100%; object-fit: contain; }
    .help-step-number {
      position: absolute;
      top: 14px;
      left: 14px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: #111111;
      color: #FFFFFF;
      font-size: var(--text-small);
      font-weight: 750;
    }
    .help-step-placeholder { color: var(--text-muted); font-size: var(--text-small); }
    .help-step-title { margin: 14px 8px 3px; font-size: var(--text-body); font-weight: 750; line-height: 1.35; }
    .help-step-description { margin: 0 8px; color: var(--text-muted); font-size: var(--text-small); line-height: 1.5; }

    .credits-modal-title {
      font-size: var(--text-body);
      font-weight: 600;
      color: var(--text-main);
    }

    .credits-modal-text {
      font-size: var(--text-small);
      line-height: 1.6;
      color: var(--text-muted);
    }

    .credits-modal-actions {
      display: flex;
      gap: 8px;
      margin-top: 4px;
    }

    .credits-modal-btn {
      flex: 1;
      min-height: 46px;
      border: 0;
      border-radius: var(--radius-lg);
      font: inherit;
      font-size: var(--text-small);
      font-weight: 550;
      cursor: pointer;
      transition: transform .16s ease, opacity .16s ease;
    }

    .credits-modal-btn.secondary {
      background: var(--pill-bg);
      border: 1px solid var(--pill-border);
      color: var(--text-main);
    }

    .credits-modal-btn.primary {
      background: var(--action-gradient);
      color: #201A13;
    }

    .credits-modal-btn:active {
      opacity: .92;
    }

    .sections-sheet-overlay.open .sections-sheet-box,
    .sheet-modal-overlay.open .sheet-modal-content {
      transform: translateY(0);
    }

    @media (prefers-reduced-motion: reduce) {
      .sections-sheet-overlay, .sheet-modal-overlay, .fullscreen-modal-overlay,
      .sections-sheet-box, .sheet-modal-content { transition: none; }
    }

    .fullscreen-viewer-box {
      position: relative;
      flex: 1 1 auto;
      width: 100%;
      max-width: 960px;
      margin: 0 auto;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      transform: scale(0.95);
      transition: transform .25s cubic-bezier(.16,1,.3,1);
      overflow: hidden;
    }

    .fullscreen-modal-overlay.open .fullscreen-viewer-box {
      transform: scale(1);
    }

    .fullscreen-zoom-stage {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      touch-action: none;
    }

    .fullscreen-viewer-img {
      width: auto;
      height: auto;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      border-radius: var(--radius-lg);
      transform-origin: center center;
      will-change: transform;
      user-select: none;
      -webkit-user-drag: none;
    }

    .fullscreen-thumbs {
      flex: 0 0 auto;
      width: max-content;
      max-width: 100%;
      margin: 0 auto;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
      padding: 12px 2px 2px;
    }

    .fullscreen-thumbs[hidden] { display: none; }
    .fullscreen-thumbs::-webkit-scrollbar { display: none; }

    .fullscreen-thumb {
      flex: 0 0 auto;
      width: 56px;
      height: 56px;
      padding: 0;
      border: 0;
      border-radius: 10px;
      overflow: hidden;
      background: rgba(255, 255, 255, .08);
      cursor: pointer;
      opacity: .55;
      transition: opacity .2s ease;
    }

    .fullscreen-thumb.active {
      opacity: 1;
    }

    .fullscreen-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center top;
      display: block;
    }

    .fullscreen-close-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.14);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #FFFFFF;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform .18s ease, background .18s ease;
      z-index: 10;
    }

    .fullscreen-close-btn:active {
      background: rgba(255, 255, 255, 0.22);
    }

    .fullscreen-close-btn svg {
      width: 15px;
      height: 15px;
    }

    .sections-sheet-title,
    .sheet-main-title {
      font-weight: 500;
      color: var(--text-main);
    }

    .sections-sheet-title {
      font-size: var(--text-body);
    }

    .sections-sheet-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .sections-sheet-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 52px;
      padding: 13px 16px;
      border-radius: var(--radius-lg);
      background: var(--pill-bg);
      border: 1.5px solid transparent;
      color: var(--text-main);
      font-size: var(--text-small);
      font-family: inherit;
      text-align: left;
      cursor: pointer;
    }

    .sections-sheet-item.active {
      background: var(--active-gradient);
      border-color: var(--accent-pearl-border);
      color: var(--accent-pearl-text);
      font-weight: 500;
    }

    .sheet-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 2px 4px;
    }

    .sheet-title-box {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .sheet-main-title {
      font-size: var(--text-body);
    }

    .sheet-sub-title {
      font-size: var(--text-caption);
      font-weight: 400;
      color: var(--text-muted);
    }

    .sheet-close-btn {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--sheet-sub-bg);
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--text-main);
    }

    .sheet-close-btn svg {
      width: 13px;
      height: 13px;
    }

    .sheet-scroll-body {
      min-height: 0;
      overflow-y: auto;
      scrollbar-width: none;
      max-height: none;
      padding: 2px 2px 14px;
    }

    .subtheme-modal-card {
      height: 145px;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      border-radius: var(--radius-lg);
      overflow: hidden;
      background: transparent;
      border: none !important;
      cursor: pointer;
      padding: 10px;
    }

    .subtheme-photo-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 20%;
      pointer-events: none;
    }

    .subtheme-scrim {
      background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(10,12,20,.85) 100%);
      z-index: 1;
    }

    .subtheme-title-label {
      position: relative;
      z-index: 2;
      font-size: var(--text-caption);
      font-weight: 450;
      color: #fff;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tariff-balance-banner {
      padding: 16px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
    }

    .tariff-balance-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .tariff-balance-val {
      font-size: var(--text-title);
      font-weight: 550;
      color: var(--text-main);
      display: flex;
      align-items: baseline;
      gap: 5px;
    }

    .tariff-balance-unit {
      font-size: var(--text-caption);
      font-weight: 450;
      color: var(--text-muted);
    }

    .balance-payment-methods {
      display: block;
      width: 88px;
      height: 24px;
      max-width: 42vw;
      object-fit: contain;
      flex: 0 0 auto;
    }

    .tariff-draft-btn {
      width: 40px;
      height: 40px;
      flex: 0 0 40px;
      margin-left: 10px;
      border: 1px solid var(--panel-border);
      border-radius: 13px;
      background: var(--accent-pearl);
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    .tariff-draft-btn svg {
      width: 18px;
      height: 18px;
    }

    .favorite-toggle-btn {
      position: absolute;
      top: 12px;
      left: 12px;
      z-index: 8;
      width: 26px;
      height: 26px;
      padding: 0;
      border: 1px solid rgba(255,255,255,.32);
      border-radius: 50%;
      background: rgba(14,16,24,.45);
      backdrop-filter: blur(14px) saturate(180%);
      -webkit-backdrop-filter: blur(14px) saturate(180%);
      color: #FFFFFF;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0,0,0,.16);
      transition: transform .24s cubic-bezier(.32,.72,0,1), background .2s ease, opacity .18s ease;
    }

    .favorite-toggle-btn::before { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; }
    .favorite-toggle-btn:active { opacity: .85; }
    .favorite-toggle-btn svg { width: var(--icon-small); height: var(--icon-small); fill: none; }
    .favorite-toggle-btn.active { color: #FFFFFF; background: rgba(14,16,24,.45); }
    .favorite-toggle-btn.active svg { fill: currentColor; }
    .favorite-toggle-btn.compact { top: 7px; left: 7px; width: 22px; height: 22px; }
    .favorite-toggle-btn.compact svg { width: 12px; height: 12px; }

    .favorites-empty-state {
      width: 100%;
      box-sizing: border-box;
      padding: 56px 24px;
      text-align: center;
      color: var(--text-muted);
      font-size: var(--text-small);
      line-height: 1.5;
      break-inside: avoid;
    }

    .tariff-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 13px 14px;
      border-radius: var(--radius-md);
      background: var(--pill-bg);
      border: 1px solid var(--pill-border);
      transition: all .2s cubic-bezier(.16,1,.3,1);
    }

    .tariff-info-col {
      flex: 1;
    }

    .tariff-title {
      font-size: var(--text-small);
      font-weight: 500;
      margin-bottom: 2px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .tariff-sub {
      font-size: var(--text-caption);
      font-weight: 400;
      color: var(--text-muted);
    }

    .tariff-tag-pill {
      font-size: var(--text-caption);
      font-weight: 500;
      padding: 2px 6px;
      border-radius: 999px;
      background: var(--accent-pearl);
      color: var(--accent-pearl-text);
    }

    .tariff-price {
      font-size: var(--text-body);
      font-weight: 550;
    }

    .payment-status {
      font-size: var(--text-caption);
      font-weight: 400;
      text-align: center;
      color: var(--text-muted);
      min-height: 14px;
    }

    .payment-status.error {
      color: #E03131;
      font-weight: 450;
    }

    @media (min-width: 768px) {
      .app { max-width: 760px; }
      .bottom-dock-wrapper { width: 100%; }
      .sheet-modal-content { max-width: 680px; }
      #viewDetail.story-sheet { max-width: 760px; }
    }

    @media (orientation: landscape) and (min-width: 560px) and (max-height: 600px) {
      .app { max-width: 960px; }
      .quick-category-art { width: 58px; height: 52px; }
      .quick-category-btn { gap: 2px; }
      .app.is-topbar-open .app-topbar { height: calc(var(--page-top) + clamp(210px, 45vh, 240px)); }
      .topbar-intro { gap: 7px; padding-bottom: 16px; }
      .topbar-intro-title { font-size: var(--text-heading); }
      .topbar-help-button { margin-top: 3px; }
      .catalog-titlebar { min-height: 48px; }
      #viewDetail.story-sheet { max-width: 960px; }
      #viewStudio { gap: 0; }
      .catalog-sheet { gap: 8px; }
      .album-wrapper { min-height: 270px; }
      .album-wrapper.popular-swipe { height: 290px; min-height: 290px; }
      .album-wrapper.has-inline-variants { gap: 6px; }
      .album-selection-footer { grid-template-columns: minmax(0, 1fr) 82px; gap: 6px; }
      .album-variant-btn { width: 70px; height: 82px; flex-basis: 70px; border-radius: 12px; }
      .album-settings-btn { height: 82px; border-radius: 12px; }
      .bottom-dock-wrapper { width: 100%; flex-wrap: wrap; }
      .dock-action-capsule { flex: 0 1 42%; order: 0; min-width: 0; }
      .dock-pill-side { min-width: 0; height: 48px; gap: 2px; }
      .dock-tab-btn { height: 46px; }
      .dock-balance-pill-btn { padding-inline: 4px; }
      .sheet-modal-content { max-width: 680px; }
    }

    button, input, select, textarea, dialog { font-family: var(--font-ui); }
    .sheet-header-row, .credits-modal-title { touch-action: none; cursor: grab; }
    .view-content, .sheet-modal-overlay, .fullscreen-modal-overlay,
    .sheet-modal-content, .sections-sheet-box, .app-dock { transition: none; animation: none; }

    @media (prefers-reduced-motion: reduce) {
      .view-content, .album-page-card, .album-variant-btn, .album-settings-btn, .app-dock { transition: none; }
      .app-topbar, .app-content { transition: none; }
      .preloader-logo-window { animation: none; opacity: 1; transform: none; }
      #viewDetail.story-sheet { animation: none; }
    }

    @media (max-width: 360px) {
      .quick-category-art { width: 74px; height: 68px; }
      .catalog-category-grid { gap: 14px 8px; }
    }

    @media (max-width: 600px) {
      .hero-banner { max-height: min(500px, 68vh); }
      @supports (height: 1svh) {
        .hero-banner { max-height: min(500px, 68svh); }
      }
    }

    .app.is-generation-topbar { background: var(--generation-background, #000000); --topbar-bg: var(--generation-background, #000000); --page-surface-backdrop: var(--generation-background, #000000); --topbar-text: #FFFFFF; --topbar-subtext: #B8B8B8; --generation-top-spacing: calc(var(--page-top) + 8px); }
    .app.is-generation-topbar.is-topbar-open .app-topbar {
      height: calc(var(--generation-top-spacing) + 104px);
      padding: var(--generation-top-spacing) var(--page-gutter) 12px;
      background: var(--topbar-bg);
    }
    .app:not(.is-topbar-open) .generation-curtain { display: none; }
    .generation-completion-confetti { position: fixed; z-index: 2100; inset: 0; pointer-events: none; overflow: hidden; }
    .generation-completion-confetti i { position: absolute; left: 50%; top: 42%; width: 4px; height: 8px; border-radius: 1px; opacity: 0; animation: generation-completion-burst 1900ms cubic-bezier(.15,.6,.3,1) var(--delay) both; will-change: transform,opacity; }
    .generation-completion-confetti i:nth-child(3n) { width: 5px; height: 5px; border-radius: 50%; }
    @keyframes generation-completion-burst {
      0% { opacity: 0; transform: translate3d(0,0,0) rotate(0); }
      12% { opacity: .95; }
      42% { opacity: .9; transform: translate3d(calc(var(--x) * .7),var(--y),0) rotate(calc(var(--turn) * .55)); }
      100% { opacity: 0; transform: translate3d(var(--x),90px,0) rotate(var(--turn)); }
    }
    @media (prefers-reduced-motion: reduce) { .generation-completion-confetti { display: none; } }
    .app.has-intro-media.is-generation-topbar.is-topbar-open .app-topbar { overflow: visible; }
    .app.has-intro-media.is-generation-topbar.is-topbar-open .topbar-background { bottom: calc(-1 * var(--page-surface-radius)); }
    .app.is-generation-topbar .topbar-background::after { display: block; background: rgba(0, 0, 0, var(--topbar-background-dim, .55)); pointer-events: none; }
    .generation-curtain {
      position: relative; z-index: 1; width: 100%; height: 92px; color: var(--topbar-text);
      background: rgba(17, 17, 17, .97); border: 1px solid #FFFFFF0D; border-radius: 20px;
    }
    .generation-curtain-summary {
      width: 100%; height: 100%; display: flex; align-items: center; gap: 15px;
      padding: 12px 17px; border: 0; border-radius: inherit;
      background: transparent; color: inherit; text-align: left; font: inherit;
      cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
    }
    .generation-curtain-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
    #generationCurtainTitle { font-size: clamp(15px, 4.1vw, 17px); font-weight: 650; line-height: 1.28; letter-spacing: -.035em; }
    .generation-curtain.is-resolving .generation-curtain-copy { visibility: hidden; }
    .generation-curtain.is-resolving .generation-curtain-summary { pointer-events: none; }
    .generation-curtain-logo { display: none; width: clamp(44px, 13vw, 56px); height: auto; flex: 0 0 auto; object-fit: contain; }
    .generation-curtain.is-idle:not(.is-resolving) .generation-curtain-logo:not([hidden]) { display: block; }
    .generation-curtain.is-idle .generation-curtain-summary { gap: clamp(10px, 3vw, 14px); }
    .generation-curtain.is-idle #generationCurtainTitle { white-space: nowrap; font-size: clamp(14px, 4vw, 17px); }
    body:not(.is-website) .app.has-no-generation.is-topbar-open .app-topbar { height: auto; }
    .app.has-no-generation .generation-curtain { display: none; }
    .catalog-welcome { position: relative; z-index: 1; color: var(--catalog-welcome-text, #FFFFFF); padding: 12px 0 16px; }
    .catalog-welcome[hidden] { display: none; }
    .catalog-welcome h2 { margin: 0; font-size: clamp(14px, 4vw, 16px); font-weight: 750; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
    .catalog-welcome p { margin: 6px 0 0; font-size: clamp(12px, 3.3vw, 13px); line-height: 1.4; }
    .catalog-welcome-emoji { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; font-weight: 400; letter-spacing: normal; margin-inline-start: .12em; }
    .generation-curtain.is-idle #generationCurtainSubtitle { font-size: clamp(11px, 3.1vw, 12px); }
    #generationCurtainSubtitle { color: var(--topbar-subtext); font-size: var(--text-caption); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #generationCurtainTime { color: var(--topbar-subtext); font-size: var(--text-caption); font-variant-numeric: tabular-nums; line-height: 1.2; }
    .generation-curtain-thumbnail { position: relative; display: block; width: 52px; height: 52px; min-width: 52px; min-height: 52px; flex: 0 0 52px; aspect-ratio: 1; border-radius: 50%; background: #202020; }
    .generation-curtain-thumbnail img { position: absolute; inset: 0; display: block; width: 52px; height: 52px; max-width: none; max-height: none; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
    .generation-curtain-ring { position: absolute; inset: -5px; width: 62px; height: 62px; fill: none; stroke-width: 1.5; pointer-events: none; opacity: 0; transform: rotate(-90deg); }
    .generation-curtain-ring-track { stroke: #333333; }
    .generation-curtain-ring-fill { stroke: var(--topbar-text); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .65s ease, stroke .3s ease; }
    .generation-curtain.is-running .generation-curtain-ring, .generation-curtain.is-ready .generation-curtain-ring { opacity: 1; }
    .generation-curtain.is-ready .generation-curtain-ring-fill { stroke: #46B980; }
    .generation-curtain.is-idle .generation-curtain-thumbnail, .generation-curtain [hidden] { display: none; }
    @supports ((background-clip: text) or (-webkit-background-clip: text)) {
      .generation-curtain.is-running #generationCurtainTitle, .generation-curtain.is-idle #generationCurtainTitle {
        background-image: linear-gradient(100deg, var(--generation-shimmer-base, #8B8B8B) 35%, var(--generation-shimmer-highlight, #FFFFFF) 47%, var(--generation-shimmer-highlight, #FFFFFF) 53%, var(--generation-shimmer-base, #8B8B8B) 65%);
        background-size: 250% 100%; background-clip: text; -webkit-background-clip: text;
        -webkit-text-fill-color: transparent; animation: generation-text-shimmer 3.2s ease-in-out infinite;
      }
    }
    .generation-curtain.is-paused #generationCurtainTitle { animation-play-state: paused; }
    @media (prefers-reduced-motion: reduce) {
      .generation-curtain #generationCurtainTitle { animation: none !important; background: none !important; -webkit-text-fill-color: currentColor; }
      .generation-curtain .generation-curtain-ring-fill { transition: none; }
    }

    #viewHistory { padding-bottom: calc(var(--dock-clearance) + 16px); }
    .generation-history-list { display: flex; flex-direction: column; gap: 26px; width: 100%; min-width: 0; }
    .generation-history-day { width: 100%; min-width: 0; }
    .generation-history-day-header { margin-bottom: 12px; }
    .generation-history-day-header time { display: block; color: var(--text-main); font-size: var(--text-heading); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
    .generation-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
    .generation-history-card { width: 100%; min-width: 0; }
    .generation-history-actions { display: none; flex-wrap: wrap; width: 100%; gap: 10px; }
    .generation-history-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1 1 100px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); color: var(--text-main); font: 550 var(--text-small) var(--font-ui); cursor: pointer; }
    .generation-history-actions button:hover { background: var(--accent-pearl); }
    .generation-history-actions button:focus-visible { outline: 2px solid var(--accent-pearl-border); outline-offset: 2px; }
    .generation-history-actions button:disabled { opacity: .5; cursor: wait; }
    .generation-history-actions svg { width: 18px; height: 18px; flex: none; }
    .generation-history-card .generation-history-actions { margin-top: 10px; }
    .generation-history-photo { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 13px; background: transparent; }
    .generation-history-open { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; }
    .generation-history-photo .generation-result-photo-note { pointer-events: none; padding: 12px; font-size: var(--text-caption); }
    .generation-history-photo .generation-result-photo-note button { pointer-events: auto; }
    .generation-history-photo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
    .generation-history-photo [hidden] { display: none; }
    .generation-result-photo-note { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 20px; color: var(--text-muted); text-align: center; font-size: var(--text-caption); line-height: 1.5; }
    .generation-result-photo-note button { min-height: 36px; padding: 7px 13px; border: 1px solid var(--panel-border); border-radius: 12px; background: #FFFFFF; color: var(--text-main); font: 600 var(--text-caption) var(--font-ui); cursor: pointer; }
    .generation-history-more { width: 100%; min-height: 40px; padding: 10px 15px; border-radius: 14px; border: 1px solid var(--panel-border); background: #F6F5F3; color: var(--text-main); font: 600 var(--text-caption) var(--font-ui); cursor: pointer; }
    .generation-history-more:disabled { opacity: .55; cursor: wait; }
    .generation-history-status { padding: 32px 14px; color: var(--text-muted); font-size: var(--text-small); line-height: 1.6; text-align: center; }
    .generation-history-status[hidden], .generation-history-more[hidden] { display: none; }
    .history-fullscreen-caption { width: 100%; max-width: 460px; flex: none; margin: 0 auto 14px; padding: 0 36px; color: #FFFFFF; font-size: var(--text-body); line-height: 1.4; font-weight: 600; text-align: center; }
    .history-fullscreen-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; width: 100%; max-width: 460px; flex: none; margin: 12px auto 0; }
    .history-fullscreen-actions button { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px; border-radius: 14px; border: 1px solid #FFFFFF24; background: #FFFFFF12; color: #FFFFFF; font: 600 var(--text-caption) var(--font-ui); cursor: pointer; }
    .history-fullscreen-actions button svg { width: 17px; height: 17px; }
    .history-fullscreen-actions button:disabled { opacity: .5; cursor: wait; }
    .history-fullscreen-status { width: 100%; max-width: 460px; margin: 8px auto 0; color: #CCCCCC; font-size: var(--text-caption); line-height: 1.5; text-align: center; }
    #historyFullscreenNote { color: #CCCCCC; }
    #historyFullscreenHeader[hidden], #historyFullscreenActions[hidden], #historyFullscreenCaption[hidden], #historyFullscreenNote[hidden], #historyFullscreenStatus[hidden], #fullscreenImageModal.is-history #fullscreenViewerImg[hidden] { display: none; }
    #fullscreenImageModal.is-history .fullscreen-viewer-img { border-radius: 12px; }
    #fullscreenImageModal.is-history .fullscreen-zoom-stage { position: relative; border-radius: 12px; }
    .history-before-layer { position: absolute; inset: 0; overflow: hidden; border-radius: 12px; background: #111215; pointer-events: none; }
    .history-before-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 12px; transform-origin: center center; pointer-events: none; }
    .history-compare-chip { left: 12px; right: auto; top: 12px; outline: none; font: inherit; -webkit-tap-highlight-color: transparent; }
    .history-compare-chip:disabled { cursor: wait; }
    #historyBeforeLayer[hidden], #historyBeforePhoto[hidden], #historyCompareChip[hidden], .history-compare-divider[hidden] { display: none; }
    #fullscreenImageModal.is-history .fullscreen-close-btn { position: static; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border: none; outline: none; box-shadow: none; background: #FFFFFF12; backdrop-filter: none; -webkit-backdrop-filter: none; }
    #fullscreenImageModal.is-history .fullscreen-close-btn svg { width: 13px; height: 13px; }
    #fullscreenImageModal.is-history .fullscreen-close-btn:active { background: #FFFFFF20; }
    #fullscreenImageModal.is-history .fullscreen-close-btn:focus-visible { background: #FFFFFF26; }

    #fullscreenImageModal.is-history {
      --history-photo-max-height: max(100px, calc(100vh - var(--page-top) - var(--page-bottom) - 148px));
      --history-photo-width: min(100%, 640px, calc(var(--history-photo-max-height) * var(--history-photo-ratio, .8)));
      justify-content: center; background: #111215;
    }
    @supports (height: 100dvh) {
      #fullscreenImageModal.is-history { --history-photo-max-height: max(100px, calc(100dvh - var(--page-top) - var(--page-bottom) - 148px)); }
    }
    #fullscreenImageModal.is-history .fullscreen-viewer-box { flex: none; width: var(--history-photo-width); height: auto; aspect-ratio: var(--history-photo-ratio, .8); max-width: 640px; }
    #fullscreenImageModal.is-history .fullscreen-zoom-stage { height: auto; aspect-ratio: var(--history-photo-ratio, .8); }
    .history-fullscreen-header { display: flex; align-items: center; gap: 12px; flex: none; width: var(--history-photo-width, 100%); max-width: 640px; min-height: 30px; margin: 0 auto 12px; }
    #fullscreenImageModal.is-history .history-fullscreen-caption { flex: 1; min-width: 0; width: auto; max-width: none; margin: 0; padding: 0; font-size: var(--text-body); line-height: 1.4; text-align: left; overflow-wrap: break-word; }
    #fullscreenImageModal.is-history .history-fullscreen-actions { width: var(--history-photo-width); max-width: 640px; margin-top: 12px; }
    #fullscreenImageModal.is-history .history-fullscreen-status { width: var(--history-photo-width); max-width: 640px; }
    #fullscreenImageModal.is-history:not(.is-history-expanded) .fullscreen-viewer-img { cursor: zoom-in; }
    #fullscreenImageModal.is-history.is-history-expanded .history-fullscreen-header { width: 100%; max-width: 960px; justify-content: flex-end; }
    #fullscreenImageModal.is-history.is-history-expanded .history-fullscreen-caption,
    #fullscreenImageModal.is-history.is-history-expanded .history-fullscreen-actions,
    #fullscreenImageModal.is-history.is-history-expanded .history-compare-chip,
    #fullscreenImageModal.is-history.is-history-expanded .history-compare-divider,
    #fullscreenImageModal.is-history.is-history-expanded .history-before-layer,
    #fullscreenImageModal.is-history.is-history-expanded .history-fullscreen-status { display: none; }
    #fullscreenImageModal.is-history.is-history-expanded .fullscreen-viewer-box { flex: 1 1 auto; width: 100%; height: auto; max-width: 960px; aspect-ratio: auto; }
    #fullscreenImageModal.is-history.is-history-expanded .fullscreen-zoom-stage { height: 100%; aspect-ratio: auto; }
    #fullscreenImageModal.is-history.is-history-expanded .fullscreen-viewer-img { width: 100%; height: 100%; cursor: default; }

    .app.has-generation-feedback.is-topbar-open .app-topbar { height: calc(var(--generation-top-spacing) + 136px); }
    .generation-curtain.has-feedback { height: 124px; }
    .generation-curtain.has-feedback .generation-curtain-summary { height: 88px; }
    .generation-feedback-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 17px 4px; height: 36px; }
    .generation-feedback-bar[hidden] { display: none; }
    .generation-feedback-bar button { display: inline-flex; align-items: center; justify-content: center; width: 40px; min-height: 32px; padding: 0; border: 0; border-radius: 9px; background: #282828; color: #B8B8B8; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .generation-feedback-bar button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; }
    .generation-feedback-bar button.is-selected { background: #444444; color: #FFFFFF; }
    .generation-feedback-bar button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
    .generation-feedback-bar button:disabled { opacity: .55; }
    .generation-feedback-modal { top: var(--feedback-viewport-top, 0px); bottom: auto; height: var(--feedback-viewport-height, 100%); z-index: 2200; transition: opacity .22s ease, visibility .22s ease; }
    .generation-feedback-sheet { margin: 0; max-height: calc(var(--feedback-viewport-height, var(--app-height)) - 16px); padding: 18px 18px max(22px, var(--page-bottom)); gap: 16px; background: #FFFFFF; color: var(--text-main); transition: transform .22s cubic-bezier(.16,1,.3,1); }
    .generation-feedback-sheet .sheet-header-row { padding: 0; gap: 12px; }
    .generation-feedback-sheet h2 { margin: 0; font-size: var(--text-heading); font-weight: 650; line-height: 1.35; letter-spacing: -.025em; }
    .generation-feedback-sheet h2:focus { outline: none; }
    .generation-feedback-body { display: flex; flex-direction: column; gap: 18px; }
    .generation-feedback-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .generation-feedback-options button { height: 44px; min-height: 44px; width: 100%; white-space: nowrap; padding: 10px 6px; border: 1px solid var(--panel-border); border-radius: 13px; background: #FFFFFF; color: var(--text-main); font: 500 var(--text-small)/20px var(--font-ui); cursor: pointer; }
    .generation-feedback-options button.is-selected { background: var(--accent-pearl); border-color: var(--accent-pearl-border); }
    .generation-feedback-comment { display: flex; flex-direction: column; gap: 10px; }
    .generation-feedback-comment[hidden], .generation-feedback-actions button[hidden], .generation-feedback-toast[hidden] { display: none; }
    .generation-feedback-comment label { font-size: var(--text-small); color: var(--text-muted); }
    .generation-feedback-sheet textarea { display: block; width: 100%; min-height: 100px; resize: none; padding: 13px; border: 1px solid var(--panel-border); border-radius: 14px; font: var(--text-body) var(--font-ui); color: var(--text-main); background: #FAFAFA; }
    .generation-feedback-sheet textarea:focus { outline: 1px solid #999; }
    .generation-feedback-error:empty { display: none; }
    .generation-feedback-error { color: #9E2929; font-size: var(--text-caption); }
    .generation-feedback-actions { display: flex; gap: 10px; }
    .generation-feedback-actions button { flex: 1; min-height: 44px; cursor: pointer; }
    .generation-feedback-sheet button:disabled { opacity: .55; }
    .generation-feedback-toast { position: fixed; left: 50%; bottom: calc(var(--dock-clearance) + 12px); transform: translateX(-50%); z-index: 2300; width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; color: #FFFFFF; background: #202020; font-size: var(--text-caption); text-align: center; box-shadow: 0 4px 20px #0002; }
    @media (prefers-reduced-motion: reduce) { .generation-feedback-modal, .generation-feedback-sheet { transition: none; } }

    .story-notifications-sheet {
      padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px));
      gap: 0;
      background: var(--sheet-bg);
      border: 0;
    }
    .story-notifications-handle {
      flex: 0 0 24px;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      touch-action: none;
    }
    .story-notifications-handle::after {
      content: '';
      width: 34px;
      height: 4px;
      border-radius: 8px;
      background: #d9d8d5;
      margin-top: 2px;
    }
    .story-notifications-body { padding: 0; }
    .story-notifications-banner {
      display: block;
      width: min(100%, 380px, 52dvh);
      height: auto;
      aspect-ratio: 16 / 9;
      object-fit: contain;
      border-radius: 18px;
      margin: 0 auto 18px;
    }
    .story-notifications-title {
      font-size: var(--text-title);
      line-height: 1.2;
      letter-spacing: -.8px;
      font-weight: 700;
      color: var(--text-main);
      margin: 0 0 12px;
    }
    .story-notifications-description {
      font-size: var(--text-body);
      line-height: 1.6;
      color: var(--text-muted);
      margin: 0 0 22px;
    }
    .story-notifications-actions { display: grid; gap: 10px; }
    .story-notifications-actions button {
      width: 100%;
      min-height: 50px;
      border-radius: 16px;
      font: inherit;
      font-size: var(--text-body);
      color: var(--text-main);
      border: 1px solid var(--panel-border);
      background: var(--pill-bg);
    }
    .story-notifications-actions .primary {
      border: 0;
      background: linear-gradient(110deg, #eed4a1, #c3a375);
      font-weight: 600;
    }
    .story-notifications-actions button:disabled { opacity: .6; }
    .story-notifications-actions button:focus,
    .story-notifications-actions button:focus-visible { outline: none; box-shadow: none; }
    .story-notifications-error { font-size: var(--text-small); color: #b93e3e; margin: 8px 0 0; }
    .story-notifications-error:empty { display: none; }

    .catalog-heading,
    .catalog-shelf-heading { display: flex; align-items: center; min-width: 0; max-width: 100%; }
    .catalog-shelf-controls { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
    .story-news-banner { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; margin: 4px 0 22px; border: 1px solid rgba(156, 119, 66, .14); border-radius: 18px; background: linear-gradient(115deg, #F3E7D5, #F7EFE4); color: var(--text-main); }
    .story-news-banner[hidden] { display: none; }
    .story-news-banner-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.65); color: #8A6A3D; }
    .story-news-banner-icon svg { width: 20px; height: 20px; }
    .story-news-banner-copy { min-width: 0; }
    .story-news-banner-copy strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; }
    .story-news-banner > button { min-height: 44px; padding: 10px 12px; border: 1px solid rgba(156,119,66,.2); border-radius: 12px; background: rgba(255,255,255,.8); color: var(--text-main); font: 600 12px var(--font-ui); white-space: nowrap; cursor: pointer; }
    .story-news-banner > button:focus-visible { outline: 2px solid #8A6A3D; outline-offset: 3px; }
    /* Animate.css 3.7.2 swing (Daniel Eden, MIT; assets/licenses/animate.css-MIT.txt).
       Original rotations and 1s motion, followed by a 7s rest in each 8s cycle.
       https://github.com/animate-css/animate.css/blob/3.7.2/source/attention_seekers/swing.css */
    @keyframes story-news-bell-swing {
      0%, 12.5%, 100% { transform: rotate3d(0, 0, 1, 0deg); }
      2.5% { transform: rotate3d(0, 0, 1, 15deg); }
      5% { transform: rotate3d(0, 0, 1, -10deg); }
      7.5% { transform: rotate3d(0, 0, 1, 5deg); }
      10% { transform: rotate3d(0, 0, 1, -5deg); }
    }
    @media (prefers-reduced-motion: no-preference) {
      .story-news-banner-icon svg {
        transform-origin: top center;
        animation: story-news-bell-swing 8s ease 1.5s infinite;
      }
    }
    .story-news-preferences-sheet { padding: 8px 20px calc(22px + env(safe-area-inset-bottom, 0px)); gap: 0; }
    .story-news-preferences-close { display: none; }
    .story-news-preferences-body { padding: 0; }
    .story-news-preferences-body h2 { margin: 0 0 10px; font-size: var(--text-heading); font-weight: 650; line-height: 1.35; letter-spacing: -.4px; }
    .story-news-preferences-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
    .story-news-preferences-row > label:first-child { color: var(--text-main); font-size: var(--text-small); font-weight: 500; line-height: 1.45; cursor: pointer; }
    .story-news-preferences-row .switch:has(input:disabled) { opacity: .45; }
    .story-news-preferences-body > p { margin: 0; color: var(--text-muted); font-size: var(--text-caption); line-height: 1.5; }
    .story-news-preferences-body .story-news-preferences-status { min-height: 18px; margin-top: 8px; }
    .story-news-preferences-status.is-error { color: #B93E3E; }
    .story-news-preferences-retry { padding: 6px 0; border: 0; background: transparent; color: var(--text-main); font: 500 var(--text-caption) var(--font-ui); cursor: pointer; }
    .story-news-preferences-retry[hidden] { display: none; }
    .story-news-preferences-done { width: 100%; margin-top: 16px; }
    .story-news-preferences-sheet button:focus,
    .story-news-preferences-sheet button:focus-visible { outline: none; box-shadow: none; }
