*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg:       #faf7f2;
    --surface:  #f2ede4;
    --ink:      #1a1612;
    --ink2:     #4a4540;
    --ink3:     #9a9590;
    --gold:     #E85D21;
    --gold-lt:  #f07a45;
    --border:   #e0d8cc;
    --white:    #ffffff;
    --radius:   6px;
    --trans:    .35s cubic-bezier(.4,0,.2,1);
  }

  html, body { height: 100%; overflow: hidden; }

  body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Mono', monospace;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
  }

  /* ─── SCREENS ─────────────────────────────────────────────────────────── */
  .screen {
    width: 100%;
    max-width: 520px;
    height: 100dvh;
    display: none;
    flex-direction: column;
    padding: 0 20px;
    animation: fadeUp .5s ease both;
    overflow-y: auto;
  }
  .screen.active { display: flex; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ─── LANDING ─────────────────────────────────────────────────────────── */
  #landing {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: clamp(16px, 4vh, 32px);
    padding: 32px 24px;
    background:
      radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,93,33,.07) 0%, transparent 70%),
      var(--bg);
  }

  .hero-logo-wrap {
    position: relative;
  }

  .hero-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,93,33,.10) 0%, transparent 70%);
    pointer-events: none;
  }

  .logo-img {
    position: relative;
    width: clamp(180px, 54vw, 260px);
    height: auto;
  }

  .rakt-logo-img {
    width: clamp(160px, 50vw, 260px);
    height: auto;
  }

  .description {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
    color: var(--ink2);
    width: 100%;
  }

  /* ─── EVENT CARD ───────────────────────────────────────────────────────── */
  .event-card {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(232,93,33,.07), 0 1px 4px rgba(0,0,0,.05);
  }

  .event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
  }

  .event-row-group {
    display: flex;
    flex-direction: column;
  }

  .event-row-group .event-row {
    padding: 12px 20px;
  }

  .event-row-group .event-row:first-child {
    padding-top: 16px;
  }

  .event-row-group .event-row:last-child {
    padding-bottom: 16px;
  }

  .event-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
  }

  .event-icon svg {
    width: 18px;
    height: 18px;
  }

  .event-row-link {
    color: #E85D21;
    font-weight: 700;
    transition: background var(--trans);
  }
  .event-row-link:hover { background: rgba(232,93,33,.05); }

  .event-arrow {
    margin-left: auto;
    font-size: 14px;
    opacity: .6;
  }

  .event-divider {
    height: 1px;
    background: var(--border);
    margin: 0 20px;
  }

  .btn-start {
    background: #E85D21;
    color: #fff;
    border: none;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 20px 0;
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--trans);
    box-shadow: 0 4px 20px rgba(232,93,33,.30);
  }

  .btn-start::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.12);
    transform: translateY(100%);
    transition: transform var(--trans);
    z-index: 0;
  }

  .btn-start:hover::after { transform: translateY(0); }
  .btn-start span { position: relative; z-index: 1; }

  .footer-note {
    margin-top: 36px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink3);
    letter-spacing: 0.5px;
  }

  /* ─── PICK PAGE ───────────────────────────────────────────────────────── */
  #pick {
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 48px 28px 40px;
    background:
      radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,93,33,.07) 0%, transparent 70%),
      var(--bg);
  }

  .pick-logo {
    width: clamp(110px, 28vw, 140px);
    height: auto;
    margin-bottom: 24px;
    opacity: .9;
  }

  .pick-header {
    text-align: center;
    margin-bottom: 32px;
  }

  .pick-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
  }

  .pick-sub {
    font-size: 11px;
    color: var(--ink3);
    letter-spacing: 1px;
  }

  .pick-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 36px;
  }

  .pick-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    text-align: left;
    transition: var(--trans);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
  }

  .pick-btn:hover {
    border-color: var(--gold);
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(232,93,33,.13);
  }

  .pick-btn .pick-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color var(--trans), color var(--trans);
    color: var(--ink2);
  }

  .pick-btn .pick-icon svg {
    width: 20px;
    height: 20px;
  }

  .pick-btn:hover .pick-icon {
    border-color: var(--gold);
    color: var(--gold);
  }

  .pick-btn .pick-text {
    flex: 1;
  }

  .pick-btn .pick-text strong {
    display: block;
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 3px;
  }

  .pick-btn .pick-text span {
    font-size: 10px;
    color: var(--ink3);
    letter-spacing: 0.5px;
  }

  .pick-arrow {
    font-size: 16px;
    color: var(--ink3);
    transition: color var(--trans), transform var(--trans);
    flex-shrink: 0;
  }

  .pick-btn:hover .pick-arrow {
    color: var(--gold);
    transform: translateX(3px);
  }

  .back-link {
    font-size: 10px;
    color: var(--ink3);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 4px 0;
    transition: color var(--trans);
  }
  .back-link:hover { color: var(--gold); }

  /* ─── EDITOR ──────────────────────────────────────────────────────────── */
  #editor {
    padding: 0;
    max-width: 100%;
    width: 100%;
    height: 100dvh;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
  }

  .editor-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    z-index: 10;
  }

  .editor-logo-img {
    height: 32px;
    width: auto;
  }

  .btn-save {
    background: var(--gold);
    color: #fff;
    border: none;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--trans);
    box-shadow: 0 2px 12px rgba(232,93,33,.25);
  }
  .btn-save:hover { background: #c44d18; }
  .btn-save svg { width: 13px; height: 13px; }

  /* ─── NAME INPUT BAR ───────────────────────────────────────────────────── */
  .name-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .name-label {
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--ink3);
    flex-shrink: 0;
  }

  .name-input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 14px;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--ink);
    background: var(--bg);
    outline: none;
    transition: border-color var(--trans);
  }

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

  .name-input::placeholder {
    color: var(--ink3);
    opacity: 0.7;
  }

  /* Canvas area — fills all remaining vertical space */
  .canvas-area {
    flex: 1;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    min-height: 0;
  }

  .canvas-wrap {
    position: relative;
    box-shadow: 0 4px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
    /* Size to fit available space while respecting frame aspect ratio */
    max-width: calc(100vw - 48px);
    max-height: calc(100dvh - 280px);
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #mainCanvas {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 280px);
    width: auto;
    height: auto;
  }

  /* Sections */
  .section {
    padding: 10px 20px 0;
    background: var(--white);
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
  }

  .section-label {
    font-size: 8px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--ink3);
  }

  /* Ratio row (hidden but keep for JS compat) */
  .ratio-row {
    display: none;
  }

  .ratio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    padding: 8px 4px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    transition: var(--trans);
  }

  .ratio-btn .ratio-visual {
    background: var(--ink3);
    transition: background var(--trans);
    flex-shrink: 0;
    border-radius: 2px;
  }

  .ratio-btn .ratio-tag {
    font-size: 9px;
    letter-spacing: 0.5px;
    color: var(--ink2);
    white-space: nowrap;
    font-weight: 500;
  }

  .ratio-btn .ratio-name {
    font-size: 7.5px;
    color: var(--ink3);
    text-align: center;
    white-space: nowrap;
  }

  .ratio-btn.active,
  .ratio-btn:hover {
    border-color: var(--gold);
    background: #fffbf5;
  }

  .ratio-btn.active .ratio-visual { background: var(--gold); }
  .ratio-btn.active .ratio-tag    { color: var(--gold); }

  /* ─── FRAMES PANEL ────────────────────────────────────────────────────── */
  .frames-panel {
    flex-shrink: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
  }

  .frames-panel-header {
    padding: 12px 20px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .frames-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 20px 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: center;
  }
  .frames-scroll::-webkit-scrollbar { display: none; }

  .frame-thumb {
    flex-shrink: 0;
    width: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }

  .frame-preview {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2.5px solid transparent;
    transition: border-color var(--trans), transform var(--trans), box-shadow var(--trans);
    background: var(--surface);
  }

  .frame-preview img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: fill;
  }

  .frame-thumb.active .frame-preview,
  .frame-thumb:hover .frame-preview {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(232,93,33,.22);
  }

  .frame-thumb .frame-name {
    font-size: 9px;
    letter-spacing: 0.5px;
    color: var(--ink3);
    text-align: center;
    white-space: nowrap;
  }

  .frame-thumb.active .frame-name { color: var(--gold); font-weight: 500; }

  /* ─── MISC ────────────────────────────────────────────────────────────── */
  #fileInput { display: none; }

  /* ─── CAMERA OVERLAY ─────────────────────────────────────────────────── */
  #cameraOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  #cameraOverlay.open { display: flex; }

  #cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
  }

  .cam-ui {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100dvh;
    padding: 0;
  }

  /* top bar */
  .cam-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  }

  .cam-logo {
    width: clamp(110px, 28vw, 140px);
    height: auto;
    filter: brightness(0) invert(1);
    opacity: .9;
  }

  .cam-icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    transition: background var(--trans);
  }
  .cam-icon-btn:hover { background: rgba(255,255,255,.28); }

  /* viewfinder guide lines */
  .cam-guide {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
  }
  .cam-guide::before,
  .cam-guide::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,.18);
  }
  .cam-guide::before {
    left: 33.33%; top: 0; bottom: 0; width: 1px;
    box-shadow: 33.33vw 0 0 rgba(255,255,255,.18);
  }
  .cam-guide::after {
    top: 33.33%; left: 0; right: 0; height: 1px;
    box-shadow: 0 33.33vh 0 rgba(255,255,255,.18);
  }

  /* bottom bar */
  .cam-bottombar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 28px 32px 40px;
    background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
  }

  .cam-shutter {
    width: 74px; height: 74px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid rgba(255,255,255,.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,.2);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    outline: none;
    position: relative;
  }
  .cam-shutter::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ddd;
  }
  .cam-shutter:active { transform: scale(.9); box-shadow: 0 0 0 6px rgba(255,255,255,.3); }

  .cam-flip {
    font-size: 0;
  }

  .cam-error {
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: #0d0d0d;
    color: #fff;
    text-align: center;
    padding: 36px 28px;
    z-index: 3;
    display: none;
  }
  .cam-error.show { display: flex; }
  .cam-error .err-icon { font-size: 42px; margin-bottom: 18px; }
  .cam-error h3 { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; margin-bottom: 10px; }
  .cam-error .err-reason {
    font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
    color: #e05c5c; background: rgba(224,92,92,.12);
    border: 1px solid rgba(224,92,92,.3);
    padding: 5px 14px; border-radius: 20px; margin-bottom: 20px;
  }
  .cam-error .err-steps {
    list-style: none; text-align: left; width: 100%; max-width: 300px;
    margin-bottom: 28px;
  }
  .cam-error .err-steps li {
    display: flex; gap: 12px; align-items: flex-start;
    font-size: 12px; line-height: 1.7; color: #999; padding: 6px 0;
    border-bottom: 1px solid #1e1e1e;
  }
  .cam-error .err-steps li:last-child { border-bottom: none; }
  .cam-error .err-steps li .step-num {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
    background: #222; border: 1px solid #333;
    font-size: 10px; display: flex; align-items: center; justify-content: center;
    color: var(--gold); margin-top: 2px;
  }
  .cam-error .err-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 260px; }
  .cam-error .btn-retry {
    background: var(--gold); color: #fff; border: none;
    font-family: 'DM Mono', monospace; font-size: 11px;
    letter-spacing: 2px; padding: 13px 0; width: 100%;
    border-radius: var(--radius); cursor: pointer; transition: background .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .cam-error .btn-retry:hover { background: #c44d18; }
  .cam-error .btn-fallback {
    background: transparent; color: #888; border: 1px solid #2a2a2a;
    font-family: 'DM Mono', monospace; font-size: 10px;
    letter-spacing: 1.5px; padding: 11px 0; width: 100%;
    border-radius: var(--radius); cursor: pointer; transition: border-color .2s, color .2s;
  }
  .cam-error .btn-fallback:hover { border-color: #555; color: #ccc; }

  /* Loading spinner while camera starts */
  .cam-loading {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; background: #000; transition: opacity .3s;
  }
  .cam-loading.hide { opacity: 0; pointer-events: none; }
  .cam-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid #222; border-top-color: var(--gold);
    animation: spin .8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .cam-loading p { font-size: 10px; letter-spacing: 2px; color: #555; }

  /* ─── SAVE DIALOG ────────────────────────────────────────────────────── */
  .dialog-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 200;
    background: rgba(26, 22, 18, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center; justify-content: center;
    padding: 24px;
  }
  .dialog-backdrop.open { display: flex; }

  .dialog {
    background: var(--bg);
    border-radius: 20px;
    width: 100%; max-width: 320px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.28);
    animation: dialogPop .35s cubic-bezier(.34,1.56,.64,1) both;
    border: 1px solid var(--border);
  }

  @keyframes dialogPop {
    from { opacity: 0; transform: scale(.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  .dialog-top {
    background: var(--bg);
    padding: 28px 24px 16px;
    text-align: center;
  }

  .dialog-success-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(232,93,33,.1);
    border: 1.5px solid rgba(232,93,33,.25);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    color: var(--gold);
  }
  .dialog-success-icon svg { width: 26px; height: 26px; }

  .dialog-top h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px; font-weight: 700;
    color: var(--ink); letter-spacing: -.3px;
    margin-bottom: 4px;
  }

  .dialog-top p {
    font-size: 11px; color: var(--ink3);
    letter-spacing: 1px; line-height: 1.6;
  }

  .dialog-photo-wrap {
    padding: 0 24px 20px;
    display: flex;
    justify-content: center;
  }

  .dialog-photo {
    width: 120px; height: 120px;
    border-radius: 14px;
    overflow: hidden;
    border: 2.5px solid var(--gold);
    box-shadow: 0 6px 24px rgba(232,93,33,.2);
    position: relative;
  }
  .dialog-photo img {
    width: 100%; height: 100%; object-fit: cover; display: block;
  }

  .dialog-actions {
    padding: 0 20px 24px;
    display: flex; flex-direction: column; gap: 10px;
  }

  .dialog-btn {
    width: 100%; padding: 14px;
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 11px; letter-spacing: 2px;
    text-transform: uppercase; cursor: pointer;
    border: none; transition: var(--trans);
    display: flex; align-items: center; justify-content: center; gap: 9px;
  }

  .dialog-btn.share {
    background: var(--gold);
    color: #fff;
    box-shadow: 0 4px 16px rgba(232,93,33,.28);
  }
  .dialog-btn.share:hover { background: #c44d18; }

  .dialog-btn.primary {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border);
  }
  .dialog-btn.primary:hover { border-color: var(--gold); color: var(--gold); }

  .dialog-btn.secondary {
    background: var(--white);
    color: var(--ink2);
    border: 1px solid var(--border);
  }
  .dialog-btn.secondary:hover { border-color: var(--gold); color: var(--ink); }

  /* ─── VIDEO BUTTON ──────────────────────────────────────────────────── */
  .btn-video {
    background: var(--ink);
    color: #fff;
    border: none;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--trans);
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
  }
  .btn-video:hover { background: #333; }
  .btn-video svg { width: 12px; height: 12px; }

  /* ─── VIDEO PROGRESS OVERLAY ────────────────────────────────────────── */
  .video-progress {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(26, 22, 18, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .video-progress-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #fff;
    text-align: center;
  }

  .video-progress-inner p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
  }

  .video-progress-inner span {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ink3);
    text-transform: uppercase;
  }

  /* ─── VIDEO PREVIEW IN DIALOG ───────────────────────────────────────── */
  .video-preview-wrap {
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
  }

  .video-preview-wrap video {
    width: 100%;
    max-width: 260px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: #000;
  }

  /* ─── GESTURE OVERLAY ──────────────────────────────────────────────────── */
  #gestureOverlay {
    position: absolute;
    inset: 0;
    cursor: grab;
    touch-action: none;
    z-index: 2;
    border-radius: 2px;
  }
  #gestureOverlay:active { cursor: grabbing; }

  /* ─── CHANGE PHOTO BUTTON ───────────────────────────────────────────── */
  .btn-change {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink2);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--trans);
    white-space: nowrap;
  }
  .btn-change:hover {
    border-color: var(--ink2);
    color: var(--ink);
    background: var(--surface);
  }
  .btn-change svg { width: 12px; height: 12px; flex-shrink: 0; }

  /* ─── ADJUST CONTROLS in top bar ────────────────────────────────────── */
  .adjust-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 6px;
  }

  .adj-btn {
    width: 28px; height: 28px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--ink2);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
  }
  .adj-btn:hover { background: var(--gold); color: #fff; border-radius: 4px; }

  .adj-divider {
    width: 1px; height: 16px;
    background: var(--border);
    margin: 0 2px;
  }

  /* ═══════════════════════════════════════════════════════════════════════
     MOBILE RESPONSIVE  ( ≤ 480px )
  ═══════════════════════════════════════════════════════════════════════ */
  @media (max-width: 480px) {

    .editor-top {
      padding: 10px 12px;
      gap: 6px;
    }

    .editor-logo-img {
      height: 26px;
    }

    .btn-change .btn-change-label { display: none; }
    .btn-change {
      padding: 8px;
      gap: 0;
    }
    .btn-change svg { width: 15px; height: 15px; }

    .adj-btn { width: 26px; height: 26px; font-size: 15px; }

    .btn-save {
      padding: 9px 12px;
      gap: 0;
    }
    .btn-save svg { width: 15px; height: 15px; }

    .btn-video-label { display: none; }
    .btn-video {
      padding: 9px 12px;
      gap: 0;
    }
    .btn-video svg { width: 15px; height: 15px; }

    .canvas-area { padding: 14px; }
    .canvas-wrap {
      max-width: calc(100vw - 32px);
      max-height: calc(100dvh - 260px);
    }

    .frames-scroll { padding: 4px 12px 16px; gap: 10px; }
    .frame-thumb   { width: 74px; }
    .frame-preview { width: 74px; height: 74px; border-radius: 8px; }
    .frame-thumb .frame-name { font-size: 8px; }

    .name-bar { padding: 8px 12px; }
    .name-input { padding: 7px 10px; font-size: 12px; }

    .logo-img { width: 160px; }
    .pick-title { font-size: 22px; }
    .description { font-size: 12px; }
  }

  /* Tiny phones ≤ 360px */
  @media (max-width: 360px) {
    .editor-logo-img { display: none; }
    .adj-btn { width: 24px; height: 24px; font-size: 14px; }
  }
