    :root {
      --accent: #d9d0bd;
      --accent-strong: #efe5cf;
      --ink: #101126;
      --muted: rgba(217, 208, 189, .68);
      --line: rgba(217, 208, 189, .2);
      --surface: #2d2e5e;
      --paper: #d9d0bd;
      --ticker-height: 0px;
      --frame-color: #ffffff;
      --frame-glaze: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .03));
      --frame-overlay-url: none;
      --frame-overlay-position: center;
      --frame-overlay-size: 100% 100%;
      --variant-frame-aspect: .75;
      --variant-frame-ratio: 3 / 4;
      --variant-frame-width-factor: .75;
      --photo-box-x: 5%;
      --photo-box-y: 4%;
      --photo-box-w: 90%;
      --photo-box-h: 68%;
      --caption-color: #12151b;
      --caption-font-family: "Playfair Display", Georgia, "Times New Roman", serif;
      --caption-font-style: italic;
      --photo-url: none;
      --photo-original-url: none;
      --photo-x: 50%;
      --photo-y: 50%;
      --photo-zoom: 1;
      --photo-bg-size: cover;
      --photo-draw-left: 0px;
      --photo-draw-top: 0px;
      --photo-draw-width: 100%;
      --photo-draw-height: 100%;
      --photo-filter: saturate(1.05) contrast(1.04) brightness(1);
      --grain-texture: none;
      --photo-brightness: 1;
      --stage-bg: #000;
      --stage-overlay-opacity: 0.44;
      --stage-overlay-brightness: 0.64;
      --overlay-glow: drop-shadow(0 0 1px rgba(255, 255, 255, 0.4)) drop-shadow(0 6px 24px rgba(255, 255, 255, 0.15));
      --frame-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 40px rgba(255, 255, 255, 0.03),
        0 4px 22px rgba(0, 0, 0, .25),
        0 1px 1px rgba(255, 255, 255, .8) inset;
    }

    html[data-theme="light"] {
      --accent: #efe7d6;
      --accent-strong: #d9d0bd;
      --ink: #101126;
      --muted: rgba(26, 27, 38, 0.6);
      --line: rgba(26, 27, 38, 0.1);
      --surface: #ffffff;
      --paper: #ffffff;
      --stage-bg: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
      --stage-overlay-opacity: 0;
      --stage-overlay-brightness: 1;
      --overlay-glow: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.25));
      --frame-shadow:
        0 30px 80px rgba(0, 0, 0, 0.28),
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 1px 1px rgba(255, 255, 255, 0.8) inset;
    }

    /* Theme Toggle Base Styles */
    .theme-toggle {
      background: transparent;
      color: rgba(255, 255, 255, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      cursor: pointer;
      padding: 0;
    }

    .theme-toggle svg {
      width: 16px;
      height: 16px;
    }

    .theme-toggle .lucide-sun {
      display: block;
    }

    .theme-toggle .lucide-moon {
      display: none;
    }

    /* Light Theme Overrides */

    html[data-theme="light"] .topbar {
      background: var(--surface);
      border-bottom: 1px solid var(--line);
      color: var(--ink);
    }

    html[data-theme="light"] .theme-toggle {
      color: var(--ink);
      border-color: var(--line);
    }

    html[data-theme="light"] .theme-toggle .lucide-sun {
      display: none;
    }

    html[data-theme="light"] .theme-toggle .lucide-moon {
      display: block;
    }

    html[data-theme="light"] .brand {
      color: var(--ink);
    }

    html[data-theme="light"] .brand-by {
      color: rgba(16, 17, 38, 0.88);
    }

    html[data-theme="light"] .back-link,

    html[data-theme="light"] .wallet,

    html[data-theme="light"] .more-btn {
      color: var(--ink);
    }

    html[data-theme="light"] .recharge {
      background: var(--ink);
      color: #ffffff;
      border: none;
    }

    html[data-theme="light"] .panel {
      background: var(--surface);
      border-left: 1px solid var(--line);
      box-shadow: -18px 0 60px rgba(0, 0, 0, 0.04);
      color: var(--ink);
    }

    html[data-theme="light"] .panel label,

    html[data-theme="light"] .panel strong,

    html[data-theme="light"] .panel span,

    html[data-theme="light"] .panel div,

    html[data-theme="light"] .panel p,

    html[data-theme="light"] .panel input,

    html[data-theme="light"] .panel select,

    html[data-theme="light"] .panel button {
      color: var(--ink);
    }

    html[data-theme="light"] input[type="range"] {
      accent-color: var(--muted);
    }

    html[data-theme="light"] .section-title,

    html[data-theme="light"] .frame-group-tab {
      color: var(--muted) !important;
    }

    html[data-theme="light"] .frame-group-tab.is-active {
      color: var(--ink) !important;
      background: #ffffff;
      border-color: rgba(16, 17, 38, 0.2);
    }

    html[data-theme="light"] .option-card,

    html[data-theme="light"] .thumb-card {
      background: rgba(0, 0, 0, 0.1);
      color: var(--ink) !important;
    }

    html[data-theme="light"] .caption-chip-btn {
      background: rgba(0, 0, 0, 0.08);
      border-color: rgba(0, 0, 0, 0.18);
      color: var(--ink) !important;
    }

    html[data-theme="light"] #caption-date-stamp-btn {
      background: #fff0f6 !important;
      color: #c41d7f !important;
      border-color: #ffdeeb !important;
    }

    html[data-theme="light"] .caption-chip-btn:hover {
      background: rgba(0, 0, 0, 0.16);
      border-color: var(--accent);
    }

    html[data-theme="light"] #caption-suggest-box {
      background: #ffffff;
      border-color: rgba(0, 0, 0, 0.15);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    html[data-theme="light"] .caption-preset-item {
      background: rgba(0, 0, 0, 0.06);
      border-color: rgba(0, 0, 0, 0.12);
      color: var(--ink) !important;
    }

    html[data-theme="light"] .caption-preset-item:hover {
      background: var(--accent);
      color: #ffffff !important;
    }

    html[data-theme="light"] .thumb-card img,

    html[data-theme="light"] .thumb-card .mini-frame {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      border-radius: 2px;
    }

    html[data-theme="light"] .polaroid-card {
      box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.28),
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 1px 1px rgba(255, 255, 255, 0.8) inset !important;
    }

    html[data-theme="light"] .ratio-grid {
      background: rgba(0, 0, 0, 0.04);
      border-color: rgba(0, 0, 0, 0.1);
    }

    html[data-theme="light"] .stage::after {
      display: none !important;
    }

    html[data-theme="light"] .stage-upload-cta {
      color: #fff8e8;
      background: linear-gradient(180deg, #191a38, #101126);
      border: 1px solid rgba(16, 17, 38, .16);
      box-shadow:
        0 18px 44px rgba(15, 23, 42, .18),
        inset 0 1px 0 rgba(255, 255, 255, .1);
    }

    html[data-theme="light"] .stage-upload-cta:hover {
      border-color: rgba(226, 168, 102, .38);
      background: linear-gradient(180deg, #20224a, #121329);
      box-shadow:
        0 22px 54px rgba(15, 23, 42, .22),
        inset 0 1px 0 rgba(255, 255, 255, .12);
    }

    html[data-theme="light"] .user-greeting {
      color: var(--ink);
    }

    html[data-theme="light"] .membership-badge {
      color: #a91e59;
      background: rgba(240, 44, 120, .10);
      border-color: rgba(169, 30, 89, .28);
    }

    html[data-theme="light"] .membership-badge[data-plan="free"] {
      color: #45435c;
      background: rgba(25, 26, 50, .07);
      border-color: rgba(25, 26, 50, .18);
    }

    html[data-theme="light"] .polafilm::before,

    html[data-theme="light"] .polafilm::after {
      display: none;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      height: 100%;
      margin: 0;
    }

    body {
      background: var(--surface);
      color: var(--ink);
      font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      letter-spacing: 0;
      -webkit-font-smoothing: antialiased;
      text-rendering: geometricPrecision;
    }


    button,
    input {
      font: inherit;
    }

    button {
      border: 0;
      cursor: pointer;
    }

    .polafilm {
      --editor-panel-width: 420px;
      --stage-actions-bottom: max(18px, env(safe-area-inset-bottom));
      --stage-actions-height: 64px;
      --stage-preview-gap: 22px;
      --stage-preview-height: calc(100vh - 72px - var(--ticker-height) - var(--stage-actions-height) - var(--stage-actions-bottom) - var(--stage-preview-gap));
      --card-width: min(clamp(320px, 34vw, 620px), calc(var(--stage-preview-height) * .75));
      position: relative;
      height: 100vh;
      height: 100dvh;
      min-height: 100%;
      display: grid;
      grid-template-rows: 72px minmax(0, 1fr);
      overflow: hidden;
      background: var(--surface);
      isolation: isolate;
      transition: background 0.3s, color 0.3s;
    }

    .polafilm::before {
      content: "";
      position: fixed;
      inset: 0;
      z-index: -2;
      pointer-events: none;
      background:
        radial-gradient(circle at 50% 36%, rgba(255, 255, 255, .08), transparent 32%),
        linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .24));
    }

    .polafilm::after {
      content: "";
      position: fixed;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      opacity: .28;
      background-image:
        linear-gradient(135deg, rgba(255, 255, 255, .12) 1px, transparent 1px),
        linear-gradient(45deg, rgba(0, 0, 0, .12) 1px, transparent 1px);
      background-size: 36px 36px, 42px 42px;
      mix-blend-mode: overlay;
    }

    .topbar {
      position: relative;
      z-index: 20;
      width: 100%;
      min-height: 72px;
      display: grid;
      grid-template-columns: minmax(150px, 1fr) auto minmax(220px, 1fr);
      align-items: center;
      gap: 22px;
      padding: 0 30px;
      color: var(--paper);
      background: rgba(16, 17, 38, .42);
      border-bottom: 1px solid rgba(217, 208, 189, .12);
      backdrop-filter: blur(16px);
    }

    .top-left-actions {
      display: inline-flex;
      align-items: center;
      justify-self: start;
      gap: 8px;
      min-width: 0;
    }

    .back-link,
    .wallet,
    .recharge,
    .action-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      min-height: 44px;
      border-radius: inherit;
      white-space: nowrap;
      text-decoration: none;
      cursor: pointer;
    }

    .back-link {
      width: max-content;
      padding: 0 6px;
      color: rgba(217, 208, 189, .7);
      font-size: 13px;
      font-weight: 700;
      text-decoration: none;
      min-height: 34px;
    }

    .brand {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      color: var(--paper);
      font-family: "Playfair Display", Georgia, serif;
      line-height: 1;
      letter-spacing: 0;
    }

    .brand-mark {
      display: none;
    }

    .brand-logo {
      height: 38px;
      width: auto;
      object-fit: contain;
      display: inline-block;
    }

    @media (max-width: 520px) {
      .brand-logo {
        height: 30px;
      }
    }

    .brand-title {
      font-size: 34px;
      font-style: italic;
      font-weight: 700;
      margin: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
    }

    .brand-title-main {
      line-height: .86;
    }

    .brand-title-line {
      display: inline-flex;
      align-items: baseline;
      gap: 4px;
      line-height: .86;
    }

    .brand-title-intent {
      max-width: 250px;
      overflow: hidden;
      color: rgba(239, 229, 207, .62);
      font-family: "Plus Jakarta Sans", Inter, sans-serif;
      font-size: 9px;
      font-style: normal;
      font-weight: 700;
      line-height: 1.2;
      letter-spacing: .015em;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .brand-by {
      transform: translateY(2px) rotate(-1.5deg);
      color: rgba(217, 208, 189, .88);
      font-family: "Caveat", "Brush Script MT", cursive;
      font-size: 21px;
      font-weight: 700;
      line-height: .9;
    }

    .seo-navigation {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px 16px;
    }

    .seo-navigation a {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
    }

    .seo-navigation a:hover,
    .seo-navigation a:focus-visible {
      color: var(--paper);
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .top-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
    }

    .user-account-summary {
      display: flex;
      flex: 0 1 auto;
      min-width: 0;
      flex-direction: row;
      align-items: center;
      gap: 12px;
    }

    .user-account-summary[hidden],
    .membership-badge[hidden] {
      display: none !important;
    }

    .user-greeting {
      display: block;
      max-width: 170px;
      overflow: hidden;
      color: rgba(217, 208, 189, .72);
      font-size: 12px;
      font-weight: 750;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-decoration: none;
      transition: color 0.2s ease;
    }

    .user-greeting:hover {
      color: rgba(217, 208, 189, 1);
    }

    .membership-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      max-width: 170px;
      padding: 5px 10px 5px 8px;
      min-height: 24px;
      overflow: hidden;
      color: #f8dce8;
      background: rgba(240, 44, 120, .18);
      border: 1px solid rgba(240, 44, 120, .42);
      border-radius: 999px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, .12), 0 0 0 0 rgba(240, 44, 120, 0);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0;
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-decoration: none;
      cursor: pointer;
      animation: pf-membership-pulse 2.35s ease-in-out infinite;
      transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    }

    .membership-badge::before {
      content: "";
      flex: 0 0 5px;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: currentColor;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
      opacity: .9;
    }

    .membership-badge[data-plan="free"] {
      color: var(--paper);
      background: rgba(217, 208, 189, .12);
      border-color: rgba(217, 208, 189, .28);
    }

    @keyframes pf-membership-pulse {
      0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, .12), 0 0 0 0 rgba(240, 44, 120, 0); }
      50% { box-shadow: 0 4px 14px rgba(240, 44, 120, .22), 0 0 0 5px rgba(240, 44, 120, .13); }
    }

    @media (prefers-reduced-motion: reduce) {
      .membership-badge {
        animation: none;
      }
    }

    .wallet {
      position: relative;
      min-width: auto;
      min-height: 32px;
      padding: 0 12px;
      color: var(--paper);
      background: rgba(255, 255, 255, .08);
      border: 1px solid rgba(217, 208, 189, .18);
      font-size: 12px;
      font-weight: 700;
      transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
      cursor: pointer;
    }

    .wallet.is-pulse {
      border-color: rgba(255, 214, 137, .72);
      box-shadow: 0 0 0 4px rgba(255, 214, 137, .14), 0 0 26px rgba(255, 214, 137, .18);
      transform: translateY(-1px);
    }

    .wallet.is-spending {
      border-color: rgba(255, 181, 91, .78);
      box-shadow: 0 0 0 4px rgba(255, 181, 91, .14), 0 0 26px rgba(255, 181, 91, .2);
    }

    .wallet.is-refunding {
      border-color: rgba(93, 225, 164, .82);
      box-shadow: 0 0 0 4px rgba(93, 225, 164, .16), 0 0 28px rgba(93, 225, 164, .22);
    }

    .wallet.is-spending::after,
    .wallet.is-refunding::after {
      content: attr(data-point-change);
      position: absolute;
      left: 50%;
      bottom: -5px;
      z-index: 4;
      padding: 3px 6px;
      border-radius: 999px;
      color: #111329;
      background: #ffcf83;
      font-size: 9px;
      font-weight: 950;
      line-height: 1;
      pointer-events: none;
      animation: polafilm-wallet-point-change 1.05s ease-out both;
    }

    .wallet.is-refunding::after {
      background: #69e2a9;
    }

    @keyframes polafilm-wallet-point-change {
      0% { opacity: 0; transform: translate(-50%, 4px) scale(.82); }
      22% { opacity: 1; transform: translate(-50%, 12px) scale(1); }
      100% { opacity: 0; transform: translate(-50%, 24px) scale(.96); }
    }

    .top-divider {
      display: none;
    }

    .recharge {
      min-width: auto;
      min-height: 32px;
      padding: 0 12px;
      color: #2d2e5e;
      background: var(--paper);
      box-shadow: none;
      font-size: 12px;
      font-weight: 800;
    }


    .recharge svg,
    .recharge i {
      width: 14px;
      height: 14px;
      flex: 0 0 auto;
      stroke-width: 2.7;
    }

    .recharge span {
      position: relative;
      z-index: 1;
    }

    .polafilm-modal {
      position: fixed;
      inset: 0;
      z-index: 20;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(4, 5, 12, .62);
      backdrop-filter: blur(10px);
    }

    .polafilm-modal.is-open {
      display: flex;
    }

    .polafilm-dialog {
      width: min(420px, 100%);
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 10px;
      padding: 20px;
      color: var(--paper);
      background: #151632;
      box-shadow: 0 24px 80px rgba(0, 0, 0, .36);
    }

    .polafilm-dialog h2 {
      margin: 0 0 8px;
      font-size: 22px;
      line-height: 1.2;
    }

    .ai-effect-confirm-dialog {
      width: min(430px, 100%);
    }

    .ai-effect-confirm-kicker {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 9px;
      color: #ffd65a;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .ai-effect-confirm-kicker svg,
    .ai-effect-confirm-kicker .lucide {
      width: 16px;
      height: 16px;
    }

    .ai-effect-confirm-summary {
      display: grid;
      gap: 1px;
      overflow: hidden;
      margin: 0 0 12px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 8px;
      background: rgba(217, 208, 189, .11);
    }

    .ai-effect-confirm-summary > div {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-height: 38px;
      padding: 8px 11px;
      background: #191a38;
      font-size: 12px;
    }

    .ai-effect-confirm-summary span {
      color: rgba(217, 208, 189, .68);
    }

    .ai-effect-confirm-summary strong {
      color: var(--paper);
      font-weight: 900;
    }

    .ai-effect-confirm-summary .is-cost strong {
      color: #ffd65a;
    }

    .ai-effect-confirm-note {
      margin-bottom: 16px;
      padding: 10px 11px;
      border: 1px solid rgba(93, 225, 164, .24);
      border-radius: 7px;
      color: #c9ffe5;
      background: rgba(93, 225, 164, .07);
      font-size: 11px;
      line-height: 1.5;
    }

    @media (prefers-reduced-motion: reduce) {
      .wallet.is-spending::after,
      .wallet.is-refunding::after {
        animation: none;
      }
    }

    .polafilm-dialog p,
    .polafilm-dialog #polafilm-modal-message {
      margin: 0 0 16px;
      color: rgba(217, 208, 189, .78);
      font-size: 13px;
      line-height: 1.55;
    }

    .point-input-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: end;
      margin-bottom: 14px;
    }

    .point-input-row label {
      display: grid;
      gap: 6px;
      font-size: 12px;
      font-weight: 800;
    }

    .point-input-row input {
      width: 100%;
      height: 44px;
      border: 1px solid rgba(217, 208, 189, .22);
      border-radius: 8px;
      padding: 0 12px;
      color: var(--paper);
      background: rgba(255, 255, 255, .06);
      font: inherit;
      font-weight: 800;
    }

    .point-input-row.is-invalid input {
      border-color: rgba(255, 98, 98, .88);
      box-shadow: 0 0 0 3px rgba(255, 98, 98, .12);
    }

    .point-total {
      min-width: 128px;
      height: 44px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      color: #2d2e5e;
      background: var(--paper);
      font-size: 13px;
      font-weight: 900;
    }

    .membership-upgrade-promo {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-height: 40px;
      margin: -2px 0 14px;
      padding: 9px 12px;
      border: 1px solid rgba(240, 44, 120, .48);
      border-radius: 8px;
      color: #fff6fb;
      background: linear-gradient(135deg, rgba(240, 44, 120, .22), rgba(22, 119, 255, .16));
      box-shadow: 0 10px 24px rgba(240, 44, 120, .14), 0 0 0 0 rgba(240, 44, 120, 0);
      font-size: 12px;
      font-weight: 850;
      text-decoration: none;
      animation: pf-recharge-membership-pulse 2.4s ease-in-out infinite;
    }

    .membership-upgrade-promo[hidden] {
      display: none !important;
    }

    .membership-upgrade-promo span {
      color: rgba(255, 246, 251, .72);
      white-space: nowrap;
    }

    .membership-upgrade-promo strong {
      color: #fff;
      font-weight: 950;
      text-align: right;
    }

    .membership-upgrade-promo:hover {
      border-color: rgba(240, 44, 120, .72);
      background: linear-gradient(135deg, rgba(240, 44, 120, .30), rgba(22, 119, 255, .22));
    }

    @keyframes pf-recharge-membership-pulse {
      0%, 100% { box-shadow: 0 10px 24px rgba(240, 44, 120, .14), 0 0 0 0 rgba(240, 44, 120, 0); }
      50% { box-shadow: 0 14px 30px rgba(240, 44, 120, .24), 0 0 0 5px rgba(240, 44, 120, .12); }
    }

    @media (prefers-reduced-motion: reduce) {
      .membership-upgrade-promo {
        animation: none;
      }
    }

    .share-filter-modal {
      display: grid;
      gap: 8px;
    }

    .share-filter-link-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .share-filter-link-row input {
      width: 100%;
      min-width: 0;
      height: 42px;
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 8px;
      padding: 0 12px;
      color: var(--paper);
      background: rgba(255, 255, 255, .06);
      font: inherit;
      font-size: 12px;
      font-weight: 760;
    }

    .share-filter-link-row input:focus {
      outline: none;
      border-color: rgba(22, 119, 255, .78);
      box-shadow: 0 0 0 3px rgba(22, 119, 255, .16);
    }

    .share-filter-copy-button {
      min-width: 78px;
      height: 42px;
      border: 0;
      border-radius: 8px;
      color: #fff;
      background: #1677ff;
      font: inherit;
      font-size: 13px;
      font-weight: 900;
      cursor: pointer;
    }

    .share-filter-copy-button.is-copied {
      background: #34b981;
    }

    .share-filter-helper {
      margin: 2px 0 0 !important;
      color: rgba(217, 208, 189, .68);
      font-size: 12px;
      font-weight: 650;
      line-height: 1.45;
    }

    .modal-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .modal-actions.is-single {
      grid-template-columns: 1fr;
    }

    .modal-button {
      min-height: 42px;
      border: 0;
      border-radius: 8px;
      color: var(--paper);
      background: rgba(255, 255, 255, .08);
      font: inherit;
      font-size: 13px;
      font-weight: 850;
      cursor: pointer;
    }

    .modal-button.primary {
      color: #fff;
      background: #1677ff;
    }

    .modal-button:disabled {
      cursor: wait;
      opacity: .68;
    }

    .download-extra-note {
      margin-top: 8px;
      gap: 4px;
      color: #9de0b0;
      font-size: 13px;
      font-weight: 820;
      line-height: 1.35;
    }

    .download-extra-note-row {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 6px;
    }

    .download-extra-note-row strong {
      color: #bff2c9;
      font-weight: 950;
    }

    .modal-note {
      min-height: 18px;
      margin-top: 12px;
      color: rgba(217, 208, 189, .72);
      font-size: 12px;
      line-height: 1.45;
    }

    .modal-note:empty {
      display: none;
      min-height: 0;
      margin-top: 0;
      padding: 0;
      border: 0;
      box-shadow: none;
    }

    .modal-note-muted {
      display: inline-block;
      margin-top: 3px;
      color: rgba(217, 208, 189, .66);
      font-size: 11px;
      font-weight: 650;
    }

    .modal-note.is-account-promo {
      min-height: 0;
      margin-top: 14px;
      padding: 12px 13px;
      border: 1px solid rgba(95, 210, 156, .36);
      border-radius: 10px;
      background: linear-gradient(135deg, rgba(95, 210, 156, .16), rgba(22, 119, 255, .13));
      color: #f7fff9;
      font-size: 13px;
      font-weight: 760;
      line-height: 1.5;
      box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
    }

    .modal-note.is-account-promo .promo-note-kicker {
      margin-bottom: 6px;
      color: #9de0b0;
      font-size: 11px;
      font-weight: 950;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .modal-note.is-account-promo strong {
      color: #fff0b8;
      font-weight: 950;
    }

    .modal-note.is-free-download {
      min-height: 0;
      margin-top: 14px;
      padding: 10px 12px;
      border: 1px solid rgba(255, 203, 92, .42);
      border-left: 4px solid #ffcb5c;
      border-radius: 8px;
      background: rgba(255, 203, 92, .12);
      color: #fff3cf;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.45;
      box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    }

    .modal-note.is-error {
      color: #ff8f8f;
      font-weight: 800;
    }

    .quality-options label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 8px;
      padding: 10px 12px;
      background: rgba(255, 255, 255, .045);
      cursor: pointer;
      transition: all 0.2s;
    }

    .quality-options label:hover {
      border-color: rgba(22, 119, 255, 0.4);
      background: rgba(255, 255, 255, .07);
    }

    .quality-options label.is-selected {
      border-color: #1677ff !important;
      background: rgba(22, 119, 255, 0.08) !important;
    }

    .pola-cost-old {
      color: rgba(217, 208, 189, .56);
      font-size: 11px;
      font-weight: 800;
      text-decoration: line-through;
      text-decoration-thickness: 2px;
      white-space: nowrap;
    }

    .pola-cost-free {
      color: #9de0b0;
      font-size: 13px;
      font-weight: 900;
      white-space: nowrap;
    }

    .points-cost-standard:has(.pola-cost-free),
    .points-cost-original:has(.pola-cost-free) {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .qr-payment {
      display: none;
      gap: 14px;
      margin: 4px 0 16px;
    }

    .qr-payment.is-visible {
      display: grid;
    }

    .qr-frame {
      display: grid;
      place-items: center;
      border-radius: 10px;
      padding: 12px;
      background: #fff;
    }

    .qr-frame img {
      width: min(230px, 100%);
      aspect-ratio: 1;
      display: block;
    }

    .payment-info {
      display: grid;
      gap: 7px;
      border: 1px solid rgba(217, 208, 189, .14);
      border-radius: 8px;
      padding: 10px 12px;
      background: rgba(255, 255, 255, .045);
      font-size: 12px;
    }

    .payment-info div {
      display: flex;
      justify-content: space-between;
      gap: 12px;
    }

    .payment-info strong {
      color: var(--paper);
      text-align: right;
    }

    .point-history {
      display: none;
      gap: 8px;
      margin: 4px 0 16px;
      max-height: 330px;
      overflow-y: auto;
      padding-right: 2px;
      scrollbar-width: thin;
      scrollbar-color: rgba(217, 208, 189, .32) transparent;
    }

    .point-history.is-visible {
      display: grid;
    }

    .history-item {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 6px 12px;
      border: 1px solid rgba(217, 208, 189, .13);
      border-radius: 8px;
      padding: 10px 12px;
      background: rgba(255, 255, 255, .045);
    }

    .history-note {
      color: var(--paper);
      font-size: 13px;
      font-weight: 820;
    }

    .history-date,
    .history-balance {
      color: rgba(217, 208, 189, .62);
      font-size: 11px;
    }

    .history-points {
      grid-row: span 2;
      align-self: center;
      font-size: 14px;
      font-weight: 900;
    }

    .history-points.is-plus {
      color: #9de0b0;
    }

    .history-points.is-minus {
      color: #ffb5a6;
    }

    .history-empty {
      border: 1px dashed rgba(217, 208, 189, .18);
      border-radius: 8px;
      padding: 18px;
      color: rgba(217, 208, 189, .7);
      text-align: center;
      font-size: 13px;
    }

    .security-toast {
      position: fixed;
      left: 50%;
      bottom: 22px;
      z-index: 30;
      max-width: min(360px, calc(100vw - 32px));
      transform: translate(-50%, 18px);
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 8px;
      padding: 11px 14px;
      color: var(--paper);
      background: rgba(16, 17, 38, .94);
      box-shadow: 0 18px 50px rgba(0, 0, 0, .34);
      font-size: 12px;
      font-weight: 800;
      line-height: 1.45;
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease;
    }

    .security-toast.is-visible {
      transform: translate(-50%, 0);
      opacity: 1;
    }

    .verify-toast {
      position: fixed;
      top: 20px;
      right: 20px;
      background: #1f2937;
      border-left: 4px solid #eab308;
      color: #fff;
      padding: 16px;
      border-radius: 8px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
      z-index: 999999;
      transform: translateX(120%);
      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 320px;
    }

    .verify-toast.is-visible {
      transform: translateX(0);
    }

    .verify-toast-content {
      display: flex;
      gap: 12px;
      align-items: flex-start;
    }

    .verify-toast-content i {
      color: #eab308;
      flex-shrink: 0;
      margin-top: 2px;
    }

    .verify-toast-content p {
      margin: 4px 0 0;
      font-size: 13px;
      color: #9ca3af;
      line-height: 1.4;
    }

    .verify-toast-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
    }

    .pola-btn-toast-primary,
    .pola-btn-toast-secondary {
      border: none;
      border-radius: 4px;
      padding: 6px 12px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
    }

    .pola-btn-toast-primary {
      background: #e2a866;
      color: #1a1a1a;
    }

    .pola-btn-toast-primary:hover {
      background: #f3b977;
    }

    .pola-btn-toast-secondary {
      background: transparent;
      color: #9ca3af;
    }

    .pola-btn-toast-secondary:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
    }

    .verify-toast-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 3px;
      background: #eab308;
      width: 100%;
      border-bottom-left-radius: 8px;
    }

    .verify-toast.is-visible .verify-toast-progress {
      animation: verifyToastCountdown 7s linear forwards;
    }

    .verify-toast:hover .verify-toast-progress {
      animation-play-state: paused;
    }

    @keyframes verifyToastCountdown {
      from {
        width: 100%;
      }

      to {
        width: 0%;
      }
    }

    .app-shell {
      width: 100%;
      height: 100%;
      max-height: 100%;
      min-height: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 420px;
      align-items: stretch;
      gap: 0;
      padding: 0;
      overflow: hidden;
    }

    .stage-container {
      height: 100%;
      min-height: 0;
      overflow: hidden;
    }

    .stage {
      position: relative;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 28px;
      width: 100%;
      height: 100%;
      padding: 16px 28px calc(var(--stage-actions-height) + var(--stage-actions-bottom) + var(--stage-preview-gap));
      overflow: hidden;
      background: var(--stage-bg);
      transition: background 0.3s;
      isolation: isolate;
    }

    .stage::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      opacity: var(--stage-overlay-opacity);
      background: var(--photo-url) center / cover no-repeat;
      filter: blur(10px) saturate(.85) brightness(var(--stage-overlay-brightness));
      transform: scale(1.18);
      z-index: -1;
      transition: opacity 0.3s, filter 0.3s;
    }

    .stage::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: rgba(0, 0, 0, .5);
      opacity: 1;
      mix-blend-mode: normal;
    }

    .file-input {
      position: fixed;
      left: -9999px;
      top: 0;
      inline-size: 1px;
      block-size: 1px;
      opacity: 0;
    }

    .preview-wrap {
      position: relative;
      flex: 0 0 auto;
      z-index: 1;
      display: grid;
      place-items: center;
      margin-top: 0;
    }

    .preview-wrap::after {
      content: "";
      position: absolute;
      z-index: -1;
      display: none;
      pointer-events: none;
    }

    .preview-wrap.is-template-loading::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 18;
      display: block;
      pointer-events: none;
      border-radius: 8px;
      background-color: rgba(9, 10, 18, .24);
      background-image: var(--template-preview-url);
      background-position: center;
      background-size: cover;
      opacity: .42;
      filter: blur(8px) saturate(.95) brightness(.78);
      transform: scale(1.04);
      backdrop-filter: blur(1.5px);
    }

    .preview-wrap.is-template-loading::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 19;
      width: 32px;
      height: 32px;
      margin: -16px 0 0 -16px;
      border: 3px solid rgba(255, 255, 255, .78);
      border-top-color: var(--accent-strong);
      border-radius: 50%;
      box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
      animation: templateSpin .8s linear infinite;
      pointer-events: none;
    }

    .ai-color-scan-overlay {
      position: absolute;
      inset: 0;
      z-index: 17;
      display: none;
      pointer-events: none;
      overflow: hidden;
      border-radius: inherit;
      opacity: 0;
      contain: paint;
      isolation: isolate;
      background: rgba(4, 8, 16, .22);
      -webkit-backdrop-filter: blur(.9px) brightness(.86) saturate(.96);
      backdrop-filter: blur(.9px) brightness(.86) saturate(.96);
    }

    .preview-wrap.is-ai-color-scanning .ai-color-scan-overlay {
      display: block;
      opacity: 1;
    }

    .ai-color-scan-overlay > span {
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
    }

    .ai-color-scan-mesh {
      z-index: 1;
      opacity: .2;
      background:
        linear-gradient(rgba(125, 211, 252, .34) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, .3) 1px, transparent 1px),
        linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, .18) 49%, transparent 51% 100%);
      background-size: 42px 42px, 42px 42px, 132px 132px;
      background-position: 0 0, 0 0, 0 0;
      filter: drop-shadow(0 0 3px rgba(56, 189, 248, .2));
      transform: translate3d(-1px, 1px, 0);
      will-change: opacity, transform;
      animation: aiColorPreviewMesh 2.45s ease-in-out infinite;
    }

    .ai-color-scan-zones {
      z-index: 2;
    }

    .ai-color-scan-zone {
      position: absolute;
      inset: 0;
      border: 0;
      border-radius: inherit;
      opacity: 0;
      background:
        linear-gradient(rgba(178, 235, 255, .26) 1px, transparent 1px),
        linear-gradient(90deg, rgba(178, 235, 255, .23) 1px, transparent 1px),
        linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, .12) 49%, transparent 51% 100%);
      background-size: 42px 42px, 42px 42px, 132px 132px;
      background-position: 0 0, 0 0, 0 0;
      filter: drop-shadow(0 0 4px rgba(56, 189, 248, .14));
      transform: translate3d(0, 0, 0);
      will-change: opacity, transform;
      animation: aiColorPreviewZone 4.2s ease-in-out infinite;
    }

    .ai-color-scan-zone-1 {
      clip-path: inset(8% 49% 63% 7% round 3px);
      animation-delay: 0s;
    }

    .ai-color-scan-zone-2 {
      clip-path: inset(35% 7% 34% 53% round 3px);
      animation-delay: 1.35s;
    }

    .ai-color-scan-zone-3 {
      clip-path: inset(60% 44% 10% 10% round 3px);
      animation-delay: 2.7s;
    }

    .ai-color-scan-nodes {
      z-index: 2;
      opacity: .72;
      background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .92) 0 1px, transparent 2px),
        radial-gradient(circle at 36% 14%, rgba(125, 211, 252, .9) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 24%, rgba(255, 255, 255, .82) 0 1px, transparent 2px),
        radial-gradient(circle at 84% 52%, rgba(125, 211, 252, .86) 0 1px, transparent 2px),
        radial-gradient(circle at 63% 78%, rgba(255, 255, 255, .76) 0 1px, transparent 2px),
        radial-gradient(circle at 25% 68%, rgba(125, 211, 252, .82) 0 1px, transparent 2px);
      filter: drop-shadow(0 0 5px rgba(56, 189, 248, .38));
      will-change: opacity, transform;
      animation: aiColorPreviewNodes 2.35s ease-in-out infinite;
    }

    .ai-color-scan-reticle {
      z-index: 3;
      opacity: .42;
      background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent) center / 72% 1px no-repeat,
        linear-gradient(180deg, transparent, rgba(125, 211, 252, .18), transparent) center / 1px 72% no-repeat;
      animation: aiColorPreviewReticle 2.8s ease-in-out infinite;
    }

    .ai-color-scan-reticle::before,
    .ai-color-scan-reticle::after {
      content: "";
      position: absolute;
      border-radius: 4px;
      pointer-events: none;
    }

    .ai-color-scan-reticle::before {
      inset: 20% 18%;
      border: 1px solid rgba(125, 211, 252, .18);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    }

    .ai-color-scan-reticle::after {
      left: 18%;
      right: 18%;
      top: 50%;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), rgba(125, 211, 252, .28), transparent);
      transform: translate3d(0, -50%, 0);
      animation: aiColorPreviewSignal 1.45s ease-in-out infinite;
    }

    .ai-color-scan-overlay::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 5;
      border-radius: inherit;
      opacity: .56;
      background:
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) left top / 34px 1px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) right top / 34px 1px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) left bottom / 34px 1px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) right bottom / 34px 1px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) left top / 1px 34px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) right top / 1px 34px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) left bottom / 1px 34px no-repeat,
        linear-gradient(rgba(178, 235, 255, .86), rgba(178, 235, 255, .86)) right bottom / 1px 34px no-repeat;
      filter: drop-shadow(0 0 7px rgba(56, 189, 248, .22));
      animation: aiColorPreviewFocus 2.25s ease-in-out infinite;
    }

    @keyframes aiColorPreviewMesh {
      0%,
      100% {
        opacity: .2;
        transform: translate3d(-1px, 1px, 0);
      }

      48%,
      58% {
        opacity: .06;
        transform: translate3d(1px, -1px, 0);
      }
    }

    @keyframes aiColorPreviewZone {
      0%,
      12%,
      100% {
        opacity: .04;
        transform: translate3d(-1px, 1px, 0);
      }

      24%,
      40% {
        opacity: .64;
        transform: translate3d(.75px, -.75px, 0);
      }

      56% {
        opacity: .16;
        transform: translate3d(0, 0, 0);
      }
    }

    @keyframes aiColorPreviewNodes {
      0%,
      100% {
        opacity: .46;
        transform: translate3d(0, 0, 0) scale(1);
      }

      50% {
        opacity: .86;
        transform: translate3d(1px, -1px, 0) scale(1.01);
      }
    }

    @keyframes aiColorPreviewReticle {
      0%,
      100% {
        opacity: .26;
      }

      50% {
        opacity: .5;
      }
    }

    @keyframes aiColorPreviewSignal {
      0%,
      100% {
        opacity: .18;
        transform: translate3d(-4%, -50%, 0);
      }

      50% {
        opacity: .58;
        transform: translate3d(4%, -50%, 0);
      }
    }

    @keyframes aiColorPreviewFocus {
      0%,
      100% {
        opacity: .38;
        transform: scale(.998);
      }

      50% {
        opacity: .62;
        transform: scale(1);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .preview-wrap.is-ai-color-scanning .ai-color-scan-overlay::before,
      .preview-wrap.is-ai-color-scanning .ai-color-scan-mesh,
      .preview-wrap.is-ai-color-scanning .ai-color-scan-nodes,
      .preview-wrap.is-ai-color-scanning .ai-color-scan-zone,
      .preview-wrap.is-ai-color-scanning .ai-color-scan-reticle,
      .preview-wrap.is-ai-color-scanning .ai-color-scan-reticle::after {
        animation-duration: 4s;
      }
    }

    .compare-original-panel {
      display: none;
    }

    .preview-wrap.preview-wide {
      width: min(clamp(320px, 60vw, 920px), calc(100vw - var(--editor-panel-width) - 84px), calc(var(--stage-preview-height) * 1.5));
      height: auto;
    }

    @media (min-width: 941px) {
      .preview-wrap.compare-active {
        --compare-gap: 28px;
        width: var(--compare-wrap-width, min(calc(100vw - var(--editor-panel-width) - 56px), calc((100vh - 300px - var(--ticker-height)) * 3), calc((var(--compare-panel-width, var(--card-width)) * 2) + var(--compare-gap))));
        max-width: calc(100vw - var(--editor-panel-width) - 56px);
        grid-template-columns: minmax(0, var(--compare-panel-width, var(--card-width))) minmax(0, var(--compare-panel-width, var(--card-width)));
        gap: var(--compare-gap);
        align-items: center;
        justify-content: center;
        overflow: hidden;
      }

      .preview-wrap.compare-active.compare-horizontal {
        --compare-gap: 16px;
        width: var(--compare-wrap-width, min(calc((var(--compare-panel-width, var(--card-width)) * 2) + var(--compare-gap)), calc(100vw - var(--editor-panel-width) - 56px)));
        max-width: calc(100vw - var(--editor-panel-width) - 56px);
        align-self: center;
        justify-self: center;
        margin-inline: auto;
      }

      .preview-wrap.compare-active::before {
        content: none;
      }

      .preview-wrap.compare-active .compare-original-panel {
        content: "";
        position: relative;
        z-index: 0;
        display: block;
        width: var(--compare-panel-width, 100%);
        height: var(--compare-panel-height, auto);
        aspect-ratio: var(--variant-frame-ratio, 1 / 1);
        border-radius: 0;
        background-color: #f8fafc;
        background-image: var(--photo-original-url);
        background-position: var(--photo-x) var(--photo-y);
        background-size: var(--photo-bg-size, cover);
        background-repeat: no-repeat;
        box-shadow: 0 24px 58px rgba(0, 0, 0, .26), inset 0 0 0 1px rgba(255, 255, 255, .16);
      }

      .preview-wrap.compare-active .polaroid-card {
        grid-column: 2;
      }

      .preview-wrap.compare-active.compare-horizontal .polaroid-card,
      .preview-wrap.compare-active .polaroid-card.ratio-wide:not(.variant-frame),
      .preview-wrap.compare-active .polaroid-card.ratio-landscape:not(.variant-frame) {
        width: var(--compare-panel-width, auto);
      }

      .preview-wrap.compare-active.compare-horizontal .compare-original-panel,
      .preview-wrap.compare-active.compare-horizontal .polaroid-card,
      .preview-wrap.compare-active.compare-horizontal .polaroid-card.frame-none,
      .preview-wrap.compare-active.compare-horizontal .polaroid-card.ratio-wide:not(.variant-frame),
      .preview-wrap.compare-active.compare-horizontal .polaroid-card.ratio-landscape:not(.variant-frame) {
        width: var(--compare-panel-width, auto) !important;
        height: var(--compare-panel-height, auto) !important;
        max-height: var(--compare-panel-height, none) !important;
      }

      .preview-wrap.compare-active.compare-horizontal .polaroid-card.frame-none .photo-slot,
      .preview-wrap.compare-active.compare-horizontal .polaroid-card.ratio-wide:not(.variant-frame) .photo-slot,
      .preview-wrap.compare-active.compare-horizontal .polaroid-card.ratio-landscape:not(.variant-frame) .photo-slot {
        height: 100% !important;
      }

      .preview-wrap.compare-active .polaroid-card.show-original .photo-slot::before {
        opacity: 0;
      }

      .preview-wrap.compare-active .polaroid-card.show-original .preview-light-leak.is-active {
        opacity: 1 !important;
      }

      .preview-wrap.compare-active .polaroid-card.show-original .photo-slot.has-lut-preview .photo-lut-preview {
        opacity: 1 !important;
      }

      .preview-wrap.compare-active .polaroid-card.show-original .photo-slot.has-lut-preview .photo-image {
        opacity: 0;
      }
    }

    .stage-upload-cta {
      position: relative;
      flex: 0 0 auto;
      z-index: 2;
      min-height: 56px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 0 26px;
      border: 1px solid rgba(255, 255, 255, .12);
      border-radius: 8px;
      color: #fff8e8;
      background: linear-gradient(180deg, #191a38, #101126);
      box-shadow:
        0 18px 46px rgba(0, 0, 0, .26),
        inset 0 1px 0 rgba(255, 255, 255, .1);
      font-size: 14px;
      font-weight: 880;
      text-decoration: none;
      white-space: nowrap;
      cursor: pointer;
      transition: opacity .16s ease, visibility .16s ease, background .16s ease, box-shadow .16s ease, transform .14s ease, border-color .16s ease;
    }

    .stage-upload-cta:hover {
      border-color: rgba(226, 168, 102, .34);
      background: linear-gradient(180deg, #20224a, #121329);
      box-shadow:
        0 22px 58px rgba(0, 0, 0, .32),
        inset 0 1px 0 rgba(255, 255, 255, .12);
      transform: translateY(-1px);
    }

    .stage-upload-cta:active {
      transform: translateY(0);
    }

    .stage-upload-cta .lucide {
      width: 27px;
      height: 27px;
      color: #e2a866;
      stroke-width: 2.15;
    }

    .stage-actions {
      position: relative;
      z-index: 3;
      width: fit-content;
      max-width: calc(100% - 24px);
      display: flex !important;
      flex-direction: row !important;
      flex-wrap: nowrap !important;
      justify-content: center;
      gap: 10px;
      margin-top: 8px;
      align-self: center;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
    }

    .stage-action-button {
      position: relative;
      overflow: visible;
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 0 10px;
      border: 1px solid rgba(255, 255, 255, .08);
      border-radius: 999px;
      color: var(--paper);
      background: rgba(16, 17, 38, .9);
      box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
      font-size: 11px;
      font-weight: 820;
      letter-spacing: 0;
      cursor: pointer;
      transition: transform .14s ease, filter .16s ease, background .16s ease, box-shadow .16s ease;
      flex: 1 1 auto;
      min-width: 0;
      max-width: 150px;
      white-space: nowrap;
    }

    #stage-random-light-leak,
    #panel-random-light-leak {
      background: linear-gradient(135deg, #ff7a18, #af002d 31.25%, #319197 100%);
      border-color: rgba(255, 255, 255, .2);
    }

    .stage-action-button.primary {
      background: linear-gradient(135deg, #2d8cff, #126dff);
      border-color: rgba(255, 255, 255, .14);
      box-shadow: 0 18px 48px rgba(18, 109, 255, .24), 0 16px 38px rgba(0, 0, 0, .22);
    }

    .stage-action-button:hover {
      filter: brightness(1.07);
      transform: translateY(-1px);
      box-shadow: 0 22px 54px rgba(0, 0, 0, .28);
    }

    .stage-action-button:disabled {
      cursor: progress;
      opacity: .7;
      filter: none;
    }

    .stage-action-button:active {
      transform: translateY(1px);
    }

    .stage-action-button .lucide {
      width: 18px;
      height: 18px;
      stroke-width: 2.45;
    }

    .stage-action-button .stage-action-icon {
      width: 18px;
      height: 18px;
      flex: 0 0 18px;
      display: block;
      color: currentColor;
      stroke: currentColor;
      pointer-events: none;
    }

    .stage-action-menu {
      position: relative;
      display: inline-flex;
      flex: 0 1 auto;
      min-width: 0;
    }

    .stage-action-menu[hidden] {
      display: none !important;
    }

    .stage-action-menu .stage-action-button {
      width: 100%;
    }

    .stage-action-caret {
      width: 14px !important;
      height: 14px !important;
      opacity: .75;
    }

    .stage-batch-copy-popover {
      position: absolute;
      right: 0;
      bottom: calc(100% + 8px);
      z-index: 55;
      width: min(240px, calc(100vw - 32px));
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 10px;
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 8px;
      color: var(--paper);
      background: #151632;
      box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
    }

    .stage-batch-copy-popover[hidden] {
      display: none !important;
    }

    .stage-batch-copy-title {
      padding: 2px 4px 4px;
      color: rgba(255, 248, 230, .72);
      font-size: 11px;
      font-weight: 760;
    }

    .stage-batch-copy-option {
      min-height: 34px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 8px;
      border: 1px solid rgba(255, 255, 255, .08);
      border-radius: 7px;
      color: rgba(255, 248, 230, .92);
      background: rgba(255, 255, 255, .04);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }

    .stage-batch-copy-option input {
      width: 16px;
      height: 16px;
      margin: 0;
      accent-color: #2d8cff;
    }

    .stage-batch-copy-apply {
      min-height: 36px;
      margin-top: 2px;
      border: 1px solid rgba(255, 255, 255, .12);
      border-radius: 7px;
      color: #fff;
      background: #126dff;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
    }

    .stage-batch-copy-apply:hover {
      filter: brightness(1.08);
    }

    html[data-theme="light"] .stage-batch-copy-popover {
      border-color: rgba(16, 17, 38, .12);
      color: #141624;
      background: #fff;
      box-shadow: 0 18px 50px rgba(16, 17, 38, .18);
    }

    html[data-theme="light"] .stage-batch-copy-title {
      color: rgba(16, 17, 38, .62);
    }

    html[data-theme="light"] .stage-batch-copy-option {
      border-color: rgba(16, 17, 38, .08);
      color: #141624;
      background: rgba(16, 17, 38, .04);
    }


    .batch-dock {
      position: relative;
      z-index: 4;
      width: min(100%, 960px);
      align-self: stretch;
      margin: -4px auto 0;
      padding: 12px;
      border: 0;
      border-radius: 8px;
      color: var(--paper);
      box-shadow: none;
      backdrop-filter: blur(18px);
    }

    .batch-dock[hidden] {
      display: none !important;
    }

    .batch-dock-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }

    .batch-dock-title {
      min-width: 0;
      display: flex;
      align-items: baseline;
      gap: 9px;
      color: rgba(255, 248, 230, .96);
      white-space: nowrap;
    }

    .batch-dock-title strong {
      font-size: 13px;
      font-weight: 850;
      letter-spacing: 0;
    }

    .batch-dock-title span {
      color: rgba(217, 208, 189, .74);
      font-size: 12px;
      font-weight: 760;
      letter-spacing: 0;
    }

    .batch-dock-controls {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .batch-action {
      min-height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: 0;
      border-radius: 6px;
      color: rgba(255, 248, 230, .76);
      background: transparent;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0;
      white-space: nowrap;
      cursor: pointer;
      transition: color .14s ease, background .14s ease, opacity .14s ease, transform .14s ease;
    }


    .batch-action {
      padding: 0 10px;
      border: 1px solid rgba(217, 208, 189, .14);
      background: rgba(255, 255, 255, .05);
    }

    .batch-action.primary {
      color: #fff;
      border-color: rgba(56, 189, 248, .34);
      background: linear-gradient(135deg, #2563eb, #0ea5e9);
      box-shadow: 0 10px 26px rgba(37, 99, 235, .28);
    }

    .batch-action:hover {
      color: #fff;
      background: rgba(255, 255, 255, .1);
      transform: translateY(-1px);
    }

    .batch-action.primary:hover {
      background: linear-gradient(135deg, #1d4ed8, #0284c7);
    }

    .batch-action:disabled {
      cursor: not-allowed;
      opacity: .45;
      transform: none;
    }

    .batch-action .lucide,
    .batch-action svg {
      width: 15px;
      height: 15px;
      stroke-width: 2.4;
    }

    .batch-strip {
      min-height: 94px;
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: 84px;
      gap: 8px;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 2px 2px 6px;
      scrollbar-width: thin;
      scrollbar-color: rgba(217, 208, 189, .34) transparent;
    }

    .batch-strip::-webkit-scrollbar {
      height: 8px;
    }

    .batch-strip::-webkit-scrollbar-track {
      background: transparent;
    }

    .batch-strip::-webkit-scrollbar-thumb {
      border: 2px solid transparent;
      border-radius: 999px;
      background: rgba(217, 208, 189, .34);
      background-clip: content-box;
    }

    .batch-item {
      position: relative;
      min-width: 0;
      display: grid;
      grid-template-rows: 64px 1fr;
      gap: 6px;
      padding: 5px;
      border: 1px solid rgba(217, 208, 189, .14);
      border-radius: 7px;
      color: rgba(255, 248, 230, .78);
      background: rgba(255, 255, 255, .045);
      cursor: pointer;
      transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease;
    }

    .batch-item:hover {
      border-color: rgba(217, 208, 189, .34);
      background: rgba(255, 255, 255, .08);
      transform: translateY(-1px);
    }

    .batch-item.is-active {
      border-color: #38bdf8;
      background: rgba(14, 165, 233, .12);
      box-shadow: 0 0 0 1px rgba(56, 189, 248, .28), 0 12px 24px rgba(0, 0, 0, .22);
    }

    .batch-item-thumb {
      position: relative;
      overflow: hidden;
      border-radius: 5px;
      background: rgba(0, 0, 0, .24);
    }

    .batch-item-thumb img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }

    .batch-item-index {
      position: absolute;
      left: 5px;
      top: 5px;
      min-width: 20px;
      height: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      color: #111318;
      background: rgba(255, 248, 230, .92);
      font-size: 10px;
      font-weight: 900;
      line-height: 1;
    }

    .batch-item-name {
      min-width: 0;
      overflow: hidden;
      color: inherit;
      font-size: 10.5px;
      font-weight: 760;
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .batch-dock.is-busy .batch-item {
      pointer-events: none;
    }

    .polafilm.is-batch-exporting .panel,
    .polafilm.is-batch-exporting .stage-actions {
      pointer-events: none;
      opacity: .58;
    }


    .batch-quality-dialog {
      position: fixed;
      inset: 0;
      z-index: 9999999;
      display: grid;
      place-items: center;
      padding: 24px;
      color: var(--paper);
      background: rgba(9, 10, 24, .72);
      backdrop-filter: blur(16px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease;
    }

    .batch-quality-dialog[hidden] {
      display: none !important;
    }

    .batch-quality-dialog.is-active {
      opacity: 1;
      pointer-events: auto;
    }

    .batch-quality-panel {
      position: relative;
      width: min(620px, calc(100vw - 32px));
      padding: 24px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 8px;
      background: rgba(19, 20, 43, .96);
      box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
    }

    .batch-quality-close {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 32px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 8px;
      color: rgba(255, 248, 230, .72);
      background: rgba(255, 255, 255, .055);
      font: inherit;
      font-size: 20px;
      line-height: 1;
      cursor: pointer;
    }

    .batch-quality-kicker {
      display: block;
      color: rgba(217, 208, 189, .62);
      font-size: 12px;
      font-weight: 850;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .batch-quality-panel h2 {
      margin: 6px 42px 8px 0;
      color: #fff8e6;
      font-size: 24px;
      font-weight: 900;
      line-height: 1.15;
      letter-spacing: 0;
    }

    .batch-quality-panel p {
      margin: 0;
      color: rgba(217, 208, 189, .72);
      font-size: 13px;
      font-weight: 700;
      line-height: 1.5;
      letter-spacing: 0;
    }

    .batch-quality-options {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin-top: 18px;
    }

    .batch-quality-card {
      min-width: 0;
      display: grid;
      gap: 12px;
      padding: 16px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 8px;
      color: rgba(255, 248, 230, .84);
      background: rgba(255, 255, 255, .055);
      font: inherit;
      text-align: left;
      cursor: pointer;
      transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
    }

    .batch-quality-card:hover:not(:disabled) {
      border-color: rgba(56, 189, 248, .46);
      background: rgba(56, 189, 248, .10);
      box-shadow: 0 14px 28px rgba(0, 0, 0, .22);
      transform: translateY(-1px);
    }

    .batch-quality-card:disabled {
      cursor: not-allowed;
      opacity: .58;
    }

    .batch-quality-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .batch-quality-card-head strong {
      color: #fff8e6;
      font-size: 16px;
      font-weight: 900;
      letter-spacing: 0;
    }

    .batch-quality-card-head em {
      min-height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 9px;
      border-radius: 999px;
      color: #111318;
      background: var(--accent-strong);
      font-size: 11px;
      font-style: normal;
      font-weight: 900;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .batch-quality-card-subtitle {
      color: rgba(217, 208, 189, .72);
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
    }

    .batch-quality-card-grid {
      display: grid;
      gap: 8px;
    }

    .batch-quality-card-grid span {
      display: grid;
      grid-template-columns: 98px minmax(0, 1fr);
      gap: 10px;
      align-items: baseline;
      padding-top: 8px;
      border-top: 1px solid rgba(217, 208, 189, .10);
    }

    .batch-quality-card-grid b {
      color: rgba(217, 208, 189, .58);
      font-size: 11px;
      font-weight: 850;
      letter-spacing: 0;
    }

    .batch-quality-card-grid i {
      min-width: 0;
      overflow-wrap: anywhere;
      color: rgba(255, 248, 230, .92);
      font-size: 12px;
      font-style: normal;
      font-weight: 850;
      line-height: 1.35;
      letter-spacing: 0;
    }

    .batch-quality-card-action {
      min-height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-top: 2px;
      border-radius: 8px;
      color: #111318;
      background: var(--accent-strong);
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0;
      text-align: center;
    }

    .batch-export-overlay {
      position: fixed;
      inset: 0;
      z-index: 10000000;
      display: grid;
      place-items: center;
      padding: 24px;
      color: var(--paper);
      background: rgba(9, 10, 24, .86);
      backdrop-filter: blur(18px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
    }

    .batch-export-overlay[hidden] {
      display: none !important;
    }

    .batch-export-overlay.is-active {
      opacity: 1;
      pointer-events: auto;
    }

    .batch-export-panel {
      position: relative;
      overflow: hidden;
      width: min(560px, calc(100vw - 32px));
      padding: 24px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 8px;
      background: rgba(19, 20, 43, .94);
      box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
    }

    .batch-export-panel::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: 2px;
      background: linear-gradient(90deg, #38bdf8, #f97316, #f472b6, #38bdf8);
      opacity: .95;
      animation: batch-export-scan 2.2s ease-in-out infinite;
    }

    .batch-export-visual {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .batch-export-logo-wrap {
      position: relative;
      width: 66px;
      height: 66px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border-radius: 50%;
      overflow: hidden;
      background: #17182f;
    }

    .batch-export-logo-wrap::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      border-radius: inherit;
      background: conic-gradient(from 0deg, #38bdf8, #f97316, #f472b6, #38bdf8);
      animation: polafilm-spin 1.2s linear infinite;
    }

    .batch-export-logo-wrap::before {
      content: "";
      position: absolute;
      inset: 7px;
      z-index: 1;
      border-radius: inherit;
      background: #17182f;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    }

    .batch-export-logo {
      position: relative;
      z-index: 2;
      width: 46px;
      height: 46px;
      object-fit: contain;
      filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35));
    }

    .batch-export-logo-wrap.is-empty .batch-export-logo {
      display: none;
    }

    .batch-export-heading {
      min-width: 0;
    }

    .batch-export-kicker {
      display: block;
      color: rgba(217, 208, 189, .62);
      font-size: 12px;
      font-weight: 850;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .batch-export-heading strong {
      display: block;
      margin-top: 4px;
      color: #fff8e6;
      font-size: 22px;
      font-weight: 900;
      line-height: 1.12;
      letter-spacing: 0;
    }

    .batch-export-heading p {
      margin: 6px 0 0;
      color: rgba(217, 208, 189, .74);
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
      letter-spacing: 0;
    }


    .batch-export-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 18px;
    }

    .batch-export-badges span {
      min-height: 26px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 0 9px;
      border: 1px solid rgba(217, 208, 189, .14);
      border-radius: 7px;
      color: rgba(255, 248, 230, .78);
      background: rgba(255, 255, 255, .045);
      font-size: 11px;
      font-weight: 850;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .batch-export-badges span::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #38bdf8;
      box-shadow: 0 0 12px rgba(56, 189, 248, .55);
    }

    .batch-export-badges span:nth-child(2)::before {
      background: #f97316;
      box-shadow: 0 0 12px rgba(249, 115, 22, .5);
    }

    .batch-export-badges span:nth-child(3)::before {
      background: #34d399;
      box-shadow: 0 0 12px rgba(52, 211, 153, .5);
    }

    .batch-export-progress {
      height: 10px;
      margin-top: 22px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(255, 255, 255, .08);
    }

    .batch-export-progress span {
      position: relative;
      display: block;
      width: 0;
      height: 100%;
      overflow: hidden;
      border-radius: inherit;
      background: linear-gradient(90deg, #38bdf8, #f97316, #f472b6);
      transition: width .24s ease;
    }

    .batch-export-progress span::after {
      content: "";
      position: absolute;
      inset: 0;
      width: 42%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
      animation: batch-export-glint 1.25s ease-in-out infinite;
      transform: translateX(-120%);
    }

    .batch-export-meter {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      margin-top: 10px;
      color: rgba(217, 208, 189, .76);
      font-size: 12px;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      letter-spacing: 0;
    }

    .batch-export-meter strong {
      color: #fff8e6;
      font-size: 18px;
      line-height: 1;
      letter-spacing: 0;
    }

    .batch-export-current {
      display: grid;
      grid-template-columns: 56px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      margin-top: 18px;
      padding: 12px;
      border: 1px solid rgba(217, 208, 189, .12);
      border-radius: 8px;
      background: rgba(255, 255, 255, .045);
    }

    .batch-export-thumb {
      width: 56px;
      aspect-ratio: 1;
      overflow: hidden;
      border-radius: 7px;
      background: linear-gradient(135deg, rgba(56, 189, 248, .18), rgba(249, 115, 22, .16));
    }

    .batch-export-thumb img {
      width: 100%;
      height: 100%;
      display: none;
      object-fit: cover;
    }

    .batch-export-thumb.has-image img {
      display: block;
    }

    .batch-export-current span {
      display: block;
      color: rgba(217, 208, 189, .58);
      font-size: 11px;
      font-weight: 850;
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    .batch-export-current strong {
      display: block;
      margin-top: 4px;
      overflow: hidden;
      color: #fff8e6;
      font-size: 14px;
      font-weight: 850;
      letter-spacing: 0;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .batch-export-overlay.is-importing .batch-export-steps {
      display: none;
    }

    .batch-export-steps {
      position: relative;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      margin-top: 18px;
      padding-top: 18px;
    }

    .batch-export-steps::before {
      content: "";
      position: absolute;
      left: 16.66%;
      right: 16.66%;
      top: 6px;
      height: 2px;
      border-radius: 999px;
      background: rgba(217, 208, 189, .18);
    }

    .batch-export-steps span {
      position: relative;
      min-width: 0;
      display: flex;
      justify-content: center;
      color: rgba(217, 208, 189, .58);
      font-size: 12px;
      font-weight: 850;
      line-height: 1.25;
      letter-spacing: 0;
      text-align: center;
    }

    .batch-export-steps span::before {
      content: "";
      position: absolute;
      top: -17px;
      left: 50%;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #2f3154;
      box-shadow: 0 0 0 2px rgba(217, 208, 189, .16);
      transform: translateX(-50%);
    }

    .batch-export-steps span.is-active {
      color: #fff8e6;
    }

    .batch-export-steps span.is-active::before {
      background: #fff8e6;
      box-shadow: 0 0 0 4px rgba(255, 248, 230, .16), 0 0 18px rgba(255, 248, 230, .34);
    }

    .batch-export-steps span.is-complete {
      color: #a7f3d0;
    }

    .batch-export-steps span.is-complete::before {
      background: #34d399;
      box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
    }

    .batch-export-note {
      margin: 16px 0 0;
      color: rgba(217, 208, 189, .66);
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
      letter-spacing: 0;
      text-align: center;
    }

    .batch-export-cancel {
      width: 100%;
      min-height: 38px;
      margin-top: 14px;
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 8px;
      color: rgba(255, 248, 230, .86);
      background: rgba(255, 255, 255, .055);
      font: inherit;
      font-size: 12px;
      font-weight: 850;
      letter-spacing: 0;
      cursor: pointer;
      transition: background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
    }

    .batch-export-cancel:hover:not(:disabled) {
      color: #fff8e6;
      background: rgba(248, 113, 113, .14);
      border-color: rgba(248, 113, 113, .38);
    }

    .batch-export-cancel:disabled {
      cursor: wait;
      opacity: .66;
    }

    .batch-export-cancel[hidden] {
      display: none !important;
    }


    @keyframes batch-export-scan {
      0%, 100% { opacity: .42; transform: translateX(-18%); }
      50% { opacity: 1; transform: translateX(18%); }
    }

    @keyframes batch-export-glint {
      0% { transform: translateX(-120%); }
      100% { transform: translateX(260%); }
    }

    html[data-theme="light"] .batch-export-overlay {
      color: #111827;
      background: rgba(248, 250, 252, .88);
    }

    html[data-theme="light"] .batch-export-panel {
      border-color: rgba(16, 17, 38, .1);
      background: rgba(255, 255, 255, .94);
      box-shadow: 0 28px 80px rgba(16, 17, 38, .18);
    }

    html[data-theme="light"] .batch-export-logo-wrap::before {
      background: #ffffff;
    }

    html[data-theme="light"] .batch-export-kicker,
    html[data-theme="light"] .batch-export-heading p,
    html[data-theme="light"] .batch-export-meter,
    html[data-theme="light"] .batch-export-current span,
    html[data-theme="light"] .batch-export-note {
      color: rgba(15, 23, 42, .62);
    }

    html[data-theme="light"] .batch-export-heading strong,
    html[data-theme="light"] .batch-export-meter strong,
    html[data-theme="light"] .batch-export-current strong {
      color: #0f172a;
    }


    html[data-theme="light"] .batch-export-badges span {
      color: rgba(15, 23, 42, .68);
      border-color: rgba(16, 17, 38, .1);
      background: rgba(15, 23, 42, .04);
    }

    html[data-theme="light"] .batch-export-current {
      border-color: rgba(16, 17, 38, .1);
      background: rgba(15, 23, 42, .04);
    }

    html[data-theme="light"] .batch-export-cancel {
      color: rgba(17, 24, 39, .76);
      background: rgba(17, 24, 39, .045);
      border-color: rgba(17, 24, 39, .12);
    }

    html[data-theme="light"] .batch-export-cancel:hover:not(:disabled) {
      color: #991b1b;
      background: rgba(239, 68, 68, .08);
      border-color: rgba(239, 68, 68, .22);
    }

    html[data-theme="light"] .batch-export-steps::before {
      background: rgba(15, 23, 42, .14);
    }

    html[data-theme="light"] .batch-export-steps span {
      color: rgba(15, 23, 42, .52);
    }

    html[data-theme="light"] .batch-export-steps span::before {
      background: #cbd5e1;
      box-shadow: 0 0 0 2px rgba(15, 23, 42, .08);
    }

    html[data-theme="light"] .batch-export-steps span.is-active {
      color: #0f172a;
    }

    html[data-theme="light"] .batch-export-steps span.is-active::before {
      background: #0f172a;
      box-shadow: 0 0 0 4px rgba(15, 23, 42, .1), 0 0 18px rgba(14, 165, 233, .22);
    }

    html[data-theme="light"] .batch-export-steps span.is-complete {
      color: #047857;
    }

    html[data-theme="light"] .batch-export-steps span.is-complete::before {
      background: #10b981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
    }

    @media (max-width: 640px) {
      .batch-export-overlay {
        padding: 16px;
      }

      .batch-export-panel {
        width: min(100%, 420px);
        padding: 18px;
      }

      .batch-export-visual {
        gap: 12px;
      }

      .batch-export-logo-wrap {
        width: 54px;
        height: 54px;
      }

      .batch-export-logo {
        width: 38px;
        height: 38px;
      }

      .batch-export-heading strong {
        font-size: 19px;
      }


      .batch-export-badges {
        gap: 6px;
        margin-top: 14px;
      }

      .batch-export-badges span {
        min-height: 24px;
        padding: 0 8px;
        font-size: 10.5px;
      }

      .batch-export-steps {
        gap: 6px;
      }

      .batch-export-steps span {
        font-size: 11px;
      }

      .batch-quality-panel {
        padding: 20px;
      }

      .batch-quality-options {
        grid-template-columns: 1fr;
      }

      .batch-quality-card-grid span {
        grid-template-columns: 88px minmax(0, 1fr);
      }
    }
    html[data-theme="light"] .batch-dock {
      color: #111827;
      border-color: transparent;
      box-shadow: none;
    }

    html[data-theme="light"] .batch-dock-title {
      color: #0f172a;
    }

    html[data-theme="light"] .batch-quality-dialog {
      color: #111827;
      background: rgba(248, 250, 252, .80);
    }

    html[data-theme="light"] .batch-quality-panel {
      background: rgba(255, 255, 255, .96);
      border-color: rgba(16, 17, 38, .10);
      box-shadow: 0 24px 70px rgba(16, 17, 38, .16);
    }

    html[data-theme="light"] .batch-quality-close,
    html[data-theme="light"] .batch-quality-card {
      color: #475569;
      background: rgba(15, 23, 42, .04);
      border-color: rgba(16, 17, 38, .10);
    }

    html[data-theme="light"] .batch-quality-kicker,
    html[data-theme="light"] .batch-quality-panel p,
    html[data-theme="light"] .batch-quality-card-subtitle,
    html[data-theme="light"] .batch-quality-card-grid b {
      color: rgba(15, 23, 42, .62);
    }

    html[data-theme="light"] .batch-quality-panel h2,
    html[data-theme="light"] .batch-quality-card-head strong,
    html[data-theme="light"] .batch-quality-card-grid i {
      color: #0f172a;
    }

    html[data-theme="light"] .batch-quality-card:hover:not(:disabled) {
      border-color: rgba(14, 165, 233, .38);
      background: rgba(14, 165, 233, .08);
      box-shadow: 0 14px 28px rgba(16, 17, 38, .10);
    }

    html[data-theme="light"] .batch-quality-card-action {
      color: #111318;
      background: #f3e7cf;
    }

    html[data-theme="light"] .batch-dock-title span,

    html[data-theme="light"] .batch-item,

    html[data-theme="light"] .batch-action {
      color: #475569;
    }


    html[data-theme="light"] .batch-action,

    html[data-theme="light"] .batch-item {
      border-color: rgba(16, 17, 38, .1);
      background: rgba(248, 250, 252, .82);
    }

    html[data-theme="light"] .batch-item.is-active {
      border-color: #0284c7;
      background: rgba(14, 165, 233, .1);
      box-shadow: 0 0 0 1px rgba(14, 165, 233, .24), 0 12px 24px rgba(16, 17, 38, .08);
    }

    @media (min-width: 941px) {
      .stage-container.has-batch-dock {
        display: grid !important;
        grid-template-columns: 152px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        column-gap: 0;
        align-items: stretch;
      }

      .stage-container.has-batch-dock #polafilm-news-ticker {
        grid-column: 1 / -1;
        grid-row: 1;
      }

      .stage-container.has-batch-dock .stage {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        padding-left: 0;
        padding-right: 24px;
      }

      .stage-container.has-batch-dock .preview-wrap,
      .stage-container.has-batch-dock .preview-wrap.compare-active {
        max-width: 100%;
      }

      .stage-container.has-batch-dock .batch-dock {
        grid-column: 1;
        grid-row: 2;
        align-self: stretch;
        width: auto;
        min-width: 0;
        max-height: calc(100vh - 146px);
        margin: 12px 0 14px;
        padding: 8px 0;
        display: flex;
        flex-direction: column;
      }

      .stage-container.has-batch-dock .batch-dock-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 10px;
      }

      .stage-container.has-batch-dock .batch-dock-title {
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        width: 100%;
        padding: 0 6px;
      }

      .stage-container.has-batch-dock .batch-dock-title strong {
        font-size: 12px;
      }

      .stage-container.has-batch-dock .batch-dock-title span {
        font-size: 11px;
      }

      .stage-container.has-batch-dock .batch-dock-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 0 5px;
      }


      .stage-container.has-batch-dock .batch-action {
        width: 100%;
        min-height: 32px;
        padding: 0 8px;
      }

      .stage-container.has-batch-dock .batch-strip {
        flex: 1 1 auto;
        min-height: 0;
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: 96px;
        overflow-x: hidden;
        overflow-y: auto;
        width: 100%;
        margin: 0;
        padding: 0;
        scrollbar-width: none;
      }

      .stage-container.has-batch-dock .batch-strip::-webkit-scrollbar {
        width: 0;
        height: 0;
      }

      .stage-container.has-batch-dock .batch-item {
        grid-template-rows: 68px 1fr;
        padding: 4px;
      }

      .stage-container.has-batch-dock .batch-item:hover {
        transform: translateX(1px);
      }
    }
    @media (max-width: 940px) {
      .batch-dock {
        display: none !important;
      }
    }

    /* Concept C (Precision Deck with Optical Shimmer) - Desktop Only & Mode Optimized */
    @media (min-width: 941px) {
      .stage-actions {
        gap: 10px;
      }

      .stage-action-button {
        min-height: 42px;
        padding: 0 18px;
        gap: 8px;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 11px;
        color: #d1d5db;
        background: #141624;
        font-size: 13.5px;
        font-weight: 650;
        letter-spacing: 0;
        cursor: pointer;
        transition: all .2s cubic-bezier(.16, 1, .3, 1);
        box-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
      }

      .stage-action-button:hover {
        background: #1c1f33;
        border-color: rgba(255, 255, 255, .28);
        color: #ffffff;
        filter: none;
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .15);
      }

      .stage-action-button:active {
        transform: translateY(0);
      }

      .stage-action-button .lucide,
      .stage-action-button svg {
        width: 17px;
        height: 17px;
        color: #9ca3af;
        stroke: #9ca3af;
        transition: all .2s ease;
      }

      .stage-action-button:hover .lucide,
      .stage-action-button:hover svg {
        color: #ffffff;
        stroke: #ffffff;
      }

      .stage-actions #stage-random-light-leak {
        background: linear-gradient(#141624, #141624) padding-box,
                    linear-gradient(135deg, #f97316, #ec4899, #3b82f6) border-box !important;
        border: 1.5px solid transparent !important;
        color: #ffffff;
      }

      .stage-actions #stage-random-light-leak .stage-action-marquee-track .lucide,
      .stage-actions #stage-random-light-leak .stage-action-marquee-track svg,
      .stage-actions #stage-random-light-leak > .lucide,
      .stage-actions #stage-random-light-leak > svg {
        color: #fb923c !important;
        stroke: #fb923c !important;
      }

      .stage-actions #stage-random-light-leak:hover {
        background: linear-gradient(#1e2136, #1e2136) padding-box,
                    linear-gradient(135deg, #fb923c, #f43f5e, #60a5fa) border-box !important;
        box-shadow: 0 10px 28px rgba(249, 115, 22, .28) !important;
      }

      .stage-actions #stage-random-light-leak:hover .stage-action-marquee-track .lucide,
      .stage-actions #stage-random-light-leak:hover .stage-action-marquee-track svg,
      .stage-actions #stage-random-light-leak:hover > .lucide,
      .stage-actions #stage-random-light-leak:hover > svg {
        transform: rotate(180deg);
      }

      .stage-action-button.primary {
        background: #0066ff !important;
        border: 1px solid #38bdf8 !important;
        color: #ffffff !important;
        font-weight: 750;
        padding: 0 24px;
        box-shadow: 0 6px 20px rgba(0, 102, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .3) !important;
      }

      .stage-action-button.primary .lucide,
      .stage-action-button.primary svg {
        color: #ffffff !important;
        stroke: #ffffff !important;
      }

      .stage-action-button.primary:hover {
        background: #1075ff !important;
        border-color: #7dd3fc !important;
        box-shadow: 0 12px 30px rgba(0, 102, 255, .65), 0 0 18px rgba(56, 189, 248, .45) !important;
      }

      /* Light Mode overrides on Desktop */

    html[data-theme="light"] .stage-action-button {
        background: #ffffff;
        border-color: rgba(16, 17, 38, .12);
        color: #334155;
        box-shadow: 0 6px 16px rgba(16, 17, 38, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
      }

    html[data-theme="light"] .stage-action-button:hover {
        background: #f8fafc;
        border-color: rgba(16, 17, 38, .25);
        color: #0f172a;
        box-shadow: 0 10px 24px rgba(16, 17, 38, .12), inset 0 1px 0 #ffffff;
      }

    html[data-theme="light"] .stage-action-button .lucide,

    html[data-theme="light"] .stage-action-button svg {
        color: #475569;
        stroke: #475569;
      }

    html[data-theme="light"] .stage-action-button:hover .lucide,

    html[data-theme="light"] .stage-action-button:hover svg {
        color: #0f172a;
        stroke: #0f172a;
      }

    html[data-theme="light"] .stage-actions #stage-random-light-leak {
        background: linear-gradient(#ffffff, #ffffff) padding-box,
                    linear-gradient(135deg, #f97316, #ec4899, #3b82f6) border-box !important;
        color: #1e293b;
      }

    html[data-theme="light"] .stage-actions #stage-random-light-leak .stage-action-marquee-track .lucide,

    html[data-theme="light"] .stage-actions #stage-random-light-leak .stage-action-marquee-track svg,

    html[data-theme="light"] .stage-actions #stage-random-light-leak > .lucide,

    html[data-theme="light"] .stage-actions #stage-random-light-leak > svg {
        color: #ea580c !important;
        stroke: #ea580c !important;
      }

    html[data-theme="light"] .stage-actions #stage-random-light-leak:hover {
        background: linear-gradient(#f8fafc, #f8fafc) padding-box,
                    linear-gradient(135deg, #ea580c, #db2777, #2563eb) border-box !important;
        color: #0f172a;
        box-shadow: 0 10px 28px rgba(249, 115, 22, .2) !important;
      }

    html[data-theme="light"] .stage-action-button.primary {
        background: #0066ff !important;
        border-color: #60a5fa !important;
        color: #ffffff !important;
        box-shadow: 0 6px 20px rgba(0, 102, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .4) !important;
      }

    html[data-theme="light"] .stage-action-button.primary .lucide,

    html[data-theme="light"] .stage-action-button.primary svg {
        color: #ffffff !important;
        stroke: #ffffff !important;
      }

    html[data-theme="light"] .stage-action-button.primary:hover {
        background: #005ce6 !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 12px 28px rgba(0, 102, 255, .45), 0 0 14px rgba(96, 165, 250, .4) !important;
      }

      /* Guarantee remove-effect-badge and X icon are crystal clear across all Desktop themes */
      .remove-effect-badge,
      .stage-action-button .remove-effect-badge,
      #stage-random-light-leak .remove-effect-badge,

    html[data-theme="light"] .remove-effect-badge,

    html[data-theme="light"] .stage-action-button .remove-effect-badge,

    html[data-theme="light"] #stage-random-light-leak .remove-effect-badge {
        background: #ef4444 !important;
        color: #ffffff !important;
        border: 1.5px solid #ffffff !important;
        box-shadow: 0 2px 8px rgba(239, 68, 68, .45), 0 1px 3px rgba(0, 0, 0, .25) !important;
      }

      .remove-effect-badge .lucide,
      .remove-effect-badge svg,
      .remove-effect-badge i,
      .stage-action-button .remove-effect-badge .lucide,
      .stage-action-button .remove-effect-badge svg,
      #stage-random-light-leak .remove-effect-badge .lucide,
      #stage-random-light-leak .remove-effect-badge svg,

    html[data-theme="light"] .remove-effect-badge .lucide,

    html[data-theme="light"] .remove-effect-badge svg,

    html[data-theme="light"] #stage-random-light-leak .remove-effect-badge .lucide,

    html[data-theme="light"] #stage-random-light-leak .remove-effect-badge svg {
        color: #ffffff !important;
        stroke: #ffffff !important;
        stroke-width: 3 !important;
        width: 11px !important;
        height: 11px !important;
      }
    }


    .polaroid-card {
      --frame-padding: clamp(15px, calc(var(--card-width) * .046), 23px);
      --bottom-padding: clamp(65px, calc(var(--card-width) * .2), 100px);
      --photo-ratio: 1 / 1;
      position: relative;
      width: var(--card-width);
      height: calc(var(--card-width) * 1.333333);
      aspect-ratio: auto;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
      padding: var(--frame-padding) var(--frame-padding) var(--bottom-padding);
      border-radius: 2px;
      background:
        var(--frame-glaze),
        var(--frame-color);
      box-shadow: var(--frame-shadow);
      transform: scale(var(--preview-zoom, 1));
      transform-origin: center center;
      transition: width .22s ease, aspect-ratio .22s ease, padding .22s ease, background .18s ease, transform .18s ease;
    }

    .polaroid-card::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      opacity: .2;
      pointer-events: none;
      background-image:
        linear-gradient(90deg, rgba(18, 22, 29, .045) 1px, transparent 1px),
        linear-gradient(rgba(18, 22, 29, .035) 1px, transparent 1px);
      background-size: 14px 14px;
      mix-blend-mode: multiply;
    }

    .polaroid-card::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      border: 1px solid rgba(255, 255, 255, .08);
      pointer-events: none;
    }

    .polaroid-card.frame-none {
      --frame-padding: 0px;
      --bottom-padding: 0px;
      background: transparent;
      box-shadow: none;
      height: auto !important;
      aspect-ratio: var(--variant-frame-aspect) !important;
    }

    .polaroid-card.frame-none .photo-slot {
      border-radius: 0;
      box-shadow: none;
    }

    .polaroid-card.show-original .photo-transition {
      opacity: 0 !important;
    }

    .polaroid-card.show-original .preview-light-leak {
      opacity: 0 !important;
    }

    .polaroid-card.show-original .photo-slot {
      filter: none !important;
    }

    .polaroid-card.show-original .photo-slot::before {
      opacity: 1;
    }

    .polaroid-card.frame-none::before,
    .polaroid-card.frame-none::after {
      display: none;
    }

    .polaroid-card.frame-none .photo-slot {
      box-shadow: none;
      width: 100% !important;
      height: 100% !important;
      aspect-ratio: var(--variant-frame-aspect) !important;
    }

    .png-overlay-frame {
      background: transparent;
      box-shadow: none;
      filter: var(--overlay-glow);
    }

    .png-overlay-frame::before,
    .png-overlay-frame::after {
      display: none;
    }

    .template-frame {
      background: var(--frame-color);
      cursor: grab;
      touch-action: none;
      user-select: none;
    }

    .template-frame::before,
    .template-frame::after {
      display: none;
    }

    .template-frame.is-template-loading {
      cursor: progress;
    }

    .template-frame.is-template-loading::before,
    .template-frame.is-template-loading::after {
      display: block;
      pointer-events: none;
    }

    .template-frame.is-template-loading::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background: rgba(9, 10, 18, .16);
      backdrop-filter: blur(1.5px);
      z-index: 30;
    }

    .template-frame.is-template-loading::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 28px;
      height: 28px;
      margin: -14px 0 0 -14px;
      border: 3px solid rgba(255, 255, 255, .72);
      border-top-color: var(--accent-strong);
      border-radius: 50%;
      box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
      animation: templateSpin .8s linear infinite;
      z-index: 31;
    }

    @keyframes templateSpin {
      to {
        transform: rotate(360deg);
      }
    }

    .preview-light-leak {
      position: absolute;
      inset: 0;
      z-index: 10;
      pointer-events: none;
      mix-blend-mode: screen;
      background-size: 100% 100%;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .preview-light-leak.is-active {
      opacity: 1;
    }

    .png-overlay-frame .caption {
      display: none;
    }


    .tool-locked {
      --card-width: min(clamp(320px, 30vw, 460px), calc((100vh - 240px - var(--ticker-height)) * .75));
      --upload-card-width: min(clamp(420px, 38vw, 600px), calc((100vh - 280px - var(--ticker-height)) * .86));
    }

    .tool-locked .stage {
      grid-template-rows: auto auto;
      align-content: center;
      justify-items: center;
      gap: 24px;
      padding: 20px 24px 28px;
      background:
        radial-gradient(circle at 50% 24%, rgba(217, 224, 255, .30), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #eef3fa 100%);
    }

    .tool-locked .stage::after {
      background:
        radial-gradient(circle at 50% 28%, rgba(124, 134, 255, .06), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(243, 246, 252, .46));
      opacity: 1;
      mix-blend-mode: normal;
    }

    html:not([data-theme="light"]) .tool-locked .stage {
      background:
        radial-gradient(circle at 50% 22%, rgba(88, 95, 183, .12), transparent 32%),
        linear-gradient(180deg, #0f1120 0%, #121429 100%);
    }

    html:not([data-theme="light"]) .tool-locked .stage::after {
      background:
        radial-gradient(circle at 50% 26%, rgba(255, 255, 255, .04), transparent 30%),
        linear-gradient(180deg, rgba(6, 7, 16, .08), rgba(6, 7, 16, .24));
      opacity: 1;
      mix-blend-mode: normal;
    }

    .tool-locked .preview-wrap,
    .tool-locked .preview-wrap.preview-wide {
      width: var(--upload-card-width);
      height: auto;
      margin-top: 0;
    }

    .tool-locked .polaroid-card.frame-none {
      width: 100%;
      aspect-ratio: 1.14;
      padding: 18px;
      overflow: visible;
      border-radius: 30px;
      background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 249, 255, .94));
      border: 1px solid rgba(223, 229, 242, .94);
      box-shadow:
        0 20px 54px rgba(107, 124, 162, .12),
        0 8px 22px rgba(107, 124, 162, .08),
        inset 0 1px 0 rgba(255, 255, 255, .78);
      transition: none;
    }

    html:not([data-theme="light"]) .tool-locked .polaroid-card.frame-none {
      background: linear-gradient(180deg, rgba(24, 26, 46, .96), rgba(18, 20, 37, .93));
      border-color: rgba(255, 255, 255, .06);
      box-shadow:
        0 24px 64px rgba(0, 0, 0, .34),
        0 0 0 1px rgba(255, 255, 255, .03);
    }

    .tool-locked .polaroid-card.frame-none::before,
    .tool-locked .polaroid-card.frame-none::after {
      display: none;
    }

    .tool-locked .polaroid-card.frame-none .photo-slot {
      width: 100% !important;
      height: 100% !important;
      aspect-ratio: auto !important;
      border-radius: 24px;
      cursor: pointer;
      touch-action: auto;
      background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(246, 249, 255, .92));
      box-shadow: inset 0 0 0 1px rgba(214, 221, 239, .95);
    }

    html:not([data-theme="light"]) .tool-locked .polaroid-card.frame-none .photo-slot {
      background: linear-gradient(180deg, rgba(31, 33, 56, .96), rgba(21, 23, 41, .92));
      box-shadow: inset 0 0 0 1px rgba(150, 158, 214, .08);
    }

    .tool-locked .variant-frame .photo-slot {
      position: relative;
      left: auto;
      top: auto;
      width: 100%;
      height: auto;
      max-height: 100%;
      aspect-ratio: var(--photo-ratio);
    }

    .tool-locked .stage-upload-cta {
      position: relative;
      left: auto;
      bottom: auto;
      width: min(100%, 340px);
      min-height: 62px;
      padding: 0 26px;
      transform: none;
      border: 1px solid rgba(84, 73, 219, .18);
      border-radius: 16px;
      color: #ffffff;
      background: linear-gradient(180deg, #574ef0, #3b2fb1);
      box-shadow:
        0 14px 34px rgba(78, 75, 224, .22),
        inset 0 1px 0 rgba(255, 255, 255, .14);
      font-size: 16px;
      font-weight: 850;
      letter-spacing: 0;
    }

    .tool-locked .stage-upload-cta:hover {
      border-color: rgba(84, 73, 219, .28);
      background: linear-gradient(180deg, #6159f2, #4134c0);
      box-shadow:
        0 18px 40px rgba(78, 75, 224, .24),
        inset 0 1px 0 rgba(255, 255, 255, .16);
      transform: translateY(-1px);
    }

    html:not([data-theme="light"]) .tool-locked .stage-upload-cta {
      background: linear-gradient(180deg, #4a45d1, #372ca5);
      box-shadow:
        0 16px 38px rgba(27, 25, 82, .42),
        inset 0 1px 0 rgba(255, 255, 255, .10);
    }

    html:not([data-theme="light"]) .tool-locked .stage-upload-cta:hover {
      background: linear-gradient(180deg, #5550da, #4032b6);
      box-shadow:
        0 18px 44px rgba(27, 25, 82, .46),
        inset 0 1px 0 rgba(255, 255, 255, .12);
    }

    .tool-locked .stage-upload-cta:active {
      transform: translateY(1px);
    }

    .tool-locked .stage-upload-cta .lucide,
    .tool-locked .stage-upload-cta svg {
      width: 24px;
      height: 24px;
      color: #ffffff;
      stroke-width: 2.1;
    }

    .tool-locked .stage-upload-cta span {
      line-height: 1.1;
    }

    @media (max-width: 940px) {
      .tool-locked {
        --upload-card-width: min(calc(100vw - 28px), 520px);
      }

      .tool-locked .stage {
        gap: 18px;
        padding: 16px 14px 24px;
      }

      .tool-locked .polaroid-card.frame-none {
        aspect-ratio: 1.04;
        padding: 16px;
      }

      .tool-locked .polaroid-card.frame-none .photo-slot {
        border-radius: 20px;
      }

      .empty-drop-zone {
        gap: 8px;
        padding: 22px 20px;
      }

      .empty-drop-zone::before {
        inset: 14px;
        border-radius: 16px;
      }

      .empty-drop-icon {
        width: 72px;
        height: 72px;
      }

      .empty-drop-icon .lucide,
      .empty-drop-icon svg {
        width: 36px;
        height: 36px;
      }

      .empty-drop-title {
        font-size: 24px;
      }

      .empty-drop-subtitle {
        font-size: 15px;
      }

      .empty-drop-note {
        font-size: 12px;
      }

      .tool-locked .stage-upload-cta {
        width: min(100%, 320px);
        min-height: 58px;
        padding: 0 22px;
        font-size: 15px;
      }
    }

    .photo-slot::before {
      content: "";
      position: absolute;
      left: var(--photo-draw-left, 0px);
      top: var(--photo-draw-top, 0px);
      width: var(--photo-draw-width, 100%);
      height: var(--photo-draw-height, 100%);
      z-index: 2;
      background-image: var(--photo-original-url);
      background-position: var(--photo-x) var(--photo-y);
      background-size: var(--photo-bg-size, cover);
      background-repeat: no-repeat;
      opacity: 0;
      transition: opacity 0.2s ease-out;
      pointer-events: none;
    }

    .photo-slot {
      position: relative;
      z-index: 1;
      width: 100%;
      max-height: 100%;
      align-self: start;
      justify-self: center;
      aspect-ratio: var(--photo-ratio);
      overflow: hidden;
      border-radius: 2px;
      background-color: #f8fafc;
      box-shadow: inset 0 0 0 1px rgba(5, 8, 12, .13);
      cursor: grab;
      touch-action: none;
      user-select: none;
      transition: aspect-ratio .22s ease;
    }

    .empty-drop-zone {
      position: absolute;
      inset: 0;
      z-index: 8;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 28px 32px;
      color: rgba(31, 42, 68, .92);
      text-align: center;
      pointer-events: none;
      transition: color .16s ease, transform .16s ease;
    }

    .empty-drop-zone::before {
      content: "";
      position: absolute;
      inset: 16px;
      border: 1px dashed rgba(185, 194, 220, .88);
      border-radius: 22px;
      background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(249, 250, 255, .06));
      pointer-events: none;
      transition: border-color .16s ease, background .16s ease, transform .16s ease;
    }

    .empty-drop-zone::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 43%;
      width: 150px;
      height: 150px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(120, 128, 255, .14), rgba(120, 128, 255, 0) 70%);
      transform: translate(-50%, -50%);
      pointer-events: none;
      animation: emptyDropGlow 3.2s ease-in-out infinite;
    }

    @keyframes emptyDropIconFloat {
      0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 8px 14px rgba(107, 111, 240, .08)); }
      50% { transform: translateY(-6px) scale(1.06); filter: drop-shadow(0 16px 22px rgba(107, 111, 240, .24)); }
    }

    @keyframes emptyDropArrowLift {
      0%, 100% { transform: translateY(1px) scale(1); opacity: .86; }
      50% { transform: translateY(-5px) scale(1.08); opacity: 1; }
    }

    @keyframes emptyDropIconRing {
      0% { opacity: .42; transform: scale(.94); }
      68%, 100% { opacity: 0; transform: scale(1.22); }
    }

    @keyframes emptyDropGlow {
      0%, 100% { opacity: .72; transform: translate(-50%, -50%) scale(.94); }
      50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
    }

    .empty-drop-icon {
      animation: emptyDropIconFloat 1.9s ease-in-out infinite !important;
      position: relative;
      z-index: 1;
      display: inline-grid;
      place-items: center;
      width: 84px;
      height: 84px;
      border-radius: 50%;
      color: #6b6ff0;
      background:
        radial-gradient(circle at 50% 34%, rgba(151, 156, 255, .38), rgba(107, 111, 240, .14) 62%, rgba(107, 111, 240, .04) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(241, 244, 255, .78));
      box-shadow:
        0 14px 34px rgba(107, 111, 240, .16),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    }

    .empty-drop-icon::after {
      content: "";
      position: absolute;
      inset: -6px;
      border: 1px solid currentColor;
      border-radius: 50%;
      pointer-events: none;
      animation: emptyDropIconRing 1.9s ease-out infinite !important;
    }

    .empty-drop-icon .lucide,
    .empty-drop-icon svg {
      width: 42px;
      height: 42px;
      stroke-width: 2;
      animation: emptyDropArrowLift 1.9s ease-in-out infinite !important;
    }

    .empty-drop-title {
      position: relative;
      z-index: 1;
      max-width: 460px;
      font-size: clamp(24px, 2vw, 34px);
      line-height: 1.08;
      font-weight: 850;
      letter-spacing: 0;
      color: #1f2a44;
    }

    .empty-drop-subtitle {
      position: relative;
      z-index: 1;
      max-width: 420px;
      font-size: clamp(15px, 1.05vw, 18px);
      line-height: 1.28;
      font-weight: 500;
      color: rgba(86, 94, 119, .88);
    }

    .empty-drop-note {
      position: relative;
      z-index: 1;
      max-width: 420px;
      font-size: 12px;
      line-height: 1.35;
      font-weight: 500;
      color: rgba(101, 110, 135, .82);
    }

    .tool-locked .empty-drop-zone {
      display: flex;
    }

    .tool-locked .photo-slot {
      position: relative;
      border-radius: 24px;
      cursor: pointer;
      touch-action: auto;
      background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(246, 249, 255, .92));
      box-shadow: inset 0 0 0 1px rgba(214, 221, 239, .95);
    }

    .tool-locked .photo-slot.is-drop-hover {
      box-shadow: inset 0 0 0 1px rgba(107, 111, 240, .22);
    }

    .tool-locked .photo-slot.is-drop-hover .empty-drop-zone {
      color: rgba(31, 42, 68, .98);
      transform: scale(.994);
    }

    .tool-locked .photo-slot.is-drop-hover .empty-drop-zone::before {
      border-color: rgba(107, 111, 240, .34);
      background: rgba(107, 111, 240, .03);
    }

    html:not([data-theme="light"]) .empty-drop-zone {
      color: rgba(237, 239, 255, .88);
    }

    html:not([data-theme="light"]) .empty-drop-zone::before {
      border-color: rgba(133, 142, 198, .30);
      background: linear-gradient(180deg, rgba(31, 34, 58, .30), rgba(20, 22, 38, .14));
    }

    html:not([data-theme="light"]) .empty-drop-zone::after {
      background: radial-gradient(circle, rgba(120, 128, 255, .10), rgba(120, 128, 255, 0) 70%);
    }

    html:not([data-theme="light"]) .empty-drop-icon {
      color: #bcc5ff;
      background:
        radial-gradient(circle at 50% 36%, rgba(118, 127, 255, .28), rgba(74, 84, 188, .12) 62%, rgba(74, 84, 188, .04) 100%),
        linear-gradient(180deg, rgba(37, 39, 66, .98), rgba(24, 25, 45, .92));
      box-shadow:
        0 14px 34px rgba(0, 0, 0, .22),
        inset 0 1px 0 rgba(255, 255, 255, .06);
    }

    html:not([data-theme="light"]) .empty-drop-title {
      color: #f5f6ff;
    }

    html:not([data-theme="light"]) .empty-drop-subtitle {
      color: rgba(214, 219, 255, .72);
    }

    html:not([data-theme="light"]) .empty-drop-note {
      color: rgba(176, 184, 220, .62);
    }

    html:not([data-theme="light"]) .tool-locked .photo-slot {
      background: linear-gradient(180deg, rgba(31, 33, 56, .96), rgba(21, 23, 41, .92));
      box-shadow: inset 0 0 0 1px rgba(150, 158, 214, .08);
    }

    html:not([data-theme="light"]) .tool-locked .photo-slot.is-drop-hover {
      box-shadow: inset 0 0 0 1px rgba(145, 154, 214, .18);
    }

    html:not([data-theme="light"]) .tool-locked .photo-slot.is-drop-hover .empty-drop-zone::before {
      border-color: rgba(145, 154, 214, .34);
      background: rgba(145, 154, 214, .04);
    }

    .photo-slot::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      z-index: 2;
      background-image: var(--photo-original-url);
      background-position: var(--photo-x) var(--photo-y);
      background-size: var(--photo-bg-size, cover);
      background-repeat: no-repeat;
      opacity: 0;
      transition: opacity 0.2s ease-out;
      pointer-events: none;
    }

    .photo-image {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      background-image: var(--photo-url);
      background-position: var(--photo-x) var(--photo-y);
      background-size: var(--photo-bg-size, cover);
      background-repeat: no-repeat;
      filter: var(--photo-filter);
      will-change: filter;
    }

    .photo-lut-preview {
      position: absolute;
      left: 0;
      top: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: center;
      filter: var(--photo-filter);
      opacity: 0;
      pointer-events: none;
    }

    .photo-slot.has-slot-preview .photo-lut-preview {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }

    .photo-slot.has-lut-preview .photo-lut-preview {
      opacity: 1;
    }

    .photo-slot.has-lut-preview .photo-image {
      opacity: 0;
    }

    .polaroid-card.show-original .photo-lut-preview {
      opacity: 0 !important;
    }

    .photo-slot.is-dragging {
      cursor: grabbing;
    }

    .template-frame:has(.photo-slot.is-dragging) {
      cursor: grabbing;
    }

    .photo-transition {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      z-index: 2;
      display: block;
      opacity: 0;
      pointer-events: none;
      background-image: var(--photo-next-url);
      background-position: var(--photo-x) var(--photo-y);
      background-size: var(--photo-bg-size, cover);
      background-repeat: no-repeat;
      filter: var(--photo-next-filter, var(--photo-filter));
      transition: opacity .28s ease;
      will-change: opacity, filter;
    }

    .photo-slot.is-filter-ready .photo-transition {
      opacity: 1;
    }

    .photo-loading {
      position: absolute;
      left: 50%;
      bottom: 14px;
      z-index: 4;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 30px;
      padding: 0 12px;
      border: 1px solid rgba(255, 255, 255, .22);
      border-radius: 999px;
      color: #fff;
      background: rgba(9, 10, 18, .56);
      box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
      font-size: 11px;
      font-weight: 780;
      opacity: 0;
      transform: translate(-50%, 8px);
      pointer-events: none;
      backdrop-filter: blur(10px);
      transition: opacity .18s ease, transform .18s ease;
    }

    .photo-loading::before {
      content: "";
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--accent-strong);
      box-shadow: 0 0 0 0 rgba(255, 222, 181, .45);
      animation: filterPulse .9s ease-in-out infinite;
    }

    .photo-slot.is-filter-loading .photo-loading {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    @keyframes filterPulse {

      0%,
      100% {
        transform: scale(.82);
        box-shadow: 0 0 0 0 rgba(255, 222, 181, .38);
      }

      50% {
        transform: scale(1);
        box-shadow: 0 0 0 7px rgba(255, 222, 181, 0);
      }
    }

    .photo-slot::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 3;
      pointer-events: none;
      opacity: var(--grain-opacity, .1);
      background-image: var(--grain-texture);
      background-position: center;
      background-size: 300px 300px;
      mix-blend-mode: soft-light;
    }



    .caption {
      position: absolute;
      left: 38px;
      right: 38px;
      bottom: 24px;
      z-index: 3;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--caption-color);
      font-family: var(--caption-font-family);
      font-size: var(--caption-font-size, 18px);
      font-style: var(--caption-font-style);
      line-height: 1.1;
      text-align: center;
      cursor: move;
      user-select: none;
      touch-action: none;
      border: 1px dashed transparent;
      border-radius: 4px;
      padding: 2px 4px;
      transition: border-color 0.2s, background-color 0.2s;
    }

    .caption:hover,
    .caption.is-dragging {
      border-color: rgba(0, 0, 0, 0.28);
      background-color: rgba(255, 255, 255, 0.18);
    }

    .frame-overlay {
      position: absolute;
      inset: 0;
      z-index: 2;
      display: none;
      border-radius: inherit;
      pointer-events: none;
      background-image: var(--frame-overlay-url);
      background-position: var(--frame-overlay-position);
      background-size: var(--frame-overlay-size);
      background-repeat: no-repeat;
    }

    .has-frame-overlay .frame-overlay {
      display: block;
    }

    .template-scrim {
      position: absolute;
      inset: 0;
      z-index: 7;
      display: none;
      border-radius: inherit;
      pointer-events: none;
      background: var(--template-scrim-color, #000);
      opacity: var(--template-scrim-opacity, 0);
    }

    .template-frame .template-scrim {
      display: block;
    }

    .template-layer-stack {
      position: absolute;
      inset: 0;
      z-index: 8;
      display: none;
      overflow: hidden;
      border-radius: inherit;
      pointer-events: none;
    }

    .template-frame .template-layer-stack {
      display: block;
    }

    .template-layer {
      position: absolute;
      box-sizing: border-box;
      pointer-events: none;
      transform-origin: center center;
    }

    .template-layer-image {
      background-position: center;
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }

    .template-layer-text {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--template-layer-color, #fff);
      font-family: var(--template-layer-font, Inter, Arial, sans-serif);
      font-size: var(--template-layer-font-size, 16px);
      font-weight: var(--template-layer-font-weight, 700);
      font-style: var(--template-layer-font-style, normal);
      line-height: var(--template-layer-line-height, 1);
      letter-spacing: var(--template-layer-letter-spacing, 0);
      text-align: center;
      white-space: pre;
      text-transform: var(--template-layer-transform, none);
    }


    .variant-frame {
      width: min(clamp(320px, 52vw, 720px), calc(var(--stage-preview-height) * var(--variant-frame-width-factor)));
      height: auto;
      aspect-ratio: var(--variant-frame-ratio);
      padding: 0;
      overflow: hidden;
      --frame-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25),
        0 8px 40px rgba(255, 255, 255, 0.12),
        0 4px 30px rgba(0, 0, 0, .4),
        0 1px 1px rgba(255, 255, 255, .15) inset;
    }

    .variant-frame .photo-slot {
      position: absolute;
      left: var(--photo-box-x);
      top: var(--photo-box-y);
      width: var(--photo-box-w);
      height: var(--photo-box-h);
      max-width: none;
      max-height: none;
      aspect-ratio: auto;
    }


    .ratio-portrait {
      --photo-ratio: 4 / 5;
      --card-width: min(clamp(300px, 32vw, 560px), calc(var(--stage-preview-height) * .75));
    }

    .ratio-portrait:not(.variant-frame) .photo-slot {
      width: 82%;
      max-height: none;
      aspect-ratio: 4 / 5;
    }

    .ratio-portrait:not(.variant-frame) .caption {
      bottom: 22px;
    }


    .ratio-story {
      --photo-ratio: 9 / 16;
      --card-width: min(clamp(280px, 30vw, 500px), calc(var(--stage-preview-height) * .5625));
      --bottom-padding: clamp(72px, calc(var(--card-width) * .22), 110px);
    }

    .ratio-story:not(.variant-frame) .photo-slot {
      width: 82%;
      max-height: none;
      aspect-ratio: 9 / 16;
    }

    .frame-paper {
      --frame-color: #efe3ce;
      --frame-glaze: linear-gradient(135deg, rgba(255, 248, 235, .38), rgba(221, 196, 160, .12));
      --frame-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 40px rgba(255, 255, 255, 0.03),
        34px 48px 52px rgba(48, 33, 16, .22),
        12px 18px 20px rgba(48, 33, 16, .13),
        0 1px 1px rgba(255, 255, 255, .55) inset;
    }

    .frame-black {
      --frame-color: #161616;
      --frame-glaze: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .01));
      color: #fff;
      --frame-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25),
        0 8px 40px rgba(255, 255, 255, 0.12),
        34px 48px 56px rgba(0, 0, 0, .4),
        12px 18px 22px rgba(0, 0, 0, .25),
        0 1px 1px rgba(255, 255, 255, .15) inset;
    }

    .frame-black .caption {
      color: #f5f5f2;
    }

    .frame-strip {
      --frame-color: #111318;
      --frame-glaze: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .01));
      --frame-padding: clamp(44px, calc(var(--card-width) * .136), 68px);
      --bottom-padding: clamp(88px, calc(var(--card-width) * .272), 136px);
      --frame-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25),
        0 8px 40px rgba(255, 255, 255, 0.12),
        0 4px 30px rgba(0, 0, 0, .4),
        0 1px 1px rgba(255, 255, 255, .15) inset;
    }

    .frame-strip .caption {
      color: #f5f5f2;
    }

    .frame-strip .photo-slot {
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
    }

    .frame-strip.ratio-story {
      --bottom-padding: clamp(72px, calc(var(--card-width) * .22), 110px);
    }

    .ratio-landscape {
      --photo-ratio: 3 / 2;
    }

    .ratio-landscape:not(.variant-frame) .photo-slot {
      width: 100%;
      max-height: none;
      aspect-ratio: 3 / 2;
    }

    .ratio-wide {
      --photo-ratio: 16 / 9;
      --bottom-padding: clamp(72px, calc(var(--card-width) * .22), 110px);
    }

    .preview-wrap.preview-wide .polaroid-card,
    .polaroid-card.ratio-wide:not(.variant-frame) {
      width: 100%;
      height: auto;
    }

    .polaroid-card.ratio-wide:not(.variant-frame) {
      display: block;
    }

    .ratio-wide:not(.variant-frame) .photo-slot {
      width: 100%;
      max-height: none;
      aspect-ratio: 16 / 9;
    }

    .frame-strip.ratio-wide {
      --bottom-padding: clamp(72px, calc(var(--card-width) * .22), 110px);
    }

    .frame-strip::before {
      opacity: 1;
      background:
        repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 255, 255, .94) 18px 28px, transparent 28px 46px) left 23px top 34px / 14px calc(100% - 68px) no-repeat,
        repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 255, 255, .94) 18px 28px, transparent 28px 46px) right 23px top 34px / 14px calc(100% - 68px) no-repeat;
      mix-blend-mode: normal;
    }

    .panel {
      width: 100%;
      height: 100%;
      max-height: 100%;
      min-width: 0;
      min-height: 0;
      align-self: stretch;
      overflow-y: auto;
      overscroll-behavior: contain;
      background: rgba(16, 17, 38, .68);
      border-left: 1px solid rgba(217, 208, 189, .14);
      box-shadow: -18px 0 60px rgba(0, 0, 0, .16);
      backdrop-filter: blur(18px);
      scrollbar-width: thin;
      scrollbar-color: rgba(217, 208, 189, .32) transparent;
    }

    .panel::-webkit-scrollbar {
      width: 8px;
    }

    .panel::-webkit-scrollbar-track {
      background: transparent;
    }

    .panel::-webkit-scrollbar-thumb {
      border: 2px solid transparent;
      border-radius: 999px;
      background: rgba(217, 208, 189, .34);
      background-clip: content-box;
    }

    .panel-inner {
      width: 100%;
      max-width: 384px;
      margin: 0 auto;
      padding: 22px 18px 24px;
    }

    .control-section {
      padding: 0;
      margin: 0 0 15px;
      border-bottom: 0;
    }

    .control-section:last-child {
      border-bottom: 0;
      margin-bottom: 0;
      padding-bottom: 0;
    }

    .section-title {
      margin: 0 0 13px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 820;
      letter-spacing: 0;
      text-transform: uppercase;
      text-align: left;
    }

    /* Panel mode switch + AI Effect Phase 1 */
    .panel-mode-tabs {
      position: sticky;
      top: 0;
      z-index: 34;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      margin: -4px 0 18px;
      padding: 6px;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 6px;
      background: rgba(16, 17, 38, .94);
      box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
      backdrop-filter: blur(18px);
    }

    .panel-mode-tab {
      min-width: 0;
      min-height: 42px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 8px 10px;
      border: 1px solid transparent;
      border-radius: 4px;
      background: transparent;
      color: rgba(217, 208, 189, .58);
      font: inherit;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
      transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
    }

    .panel-mode-tab:hover {
      color: var(--paper);
      border-color: rgba(217, 208, 189, .2);
      background: rgba(217, 208, 189, .08);
    }

    .panel-mode-tab.is-active {
      color: #17182f;
      border-color: var(--paper);
      background: var(--paper);
      box-shadow: 0 5px 16px rgba(0, 0, 0, .2);
    }

    .panel-mode-tab .lucide,
    .panel-mode-tab svg {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
    }

    .panel-mode-tab small {
      padding: 2px 5px;
      border-radius: 999px;
      background: #ffd65a;
      color: #4b3500;
      font-size: 8px;
      font-weight: 900;
      letter-spacing: .05em;
      line-height: 1.25;
    }

    .panel-inner.is-ai-effect-mode > [data-panel-view="edit"] {
      display: none !important;
    }

    .panel-inner:not(.is-ai-effect-mode) > [data-panel-view="ai-effect"] {
      display: none !important;
    }

    .ai-effect-panel {
      min-height: 460px;
    }

    .ai-effect-heading {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .ai-effect-heading h2 {
      margin: 5px 0 5px;
      color: var(--paper);
      font-size: 17px;
      font-weight: 850;
      line-height: 1.25;
    }

    .ai-effect-heading p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }

    .ai-effect-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: #ffd65a;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .ai-effect-eyebrow .lucide,
    .ai-effect-eyebrow svg {
      width: 13px;
      height: 13px;
    }

    .ai-effect-beta-badge {
      flex: 0 0 auto;
      padding: 4px 7px;
      border: 1px solid rgba(255, 214, 90, .38);
      border-radius: 999px;
      background: rgba(255, 214, 90, .1);
      color: #ffd65a;
      font-size: 9px;
      font-weight: 900;
      letter-spacing: .08em;
    }

    .ai-effect-access {
      position: relative;
    }

    .ai-effect-lock,
    .ai-effect-admin-note {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 14px;
      padding: 11px 12px;
      border: 1px solid rgba(255, 214, 90, .28);
      border-radius: 6px;
      background: rgba(255, 214, 90, .07);
      color: var(--paper);
    }

    .ai-effect-admin-note {
      align-items: center;
      border-color: rgba(93, 225, 164, .3);
      background: rgba(93, 225, 164, .08);
      color: #c9ffe5;
      font-size: 10px;
      line-height: 1.45;
    }

    .ai-effect-admin-note .lucide,
    .ai-effect-admin-note svg {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
      color: #69e2a9;
    }

    .ai-effect-lock-icon {
      width: 30px;
      height: 30px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      border-radius: 50%;
      background: rgba(255, 214, 90, .13);
      color: #ffd65a;
    }

    .ai-effect-lock-icon .lucide,
    .ai-effect-lock-icon svg {
      width: 15px;
      height: 15px;
    }

    .ai-effect-lock strong {
      display: block;
      margin-bottom: 3px;
      font-size: 11px;
      line-height: 1.35;
    }

    .ai-effect-lock p {
      margin: 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }

    .ai-effect-access:not(.is-locked) .ai-effect-lock {
      display: none;
    }

    .ai-effect-access.is-locked .ai-effect-form {
      opacity: .46;
      filter: grayscale(.18);
      pointer-events: none;
      user-select: none;
    }

    .ai-effect-form {
      min-width: 0;
      margin: 0;
      padding: 0;
      border: 0;
      transition: opacity .2s ease, filter .2s ease;
    }

    .ai-effect-form .screen-reader-text {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip: rect(0, 0, 0, 0) !important;
      white-space: nowrap !important;
      border: 0 !important;
    }

    .ai-effect-card-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      margin-bottom: 15px;
    }

    .ai-effect-card {
      min-width: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 5px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 5px;
      background: rgba(255, 255, 255, .035);
      color: var(--paper);
      font: inherit;
      text-align: left;
      cursor: pointer;
      transition: border-color .2s ease, background .2s ease, transform .2s ease;
    }

    .ai-effect-card:hover {
      border-color: rgba(217, 208, 189, .42);
      background: rgba(255, 255, 255, .07);
      transform: translateY(-1px);
    }

    .ai-effect-card.is-active {
      border-color: var(--paper);
      background: rgba(217, 208, 189, .1);
      box-shadow: 0 0 0 1px rgba(217, 208, 189, .08);
    }

    .ai-effect-card.is-locked {
      position: relative;
      opacity: .5;
      cursor: not-allowed;
      filter: grayscale(.35);
    }

    .ai-effect-card.is-locked:hover {
      border-color: rgba(217, 208, 189, .16);
      background: rgba(255, 255, 255, .035);
      transform: none;
    }

    .ai-effect-card.is-locked::after {
      content: "Khóa";
      position: absolute;
      top: 9px;
      right: 9px;
      z-index: 2;
      padding: 3px 6px;
      border: 1px solid rgba(255, 255, 255, .24);
      border-radius: 999px;
      background: rgba(13, 15, 35, .82);
      color: #fff;
      font-size: 8px;
      font-weight: 800;
      line-height: 1;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .ai-effect-thumbnail {
      position: relative;
      width: 100%;
      aspect-ratio: 4 / 3;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 3px;
      isolation: isolate;
    }

    .ai-effect-thumbnail::before,
    .ai-effect-thumbnail::after {
      content: "";
      position: absolute;
      z-index: -1;
      pointer-events: none;
    }

    .ai-effect-thumbnail.is-lighting {
      background: linear-gradient(145deg, #162b3b 0%, #315e4b 48%, #d2a24a 100%);
    }

    .ai-effect-thumbnail.is-lighting::before {
      width: 150%;
      height: 42%;
      top: 2%;
      left: -26%;
      transform: rotate(-22deg);
      background: linear-gradient(90deg, transparent, rgba(255, 240, 176, .85), transparent);
      filter: blur(7px);
    }

    .ai-effect-thumbnail.is-weather {
      background: linear-gradient(145deg, #9bc8dc 0 46%, #f0c7d3 47% 63%, #74a65d 64% 100%);
    }

    .ai-effect-thumbnail.is-weather::before {
      width: 42px;
      height: 15px;
      top: 14px;
      left: 9px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .7);
      box-shadow: 15px -6px 0 rgba(255, 255, 255, .58);
    }

    .ai-effect-thumbnail.is-background {
      background: linear-gradient(#65a8cf 0 52%, #2f806c 53% 70%, #d9b86e 71% 100%);
    }

    .ai-effect-thumbnail.is-background::before {
      width: 95px;
      height: 55px;
      right: -32px;
      bottom: -25px;
      border-radius: 50% 50% 0 0;
      background: #1f5f51;
      transform: rotate(-7deg);
    }

    .ai-effect-thumbnail .lucide,
    .ai-effect-thumbnail svg {
      width: 25px;
      height: 25px;
      color: rgba(255, 255, 255, .92);
      filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .36));
    }

    .ai-effect-card-copy {
      min-width: 0;
      display: block;
      padding: 7px 3px 4px;
    }

    .ai-effect-card-copy strong,
    .ai-effect-card-copy small {
      display: block;
    }

    .ai-effect-card-copy strong {
      margin-bottom: 3px;
      font-size: 10px;
      line-height: 1.2;
    }

    .ai-effect-card-copy small {
      color: var(--muted);
      font-size: 8px;
      line-height: 1.35;
    }

    .ai-effect-config[hidden],
    .ai-effect-admin-note[hidden] {
      display: none !important;
    }

    .ai-effect-config {
      margin-top: 2px;
      padding: 14px 4px 0 4px;
      border-top: 1px solid rgba(217, 208, 189, .13);
    }

    .ai-effect-config h3 {
      margin: 0 0 9px 3px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .ai-effect-preset-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .ai-effect-preset {
      position: relative;
      min-height: 34px;
      padding: 7px 8px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 4px;
      background: rgba(255, 255, 255, .035);
      color: rgba(217, 208, 189, .72);
      font: inherit;
      font-size: 9px;
      font-weight: 720;
      line-height: 1.25;
      cursor: pointer;
    }

    .ai-effect-preset:hover,
    .ai-effect-preset.is-active {
      border-color: var(--paper);
      background: var(--paper);
      color: #17182f;
    }

    .ai-effect-preset.is-locked {
      padding-right: 47px;
      opacity: .48;
      cursor: not-allowed;
      filter: grayscale(.35);
    }

    .ai-effect-preset.is-locked:hover {
      border-color: rgba(217, 208, 189, .16);
      background: rgba(255, 255, 255, .035);
      color: rgba(217, 208, 189, .72);
    }

    .ai-effect-preset.is-locked::after {
      content: "Admin";
      position: absolute;
      top: 50%;
      right: 6px;
      transform: translateY(-50%);
      padding: 3px 5px;
      border: 1px solid rgba(255, 255, 255, .22);
      border-radius: 999px;
      background: rgba(13, 15, 35, .82);
      color: #fff;
      font-size: 7px;
      font-weight: 850;
      line-height: 1;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .ai-effect-preset-title {
      display: inline-block;
      color: inherit !important;
      pointer-events: none;
    }

    .ai-effect-preset:hover .ai-effect-preset-title,
    .ai-effect-preset.is-active .ai-effect-preset-title {
      color: inherit !important;
    }

    /* Popover Tooltip Preview for Preset Demo */
    .ai-effect-popover {
      position: absolute;
      bottom: calc(100% + 9px);
      left: 50%;
      transform: translateX(-50%) translateY(4px) scale(0.95);
      width: 132px;
      padding: 5px;
      border: 1px solid rgba(255, 214, 90, .35);
      border-radius: 7px;
      background: #17182f;
      box-shadow: 0 12px 28px -4px rgba(0, 0, 0, .75), 0 0 16px rgba(255, 214, 90, .14);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity .2s cubic-bezier(.16, 1, .3, 1), transform .2s cubic-bezier(.16, 1, .3, 1), visibility .2s;
      z-index: 100;
      cursor: default;
    }

    .ai-effect-popover::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border-width: 6px 6px 0 6px;
      border-style: solid;
      border-color: #17182f transparent transparent transparent;
    }

    .ai-effect-popover::before {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border-width: 7px 7px 0 7px;
      border-style: solid;
      border-color: rgba(255, 214, 90, .35) transparent transparent transparent;
    }

    .ai-effect-popover-image {
      display: block;
      width: 100%;
      border-radius: 4px;
      overflow: hidden;
      background: rgba(0, 0, 0, .2);
    }

    .ai-effect-popover-image img {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 3 / 4;
      object-fit: cover;
      border-radius: 4px;
    }

    .ai-effect-popover-badge {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      margin-top: 4px;
      color: #ffd54f;
      font-size: 8px;
      font-weight: 800;
      letter-spacing: .03em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .ai-effect-popover-badge .lucide,
    .ai-effect-popover-badge svg {
      width: 10px;
      height: 10px;
      color: #ffd54f;
    }

    .ai-effect-preset:hover .ai-effect-popover,
    .ai-effect-preset:focus-visible .ai-effect-popover {
      opacity: 1;
      visibility: visible;
      transform: translateX(-50%) translateY(0) scale(1);
    }

    .ai-effect-fit-tip {
      margin: 8px 0 0;
      padding: 8px 9px;
      border: 1px solid rgba(255, 213, 79, .24);
      border-radius: 4px;
      background: rgba(255, 213, 79, .07);
      color: rgba(217, 208, 189, .8);
      font-size: 9px;
      line-height: 1.45;
    }

    .ai-effect-fit-tip strong {
      color: #ffd54f;
      font-weight: 850;
    }

    .ai-effect-intensity-tip {
      margin: 8px 0 0;
      padding: 7px 9px;
      border: 1px solid rgba(255, 213, 79, .18);
      border-radius: 4px;
      background: rgba(255, 213, 79, .05);
      color: rgba(217, 208, 189, .78);
      font-size: 8.5px;
      line-height: 1.4;
      display: flex;
      align-items: flex-start;
      gap: 6px;
    }

    .ai-effect-intensity-tip svg,
    .ai-effect-intensity-tip i {
      width: 12px;
      height: 12px;
      flex-shrink: 0;
      margin-top: 1px;
      color: #ffd54f;
    }

    .ai-effect-intensity-tip strong {
      color: #ffd54f;
      font-weight: 800;
    }

    .ai-effect-intensity-tip[hidden] {
      display: none !important;
    }

    .ai-effect-field-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }

    .ai-effect-window-pattern-field,
    .ai-effect-lens-flare-field {
      grid-column: 1 / -1;
    }

    .ai-effect-window-pattern-field[hidden],
    .ai-effect-lens-flare-field[hidden] {
      display: none !important;
    }

    .ai-effect-field-row label,
    .ai-effect-custom-label {
      display: flex;
      flex-direction: column;
      gap: 5px;
      color: var(--muted);
      font-size: 9px;
      font-weight: 800;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .ai-effect-field-label,
    .ai-effect-custom-label {
      padding-left: 3px;
    }

    .ai-effect-field-row select,
    #ai-background-prompt {
      width: 100%;
      min-width: 0;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 4px;
      outline: 0;
      background: rgba(0, 0, 0, .18);
      color: var(--paper);
      font: inherit;
      font-size: 10px;
      text-transform: none;
    }

    .ai-effect-field-row select {
      height: 34px;
      padding: 0 8px;
    }

    .ai-effect-field-row select option {
      color: #f0f0f5;
      background: #17182f;
      padding: 6px 10px;
    }

    .ai-effect-field-row select option:disabled {
      color: #636681;
    }

    .ai-effect-field-row select:disabled {
      opacity: 0.9;
      cursor: default;
      color: var(--paper);
    }

    .ai-effect-field-row select:focus,
    #ai-background-prompt:focus {
      border-color: #ffd65a;
      box-shadow: 0 0 0 2px rgba(255, 214, 90, .1);
    }

    .ai-effect-helper {
      margin: 9px 0 0;
      color: var(--muted);
      font-size: 9px;
      line-height: 1.45;
    }

    .ai-effect-custom-label {
      margin-top: 11px;
    }

    #ai-background-prompt {
      min-height: 68px;
      margin-top: 6px;
      padding: 9px 10px;
      resize: vertical;
      line-height: 1.45;
    }

    #ai-background-prompt::placeholder {
      color: rgba(217, 208, 189, .42);
    }

    .ai-effect-character-count {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 8px;
      text-align: right;
    }

    .ai-effect-generate {
      width: 100%;
      min-height: 42px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      margin-top: 14px;
      padding: 9px 12px;
      border: 1px solid #ffd65a;
      border-radius: 5px;
      background: #ffd65a;
      color: #2e2509;
      font: inherit;
      font-size: 11px;
      font-weight: 850;
      cursor: pointer;
      box-shadow: 0 8px 20px rgba(255, 196, 45, .15);
    }

    .ai-effect-resolution-note {
      display: flex;
      align-items: flex-start;
      gap: 7px;
      margin-top: 10px;
      padding: 8px 9px;
      border: 1px solid rgba(255, 171, 64, .3);
      border-radius: 5px;
      background: rgba(255, 145, 48, .09);
      color: #ffd9ae;
      font-size: 9px;
      line-height: 1.45;
    }

    .ai-effect-resolution-note[hidden] {
      display: none !important;
    }

    .ai-effect-resolution-note svg {
      width: 15px;
      height: 15px;
      flex: 0 0 auto;
      color: #ffb45d;
    }

    .ai-effect-resolution-note strong {
      color: #ffc77f;
    }

    .ai-effect-generate:hover {
      background: #ffe17d;
      transform: translateY(-1px);
    }

    .ai-effect-generate:disabled {
      border-color: rgba(217, 208, 189, .2);
      background: rgba(217, 208, 189, .12);
      color: rgba(217, 208, 189, .48);
      box-shadow: none;
      cursor: not-allowed;
      transform: none;
    }

    .ai-effect-generate .lucide,
    .ai-effect-generate svg {
      width: 16px;
      height: 16px;
    }

    .ai-effect-generate small {
      margin-left: auto;
      padding-left: 8px;
      font-size: 8px;
      font-weight: 800;
      opacity: .72;
    }

    .ai-effect-status {
      min-height: 14px;
      margin: 7px 0 0;
      color: #69e2a9;
      font-size: 9px;
      line-height: 1.4;
      text-align: center;
    }

    .ai-effect-generate.is-loading svg {
      animation: ai-effect-spin 1.1s linear infinite;
    }

    @keyframes ai-effect-spin {
      to { transform: rotate(360deg); }
    }

    .ai-effect-result-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: 9px;
    }

    .ai-effect-result-actions[hidden] {
      display: none !important;
    }

    .ai-effect-restore,
    .ai-effect-feedback button {
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 4px;
      background: rgba(255, 255, 255, .04);
      color: var(--paper);
      font: inherit;
      cursor: pointer;
    }

    .ai-effect-restore {
      min-height: 31px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 9px;
      font-size: 9px;
      font-weight: 750;
    }

    .ai-effect-restore svg {
      width: 13px;
      height: 13px;
    }

    .ai-effect-feedback {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: var(--muted);
      font-size: 8px;
    }

    .ai-effect-feedback button {
      width: 29px;
      height: 29px;
      padding: 0;
      line-height: 1;
    }

    .ai-effect-restore:hover,
    .ai-effect-feedback button:hover,
    .ai-effect-feedback button.is-active {
      border-color: #ffd65a;
      background: rgba(255, 214, 90, .12);
    }

    .ai-effect-status.is-error {
      color: #ff8f8f;
    }

    .ai-effect-status.is-warning {
      color: #ffd166;
    }

    html[data-theme="light"] .ai-effect-restore,
    html[data-theme="light"] .ai-effect-feedback button {
      border-color: #c8cad4;
      background: #ffffff;
      color: #292c43;
    }

    html[data-theme="light"] .panel-mode-tabs {
      border-color: rgba(29, 31, 55, .13);
      background: rgba(247, 245, 239, .96);
      box-shadow: 0 8px 24px rgba(35, 37, 57, .09);
    }

    html[data-theme="light"] .panel-mode-tab {
      border-color: rgba(29, 31, 55, .16);
      background: #ffffff;
      color: #3d4057;
      box-shadow: 0 2px 7px rgba(35, 37, 57, .06);
    }

    html[data-theme="light"] .panel-mode-tab > span,
    html[data-theme="light"] .panel-mode-tab > i,
    html[data-theme="light"] .panel-mode-tab > svg {
      color: inherit !important;
      stroke: currentColor;
    }

    html[data-theme="light"] .panel-mode-tab:hover {
      color: #17192d;
      border-color: rgba(29, 31, 55, .34);
      background: #f1f2f6;
    }

    html[data-theme="light"] .panel-mode-tab.is-active {
      color: #ffffff !important;
      border-color: #22243f;
      background: #22243f;
      box-shadow: 0 6px 15px rgba(34, 36, 63, .24);
    }

    html[data-theme="light"] .panel-mode-tab.is-active > span,
    html[data-theme="light"] .panel-mode-tab.is-active > i,
    html[data-theme="light"] .panel-mode-tab.is-active > svg {
      color: #ffffff !important;
      stroke: #ffffff !important;
    }

    html[data-theme="light"] .panel-mode-tab small {
      color: #4b3500 !important;
    }

    html[data-theme="light"] .ai-effect-heading h2,
    html[data-theme="light"] .ai-effect-card,
    html[data-theme="light"] .ai-effect-lock {
      color: #1d1f37;
    }

    html[data-theme="light"] .ai-effect-card,
    html[data-theme="light"] .ai-effect-preset {
      border-color: rgba(29, 31, 55, .2);
      background: #ffffff;
      color: #292c43 !important;
      box-shadow: 0 2px 7px rgba(35, 37, 57, .05);
    }

    html[data-theme="light"] .ai-effect-card.is-active {
      border-color: #22243f;
      background: #eef0f6;
      box-shadow: 0 0 0 1px rgba(34, 36, 63, .08), 0 4px 10px rgba(35, 37, 57, .08);
    }

    html[data-theme="light"] .ai-effect-card-copy strong {
      color: #1d1f37 !important;
    }

    html[data-theme="light"] .ai-effect-card-copy small {
      color: #62657a !important;
    }

    html[data-theme="light"] .ai-effect-preset .ai-effect-preset-title {
      color: #292c43 !important;
    }

    html[data-theme="light"] .ai-effect-preset:hover,
    html[data-theme="light"] .ai-effect-preset.is-active {
      border-color: #22243f;
      background: #22243f;
      color: #ffffff !important;
      box-shadow: 0 4px 10px rgba(34, 36, 63, .18);
    }

    html[data-theme="light"] .ai-effect-preset:hover .ai-effect-preset-title,
    html[data-theme="light"] .ai-effect-preset.is-active .ai-effect-preset-title {
      color: #ffffff !important;
    }

    html[data-theme="light"] .ai-effect-preset.is-locked,
    html[data-theme="light"] .ai-effect-preset.is-locked:hover {
      border-color: rgba(29, 31, 55, .2);
      background: #ffffff;
      color: #62657a !important;
      box-shadow: 0 2px 7px rgba(35, 37, 57, .05);
    }

    html[data-theme="light"] .ai-effect-preset.is-locked .ai-effect-preset-title,
    html[data-theme="light"] .ai-effect-preset.is-locked:hover .ai-effect-preset-title {
      color: #62657a !important;
    }

    html[data-theme="light"] .ai-effect-popover {
      background: #ffffff;
      border-color: rgba(217, 119, 6, .35);
      box-shadow: 0 12px 28px -4px rgba(0, 0, 0, .18), 0 0 14px rgba(217, 119, 6, .12);
    }

    html[data-theme="light"] .ai-effect-popover::after {
      border-color: #ffffff transparent transparent transparent;
    }

    html[data-theme="light"] .ai-effect-popover::before {
      border-color: rgba(217, 119, 6, .35) transparent transparent transparent;
    }

    html[data-theme="light"] .ai-effect-popover-badge {
      color: #b45309;
    }

    html[data-theme="light"] .ai-effect-fit-tip {
      border-color: rgba(151, 105, 0, .22);
      background: #fff8df;
      color: #5d5134;
    }

    html[data-theme="light"] .ai-effect-fit-tip strong {
      color: #805900;
    }

    html[data-theme="light"] .ai-effect-intensity-tip {
      border-color: rgba(166, 85, 0, .20);
      background: #fff8ee;
      color: #68461f;
    }

    html[data-theme="light"] .ai-effect-intensity-tip strong,
    html[data-theme="light"] .ai-effect-intensity-tip svg {
      color: #8a4b00;
    }

    html[data-theme="light"] .ai-effect-resolution-note {
      border-color: rgba(166, 85, 0, .24);
      background: #fff3e3;
      color: #68461f;
    }

    html[data-theme="light"] .ai-effect-resolution-note strong,
    html[data-theme="light"] .ai-effect-resolution-note svg {
      color: #8a4b00;
    }

    html[data-theme="light"] .ai-effect-field-row select,
    html[data-theme="light"] #ai-background-prompt {
      border-color: #c8cad4;
      background: #ffffff;
      color: #1d1f37;
    }

    html[data-theme="light"] .ai-effect-field-row select option {
      color: #1d1f37;
      background: #ffffff;
    }

    html[data-theme="light"] .ai-effect-field-row select option:disabled {
      color: #a0a3b5;
    }

    html[data-theme="light"] #ai-background-prompt::placeholder {
      color: #777a8d !important;
      opacity: 1;
    }

    html[data-theme="light"] #ai-background-prompt:hover {
      border-color: #999cab;
    }

    html[data-theme="light"] #ai-background-prompt:focus {
      border-color: #55596f;
      box-shadow: 0 0 0 3px rgba(34, 36, 63, .1);
    }

    html[data-theme="light"] .ai-effect-custom-label,
    html[data-theme="light"] .ai-effect-character-count,
    html[data-theme="light"] .ai-effect-character-count span {
      color: #45485c !important;
    }

    html[data-theme="light"] .ai-effect-lock {
      background: rgba(205, 154, 20, .08);
    }

    html[data-theme="light"] .ai-effect-eyebrow,
    html[data-theme="light"] .ai-effect-beta-badge,
    html[data-theme="light"] .ai-effect-lock-icon {
      color: #8a6500 !important;
    }

    html[data-theme="light"] .ai-effect-admin-note {
      color: #176344;
      background: rgba(41, 157, 104, .08);
    }

    html[data-theme="light"] .ai-effect-admin-note span,
    html[data-theme="light"] .ai-effect-admin-note strong {
      color: #176344 !important;
    }

    html[data-theme="light"] .ai-effect-generate > span,
    html[data-theme="light"] .ai-effect-generate > small,
    html[data-theme="light"] .ai-effect-generate > i,
    html[data-theme="light"] .ai-effect-generate > svg {
      color: #2e2509 !important;
      stroke: currentColor;
    }

    html[data-theme="light"] .ai-effect-generate:disabled,
    html[data-theme="light"] .ai-effect-generate:disabled > span,
    html[data-theme="light"] .ai-effect-generate:disabled > small,
    html[data-theme="light"] .ai-effect-generate:disabled > i,
    html[data-theme="light"] .ai-effect-generate:disabled > svg {
      color: #747789 !important;
      border-color: #d2d4dc;
      background: #e7e8ed;
      stroke: currentColor;
    }

    .ratio-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 6px;
      padding: 6px;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 3px;
      background: rgba(0, 0, 0, .12);
    }

    #section-ratio.is-ratio-locked .ratio-grid {
      opacity: .42;
      filter: grayscale(.22);
    }

    #section-ratio.is-ratio-locked .option-card {
      cursor: not-allowed;
      pointer-events: none;
    }

    #section-ratio.is-ratio-locked .option-card.is-active {
      opacity: 1;
      color: var(--paper);
      background: rgba(217, 208, 189, .16);
      box-shadow: inset 0 0 0 1px rgba(217, 208, 189, .26);
    }

    .frame-group-tabs {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: max-content;
      gap: 6px;
      overflow-x: auto;
      margin-bottom: 7px;
      padding-bottom: 2px;
      scrollbar-width: none;
      -ms-overflow-style: none;
      cursor: grab;
      user-select: none;
    }

    .frame-group-tabs::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
    }

    .frame-group-tab {
      min-height: 30px;
      padding: 0 10px;
      border-radius: 2px;
      color: var(--muted);
      background: rgba(255, 255, 255, .04);
      border: 1px solid rgba(217, 208, 189, .16);
      font-size: 10px;
      font-weight: 820;
      line-height: 1;
      white-space: nowrap;
    }

    .color-preset-btn {
      transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .color-preset-btn:hover {
      transform: scale(1.15);
    }

    .color-preset-btn.is-active {
      border-color: #ffffff !important;
      transform: scale(1.2);
      box-shadow: 0 0 12px rgba(255, 255, 255, 0.6) !important;
    }

    .frame-group-tab.is-active {
      color: #2d2e5e;
      background: var(--paper);
      border-color: var(--paper);
    }

    .ai-color-assist {
      margin: 7px 0 7px;
      padding: 7px;
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 4px;
      background: rgba(0, 0, 0, .14);
    }

    .ai-color-top {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .ai-color-button {
      min-height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 0 10px;
      border: 1px solid rgba(217, 208, 189, .26);
      border-radius: 3px;
      background: rgba(217, 208, 189, .12);
      color: var(--paper);
      font-size: 11px;
      font-weight: 820;
      white-space: nowrap;
    }

    .ai-color-button svg,
    .ai-color-button i {
      width: 15px;
      height: 15px;
      flex: 0 0 auto;
      color: #f6d365;
    }

    .ai-color-button em {
      min-height: 16px;
      display: inline-flex;
      align-items: center;
      padding: 1px 5px;
      border-radius: 999px;
      background: #38bdf8;
      color: #08111f;
      font-size: 8px;
      font-style: normal;
      font-weight: 900;
      line-height: 1;
      text-transform: uppercase;
    }

    .ai-color-button:disabled {
      opacity: .46;
      cursor: not-allowed;
    }

    .ai-color-assist:not(.is-locked) .ai-color-button {
      border-color: rgba(246, 211, 101, .52);
      background: rgba(246, 211, 101, .12);
    }

    .ai-color-hint {
      min-width: 0;
      color: rgba(217, 208, 189, .7);
      font-size: 10px;
      font-weight: 720;
      line-height: 1.25;
    }

    .ai-color-panel {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(217, 208, 189, .14);
    }

    .ai-color-panel-title {
      margin: 0 0 7px;
      color: rgba(245, 245, 242, .92);
      font-size: 11px;
      font-weight: 820;
      line-height: 1.25;
    }

    .ai-color-mode-options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin-bottom: 8px;
    }

    .ai-color-mode-option {
      min-height: 34px;
      padding: 0 8px;
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 4px;
      background: rgba(255, 255, 255, .045);
      color: rgba(245, 245, 242, .78);
      font-size: 10px;
      font-weight: 820;
      line-height: 1.15;
      text-align: center;
    }

    .ai-color-mode-option.is-active {
      border-color: rgba(246, 211, 101, .68);
      background: rgba(246, 211, 101, .13);
      color: #fff4cf;
    }

    .ai-color-creative-control {
      margin: 0 0 9px;
      padding: 9px 10px 8px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 5px;
      background: rgba(255, 255, 255, .035);
    }

    .ai-color-creative-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 5px;
    }

    .ai-color-creative-header strong {
      flex: 0 0 auto;
      color: #fff4cf;
      font-size: 10px;
      font-weight: 860;
    }

    .ai-color-creative-description {
      min-width: 0;
      color: rgba(217, 208, 189, .72);
      font-size: 9px;
      font-weight: 680;
      line-height: 1.25;
      text-align: right;
    }

    .ai-color-creative-range {
      width: 100%;
      height: 18px;
      margin: 0;
      accent-color: #f6d365;
      cursor: pointer;
    }

    .ai-color-creative-marks {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 5px;
      margin-top: 1px;
    }

    .ai-color-creative-marks button {
      min-height: 24px;
      padding: 0 5px;
      border: 1px solid transparent;
      border-radius: 3px;
      background: transparent;
      color: rgba(245, 245, 242, .65);
      font-size: 9px;
      font-weight: 800;
      line-height: 1;
    }

    .ai-color-creative-marks button.is-active {
      border-color: rgba(246, 211, 101, .5);
      background: rgba(246, 211, 101, .12);
      color: #fff4cf;
    }

    .ai-color-assist[data-creative-level="creative"] .ai-color-creative-control {
      border-color: rgba(244, 114, 182, .4);
      background: linear-gradient(135deg, rgba(244, 114, 182, .1), rgba(56, 189, 248, .06));
    }

    .ai-color-assist.is-mode-style .ai-color-creative-control {
      display: none;
    }

    .ai-color-assist:not(.is-mode-style) .ai-color-style-chips {
      display: none;
    }

    .ai-color-style-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .ai-color-chip {
      min-height: 26px;
      padding: 0 9px;
      border: 1px solid rgba(217, 208, 189, .18);
      border-radius: 999px;
      background: rgba(255, 255, 255, .05);
      color: rgba(245, 245, 242, .84);
      font-size: 10px;
      font-weight: 780;
      line-height: 1;
      white-space: nowrap;
    }

    .ai-color-chip.is-active {
      border-color: rgba(56, 189, 248, .62);
      background: rgba(56, 189, 248, .16);
      color: #e8f8ff;
    }

    .ai-color-actions {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-top: 8px;
    }

    .ai-color-suggest-button,
    .ai-color-close-button,
    .ai-color-apply {
      min-height: 30px;
      padding: 0 10px;
      border-radius: 3px;
      font-size: 10px;
      font-weight: 840;
      line-height: 1;
    }

    .ai-color-suggest-button,
    .ai-color-apply {
      border: 1px solid rgba(246, 211, 101, .58);
      background: #f6d365;
      color: #22170a;
    }

    .ai-color-close-button {
      border: 1px solid rgba(217, 208, 189, .18);
      background: rgba(255, 255, 255, .05);
      color: rgba(245, 245, 242, .82);
    }

    .ai-color-suggest-button:disabled {
      opacity: .55;
      cursor: wait;
    }

    .ai-color-status {
      min-height: 15px;
      margin-top: 7px;
      color: rgba(217, 208, 189, .72);
      font-size: 10px;
      font-weight: 720;
      line-height: 1.35;
    }

    .ai-color-insight-card {
      margin-bottom: 8px;
      padding: 10px 12px;
      border: 1px solid rgba(250, 204, 21, .35);
      border-radius: 8px;
      background: linear-gradient(135deg, rgba(250, 204, 21, .09) 0%, rgba(30, 27, 46, .45) 100%);
      box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
      animation: aiInsightFadeIn .32s ease-out;
    }

    @keyframes aiInsightFadeIn {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .ai-color-insight-header {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 4px;
      color: #facc15;
    }

    .ai-color-insight-header i, .ai-color-insight-header svg {
      width: 15px;
      height: 15px;
      color: #facc15;
      flex-shrink: 0;
    }

    .ai-color-insight-title {
      font-size: 12px;
      font-weight: 700;
      color: #fef08a;
      letter-spacing: .01em;
    }

    .ai-color-insight-summary {
      margin: 0 0 6px;
      color: rgba(243, 244, 246, .92);
      font-size: 11px;
      line-height: 1.42;
    }

    .ai-color-insight-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .ai-color-insight-chip {
      display: inline-flex;
      align-items: center;
      padding: 2px 7px;
      border-radius: 999px;
      border: 1px solid rgba(250, 204, 21, .28);
      background: rgba(250, 204, 21, .12);
      color: #fef08a;
      font-size: 10px;
      font-weight: 600;
    }

    .ai-color-results {
      display: grid;
      gap: 6px;
      margin-top: 7px;
    }

    .ai-color-result {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border: 1px solid rgba(217, 208, 189, .15);
      border-radius: 4px;
      background: rgba(255, 255, 255, .045);
    }

    .ai-color-result .filter-thumb {
      width: 58px;
      height: 42px;
      border-radius: 3px;
    }

    .ai-color-preview-button {
      width: 58px;
      height: 42px;
      padding: 0;
      border: 0;
      border-radius: 4px;
      background: transparent;
      cursor: pointer;
      display: block;
    }

    .ai-color-preview-button:focus-visible {
      outline: 2px solid #facc15;
      outline-offset: 2px;
    }

    .ai-color-result.is-previewing {
      border-color: rgba(250, 204, 21, .68);
      background: rgba(250, 204, 21, .08);
    }

    .ai-color-result.is-previewing .filter-thumb {
      box-shadow: 0 0 0 2px rgba(250, 204, 21, .82);
    }

    .ai-color-result-body {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .ai-color-result-body strong,
    .ai-color-result-body span,
    .ai-color-result-body small {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ai-color-result-body strong {
      color: var(--paper);
      font-size: 11px;
      font-weight: 850;
      line-height: 1.2;
    }

    .ai-color-result-body span {
      color: #a7f3d0;
      font-size: 9px;
      font-weight: 820;
      line-height: 1.1;
    }

    .ai-color-result-body small {
      color: rgba(217, 208, 189, .72);
      font-size: 9px;
      font-weight: 680;
      line-height: 1.25;
      white-space: normal;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .ai-color-reason-tags {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 3px;
      overflow: hidden;
      white-space: nowrap;
    }

    .ai-color-reason-tags em {
      max-width: 82px;
      min-height: 15px;
      padding: 1px 5px;
      border-radius: 999px;
      background: rgba(56, 189, 248, .13);
      color: rgba(186, 230, 253, .94);
      font-size: 8px;
      font-style: normal;
      font-weight: 800;
      line-height: 1.35;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ai-color-apply {
      min-width: 58px;
    }

    html[data-theme="light"] .ai-color-assist {
      border-color: rgba(16, 17, 38, .16);
      background: #f8fafc;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    }

    html[data-theme="light"] .ai-color-button {
      border-color: rgba(217, 119, 6, .5);
      background: #fff8db;
      color: #111827 !important;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    }

    html[data-theme="light"] .ai-color-button svg,
    html[data-theme="light"] .ai-color-button i {
      color: #d97706;
    }

    html[data-theme="light"] .ai-color-button em {
      background: #0284c7;
      color: #ffffff !important;
      box-shadow: 0 1px 2px rgba(2, 132, 199, .24);
    }

    html[data-theme="light"] .ai-color-button:disabled {
      cursor: not-allowed;
      box-shadow: none;
    }

    html[data-theme="light"] .ai-color-assist.is-locked {
      border-color: #d1d5db;
      background: #f3f4f6;
      box-shadow: none;
    }

    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-button {
      border-color: #cbd5e1;
      background: #e5e7eb;
      color: #64748b !important;
      opacity: 1;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
    }

    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-button svg,
    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-button i {
      color: #94a3b8;
    }

    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-button em {
      background: #cbd5e1;
      color: #475569 !important;
      box-shadow: none;
    }

    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-button:hover,
    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-button:focus-visible {
      border-color: #cbd5e1;
      background: #e5e7eb;
      color: #64748b !important;
      transform: none;
    }

    html[data-theme="light"] .ai-color-assist.is-locked .ai-color-hint {
      color: #334155 !important;
      font-weight: 820;
    }

    html[data-theme="light"] .ai-color-assist:not(.is-locked) .ai-color-button {
      border-color: #d97706;
      background: #fffbeb;
      color: #111827 !important;
    }

    html[data-theme="light"] .ai-color-hint,
    html[data-theme="light"] .ai-color-status,
    html[data-theme="light"] .ai-color-result-body small {
      color: #475569 !important;
    }

    html[data-theme="light"] .ai-color-reason-tags em {
      background: #e0f2fe;
      color: #075985 !important;
    }

    html[data-theme="light"] .ai-color-panel {
      border-top-color: rgba(16, 17, 38, .12);
    }

    html[data-theme="light"] .ai-color-panel-title,
    html[data-theme="light"] .ai-color-result-body strong {
      color: #111827 !important;
    }

    html[data-theme="light"] .ai-color-creative-control {
      border-color: #d7dee8;
      background: #ffffff;
    }

    html[data-theme="light"] .ai-color-creative-header strong {
      color: #111827;
    }

    html[data-theme="light"] .ai-color-creative-description {
      color: #475569;
    }

    html[data-theme="light"] .ai-color-creative-marks button {
      color: #64748b;
    }

    html[data-theme="light"] .ai-color-creative-marks button.is-active {
      border-color: #d97706;
      background: #fff7d6;
      color: #92400e;
    }

    html[data-theme="light"] .ai-color-assist[data-creative-level="creative"] .ai-color-creative-control {
      border-color: #f0abcf;
      background: linear-gradient(135deg, #fff1f7, #f0f9ff);
    }

    html[data-theme="light"] .ai-color-chip {
      border-color: #cbd5e1;
      background: #ffffff;
      color: #1f2937 !important;
    }

    html[data-theme="light"] .ai-color-chip.is-active {
      border-color: #0284c7;
      background: #e0f2fe;
      color: #075985 !important;
    }

    html[data-theme="light"] .ai-color-suggest-button,
    html[data-theme="light"] .ai-color-apply {
      border-color: #d97706;
      background: #fbbf24;
      color: #111827 !important;
    }

    html[data-theme="light"] .ai-color-close-button {
      border-color: #cbd5e1;
      background: #ffffff;
      color: #334155 !important;
    }

    html[data-theme="light"] .ai-color-result {
      border-color: #e2e8f0;
      background: #ffffff;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    }

    html[data-theme="light"] .ai-color-result.is-previewing {
      border-color: #d97706;
      background: #fff7ed;
      box-shadow: 0 1px 2px rgba(217, 119, 6, .16);
    }

    html[data-theme="light"] .ai-color-result.is-previewing .filter-thumb {
      box-shadow: 0 0 0 2px rgba(217, 119, 6, .72);
    }

    html[data-theme="light"] .ai-color-result-body span {
      color: #047857 !important;
    }

    html[data-theme="light"] .ai-color-insight-card {
      border-color: rgba(217, 119, 6, 0.28);
      background: linear-gradient(135deg, #fffcf5 0%, #fef3c7 100%);
      box-shadow: 0 4px 14px rgba(217, 119, 6, 0.10);
    }

    html[data-theme="light"] .ai-color-insight-header,
    html[data-theme="light"] .ai-color-insight-header i,
    html[data-theme="light"] .ai-color-insight-header svg {
      color: #d97706 !important;
    }

    html[data-theme="light"] .ai-color-insight-title {
      color: #92400e !important;
    }

    html[data-theme="light"] .ai-color-insight-summary {
      color: #334155 !important;
    }

    html[data-theme="light"] .ai-color-insight-chip {
      border-color: rgba(217, 119, 6, 0.28);
      background: #fef3c7;
      color: #92400e !important;
    }


    .option-card,
    .thumb-card {
      min-width: 0;
      border: 0;
      background: rgba(255, 255, 255, .04);
      color: var(--paper);
      box-shadow: none;
      transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
    }

    .option-card {
      height: 56px;
      border-radius: 2px;
      display: grid;
      grid-template-rows: 28px 13px;
      place-items: center;
      align-content: center;
      gap: 2px;
      padding: 6px 5px;
      font-size: 11px;
      font-weight: 720;
      line-height: 1;
    }

    .ratio-icon {
      width: 24px;
      height: 28px;
      border: 2px solid currentColor;
      border-radius: 2px;
    }

    .ratio-icon.square {
      width: 24px;
      height: 24px;
    }

    .ratio-icon.portrait {
      width: 20px;
      height: 28px;
    }

    .ratio-icon.story {
      width: 16px;
      height: 28px;
    }

    .ratio-icon.landscape {
      width: 28px;
      height: 20px;
    }

    .ratio-icon.wide {
      width: 31px;
      height: 18px;
    }

    .tool-locked .panel .control-section:not(:last-child) {
      opacity: .42;
      pointer-events: none;
      filter: grayscale(.16);
    }

    .tool-locked .action-button.primary {
      opacity: .46;
      pointer-events: none;
    }

    .tool-locked .photo-slot {
      background-image: none;
      filter: none;
    }

    .tool-locked .stage::before {
      background: none;
      opacity: 0;
      filter: none;
      transform: none;
    }

    .polafilm:not(.tool-locked) .stage-upload-cta {
      display: none;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .polafilm:not(.tool-locked) .stage-actions {
      position: fixed;
      left: calc((100vw - var(--editor-panel-width)) / 2);
      bottom: var(--stage-actions-bottom);
      z-index: 90;
      width: min(690px, calc(100vw - var(--editor-panel-width) - 48px));
      max-width: none;
      display: flex;
      margin: 0;
      padding: 10px;
      border: 1px solid rgba(255, 255, 255, .12);
      border-radius: 14px;
      background: rgba(16, 17, 38, .78);
      box-shadow: 0 18px 48px rgba(0, 0, 0, .26);
      backdrop-filter: blur(16px);
      transform: translateX(-50%);
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    html[data-theme="light"] .polafilm:not(.tool-locked) .stage-actions {
      border-color: rgba(16, 17, 38, .1);
      background: rgba(255, 255, 255, .8);
      box-shadow: 0 18px 42px rgba(16, 17, 38, .14);
    }

    .tool-locked .stage-actions {
      display: none !important;
    }

    @media (min-width: 941px) {
      .polafilm:not(.tool-locked) .stage {
        padding-top: 16px;
        padding-bottom: calc(var(--stage-actions-height) + var(--stage-actions-bottom) + var(--stage-preview-gap));
      }
    }

    .panel-actions-section {
      margin: 0;
      padding: 0;
      border: 0;
    }

    .panel-actions-section .action-grid {
      display: none;
    }

    .ratio-hint {
      margin: 8px 2px 0;
      min-height: 16px;
      color: rgba(217, 208, 189, .64);
      font-size: 10px;
      font-weight: 720;
      line-height: 1.35;
    }

    .is-active {
      color: var(--paper);
      background: rgba(217, 208, 189, .18);
      box-shadow: none;
    }

    .scroller {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: 74px;
      gap: 6px;
      overflow-x: auto;
      padding: 6px;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 3px;
      background: rgba(0, 0, 0, .12);
      scrollbar-width: none;
      -ms-overflow-style: none;
      cursor: grab;
      user-select: none;
      contain: layout paint;
    }

    .frame-group-tabs.is-dragging,
    .scroller.is-dragging {
      cursor: grabbing;
      scroll-behavior: auto;
    }

    .scroller::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
    }

    .scroll-arrow {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(16, 17, 38, 0.6);
      color: var(--accent);
      border: 1px solid rgba(217, 208, 189, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 10;
      transition: all 0.2s ease;
      padding: 0;
      backdrop-filter: blur(4px);
    }

    .scroll-arrow.scroll-left {
      left: 4px;
    }

    .scroll-arrow.scroll-right {
      right: 4px;
    }

    .scroll-arrow:hover {
      background: rgba(16, 17, 38, 0.9);
      color: #fff;
      transform: translateY(-50%) scale(1.1);
    }

    .empty-frames {
      grid-column: 1 / -1;
      min-height: 64px;
      display: grid;
      place-items: center;
      padding: 10px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 720;
      text-align: center;
    }

    .thumb-card {
      min-height: 74px;
      border-radius: 2px;
      padding: 6px 5px;
      display: grid;
      gap: 5px;
      place-items: center;
      font-size: 10px;
      font-weight: 720;
      line-height: 1.15;
    }

    .favorite-btn {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 22px;
      height: 22px;
      background: rgba(0, 0, 0, 0.5);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      cursor: pointer;
      opacity: 0;
      transition: all 0.2s ease;
      z-index: 10;
    }

    .thumb-card:hover .favorite-btn,
    .favorite-btn:hover,
    .thumb-card.is-active .favorite-btn,
    .favorite-btn.is-active {
      opacity: 1;
      background: rgba(0, 0, 0, 0.7);
    }

    .favorite-btn:active {
      transform: scale(0.85);
    }

    .mini-frame {
      display: block;
      position: relative;
      width: 42px;
      height: 42px;
      border-radius: 3px;
      background: #fffefa;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .075);
    }

    .mini-frame::after {
      content: "";
      position: absolute;
      left: 9px;
      right: 9px;
      top: 8px;
      height: 24px;
      border-radius: 2px;
      background: linear-gradient(135deg, #e3e8ee, #fff);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .075);
    }

    .mini-frame.mini-none {
      background: transparent;
      border: 1.5px dashed rgba(255, 255, 255, 0.3);
      box-shadow: none;
    }

    .mini-frame.mini-none::after {
      display: none;
    }

    .thumb-image {
      display: block;
      width: 62px;
      height: 42px;
      border-radius: 4px;
      background-position: center;
      background-size: contain;
      background-repeat: no-repeat;
      background-color: rgba(255, 255, 255, .08);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
    }

    .mini-paper {
      background:
        radial-gradient(circle at 20% 18%, rgba(151, 96, 36, .16), transparent 25%),
        #ead8bc;
    }

    .mini-black {
      background: #111;
    }

    .mini-strip {
      background:
        repeating-linear-gradient(0deg, transparent 0 8px, #fff 8px 13px, transparent 13px 21px) left 4px top 5px / 7px 48px no-repeat,
        repeating-linear-gradient(0deg, transparent 0 8px, #fff 8px 13px, transparent 13px 21px) right 4px top 5px / 7px 48px no-repeat,
        #111;
    }

    .filter-thumb {
      display: block;
      width: 82px;
      max-width: 62px;
      height: 39px;
      border-radius: 5px;
      background: #cbd4dc var(--photo-url) center / cover no-repeat;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
      transition: opacity .18s ease;
      contain: strict;
    }

    .item-premium-badge {
      position: absolute;
      top: 4px;
      left: 4px;
      width: 25px;
      height: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      z-index: 11;
      pointer-events: none;
    }

    .item-premium-badge svg {
      width: 25px;
      height: 19px;
      display: block;
      filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .72)) drop-shadow(0 2px 5px rgba(0, 0, 0, .45));
    }

    .item-new-badge {
      position: absolute;
      top: -4px;
      right: -4px;
      background: #e31837;
      color: #fff;
      font-size: 8px;
      font-weight: 800;
      padding: 2px 4px;
      border-radius: 4px;
      text-transform: uppercase;
      letter-spacing: .5px;
      z-index: 10;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      pointer-events: none;
    }

    .filter-thumb.is-rendering {
      opacity: .55;
    }

    .filter-kodak {
      filter: saturate(1.18) contrast(1.08) sepia(.11) brightness(1.04);
    }

    .filter-fuji {
      filter: saturate(1.05) contrast(1.1) hue-rotate(174deg) brightness(1.02);
    }

    .filter-moody {
      filter: saturate(.78) contrast(1.24) brightness(.9);
    }

    .filter-warm {
      filter: saturate(1.02) contrast(.96) sepia(.24) brightness(1.08);
    }

    .slider-row {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr) 42px;
      align-items: center;
      gap: 10px;
      min-height: 32px;
      margin-top: 8px;
      color: var(--paper);
      font-size: 12px;
    }

    .slider-row.compact {
      grid-template-columns: 22px 72px minmax(0, 1fr) 42px;
    }

    .template-scrim-row {
      grid-template-columns: 78px minmax(0, 1fr) 42px;
      margin-top: 10px;
      padding: 0 4px;
    }

    .template-scrim-row[hidden] {
      display: none !important;
    }

    .template-photo-zoom-row[hidden] {
      display: none !important;
    }

    .template-scrim-row label {
      color: var(--paper);
      font-weight: 700;
      white-space: nowrap;
    }

    .template-photo-zoom-row {
      grid-template-columns: 78px minmax(0, 1fr) 42px;
      margin-top: 8px;
      padding: 0 4px;
    }

    .template-photo-zoom-row label {
      color: var(--paper);
      font-weight: 700;
      white-space: nowrap;
    }

    .template-scrim-row .slider-value {
      text-align: right;
    }

    .template-photo-zoom-row .slider-value {
      text-align: right;
    }

    .slider-row.compact > .lucide,
    .slider-row.compact > svg {
      width: 18px;
      height: 18px;
      justify-self: center;
      flex-shrink: 0;
      display: block;
    }

    .slider-value {
      text-align: right;
      color: var(--paper);
      font-weight: 740;
      font-variant-numeric: tabular-nums;
    }

    input[type="range"] {
      width: 100%;
      accent-color: var(--accent);
    }

    .caption-input {
      width: 100%;
      min-height: 40px;
      padding: 0 12px;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 3px;
      color: var(--paper);
      outline: none;
      background: rgba(0, 0, 0, .12);
    }

    .caption-font-select {
      margin-top: 8px;
      appearance: auto;
      color: var(--paper);
      background: rgba(0, 0, 0, .18);
      border-color: rgba(217, 208, 189, .34);
    }

    .caption-font-select option {
      color: #f0f0f5;
      background: #17182f;
    }

    html[data-theme="light"] .caption-font-select option {
      color: #12151b;
      background: #ffffff;
    }

    .caption-quick-chips {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding: 8px 0 4px 0;
      scrollbar-width: none;
      -ms-overflow-style: none;
      cursor: grab;
      user-select: none;
      touch-action: pan-x;
      -webkit-overflow-scrolling: touch;
    }

    .caption-quick-chips.is-dragging {
      cursor: grabbing;
      scroll-behavior: auto;
    }

    .caption-quick-chips::-webkit-scrollbar {
      display: none;
    }

    .caption-chip-btn {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 32px;
      padding: 4px 10px;
      border-radius: 6px;
      font-family: inherit;
      font-size: 13px;
      font-weight: 500;
      color: var(--paper);
      background: rgba(255, 255, 255, .12);
      border: 1px solid rgba(255, 255, 255, .18);
      cursor: pointer;
      transition: all 0.2s;
    }

    .caption-chip-btn:hover {
      background: rgba(255, 255, 255, .24);
      border-color: var(--accent);
      transform: translateY(-1px);
    }

    .caption-preset-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 10px;
    }

    .caption-preset-item {
      padding: 5px 10px;
      border-radius: 6px;
      font-size: 12px;
      color: var(--paper);
      background: rgba(0, 0, 0, .24);
      border: 1px solid rgba(255, 255, 255, .14);
      cursor: pointer;
      text-align: left;
      transition: all 0.2s;
    }

    .caption-preset-item:hover {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
    }

    .caption-color-btn {
      width: 20px;
      height: 20px;
      padding: 0;
      border-radius: 50%;
      border: 1.5px solid rgba(255, 255, 255, 0.25);
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .caption-color-btn:hover {
      transform: scale(1.15);
      border-color: #ffffff;
      box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
    }

    .caption-color-btn.is-active {
      transform: scale(1.25);
      border-color: #38bdf8 !important;
      box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.5), 0 3px 8px rgba(0, 0, 0, 0.3) !important;
      z-index: 2;
    }

    html[data-theme="light"] .caption-color-btn {
      border-color: rgba(0, 0, 0, 0.18);
    }

    html[data-theme="light"] .caption-color-btn:hover {
      border-color: rgba(0, 0, 0, 0.5);
    }

    .caption-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(18, 103, 255, .12);
    }

    .action-grid {
      display: flex;
      gap: 8px;
    }

    .action-grid .action-button {
      flex: 1 1 0;
      min-width: 0;
      padding: 0 4px;
    }

    .action-button {
      position: relative;
      overflow: visible;
      width: 100%;
      min-height: 50px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border-radius: 2px;
      border: 0;
      color: var(--paper);
      background: rgba(0, 0, 0, .16);
      box-shadow: none;
      font-size: 11px;
      font-weight: 820;
      line-height: 1.15;
      text-align: center;
      transition: background .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
    }

    .action-button .lucide {
      width: 21px;
      height: 21px;
      stroke-width: 2.2;
    }

    .action-button.primary {
      color: #fff;
      background: linear-gradient(135deg, #2f8dff, #005cff);
      box-shadow:
        0 15px 34px rgba(0, 92, 255, .35),
        inset 0 1px 0 rgba(255, 255, 255, .22);
    }

    .action-button.primary:hover {
      background: linear-gradient(135deg, #47a0ff, #1268ff);
      box-shadow:
        0 18px 42px rgba(0, 92, 255, .44),
        inset 0 1px 0 rgba(255, 255, 255, .26);
    }

    .action-button:not(.primary):hover {
      background: rgba(0, 0, 0, .24);
    }

    .action-button:active,
    .option-card:active,
    .thumb-card:active,
    .recharge:active {
      transform: translateY(1px);
    }

    .mobile-tabs-nav {
      display: none;
    }

    #caption-settings-wrapper[hidden] {
      display: none !important;
    }
    @media (max-width: 940px) {
      .panel-mode-tabs {
        top: 64px;
        margin-top: 0;
      }

      .mobile-tabs-nav {
        position: sticky;
        top: 124px;
        z-index: 30;
        display: flex;
        gap: 6px;
        width: 100%;
        margin-bottom: 16px;
        border-bottom: 1px solid rgba(217, 208, 189, .12);
        padding: 8px 0 10px;
        justify-content: space-between;
        background: #101126;
      }

    html[data-theme="light"] .mobile-tabs-nav {
        background: var(--surface);
      }

      .tab-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 58px;
        padding: 8px 0;
        background: transparent;
        border: none;
        color: rgba(217, 208, 189, .45);
        cursor: pointer;
        transition: color .2s, border-bottom-color .2s;
        border-bottom: 2px solid transparent;
        font-size: 11px;
        font-weight: 700;
      }

      .tab-nav-item.is-active {
        color: var(--paper);
        border-bottom-color: var(--paper);
      }

      .tab-nav-item .lucide {
        width: 20px;
        height: 20px;
      }

      .panel-inner:not(.active-tab-frame) .control-section[data-tab="frame"] {
        display: none;
      }

      .panel-inner:not(.active-tab-filter) .control-section[data-tab="filter"] {
        display: none;
      }

      .panel-inner:not(.active-tab-adjust) .control-section[data-tab="adjust"] {
        display: none;
      }

      .panel-inner:not(.active-tab-text) .control-section[data-tab="text"] {
        display: none;
      }

      .panel-inner:not(.active-tab-typography) .control-section[data-tab="typography"] {
        display: none;
      }

      .panel-inner.is-ai-effect-mode .panel-mode-tabs {
        margin-bottom: 14px;
      }


      .polafilm {
        --card-width: 324px;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow-x: hidden;
        overflow-y: auto;
      }

      .topbar {
        position: sticky;
        top: 0;
        width: 100%;
        min-height: 64px;
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        padding: 0 14px;
      }

      .brand {
        font-size: 30px;
      }

      .brand-title {
        font-size: 30px;
      }

      .brand-by {
        font-size: 18px;
      }

      .top-actions {
        gap: 6px;
      }

      .wallet,
      .recharge {
        min-height: 34px;
        padding: 0 10px;
      }

      .app-shell {
        width: min(100%, 380px);
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        padding: 16px 18px 18px;
        overflow: visible;
      }

      .stage {
        width: var(--card-width);
        height: auto;
        min-height: 0;
        gap: 12px;
        padding: 8px 0 0;
        overflow: visible;
      }

      .preview-wrap {
        margin-top: 0;
      }

      .stage-upload-cta {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        width: 100%;
      }

      .stage-actions {
        display: none !important;
      }

      .polafilm:not(.tool-locked) .stage-actions {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 90;
        width: auto;
        max-width: none;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
        gap: 6px;
        margin: 0;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 12px;
        background: rgba(16, 17, 38, .94);
        box-shadow: 0 14px 40px rgba(0, 0, 0, .34);
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
      }

    html[data-theme="light"] .polafilm:not(.tool-locked) .stage-actions {
        background: rgba(255, 255, 255, .94);
        border-color: rgba(16, 17, 38, .1);
        box-shadow: 0 14px 36px rgba(16, 17, 38, .16);
      }

      .polafilm:not(.tool-locked) .stage-action-button {
        min-height: 46px;
        width: 100%;
        min-width: 0;
        padding: 0 5px;
        border-radius: 8px;
        box-shadow: none;
        font-size: 10px;
        gap: 4px;
        overflow: visible;
      }

      .polafilm:not(.tool-locked) .stage-action-menu {
        width: 100%;
      }

      .polafilm:not(.tool-locked) .stage-action-menu .stage-action-button {
        width: 100%;
      }

      .polafilm:not(.tool-locked) .stage-batch-copy-popover {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
      }

      .polafilm:not(.tool-locked) #stage-random-light-leak {
        overflow: visible;
      }

      .polafilm:not(.tool-locked) .stage-action-button>span:not(.remove-effect-badge) {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
      }

      .polafilm:not(.tool-locked) .stage-action-marquee-viewport {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        display: block;
      }

      .polafilm:not(.tool-locked) .stage-action-marquee-track {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-width: max-content;
        white-space: nowrap;
        animation: none;
        transform: translateX(0);
      }

      .polafilm:not(.tool-locked) #stage-random-light-leak.is-marquee-active .stage-action-marquee-track {
        animation: polafilm-action-label-marquee 7.5s ease-in-out infinite;
        animation-delay: .5s;
      }

      @keyframes polafilm-action-label-marquee {

        0%,
        18% {
          transform: translateX(0);
        }

        50%,
        68% {
          transform: translateX(calc(-100% + 42px));
        }

        100% {
          transform: translateX(0);
        }
      }

      .polafilm:not(.tool-locked) .stage-action-button .lucide,
      .polafilm:not(.tool-locked) .stage-action-button svg {
        width: 17px;
        height: 17px;
      }

      .polafilm:not(.tool-locked) .app-shell {
        padding-bottom: 78px;
      }

      .panel-actions-section {
        display: none !important;
      }

      .stage-upload-cta:active {
        transform: translateY(1px);
      }

      .panel {
        width: var(--card-width);
        min-height: auto;
        overflow: visible;
        background: transparent;
        border-left: 0;
        box-shadow: none;
        backdrop-filter: none;
      }

      .panel-inner {
        width: var(--card-width);
        max-width: none;
        padding: 0;
      }

      .stage-container {
        height: auto !important;
      }

      .preview-wrap,
      .preview-wrap.preview-wide,
      .preview-wrap.preview-wide .polaroid-card,
      .polaroid-card.ratio-wide:not(.variant-frame),
      .polaroid-card.frame-none {
        width: var(--card-width);
        height: auto !important;
      }

      .section-title {
        text-align: center;
      }

      .polaroid-card {
        --frame-padding: clamp(10px, calc(var(--card-width) * .04), 16px);
        --bottom-padding: clamp(45px, calc(var(--card-width) * .18), 70px);
      }
    }

    .stage-zoom-controls {
      position: fixed;
      top: var(--zoom-controls-top, 50%);
      left: var(--zoom-controls-left, calc(50% + var(--card-width) / 2 + 12px));
      right: auto;
      bottom: auto;
      transform: translateY(-50%);
      z-index: 10;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      background: rgba(16, 17, 38, .8);
      border: 1px solid rgba(255, 255, 255, .1);
      border-radius: 8px;
      padding: 6px;
      backdrop-filter: blur(8px);
      opacity: 0;
      visibility: hidden;
      transition: opacity .2s, visibility .2s, transform .2s;
      will-change: top, left;
    }

    .polafilm:not(.tool-locked) .stage-zoom-controls {
      opacity: 1;
      visibility: visible;
    }

    .zoom-btn {
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      color: #fff;
      cursor: pointer;
      border-radius: 4px;
      transition: background .15s;
    }

    .zoom-btn:hover {
      background: rgba(255, 255, 255, .15);
    }

    .zoom-btn .lucide {
      width: 16px;
      height: 16px;
    }

    .zoom-toggle-btn {
      display: none;
    }

    .zoom-expand-area {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }

    #zoom-level {
      color: #fff;
      font-size: 10px;
      font-weight: 600;
      min-width: 32px;
      text-align: center;
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 3px 0;
      border-radius: 4px;
      transition: background 0.15s;
    }

    #zoom-level:hover {
      background: rgba(255, 255, 255, 0.15);
    }
    @media (max-width: 940px) {
      .stage-zoom-controls {
        position: absolute;
        top: 50%;
        left: auto;
        right: 12px;
        bottom: auto;
        transform: translateY(-50%);
        padding: 4px;
        border-radius: 20px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
      }

      .zoom-toggle-btn {
        display: flex;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #fff;
        cursor: pointer;
        border-radius: 50%;
        transition: background 0.15s;
      }

      .zoom-toggle-btn:active {
        background: rgba(255, 255, 255, 0.2);
      }

      .zoom-toggle-btn .lucide {
        width: 20px;
        height: 20px;
      }

      .stage-zoom-controls:not(.is-expanded) .zoom-expand-area {
        display: none;
      }

      .stage-zoom-controls.is-expanded {
        border-radius: 12px;
        padding: 6px;
        cursor: default;
      }

      .stage-zoom-controls.is-expanded .zoom-toggle-btn {
        display: none;
      }
    }

    .custom-font-item {
      padding: 10px 12px;
      cursor: pointer;
      border-bottom: 1px solid var(--border, #e2e8f0);
      transition: background 0.15s;
    }

    .custom-font-item:last-child {
      border-bottom: none;
    }

    .custom-font-item:hover {
      background: var(--muted, #f1f5f9);
    }

    .custom-font-item.is-active {
      background: var(--primary, #0f172a);
      color: #fff !important;
    }

    .custom-font-item-name {
      font-size: 12px;
      margin-bottom: 4px;
      opacity: 0.8;
    }

    .custom-font-item-preview {
      font-size: 16px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .custom-font-options {
      display: none;
    }

    .custom-font-dropdown.is-open .custom-font-options {
      display: block;
    }

    .custom-font-dropdown.is-open .custom-font-selected {
      border-color: var(--ring, #94a3b8);
      box-shadow: 0 0 0 1px var(--ring, #94a3b8);
    }

    .remove-effect-badge {
      position: absolute;
      top: -6px;
      right: -6px;
      width: 18px;
      height: 18px;
      background: #ef4444 !important;
      color: #ffffff !important;
      border: 1.5px solid #ffffff !important;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(239, 68, 68, .45), 0 1px 3px rgba(0, 0, 0, .25) !important;
      z-index: 10;
      transition: transform 0.2s, background 0.2s;
    }

    .remove-effect-badge:hover {
      transform: scale(1.1);
      background: #dc2626 !important;
    }

    .remove-effect-badge .lucide,
    .remove-effect-badge svg,
    .remove-effect-badge i {
      width: 11px !important;
      height: 11px !important;
      color: #ffffff !important;
      stroke: #ffffff !important;
      stroke-width: 3 !important;
    }

    @media (max-width: 520px) {

      .back-link span,
      .wallet span,
      .user-account-summary,
      .brand-by {
        display: none;
      }

      .back-link,
      .wallet {
        min-width: 34px;
        padding: 0;
      }
    }

    @media (max-width: 380px) {
      .polafilm {
        --card-width: calc(100vw - 24px);
      }

      .topbar,
      .app-shell {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
      }

      .brand {
        font-size: 27px;
      }

      .brand-title {
        font-size: 27px;
      }

      .brand-title-intent {
        display: none;
      }

      .brand-by {
        font-size: 16px;
      }

      .stage,
      .preview-wrap,
      .polaroid-card,
      .panel,
      .panel-inner {
        width: calc(100vw - 24px);
      }

      .polaroid-card:not(.ratio-wide):not(.frame-none):not(.variant-frame) {
        height: calc(var(--card-width) * 1.333333);
      }

      .preview-wrap,
      .preview-wrap.preview-wide,
      .preview-wrap.preview-wide .polaroid-card,
      .polaroid-card.ratio-wide:not(.variant-frame),
      .polaroid-card.frame-none {
        height: auto !important;
      }

      .stage-upload-cta {
        width: 100%;
        min-height: 58px;
        padding: 0 16px;
        font-size: 14px;
      }

      .action-button {
        min-height: 46px;
        font-size: 10px;
      }

      .action-button .lucide {
        width: 19px;
        height: 19px;
      }
    }

    .top-more-menu {
      position: relative;
    }

    .more-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      color: var(--paper);
      background: rgba(255, 255, 255, .08);
      border: 1px solid rgba(217, 208, 189, .18);
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s;
    }

    .more-btn:hover {
      background: rgba(255, 255, 255, .15);
      border-color: rgba(217, 208, 189, .4);
    }

    .more-btn .lucide {
      width: 18px;
      height: 18px;
    }

    .more-dropdown {
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 8px;
      width: 220px;
      background: #151632;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 8px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
      padding: 8px;
      display: none;
      flex-direction: column;
      gap: 4px;
      z-index: 50;
    }

    .more-dropdown.is-open {
      display: flex;
      animation: fadeInDown 0.2s ease;
    }

    @keyframes fadeInDown {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .more-dropdown button {
      text-align: left;
      padding: 10px 12px;
      color: var(--paper);
      background: transparent;
      border: none;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
    }

    .more-dropdown button:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .polafilm-help-dialog {
      width: min(750px, 100%);
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      border: 1px solid rgba(217, 208, 189, .2);
      border-radius: 12px;
      background: #151632;
      box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
      overflow: hidden;
    }

    .help-header {
      padding: 16px 20px;
      border-bottom: 1px solid rgba(217, 208, 189, .15);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(0, 0, 0, 0.2);
    }

    .help-header h2 {
      margin: 0;
      font-size: 18px;
      color: var(--paper);
    }

    .help-close {
      background: none;
      border: none;
      color: rgba(217, 208, 189, .6);
      cursor: pointer;
      padding: 4px;
      display: flex;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .help-close:hover {
      color: var(--paper);
      background: rgba(255, 255, 255, 0.1);
    }

    .help-close .lucide {
      width: 20px;
      height: 20px;
    }

    .help-body {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    .help-sidebar {
      width: 200px;
      background: rgba(0, 0, 0, 0.15);
      border-right: 1px solid rgba(217, 208, 189, .15);
      padding: 16px 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex-shrink: 0;
    }

    .help-sidebar button {
      text-align: left;
      padding: 10px 12px;
      color: rgba(217, 208, 189, .7);
      background: transparent;
      border: none;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .help-sidebar button:hover {
      color: var(--paper);
      background: rgba(255, 255, 255, 0.05);
    }

    .help-sidebar button.is-active {
      color: #fff;
      background: rgba(255, 255, 255, 0.15);
    }

    .help-content-area {
      flex: 1;
      padding: 24px;
      overflow-y: auto;
      color: rgba(217, 208, 189, .85);
      font-size: 14px;
      line-height: 1.6;
    }

    .help-content-area::-webkit-scrollbar {
      width: 6px;
    }

    .help-content-area::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.1);
    }

    .help-content-area::-webkit-scrollbar-thumb {
      background: rgba(217, 208, 189, .3);
      border-radius: 3px;
    }

    .help-tab-content {
      display: none;
      animation: fadeIn 0.3s ease;
    }

    .help-tab-content.is-active {
      display: block;
    }

    .help-tab-content h3 {
      color: var(--paper);
      font-size: 20px;
      margin: 0 0 16px 0;
      font-family: "Playfair Display", serif;
      font-style: italic;
    }

    .help-tab-content h4 {
      color: #fff;
      font-size: 15px;
      margin: 20px 0 10px 0;
    }

    .help-tab-content p {
      margin: 0 0 12px 0;
    }

    .help-tab-content ul {
      margin: 0 0 16px 0;
      padding-left: 20px;
    }

    .help-tab-content li {
      margin-bottom: 6px;
    }

    .help-pricing-table {
      width: 100%;
      border-collapse: collapse;
      margin: 16px 0;
    }

    .help-pricing-table th,
    .help-pricing-table td {
      border: 1px solid rgba(217, 208, 189, .2);
      padding: 10px 14px;
      text-align: left;
    }

    .help-pricing-table th {
      background: rgba(255, 255, 255, 0.05);
      color: var(--paper);
      font-weight: bold;
    }

    @media (max-width: 640px) {
      .help-body {
        flex-direction: column;
      }

      .help-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(217, 208, 189, .15);
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
      }

      .help-sidebar button {
        white-space: nowrap;
      }

      .help-content-area {
        padding: 16px;
      }
    }

    .action-button.is-loading {
      pointer-events: none;
      opacity: 0.8;
      cursor: not-allowed;
    }

    .action-button.is-loading svg,
    .action-button.is-loading i,
    .stage-action-button.is-loading svg,
    .stage-action-button.is-loading i {
      animation: polafilm-spin 1s linear infinite !important;
      transform-origin: center center;
    }

    @keyframes polafilm-spin {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }

    /* Notification Hub */
    html.notification-hub-open,
    html.notification-hub-open body {
      overflow: hidden;
    }

    /* The hub lives inside the topbar stacking context. Lift that context while
       the dialog is open so sticky editor tabs cannot paint above the modal. */
    html.notification-hub-open .topbar {
      z-index: 100000;
    }

    #polafilm-news-ticker.notification-hub {
      position: relative;
      z-index: 42;
      width: auto;
      min-height: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      margin: 0;
      color: var(--paper);
    }

    .notification-hub-bell {
      position: relative;
      width: 36px;
      height: 36px;
      min-width: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(217, 208, 189, .14);
      border-radius: 8px;
      color: rgba(255, 248, 230, .82);
      background: rgba(255, 255, 255, .055);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
      cursor: pointer;
      transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
    }

    .bonus-review-notice {
      position: fixed;
      top: max(78px, calc(env(safe-area-inset-top) + 64px));
      right: 16px;
      z-index: 73;
      width: min(430px, calc(100vw - 32px));
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 30px;
      align-items: start;
      gap: 12px;
      padding: 14px;
      border: 1px solid rgba(245, 158, 11, .42);
      border-radius: 10px;
      color: #fff8e6;
      background: rgba(31, 26, 47, .97);
      box-shadow: 0 18px 48px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .08);
      opacity: 0;
      transform: translateY(-10px);
      transition: opacity .18s ease, transform .18s ease;
    }

    .bonus-review-notice.is-visible {
      opacity: 1;
      transform: translateY(0);
    }

    .bonus-review-notice-icon {
      width: 42px;
      height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
      color: #ffd089;
      background: rgba(245, 158, 11, .14);
    }

    .bonus-review-notice-icon svg {
      width: 21px;
      height: 21px;
    }

    .bonus-review-notice-content strong {
      display: block;
      color: #fff8e6;
      font-size: 14px;
      font-weight: 900;
      line-height: 1.3;
    }

    .bonus-review-notice-content p {
      margin: 4px 0 7px;
      color: rgba(255, 248, 230, .72);
      font-size: 12px;
      font-weight: 650;
      line-height: 1.45;
    }

    .bonus-review-notice-content a {
      color: #ffd089;
      font-size: 12px;
      font-weight: 850;
      text-decoration: none;
    }

    .bonus-review-notice-content a:hover {
      color: #fff;
      text-decoration: underline;
    }

    .bonus-review-notice-close {
      width: 30px;
      height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      border: 1px solid rgba(255, 248, 230, .16);
      border-radius: 8px;
      color: rgba(255, 248, 230, .78);
      background: rgba(255, 255, 255, .05);
      font-size: 22px;
      line-height: 1;
      cursor: pointer;
    }

    html[data-theme="light"] .bonus-review-notice {
      color: #0f172a;
      border-color: rgba(217, 119, 6, .3);
      background: rgba(255, 252, 242, .98);
      box-shadow: 0 18px 48px rgba(16, 24, 40, .18);
    }

    html[data-theme="light"] .bonus-review-notice-content strong {
      color: #172033;
    }

    html[data-theme="light"] .bonus-review-notice-content p {
      color: #5c6473;
    }

    html[data-theme="light"] .bonus-review-notice-content a {
      color: #a74b00;
    }

    html[data-theme="light"] .bonus-review-notice-close {
      color: #5c6473;
      border-color: rgba(16, 24, 40, .12);
      background: rgba(16, 24, 40, .04);
    }

    @media (max-width: 940px) {
      .bonus-review-notice {
        top: max(70px, calc(env(safe-area-inset-top) + 58px));
        left: 10px;
        right: 10px;
        width: auto;
        grid-template-columns: 38px minmax(0, 1fr) 30px;
        padding: 12px;
      }

      .bonus-review-notice-icon {
        width: 38px;
        height: 38px;
      }
    }

    .notification-hub-bell:hover,
    .notification-hub.is-open .notification-hub-bell {
      color: #fff8e6;
      border-color: rgba(217, 208, 189, .26);
      background: rgba(255, 255, 255, .09);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 22px rgba(0, 0, 0, .14);
      transform: translateY(-1px);
    }

    .notification-hub-bell .lucide,
    .notification-hub-bell svg {
      width: 17px;
      height: 17px;
      stroke-width: 2.45;
    }

    .notification-hub-badge {
      position: absolute;
      top: -5px;
      right: -5px;
      min-width: 17px;
      height: 17px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 4px;
      border: 2px solid #1f2044;
      border-radius: 8px;
      color: #ffffff;
      background: #f02c78;
      box-shadow: 0 0 14px rgba(240, 44, 120, .54);
      font-size: 9px;
      font-weight: 950;
      line-height: 1;
    }

    .notification-hub.is-read .notification-hub-badge,
    .notification-hub-badge[hidden] {
      display: none !important;
    }

    .notification-hub-backdrop {
      position: fixed;
      inset: 0;
      z-index: 74;
      background: rgba(4, 5, 12, .18);
      backdrop-filter: blur(2px);
    }

    .notification-hub-backdrop[hidden],
    .notification-panel[hidden] {
      display: none !important;
    }

    .notification-panel {
      position: absolute;
      top: calc(100% + 10px);
      left: 0;
      z-index: 86;
      width: min(430px, calc(100vw - 32px));
      max-height: min(72vh, 620px);
      overflow-y: auto;
      padding: 16px;
      border: 1px solid rgba(217, 208, 189, .16);
      border-radius: 8px;
      color: var(--paper);
      background: rgba(18, 19, 42, .97);
      box-shadow: 0 28px 80px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
      opacity: 0;
      transform: translateY(-6px) scale(.98);
      transform-origin: top left;
      transition: opacity .18s ease, transform .18s ease;
      outline: none;
    }

    .notification-hub.is-open .notification-panel {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    .notification-panel-grip {
      display: none;
    }

    .notification-panel-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
    }

    .notification-panel-kicker {
      display: block;
      color: rgba(217, 208, 189, .58);
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .notification-panel-head strong {
      display: block;
      margin-top: 3px;
      color: #fff8e6;
      font-size: 19px;
      font-weight: 950;
      line-height: 1.15;
      letter-spacing: 0;
    }

    .notification-panel-head p {
      margin: 5px 0 0;
      color: rgba(217, 208, 189, .62);
      font-size: 11px;
      font-weight: 740;
      line-height: 1.25;
      letter-spacing: 0;
    }

    .notification-panel-close {
      width: 32px;
      height: 32px;
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(217, 208, 189, .14);
      border-radius: 8px;
      color: rgba(255, 248, 230, .72);
      background: rgba(255, 255, 255, .045);
      cursor: pointer;
    }

    .notification-panel-close:hover {
      color: #ffffff;
      background: rgba(255, 255, 255, .08);
    }

    .notification-panel-hero {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 14px;
      border: 1px solid rgba(249, 115, 22, .2);
      border-radius: 8px;
      background: linear-gradient(135deg, rgba(249, 115, 22, .12), rgba(240, 44, 120, .08));
    }

    .notification-hero-icon,
    .notification-card-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      color: #fff8e6;
      background: rgba(255, 255, 255, .08);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
    }

    .notification-hero-icon {
      width: 42px;
      height: 42px;
      color: #ffd089;
    }

    .notification-panel-hero strong,
    .notification-card strong {
      display: block;
      color: #fff8e6;
      font-size: 13px;
      font-weight: 900;
      line-height: 1.25;
      letter-spacing: 0;
    }

    .notification-panel-hero p,
    .notification-card p {
      margin: 3px 0 0;
      color: rgba(217, 208, 189, .66);
      font-size: 12px;
      font-weight: 650;
      line-height: 1.35;
      letter-spacing: 0;
    }

    .notification-panel-hero button,
    .notification-card button {
      min-height: 30px;
      padding: 0 10px;
      border: 0;
      border-radius: 7px;
      color: #111318;
      background: #fff8e6;
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
      cursor: pointer;
    }

    .notification-panel-list {
      display: grid;
      gap: 10px;
      margin-top: 12px;
    }

    .notification-card {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border: 1px solid rgba(217, 208, 189, .12);
      border-radius: 8px;
      background: rgba(255, 255, 255, .04);
    }

    .notification-card-icon {
      width: 38px;
      height: 38px;
      color: #9fe7ff;
    }

    .notification-card:nth-child(2) .notification-card-icon {
      color: #ffc685;
    }

    .notification-card:nth-child(3) .notification-card-icon {
      color: #a7f3d0;
    }

    .notification-panel-close .lucide,
    .notification-panel-close svg,
    .notification-card-icon .lucide,
    .notification-card-icon svg,
    .notification-hero-icon .lucide,
    .notification-hero-icon svg {
      width: 15px;
      height: 15px;
      stroke-width: 2.5;
    }

    html[data-theme="light"] .notification-hub-bell,
    html[data-theme="light"] .notification-panel {
      color: #0f172a;
    }

    html[data-theme="light"] .notification-hub-bell {
      border-color: rgba(16, 17, 38, .16);
      background: rgba(16, 17, 38, .055);
      box-shadow: none;
    }

    html[data-theme="light"] .notification-hub-bell:hover,
    html[data-theme="light"] .notification-hub.is-open .notification-hub-bell {
      background: rgba(16, 17, 38, .09);
      border-color: rgba(16, 17, 38, .28);
    }

    html[data-theme="light"] .notification-hub-badge {
      border-color: #faf6ed;
    }

    html[data-theme="light"] .notification-panel {
      border-color: rgba(16, 17, 38, .1);
      background: rgba(255, 255, 255, .97);
      box-shadow: 0 28px 80px rgba(16, 17, 38, .18);
    }

    html[data-theme="light"] .notification-panel-head strong,
    html[data-theme="light"] .notification-panel-hero strong,
    html[data-theme="light"] .notification-card strong {
      color: #0f172a;
    }

    html[data-theme="light"] .notification-panel-kicker,
    html[data-theme="light"] .notification-panel-head p,
    html[data-theme="light"] .notification-panel-hero p,
    html[data-theme="light"] .notification-card p {
      color: rgba(15, 23, 42, .62);
    }

    html[data-theme="light"] .notification-panel-close,
    html[data-theme="light"] .notification-card,
    html[data-theme="light"] .notification-hero-icon,
    html[data-theme="light"] .notification-card-icon {
      border-color: rgba(16, 17, 38, .1);
      color: #0f172a;
      background: rgba(15, 23, 42, .04);
    }

    @media (max-width: 940px) {
      .notification-hub-bell {
        width: 34px;
        height: 34px;
        min-width: 34px;
      }

      .notification-hub-backdrop {
        background: rgba(4, 5, 12, .58);
        backdrop-filter: blur(8px);
      }

      .notification-panel {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-height: min(84vh, 660px);
        max-height: min(84dvh, 660px);
        padding: 10px 14px max(16px, env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 8px 8px 0 0;
        transform: translateY(18px);
        transform-origin: bottom center;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
      }

      .notification-hub.is-open .notification-panel {
        transform: translateY(0);
      }

      .notification-panel-grip {
        display: block;
        width: 42px;
        height: 4px;
        margin: 2px auto 12px;
        border-radius: 999px;
        background: rgba(217, 208, 189, .28);
      }

      .notification-panel-head {
        margin-bottom: 12px;
      }

      .notification-panel-hero,
      .notification-card {
        grid-template-columns: 38px minmax(0, 1fr);
      }

      .notification-panel-hero button,
      .notification-card button {
        grid-column: 2;
        justify-self: start;
        margin-top: 6px;
      }
    }

    @media (max-width: 520px) {
      .notification-hub-bell {
        width: 32px;
        height: 32px;
        min-width: 32px;
      }

      .notification-hub-bell .lucide,
      .notification-hub-bell svg {
        width: 15px;
        height: 15px;
      }

      .notification-hub-badge {
        top: -4px;
        right: -4px;
        min-width: 15px;
        height: 15px;
        font-size: 8px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .notification-hub-bell,
      .notification-panel {
        transition: none;
      }
    }

    /* Pola Account Modal */
    .pola-account-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(8px);
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }

    .pola-account-modal.show {
      opacity: 1;
      pointer-events: auto;
    }

    .pola-account-content {
      background: rgba(30, 32, 47, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
      border-radius: 20px;
      width: 90%;
      max-width: 450px;
      color: #fff;
      transform: translateY(20px) scale(0.95);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .pola-account-modal.show .pola-account-content {
      transform: translateY(0) scale(1);
    }

    .pola-account-header {
      padding: 20px 24px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .pola-account-header h2 {
      margin: 0;
      font-size: 1.15rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .pola-account-close {
      background: none;
      border: none;
      color: #9ca3af;
      cursor: pointer;
      padding: 5px;
      border-radius: 5px;
      transition: all 0.2s;
    }

    .pola-account-close:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
    }

    .pola-account-tabs {
      display: flex;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      background: rgba(0, 0, 0, 0.2);
    }

    .pola-account-tab {
      flex: 1;
      padding: 15px 5px;
      background: none;
      border: none;
      color: #9ca3af;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      border-bottom: 2px solid transparent;
      font-size: 0.85rem;
    }

    .pola-account-tab:hover {
      color: #fff;
    }

    .pola-account-tab.active {
      color: #e2a866;
      border-bottom-color: #e2a866;
      background: rgba(226, 168, 102, 0.05);
    }

    .pola-account-body {
      padding: 24px;
      min-height: 250px;
      max-height: 60vh;
      overflow-y: auto;
    }

    .pola-tab-content {
      display: none;
      animation: polaFadeIn 0.3s ease;
    }

    .pola-tab-content.active {
      display: block;
    }

    @keyframes polaFadeIn {
      from {
        opacity: 0;
        transform: translateY(5px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Profile Tab */
    .pola-profile-info {
      text-align: center;
      margin-bottom: 20px;
    }

    .pola-profile-avatar {
      width: 70px;
      height: 70px;
      border-radius: 50%;
      background: linear-gradient(135deg, #e2a866, #ff7e5f);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2rem;
      font-weight: bold;
      color: #fff;
      margin: 0 auto 15px;
      box-shadow: 0 4px 15px rgba(226, 168, 102, 0.3);
    }

    .pola-profile-name {
      font-size: 1.2rem;
      font-weight: 600;
      margin-bottom: 5px;
    }

    .pola-profile-email {
      color: #9ca3af;
      font-size: 0.9rem;
      margin-bottom: 15px;
    }

    .pola-profile-points {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(226, 168, 102, 0.1);
      color: #e2a866;
      padding: 8px 16px;
      border-radius: 50px;
      font-weight: 600;
    }

    /* Form Elements */
    .pola-form-group {
      margin-bottom: 16px;
    }

    .pola-form-group label {
      display: block;
      margin-bottom: 8px;
      color: #d1d5db;
      font-size: 0.9rem;
    }

    .pola-form-control {
      width: 100%;
      padding: 12px 16px;
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      color: #fff;
      box-sizing: border-box;
      transition: border-color 0.2s;
    }

    .pola-form-control:focus {
      outline: none;
      border-color: #e2a866;
      background: rgba(0, 0, 0, 0.4);
    }

    .pola-btn {
      width: 100%;
      padding: 12px;
      border: none;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .pola-btn-primary {
      background: #e2a866;
      color: #1e202f;
    }

    .pola-btn-primary:hover {
      background: #d19555;
      transform: translateY(-1px);
    }

    .pola-btn-danger {
      background: rgba(239, 68, 68, 0.1);
      color: #ef4444;
      border: 1px solid rgba(239, 68, 68, 0.2);
      margin-top: 20px;
    }

    .pola-btn-danger:hover {
      background: rgba(239, 68, 68, 0.2);
    }

    /* History Table */
    .pola-history-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .pola-history-item {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 8px;
      padding: 12px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .pola-history-info {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .pola-history-title {
      font-size: 0.95rem;
      font-weight: 500;
    }

    .pola-history-date {
      font-size: 0.8rem;
      color: #9ca3af;
    }

    .pola-history-points {
      font-weight: bold;
      font-size: 1.1rem;
    }

    .pola-history-points.plus {
      color: #10b981;
    }

    .pola-history-points.minus {
      color: #ef4444;
    }

    .pola-empty-state {
      text-align: center;
      color: #9ca3af;
      padding: 40px 0;
    }

    #pola-form-message {
      margin-top: 15px;
      font-size: 0.9rem;
      text-align: center;
    }

    #pola-form-message.success {
      color: #10b981;
    }

    #pola-form-message.error {
      color: #ef4444;
    }

    /* Pola Auth Modal */
    .pola-auth-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(10px);
      z-index: 100000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }

    .pola-auth-modal.show {
      opacity: 1;
      pointer-events: auto;
    }

    .pola-auth-content {
      background: rgba(24, 24, 27, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
      border-radius: 24px;
      width: 90%;
      max-width: 400px;
      color: #fff;
      transform: translateY(20px) scale(0.95);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .pola-auth-modal.show .pola-auth-content {
      transform: translateY(0) scale(1);
    }

    .pola-auth-header {
      padding: 30px 24px 20px;
      text-align: center;
      position: relative;
    }

    .pola-auth-header h2 {
      margin: 0;
      font-size: 1.5rem;
      font-weight: 700;
      background: linear-gradient(135deg, #fff, #a1a1aa);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .pola-auth-header p {
      margin: 8px 0 0;
      color: #9ca3af;
      font-size: 0.88rem;
      line-height: 1.35;
    }

    .pola-auth-header p.is-bonus {
      display: inline-block;
      margin-top: 10px;
      padding: 7px 10px;
      border-radius: 10px;
      background: rgba(226, 168, 102, 0.1);
      border: 1px solid rgba(226, 168, 102, 0.2);
      color: #f0c993;
      font-weight: 750;
    }

    .pola-auth-close {
      position: absolute;
      top: 15px;
      right: 15px;
      background: rgba(255, 255, 255, 0.05);
      border: none;
      color: #9ca3af;
      cursor: pointer;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }

    .pola-auth-close:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.15);
    }

    .pola-auth-tabs {
      display: flex;
      margin: 0 24px 20px;
      background: rgba(0, 0, 0, 0.3);
      border-radius: 12px;
      padding: 4px;
    }

    .pola-auth-tab {
      flex: 1;
      padding: 10px;
      background: none;
      border: none;
      color: #9ca3af;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      border-radius: 8px;
      font-size: 0.9rem;
    }

    .pola-auth-register-tab {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      line-height: 1;
      white-space: nowrap;
    }

    .pola-auth-register-tab strong {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 18px;
      padding: 2px 6px;
      border-radius: 999px;
      background: rgba(226, 168, 102, 0.18);
      color: #f3c37f;
      font-size: 0.68rem;
      font-weight: 800;
      white-space: nowrap;
    }

    .pola-auth-tab:hover {
      color: #fff;
    }

    .pola-auth-tab.active {
      color: #18181b;
      background: #e2a866;
      box-shadow: 0 2px 8px rgba(226, 168, 102, 0.3);
    }

    .pola-auth-tab.active strong {
      background: rgba(24, 24, 27, 0.12);
      color: #18181b;
    }

    .pola-auth-body {
      padding: 0 24px 30px;
      position: relative;
    }

    .pola-auth-form {
      position: absolute;
      visibility: hidden;
      opacity: 0;
      width: 100%;
      top: 0;
      left: 0;
      transition: opacity 0.3s ease;
    }

    .pola-auth-form.active {
      position: relative;
      visibility: visible;
      opacity: 1;
    }

    .pola-auth-message {
      margin-top: 15px;
      font-size: 0.9rem;
      text-align: center;
      padding: 10px;
      border-radius: 8px;
      display: none;
    }

    .pola-auth-message.error {
      display: block;
      background: rgba(239, 68, 68, 0.1);
      color: #ef4444;
      border: 1px solid rgba(239, 68, 68, 0.2);
    }

    .pola-auth-message.success {
      display: block;
      background: rgba(16, 185, 129, 0.1);
      color: #10b981;
      border: 1px solid rgba(16, 185, 129, 0.2);
    }

    /* --- MOBILE OPTIMIZATIONS --- */
    @media (max-width: 940px) {
      .topbar {
        backdrop-filter: none;
        background: #101126;
      }

    html[data-theme="light"] .topbar {
        background: var(--surface);
      }

      .panel {
        backdrop-filter: none;
        background: #101126;
      }

    html[data-theme="light"] .panel {
        background: var(--surface);
      }

      .polafilm-modal {
        backdrop-filter: none;
        background: rgba(4, 5, 12, .9);
      }

      .stage::before {
        display: none;
      }

      .stage {
        background: #000;
      }

    html[data-theme="light"] .stage {
        background: #f8fafc;
      }

      .polafilm::after,
      .polaroid-card::before {
        display: none !important;
      }

      .polaroid-card,
      .frame-paper,
      .frame-black,
      .frame-strip {
        transform: translateZ(0);
        will-change: transform;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(255, 255, 255, 0.4) inset !important;
      }

    html[data-theme="light"] .polaroid-card,

    html[data-theme="light"] .frame-paper,

    html[data-theme="light"] .frame-black,

    html[data-theme="light"] .frame-strip {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(255, 255, 255, 0.4) inset !important;
      }

      .photo-slot {
        transform: translateZ(0);
        will-change: filter, background-position;
      }
    }


/* Light mode header contrast tune */

    html[data-theme="light"] .topbar {
  background: rgba(250, 246, 237, .94);
  border-bottom-color: rgba(16, 17, 38, .16);
  box-shadow: 0 1px 0 rgba(16, 17, 38, .05);
}

    html[data-theme="light"] .theme-toggle,

    html[data-theme="light"] .wallet,

    html[data-theme="light"] .more-btn {
  color: #101126;
  background: rgba(16, 17, 38, .055);
  border-color: rgba(16, 17, 38, .16);
}

    html[data-theme="light"] .theme-toggle:hover,

    html[data-theme="light"] .wallet:hover,

    html[data-theme="light"] .more-btn:hover {
  background: rgba(16, 17, 38, .09);
  border-color: rgba(16, 17, 38, .28);
}

    html[data-theme="light"] .user-greeting {
  color: rgba(16, 17, 38, .78);
}

    html[data-theme="light"] .user-greeting:hover {
  color: #101126;
}

    html[data-theme="light"] .membership-badge {
  color: #b0145d;
  background: rgba(240, 44, 120, .14);
  border-color: rgba(240, 44, 120, .38);
}

    html[data-theme="light"] .membership-badge[data-plan="free"] {
  color: #101126;
  background: rgba(16, 17, 38, .06);
  border-color: rgba(16, 17, 38, .16);
}

    html[data-theme="light"] .recharge {
  color: #ffffff;
  background: #101126;
  border-color: #101126;
}

    html[data-theme="light"] .recharge:hover {
  background: #24243f;
  border-color: #24243f;
}

    .header-login-btn {
      position: relative;
      min-width: 108px;
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      overflow: hidden;
      padding: 0 14px 0 12px;
      color: #fff8e6;
      background: linear-gradient(135deg, rgba(255, 248, 230, .11), rgba(56, 189, 248, .08));
      border: 1px solid rgba(217, 208, 189, .22);
      border-radius: 8px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 24px rgba(0, 0, 0, .14);
      font-size: 12px;
      font-weight: 850;
      letter-spacing: 0;
      cursor: pointer;
      white-space: nowrap;
      text-decoration: none;
      transform: translateZ(0);
      transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    }

    .header-login-btn::after {
      content: "";
      position: absolute;
      inset: 0;
      width: 42%;
      background: linear-gradient(90deg, transparent, rgba(255, 248, 230, .24), transparent);
      opacity: 0;
      transform: translateX(-120%);
      transition: opacity .18s ease;
      pointer-events: none;
    }

    .header-login-btn:hover {
      color: #ffffff;
      background: linear-gradient(135deg, rgba(255, 248, 230, .16), rgba(56, 189, 248, .13));
      border-color: rgba(255, 248, 230, .42);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 28px rgba(0, 0, 0, .2), 0 0 18px rgba(56, 189, 248, .1);
      transform: translateY(-1px);
    }

    .header-login-btn:hover::after {
      opacity: 1;
      animation: header-login-glint 1.15s ease-in-out;
    }

    .header-login-btn svg,
    .header-login-btn i {
      position: relative;
      z-index: 1;
      width: 22px;
      height: 22px;
      flex: 0 0 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      border: 1px solid rgba(248, 210, 141, .24);
      border-radius: 50%;
      box-sizing: border-box;
      color: #f8d28d;
      background: radial-gradient(circle at 35% 28%, rgba(255, 248, 230, .2), rgba(248, 210, 141, .08) 42%, rgba(56, 189, 248, .08));
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 14px rgba(248, 210, 141, .1);
      stroke-width: 2.4;
    }

    .header-login-btn i::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: currentColor;
      box-shadow: 0 8px 0 -2px currentColor;
    }

    .header-login-btn span {
      position: relative;
      z-index: 1;
    }

    .header-login-btn[hidden] {
      display: none !important;
    }

    @keyframes header-login-glint {
      0% { transform: translateX(-120%); }
      100% { transform: translateX(260%); }
    }

    html[data-theme="light"] .header-login-btn {
      color: #101126;
      background: linear-gradient(135deg, rgba(239, 229, 207, .92), rgba(255, 255, 255, .68));
      border-color: rgba(16, 17, 38, .14);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), 0 8px 22px rgba(16, 17, 38, .08);
    }

    html[data-theme="light"] .header-login-btn:hover {
      color: #101126;
      background: linear-gradient(135deg, rgba(239, 229, 207, 1), rgba(255, 255, 255, .88));
      border-color: rgba(16, 17, 38, .24);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 26px rgba(16, 17, 38, .12), 0 0 18px rgba(249, 115, 22, .1);
    }

    html[data-theme="light"] .header-login-btn svg,
    html[data-theme="light"] .header-login-btn i {
      color: #9a5f17;
      border-color: rgba(154, 95, 23, .18);
      background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .9), rgba(239, 229, 207, .72) 44%, rgba(154, 95, 23, .08));
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 14px rgba(154, 95, 23, .08);
    }


    @media (max-width: 520px) {
      .header-login-btn {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        gap: 0;
        padding: 0;
      }

      .header-login-btn span {
        display: none;
      }
    }

    /* Mobile header compact polish */
    @media (max-width: 520px) {
      .topbar {
        min-height: 58px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px;
        padding: 0 8px;
      }

      .theme-toggle {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
      }

      .top-left-actions {
        gap: 4px;
      }

      .brand {
        min-width: 0;
        justify-self: start;
        gap: 4px;
      }

      .brand-logo {
        height: 26px;
      }

      .brand-title {
        font-size: 27px;
      }

      .brand-by {
        display: none;
      }

      .top-actions {
        min-width: 0;
        gap: 4px;
      }

      .header-login-btn,
      .wallet,
      .notification-hub-bell,
      .more-btn {
        width: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        border-radius: 8px;
      }

      .header-login-btn svg,
      .header-login-btn i {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
        padding: 3px;
      }

      .wallet svg,
      .wallet i,
      .notification-hub-bell svg,
      .notification-hub-bell i,
      .more-btn svg,
      .more-btn i {
        width: 16px;
        height: 16px;
      }

      .wallet span,
      .header-login-btn span,
      .user-account-summary {
        display: none !important;
      }

      .recharge {
        min-width: 54px;
        min-height: 32px;
        gap: 4px;
        padding: 0 8px;
        border-radius: 8px;
        font-size: 0;
      }

      .recharge svg,
      .recharge i {
        width: 13px;
        height: 13px;
      }

      .recharge span {
        font-size: 0;
        line-height: 1;
      }

      .recharge span::after {
        content: "Nạp";
        font-size: 12px;
        font-weight: 900;
        letter-spacing: 0;
      }
    }

    @media (max-width: 380px) {
      .topbar {
        gap: 5px;
        padding-left: 6px;
        padding-right: 6px;
      }

      .brand-logo {
        height: 24px;
      }

      .brand-title {
        font-size: 25px;
      }

      .top-actions {
        gap: 3px;
      }

      .top-left-actions {
        gap: 3px;
      }

      .header-login-btn,
      .wallet,
      .notification-hub-bell,
      .more-btn {
        width: 31px;
        min-width: 31px;
        min-height: 31px;
      }

      .recharge {
        width: 31px;
        min-width: 31px;
        min-height: 31px;
        padding: 0;
      }

      .recharge span {
        display: none;
      }
    }

    @media (max-width: 340px) {
      .brand-title {
        font-size: 23px;
      }

      .wallet {
        display: none;
      }
    }



/* Desktop preview fills the vertical workspace up to the action dock. */
@media (min-width: 941px) {
  .polafilm:not(.tool-locked) {
    --stage-preview-gap: 0px;
    --stage-preview-height: calc(100dvh - 72px - var(--stage-actions-height) - var(--stage-actions-bottom));
    --card-width: min(clamp(320px, 44vw, 620px), calc(var(--stage-preview-height) * var(--variant-frame-aspect, .75)), calc(100vw - var(--editor-panel-width) - 56px));
  }

  .polafilm:not(.tool-locked) .stage {
    justify-content: flex-end;
    gap: 0;
    padding-top: 0;
    padding-bottom: calc(var(--stage-actions-height) + var(--stage-actions-bottom));
  }

  .polafilm:not(.tool-locked):not(.is-compare-mode).is-horizontal-single .stage {
    justify-content: center;
  }

  .polafilm:not(.tool-locked).is-compare-mode .stage {
    justify-content: center;
  }

  .polafilm:not(.tool-locked).is-compare-mode .preview-wrap.compare-active {
    transform: none;
  }

  .polafilm:not(.tool-locked) .preview-wrap {
    max-height: var(--stage-preview-height);
  }

  .polafilm:not(.tool-locked) .preview-wrap.preview-wide {
    width: min(clamp(320px, 60vw, 920px), calc(100vw - var(--editor-panel-width) - 84px), calc(var(--stage-preview-height) * 1.5)) !important;
    height: auto !important;
    max-height: var(--stage-preview-height);
  }

  .polafilm:not(.tool-locked):not(.is-compare-mode).is-horizontal-single .preview-wrap.preview-landscape,
  .polafilm:not(.tool-locked):not(.is-compare-mode).is-horizontal-single .preview-wrap.preview-wide {
    margin-block: auto;
  }

  .polafilm:not(.tool-locked) .polaroid-card.frame-none {
    width: min(calc(var(--stage-preview-height) * var(--variant-frame-aspect, .75)), calc(100vw - var(--editor-panel-width) - 56px)) !important;
    height: var(--stage-preview-height) !important;
    max-height: var(--stage-preview-height);
  }

  .polafilm:not(.tool-locked) .polaroid-card.frame-none.ratio-landscape {
    width: min(clamp(320px, 58vw, 1040px), calc(100vw - var(--editor-panel-width) - 56px), calc(var(--stage-preview-height) * 1.5)) !important;
    height: auto !important;
    max-height: var(--stage-preview-height);
  }

  .polafilm:not(.tool-locked) .polaroid-card.frame-none.ratio-wide {
    width: min(clamp(320px, 60vw, 920px), calc(100vw - var(--editor-panel-width) - 84px), calc(var(--stage-preview-height) * 1.5)) !important;
    height: auto !important;
    max-height: var(--stage-preview-height);
  }

  .polafilm:not(.tool-locked) .polaroid-card.frame-none.ratio-landscape .photo-slot,
  .polafilm:not(.tool-locked) .polaroid-card.frame-none.ratio-wide .photo-slot {
    height: auto !important;
  }
}
