/* IELTS CD Builder — minimal UI */
:root {
  --bg: #f7f7f8; --surface: #fff; --text: #16181d; --muted: #6b7079; --faint: #9aa0a8;
  --line: #e7e8eb; --line-2: #f0f1f3; --hover: #f4f5f7;
  --accent: #16181d; --accent-text: #fff;
  --ok: #16a34a; --ok-bg: #effaf3; --warn: #d97706; --warn-bg: #fff8eb; --bad: #dc2626; --bad-bg: #fef2f2;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--line-2); padding: 2px 6px; border-radius: 5px; }
svg { flex-shrink: 0; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.hint a { color: var(--text); }
.opt { color: var(--faint); font-weight: 400; font-size: 12.5px; }
.empty { color: var(--muted); text-align: center; padding: 34px 16px; margin: 0; font-size: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: opacity .15s, background .15s, border-color .15s; }
.btn:hover { opacity: .88; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-line { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-line:hover { opacity: 1; background: var(--hover); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f3caca; }
.btn-danger:hover { opacity: 1; background: var(--bad-bg); }
.btn-disabled { pointer-events: none; color: var(--faint); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- badges / meters ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.meter { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.meter-warn span { background: var(--warn); }
.meter-bad span, .meter-none span { background: var(--bad); }

/* ---------- flash / callouts ---------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); margin: 0 0 20px; font-size: 14px; border: 1px solid; }
.flash svg { width: 16px; height: 16px; }
.flash-ok { background: var(--ok-bg); border-color: #c9ecd5; color: #136c33; }
.flash-err { background: var(--bad-bg); border-color: #f6d0d0; color: #a11d1d; }
.flash-warn { background: var(--warn-bg); border-color: #f6e0b5; color: #8a5300; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--r); margin-bottom: 20px; border: 1px solid; }
.callout b { display: block; font-size: 14px; }
.callout span { font-size: 13.5px; opacity: .85; }
.callout-warn { background: var(--warn-bg); border-color: #f6e0b5; color: #7a4a00; }
.callout-bad { background: var(--bad-bg); border-color: #f6d0d0; color: #8f1b1b; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #3a3e46; }
input:not([type=hidden]), select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  font: inherit; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
select { appearance: none; padding-right: 32px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7079' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: #b9bcc3; box-shadow: 0 0 0 3px #eceef1; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.code-input { height: 56px !important; font-size: 26px !important; letter-spacing: 12px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- public site ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 440px; }
.site { background: var(--surface); }
.site-top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-2); }
.site-top-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav > a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; }
.site-nav > a:not(.btn):hover { color: var(--text); }
.site-foot { border-top: 1px solid var(--line-2); margin-top: 80px; padding: 26px 0; color: var(--muted); font-size: 13.5px; }
.site-foot .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site main { padding-top: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: 15px; }
.logo-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 11px; letter-spacing: .5px; }

.hero { text-align: center; padding: 72px 0 40px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -.03em; max-width: 780px; margin: 0 auto 18px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.block { padding: 48px 0 0; }
.block > h2 { font-size: 26px; letter-spacing: -.02em; text-align: center; margin-bottom: 26px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 36px; }
.features h4 { font-size: 15px; margin-bottom: 4px; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }
.faq details { max-width: 680px; margin: 0 auto; border-bottom: 1px solid var(--line); padding: 16px 2px; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { color: var(--muted); margin: 10px 0 0; font-size: 14.5px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; background: var(--surface); display: flex; flex-direction: column; }
.plan-hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-name { font-weight: 600; color: var(--muted); font-size: 14px; }
.plan-note { font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: 2px 8px; border-radius: 99px; }
.plan-price { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; font-size: 14px; color: #3a3e46; flex: 1; }
.plan li { display: flex; align-items: center; gap: 8px; }
.plan li svg { width: 15px; height: 15px; color: var(--ok); }

.auth { margin: 56px 0 0; }
.auth h1 { font-size: 26px; letter-spacing: -.02em; }
.auth > .hint { margin: 6px 0 24px; font-size: 14.5px; }
.auth .form { margin-bottom: 18px; }
.auth .flash { margin: 0 0 16px; }
.auth-links { display: flex; justify-content: center; gap: 18px; font-size: 13.5px; }
.auth-links a { color: var(--muted); }

/* ---------- tiles (builders) ---------- */
.builders { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tile h3 { font-size: 17px; margin: 6px 0 6px; }
.tile p { color: var(--muted); font-size: 14px; margin: 0 0 18px; flex: 1; }
.tile .tile-meta { flex: 0; font-size: 12.5px; color: var(--faint); margin-top: -8px; }
.tile .btn { align-self: flex-start; }
.tile-locked { opacity: .6; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: 248px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.side .logo { padding: 4px 8px 18px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; }
.side-nav a:hover { background: var(--hover); color: var(--text); }
.side-nav a.on { background: var(--line-2); color: var(--text); font-weight: 600; }
.side-plan { margin-top: auto; display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; font-size: 13px; }
.side-plan:hover { background: var(--hover); }
.side-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-plan-top > span:last-child { color: var(--muted); font-size: 12.5px; text-align: right; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line-2); margin-top: 8px; }
.side-nav + .side-user { margin-top: auto; }
.side-user-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.side-user-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-txt span { font-size: 12px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--line-2); color: #4a4f58; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }

.main { flex: 1; min-width: 0; padding: 36px 44px 60px; max-width: 1120px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head h1 { font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.who { display: flex; align-items: center; gap: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 13.5px; margin: -10px 0 16px -4px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; }
.section { font-size: 15px; margin: 32px 0 12px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; color: var(--muted); background: var(--line-2); border-radius: 99px; padding: 1px 8px; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 8px; }

.new-card summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.new-card summary::-webkit-details-marker { display: none; }
.new-card summary h3 { font-size: 15px; }
.new-card summary .hint { margin: 0; }
.new-card:not([open]) { display: none; }
.new-card[open] .form { margin-top: 16px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; background: var(--line-2); padding: 3px; border-radius: 10px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.tabs a span { font-size: 12px; color: var(--faint); }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.search input { width: 260px; height: 38px; }

.rows { display: grid; }
.row { display: grid; grid-template-columns: 34px minmax(0, 1.4fr) 110px minmax(0, 1fr) 20px; align-items: center; gap: 14px; padding: 13px 18px; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafafb; }
.row-main { display: grid; min-width: 0; line-height: 1.35; }
.row-main b { font-size: 14px; font-weight: 600; }
.row-main span, .row-time-top span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { display: grid; gap: 6px; }
.row-time-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.row-time-top b { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.row-go { color: var(--faint); }
.row:not(:has(.row-status)) { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.1fr) 20px; }

.status-card .status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-card .status-row .hint { margin: 0; }
.status-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 14px; }
.status-card .meter { height: 8px; }

.grant { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); display: grid; gap: 12px; }
.grant-plans { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.chip span { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.chip:hover { background: var(--hover); border-color: #d5d7dc; }
.grant-custom { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.card:not(.flush) .list li { padding: 11px 0; }
.list li:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main a { font-weight: 600; text-decoration: none; }
.list-main a:hover { text-decoration: underline; }
.list-side { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.delta { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.delta-up { background: var(--ok-bg); color: var(--ok); }
.delta-down { background: var(--bad-bg); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat b { display: block; font-size: 28px; letter-spacing: -.02em; margin-top: 4px; }
.stat-warn b { color: var(--warn); }
.stat-bad b { color: var(--bad); }

.steps { margin: 0 0 18px; padding-left: 20px; color: #3a3e46; font-size: 14px; display: grid; gap: 4px; }
.steps a { font-weight: 600; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 16px 0 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { position: static; height: auto; width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; gap: 8px; }
  .side .logo { padding: 0 8px 0 0; }
  .side .logo span:last-child { display: none; }
  .side-nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
  .side-nav a { height: 34px; white-space: nowrap; }
  .side-plan { display: none; }
  .side-user { border: 0; padding: 0; margin: 0 !important; }
  .side-user-txt { display: none; }
  .main { padding: 24px 18px 48px; }
  .cols, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr 1fr; }
  .row, .row:not(:has(.row-status)) { grid-template-columns: 34px minmax(0, 1fr) 20px; }
  .row-status { display: none; }
  .row-time { grid-column: 2 / 3; }
  .row-go { grid-row: 1; grid-column: 3; }
  .grant-custom { grid-template-columns: 1fr; }
  .search, .search input { width: 100%; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .callout { flex-direction: column; align-items: flex-start; }
}

/* Telegram login */
.connect { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.connect li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.connect li > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line-2); font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.btn-tg { background: #2aabee; border-color: #2aabee; margin-bottom: 22px; }

/* v4: password login, date picker, devices, credentials box */
.flash-wrap { margin-bottom: 20px; }
.flash-wrap .flash { margin-bottom: 10px; }
.creds { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px dashed #c9ecd5; border-radius: var(--r-sm); background: #fbfefc; }
.creds dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.creds dt { color: var(--muted); }
.creds dd { margin: 0; font-weight: 600; }
.creds code { font-size: 15px; background: none; padding: 0; }
.flash-wrap .hint { margin: 6px 2px 0; }
.until { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; align-items: end; }
.until label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #3a3e46; }
.end-now { margin-top: 12px; }
.end-now .link { color: var(--bad); font-size: 13px; }
.devices li { align-items: center; }
.devices .list-main { white-space: normal; }
.devices .hint { margin: 0; font-size: 12.5px; }
.delta:not(.delta-up):not(.delta-down) { background: var(--line-2); color: var(--muted); }
input[type=date] { cursor: pointer; }
@media (max-width: 900px) { .until { grid-template-columns: 1fr; } .creds { flex-direction: column; align-items: flex-start; } }

/* Builder page: top bar + framed builder */
.frame-page { margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.frame-bar { flex-shrink: 0; height: 44px; display: flex; align-items: center; gap: 16px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.frame-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 500; }
.frame-back:hover { color: var(--text); }
.frame-back svg { width: 16px; height: 16px; }
.frame-title { font-weight: 700; }
.frame-switch { display: flex; gap: 2px; background: var(--line-2); padding: 3px; border-radius: 8px; }
.frame-switch a { padding: 3px 10px; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.frame-switch a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.frame-status { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.frame { flex: 1; width: 100%; border: 0; display: block; }
.frame-lock { flex: 1; display: grid; place-items: center; text-align: center; background: var(--bg); }
.frame-lock[hidden] { display: none; }
.frame-lock h2 { font-size: 22px; margin-bottom: 16px; }
@media (max-width: 700px) { .frame-title, .frame-status > span:last-child { display: none; } }

/* =========================================================
   v5: motion & life — subtle, fast, respects reduced motion
   ========================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
html { scroll-behavior: smooth; }
:root { --ease: cubic-bezier(.2, .7, .2, 1); --lift: 0 10px 30px -12px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .05); }

/* page enter */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.hero > *, .auth > * { animation: rise .6s var(--ease) both; }
.hero > :nth-child(2), .auth > :nth-child(2) { animation-delay: .06s; }
.hero > :nth-child(3), .auth > :nth-child(3) { animation-delay: .12s; }
.hero > :nth-child(4), .auth > :nth-child(4) { animation-delay: .18s; }
.hero > :nth-child(5), .auth > :nth-child(5) { animation-delay: .24s; }
.main { animation: fade .35s ease both; }

/* scroll reveal (only when JS is on, so nothing hides without it) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease), box-shadow .2s, border-color .2s, background .15s; transition-delay: calc(var(--i, 0) * 55ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.in:hover { transition-delay: 0s; }

/* hover life on cards */
.tile, .plan, .stat, .card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.tile:not(.tile-locked):hover, .plan:hover { transform: translateY(-4px); box-shadow: var(--lift); border-color: #d9dbe0; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--lift); }
.tile .btn svg { transition: transform .2s var(--ease); }
.tile .btn:hover svg { transform: translateX(3px); }
.plan-hot { position: relative; }
.plan-hot::before { content: "Most popular"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--accent); color: #fff; letter-spacing: .02em; }

/* buttons: press, ripple, busy spinner */
.btn, .chip { position: relative; overflow: hidden; transition: opacity .15s, background .15s, border-color .15s, transform .12s var(--ease), box-shadow .2s; }
.btn:active, .chip:active { transform: scale(.97); }
.btn:not(.btn-line):not(.btn-danger):hover { opacity: 1; box-shadow: 0 6px 16px -6px rgba(16, 24, 40, .45); }
.ripple { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: currentColor; opacity: .25; pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(40); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-text); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-line.busy::after, .btn-danger.busy::after { border-color: var(--text); border-right-color: transparent; }

/* inputs */
input:not([type=hidden]):hover, select:hover { border-color: #d3d6db; }
input:focus, select:focus { border-color: var(--text); box-shadow: 0 0 0 4px rgba(22, 24, 29, .08); }

/* header shadow on scroll */
.site-top { transition: box-shadow .25s, border-color .25s; }
.site-top.scrolled { box-shadow: 0 6px 20px -12px rgba(16, 24, 40, .25); }
.site-nav > a:not(.btn) { position: relative; }
.site-nav > a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transition: transform .25s var(--ease); }
.site-nav > a:not(.btn):hover::after { transform: scaleX(1); }
.logo-mark { transition: transform .35s var(--ease); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }

/* hero: soft moving glow + live badge */
.site { overflow-x: clip; }
.hero { position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: -40px -10% auto; height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 30% 40%, rgba(37, 99, 235, .10), transparent 70%), radial-gradient(35% 45% at 72% 35%, rgba(22, 163, 74, .10), transparent 70%);
  filter: blur(10px); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(-3%, 0, 0) scale(1); } to { transform: translate3d(3%, 12px, 0) scale(1.06); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.hero h1 .grad { background: linear-gradient(90deg, #16181d 0%, #2563eb 45%, #16a34a 75%, #16181d 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s ease-in-out infinite; }
@keyframes shine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* hero demo: a mini exam window with navigator cards marking themselves */
.demo { max-width: 620px; margin: 44px auto 0; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--lift); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.demo-bar b { margin-left: 8px; color: var(--text); font-weight: 600; }
.demo-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.demo-body { padding: 16px 16px 14px; display: grid; gap: 10px; }
.demo-line { height: 9px; border-radius: 6px; background: var(--line-2); }
.demo-line:nth-child(2) { width: 86%; } .demo-line:nth-child(3) { width: 64%; }
.demo-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px 16px; border-top: 1px solid var(--line-2); align-items: center; }
.demo-nav span:first-child { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.demo-nav em { font-style: normal; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted);
  animation: mark 6s var(--ease) infinite; animation-delay: calc(var(--n) * .18s); }
.demo-nav em.x { animation-name: markx; }
@keyframes mark { 0%, 30% { background: var(--surface); color: var(--muted); border-color: var(--line); transform: none; } 36% { transform: scale(1.18); } 42%, 88% { background: var(--ok); color: #fff; border-color: var(--ok); transform: none; } 100% { background: var(--surface); color: var(--muted); border-color: var(--line); } }
@keyframes markx { 0%, 30% { background: var(--surface); color: var(--muted); border-color: var(--line); transform: none; } 36% { transform: scale(1.18); } 42%, 88% { background: var(--bad); color: #fff; border-color: var(--bad); transform: none; } 100% { background: var(--surface); color: var(--muted); border-color: var(--line); } }
.demo-score { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--ok); background: var(--ok-bg); padding: 4px 10px; border-radius: 99px; animation: score 6s var(--ease) infinite; }
@keyframes score { 0%, 55% { opacity: 0; transform: translateY(4px); } 62%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* meters fill in, badges breathe a little */
.meter span { animation: grow .9s var(--ease) both .15s; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.badge-ok i { animation: pulse 2.4s infinite; }
.badge-warn i, .badge-bad i { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* sidebar & rows */
.side-nav a { position: relative; transition: background .15s, color .15s, padding-left .2s var(--ease); }
.side-nav a:hover { padding-left: 13px; }
.side-nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--text); animation: fade .3s ease both; }
.row { transition: background .15s; }
.row-go { transition: transform .2s var(--ease), color .15s; }
.row:hover .row-go { transform: translateX(3px); color: var(--text); }
.avatar { transition: transform .25s var(--ease); }
.side-user:hover .avatar { transform: scale(1.06); }
.tabs a { transition: background .2s, color .15s, box-shadow .2s; }

/* faq opens smoothly */
.faq summary::after { transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details[open] p { animation: rise .35s var(--ease) both; }
.faq summary:hover { color: #2563eb; }

/* flash messages */
.flash { animation: rise .4s var(--ease) both; transition: opacity .4s, transform .4s, max-height .4s, margin .4s, padding .4s; max-height: 200px; }
.flash.gone { opacity: 0; transform: translateY(-6px); max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; border-width: 0; overflow: hidden; }

/* builder page: loading bar until the frame is ready */
.frame-page::after { content: ""; position: fixed; top: 44px; left: 0; height: 2px; width: 40%; background: linear-gradient(90deg, transparent, #2563eb, transparent); animation: load 1.1s ease-in-out infinite; z-index: 5; }
.frame-page.frame-ready::after { display: none; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.frame-switch a { transition: background .2s, color .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* v6: demo tests, free trial, legal line */
.trial { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 22px auto 14px; padding: 16px 20px; border: 1px dashed #c9ecd5; border-radius: var(--r); background: #fbfefc; max-width: 760px; }
.trial b { display: block; font-size: 15px; }
.trial span { color: var(--muted); font-size: 14px; }
.hero-sm { padding: 48px 0 8px; }
.hero-sm h1 { font-size: clamp(28px, 4vw, 40px); }
.legal { flex-basis: 100%; margin: 10px 0 0; font-size: 12px; color: var(--faint); line-height: 1.5; }
.frame-status .btn { color: var(--accent-text); }
.builders + .hint { margin-top: 18px; }
