
    :root {
      --ink: #0a0b14;
      --ink-soft: #141628;
      --card: #ffffff;
      --text: #1a1220;
      --muted: #6b6472;
      --line: #f0e4ec;
      --rose: #c2185b;
      --rose-bright: #e11d74;
      --rose-soft: #fce7f1;
      --rose-border: #f9a8d4;
      --ok: #059669;
      --warn: #b45309;
      --shadow: 0 18px 50px rgba(8, 6, 20, 0.35);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    html, body {
      min-height: 100%;
      font-family: "Manrope", sans-serif;
      color: var(--text);
      background: var(--ink);
    }

    body {
      overflow-x: hidden;
    }

    .starry {
      position: fixed;
      inset: 0;
      z-index: 0;
      background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(194, 24, 91, 0.22), transparent 55%),
        radial-gradient(ellipse 60% 40% at 85% 80%, rgba(120, 40, 90, 0.18), transparent 50%),
        linear-gradient(180deg, #090a1a 0%, #0d0f22 50%, #080912 100%);
      pointer-events: none;
    }

    .star {
      position: absolute;
      border-radius: 50%;
      background: #fff;
      opacity: 0.7;
      animation: twinkle linear infinite;
    }

    @keyframes twinkle {
      0%, 100% { opacity: 0.25; transform: scale(0.8); }
      50% { opacity: 0.95; transform: scale(1.15); }
    }

    .page {
      position: relative;
      z-index: 1;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      padding: 28px 14px 48px;
    }

    .shell {
      width: 100%;
      max-width: 520px;
    }

    @media (min-width: 900px) {
      .shell { max-width: 1180px; }
      .page { padding: 36px 24px 56px; }
      .card { padding: 22px 22px 26px; }
    }

    @media (min-width: 1280px) {
      .shell { max-width: 1440px; }
    }

    @media (min-width: 1600px) {
      .shell { max-width: 1680px; }
    }

    /* Studio: form trái + preview phải (desktop); mobile xếp dọc */
    .studio {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .studio-main {
      min-width: 0;
      order: 1;
    }

    .studio-preview {
      display: block;
      order: 2;
    }

    .preview-panel {
      background: #0f1224;
      border-radius: 16px;
      padding: 12px 12px 14px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    }

    .preview-toolbar {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
    }

    .preview-toolbar .preview-title {
      color: rgba(255, 230, 242, 0.9);
      font-size: 0.78rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      min-width: 0;
      justify-self: start;
    }

    .preview-modes {
      display: inline-flex;
      gap: 4px;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 999px;
      padding: 3px;
      justify-self: center;
    }

    .preview-tools {
      display: inline-flex;
      gap: 4px;
      justify-self: end;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 999px;
      padding: 3px;
    }

    .preview-mode-btn {
      border: 0;
      background: transparent;
      color: rgba(255, 255, 255, 0.65);
      font-size: 0.72rem;
      font-weight: 600;
      padding: 5px 10px;
      border-radius: 999px;
      cursor: pointer;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .preview-mode-btn .preview-mode-icon {
      width: 13px;
      height: 13px;
      flex-shrink: 0;
      display: block;
    }

    .preview-mode-btn.active {
      background: var(--rose-bright);
      color: #fff;
    }

    .preview-tool-btn {
      border: 0;
      background: transparent;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 30px;
      min-width: 30px;
      padding: 5px 0;
      border-radius: 999px;
      color: rgba(255, 255, 255, 0.85);
      cursor: pointer;
      font-family: inherit;
    }

    .preview-tool-btn:hover {
      background: rgba(255, 255, 255, 0.16);
      color: #fff;
    }

    .preview-restart-btn .preview-restart-icon {
      width: 15px;
      height: 15px;
      display: block;
      overflow: visible;
    }

    .preview-fs-btn .preview-fs-icon {
      width: 15px;
      height: 15px;
      display: block;
      overflow: visible;
    }

    .preview-fs-btn.is-active .preview-fs-expand,
    .preview-fs-btn .preview-fs-compress[hidden] {
      display: none;
    }

    .preview-fs-btn.is-active .preview-fs-compress {
      display: block;
    }

    .preview-fs-btn.is-active {
      background: rgba(255, 255, 255, 0.16);
      color: #fff;
    }

    body.preview-is-fullscreen {
      overflow: hidden;
    }

    body.preview-is-fullscreen .brand,
    body.preview-is-fullscreen .studio-main,
    body.preview-is-fullscreen .buy-form-panel,
    body.preview-is-fullscreen .foot-note,
    body.preview-is-fullscreen .app-tabbar {
      display: none !important;
    }

    /* .card animation transform chặn position:fixed — tắt khi phóng */
    body.preview-is-fullscreen .card,
    body.preview-is-fullscreen .page,
    body.preview-is-fullscreen .shell,
    body.preview-is-fullscreen .studio,
    body.preview-is-fullscreen .studio-preview {
      animation: none !important;
      transform: none !important;
      filter: none !important;
      perspective: none !important;
      contain: none !important;
      max-width: none !important;
      width: 100% !important;
      padding: 0 !important;
      margin: 0 !important;
      position: static !important;
      background: transparent !important;
      box-shadow: none !important;
      border-radius: 0 !important;
    }

    body.preview-is-fullscreen .studio {
      display: block !important;
      grid-template-columns: none !important;
    }

    body.preview-is-fullscreen .studio-preview {
      display: block !important;
      order: initial !important;
      top: auto !important;
    }

    .preview-fs-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9998;
      background: #070814;
    }

    body.preview-is-fullscreen .preview-fs-backdrop {
      display: block;
    }

    .preview-panel.is-preview-fullscreen {
      position: fixed !important;
      inset: 0 !important;
      z-index: 10000;
      width: 100vw !important;
      height: 100dvh !important;
      max-width: none !important;
      border-radius: 0;
      display: flex;
      flex-direction: column;
      padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
      background: #070814;
      border: 0;
      box-shadow: none;
    }

    .preview-panel.is-preview-fullscreen .preview-toolbar {
      flex-shrink: 0;
    }

    .preview-panel.is-preview-fullscreen .preview-stage {
      flex: 1;
      min-height: 0;
      border-radius: 12px;
      align-items: center;
    }

    .preview-panel.is-preview-fullscreen .preview-device {
      max-width: min(420px, 100%);
      height: min(calc(100dvh - 110px), 860px);
    }

    .preview-panel.is-preview-fullscreen .preview-device.is-desktop {
      max-width: min(1100px, 96%);
      height: min(calc(100dvh - 110px), 820px);
    }

    .preview-nav-btn {
      display: none;
    }

    .preview-nav-btn[hidden] {
      display: none !important;
      pointer-events: none;
    }

    .preview-panel.is-preview-fullscreen .preview-stage {
      position: relative;
    }

    .preview-panel.is-preview-fullscreen .preview-nav-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 5;
      width: 44px;
      height: 44px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      cursor: pointer;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }

    .preview-panel.is-preview-fullscreen .preview-nav-btn:disabled {
      opacity: 0.35;
      cursor: default;
      pointer-events: none;
    }

    .preview-panel.is-preview-fullscreen .preview-nav-btn:hover {
      background: rgba(225, 29, 116, 0.85);
      border-color: rgba(255, 255, 255, 0.35);
    }

    .preview-panel.is-preview-fullscreen .preview-nav-btn:active {
      transform: translateY(-50%) scale(0.96);
    }

    .preview-panel.is-preview-fullscreen .preview-nav-prev {
      left: 10px;
    }

    .preview-panel.is-preview-fullscreen .preview-nav-next {
      right: 10px;
    }

    .preview-panel.is-preview-fullscreen .preview-nav-btn svg {
      width: 22px;
      height: 22px;
      display: block;
    }

    @media (min-width: 960px) {
      .preview-panel.is-preview-fullscreen .preview-nav-btn {
        width: 52px;
        height: 52px;
      }
      .preview-panel.is-preview-fullscreen .preview-nav-prev {
        left: 18px;
      }
      .preview-panel.is-preview-fullscreen .preview-nav-next {
        right: 18px;
      }
      .preview-panel.is-preview-fullscreen .preview-nav-btn svg {
        width: 26px;
        height: 26px;
      }
    }

    @media (max-width: 959px), (any-pointer: coarse) {
      .preview-panel.is-preview-fullscreen .preview-nav-btn {
        display: none !important;
        pointer-events: none;
      }
    }

    .preview-stage {
      display: flex;
      justify-content: center;
      background:
        radial-gradient(ellipse 90% 70% at 50% 38%, rgba(80, 40, 120, 0.45), transparent 55%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(120, 30, 80, 0.28), transparent 50%),
        radial-gradient(ellipse 55% 45% at 85% 20%, rgba(30, 50, 120, 0.3), transparent 48%),
        #03020c;
      border-radius: 12px;
      padding: 12px;
      min-height: 420px;
    }

    .preview-device {
      position: relative;
      width: 100%;
      max-width: 320px;
      height: 560px;
      border-radius: 18px;
      overflow: hidden;
      background: #03020c;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
      border: 2px solid rgba(255, 255, 255, 0.12);
      transition: max-width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
    }

    .preview-device.is-desktop {
      max-width: 100%;
      height: 360px;
      border-radius: 10px;
    }

    .preview-device iframe {
      width: 100%;
      height: 100%;
      border: 0;
      background: #03020c;
      display: block;
    }

    .preview-buy-btn {
      position: absolute;
      left: 50%;
      bottom: 12px;
      z-index: 3;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 13px 6px 10px;
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 999px;
      background: linear-gradient(135deg, #ff8fc0, #ec2a80);
      color: #fff;
      font: inherit;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      letter-spacing: 0.02em;
      white-space: nowrap;
      cursor: pointer;
      box-shadow: 0 6px 16px rgba(236, 42, 128, 0.45);
      transform: translateX(-50%);
      animation: preview-buy-pulse 2.4s ease-in-out infinite;
      -webkit-tap-highlight-color: transparent;
    }

    .preview-buy-btn svg {
      width: 13px;
      height: 13px;
    }

    .preview-buy-btn:hover {
      background: linear-gradient(135deg, #ffa3cc, #f23d8e);
    }

    .preview-buy-btn:active {
      transform: translateX(-50%) scale(0.94);
    }

    .preview-buy-btn:focus-visible {
      outline: 2px solid #fff;
      outline-offset: 2px;
    }

    .preview-device.is-desktop .preview-buy-btn,
    body.app-view-buy .preview-buy-btn {
      display: none;
    }

    @keyframes preview-buy-pulse {
      0%, 100% { box-shadow: 0 6px 16px rgba(236, 42, 128, 0.45); }
      50% { box-shadow: 0 6px 22px rgba(255, 110, 170, 0.75); }
    }

    @media (prefers-reduced-motion: reduce) {
      .preview-buy-btn { animation: none; }
    }

    .preview-device .preview-gate {
      position: absolute;
      inset: 0;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 28px 22px;
      text-align: center;
      color: #fff;
      overflow: hidden;
      isolation: isolate;
      background: radial-gradient(ellipse at 50% 35%, #35203e 0, #130c20 52%, #03020c 100%);
    }

    .preview-gate::before,
    .preview-loading::before {
      content: "";
      position: absolute;
      inset: -40px;
      z-index: -2;
      background: var(--preview-poster, none) center / cover no-repeat;
      filter: blur(26px) saturate(1.25);
      opacity: 0.55;
      transform: scale(1.1);
      transition: opacity 0.6s ease;
    }

    .preview-gate::after,
    .preview-loading::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(20, 8, 30, 0.1), rgba(8, 4, 16, 0.72) 100%),
        linear-gradient(180deg, rgba(8, 4, 16, 0.15), rgba(8, 4, 16, 0.6));
    }

    .preview-gate-stage {
      position: relative;
      width: min(86%, 300px);
      margin-bottom: 14px;
    }

    .preview-gate-poster {
      aspect-ratio: 16 / 10;
      border-radius: 18px;
      background: var(--preview-poster, none) center / cover no-repeat, linear-gradient(135deg, #3a2046, #1a1026);
      box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 18px 40px rgba(0, 0, 0, 0.45),
        0 0 60px rgba(255, 110, 170, 0.22);
      cursor: pointer;
      animation: gate-float 5s ease-in-out infinite;
    }

    .preview-gate-poster.is-in {
      animation: gate-poster-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both, gate-float 5s ease-in-out 0.7s infinite;
    }

    .preview-gate-play {
      position: absolute;
      left: 50%;
      bottom: 0;
      transform: translate(-50%, 50%);
    }

    .preview-gate-play::before,
    .preview-gate-play::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 1.5px solid rgba(255, 170, 205, 0.7);
      animation: gate-ring 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
      pointer-events: none;
    }

    .preview-gate-play::after { animation-delay: 1.2s; }

    .preview-gate .preview-playback-btn {
      position: relative;
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.45);
      background: linear-gradient(135deg, #ff7eb6, #e11d74);
      box-shadow: 0 10px 26px rgba(225, 29, 116, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
      transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    }

    .preview-gate .preview-playback-btn:hover:not(:disabled) {
      background: linear-gradient(135deg, #ff8fc0, #ec2a80);
      transform: scale(1.08);
      box-shadow: 0 14px 32px rgba(225, 29, 116, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    }

    .preview-gate .preview-playback-btn svg { margin-left: 3px; }

    .preview-gate-name {
      margin-top: 20px;
      text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    }

    .preview-gate-hint {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: rgba(255, 214, 232, 0.72);
    }

    .preview-loading {
      position: absolute;
      inset: 0;
      z-index: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 16px;
      color: #fff;
      overflow: hidden;
      isolation: isolate;
      background: #0b0614;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.55s ease, visibility 0s linear 0.55s;
    }

    .preview-device.is-loading .preview-loading {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      transition: opacity 0.25s ease;
    }

    .preview-loading-heart {
      width: 68px;
      height: 68px;
      overflow: visible;
      filter: drop-shadow(0 0 16px rgba(255, 110, 170, 0.55));
    }

    .preview-loading-stroke {
      fill: none;
      stroke: #ffc2dc;
      stroke-width: 1.4;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-dasharray: 26 74;
      animation: gate-trace 1.6s linear infinite;
    }

    .preview-loading-fill {
      fill: #e11d74;
      opacity: 0.85;
      transform-origin: 12px 13px;
      animation: gate-beat 1.2s ease-in-out infinite;
    }

    .preview-loading-bar {
      position: relative;
      width: 120px;
      height: 2px;
      border-radius: 2px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.12);
    }

    .preview-loading-bar span {
      position: absolute;
      inset: 0 auto 0 0;
      width: 40%;
      border-radius: inherit;
      background: linear-gradient(90deg, transparent, #ff7eb6, #ffd1e4);
      animation: gate-bar 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    }

    .preview-loading-text {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: rgba(255, 214, 232, 0.75);
    }

    @keyframes gate-float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-6px); }
    }

    @keyframes gate-poster-in {
      from { opacity: 0; transform: translateY(10px) scale(0.96); filter: blur(6px); }
      to { opacity: 1; transform: none; filter: none; }
    }

    @keyframes gate-ring {
      from { transform: scale(1); opacity: 0.9; }
      to { transform: scale(1.75); opacity: 0; }
    }

    @keyframes gate-trace {
      to { stroke-dashoffset: -100; }
    }

    @keyframes gate-beat {
      0%, 100% { transform: scale(0.62); }
      15% { transform: scale(0.74); }
      30% { transform: scale(0.66); }
    }

    @keyframes gate-bar {
      from { transform: translateX(-100%); }
      to { transform: translateX(250%); }
    }

    @media (prefers-reduced-motion: reduce) {
      .preview-gate-poster,
      .preview-gate-poster.is-in,
      .preview-gate-play::before,
      .preview-gate-play::after,
      .preview-loading-stroke,
      .preview-loading-fill,
      .preview-loading-bar span { animation: none; }
    }

    .preview-device .preview-gate[hidden],
    .preview-playback-btn svg[hidden] { display: none; }

    .preview-playback-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      width: 44px;
      height: 44px;
      padding: 0;
      border: 1px solid rgba(255, 158, 196, .3);
      border-radius: 50%;
      color: #ffb7d2;
      background: rgba(255, 158, 196, .12);
      cursor: pointer;
    }

    .preview-playback-btn svg { width: 22px; height: 22px; }
    .preview-playback-btn:hover { background: rgba(255, 158, 196, .23); }
    .preview-playback-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
    .preview-playback-btn:disabled, .preview-restart-btn:disabled { opacity: .45; cursor: default; }
    .preview-gate .preview-playback-btn { width: 68px; height: 68px; }
    .preview-gate .preview-playback-btn svg { width: 28px; height: 28px; }
    .preview-gate-name { font: inherit; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }

    @media (max-width: 599px) {
      .preview-toolbar .preview-mode-btn span { display: none; }
    }

    @media (min-width: 960px) {
      .studio {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(460px, 580px);
        gap: 16px;
        align-items: start;
      }

      .studio-main,
      .studio-preview {
        order: initial;
      }

      .studio-preview {
        position: sticky;
        top: 18px;
      }

      .preview-stage {
        min-height: 560px;
      }

      .preview-device {
        max-width: 400px;
        height: 700px;
      }

      .preview-device.is-desktop {
        max-width: 100%;
        height: 480px;
      }
    }

    /* Trang mua hàng: form trái + preview phải */
    .buy-form-panel {
      display: none;
      min-width: 0;
      order: 1;
      background: #fff;
      border-radius: 16px;
      border: 1px solid rgba(26, 18, 32, 0.08);
      box-shadow: 0 10px 28px rgba(10, 8, 20, 0.08);
      padding: 16px 16px 8px;
      max-height: min(86vh, 920px);
      overflow: auto;
      text-align: left;
      color: #1a1220;
    }

    .buy-form-head {
      margin-bottom: 14px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--line, #eee);
    }

    .btn-buy-back {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      border: 0;
      background: transparent;
      color: #be185d;
      font-weight: 700;
      font-size: 0.82rem;
      font-family: inherit;
      cursor: pointer;
      padding: 0;
      margin-bottom: 8px;
    }

    .btn-buy-back:hover { filter: brightness(0.9); }

    .buy-form-head h2 {
      margin: 0;
      font-family: "Cormorant Garamond", serif;
      font-size: 1.55rem;
      font-weight: 700;
      color: #9f1239;
      line-height: 1.2;
    }

    .buy-form-sub {
      margin: 4px 0 0;
      font-size: 0.84rem;
      color: #6b5b66;
    }

    body.app-view-buy .studio-main {
      display: none !important;
    }

    body.app-view-buy .buy-form-panel {
      display: block;
    }

    body.app-view-buy .studio-preview {
      display: block;
      order: 2;
      position: sticky;
      top: 12px;
      align-self: start;
    }

    body.app-view-buy .preview-title::after {
      content: none;
    }

    @media (min-width: 960px) {
      body.app-view-buy .studio {
        display: grid;
        grid-template-columns: minmax(320px, 640px) minmax(360px, 528px);
        justify-content: center;
        gap: 14px;
        align-items: start;
      }

      body.app-view-buy .buy-form-panel {
        max-width: 640px;
        max-height: min(88vh, 960px);
        width: 100%;
        justify-self: stretch;
      }

      body.app-view-buy .studio-preview {
        width: 100%;
        max-width: 528px;
        justify-self: stretch;
      }

      body.app-view-buy .preview-stage {
        min-height: min(62vh, 640px);
      }
    }

    .checkout-bar-inline {
      position: sticky;
      bottom: 0;
      background: #fff;
      padding-top: 12px;
      margin-top: 8px;
      border-top: 1px solid var(--line);
      z-index: 2;
    }

    .checkout-actions {
      display: grid;
      grid-template-columns: 1fr 1.6fr;
      gap: 8px;
      align-items: stretch;
    }

    .checkout-actions .btn-apply,
    .checkout-actions .btn-pay {
      width: 100%;
      margin: 0;
      min-height: 48px;
    }

    .checkout-actions .btn-apply {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 12px 10px;
      font-size: 0.9rem;
      font-weight: 700;
      border-radius: 12px;
      border: 1px solid #f3a0c8;
      background: #fff5f9;
      color: #be185d;
    }

    .checkout-actions .btn-apply:hover {
      background: #fce7f1;
      border-color: #e11d74;
    }

    .checkout-actions .btn-apply-icon {
      flex-shrink: 0;
    }

    .checkout-actions .btn-apply.is-pending {
      box-shadow: 0 0 0 2px rgba(225, 29, 116, 0.28);
      animation: apply-pulse 1.4s ease infinite;
    }

    @keyframes apply-pulse {
      0%, 100% { box-shadow: 0 0 0 2px rgba(225, 29, 116, 0.22); }
      50% { box-shadow: 0 0 0 4px rgba(225, 29, 116, 0.12); }
    }

    .checkout-actions .btn-pay {
      padding: 12px 10px;
      font-size: 0.95rem;
    }

    .checkout-bar-inline .summary {
      margin-bottom: 8px;
      text-align: center;
      font-size: 0.82rem;
    }

    .preview-link {
      display: none !important;
    }

    .brand {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      text-align: left;
      margin-bottom: 10px;
      animation: rise 0.7s ease both;
    }

    .brand h1 {
      font-family: "Cormorant Garamond", serif;
      font-size: clamp(2rem, 6vw, 2.55rem);
      font-weight: 700;
      letter-spacing: 0.02em;
      color: #fff;
      text-shadow: 0 0 40px rgba(225, 29, 116, 0.45);
    }

    .brand h1 span {
      color: var(--rose-bright);
    }

    .brand h1 .brand-logo-img {
      display: block;
      max-width: min(220px, 70vw);
      max-height: 72px;
      margin: 0;
      object-fit: contain;
    }

    .brand p {
      margin-top: 6px;
      color: rgba(255, 230, 242, 0.72);
      font-size: 0.92rem;
    }

    .brand-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .btn-account {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 8px 14px;
      border-radius: 999px;
      border: 1px solid rgba(255, 182, 213, 0.45);
      background: rgba(255, 255, 255, 0.08);
      color: #ffe6f2;
      text-decoration: none;
      font-size: 0.86rem;
      font-weight: 650;
      letter-spacing: 0.01em;
      backdrop-filter: blur(8px);
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
      white-space: nowrap;
    }

    .btn-account:hover {
      background: rgba(225, 29, 116, 0.28);
      border-color: rgba(255, 158, 196, 0.8);
      transform: translateY(-1px);
    }

    .btn-support {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      padding: 6px 12px;
      border-radius: 999px;
      border: 1px solid rgba(255, 182, 213, 0.35);
      background: transparent;
      color: #ffe6f2;
      text-decoration: none;
      font-size: 0.8rem;
      font-weight: 650;
      letter-spacing: 0.01em;
      backdrop-filter: blur(8px);
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
      white-space: nowrap;
    }

    .btn-support:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 158, 196, 0.7);
      transform: translateY(-1px);
    }

    .card {
      background: var(--card);
      border-radius: 18px;
      box-shadow: var(--shadow);
      padding: 18px 16px 22px;
      animation: rise 0.85s 0.08s ease both;
    }

    @keyframes rise {
      from { opacity: 0; transform: translateY(18px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .section {
      margin-bottom: 18px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--line);
    }

    .section:last-of-type {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }

    .section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 12px;
    }

    .label-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .btn-guide {
      appearance: none;
      -webkit-appearance: none;
      border: 1px solid #f9a8d4;
      background: #fce7f1;
      color: #c2185b;
      font: 600 0.78rem/1 "Manrope", sans-serif;
      padding: 7px 12px;
      border-radius: 10px;
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }

    .btn-guide:hover {
      background: #fff;
      border-color: #e11d74;
      transform: translateY(-1px);
    }

    .label {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text);
    }

    .label.accent { color: var(--rose); }

    .badge {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--muted);
      background: #f5f3f6;
      border-radius: 999px;
      padding: 4px 10px;
    }

    .filter-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
    }

    .filter-chip {
      appearance: none;
      border: 1px solid #e8e0e6;
      background: #fff;
      color: var(--muted);
      font: 600 0.8rem/1 "Manrope", sans-serif;
      padding: 8px 12px;
      border-radius: 999px;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
    }

    .filter-chip:hover {
      border-color: var(--rose-border);
      color: var(--rose);
      transform: translateY(-1px);
    }

    .filter-chip.active {
      background: var(--rose-soft);
      border-color: var(--rose-bright);
      color: var(--rose);
    }

    .filter-empty {
      grid-column: 1 / -1;
      text-align: center;
      padding: 28px 12px;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .template-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    @media (min-width: 700px) {
      .template-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
      }
      .thumb { height: 110px; }
    }

    /* Desktop: tối đa 4 cột, thumbnail nhỏ hơn → preview rộng hơn */
    @media (min-width: 960px) {
      .template-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
      }
      .thumb { height: 92px; }
      .template-meta { padding: 6px 6px 8px; }
      .template-meta h3 { font-size: 0.78rem; margin-bottom: 5px; }
      .template-meta .price { font-size: 0.76rem; }
      .template-meta-row .card-buy-btn {
        font-size: 0.6rem;
        padding: 5px 8px;
      }
    }

    @media (min-width: 1280px) {
      .template-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 11px;
      }
      .thumb { height: 100px; }
    }

    .template-card {
      position: relative;
      border: 2px solid #e8e0e6;
      border-radius: 14px;
      overflow: hidden;
      background: #fff;
      cursor: pointer;
      text-align: center;
      transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    }

    .template-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 24px rgba(194, 24, 91, 0.12);
    }

    .template-card.selected {
      border-color: var(--rose-bright);
      background: linear-gradient(180deg, #fff 60%, var(--rose-soft));
      box-shadow: 0 0 0 1px rgba(225, 29, 116, 0.15);
    }

    .template-card .check {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--rose-bright);
      color: #fff;
      font-size: 12px;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2;
      box-shadow: 0 2px 8px rgba(194, 24, 91, 0.45);
    }

    .template-card.selected .check { display: flex; }

    .thumb {
      height: 92px;
      width: 100%;
      position: relative;
      overflow: hidden;
    }

    @keyframes beat { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }

    .thumb-astra {
      background:
        radial-gradient(circle at 58% 52%, rgba(255,45,141,.45), transparent 28%),
        radial-gradient(circle at 40% 40%, #ff2d8d, transparent 40%),
        radial-gradient(circle at 70% 60%, #4d164e, #050816 60%);
    }
    .thumb-astra::before {
      content: "✦";
      position: absolute; inset: 0; display: grid; place-items: center;
      font-size: 28px; color: #ffd8ee;
      text-shadow: 0 0 18px #ff2d8d, 0 0 36px #ff2d8d;
    }
    .thumb-glow {
      background:
        radial-gradient(circle at 50% 48%, rgba(255,77,148,.55) 0%, transparent 22%),
        radial-gradient(circle at 50% 42%, #24203e 0%, #10101f 40%, #05050e 78%);
    }
    .thumb-glow::before {
      content: "♡";
      position: absolute; inset: 0; display: grid; place-items: center;
      font-size: 36px; color: #ff4d94;
      text-shadow: 0 0 16px #ff2d8d, 0 0 32px #ff2d8d;
      animation: beat 1.8s ease-in-out infinite;
    }
    .thumb-iu {
      background:
        radial-gradient(circle at 80% 85%, rgba(238,102,166,.45), transparent 35%),
        radial-gradient(circle at 30% 30%, #1a1028, #050508 70%);
    }
    .thumb-iu::before {
      content: "iu";
      position: absolute; inset: 0; display: grid; place-items: center;
      font-family: Georgia, "Times New Roman", serif;
      font-size: 28px; font-weight: 700; color: #fff;
      text-shadow: 0 0 12px #ee66a6, 0 0 28px #ee66a6, 0 0 48px #ee66a6;
      letter-spacing: .04em;
    }
    .thumb-orb {
      background:
        radial-gradient(circle at 38% 32%, rgba(255,248,252,.9) 0%, rgba(255,210,225,.7) 18%, rgba(200,110,150,.75) 48%, rgba(50,20,40,.95) 100%);
    }
    .thumb-orb::before {
      content: "";
      position: absolute;
      width: 48px; height: 48px; border-radius: 50%;
      left: 50%; top: 50%; transform: translate(-50%,-50%);
      background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,.75), transparent 40%),
        radial-gradient(circle at 50% 55%, #e8a0b8, #5a2040 78%);
      box-shadow: 0 0 16px rgba(232,160,184,.55), 0 0 28px rgba(180,80,120,.25);
      border: 1px solid rgba(255,240,245,.25);
    }
    .thumb-tinh-ha-yeu {
      background:
        radial-gradient(ellipse 70% 50% at 50% 55%, rgba(255,180,210,.35), transparent 55%),
        radial-gradient(circle at 20% 20%, rgba(120,160,255,.2), transparent 40%),
        #000;
    }
    .thumb-tinh-ha-yeu::before {
      content: "";
      position: absolute;
      width: 36px; height: 36px; border-radius: 50%;
      left: 50%; top: 48%; transform: translate(-50%,-50%);
      background:
        radial-gradient(circle at 35% 30%, #fff, #ffb6d0 45%, #4a2040 100%);
      box-shadow:
        0 0 18px rgba(255,150,200,.7),
        0 0 0 10px rgba(255,200,220,.08),
        0 0 0 18px rgba(255,200,220,.04);
    }
    .thumb-tinh-ha-yeu::after {
      content: "";
      position: absolute;
      inset: 18% 8%;
      border-radius: 50%;
      border: 1px solid rgba(255,220,235,.22);
      box-shadow:
        22px 0 0 -19px rgba(255,255,255,.55),
        -26px 6px 0 -20px rgba(255,180,210,.5),
        0 -20px 0 -18px rgba(255,255,255,.35);
      pointer-events: none;
    }
    .thumb-cube {
      background:
        radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    }
    .thumb-cube::before {
      content: "";
      position: absolute;
      width: 42px; height: 42px;
      left: 50%; top: 50%;
      transform: translate(-50%, -58%) rotateX(18deg) rotateY(-28deg);
      border-radius: 8px;
      background:
        linear-gradient(135deg, rgba(255,94,98,.85), rgba(255,153,102,.75));
      box-shadow:
        14px 10px 0 -2px rgba(255,255,255,.12),
        -12px 14px 0 -4px rgba(42,203,186,.35),
        0 0 18px rgba(255,107,107,.45);
      border: 1px solid rgba(255,255,255,.45);
    }
    .thumb-ring {
      background: #f5e8dc;
    }
    .thumb-ring::before {
      content: "";
      position: absolute;
      width: 36px; height: 48px;
      left: 50%; top: 50%;
      transform: translate(-50%, -54%);
      border-radius: 8px;
      background: #fff;
      border: 3px solid #5c4033;
      box-shadow:
        22px 4px 0 -6px rgba(92,64,51,.35),
        -22px 4px 0 -6px rgba(92,64,51,.35),
        0 10px 18px rgba(92,64,51,.18);
    }
    .thumb-ring::after {
      content: "";
      position: absolute;
      width: 14px; height: 14px;
      left: 50%; bottom: 14px;
      transform: translateX(-50%);
      border-radius: 50%;
      background: #dc143c;
      box-shadow: 18px 0 0 #dc143c;
      opacity: .9;
    }
    .thumb-rain {
      background: #000;
    }
    .thumb-rain::before {
      content: "Yêu em ❤️";
      position: absolute;
      left: 50%; top: 42%;
      transform: translate(-50%, -50%) rotate(-6deg);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: #99ddff;
      text-shadow: 0 0 10px #fff, 0 0 16px #99ddff, 0 0 22px #ee66a6;
      white-space: nowrap;
    }
    .thumb-rain::after {
      content: "";
      position: absolute;
      width: 4px; height: 4px;
      border-radius: 50%;
      left: 28%; top: 28%;
      background: #fff;
      box-shadow:
        40px 18px 0 #fff,
        22px 48px 0 #ee66a6,
        58px 36px 0 #99ddff,
        12px 62px 0 #fff,
        70px 55px 0 #e62e00;
      opacity: .9;
    }
    .thumb-mua-yeu-thuong {
      background:
        radial-gradient(ellipse 80% 40% at 35% 55%, rgba(180,100,255,.28), transparent 55%),
        radial-gradient(ellipse 70% 35% at 70% 40%, rgba(255,110,180,.22), transparent 50%),
        radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    }
    .thumb-mua-yeu-thuong::before {
      content: "♥";
      position: absolute;
      left: 50%; top: 46%;
      transform: translate(-50%, -50%);
      font-size: 28px;
      line-height: 1;
      color: #e86b8a;
      filter:
        drop-shadow(0 0 8px rgba(255, 140, 200, 0.9))
        drop-shadow(0 0 22px rgba(180, 120, 255, 0.55));
    }
    .thumb-mua-yeu-thuong::after {
      content: "";
      position: absolute;
      width: 3px; height: 3px;
      border-radius: 50%;
      right: 38%; top: 32%;
      background: #fff;
      box-shadow:
        -36px 28px 0 #fff,
        18px 40px 0 #ff6eb4,
        -10px 52px 0 #c9a0ff,
        28px 18px 0 1px rgba(255,255,255,.85),
        -22px 8px 0 #8eb4ff,
        6px 60px 0 #fff,
        -48px 44px 0 #ff9ad5;
      opacity: .95;
    }
    .thumb-catch {
      background:
        radial-gradient(circle at 70% 80%, rgba(255,105,180,.35), transparent 42%),
        #050208;
    }
    .thumb-catch::before {
      content: "A♥";
      position: absolute;
      left: 50%; top: 40%;
      transform: translate(-50%, -50%);
      font-size: 18px;
      font-weight: 800;
      color: #ff69b4;
      text-shadow: 0 0 12px #fff, 0 0 20px #ff69b4;
      letter-spacing: .06em;
    }
    .thumb-catch::after {
      content: "";
      position: absolute;
      left: 50%; bottom: 16px;
      transform: translateX(-50%);
      width: 42px; height: 10px;
      border-radius: 999px;
      border: 1.5px solid #ff69b4;
      box-shadow: 0 0 10px rgba(255,105,180,.5);
      background: rgba(255,105,180,.15);
    }

    .thumb-birthday-v2 {
      background:
        url("assets/birthday-v2/birthday-v2.webp") center/cover no-repeat,
        #000;
    }
    .thumb-birthday-v2::before {
      content: "❤";
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-size: 2.2rem;
      color: #ffa3e0;
      text-shadow: 0 0 18px #ff69b4, 0 0 40px #ff2d95;
      background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55));
    }

    .thumb-photo {
      background-color: #f6e3ef;
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      transition: filter 0.4s ease;
    }
    .thumb-photo::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      background:
        linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%) 0 0 / 200% 100% no-repeat,
        linear-gradient(135deg, #fce7f1, #efe0fb 55%, #fde8e1);
      animation: thumb-shimmer 1.4s ease-in-out infinite;
      transition: opacity 0.55s ease;
      pointer-events: none;
    }
    .thumb-photo.is-loaded::before {
      opacity: 0;
      animation: none;
    }
    .thumb-photo::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, transparent 62%, rgba(40, 10, 40, 0.22));
      pointer-events: none;
    }
    .template-card:hover .thumb-photo,
    .template-card.selected .thumb-photo {
      filter: saturate(1.12) brightness(1.05);
    }
    @keyframes thumb-shimmer {
      from { background-position: 150% 0, 0 0; }
      to { background-position: -50% 0, 0 0; }
    }
    @media (prefers-reduced-motion: reduce) {
      .thumb-photo::before { animation: none; }
      .thumb-photo { transition: none; }
    }
    .thumb-mai-iu-em,
    .thumb-memories,
    .thumb-trai-tim-ky-uc,
    .thumb-trien-lam,
    .thumb-memory-photo,
    .thumb-letter-v5,
    .thumb-anh-sang,
    .thumb-thu-v4,
    .thumb-lam-ny,
    .thumb-nguyen-uc,
    .thumb-anh-iu-em,
    .thumb-heart-mosaic,
    .thumb-love-hex,
    .thumb-love-pro2,
    .thumb-birthday-balloons,
    .thumb-birthday-gift-pro,
    .thumb-qua-sinh-nhat,
    .thumb-gift-christmas,
    .thumb-qua-giang-sinh,
    .thumb-love-gift-3000,
    .thumb-thiep-tinh-yeu,
    .thumb-thiep-online,
    .thumb-love-gift,
    .thumb-special-gift,
    .thumb-mon-qua-dac-biet,
    .thumb-love-letter-pink,
    .thumb-gift-for-you,
    .thumb-gift-tulips,
    .thumb-rose-fall,
    .thumb-gift-christmas-2025,
    .thumb-gui-yeu-thuong,
    .thumb-valentine-love,
    .thumb-merry-christmas-tree,
    .thumb-love-fireworks,
    .thumb-love-gift-3d,
    .thumb-thiep-giang-sinh,
    .thumb-love-animation,
    .thumb-paper-plane,
    .thumb-dem-trung-thu,
    .thumb-valentine-app,
    .thumb-valentine-messenger,
    .thumb-love-gift-pnvn,
    .thumb-birthday-gift-v2,
    .thumb-qua-hat-sang {
      background-color: #0a0610;
      background-position: center;
      background-size: cover;
    }
    .thumb-anh-iu-em {
      /* Envelope sits high in the source art — bias crop so it reads centered in the card */
      background-position: center 28%;
    }
    .thumb-rose-fall {
      background:
        radial-gradient(circle at 50% 48%, rgba(255,80,140,.55), transparent 42%),
        radial-gradient(circle at 50% 50%, #14020a 0%, #000 72%);
    }
    .thumb-rose-fall::after {
      content: "";
      position: absolute;
      inset: 28% 36% 34%;
      border-radius: 50% 50% 45% 45%;
      background:
        radial-gradient(circle at 40% 40%, #ff9ec0, #ff2d7a 55%, transparent 70%);
      box-shadow: 0 0 18px rgba(255,70,140,.55);
      pointer-events: none;
    }
    .thumb-heart-mosaic {
      background:
        radial-gradient(ellipse 70% 42% at 50% 55%, rgba(255,110,180,.55), transparent 62%),
        radial-gradient(circle at 50% 50%, #1a0a14 0%, #050208 70%);
    }
    .thumb-heart-mosaic::after {
      content: "";
      position: absolute;
      inset: 18% 12% 22%;
      border: 1px solid rgba(255,255,255,.28);
      border-radius: 50%;
      transform: rotateX(58deg);
      box-shadow: 0 0 24px rgba(255,120,190,.35);
      pointer-events: none;
    }
    .thumb-love-hex {
      background:
        radial-gradient(circle at 50% 48%, rgba(255,255,255,.22), transparent 42%),
        radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000 72%);
    }
    .thumb-love-hex::after {
      content: "♥";
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-size: 2.1rem;
      color: rgba(255,255,255,.9);
      text-shadow: 0 0 12px #fff, 0 0 26px #ffa3e0;
      pointer-events: none;
    }
    .thumb-love-pro2 {
      background:
        radial-gradient(circle at 50% 48%, rgba(255,45,106,.35), transparent 42%),
        radial-gradient(circle at 50% 50%, #12040a 0%, #050308 72%);
    }
    .thumb-birthday-balloons {
      background:
        radial-gradient(circle at 50% 40%, rgba(251,146,60,.4), transparent 45%),
        radial-gradient(circle at 50% 50%, #1e0a2e 0%, #0f0518 72%);
    }

    .template-meta {
      padding: 10px 8px 10px;
      text-align: left;
    }

    .template-meta h3 {
      font-size: 0.92rem;
      font-weight: 700;
      margin: 0 0 8px;
      line-height: 1.25;
      text-align: left;
    }

    .template-meta-row {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      width: 100%;
      min-width: 0;
    }

    .template-meta .price {
      color: var(--rose);
      font-weight: 700;
      font-size: 0.9rem;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: flex-start;
      gap: 4px;
      margin: 0;
      min-width: 0;
      flex: 1 1 auto;
      text-align: left;
      line-height: 1.2;
    }

    .template-meta-row .card-buy-btn {
      -webkit-appearance: none;
      appearance: none;
      flex: 0 0 auto;
      margin: 0;
      border: 0;
      border-radius: 999px;
      padding: 6px 11px;
      background: linear-gradient(135deg, #ff4d94 0%, var(--rose-bright) 45%, #be185d 100%);
      color: #fff;
      font-family: inherit;
      font-size: 0.68rem;
      font-weight: 800;
      line-height: 1;
      letter-spacing: 0.01em;
      white-space: nowrap;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(190, 24, 93, 0.28);
      transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
    }

    .template-meta-row .card-buy-btn:hover {
      filter: brightness(1.06);
      box-shadow: 0 6px 14px rgba(190, 24, 93, 0.34);
    }

    .template-meta-row .card-buy-btn:active {
      transform: scale(0.96);
    }

    .template-meta .price-old {
      color: rgba(255, 230, 242, 0.45);
      text-decoration: line-through;
      font-weight: 600;
      font-size: 0.78rem;
    }

    .template-meta .price-sale {
      color: #ffb4d0;
    }

    .template-meta .sale-badge {
      font-size: 0.68rem;
      font-weight: 700;
      color: #1a1020;
      background: linear-gradient(120deg, #ff8fbf, #ffd0e4);
      border-radius: 999px;
      padding: 2px 7px;
    }

    .preview-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
      color: var(--rose);
      font-weight: 600;
      font-size: 0.85rem;
      text-decoration: none;
    }

    .preview-link:hover { text-decoration: underline; }

    .btn {
      border: none;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      transition: transform 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
    }

    .btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none !important;
    }

    .btn:not(:disabled):hover { transform: translateY(-1px); }

    .btn-clear {
      width: 100%;
      background: #6b7280;
      color: #fff;
      border-radius: 10px;
      padding: 12px 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 0.92rem;
    }

    .btn-clear:hover { background: #4b5563; }

    .field { margin-bottom: 12px; }

    .field label {
      display: block;
      font-weight: 700;
      font-size: 0.92rem;
      margin-bottom: 8px;
    }

    .field .hint {
      margin-top: 6px;
      font-size: 0.8rem;
      color: var(--muted);
      line-height: 1.45;
    }

    .custom-field-group { border-top: 1px solid #e4dce3; }
    .custom-field-group summary { cursor: pointer; padding: 16px 0; font-weight: 600; }
    .custom-field-group summary:focus-visible { outline: 2px solid #e11d74; outline-offset: 2px; }
    .custom-field-group .field[data-extra-type="color"] { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .custom-field-group .field[data-extra-type="color"] label { margin: 0; }
    .custom-field-group .field[data-extra-type="color"] .color-swatch-row:empty { display: none; }

    .share-password-group {
      border: 1px solid var(--rose-border);
      border-radius: 12px;
      background:
        linear-gradient(165deg, #fff9fc 0%, #fff7fb 48%, #fceef6 100%);
      overflow: hidden;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .share-password-group[open] {
      border-color: #f3a0c8;
      box-shadow: 0 8px 22px rgba(194, 24, 91, 0.08);
    }

    .share-password-group summary {
      display: flex;
      align-items: center;
      gap: 10px;
      list-style: none;
      padding: 14px 14px;
      font-weight: 700;
      font-size: 0.92rem;
      color: var(--text);
      user-select: none;
      transition: background 0.2s ease;
    }

    .share-password-group summary::-webkit-details-marker { display: none; }

    .share-password-group summary::before {
      content: "";
      width: 34px;
      height: 34px;
      flex-shrink: 0;
      border-radius: 10px;
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2185b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E")
        center / 18px 18px no-repeat,
        rgba(225, 29, 116, 0.1);
    }

    .share-password-group summary::after {
      content: "";
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6472' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
        center / 16px 16px no-repeat;
      transition: transform 0.2s ease;
    }

    .share-password-group[open] summary::after {
      transform: rotate(180deg);
    }

    .share-password-group summary:hover {
      background: rgba(252, 231, 241, 0.55);
    }

    .share-password-title {
      min-width: 0;
      line-height: 1.3;
    }

    .share-password-badge {
      margin-left: auto;
      flex-shrink: 0;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: var(--rose);
      background: rgba(225, 29, 116, 0.1);
      border: 1px solid rgba(249, 168, 212, 0.65);
    }

    .share-password-field {
      margin: 0;
      padding: 0 14px 14px;
      border-top: 1px dashed rgba(249, 168, 212, 0.55);
      padding-top: 14px;
    }

    .share-password-field label {
      font-size: 0.86rem;
      color: #4a3a46;
    }

    .share-password-field .hint {
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.72);
      border: 1px solid rgba(240, 228, 236, 0.95);
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.55;
    }

    .share-password-group .share-password-field > input,
    .share-password-group .password-field > input {
      border-color: #f0d0e0;
      background: #fff;
      border-radius: 10px;
      padding: 12px 12px;
    }

    .share-password-group .password-field > input {
      padding-right: 44px;
    }

    .share-password-group .share-password-field > input:focus,
    .share-password-group .password-field > input:focus {
      border-color: var(--rose-bright);
      box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.14);
    }
    .color-field-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
    }
    .color-swatch-row {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      flex: 1;
    }
    .color-swatch-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.35);
      cursor: pointer;
      padding: 0;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
      transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    }
    .color-swatch-btn:hover { transform: scale(1.08); }
    .palette-swatch-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
    .palette-swatch-btn {
      display: flex; align-items: center; gap: 8px;
      padding: 8px 10px; border: 1px solid var(--rose-border); border-radius: 12px;
      background: #fff; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }
    .palette-swatch-btn:hover { border-color: var(--rose-bright); }
    .palette-swatch-btn:focus-visible { outline: 2px solid #e11d74; outline-offset: 2px; }
    .palette-swatch-btn.active { border-color: var(--rose-bright); box-shadow: 0 0 0 2px var(--rose-bright); font-weight: 600; }
    .palette-swatch-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
    .color-swatch-btn.active {
      border-color: #fff;
      box-shadow: 0 0 0 2px var(--rose-bright), 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    .color-field-row input[type="color"] {
      width: 42px;
      height: 34px;
      padding: 2px;
      border-radius: 10px;
      border: 1px solid var(--rose-border);
      background: rgba(255, 255, 255, 0.08);
      cursor: pointer;
      flex-shrink: 0;
    }

    .field .status {
      margin-top: 6px;
      font-size: 0.82rem;
      font-weight: 600;
      min-height: 1.2em;
    }

    .status.ok { color: var(--ok); }
    .status.bad { color: #dc2626; }
    .status.warn { color: var(--warn); }

    .checkout-contact-row {
      display: grid;
      gap: 12px;
    }

    @media (min-width: 520px) {
      .checkout-contact-row {
        grid-template-columns: 1fr 1fr;
        align-items: start;
      }
    }

    .checkout-contact-row .field {
      margin-bottom: 0;
    }

    .checkout-contact-row--logged-in {
      grid-template-columns: 1fr;
    }

    .checkout-quick-account {
      border: 1px solid var(--rose-border);
      border-radius: 12px;
      background:
        linear-gradient(165deg, #fff9fc 0%, #fff7fb 48%, #fceef6 100%);
      overflow: hidden;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
      margin: 0;
    }

    .checkout-quick-account[hidden] {
      display: none !important;
    }

    .checkout-quick-account[open] {
      border-color: #f3a0c8;
      box-shadow: 0 8px 22px rgba(194, 24, 91, 0.08);
    }

    .checkout-quick-account > summary {
      display: flex;
      align-items: center;
      gap: 10px;
      list-style: none;
      padding: 14px;
      font-weight: 700;
      font-size: 0.92rem;
      color: var(--text);
      cursor: pointer;
      user-select: none;
      transition: background 0.2s ease;
    }

    .checkout-quick-account > summary::-webkit-details-marker { display: none; }

    .checkout-quick-account > summary::before {
      content: "";
      width: 34px;
      height: 34px;
      flex-shrink: 0;
      border-radius: 10px;
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2185b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E")
        center / 18px 18px no-repeat,
        rgba(225, 29, 116, 0.1);
    }

    .checkout-quick-account > summary::after {
      content: "";
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6472' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
        center / 16px 16px no-repeat;
      transition: transform 0.2s ease;
    }

    .checkout-quick-account[open] > summary::after {
      transform: rotate(180deg);
    }

    .checkout-quick-account > summary:hover {
      background: rgba(252, 231, 241, 0.55);
    }

    .checkout-quick-account > summary:focus-visible {
      outline: 2px solid #e11d74;
      outline-offset: 2px;
    }

    .checkout-quick-account-title {
      min-width: 0;
      line-height: 1.3;
    }

    .checkout-quick-account-badge {
      margin-left: auto;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: var(--rose);
      background: rgba(225, 29, 116, 0.1);
      border: 1px solid rgba(249, 168, 212, 0.65);
    }

    .checkout-quick-account-body {
      padding: 0 14px 14px;
      border-top: 1px dashed rgba(249, 168, 212, 0.55);
      padding-top: 14px;
    }

    .checkout-quick-account .hint {
      margin: 0 0 10px;
      padding: 10px 12px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.72);
      border: 1px solid rgba(240, 228, 236, 0.95);
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.55;
    }

    .checkout-quick-account-fields {
      display: grid;
      gap: 8px;
    }

    .checkout-quick-account-fields > label { font-size: 12px; font-weight: 600; color: #52434c; margin-bottom: -3px; }
    .checkout-quick-account-fields > label small { color: #7b6e76; font-weight: 400; }
    .quick-account-link { display: block; width: 100%; padding: 9px 0 2px; border: 0; background: none; font: inherit; font-size: 12px; line-height: 1.5; color: #b51559; cursor: pointer; text-align: left; }
    .quick-account-link:hover { text-decoration: underline; }
    .quick-account-skip { color: #736570; }

    .checkout-quick-account-fields[hidden],
    .checkout-quick-account .hint[hidden] {
      display: none;
    }

    .checkout-quick-account-fields > input,
    .checkout-quick-account-fields .password-field > input {
      border-color: #f0d0e0;
      background: #fff;
      border-radius: 10px;
      padding: 12px;
    }

    .checkout-quick-account-fields .password-field > input {
      padding-right: 44px;
    }

    .checkout-quick-account-fields > input:focus,
    .checkout-quick-account-fields .password-field > input:focus {
      border-color: var(--rose-bright);
      box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.14);
    }

    .checkout-quick-account .status {
      margin-top: 8px;
      min-height: 1.2em;
    }

    .input-row {
      display: flex;
      gap: 8px;
    }

    input[type="text"],
    input[type="password"],
    input[type="url"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="file"],
    select.extra-input,
    textarea {
      width: 100%;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 11px 12px;
      font: inherit;
      font-size: 0.92rem;
      outline: none;
      background: #fff;
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    input:focus, textarea:focus, select.extra-input:focus {
      border-color: var(--rose-border);
      box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.12);
    }

    input[type="file"] {
      padding: 10px;
      cursor: pointer;
    }

    input[type="date"] {
      min-height: 44px;
      color: #3b2230;
      cursor: pointer;
      -webkit-appearance: none;
      appearance: none;
      padding-right: 44px;
      background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23e11d74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 2.5v4M16 2.5v4M3 9.5h18'/%3E%3Cpath d='M12 17.2s-2.6-1.5-2.6-3.2a1.4 1.4 0 0 1 2.6-.7 1.4 1.4 0 0 1 2.6.7c0 1.7-2.6 3.2-2.6 3.2z' fill='%23e11d74' stroke='none'/%3E%3C/svg%3E") no-repeat right 12px center / 20px;
    }
    input[type="date"]:hover { border-color: var(--rose-border); }
    input[type="date"]::-webkit-calendar-picker-indicator {
      position: absolute;
      right: 0;
      width: 44px;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }
    input[type="date"]::-webkit-datetime-edit { padding: 0; }
    input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
    input[type="date"] { position: relative; }

    .photo-preview {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }
    .photo-preview img {
      width: 64px;
      height: 64px;
      object-fit: cover;
      border-radius: 10px;
      border: 1px solid #f0d0e0;
      box-shadow: 0 4px 12px rgba(225, 29, 116, 0.12);
    }

    .customization-tools {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 10px;
    }

    .buy-custom-head {
      align-items: center;
      flex-wrap: wrap;
      gap: 8px 10px;
      margin-bottom: 10px;
    }

    .buy-custom-head > strong {
      flex: 1 1 auto;
      min-width: 0;
      font-size: 0.95rem;
    }

    .buy-custom-head .customization-tools {
      margin-bottom: 0;
      flex: 0 1 auto;
      justify-content: flex-end;
    }

    .customization-tool-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border-radius: 8px;
      font-size: 0.78rem;
      font-weight: 700;
      line-height: 1;
      color: #8f2450;
      background: #fff;
      border: 1px solid #f0d0e0;
      box-shadow: 0 1px 0 rgba(194, 24, 91, 0.04);
    }

    .customization-tool-btn:not(:disabled):hover {
      background: #fff5f9;
      border-color: #f3a0c8;
      color: var(--rose);
    }

    .customization-tool-btn:focus-visible {
      outline: 2px solid #e11d74;
      outline-offset: 2px;
    }

    .customization-tool-btn--reset {
      color: #6b6472;
      border-color: #eadfe6;
    }

    .customization-tool-btn--reset:not(:disabled):hover {
      color: #4a3a46;
      background: #faf7f9;
      border-color: #dcc9d4;
    }

    .customization-tool-icon {
      flex-shrink: 0;
      display: block;
    }

    .draft-status {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      box-sizing: border-box;
      width: fit-content;
      max-width: 100%;
      margin: 0 0 0.75rem;
      padding: 0.22rem 0.62rem 0.22rem 0.42rem;
      border: 1px solid transparent;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 500;
      letter-spacing: 0.01em;
      line-height: 1.35;
      color: #4d5c55;
      background: #f2f6f3;
      min-height: 0;
    }
    .draft-status[hidden] { display: none !important; }
    .draft-status::before {
      content: "";
      flex: 0 0 auto;
      width: 0.92rem;
      height: 0.92rem;
      border-radius: 50%;
      background:
        linear-gradient(#fff, #fff) center / 0.28rem 0.28rem no-repeat,
        currentColor;
      opacity: 0.85;
    }
    .draft-status[data-state="saved"] {
      color: #1f6b4a;
      background: #eef8f2;
      border-color: #cfe8d9;
    }
    .draft-status[data-state="saved"]::before {
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='8' fill='%231f6b4a'/%3E%3Cpath d='M4.6 8.2l2.1 2.1 4.7-4.7' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center / contain no-repeat;
      opacity: 1;
    }
    .draft-status[data-state="busy"] {
      color: #6a5a64;
      background: #f7f3f5;
      border-color: #eadfe6;
    }
    .draft-status[data-state="busy"]::before {
      background: conic-gradient(from 0deg, transparent 30%, #b58a9c 100%);
      mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
      animation: draft-status-spin 0.8s linear infinite;
      opacity: 1;
    }
    .draft-status[data-state="error"] {
      color: #a51836;
      background: #fff5f7;
      border-color: #f0c8d1;
    }
    .draft-status[data-state="error"]::before {
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23a51836'/%3E%3Cpath d='M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6' stroke='%23fff' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E")
        center / contain no-repeat;
      opacity: 1;
    }
    @keyframes draft-status-spin {
      to { transform: rotate(360deg); }
    }
    .customization-errors { color:#a51836; }
    .customization-errors { padding:12px; margin:10px 0 16px; border:1px solid #e7acb7; border-radius:10px; background:#fff6f7; font-size:.85rem; }
    .customization-errors ul { padding-left:18px; margin:6px 0 0; }
    .customization-errors button { border:0; padding:4px 0; background:none; color:inherit; text-align:left; text-decoration:underline; cursor:pointer; }
    [aria-invalid="true"] { border-color:#c52c48 !important; }
    .photo-item { display:flex; flex-direction:column; align-items:center; gap:4px; padding:4px; border:1px solid #ead4df; border-radius:10px; }
    .photo-item img { width:78px; height:78px; }
    .photo-item-controls { display:flex; gap:3px; }
    .photo-item button { min-width:26px; min-height:30px; border:1px solid #efc6d9; border-radius:5px; color:#952555; background:#fff3f8; cursor:pointer; }
    .photo-item button:disabled { opacity:.4; cursor:default; }
    .photo-item-number { font-size:.7rem; color:#695260; }
    .extra-image-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .extra-image-row .photo-item img { width:64px; height:64px; border-radius:50%; object-fit:cover; }
    .extra-image-row .extra-image-input { flex:1; min-width:0; }

    textarea {
      min-height: 120px;
      resize: vertical;
      line-height: 1.5;
    }

    .btn-check {
      flex-shrink: 0;
      background: var(--rose-bright);
      color: #fff;
      border-radius: 6px;
      padding: 0 14px;
      font-size: 0.88rem;
    }

    .btn-check:hover { background: var(--rose); }

    .domain-suffix {
      align-self: center;
      color: var(--muted);
      font-size: 0.85rem;
      white-space: nowrap;
      display: none;
    }

    .music-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--rose-border);
      border-radius: 10px;
      background: #fff7fb;
      cursor: pointer;
      user-select: none;
    }

    .music-toggle.active {
      background: var(--rose-soft);
      border-color: var(--rose-bright);
    }

    .music-toggle .left {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .music-toggle .left strong { font-size: 0.92rem; }
    .music-toggle .left span { font-size: 0.8rem; color: var(--muted); }

    .music-price {
      font-weight: 700;
      color: var(--rose);
      font-size: 0.9rem;
    }

    .music-box { margin-top: 10px; display: none; }
    .music-box.show { display: block; }

    .music-input-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .music-input-row > input {
      flex: 1;
      min-width: 0;
    }

    .music-help-btn {
      flex: 0 0 auto;
      width: 40px;
      height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
      border: 1px solid #f0d0e0;
      background: #fff;
      color: #be185d;
      cursor: pointer;
      padding: 0;
      font-family: inherit;
    }

    .music-help-btn:hover,
    .music-help-btn[aria-expanded="true"] {
      background: #fff5f9;
      border-color: #f3a0c8;
    }

    .music-help-panel {
      margin-top: 10px;
      padding: 12px 12px 10px;
      border-radius: 12px;
      border: 1px solid #f0d0e0;
      background: #fff8fb;
      color: #4a3a46;
      font-size: 0.82rem;
      line-height: 1.45;
    }

    .music-help-panel strong {
      display: block;
      margin-bottom: 6px;
      color: #9f1239;
      font-size: 0.88rem;
    }

    .music-help-panel ol {
      margin: 0 0 8px;
      padding-left: 1.2rem;
    }

    .music-help-panel li {
      margin-bottom: 4px;
    }

    .music-help-panel code {
      font-size: 0.78em;
      background: rgba(225, 29, 116, 0.08);
      padding: 1px 5px;
      border-radius: 4px;
      word-break: break-all;
    }

    .music-help-panel a {
      color: #be185d;
      font-weight: 600;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .music-help-panel a:hover {
      color: #9f1239;
    }

    .music-help-note {
      margin: 0;
      color: #6b5b66;
      font-size: 0.78rem;
    }

    .music-label {
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 4px 0 8px;
      font-weight: 700;
      font-size: 0.86rem;
    }

    .music-search { position: relative; }
    .music-search > input { width: 100%; padding-right: 40px; }
    .music-search > input:focus { border-color: var(--rose-bright); }

    .music-search-clear {
      position: absolute;
      top: 50%;
      right: 6px;
      width: 30px;
      height: 30px;
      transform: translateY(-50%);
      border: 0;
      border-radius: 50%;
      background: transparent;
      color: var(--muted);
      font-size: 1.3rem;
      line-height: 1;
      cursor: pointer;
    }
    .music-search-clear:hover { background: var(--rose-soft); color: var(--rose); }

    .music-results {
      position: absolute;
      z-index: 30;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      max-height: 320px;
      overflow-y: auto;
      padding: 4px;
      border: 1px solid var(--rose-border);
      border-radius: 12px;
      background: #fff;
      box-shadow: 0 14px 34px rgba(80, 20, 50, 0.16);
      overscroll-behavior: contain;
    }

    .music-result {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px;
      border-radius: 10px;
      cursor: pointer;
    }
    .music-result:hover,
    .music-result[aria-selected="true"] { background: #fff5f9; }

    .music-cover {
      flex: 0 0 auto;
      width: 44px;
      height: 44px;
      border-radius: 8px;
      object-fit: cover;
      background: var(--rose-soft);
    }
    .music-cover.is-large { width: 52px; height: 52px; }
    .music-cover.is-empty {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--rose);
    }

    .music-result-info,
    .music-selected-info {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .music-result-info strong,
    .music-selected-info strong {
      overflow: hidden;
      font-size: 0.9rem;
      line-height: 1.3;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .music-result-info span,
    .music-selected-info > span:not(.music-badge) {
      overflow: hidden;
      color: var(--muted);
      font-size: 0.78rem;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .music-source {
      display: inline-block;
      margin-right: 6px;
      padding: 0 5px;
      border-radius: 4px;
      font-size: 0.66rem;
      font-weight: 700;
      line-height: 1.5;
      vertical-align: 1px;
    }
    .music-source.is-yt { background: #fee2e2; color: #b91c1c; }
    .music-source.is-sc { background: #ffedd5; color: #c2410c; }

    .music-round-btn {
      flex: 0 0 auto;
      width: 36px;
      height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      border: 1px solid var(--rose-border);
      border-radius: 50%;
      background: #fff;
      color: #4a3a46;
      cursor: pointer;
    }
    .music-round-btn:hover { border-color: var(--rose-bright); color: var(--rose); }
    .music-round-btn.is-playing { border-color: var(--rose); background: var(--rose); color: #fff; }

    .music-search-status {
      min-height: 0;
      margin-top: 6px;
      color: var(--muted);
      font-size: 0.78rem;
    }
    .music-search-status:empty { display: none; }
    .music-search-status.is-error { color: #b42318; }

    .music-selected {
      margin-top: 10px;
      padding: 12px;
      border: 1px solid var(--rose-bright);
      border-radius: 12px;
      background: #fff7fb;
    }

    .music-selected-head {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .music-badge {
      color: var(--rose);
      font-size: 0.7rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .music-remove {
      flex: 0 0 auto;
      align-self: flex-start;
      width: 26px;
      height: 26px;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: transparent;
      color: var(--muted);
      font-size: 1.2rem;
      line-height: 1;
      cursor: pointer;
    }
    .music-remove:hover { background: var(--rose-soft); color: var(--rose); }

    .music-start {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px dashed var(--rose-border);
    }

    .music-start-label {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      font-size: 0.84rem;
      font-weight: 600;
    }
    .music-start-time { color: var(--rose); font-size: 1rem; font-variant-numeric: tabular-nums; }
    .music-start-hint { color: var(--muted); font-weight: 400; }
    .music-now { margin-left: auto; color: var(--muted); font-size: 0.76rem; font-weight: 400; font-variant-numeric: tabular-nums; }

    .music-range {
      --fill: 0%;
      width: 100%;
      height: 6px;
      margin: 12px 0;
      border-radius: 999px;
      background: linear-gradient(to right, var(--rose) var(--fill), #eadde3 var(--fill));
      accent-color: var(--rose);
      appearance: none;
      -webkit-appearance: none;
      cursor: pointer;
    }
    .music-range::-webkit-slider-thumb {
      width: 18px;
      height: 18px;
      border: 3px solid #fff;
      border-radius: 50%;
      background: var(--rose);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
      -webkit-appearance: none;
    }
    .music-range::-moz-range-thumb {
      width: 14px;
      height: 14px;
      border: 3px solid #fff;
      border-radius: 50%;
      background: var(--rose);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }

    .music-start-actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
    }

    .music-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-height: 32px;
      padding: 4px 12px;
      border: 1px solid var(--rose-border);
      border-radius: 999px;
      background: #fff;
      color: #4a3a46;
      font: inherit;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
    }
    .music-chip:hover:not(:disabled) { border-color: var(--rose-bright); }
    .music-chip:disabled { opacity: 0.45; cursor: default; }
    .music-chip.is-accent { border-color: var(--rose); color: var(--rose); }
    .music-chip.is-link {
      padding: 4px 2px;
      border: 0;
      background: none;
      color: var(--muted);
      font-weight: 500;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .music-chip[hidden] { display: none; }

    .music-alt {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid #f1e4ea;
    }
    .music-alt > summary {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #6b5b66;
      font-size: 0.84rem;
      cursor: pointer;
      list-style: none;
    }
    .music-alt > summary::-webkit-details-marker { display: none; }
    .music-alt > summary:hover,
    .music-alt[open] > summary { color: var(--rose); }
    .music-alt-body { margin-top: 10px; }
    .music-alt-body > input { width: 100%; }

    .music-sc-btn {
      margin-top: 8px;
      border-color: var(--rose);
      background: var(--rose);
      color: #fff;
    }
    .music-sc-btn:disabled { opacity: 0.5; cursor: default; }

    .music-hint,
    .music-note {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.45;
    }
    .music-note:first-of-type { margin-top: 14px; }

    .music-upload-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }

    .tip-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .tip-btn {
      background: #fff;
      color: var(--rose);
      border: 1px solid var(--rose-border);
      border-radius: 6px;
      padding: 11px 6px;
      font-size: 0.88rem;
      white-space: nowrap;
    }

    .tip-btn.selected,
    .tip-btn:hover {
      background: var(--rose-soft);
      border-color: var(--rose-bright);
    }

    .custom-tip {
      margin-top: 8px;
      display: none;
    }

    .custom-tip.show { display: block; }

    .checkout-bar {
      position: sticky;
      bottom: 0;
      margin-top: 16px;
      padding-top: 8px;
      background: linear-gradient(180deg, transparent, #fff 28%);
    }

    .btn-pay {
      width: 100%;
      background: linear-gradient(135deg, #e11d74, #be185d);
      color: #fff;
      border-radius: 12px;
      padding: 15px 16px;
      font-size: 1.05rem;
      letter-spacing: 0.01em;
      box-shadow: 0 10px 28px rgba(190, 24, 93, 0.35);
    }

    .btn-pay:hover {
      background: linear-gradient(135deg, #be185d, #9d174d);
      box-shadow: 0 12px 32px rgba(190, 24, 93, 0.45);
    }

    .summary {
      text-align: center;
      margin-bottom: 8px;
      font-size: 0.82rem;
      color: var(--muted);
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 50;
      background: rgba(8, 6, 20, 0.62);
      backdrop-filter: blur(6px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
    }

    .modal-backdrop.open { display: flex; }

    .modal {
      width: min(440px, 100%);
      max-height: min(92vh, 860px);
      overflow: auto;
      background: #fff;
      border-radius: 18px;
      padding: 22px 18px;
      box-shadow: var(--shadow);
      animation: rise 0.35s ease both;
    }

    .modal-guide {
      z-index: 60;
    }

    .guide-modal {
      width: min(480px, 100%);
      max-height: min(88vh, 720px);
    }

    .guide-lead {
      margin-bottom: 16px !important;
    }

    .guide-block {
      text-align: left;
      margin-bottom: 14px;
      padding: 12px 14px;
      background: #faf7f9;
      border: 1px solid var(--line);
      border-radius: 12px;
    }

    .guide-block h3 {
      font-size: 0.92rem;
      font-weight: 700;
      color: var(--rose);
      margin-bottom: 8px;
    }

    .guide-steps {
      margin: 0;
      padding-left: 1.15rem;
      color: var(--text);
      font-size: 0.86rem;
      line-height: 1.55;
    }

    .guide-steps li + li {
      margin-top: 6px;
    }

    .guide-note {
      text-align: center;
      font-size: 0.84rem !important;
      margin-bottom: 16px !important;
    }

    .guide-note a {
      color: var(--rose-bright);
      text-decoration: none;
      font-weight: 600;
    }

    .modal h2 {
      font-family: "Cormorant Garamond", serif;
      font-size: 1.7rem;
      color: var(--rose);
      text-align: center;
      margin-bottom: 8px;
    }

    .modal p {
      text-align: center;
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.5;
      margin-bottom: 14px;
    }

    .order-lines {
      background: #faf7f9;
      border-radius: 12px;
      padding: 12px;
      margin-bottom: 14px;
      font-size: 0.88rem;
      display: grid;
      gap: 8px;
    }

    .order-lines .row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
    }

    .order-lines .total {
      border-top: 1px dashed #e8d5df;
      padding-top: 8px;
      font-weight: 700;
      color: var(--rose);
    }

    #payBox[hidden], #btnPaidConfirm[hidden] { display: none; }
    .pay-box {
      border: 1px solid var(--rose-border);
      background: linear-gradient(180deg, #fff7fb, #fff);
      border-radius: 14px;
      padding: 14px;
      margin-bottom: 14px;
      text-align: center;
    }

    .pay-box .pay-title {
      font-weight: 700;
      color: var(--rose);
      margin-bottom: 8px;
      font-size: 0.95rem;
    }

    .pay-qr {
      width: min(220px, 68vw);
      height: min(220px, 68vw);
      aspect-ratio: 1;
      margin: 0 auto 10px;
      border-radius: 12px;
      background: #fff;
      border: 1px solid #f3e8ef;
      padding: 10px;
      display: block;
      object-fit: contain;
    }

    .pay-meta {
      font-size: 0.84rem;
      color: var(--text);
      line-height: 1.55;
      display: grid;
      gap: 4px;
    }

    .pay-meta strong { color: var(--rose); word-break: break-word; }

    .pay-copy-row {
      display: flex;
      gap: 8px;
      margin-top: 10px;
    }

    .pay-copy-row input {
      flex: 1;
      font-size: 0.82rem;
      padding: 9px 10px;
    }

    .btn-qr-remake {
      width: 100%;
      margin-top: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 13px 14px;
      border-radius: 12px;
      background: linear-gradient(135deg, #ff5fa2 0%, #e11d74 55%, #c2185b 100%);
      color: #fff;
      font-weight: 700;
      font-size: 0.92rem;
      line-height: 1.3;
      text-align: center;
      box-shadow: 0 8px 22px rgba(225, 29, 116, 0.35);
      animation: qr-remake-glow 2.2s ease-in-out infinite;
    }

    .btn-qr-remake:hover {
      filter: brightness(1.06);
    }

    .btn-qr-remake-icon {
      flex-shrink: 0;
      animation: beat 1.1s ease-in-out infinite;
    }

    @keyframes qr-remake-glow {
      0%, 100% { box-shadow: 0 8px 22px rgba(225, 29, 116, 0.35); }
      50% { box-shadow: 0 8px 30px rgba(225, 29, 116, 0.6), 0 0 0 4px rgba(255, 126, 182, 0.25); }
    }

    @media (prefers-reduced-motion: reduce) {
      .btn-qr-remake,
      .btn-qr-remake-icon { animation: none; }
    }

    .btn-qr-remake.is-done {
      background: linear-gradient(135deg, #34d399 0%, #059669 100%);
      box-shadow: 0 8px 22px rgba(5, 150, 105, 0.3);
      animation: none;
    }

    .order-modal {
      width: min(460px, 100%);
    }

    .order-reminder {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 14px;
      padding: 12px 14px;
      border-radius: 14px;
      background: linear-gradient(135deg, #ff5fa2 0%, #e11d74 60%, #c2185b 100%);
      color: #fff;
      box-shadow: 0 8px 22px rgba(225, 29, 116, 0.3);
      text-align: left;
    }

    .order-reminder-icon {
      flex-shrink: 0;
      margin-top: 1px;
      animation: beat 1.1s ease-in-out infinite;
    }

    .order-reminder strong {
      display: block;
      font-size: 0.98rem;
      line-height: 1.35;
    }

    .order-reminder span {
      display: block;
      margin-top: 3px;
      font-size: 0.84rem;
      line-height: 1.45;
      opacity: 0.95;
    }

    .order-columns {
      display: grid;
      gap: 16px;
    }

    .order-col {
      min-width: 0;
    }

    .order-step {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      font-weight: 700;
      color: var(--rose);
      font-size: 0.95rem;
    }

    .order-step-num {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: inline-grid;
      place-items: center;
      background: var(--rose-bright);
      color: #fff;
      font-size: 0.8rem;
    }

    .order-col-qr .qr-style-panel {
      margin-top: 0;
    }

    .order-col-qr .btn-qr-dl {
      display: none;
    }

    .order-col-qr .pay-notice {
      margin: 10px 0 0;
    }

    @media (min-width: 900px) {
      .order-modal {
        width: min(1000px, 100%);
      }

      .order-columns {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        align-items: start;
        gap: 20px;
      }

      .order-col-qr {
        position: sticky;
        top: 0;
      }

      .order-col-pay .order-lines {
        padding: 10px 12px;
        gap: 5px;
        margin-bottom: 10px;
        font-size: 0.82rem;
      }

      .order-col-pay .pay-box {
        padding: 10px 12px;
        margin-bottom: 10px;
      }

      .order-col-pay .pay-qr {
        width: 170px;
        height: 170px;
        padding: 6px;
        margin: 0 auto 8px;
      }

      .order-col-pay .pay-meta {
        font-size: 0.8rem;
        line-height: 1.4;
        gap: 3px;
      }

      .order-col-pay .pay-copy-row {
        margin-top: 10px;
      }

      .order-col-qr .pay-notice {
        padding: 9px 12px;
        font-size: 0.8rem;
      }

      .order-pay-actions {
        grid-template-columns: 1.3fr 1fr;
      }

      .order-pay-actions .btn {
        padding: 11px 10px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .order-reminder-icon { animation: none; }
    }

    .modal-actions {
      display: grid;
      gap: 8px;
    }

    .modal-checkout-confirm {
      z-index: 55;
    }

    .checkout-confirm-modal {
      width: min(400px, 100%);
      max-height: min(86vh, 520px);
      padding: 20px 16px 16px;
    }

    .checkout-confirm-modal h2 {
      font-size: 1.45rem;
      margin-bottom: 10px;
    }

    .checkout-confirm-body {
      text-align: left;
      margin-bottom: 16px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid #f3a0c8;
      background: #fff8fb;
    }

    .checkout-confirm-body p {
      text-align: left;
      margin: 0 0 10px;
      color: #4a3a46;
      font-size: 0.9rem;
      line-height: 1.5;
    }

    .checkout-confirm-body ul {
      margin: 0;
      padding-left: 1.15rem;
      color: #5b3a4a;
      font-size: 0.86rem;
      line-height: 1.55;
    }

    .checkout-confirm-body li + li {
      margin-top: 6px;
    }

    .checkout-confirm-actions {
      grid-template-columns: 1fr;
    }

    .checkout-confirm-actions .btn-primary {
      min-height: 48px;
      font-weight: 700;
    }

    .checkout-confirm-actions .btn-ghost {
      min-height: 44px;
    }

    @media (min-width: 420px) {
      .checkout-confirm-actions {
        grid-template-columns: 1.2fr 1fr;
      }

      .checkout-confirm-actions .btn-ghost {
        order: -1;
      }
    }

    .pay-notice {
      margin: 4px 0 12px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid var(--rose-border);
      background: var(--rose-soft);
      color: #5b3a4a;
      font-size: 0.84rem;
      line-height: 1.5;
      text-align: left;
    }

    .pay-notice a {
      color: var(--rose);
      font-weight: 700;
      text-decoration: none;
    }

    .pay-notice a:hover {
      text-decoration: underline;
    }

    .btn-primary {
      background: var(--rose-bright);
      color: #fff;
      border-radius: 10px;
      padding: 12px;
    }

    .btn-ghost {
      background: #f3f4f6;
      color: #374151;
      border-radius: 10px;
      padding: 12px;
    }

    .foot-note {
      margin-top: 14px;
      text-align: center;
      color: rgba(255, 230, 242, 0.55);
      font-size: 0.78rem;
    }

    @media (max-width: 420px) {
      .template-grid { gap: 10px; }
      .thumb { height: 84px; }
      .card { padding: 16px 12px 18px; }
    }

    /* —— QR style customizer —— */
    .qr-style-toggle {
      margin-top: 12px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid var(--rose-border);
      background: #fff;
      cursor: pointer;
      font-family: inherit;
      text-align: left;
      transition: border-color 0.2s, background 0.2s;
    }

    .qr-style-toggle:hover {
      border-color: var(--rose-bright);
      background: #fff8fb;
    }

    .qr-style-toggle.is-on {
      border-color: var(--rose-bright);
      background: var(--rose-soft);
    }

    .qr-style-toggle-text {
      display: grid;
      gap: 2px;
    }

    .qr-style-toggle-text strong {
      color: var(--ink);
      font-size: 0.92rem;
    }

    .qr-style-toggle-text span {
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.35;
    }

    .qr-style-switch {
      flex-shrink: 0;
      width: 44px;
      height: 26px;
      border-radius: 999px;
      background: #e5dbe2;
      position: relative;
      transition: background 0.2s;
    }

    .qr-style-switch::after {
      content: "";
      position: absolute;
      top: 3px;
      left: 3px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,0.15);
      transition: transform 0.2s;
    }

    .qr-style-toggle.is-on .qr-style-switch {
      background: var(--rose-bright);
    }

    .qr-style-toggle.is-on .qr-style-switch::after {
      transform: translateX(18px);
    }

    .qr-style-panel {
      margin-top: 10px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid var(--rose-border);
      background: linear-gradient(180deg, #fff8fb 0%, #fff 70%);
      display: none;
      overflow: hidden;
      max-width: 100%;
    }

    .qr-style-panel.is-open {
      display: block;
    }

    .qr-style-panel .qr-style-title {
      font-weight: 700;
      color: var(--rose);
      margin-bottom: 4px;
      font-size: 0.95rem;
    }

    .qr-style-panel > .hint {
      margin-bottom: 12px;
    }

    .qr-style-layout {
      display: grid;
      gap: 14px;
      min-width: 0;
      max-width: 100%;
    }

    @media (min-width: 560px) {
      .qr-style-layout {
        grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
        align-items: start;
      }
    }

    .qr-preview-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      min-width: 0;
      max-width: 100%;
    }

    .qr-preview-frame {
      width: 148px;
      height: 148px;
      max-width: 100%;
      display: grid;
      place-items: center;
      background:
        radial-gradient(circle at 30% 20%, rgba(255, 182, 213, 0.45), transparent 55%),
        #fff;
      border-radius: 16px;
      border: 1px dashed var(--rose-border);
      overflow: hidden;
      box-shadow: 0 8px 22px rgba(194, 24, 91, 0.08);
      flex-shrink: 0;
    }

    .qr-preview-frame.is-framed {
      width: 160px;
      height: 160px;
      border-style: solid;
      background: #111;
    }

    .qr-preview-frame canvas {
      width: 132px;
      height: 132px;
      max-width: 100%;
      max-height: 100%;
      display: block;
    }

    .qr-preview-frame.is-framed canvas {
      width: 148px;
      height: 148px;
    }

    .qr-preview-url {
      font-size: 0.72rem;
      color: var(--muted);
      text-align: center;
      word-break: break-all;
      line-height: 1.35;
      min-height: 2.4em;
      max-width: 100%;
    }

    .qr-controls {
      display: grid;
      gap: 12px;
      min-width: 0;
      max-width: 100%;
    }

    .qr-ctrl-label {
      font-size: 0.78rem;
      font-weight: 600;
      color: #4a3f4a;
      margin-bottom: 6px;
    }

    .qr-shape-row,
    .qr-dot-row,
    .qr-color-row,
    .qr-frame-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      max-width: 100%;
    }

    .qr-frame-hint {
      margin-top: 6px;
      margin-bottom: 0;
      font-size: 0.72rem;
      line-height: 1.35;
    }

    .qr-frame-btn {
      appearance: none;
      -webkit-appearance: none;
      border: 2px solid #eadfe6;
      background: #fff;
      border-radius: 12px;
      width: 72px;
      max-width: 72px;
      min-width: 0;
      padding: 5px 4px 6px;
      cursor: pointer;
      transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      font-family: inherit;
      color: #5b5160;
      overflow: hidden;
      flex: 0 0 auto;
      box-sizing: border-box;
    }

    .qr-frame-btn:hover {
      border-color: var(--rose-border);
      transform: translateY(-1px);
    }

    .qr-frame-btn.active {
      border-color: var(--rose-bright);
      box-shadow: 0 0 0 1px rgba(225, 29, 116, 0.12);
      background: var(--rose-soft);
      color: var(--rose);
    }

    .qr-frame-btn__thumb,
    .qr-frame-btn img.qr-frame-btn__thumb {
      width: 56px !important;
      height: 56px !important;
      max-width: 56px !important;
      max-height: 56px !important;
      border-radius: 8px;
      object-fit: cover;
      object-position: center;
      display: block;
      flex-shrink: 0;
      background: linear-gradient(135deg, #fce7f3, #fff);
    }

    .qr-frame-btn__thumb.is-empty {
      display: grid;
      place-items: center;
      color: #9a8794;
      font-size: 0.62rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1;
    }

    .qr-frame-btn__label {
      font-size: 0.62rem;
      font-weight: 600;
      line-height: 1.2;
      text-align: center;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .qr-shape-btn,
    .qr-dot-btn {
      appearance: none;
      border: 2px solid #eadfe6;
      background: #fff;
      color: #5b5160;
      border-radius: 10px;
      width: 44px;
      height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s, transform 0.2s, color 0.2s;
      padding: 0;
    }

    .qr-shape-btn svg,
    .qr-dot-btn svg {
      width: 22px;
      height: 22px;
      display: block;
    }

    .qr-shape-btn:hover,
    .qr-dot-btn:hover {
      border-color: var(--rose-border);
      transform: translateY(-1px);
    }

    .qr-shape-btn.active,
    .qr-dot-btn.active {
      border-color: var(--rose-bright);
      background: var(--rose-soft);
      color: var(--rose);
      box-shadow: 0 0 0 1px rgba(225, 29, 116, 0.12);
    }

    .qr-color-swatch {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: 2px solid #fff;
      box-shadow: 0 0 0 1.5px #e8d5df;
      cursor: pointer;
      padding: 0;
      appearance: none;
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .qr-color-swatch:hover { transform: scale(1.08); }

    .qr-color-swatch.active {
      box-shadow: 0 0 0 2px var(--rose-bright);
      transform: scale(1.06);
    }

    .qr-custom-colors {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    .qr-custom-colors label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.75rem;
      color: var(--muted);
      font-weight: 500;
    }

    .qr-custom-colors input[type="color"] {
      width: 36px;
      height: 28px;
      padding: 0;
      border: 1px solid #eadfe6;
      border-radius: 8px;
      background: #fff;
      cursor: pointer;
    }

    .btn-qr-dl {
      width: 100%;
      background: var(--rose-soft);
      color: var(--rose);
      border: 1px solid var(--rose-border);
      border-radius: 10px;
      padding: 10px 12px;
      font-weight: 700;
      font-size: 0.88rem;
    }

    .btn-qr-dl:hover {
      background: #fce7f1;
    }

    .btn-qr-dl:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    /* —— Mobile app shell + bottom tab bar —— */
    .app-tabbar {
      display: none;
    }

    @media (max-width: 959px) {
      html, body {
        min-height: 100dvh;
      }

      body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
      }

      .page {
        min-height: 100dvh;
        padding: 10px 10px calc(24px + env(safe-area-inset-bottom, 0px));
      }

      .shell {
        max-width: 100%;
      }

      .brand {
        margin-bottom: 8px;
      }

      .brand h1 {
        font-size: 1.55rem;
        letter-spacing: 0.04em;
      }

      .brand h1 .brand-logo-img {
        max-height: 44px;
        max-width: min(160px, 55vw);
      }

      .btn-account {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 0.78rem;
      }

      .btn-support {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 0.72rem;
      }

      .card {
        border-radius: 16px;
        padding: 14px 12px 18px;
        box-shadow: 0 10px 28px rgba(8, 6, 20, 0.28);
      }

      .foot-note {
        margin-top: 10px;
        margin-bottom: 8px;
        font-size: 0.7rem;
      }

      .filter-bar {
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
      }

      .filter-bar::-webkit-scrollbar {
        display: none;
      }

      .filter-chip {
        flex: 0 0 auto;
        font-size: 0.68rem;
        padding: 5px 9px;
        white-space: nowrap;
      }

      /* Tab views: products | preview | buy */
      body.app-view-products .studio-preview {
        display: none;
      }

      body.app-view-preview .studio-main {
        display: none;
      }

      body.app-view-preview .studio-preview {
        display: block;
        order: 1;
      }

      body.app-view-preview .preview-panel {
        border-radius: 14px;
      }

      body.app-view-preview .preview-stage {
        min-height: min(78dvh, 740px);
        padding: 8px;
      }

      body.app-view-preview .preview-device {
        width: min(100%, 320px);
        max-width: min(100%, 320px);
        height: min(74dvh, 720px);
      }

      body.app-view-preview .preview-device.is-desktop {
        max-width: 100%;
        width: 100%;
        height: min(48dvh, 400px);
      }

      /* Buy view (mobile): form trước, preview gọn — dễ đọc & ít cuộn */
      body.app-view-buy .page {
        padding: 8px 8px calc(88px + env(safe-area-inset-bottom, 0px));
      }

      body.app-view-buy .brand {
        margin-bottom: 6px;
      }

      body.app-view-buy .brand h1 .brand-logo-img {
        max-height: 36px;
        max-width: min(140px, 48vw);
      }

      body.app-view-buy .studio {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      body.app-view-buy .buy-form-panel {
        display: block;
        order: 1;
        max-height: none;
        padding: 12px 12px 8px;
        margin-bottom: 0;
        border-radius: 14px;
      }

      body.app-view-buy .studio-preview {
        display: block;
        order: 2;
        position: static;
        align-self: stretch;
        width: 100%;
        max-width: none;
      }

      body.app-view-buy .preview-panel {
        width: 100%;
        box-sizing: border-box;
        padding: 8px 8px 10px;
        border-radius: 14px;
      }

      body.app-view-buy .preview-toolbar {
        gap: 6px;
        margin-bottom: 6px;
      }

      body.app-view-buy .preview-title {
        font-size: 0.7rem;
      }

      body.app-view-buy .preview-mode-btn span {
        display: none;
      }

      body.app-view-buy .preview-mode-btn {
        padding: 6px 8px;
      }

      body.app-view-buy .preview-stage {
        width: 100%;
        min-height: min(58dvh, 560px);
        padding: 8px;
      }

      body.app-view-buy .preview-device {
        width: min(100%, 300px);
        max-width: min(100%, 300px);
        height: min(56dvh, 580px);
      }

      body.app-view-buy .preview-device.is-desktop {
        max-width: 100%;
        width: 100%;
        height: min(34dvh, 300px);
      }

      body.app-view-buy .buy-form-head {
        margin-bottom: 10px;
        padding-bottom: 8px;
      }

      body.app-view-buy .btn-buy-back {
        font-size: 0.88rem;
        min-height: 36px;
        margin-bottom: 4px;
        padding: 4px 0;
      }

      body.app-view-buy .buy-form-head h2 {
        font-size: 1.35rem;
        line-height: 1.15;
      }

      body.app-view-buy .buy-form-sub {
        margin-top: 2px;
        font-size: 0.86rem;
      }

      body.app-view-buy .section {
        margin-bottom: 12px;
        padding-bottom: 12px;
      }

      body.app-view-buy .field {
        margin-bottom: 10px;
      }

      body.app-view-buy .field label {
        font-size: 0.9rem;
        margin-bottom: 6px;
      }

      body.app-view-buy .field .hint,
      body.app-view-buy .hint {
        font-size: 0.84rem;
        line-height: 1.5;
        margin-top: 8px;
      }

      body.app-view-buy .field .status {
        font-size: 0.84rem;
        margin-top: 6px;
      }

      body.app-view-buy .input-row {
        gap: 8px;
        align-items: stretch;
      }

      body.app-view-buy .input-row > input {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 46px;
        font-size: 1rem;
        padding: 12px 12px;
        border-radius: 10px;
      }

      body.app-view-buy .btn-check {
        min-height: 46px;
        min-width: 5.75rem;
        padding: 0 12px;
        font-size: 0.9rem;
        font-weight: 700;
        border-radius: 10px;
      }

      body.app-view-buy input[type="text"],
      body.app-view-buy input[type="password"],
      body.app-view-buy input[type="url"],
      body.app-view-buy input[type="number"],
      body.app-view-buy input[type="tel"],
      body.app-view-buy input[type="date"],
      body.app-view-buy textarea,
      body.app-view-buy select.extra-input {
        font-size: 1rem;
        min-height: 46px;
        padding: 12px;
        border-radius: 10px;
      }
      body.app-view-buy input[type="date"] { padding-right: 44px; }

      body.app-view-buy textarea {
        min-height: 110px;
      }

      body.app-view-buy .qr-style-toggle {
        padding: 12px;
        gap: 10px;
      }

      body.app-view-buy .qr-style-toggle-text strong {
        font-size: 0.9rem;
      }

      body.app-view-buy .qr-style-toggle-text span {
        font-size: 0.8rem;
        line-height: 1.4;
      }

      body.app-view-buy .buy-custom-head > strong {
        font-size: 0.92rem;
        line-height: 1.3;
      }

      body.app-view-buy .customization-tools {
        width: 100%;
        gap: 6px;
      }

      body.app-view-buy .customization-tool-btn {
        flex: 1 1 calc(33.333% - 6px);
        min-height: 40px;
        justify-content: center;
        font-size: 0.75rem;
        padding: 8px 6px;
      }

      body.app-view-buy .music-toggle {
        padding: 12px;
        gap: 10px;
      }

      body.app-view-buy .music-toggle .left strong {
        font-size: 0.92rem;
      }

      body.app-view-buy .music-toggle .left span {
        font-size: 0.8rem;
        line-height: 1.35;
      }

      body.app-view-buy .tip-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      body.app-view-buy .tip-btn {
        min-height: 44px;
        padding: 12px 8px;
        font-size: 0.9rem;
        border-radius: 10px;
      }

      body.app-view-buy .share-password-group summary,
      body.app-view-buy .checkout-quick-account summary {
        padding: 12px;
        font-size: 0.9rem;
        gap: 8px;
      }

      body.app-view-buy .share-password-field .hint {
        font-size: 0.82rem;
        line-height: 1.5;
      }

      body.app-view-buy .checkout-bar-inline {
        padding-top: 10px;
        margin-top: 4px;
        padding-bottom: 4px;
      }

      body.app-view-buy .checkout-bar-inline .summary {
        font-size: 0.86rem;
        margin-bottom: 10px;
        line-height: 1.4;
      }

      body.app-view-buy .checkout-actions {
        gap: 8px;
      }

      body.app-view-buy .checkout-actions .btn-apply,
      body.app-view-buy .checkout-actions .btn-pay {
        min-height: 50px;
        font-size: 0.95rem;
        border-radius: 12px;
      }

      body.app-view-buy .checkout-actions .btn-apply {
        font-size: 0.88rem;
        padding: 12px 8px;
      }

      .app-tabbar {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        height: 54px;
        padding: 4px 6px;
        gap: 2px;
        background: #ffffff;
        border: 1px solid rgba(26, 18, 32, 0.1);
        border-radius: 18px;
        box-shadow:
          0 8px 22px rgba(10, 8, 20, 0.2),
          0 1px 4px rgba(10, 8, 20, 0.08);
        backdrop-filter: blur(16px) saturate(1.15);
        -webkit-backdrop-filter: blur(16px) saturate(1.15);
      }

      .app-tab {
        appearance: none;
        -webkit-appearance: none;
        border: 0;
        background: transparent;
        color: #3f3844;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 4px 3px;
        border-radius: 14px;
        cursor: pointer;
        font-family: inherit;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
      }

      .app-tab:active {
        background: rgba(225, 29, 116, 0.12);
        transform: scale(0.96);
      }

      .app-tab.is-active {
        color: #be185d;
        background: rgba(225, 29, 116, 0.14);
      }

      .app-tab-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        stroke-width: 2.25;
      }

      .app-tab-label {
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        line-height: 1.1;
        white-space: nowrap;
      }
    }

    @media (max-width: 420px) {
      body.app-view-buy .input-row {
        flex-direction: column;
        gap: 8px;
      }

      body.app-view-buy .btn-check {
        width: 100%;
        min-width: 0;
      }

      body.app-view-buy .buy-form-head h2 {
        font-size: 1.28rem;
      }

      body.app-view-buy .checkout-actions {
        grid-template-columns: 1fr;
      }

      body.app-view-buy .checkout-actions .btn-apply {
        order: 2;
      }

      body.app-view-buy .checkout-actions .btn-pay {
        order: 1;
      }
    }

    @media (min-width: 960px) {
      .app-tabbar {
        display: none !important;
      }
    }
  


.thumb-thiep-trung-thu {
  background:
    radial-gradient(circle at 35% 30%, #f6e27a88, transparent 42%),
    linear-gradient(160deg, #0a1020, #1a2850 55%, #3a1520);
}

/* Buy form header: back control beside the title and selected product. */
body.app-view-buy .buy-form-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

body.app-view-buy .btn-buy-back {
  grid-column: 1;
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #f2dce6;
  border-radius: 12px;
  background: #fff6fa;
  color: #a82d5d;
  transition: background-color 160ms ease, border-color 160ms ease;
}

body.app-view-buy .btn-buy-back span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body.app-view-buy .btn-buy-back svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

body.app-view-buy .btn-buy-back:hover {
  background: #fce7f1;
  border-color: #eab9ce;
  filter: none;
}

body.app-view-buy .btn-buy-back:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

body.app-view-buy .buy-form-head h2 {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  color: #8f244b;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body.app-view-buy .buy-form-sub {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  color: #786872;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  body.app-view-buy .buy-form-head {
    column-gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  body.app-view-buy .buy-form-head h2 {
    font-size: 1.3rem;
  }

  body.app-view-buy .buy-form-sub {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.app-view-buy .btn-buy-back { transition: none; }
}
.thumb-thiep-trung-thu::before {
  content: "";
  position: absolute;
  inset: 18% 22% 28% 22%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4c4, #f0c14a 55%, #c47a10);
  box-shadow: 0 0 24px #f6d36a99;
}
