/* ============================================================
   cuboShape – style.css
   Sections:
   1.  Tokens
   2.  Reset & Base
   3.  Background Orbs
   4.  Header
   5.  Main Layout
   6.  Hero
   7.  Drop zone
   8.  Workspace topbar
   9.  Tab bar
   10. Two-column layout
   11. Control panel & cards
   12. Dimension inputs & lock button
   13. Percentage scale buttons
   14. Preset tabs & list
   15. Format & quality row
   16. Ratio grid (crop)
   17. Crop stage & overlay
   18. Shape grid
   19. Background selector
   20. Rotate & flip controls
   21. Preview panels
   22. Checkerboard background
   23. Action buttons
   24. Ad slots
   25. Toast
   26. Animations & Keyframes
   27. Responsive
   ============================================================ */


/* ── 1. Tokens ── */
:root {
  --red:        #e34949;
  --red-dim:    #c93c3c;
  --red-glow:   rgba(227,73,73,0.25);
  --bg:           #f5f5f7;
  --surface:      #ffffff;
  --surface-2:    #fafafa;
  --border:       rgba(0,0,0,0.08);
  --text:         #1d1d1f;
  --text-2:       #6e6e73;
  --text-3:       #aeaeb2;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg:    0 24px 64px rgba(0,0,0,0.12);
  --glass:        rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.5);
}

[data-theme="dark"] {
  --bg:           #000000;
  --surface:      #1c1c1e;
  --surface-2:    #2c2c2e;
  --border:       rgba(255,255,255,0.08);
  --text:         #f5f5f7;
  --text-2:       #aeaeb2;
  --text-3:       #636366;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:    0 24px 64px rgba(0,0,0,0.6);
  --glass:        rgba(28,28,30,0.8);
  --glass-border: rgba(255,255,255,0.08);
}


/* ── 2. Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}


/* ── 3. Background Orbs ── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
  animation: orb-drift 18s ease-in-out infinite alternate;
}

.orb-1 { width: 500px; height: 500px; background: var(--red); top: -120px; right: -100px; }
.orb-2 { width: 350px; height: 350px; background: #1d1d1f; bottom: 100px; left: -80px; animation-delay: -6s; }
[data-theme="dark"] .orb-2 { background: #555; }


/* ── 4. Header ── */
header {
  position: sticky; top: 0; z-index: 100;
  height: 60px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--glass); border-bottom: 1px solid var(--glass-border);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.logo-wrap { display: flex; align-items: center; gap: 10px; animation: fade-down 0.5s ease both; }

.logo-icon {
  /* width: 34px; height: 34px; background: var(--red);  */
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px var(--red-glow); overflow: hidden;
  transition: transform 0.2s ease; cursor: pointer; flex-shrink: 0;
}

.logo-icon:hover { transform: rotate(-6deg) scale(1.08); }
.logo-icon img { width: 34px; height: 34px; object-fit: contain; display: block; }
.logo-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text); }
.logo-name span { color: var(--red); }

.theme-toggle {
  position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  cursor: pointer; transition: background 0.3s ease, border-color 0.3s ease;
  animation: fade-down 0.5s 0.1s ease both;
}

.theme-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--text-2);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease;
}

[data-theme="dark"] .theme-toggle::after { transform: translateX(18px); background: var(--red); }

.toggle-icons {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 5px;
  pointer-events: none; font-size: 9px; color: var(--text-3);
}


/* ── 5. Main Layout ── */
main {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 40px 24px 32px;
}


/* ── 6. Hero ── */
.hero { text-align: center; margin-bottom: 28px; animation: fade-up 0.6s ease both; }

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.1;
}

.hero h1 em { font-style: normal; color: var(--red); }
.hero p { margin-top: 10px; font-size: 0.9rem; color: var(--text-2); }


/* ── 7. Drop zone ── */
.dropzone {
  border: 2px dashed var(--border); border-radius: 20px;
  background: var(--surface); padding: 60px 24px;
  text-align: center; cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  margin-bottom: 16px; animation: fade-up 0.6s 0.08s ease both;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--red); background: var(--surface-2);
  box-shadow: 0 0 0 5px var(--red-glow);
}

