:root {
  --bg: var(--tg-theme-bg-color, #07100e);
  --surface: color-mix(in srgb, var(--tg-theme-secondary-bg-color, #10201c) 88%, transparent);
  --surface-strong: #122722;
  --text: var(--tg-theme-text-color, #ecf9f4);
  --muted: var(--tg-theme-hint-color, #88a099);
  --line: color-mix(in srgb, var(--text) 13%, transparent);
  --green: #83f28f;
  --green-deep: #1b9d61;
  --cyan: #65dfeb;
  --amber: #ffc766;
  --danger: #ff7575;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, rgba(71, 218, 141, .12), transparent 33rem),
    radial-gradient(circle at -15% 48%, rgba(39, 154, 145, .1), transparent 28rem),
    var(--bg);
  overflow-x: hidden;
}
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .45; }

.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(70px); opacity: .14; pointer-events: none; }
.ambient-one { width: 16rem; height: 16rem; top: 12rem; right: -8rem; background: var(--green); }
.ambient-two { width: 13rem; height: 13rem; bottom: 8rem; left: -7rem; background: var(--cyan); }

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.eyebrow, .kicker { margin: 0 0 5px; color: var(--muted); font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.brain-mark { position: relative; width: 38px; height: 38px; border: 1px solid rgba(131, 242, 143, .34); border-radius: 13px; background: rgba(131, 242, 143, .08); box-shadow: inset 0 0 24px rgba(131, 242, 143, .06); }
.brain-mark span { position: absolute; top: 10px; width: 11px; height: 17px; border: 2px solid var(--green); }
.brain-mark span:first-child { left: 7px; border-radius: 8px 3px 3px 8px; border-right-width: 1px; }
.brain-mark span:nth-child(2) { right: 7px; border-radius: 3px 8px 8px 3px; border-left-width: 1px; }
.brain-mark i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); right: 5px; top: 5px; box-shadow: 0 0 10px var(--cyan); }
.signal { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); }
.signal span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px currentColor; }
.signal b { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.signal.online span { background: var(--green); animation: pulse 2.2s infinite; }
.signal.online b { color: var(--text); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 140px;
  align-items: center;
  gap: 16px;
  min-height: 255px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(16, 39, 33, .92), rgba(8, 18, 16, .78));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero::after { content: ""; position: absolute; width: 230px; height: 230px; right: -95px; top: -120px; border: 1px solid rgba(131,242,143,.15); border-radius: 50%; box-shadow: 0 0 0 35px rgba(131,242,143,.025), 0 0 0 70px rgba(131,242,143,.018); }
.kicker { color: var(--green); }
h2 { margin: 12px 0; font-size: clamp(34px, 9vw, 56px); line-height: .98; letter-spacing: -.065em; }
h2 em { color: var(--green); font-style: normal; }
.hero-copy { max-width: 34rem; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pulse-orb { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; width: 126px; height: 126px; padding: 0; border: 0; border-radius: 50%; color: #06110c; background: transparent; cursor: pointer; }
.orb-rings, .orb-core { position: absolute; inset: 0; border-radius: 50%; }
.orb-rings { border: 1px solid rgba(131,242,143,.4); box-shadow: 0 0 0 10px rgba(131,242,143,.035), 0 0 38px rgba(67,231,128,.16); }
.orb-core { inset: 11px; background: radial-gradient(circle at 35% 28%, #c7ffd0, var(--green) 40%, #39c974 75%, #1f8e5d); box-shadow: inset -8px -10px 25px rgba(4,58,37,.25), 0 12px 30px rgba(29,192,101,.24); transition: transform .2s ease; }
.pulse-orb b, .pulse-orb small { position: relative; z-index: 2; }
.pulse-orb b { font-size: 12px; }
.pulse-orb small { margin-top: 3px; font-size: 9px; opacity: .65; }
.pulse-orb:active .orb-core { transform: scale(.94); }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.quick-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; min-height: 74px; padding: 13px; text-align: left; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.quick-card:active { transform: translateY(2px); }
.quick-card:hover { border-color: rgba(131,242,143,.28); }
.quick-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #07100e; font-weight: 900; }
.quick-icon.amber { background: var(--amber); }
.quick-icon.cyan { background: var(--cyan); }
.quick-icon.green { background: var(--green); }
.quick-card b, .quick-card small { display: block; }
.quick-card b { font-size: 12px; }
.quick-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.quick-card i { color: var(--muted); font-style: normal; }

.panel { margin-top: 12px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
h3 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.step { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font: 700 10px ui-monospace, monospace; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 18px 0 10px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.18); }
.mode { padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
.mode.active { color: #07100e; background: var(--green); }
.composer { display: block; border: 1px solid var(--line); border-radius: 17px; background: rgba(0,0,0,.12); overflow: hidden; transition: border-color .2s ease; }
.composer:focus-within { border-color: rgba(131,242,143,.55); }
textarea { display: block; width: 100%; min-height: 100px; resize: vertical; padding: 15px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; line-height: 1.45; }
textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.composer-footer { display: flex; justify-content: space-between; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.launch-button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 10px; padding: 14px 16px; border: 0; border-radius: 15px; color: #06110c; background: var(--green); font-weight: 850; cursor: pointer; box-shadow: 0 10px 28px rgba(51,201,111,.14); }
.launch-button i { font-style: normal; font-size: 20px; }

.captcha-panel { display: grid; grid-template-columns: 126px 1fr; gap: 20px; align-items: center; background: linear-gradient(135deg, rgba(23, 39, 35, .95), rgba(14, 25, 23, .9)); }
.captcha-visual { position: relative; padding: 12px; border-radius: 18px; background: #0a1513; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile-grid i { display: grid; place-items: center; aspect-ratio: 1; border-radius: 4px; color: rgba(232,255,245,.72); background: linear-gradient(145deg, #295149, #17322d); font: 700 9px ui-monospace, monospace; }
.tile-grid i:nth-child(2), .tile-grid i:nth-child(5), .tile-grid i:nth-child(9) { background: linear-gradient(145deg, #3d7568, #23483f); box-shadow: inset 0 0 0 1px rgba(131,242,143,.25); }
.scan-corners::before, .scan-corners::after { content: ""; position: absolute; width: 16px; height: 16px; border-color: var(--green); }
.scan-corners::before { left: 5px; top: 5px; border-left: 2px solid var(--green); border-top: 2px solid var(--green); }
.scan-corners::after { right: 5px; bottom: 5px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); }
.captcha-copy p:not(.eyebrow) { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.text-action { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.text-action span { margin-left: 8px; }

.privacy-strip { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 16px 18px; border: 1px solid rgba(101,223,235,.16); border-radius: 18px; background: rgba(101,223,235,.04); }
.privacy-strip > span { color: var(--cyan); font-size: 11px; }
.privacy-strip p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.privacy-strip b { color: var(--text); }
footer { display: flex; justify-content: space-between; align-items: center; padding: 22px 4px 0; color: var(--muted); font-size: 9px; }
footer button { padding: 0; border: 0; color: var(--green); background: none; font-size: inherit; cursor: pointer; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: #15241f; box-shadow: var(--shadow); font-size: 12px; transform: translate(-50%, 140%); opacity: 0; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: rgba(255,117,117,.4); }
.demo-ribbon { position: fixed; z-index: 10; top: 0; left: 50%; padding: 5px 10px; border-radius: 0 0 9px 9px; color: #06110c; background: var(--amber); font-size: 9px; font-weight: 800; transform: translateX(-50%); }
.loading { pointer-events: none; opacity: .55; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.private-entry { display: grid; place-items: center; padding: 24px; }
.entry-card { width: min(100%, 390px); padding: 34px 26px; text-align: center; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(145deg, rgba(16,39,33,.94), rgba(8,18,16,.9)); box-shadow: var(--shadow); }
.entry-mark { margin: 0 auto 20px; }
.entry-card h1 { margin: 8px 0 10px; font-size: 25px; }
.entry-card > p:not(.eyebrow) { margin: 0 auto; max-width: 280px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.entry-loader { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.entry-loader i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: entry-bounce 1.1s infinite ease-in-out; }
.entry-loader i:nth-child(2) { animation-delay: .14s; }
.entry-loader i:nth-child(3) { animation-delay: .28s; }

@keyframes entry-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(131,242,143,.35); } 50% { box-shadow: 0 0 0 7px rgba(131,242,143,0); } }

@media (max-width: 620px) {
  .shell { padding-left: 13px; padding-right: 13px; }
  .hero { grid-template-columns: 1fr 112px; min-height: 235px; padding: 22px 18px; }
  .pulse-orb { width: 104px; height: 104px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 64px; }
}
@media (max-width: 390px) {
  .hero { grid-template-columns: 1fr; }
  .pulse-orb { position: absolute; right: 16px; bottom: 18px; width: 92px; height: 92px; }
  .hero-copy { max-width: calc(100% - 92px); }
  .captcha-panel { grid-template-columns: 92px 1fr; gap: 14px; padding: 17px; }
  .captcha-visual { padding: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
