.vgl-wb {
  display: grid;
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
  gap: 24px;
  align-items: start;
}
.vgl-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.vgl-stage-panel {
  position: sticky;
  top: 84px;
}
.vgl-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.vgl-tab {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.vgl-tab[aria-selected="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.vgl-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vgl-field { margin-bottom: 14px; }
.vgl-field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.vgl-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.vgl-input, .vgl-textarea, .vgl-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 10px 12px;
}
.vgl-textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.vgl-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.vgl-swatch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer;
}
.vgl-swatch[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(194, 86, 47, .2); }
.vgl-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); flex-shrink: 0; }
.vgl-seals { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.vgl-seal-btn {
  display: flex; align-items: center; justify-content: center;
  height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer;
}
.vgl-seal-btn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); }
.vgl-seal-btn svg path { fill: var(--text); }
.vgl-seal-btn[aria-pressed="true"] svg path { fill: #ffffff; }
.vgl-music-row { display: flex; gap: 8px; align-items: center; }
.vgl-music-row .vgl-select { flex: 1; }
.vgl-photo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg);
}
.vgl-photo-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 2px solid #ffffff; box-shadow: var(--shadow-sm); }
.vgl-photo-status { font-size: 12px; color: var(--muted); flex: 1; min-width: 140px; }
.vgl-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.vgl-actions .btn-primary { flex: 1; }
.vgl-msg {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: #fdeee8; color: #8c2f10; border: 1px solid #ecc2b2;
}
.vgl-stage-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.vgl-stage-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.vgl-preview-box {
  position: relative;
  border-radius: var(--radius);
  padding: 28px 20px;
  min-height: 420px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: background .2s, color .2s, border-color .2s;
}
.vgl-env {
  position: relative; width: 100%; max-width: 400px; min-height: 260px;
  border-radius: 14px; border: 1px solid var(--env-border, #d9cbb8);
  background: var(--env-bg, #efe2ce); box-shadow: var(--shadow-lg);
  padding: 28px 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.vgl-env::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 118px;
  background: var(--env-flap, #f6ecdc);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 1px solid var(--env-border, #d9cbb8);
  pointer-events: none;
}
.vgl-env-to { position: relative; z-index: 2; font-family: var(--font-display); font-size: 22px; margin: 0; }
.vgl-env-sub { position: relative; z-index: 2; font-size: 14px; opacity: .78; margin: 0; }
.vgl-wax {
  position: relative; z-index: 3;
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--wax-bg, #c2562f);
  border: 3px solid rgba(255,250,242,.55);
  box-shadow: 0 8px 20px rgba(43,33,24,.24);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .18s;
}
.vgl-wax:hover { transform: scale(1.06); }
.vgl-wax:active { transform: scale(0.95); }
.vgl-wax-cap { position: relative; z-index: 2; font-size: 12px; font-weight: 600; letter-spacing: .04em; opacity: .82; }
.vgl-box-wrap {
  position: relative; width: 100%; max-width: 380px; padding: 28px 22px;
  border-radius: 14px; border: 1px solid var(--env-border, #d9cbb8);
  background: var(--env-bg, #efe2ce); box-shadow: var(--shadow-lg);
  text-align: center;
}
.vgl-box-ribbon-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 34px; transform: translateX(-50%); background: var(--wax-bg, #c2562f); opacity: .18; pointer-events: none; }
.vgl-box-ribbon-h { position: absolute; left: 0; right: 0; top: 50%; height: 28px; transform: translateY(-50%); background: var(--wax-bg, #c2562f); opacity: .14; pointer-events: none; }
.vgl-countdown {
  position: relative; z-index: 2; font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; background: rgba(255,250,242,.85); color: #2b2118;
  display: inline-block; margin: 10px 0 14px;
}
.vgl-letter-card {
  width: 100%; max-width: 440px; border-radius: 12px;
  padding: 28px 24px; border: 1px solid var(--env-border, #d9cbb8);
  box-shadow: var(--shadow-lg); text-align: left;
  animation: vglRise .35s ease;
}
@keyframes vglRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.vgl-letter-to { font-size: 13px; font-weight: 600; opacity: .75; margin: 0 0 6px; }
.vgl-letter-title { font-family: var(--font-display); font-size: 24px; line-height: 1.25; margin: 0 0 14px; }
.vgl-letter-body { white-space: pre-wrap; font-size: 16px; line-height: 1.65; margin: 0 0 18px; }
.vgl-polaroid {
  background: #ffffff; padding: 10px 10px 16px; border-radius: 6px;
  box-shadow: var(--shadow-sm); margin: 0 auto 18px; max-width: 240px; text-align: center;
  border: 1px solid rgba(0,0,0,.08);
}
.vgl-polaroid img { width: 100%; border-radius: 3px; margin-bottom: 8px; }
.vgl-polaroid figcaption { font-family: var(--font-display); font-size: 13px; color: #2b2118; }
.vgl-reveal-pill {
  padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--wax-bg, #c2562f);
  background: rgba(224, 160, 58, .12); font-size: 14px; font-weight: 600; margin-bottom: 16px;
}
.vgl-letter-from { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0; text-align: right; }
.vgl-scratch-zone {
  position: relative; width: 100%; max-width: 360px; height: 136px;
  border-radius: 12px; overflow: hidden; margin: 16px auto;
  border: 2px solid #e0a03a; background: #fffaf2; color: #2b2118;
  display: flex; align-items: center; justify-content: center; padding: 14px; text-align: center;
}
.vgl-scratch-secret { font-family: var(--font-display); font-size: 18px; font-weight: 700; z-index: 1; }
.vgl-scratch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; touch-action: none; cursor: crosshair; }
.vgl-result {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
}
.vgl-result h2 { font-size: 20px; margin-bottom: 10px; }
.vgl-link-box {
  display: flex; gap: 8px; align-items: center; margin: 10px 0 14px;
}
.vgl-link-input {
  flex: 1; font-family: var(--font-mono); font-size: 13px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.vgl-qr-row {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border);
}
.vgl-qr-canvas { width: 132px; height: auto; border-radius: 8px; border: 1px solid var(--border); background: #fffaf2; }
.vgl-qr-info { flex: 1; min-width: 180px; }
.vgl-qr-info p { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.vgl-recent { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.vgl-recent h2 { font-size: 16px; margin-bottom: 10px; }
.vgl-recent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.vgl-recent-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border);
  font-size: 13px;
}
.vgl-recent-item a { font-weight: 600; color: var(--text); }
.vgl-confetti-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.vgl-confetti {
  position: absolute; top: 38%; width: 8px; height: 12px; border-radius: 2px;
  animation: vglDrop 1.7s ease-out forwards;
}
@keyframes vglDrop {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx, 0px), 180px) rotate(320deg); }
}
@media (max-width: 860px) {
  .vgl-wb { grid-template-columns: 1fr; }
  .vgl-stage-panel { position: static; order: -1; }
}
@media (max-width: 640px) {
  .vgl-panel { padding: 16px; }
  .vgl-row { grid-template-columns: 1fr; }
  .vgl-seals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vgl-link-box { flex-direction: column; align-items: stretch; }
}