.drop-icon { font-size: 2.8rem; color: var(--red); margin-bottom: 14px; display: block; animation: bounce-soft 2.5s ease infinite; }
.drop-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.drop-sub   { font-size: 0.88rem; color: var(--text-2); margin-bottom: 8px; }
.drop-formats { font-size: 0.72rem; color: var(--text-3); }

.btn-link {
  background: none; border: none; color: var(--red);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; text-decoration: underline; text-decoration-color: var(--red-glow);
}


/* ── 8. Workspace topbar ── */
.workspace { animation: fade-up 0.4s ease both; }

.workspace-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}

.file-info-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-2);
}

.file-info-bar i { color: var(--red); }

.file-dims {
  font-family: 'DM Mono', monospace; font-size: 0.75rem;
  color: var(--text-3); margin-left: 4px;
}


/* ── 9. Tab bar ── */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 4px;
}

.tab-btn {
  flex: 1; padding: 9px 10px; border-radius: 10px;
  border: none; background: transparent; color: var(--text-2);
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: 500;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 6px; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn.active { background: var(--red); color: #fff; box-shadow: 0 2px 10px var(--red-glow); }
.tab-btn i { font-size: 0.78rem; }

.tab-content { display: none; animation: fade-up 0.3s ease both; }
.tab-content.active { display: block; }


/* ── 10. Two-column layout ── */
.two-col {
  display: grid; grid-template-columns: 340px 1fr;
  gap: 16px; align-items: start;
}


/* ── 11. Control panel & cards ── */
.ctrl-panel { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-sm);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.ctrl-card { padding: 18px 20px; }

.card-label {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}

.setting-label {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3);
}

.hint-text { font-size: 0.72rem; color: var(--text-3); margin-top: 6px; }


/* ── 12. Dimension inputs & lock button ── */
.dim-row {
  display: flex; align-items: flex-end; gap: 8px; margin-bottom: 14px;
}

.dim-field {
  flex: 1; display: flex; flex-direction: column; gap: 5px;
}

.dim-field label { font-size: 0.68rem; font-weight: 600; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; }

.field-input {
  width: 100%; padding: 9px 11px;
  border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font-family: 'DM Mono', monospace; font-size: 0.85rem;
  outline: none; -moz-appearance: textfield;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.field-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }

.field-select {
  width: 100%; padding: 9px 11px;
  border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem;
  outline: none; cursor: pointer;
  transition: border-color 0.2s ease;
}

.field-select:focus { border-color: var(--red); }

.lock-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text-3); display: flex; align-items: center;
  justify-content: center; font-size: 0.82rem; cursor: pointer;
  flex-shrink: 0; align-self: flex-end;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lock-btn.locked { border-color: var(--red); color: var(--red); background: rgba(227,73,73,0.08); }
.lock-btn:hover  { border-color: var(--red); color: var(--red); }


/* ── 13. Percentage scale buttons ── */
.pct-row { display: flex; flex-direction: column; gap: 8px; }

.pct-btns { display: flex; gap: 5px; flex-wrap: wrap; }

