/* ═══════════════════════════════════════════════════════════
   LUCKYBASE BUILDER — DESIGN SYSTEM v5
   Light, flat, readable. Secondary accent: strong blue.
═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Syne:wght@600;700;800&display=swap');

/* ── TOKENS ──────────────────────────────────────────── */
:root {
  --bg:     #f4f8fb;
  --bg1:    #eef4f8;
  --bg2:    #ffffff;
  --bg3:    #e7f0f5;
  --bg4:    #d9e8f1;
  --bg5:    #caddeb;

  --ln:     rgba(6,45,72,.12);
  --ln2:    rgba(6,45,72,.2);
  --ln3:    rgba(6,45,72,.3);
  --line:   var(--ln);

  --tx:     #0f2940;
  --tx2:    #30516b;
  --tx3:    #4d6478;

  --p:      #1d4ed8;
  --p2:     #1e40af;
  --p3:     #1e3a8a;
  --p-d:    rgba(29,78,216,.12);
  --p-dim:  var(--p-d);
  --p-glow: 0 0 0 3px rgba(29,78,216,.2);

  --acc:    #2563eb;
  --ok:     #34d399;
  --warn:   #fbbf24;
  --err:    #f87171;
  --info:   #60a5fa;

  --r4:  4px;  --r8:  8px;  --r12: 12px;
  --r16: 16px; --r20: 20px; --r24: 24px; --r32: 32px; --pill: 999px;
  --r: var(--r16);
  --r-sm: var(--r12);

  --sh1: 0 2px 8px rgba(15,41,64,.06);
  --sh2: 0 6px 18px rgba(15,41,64,.08);
  --sh3: 0 10px 24px rgba(15,41,64,.1);
  --sh-p: 0 8px 20px rgba(29,78,216,.2);

  --ease:   cubic-bezier(.22,.1,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --t1: 110ms var(--ease);
  --t2: 220ms var(--ease);
  --t3: 380ms var(--ease);
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  color: var(--tx);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; }

/* ── PAGE WRAPPER ────────────────────────────────────── */
.page {
  min-height: 100vh;
  position: relative;
  padding: 18px 18px 60px;
}

/* Flat background */
.page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, #f7fbfe 0%, #f2f8fc 100%);
  animation: none;
}
@keyframes bgShift {
  0%   { opacity:1; filter:hue-rotate(0deg); }
  100% { opacity:1; filter:hue-rotate(25deg); }
}

/* Floating orbs */
.orb { display: none; }
.orb-1, .orb-2, .orb-3 { display: none; }
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(30px,-40px) scale(1.05); }
  50%  { transform: translate(-20px,20px) scale(.97); }
  75%  { transform: translate(40px,30px) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}

.shell {
  width: min(100%, 1720px);
  max-width: none;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── TOPBAR ──────────────────────────────────────────── */
.top {
  position: sticky;
  top: 10px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  min-height: 62px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--ln2);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: none;
  animation: slideDown .28s var(--ease) both;
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-16px); }
  to   { opacity:1; transform:translateY(0); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand > img { width: 34px; height: 34px; object-fit: contain; }
.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--tx);
  letter-spacing: -.01em;
}
.brand-name em { font-style:normal; color:var(--tx3); font-size:12px; margin-left:3px; }
.brand > span { font-size: 14px; font-weight: 700; color: var(--tx); }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--tx2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  transition: all var(--t1);
  white-space: nowrap;
}
.nav a .nav-icon { font-size: 13px; }
.nav a:hover {
  color: var(--tx);
  background: rgba(255,255,255,.05);
  border-color: var(--ln);
}
.nav a.on {
  color: var(--tx);
  background: var(--p-d);
  border-color: rgba(29,78,216,.4);
}
.nav a.on .nav-icon { filter: drop-shadow(0 0 4px var(--p)); }

.top-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }

/* ── SESSION CHIP ────────────────────────────────────── */
.session-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--ln);
  border-radius: var(--pill);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--tx2);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tx3); flex-shrink: 0;
  transition: background var(--t2);
}
.session-dot.active { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ── PROFILE MENU ───────────────────────────────────── */
.profile-menu {
  position: relative;
}
.profile-btn {
  min-height: 40px;
  min-width: 40px;
  border-radius: var(--pill);
  border: 1px solid var(--ln2);
  background: rgba(255,255,255,.04);
  color: var(--tx2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  gap: 8px;
  cursor: pointer;
  transition: all var(--t1);
}
.profile-btn:hover {
  color: #fff;
  border-color: var(--p2);
  background: var(--p);
}
.profile-btn svg {
  width: 16px;
  height: 16px;
}
.profile-btn .profile-mini {
  font-size: 11px;
  font-weight: 700;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-dd {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  background: #ffffff;
  border: 1px solid var(--ln2);
  border-radius: var(--r16);
  box-shadow: var(--sh3);
  padding: 8px;
  display: none;
  z-index: 400;
}
.profile-dd.open {
  display: block;
}
.profile-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--ln);
  margin-bottom: 6px;
}
.profile-head b {
  display: block;
  font-size: 13px;
  color: var(--tx);
  line-height: 1.2;
}
.profile-head span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--tx3);
}
.profile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--r12);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  text-decoration: none;
  padding: 8px 10px;
  transition: all var(--t1);
}
.profile-link:hover {
  color: var(--p3);
  border-color: rgba(29,78,216,.36);
  background: rgba(29,78,216,.12);
}
.profile-link.logout {
  color: #b91c1c;
}
.profile-link.logout:hover {
  border-color: rgba(248,113,113,.45);
  background: rgba(248,113,113,.16);
  color: #7f1d1d;
}
.profile-settings {
  margin: 6px 4px 8px;
  padding: 8px 8px 2px;
  border-top: 1px solid var(--ln);
  display: grid;
  gap: 8px;
}
.profile-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--tx2);
  font-weight: 700;
}
.profile-setting-col {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: var(--tx2);
  font-weight: 700;
}
.profile-select {
  min-height: 30px;
  border-radius: var(--r8);
  padding: 6px 8px;
  font-size: 11px;
}
.profile-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--p);
}

/* ── LAYOUT ──────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  align-items: start;
}
.hero.centered {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}
.hero.wide {
  grid-template-columns: 1fr;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

/* ── GLASS CARDS ─────────────────────────────────────── */
.card {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--ln);
  padding: 18px 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: visible;
  animation: fadeUp .32s var(--ease) both;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  background: transparent;
  pointer-events: none;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(24px); }
  to   { opacity:1; transform:translateY(0); }
}
.card:nth-child(2) { animation-delay:.08s; }
.card:nth-child(3) { animation-delay:.16s; }

.card-glow { box-shadow: none; border-color: var(--ln2); }
.card-sm { padding: 14px 0; gap: 10px; border-radius: 0; }

/* ── TYPOGRAPHY ──────────────────────────────────────── */
h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -.035em;
  color: var(--tx);
}
h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(24px, 3.8vw, 40px);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -.025em;
  color: var(--tx);
}
h3 {
  font-family: 'Syne', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--tx);
}
h4 { font-size: 16px; font-weight: 700; color: var(--tx); }
p { color: var(--tx2); line-height: 1.68; }
.lead { font-size: 17px; color: var(--tx2); line-height: 1.65; }
small { font-size: 12px; color: var(--tx3); }

.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #7c5cfc 35%, #c084fc 70%, #e879f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-2 {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  width: fit-content;
}
.badge-dot { width:6px; height:6px; border-radius:50%; animation: badgePulse 2s ease-in-out infinite; flex-shrink:0; }
@keyframes badgePulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.4);opacity:.7} }

