:root {
  --bg: #F6F4EE; --paper: #FFFFFF; --ink: #17181C; --muted: #6B6D76; --line: #E4E1D8;
  --accent: #1F6F54; --accent-d: #17573F; --accent-soft: #E6F1EC; --amber: #F2B94B; --red: #C2452D;
  --r: 16px; --shadow: 0 1px 2px rgba(23,24,28,.04), 0 12px 32px -12px rgba(23,24,28,.14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 800px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(246,244,238,.86); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.logo svg { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 26px; margin-left: 12px; color: var(--muted); font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.langs { display: flex; background: #EBE8DF; border-radius: 10px; padding: 3px; }
.langs button { padding: 5px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.langs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.menu { position: absolute; right: 0; top: 44px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 190px; padding: 6px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14.5px; }
.menu a:hover, .menu button:hover { background: var(--bg); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 12px; font-weight: 700; font-size: 15.5px; transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 9px 16px; font-size: 14.5px; border-radius: 10px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(31,111,84,.6); }
.btn-accent:hover:not([disabled]) { background: var(--accent-d); }
.btn-ghost { background: var(--paper); border: 1px solid var(--line); }
.btn-ghost:hover:not([disabled]) { border-color: #C9C5B8; }
.btn-tg { background: #2AABEE; color: #fff; width: 100%; }
.link { color: var(--muted); font-weight: 600; font-size: 14px; }
.link:hover { color: var(--ink); }

/* hero */
.hero { padding: 40px 0 40px; text-align: center; }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0 auto; max-width: 860px; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; }
h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--amber) 62%, var(--amber) 92%, transparent 92%); }
.lead { margin: 18px auto 28px; max-width: 660px; font-size: 18.5px; color: var(--muted); }
h2 { margin: 0 0 12px; font-size: clamp(27px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; }
.sub { margin: 0 0 36px; color: var(--muted); font-size: 17.5px; max-width: 680px; }

/* editor */
.editor { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.pane { display: flex; flex-direction: column; min-height: 330px; min-width: 0; }
.pane-out { border-left: 1px solid var(--line); background: #FCFBF8; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); min-height: 54px; }
.pane-title { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.counter { font-size: 13.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--red); }
textarea { flex: 1; width: 100%; border: 0; outline: 0; resize: none; padding: 20px; font: inherit; font-size: 15.5px; line-height: 1.7; color: var(--ink); background: transparent; min-height: 230px; max-height: 560px; }
textarea::placeholder { color: #A6A7AE; }
.pane-foot { display: flex; gap: 18px; padding: 12px 20px; border-top: 1px solid var(--line); }
.output { flex: 1; padding: 20px; font-size: 15.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; max-height: 560px; }
.output .empty { height: 100%; min-height: 190px; display: grid; place-items: center; text-align: center; color: #A6A7AE; white-space: normal; }
.output .empty svg { width: 46px; height: 46px; margin-bottom: 12px; opacity: .55; }
.out-actions { display: flex; gap: 6px; }
.chip-btn { padding: 5px 11px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-d); font-weight: 700; font-size: 13px; }
.chip-btn:hover { background: #D6E8E0; }
.status { margin: auto; text-align: center; white-space: normal; max-width: 360px; }
.status h4 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.status p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.bar { height: 8px; border-radius: 99px; background: #E9E6DC; overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s; }
.pct { font-weight: 800; font-size: 14px; color: var(--accent-d); }

/* checkout */
.checkout { margin-top: 18px; display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; text-align: left; }
.plans { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-chip { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); text-align: left; line-height: 1.25; transition: border-color .15s, background .15s; }
.plan-chip b { display: block; font-size: 14.5px; }
.plan-chip small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.plan-chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-chip.off { opacity: .45; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.warn { flex-basis: 100%; margin: 0; text-align: right; color: var(--red); font-size: 14px; font-weight: 600; }
.fine { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13.5px; }

/* orders */
.orders { padding-top: 24px; padding-bottom: 8px; }
.orders h2 { font-size: 26px; margin-bottom: 16px; }
.order-list { display: grid; gap: 10px; }
.order { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-align: left; width: 100%; }
.order:hover { border-color: #C9C5B8; }
.order .t { flex: 1; min-width: 0; }
.order .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.order .t small { color: var(--muted); font-size: 13px; }
.badge { padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.badge.done { background: var(--accent-soft); color: var(--accent-d); }
.badge.processing, .badge.paid { background: #FDF1D7; color: #8A5A00; }
.badge.pending { background: #ECEAE3; color: var(--muted); }
.badge.failed, .badge.refunded, .badge.expired { background: #F9E3DD; color: var(--red); }

/* sections */
.section { padding-top: 84px; padding-bottom: 20px; }
.band { background: var(--ink); color: #fff; margin-top: 84px; padding-bottom: 72px; }
.band .eyebrow { color: var(--amber); }
.band .sub { color: #A9ABB5; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; }
.step .n { width: 38px; height: 38px; border-radius: 11px; background: var(--ink); color: var(--amber); display: grid; place-items: center; font-weight: 800; margin-bottom: 16px; }
.step h3, .card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
.step p, .card p { margin: 0; color: var(--muted); font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: #202229; border: 1px solid #2E3039; border-radius: var(--r); padding: 22px; }
.card p { color: #A9ABB5; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.cmp { border-radius: var(--r); padding: 24px; font-size: 15.5px; line-height: 1.7; }
.cmp p { margin: 12px 0 0; }
.cmp.before { background: #202229; border: 1px solid #2E3039; color: #C9CBD3; }
.cmp.after { background: #F6F4EE; color: var(--ink); }
.tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; }
.before .tag { background: #33353F; color: #C9CBD3; }
.after .tag { background: var(--accent); color: #fff; }
.cmp mark { background: rgba(194,69,45,.28); color: inherit; border-radius: 4px; padding: 0 2px; }

.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.price { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; display: flex; flex-direction: column; }
.price.hot { border-color: var(--ink); box-shadow: var(--shadow); position: relative; }
.price.hot::before { content: attr(data-hot); position: absolute; top: -11px; left: 22px; background: var(--amber); color: var(--ink); font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; letter-spacing: .04em; text-transform: uppercase; }
.price h3 { margin: 0; font-size: 17px; line-height: 1.3; min-height: 2.6em; }
.price .amount { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 2px; }
.price .amount small { font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.price ul { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 8px; color: var(--muted); font-size: 14.5px; flex: 1; }
.price li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 8px; }
.price .btn { width: 100%; }

.faq { margin-top: 24px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 40px 0 28px; }
.footer-in { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer p { margin: 8px 0 0; color: var(--muted); max-width: 420px; font-size: 14.5px; }
.foot-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.copy { margin-top: 28px; color: var(--muted); font-size: 13.5px; }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(23,24,28,.5); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal-card { position: relative; background: var(--paper); border-radius: 22px; padding: 34px 30px 28px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
.modal-card.wide { max-width: 680px; text-align: left; max-height: 86vh; overflow-y: auto; }
.modal-card h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.modal-card p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.x { position: absolute; top: 12px; right: 16px; font-size: 26px; color: var(--muted); line-height: 1; }
.tg-icon { width: 60px; height: 60px; border-radius: 50%; background: #2AABEE; display: grid; place-items: center; margin: 0 auto 16px; }
.tg-icon svg { width: 32px; height: 32px; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0 0 !important; font-size: 14px !important; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.consent { margin: 16px 0 0 !important; font-size: 12.5px !important; line-height: 1.5; }
.terms-date { margin: 0 0 4px !important; font-size: 13.5px !important; }
.terms h4 { margin: 20px 0 6px; font-size: 16px; }
.terms p { margin: 0 0 8px; color: #44464E; font-size: 14.5px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .editor { grid-template-columns: 1fr; }
  .pane { min-height: 0; }
  .pane-out { border-left: 0; border-top: 1px solid var(--line); }
  textarea { min-height: 240px; }
  .output .empty { min-height: 140px; }
  .checkout { grid-template-columns: 1fr; }
  .actions { justify-content: stretch; }
  .actions .btn { flex: 1; }
  .warn { text-align: left; }
  .steps, .cards, .compare { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 36px; }
  .section { padding-top: 64px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .pricing { grid-template-columns: 1fr; }
  .logo span { display: none; }
  .nav-right .logo span, .footer .logo span { display: inline; }
  .plan-chip { flex: 1 1 calc(50% - 8px); }
  .btn { padding: 13px 16px; }
  #userName { display: none; }
  .user-btn { padding: 4px; }
}