.pct-btn {
  padding: 5px 10px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-family: 'DM Mono', monospace;
  font-size: 0.75rem; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pct-btn.active { background: var(--red); border-color: transparent; color: #fff; }
.pct-btn:hover  { border-color: var(--red); color: var(--red); }


/* ── 14. Preset tabs & list ── */
.preset-tabs {
  display: flex; gap: 3px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px;
}

.preset-tab {
  flex: 1; padding: 5px 6px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.preset-tab.active { background: var(--red); color: #fff; }

.preset-list { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }

.preset-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 0.78rem; color: var(--text-2);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.preset-item:hover { border-color: var(--red); color: var(--red); background: var(--surface); }

.preset-dims {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-3);
}


/* ── 15. Format & quality row ── */
.format-row { display: flex; flex-direction: column; gap: 10px; }

.quality-wrap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.quality-wrap label { font-size: 0.72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; }
.quality-wrap span  { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--text-2); min-width: 32px; }

input[type="range"] {
  flex: 1; -webkit-appearance: none; height: 4px;
  border-radius: 2px; background: var(--border); outline: none; cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 2px 6px var(--red-glow);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }


/* ── 16. Ratio grid (crop) ── */
.ratio-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }

.ratio-btn {
  padding: 8px 4px; border-radius: 9px; text-align: center;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ratio-btn.active { background: var(--red); border-color: transparent; color: #fff; }
.ratio-btn:hover  { border-color: var(--red); color: var(--red); }

.crop-info {
  font-size: 0.8rem; color: var(--text-2);
  font-family: 'DM Mono', monospace; line-height: 1.5;
}


/* ── 17. Crop stage & overlay ── */
.crop-stage {
  position: relative; overflow: hidden;
  border-radius: 12px; background: var(--surface-2);
  min-height: 300px; display: flex; align-items: center; justify-content: center;
}

#cropCanvas { display: block; max-width: 100%; }

.crop-overlay {
  position: absolute; inset: 0; pointer-events: none;
}

.crop-box {
  position: absolute;
  border: 2px solid var(--red);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  cursor: move; pointer-events: all;
}

.crop-rule-h, .crop-rule-v {
  position: absolute; background: rgba(255,255,255,0.25);
}

.crop-rule-h { left: 33.3%; width: 1px; top: 0; bottom: 0; }
.crop-rule-v { top: 33.3%; height: 1px; left: 0; right: 0; }

.crop-handle {
  position: absolute; width: 12px; height: 12px;
  background: #fff; border: 2px solid var(--red); border-radius: 3px;
  pointer-events: all;
}

.crop-handle.tl { top: -6px;  left: -6px;  cursor: nw-resize; }
.crop-handle.tr { top: -6px;  right: -6px; cursor: ne-resize; }
.crop-handle.bl { bottom: -6px; left: -6px;  cursor: sw-resize; }
.crop-handle.br { bottom: -6px; right: -6px; cursor: se-resize; }


/* ── 18. Shape grid ── */
.shape-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 7px;
}

.shape-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 4px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.shape-btn i { font-size: 1.1rem; }
.shape-btn:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }
.shape-btn.active { background: var(--red); border-color: transparent; color: #fff; }


/* ── 19. Background selector ── */
.bg-row { display: flex; gap: 6px; flex-wrap: wrap; }

.bg-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 500; cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.bg-btn.active { border-color: var(--red); color: var(--red); }
.bg-btn:hover  { border-color: var(--red); color: var(--red); }

.bg-swatch {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
}

.transparent-swatch {
  background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
  border: 1px solid rgba(0,0,0,0.1);
}


/* ── 20. Rotate & flip controls ── */
.rotate-btns {
  display: flex; gap: 8px; margin-bottom: 14px;
}

.custom-angle-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}

.angle-input-wrap { display: flex; align-items: center; gap: 4px; }
.deg-label { font-size: 0.85rem; color: var(--text-2); }

.flip-row { display: flex; gap: 8px; }


/* ── 21. Preview panels ── */
.preview-panel { padding: 18px; display: flex; flex-direction: column; gap: 10px; }

.preview-stage {
  border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border);
  min-height: 300px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}

.preview-stage canvas { max-width: 100%; max-height: 480px; display: block; border-radius: 8px; }

.preview-meta { font-size: 0.75rem; color: var(--text-3); font-family: 'DM Mono', monospace; }


/* ── 22. Checkerboard background (for transparent shapes) ── */
.checkerboard {
  background-image:
    repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%);
  background-size: 16px 16px;
}

[data-theme="dark"] .checkerboard {
  background-image:
    repeating-conic-gradient(#333 0% 25%, transparent 0% 50%);
}


/* ── 23. Action Buttons ── */
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-action {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease,
              transform 0.15s ease, color 0.2s ease;
}

.btn-action:hover { border-color: var(--red); color: var(--red); transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }

.btn-action.primary {
  background: var(--red); color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--red-glow);
}

.btn-action.primary:hover { background: var(--red-dim); color: #fff; }


/* ── 23b. Global format bar ── */
.global-fmt-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin-bottom: 14px;
  flex-wrap: wrap; border-radius: 14px;
}

.gfmt-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}

.gfmt-pills { display: flex; gap: 5px; }

.gfmt-pill {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  font-family: 'DM Mono', monospace; font-size: 0.75rem;
  font-weight: 500; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gfmt-pill.active {
  background: var(--red); border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px var(--red-glow);
}

.gfmt-pill:hover:not(.active) { border-color: var(--red); color: var(--red); }

.gfmt-quality {
  display: flex; align-items: center; gap: 8px;
}

.gfmt-quality label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
}