.badge.free   { background:rgba(52,211,153,.1);  border:1px solid rgba(52,211,153,.3);  color:#065f46; }
.badge.free   .badge-dot { background:#34d399; box-shadow:0 0 6px #34d399; }
.badge.pro    { background:rgba(37,99,235,.12); border:1px solid rgba(37,99,235,.3); color:#1e40af; }
.badge.pro    .badge-dot { background:#2563eb; box-shadow:none; }
.badge.info   { background:var(--p-d);           border:1px solid rgba(29,78,216,.3);  color:#1e3a8a; }
.badge.info   .badge-dot { background:var(--p);  box-shadow:none; }
.badge.warn   { background:rgba(251,191,36,.1);  border:1px solid rgba(251,191,36,.3);  color:#92400e; }
.badge.warn   .badge-dot { background:#fbbf24;   box-shadow:0 0 6px #fbbf24; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: -.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--t1), opacity var(--t1), background var(--t1), border-color var(--t1), color var(--t1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}
.btn::after {
  display: none;
  content: none;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none !important; }
.btn-icon { font-size: 16px; }

.btn.main {
  background: var(--p);
  color: #ffffff;
  border-color: var(--p2);
}
.btn.main:hover:not(:disabled) { background: var(--p2); }

.btn.pro {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 800;
  border-color: #1d4ed8;
}
.btn.pro:hover:not(:disabled) { background: #1d4ed8; color: #ffffff; }

.btn.alt {
  background: rgba(29,78,216,.12);
  border-color: rgba(29,78,216,.5);
  color: #1e3a8a;
}
.btn.alt:hover:not(:disabled) { background: rgba(29,78,216,.18); border-color: var(--p2); color:#1e3a8a; }

.btn.ghost {
  background: rgba(29,78,216,.08);
  border-color: rgba(29,78,216,.35);
  color: #1e3a8a;
}
.btn.ghost:hover:not(:disabled) { background: rgba(29,78,216,.16); border-color: var(--p2); color:#1e3a8a; }

.btn.ok-btn {
  background: var(--p);
  border-color: var(--p2);
  color: #ffffff;
}
.btn.danger {
  background: rgba(29,78,216,.9);
  border-color: var(--p2);
  color: #ffffff;
}
.btn.sm { min-height: 38px; padding: 8px 16px; font-size: 13px; border-radius: var(--r12); }
.btn.lg { min-height: 56px; padding: 14px 32px; font-size: 16px; border-radius: var(--r20); }

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── FORM INPUTS ─────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-label .lbl-icon { font-size: 14px; }
.input-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tx3);
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
  transition: color var(--t1);
}
.input-wrap:focus-within .input-prefix { color: var(--p); }
input, textarea, select {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--ln2);
  border-radius: var(--r12);
  color: var(--tx);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 13px 16px;
  transition: border-color var(--t2), box-shadow var(--t2), background var(--t2);
  outline: none;
  -webkit-appearance: none;
}
input.has-prefix, textarea.has-prefix { padding-left: 44px; }
input:focus, textarea:focus, select:focus {
  border-color: var(--p);
  box-shadow: var(--p-glow);
  background: rgba(29,78,216,.07);
}
input::placeholder, textarea::placeholder { color: var(--tx3); }
textarea { min-height: 140px; resize: vertical; border-radius: var(--r16); line-height: 1.65; }
select { cursor: pointer; }
select option { background: var(--bg2); color: var(--tx); }

/* ── STATUS BOXES ────────────────────────────────────── */
.status {
  padding: 10px 0 10px 12px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-left: 3px solid var(--ln2);
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.55;
  transition: all var(--t2);
}
.status.ok    { border-left-color:rgba(52,211,153,.5); color:#047857; }
.status.warn  { border-left-color:rgba(251,191,36,.5); color:#92400e; }
.status.err   { border-left-color:rgba(248,113,113,.5); color:#991b1b; }
.status.info  { border-left-color:rgba(29,78,216,.5); color:#1e3a8a; }

/* ── DIVIDER ─────────────────────────────────────────── */
.sep { height:1px; background:var(--ln); }
.sep-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tx3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
}
.sep-label::before, .sep-label::after { content:''; flex:1; height:1px; background:var(--ln); }

/* ── FEATURE ITEMS ───────────────────────────────────── */
.feature-list { display:flex; flex-direction:column; gap:8px; }
.fi {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--ln);
  border-radius: var(--r16);
  transition: border-color var(--t2), background var(--t2);
}
.fi:hover { border-color: var(--ln2); background: rgba(29,78,216,.04); }
.fi-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--p-d);
  border: 1px solid rgba(29,78,216,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.fi-content { flex:1; min-width:0; }
.fi-content b { display:block; font-size:14px; font-weight:700; color:var(--tx); margin-bottom:3px; }
.fi-content p { font-size:13px; color:var(--tx3); line-height:1.5; }

/* ── STAT GRID ───────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-box {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--ln);
  border-radius: var(--r16);
  padding: 16px 14px;
  text-align: center;
  transition: border-color var(--t1);
}
.stat-box:hover { border-color: var(--ln2); }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--p2);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl { font-size: 11px; color: var(--tx3); font-weight: 600; letter-spacing:.04em; }

/* ── STEP ROW ────────────────────────────────────────── */
.step-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.step {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--ln);
  border-radius: var(--r16);
  padding: 16px 10px;
  text-align: center;
  transition: all var(--t2);
  position: relative;
}
.step::after {
  content: '→';
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tx3);
  font-size: 12px;
  z-index: 1;
}
.step:last-child::after { display: none; }
.step:hover { border-color: var(--ln2); background: var(--p-d); }
.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--p-d);
  border: 1px solid rgba(29,78,216,.3);
  color: #1e3a8a;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.step b { display:block; font-size:13px; color:var(--tx); font-weight:700; margin-bottom:2px; }
.step span { font-size:11px; color:var(--tx3); }

/* ── TEMPLATE GRID ───────────────────────────────────── */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tpl-card {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--ln);
  border-radius: var(--r20);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t2);
  animation: fadeUp .5s var(--ease) both;
}
.tpl-card:nth-child(2n) { animation-delay:.06s; }
.tpl-card:nth-child(3n) { animation-delay:.12s; }
.tpl-card:hover { border-color: rgba(29,78,216,.45); transform: translateY(-4px); box-shadow: 0 16px 48px rgba(29,78,216,.18); }
.tpl-card.locked { opacity:.6; cursor:default; }
.tpl-card.locked:hover { transform:none; border-color:var(--ln); box-shadow:none; }

.tpl-thumb {
  height: 150px;
  background-size: cover;
  background-position: center top;
  position: relative;
}
.tpl-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 35%, rgba(6,5,14,.88));
}
.tpl-tag-pill {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(29,78,216,.85);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 3px 9px; border-radius: var(--pill);
}
.tpl-body { padding: 14px 14px 16px; }
.tpl-name { font-size: 14px; font-weight: 700; color: var(--tx); margin-bottom: 4px; }
.tpl-desc { font-size: 12px; color: var(--tx3); line-height: 1.4; margin-bottom: 12px; }
.tpl-action {
  width: 100%;
  padding: 9px 14px;
  background: var(--p-d);
  border: 1px solid rgba(29,78,216,.3);
  border-radius: var(--r8);
  color: #1e3a8a; font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all var(--t1);
  font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tpl-action:hover:not(:disabled) { background: var(--p); border-color: var(--p2); color: #fff; }
.tpl-action:disabled { opacity:.4; cursor:not-allowed; }

/* ── FILTER CHIPS ────────────────────────────────────── */
.filter-row { display:flex; gap:5px; flex-wrap:wrap; }
.chip {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--ln);
  border-radius: var(--pill);
  color: var(--tx2); font-size: 11px; font-weight: 700;
  padding: 5px 13px; cursor: pointer;
  transition: all var(--t1);
  display: flex; align-items: center; gap: 5px;
}
.chip:hover { background: var(--p-d); border-color: rgba(29,78,216,.35); color: var(--tx); }
.chip.on { background: var(--p-d); border-color: rgba(29,78,216,.5); color: #1e3a8a; }

/* ── PRICING ─────────────────────────────────────────── */
.plan-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.plan-card {
  border: 1px solid var(--ln);
  border-radius: var(--r20);
  padding: 22px 18px;
  background: rgba(255,255,255,.025);
  position: relative;
  transition: all var(--t2);
  cursor: pointer;
}
.plan-card:hover { border-color: var(--ln2); transform: translateY(-2px); }
.plan-card.popular { border-color: rgba(37,99,235,.4); background: rgba(29,78,216,.07); }
.plan-popular-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #0b63f6, #0957d8);
  color: #fff; font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 3px 14px; border-radius: var(--pill); white-space: nowrap;
}
.plan-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--tx2); margin-bottom: 8px; }
.plan-price { font-family: 'Syne', sans-serif; font-size: 40px; font-weight: 800; color: var(--tx); line-height: 1; }
.plan-price sup { font-size: 20px; vertical-align: super; }
.plan-credits { font-size: 13px; color: var(--tx2); margin: 6px 0 14px; }
.plan-features { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.plan-feat { font-size: 12px; color: var(--tx2); display:flex; gap:8px; align-items:baseline; }
.plan-feat::before { content:'✓'; color:var(--ok); font-weight:800; flex-shrink:0; }
.plan-btn {
  width: 100%; padding: 10px; border-radius: var(--r12);
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1px solid rgba(29,78,216,.35);
  background: var(--p-d); color: #1e3a8a;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--t1);
}
.plan-btn:hover:not(:disabled) { background: var(--p); border-color: var(--p2); color: #fff; }
.plan-btn.popular-btn { background: var(--p); border-color: var(--p2); color: #fff; }
.plan-btn:disabled { opacity:.4; cursor:not-allowed; }

/* ── CREDIT DISPLAY ──────────────────────────────────── */
.credit-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(29,78,216,.08);
  border: 1px solid rgba(29,78,216,.25);
  border-radius: var(--r16);
  padding: 14px 18px;
  gap: 12px;
}
.credit-bar-left .lbl { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; color:var(--tx3); margin-bottom:3px; }
.credit-num { font-family:'Syne',sans-serif; font-size:36px; font-weight:800; color:#1e3a8a; line-height:1; }

/* ── ORDER BOX ───────────────────────────────────────── */
.order-box {
  background: var(--p-d);
  border: 1px solid rgba(29,78,216,.3);
  border-radius: var(--r16);
  padding: 16px;
  display: none;
  animation: fadeUp .3s var(--ease) both;
}
.order-box.show { display: block; }
.order-box-title { font-size:13px; font-weight:700; color:#1e3a8a; margin-bottom:6px; display:flex; align-items:center; gap:8px; }
.order-box-detail { font-size:12px; color:var(--tx2); }
.order-box-detail a { color:#1e3a8a; font-weight:700; text-decoration:underline; }

/* ── AI PROMPT ───────────────────────────────────────── */
.prompt-area { position: relative; }
.prompt-area textarea { padding-bottom: 44px; }
.prompt-footer {
  position: absolute; bottom: 10px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.word-badge {
  background: var(--bg3); border: 1px solid var(--ln);
  border-radius: var(--pill); padding: 3px 10px;
  font-size: 11px; font-weight: 700; color: var(--tx3);
}
.word-badge.over { background:rgba(248,113,113,.12); border-color:rgba(248,113,113,.3); color:var(--err); }

.preset-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.preset-btn {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--ln);
  border-radius: var(--r12);
  padding: 11px 14px;
  color: var(--tx2); font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: all var(--t1);
  font-family: 'DM Sans', sans-serif;
}
.preset-btn:hover { background: var(--p-d); border-color: rgba(29,78,216,.3); color: var(--tx); }
.preset-btn b { display:block; color:#1e3a8a; font-size:10px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:3px; }

.mode-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--ln);
  border-radius: var(--r12); padding: 4px;
}
.mode-tab {
  flex: 1; padding: 9px 12px; border-radius: var(--r8);
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: 0;
  background: none; color: var(--tx3);
  transition: all var(--t1);
  font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.mode-tab.on { background: var(--p); color: #fff; box-shadow: var(--sh-p); }

/* ── AI LOADER ───────────────────────────────────────── */
.ai-loader {
  display: none;
  align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--p-d);
  border: 1px solid rgba(29,78,216,.3);
  border-radius: var(--r16);
  animation: fadeUp .3s var(--ease);
}
.ai-loader.show { display: flex; }
.ai-ring {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(29,78,216,.3);
  border-top-color: var(--p);
  animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform:rotate(360deg); } }
.ai-loader-text { font-size: 13px; color: #1e3a8a; font-weight: 600; }

/* ── RESULT LINKS ────────────────────────────────────── */
.result-links {
  background: rgba(52,211,153,.06);
  border: 1px solid rgba(52,211,153,.22);
  border-radius: var(--r16);
  padding: 16px;
  display: none;
  animation: fadeUp .3s var(--ease);
}
.result-links.show { display: block; }
.result-links-title { font-size:13px; font-weight:700; color:#065f46; margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.result-links-row { display:flex; gap:8px; flex-wrap:wrap; }

/* ── FOOTER ──────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--tx3);
  font-weight: 600;
  padding-top: 10px;
}
.footer a {
  color: #155eef;
  font-weight: 900;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ── ANIMATIONS ──────────────────────────────────────── */
.float { animation: floatAnim 5s ease-in-out infinite; }
@keyframes floatAnim { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }

/* ── TOAST (global) ──────────────────────────────────── */
.toast-global {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--bg2); border: 1px solid var(--ln2);
  border-radius: var(--pill); padding: 11px 22px;
  font-size: 13px; font-weight: 700; color: var(--tx);
  z-index: 9999; opacity: 0;
  transition: all .28s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--sh3);
}
.toast-global.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-global.ok-t { border-color: rgba(52,211,153,.4); color: #065f46; }
.toast-global.err-t { border-color: rgba(248,113,113,.4); color: #991b1b; }

/* ── LIGHT THEME ────────────────────────────────────── */
html.theme-light {
  --bg:     #f4f8fb;
  --bg1:    #eef4f8;
  --bg2:    #ffffff;
  --bg3:    #e7f0f5;
  --bg4:    #d9e8f1;
  --bg5:    #caddeb;

  --ln:     rgba(6,45,72,.12);
  --ln2:    rgba(6,45,72,.2);
  --ln3:    rgba(6,45,72,.3);

  --tx:     #0f2940;
  --tx2:    #30516b;
  --tx3:    #4d6478;

  --p:      #1d4ed8;
  --p2:     #1e40af;
  --p3:     #1e3a8a;
  --p-d:    rgba(29,78,216,.12);
}
html.theme-light .page::before {
  background: linear-gradient(180deg, #f7fbfe 0%, #f2f8fc 100%);
}
html.theme-light .top {
  background: rgba(255,255,255,.96);
  border-color: var(--ln2);
  box-shadow: none;
}
html.theme-light .card {
  background: transparent;
  border-color: var(--ln2);
  box-shadow: none;
}
html.theme-light .profile-dd {
  border-color: var(--ln2);
  box-shadow: var(--sh2);
}
html.theme-light .session-chip,
html.theme-light .btn.alt,
html.theme-light .btn.ghost {
  background: rgba(255,255,255,.75);
}
html.theme-light .status {
  background: transparent;
}
html.theme-light h1,
html.theme-light h2,
html.theme-light h3,
html.theme-light .profile-head b,
html.theme-light .stat-num,
html.theme-light .plan-price,
html.theme-light .tpl-name,
html.theme-light .fi-content b {
  color: #0b1222;
}

/* ── SELECTION FIELDS: checkboxes, radios and accept rows ── */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--p);
  inline-size: 20px;
  block-size: 20px;
  cursor: pointer;
  flex: 0 0 auto;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 3px solid rgba(29, 78, 216, .22);
  outline-offset: 3px;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.auth-legal-row,
.coupon-check,
.switch-row,
.check-row,
.accept-row,
.option-check {
  border: 1px solid rgba(29, 78, 216, .16);
  background: rgba(255, 255, 255, .78);
  transition: border-color var(--t2), background var(--t2), box-shadow var(--t2), transform var(--t2);
}

.auth-legal-row:hover,
.coupon-check:hover,
.switch-row:hover,
.check-row:hover,
.accept-row:hover,
.option-check:hover {
  border-color: rgba(29, 78, 216, .36);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 41, 64, .08);
}

.auth-legal-row:has(input:checked),
.coupon-check:has(input:checked),
.switch-row:has(input:checked),
.check-row:has(input:checked),
.accept-row:has(input:checked),
.option-check:has(input:checked),
.share-permission-card:has(input:checked) {
  border-color: rgba(29, 78, 216, .56);
  background: linear-gradient(180deg, rgba(29, 78, 216, .10), rgba(255, 255, 255, .95));
  box-shadow: 0 16px 38px rgba(29, 78, 216, .12);
}

.check-row {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--r12);
}

.check-row label,
.auth-legal-row,
.coupon-check,
.switch-row,
.accept-row,
.option-check,
.share-permission-card {
  cursor: pointer;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1020px) {
  .hero        { grid-template-columns: 1fr; }
  .two-col     { grid-template-columns: 1fr; }
  .step-row    { grid-template-columns: repeat(2, 1fr); }
  .step::after { display: none; }
  .plan-grid   { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .page          { padding: 10px 10px 40px; }
  .top           { padding: 10px 12px; gap: 8px; min-height: 56px; }
  .brand-logo    { width: 28px; height: 28px; border-radius: 7px; }
  .brand > img   { width: 28px; height: 28px; }
  .brand-name    { font-size: 13px; }
  .brand-name em { font-size: 10px; }
  .brand > span  { font-size: 13px; }
  .nav a         { padding: 6px 10px; font-size: 12px; }
  .nav a .nav-icon { font-size: 11px; }
  .session-chip  { max-width: 170px; padding: 5px 10px; font-size: 11px; }
  .card          { padding: 14px 0; gap: 12px; }
  .tpl-grid      { grid-template-columns: 1fr; }
  .preset-grid   { grid-template-columns: 1fr; }
  .stat-grid     { grid-template-columns: repeat(2,1fr); }
  .step-row      { grid-template-columns: repeat(2,1fr); }
  .btns          { flex-direction: column; }
  .btns .btn     { width: 100%; }
  .nav a span.nav-label { display: none; }
}
