.ow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 44px;
  align-items: start;
}
.ow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6c4d19;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.ow-h1 {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ow-lead {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 52ch;
}
.ow-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 16px;
}
.ow-tab {
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ow-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.ow-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.ow-field { margin-bottom: 14px; }
.ow-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.ow-input, .ow-select, .ow-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}
.ow-input:focus, .ow-select:focus, .ow-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 86, 47, 0.14);
}
.ow-textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.ow-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ow-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ow-swatch {
  flex: 1;
  min-width: 96px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ow-swatch.active { border-color: var(--accent); background: #fff; color: var(--accent); }
.ow-swatch[data-theme="midnight-gold"].active { background: #1e1824; color: #f4d284; border-color: #1e1824; }
.ow-gift-list { display: grid; gap: 10px; max-height: 280px; overflow-y: auto; padding-right: 4px; margin-bottom: 12px; }
.ow-gift-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.ow-gift-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ow-gift-num { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ow-link-btn {
  background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 4px;
}
.ow-link-btn:hover { text-decoration: underline; }
.ow-err { color: #b42318; font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.ow-saved-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}
.ow-saved-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.ow-saved-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ow-saved-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.ow-saved-chip:hover { border-color: var(--accent); text-decoration: none; }

/* Keepsake Box Frame */
.ow-box-shell {
  position: relative;
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(145deg, var(--wood-inner), var(--wood-outer));
  box-shadow: 0 18px 40px rgba(43, 33, 24, 0.16);
}
.ow-box-shell.theme-midnight-gold {
  background: linear-gradient(145deg, #2b1d2e, #16101c);
}
.ow-box-shell.theme-velvet-cream {
  background: linear-gradient(145deg, #d7c7b2, #b8a388);
}
.ow-box-tray {
  background: var(--linen);
  border-radius: 12px;
  padding: 14px;
  box-shadow: inset 0 2px 8px rgba(43, 33, 24, 0.12);
}
.ow-box-shell.theme-midnight-gold .ow-box-tray {
  background: #231829;
}
.ow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ow-env {
  position: relative;
  aspect-ratio: 1.18 / 1;
  border-radius: 10px;
  border: 1.5px solid #d7c8b4;
  background: var(--card);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  text-align: center;
  overflow: hidden;
}
.ow-env::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(215, 200, 180, 0.25), rgba(215, 200, 180, 0));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
.ow-env:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ow-env.empty {
  background: rgba(247, 241, 232, 0.55);
  border: 1.5px dashed #c4b29c;
}
.ow-env.empty::before { display: none; }
.ow-box-shell.theme-midnight-gold .ow-env.empty {
  background: rgba(255, 250, 242, 0.06);
  border-color: rgba(224, 160, 58, 0.35);
  color: #d9cbb8;
}
.ow-env-num {
  position: absolute;
  top: 5px; left: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.75;
}
.ow-seal {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fffaf2;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 3px 6px rgba(43, 33, 24, 0.24), inset 0 2px 3px rgba(255,255,255,0.28);
  position: relative;
  z-index: 1;
}
.ow-seal.crimson { background: radial-gradient(circle at 35% 30%, #dc6a41, #a83e1c); }
.ow-seal.gold { background: radial-gradient(circle at 35% 30%, #f1be5e, #b87b1e); }
.ow-seal.forest { background: radial-gradient(circle at 35% 30%, #3a8f60, #1f5c3a); }
.ow-seal.midnight { background: radial-gradient(circle at 35% 30%, #4c4375, #231d3d); }
.ow-env-from {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  z-index: 1;
}
.ow-env-sub { font-size: 11px; color: var(--muted); z-index: 1; }
.ow-env.empty .ow-env-sub { font-weight: 600; color: var(--muted); }
.ow-box-shell.theme-midnight-gold .ow-env.empty .ow-env-sub { color: #d8c7b0; }
.ow-countdown-pill {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.ow-countdown-pill span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

@keyframes ow-rattle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-3deg); }
  45% { transform: rotate(3deg); }
  70% { transform: rotate(-2deg); }
}
.ow-env.rattle { animation: ow-rattle 0.36s ease; }

/* Live Box View */
.ow-live-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.ow-live-title {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.15;
  margin: 4px 0 6px;
}
.ow-live-meta { color: var(--muted); font-size: 15px; margin: 0; }
.ow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}
.ow-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2b2118;
  color: #fffaf2;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

/* Modal */
.ow-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 120;
}
.ow-modal-bg[hidden] { display: none; }
.ow-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 56px rgba(43, 33, 24, 0.25);
}
.ow-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ow-modal-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0;
}
.ow-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.ow-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ow-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.ow-chip.active { border-color: var(--accent); background: #fff; color: var(--accent); font-weight: 600; }
.ow-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  margin: 12px 0;
  cursor: pointer;
}
.ow-check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.ow-letter-paper {
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin: 12px 0 18px;
}
.ow-letter-text {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0 0 14px;
}
.ow-letter-sig { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0; }
.ow-live-footer {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.ow-story-preview {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

@media (max-width: 860px) {
  .ow-hero { grid-template-columns: 1fr; gap: 28px; }
  .ow-h1 { font-size: 36px; }
}
@media (max-width: 640px) {
  .ow-h1 { font-size: 30px; }
  .ow-live-title { font-size: 28px; }
  .ow-row-2 { grid-template-columns: 1fr; }
  .ow-grid { gap: 8px; }
  .ow-box-shell { padding: 10px; }
  .ow-box-tray { padding: 10px; }
}