.gfmt-quality span {
  font-family: 'DM Mono', monospace; font-size: 0.75rem;
  color: var(--text-2); min-width: 30px;
}


/* ── 23c. Lasso tool ── */
.lasso-stage {
  position: relative; overflow: hidden;
  border-radius: 12px; background: var(--surface-2);
  min-height: 360px; display: flex; align-items: center; justify-content: center;
  cursor: crosshair;
}

#lassoCanvas {
  display: block; max-width: 100%; max-height: 520px;
  border-radius: 8px; cursor: crosshair;
}

.lasso-stats {
  display: flex; gap: 14px; margin-bottom: 2px;
}

.lasso-stat {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--text-2);
  font-family: 'DM Mono', monospace;
}

.lasso-stat i { color: var(--red); font-size: 0.7rem; }

.kbd-hints {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}

.kbd-hints span {
  font-size: 0.72rem; color: var(--text-3);
  display: flex; align-items: center; gap: 4px;
}

kbd {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  color: var(--text-2); box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.lasso-bg-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 500; cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lasso-bg-btn.active { border-color: var(--red); color: var(--red); }
.lasso-bg-btn:hover  { border-color: var(--red); color: var(--red); }

.btn-action.danger {
  color: var(--red); border-color: rgba(227,73,73,0.25);
}
.btn-action.danger:hover {
  background: rgba(227,73,73,0.06); border-color: var(--red);
}


/* ── 24. Ad Slots ── */
.ads-row {
  margin-top: 28px; display: flex; gap: 16px;
  animation: fade-up 0.6s 0.2s ease both;
}

.ad-slot {
  flex: 1; height: 90px; border-radius: 14px;
  border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 0.75rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 500; background: var(--surface);
}


/* ── 25. Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text); color: var(--bg);
  padding: 12px 22px; border-radius: 30px;
  font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; z-index: 999;
  white-space: nowrap; pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }


/* ── 26. Animations ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0);     }
}

@keyframes orb-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px,40px) scale(1.1); }
}

@keyframes bounce-soft {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}


/* ── 27. Responsive ── */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .preview-panel { order: -1; }
}

@media (max-width: 600px) {
  header { padding: 0 16px; }
  main   { padding: 28px 14px 24px; }
  .tab-btn { font-size: 0.72rem; padding: 8px 5px; gap: 4px; }
  .tab-btn i { display: none; }
  .shape-grid { grid-template-columns: repeat(3,1fr); }
  .ratio-grid { grid-template-columns: repeat(3,1fr); }
  .ads-row { flex-direction: column; }
  .ad-slot { height: 60px; }
  .dropzone { padding: 40px 16px; }
  .rotate-btns { flex-wrap: wrap; }
  .flip-row { flex-direction: column; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 1.55rem; }
  .logo-name { font-size: 0.95rem; }
  /* .logo-icon {  } */
  .logo-icon img { width: 28px; height: 28px; }
  .shape-grid { grid-template-columns: repeat(3,1fr); }
  .tab-btn { padding: 7px 3px; font-size: 0.68rem; }
}

@media (max-width: 300px) {
  header { padding: 0 10px; height: 52px; }
  main   { padding: 18px 10px 16px; }
  .hero h1 { font-size: 1.25rem; }
  .hero p  { font-size: 0.72rem; }
  .tab-bar { gap: 2px; padding: 3px; }
  .tab-btn { padding: 6px 2px; font-size: 0.62rem; border-radius: 8px; }
  .shape-grid { grid-template-columns: repeat(2,1fr); }
  .ratio-grid { grid-template-columns: repeat(2,1fr); }
  .btn-action { padding: 8px 9px; font-size: 0.72rem; }
  .logo-name { font-size: 0.82rem; }
  .logo-icon {  border-radius: 8px; }
  .logo-icon img { width: 26px; height: 26px; }
  .theme-toggle { width: 38px; height: 22px; }
  .theme-toggle::after { width: 15px; height: 15px; }
  [data-theme="dark"] .theme-toggle::after { transform: translateX(13px); }
  .toast { font-size: 0.7rem; padding: 8px 12px; white-space: normal; text-align: center; max-width: 90vw; }
  .ad-slot { display: none; }
}