/* Dodopic Studio — shared design system (no color-mix for html2canvas safety) */

:root {
  --ui-bg: #efeae3;
  --ui-bg-2: #fffdf9;
  --ui-card: #ffffff;
  --ui-ink: #1c1916;
  --ui-muted: #6b6258;
  --ui-line: #e4d9cc;
  --ui-accent: #8b3a3a;
  --ui-accent-2: #1e3a5f;
  --ui-ok: #2f6b4f;
  --ui-ok-bg: #eef7f1;
  --ui-warn: #8a5a18;
  --ui-warn-bg: #fdf5e6;
  --shadow: 0 10px 36px rgba(40, 28, 18, 0.10);
  --radius: 14px;
  --font-ui: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--ui-bg);
  color: var(--ui-ink);
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ===== Header & Brand (Genius AI above Dodopic) ===== */
.site-header {
  background: var(--ui-bg-2);
  border-bottom: 1px solid var(--ui-line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  flex: 0 0 auto;
}
.brand-parent {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ui-accent);
}
.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.38rem;
  letter-spacing: 0.02em;
  color: var(--ui-ink);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--ui-line);
  background: #fff;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  min-height: 36px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-pill:hover { border-color: #bfa994; }
.nav-pill.active {
  background: var(--ui-ink);
  color: #fff;
  border-color: var(--ui-ink);
}
.nav-pill.cart-pill {
  margin-left: auto;
  background: #fff8f5;
  border-color: #e4c6bf;
}
.nav-pill.cart-pill.active {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: #fff;
}
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ui-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.nav-pill.active .cart-badge {
  background: #fff;
  color: var(--ui-accent);
}

/* ===== Buttons & Controls ===== */
.btn {
  border: 1px solid var(--ui-line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 15px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
}
.btn:hover { border-color: #bda894; }
.btn.primary {
  background: var(--ui-accent);
  color: #fff;
  border-color: var(--ui-accent);
}
.btn.primary:hover { background: #742f2f; }
.btn.ok {
  background: var(--ui-ok);
  color: #fff;
  border-color: var(--ui-ok);
}
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.48; cursor: not-allowed; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 0.8rem; }

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #f4efe8;
  color: var(--ui-ink);
}
.pill-tag.free { background: var(--ui-ok-bg); color: var(--ui-ok); }
.pill-tag.paid { background: var(--ui-warn-bg); color: var(--ui-warn); }
.pill-tag.test { background: #eef1f7; color: var(--ui-accent-2); }

/* ===== Home Page ===== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.hero-box {
  background: var(--ui-bg-2);
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  padding: 26px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.hero-box .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ui-accent);
  margin-bottom: 4px;
}
.hero-box h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0 0 8px;
  line-height: 1.1;
}
.hero-box p {
  margin: 0;
  color: var(--ui-muted);
  max-width: 640px;
  font-size: 0.96rem;
}
.pricing-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--ui-card);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(40, 28, 18, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-thumb {
  height: 128px;
  border-radius: 12px;
  border: 1px solid var(--ui-line);
  background: #f8f4ee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}
.tool-card h2 {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  margin: 0;
  line-height: 1.15;
}
.tool-card p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.88rem;
  flex: 1;
}
.tool-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #f2ece4;
}

/* ===== Maker Workspace ===== */
.maker-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 18px;
  align-items: start;
}
.preview-panel {
  background: var(--ui-bg-2);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.seg-tabs {
  display: inline-flex;
  background: #f1ebe3;
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.seg-tabs button {
  border: 0;
  background: transparent;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ui-muted);
}
.seg-tabs button.active {
  background: #fff;
  color: var(--ui-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.preview-stage {
  background: #e7dfd4;
  border-radius: 14px;
  padding: 20px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.card-frame {
  box-shadow: 0 14px 36px rgba(28, 25, 22, 0.18);
  background: #fff;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.preview-caption {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ui-muted);
}

.editor-card {
  background: var(--ui-bg-2);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.editor-card h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 0 0 10px;
}
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ui-muted);
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px solid #f0e8de;
}
.field { margin-bottom: 10px; }
.flab {
  display: block;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--ui-muted);
  margin-bottom: 4px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--ui-line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
}
.field textarea { resize: vertical; min-height: 76px; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.photo-box {
  background: #f8f4ee;
  border: 1px dashed #cbbba9;
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0 10px;
}
.photo-box-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ui-line);
}

/* ===== Cart & Charges Page ===== */
.cart-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}
.panel {
  background: var(--ui-bg-2);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.panel h2, .panel h3 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
}
.charges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.charges-table th, .charges-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #efe8df;
}
.charges-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ui-muted);
}
.cart-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #efe8df;
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-info { flex: 1 1 200px; }
.cart-item-title { font-weight: 600; font-size: 0.96rem; }
.cart-item-sub { font-size: 0.82rem; color: var(--ui-muted); margin-top: 2px; }
.qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: #fff;
}
.qty-ctrl button {
  border: 0;
  background: transparent;
  width: 30px;
  height: 30px;
  font-weight: 700;
}
.qty-ctrl span {
  min-width: 24px;
  text-align: center;
  font-size: 0.86rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.92rem;
}
.summary-row.total {
  border-top: 1px solid var(--ui-line);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.test-banner {
  background: #eef3fb;
  border: 1px solid #cdd9ec;
  color: #1e3a5f;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.84rem;
  margin-bottom: 12px;
}

/* ===== Modals & Helpers ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 22, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}
.modal {
  background: var(--ui-bg-2);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  max-width: 460px;
  width: 100%;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  max-height: 90dvh;
  overflow-y: auto;
}
.modal h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0 0 10px;
}
.modal-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.price-banner {
  background: #f8f4ee;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.86rem;
}
.code-row {
  display: flex;
  gap: 8px;
}
.code-row input { flex: 1; }
.hint { font-size: 0.81rem; color: var(--ui-muted); margin-top: 4px; }
.access-ok { color: var(--ui-ok); font-weight: 600; }
.access-err { color: #b4235a; font-weight: 600; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ui-ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  z-index: 80;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#render-stage {
  position: fixed;
  left: -10000px;
  top: 0;
  pointer-events: none;
  z-index: -1;
}

/* ===== Footer (Genius AI above Dodopic) ===== */
.site-footer {
  border-top: 1px solid var(--ui-line);
  background: var(--ui-bg-2);
  padding: 20px 16px 28px;
  margin-top: 32px;
}
.site-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.83rem;
  color: var(--ui-muted);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.footer-parent {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ui-accent);
}
.footer-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ui-ink);
}

@media (max-width: 900px) {
  .maker-wrap { grid-template-columns: 1fr; }
  .cart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .two-col { grid-template-columns: 1fr; }
  .preview-stage { padding: 12px; min-height: 250px; }
  .hero-box { padding: 18px 16px; }
}
