:root {
  --bg: #f3efe6;
  --bg-2: #e7e0d2;
  --ink: #1c241c;
  --muted: #5d675c;
  --card: rgba(255, 252, 246, 0.88);
  --line: rgba(28, 36, 28, 0.12);
  --accent: #1f6f5b;
  --accent-2: #c45c26;
  --danger: #9b2c2c;
  --ok: #1f6f5b;
  --shadow: 0 18px 50px rgba(28, 36, 28, 0.08);
  --radius: 18px;
  --font: "DM Sans", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

[data-theme="dark"] {
  --bg: #121612;
  --bg-2: #1a211a;
  --ink: #f2efe6;
  --muted: #a7b0a5;
  --card: rgba(24, 30, 24, 0.92);
  --line: rgba(242, 239, 230, 0.12);
  --accent: #3cb89a;
  --accent-2: #e08a55;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 111, 91, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(196, 92, 38, 0.14), transparent 28%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.brand-text { font-family: var(--display); font-size: 1.2rem; }
.nav { display: flex; gap: .9rem; flex: 1; flex-wrap: wrap; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.main { padding: 1.5rem 0 3rem; }
.footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: .65rem 1.1rem; cursor: pointer; font: inherit;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .4rem .8rem; font-size: .9rem; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1.05rem; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page h1, .auth-card h1, .panel h2 { font-family: var(--display); margin: 0 0 .6rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); }
.flash { margin: 1rem auto; padding: .9rem 1rem; border-radius: 12px; }
.flash-success { background: rgba(31,111,91,.12); }
.flash-error { background: rgba(155,44,44,.12); }
.panel, .auth-card, .stat, .approx-preview {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem;
}
.auth-page { display: grid; place-items: center; min-height: 70vh; }
.auth-card { width: min(440px, 100%); display: grid; gap: .8rem; }
label { display: grid; gap: .35rem; font-size: .92rem; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem;
  background: color-mix(in srgb, var(--card) 70%, white); color: var(--ink); font: inherit;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.form-grid .full { grid-column: 1 / -1; }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat-value { font-family: var(--display); font-size: 1.8rem; }
.stat-label { color: var(--muted); font-size: .85rem; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.list li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: rgba(31,111,91,.12); font-size: .8rem; }
.table-wrap { overflow: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.filters { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.hero-welcome { padding: 3rem 0 4rem; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
.brand-hero { font-family: var(--display); font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 0 0 .6rem; line-height: 1.05; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.flow-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 2rem;
  min-height: 280px; display: grid; place-content: center; gap: .6rem; text-align: center;
  box-shadow: var(--shadow); animation: rise .8s ease both;
}
.flow-arrow { color: var(--accent-2); font-size: 1.4rem; }
.steps { list-style: none; display: flex; gap: .4rem; overflow: auto; padding: 0 0 1rem; margin: 0 0 1rem; }
.steps li a {
  display: flex; align-items: center; gap: .4rem; white-space: nowrap; color: var(--muted);
  padding: .45rem .7rem; border-radius: 999px; border: 1px solid transparent;
}
.steps li.active a, .steps li.done a { color: var(--ink); border-color: var(--line); background: var(--card); }
.steps li span {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-2); font-size: .8rem;
}
.steps li.active span { background: var(--accent); color: #fff; }
.tabs, .version-tabs, .toolbar, .admin-nav, .row-actions, .lang-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.tab { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .45rem .8rem; cursor: pointer; color: var(--ink); }
.tab.active { background: var(--accent); color: #fff; border-color: transparent; }
.tab-panel, .version-panel { display: none; }
.tab-panel.active, .version-panel.active { display: block; }
.platform-grid, .image-grid, .analysis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; margin: 1rem 0; }
.analysis-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.platform-option {
  display: grid; gap: .4rem; justify-items: center; text-align: center;
  padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer;
}
.image-card { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.image-card figcaption { padding: .5rem; font-size: .8rem; }
.warn { color: var(--danger); font-size: .85rem; }
.lock-row { display: flex; gap: .4rem; }
.inline-form { display: inline; }
.approx-preview { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1rem; }
.approx-gallery img, .approx-placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--bg-2); display: grid; place-items: center; }
.approx-desc { white-space: pre-wrap; font-family: inherit; background: transparent; border: 0; }
.ad-preview-block { margin: 1rem 0 1.4rem; }
.ad-preview {
  white-space: pre-wrap;
  font-family: "DM Sans", ui-monospace, monospace;
  font-size: .92rem;
  line-height: 1.45;
  background: color-mix(in srgb, var(--bg-2) 70%, var(--card));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  max-height: 420px;
  overflow: auto;
  margin: .5rem 0 0;
}
.ad-preview.compact { max-height: 220px; margin-top: .6rem; }
.package-actions { display: grid; gap: .5rem; margin-bottom: 1rem; }
.preview-badge { display: inline-block; background: rgba(196,92,38,.15); padding: .4rem .8rem; border-radius: 999px; margin-bottom: 1rem; }
.price { font-family: var(--display); font-size: 1.8rem; color: var(--accent-2); }
.user-chip { font-size: .9rem; color: var(--muted); }
.theme-toggle { border: 1px solid var(--line); background: transparent; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel, .stat, .auth-card { animation: rise .45s ease both; }

@media (max-width: 900px) {
  .hero-grid, .split, .form-grid, .stat-grid, .analysis-grid, .approx-preview { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .nav { order: 3; width: 100%; }
}
