:root {
  --rail: #0b0d0c; --side: #121513; --main: #181c19; --raised: #1f2420; --input: #252b27; --hover: rgba(255,255,255,.045);
  --line: rgba(255,255,255,.07); --text: #eef2ef; --soft: #c3ccc6; --muted: #94a099; --faint: #66716a;
  --accent: #3ddc84; --accent-2: #2fc474; --accent-ink: #04210f; --accent-soft: rgba(61,220,132,.14);
  --danger: #f0565b; --idle: #f2b33d; --shadow: 0 12px 40px rgba(0,0,0,.5);
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--main); color: var(--text); font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body.app { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
input, textarea { background: var(--rail); border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=color] { padding: 3px; height: 38px; width: 56px; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.field { display: block; margin-top: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin-top: 12px; font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--input); border-radius: 8px; padding: 9px 16px; font-weight: 600; white-space: nowrap; transition: background .15s, transform .1s, filter .15s, box-shadow .2s; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { box-shadow: 0 4px 18px rgba(61,220,132,.3); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s, transform .1s; position: relative; flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.on { color: var(--accent); }
.iconbtn.off { color: var(--danger); }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

/* tooltips */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px) scale(.96); background: #050605; color: var(--text); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s var(--ease); z-index: 30; box-shadow: var(--shadow); }
[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0) scale(1); }
[data-tip][data-side=right]::after { bottom: auto; left: calc(100% + 14px); top: 50%; transform: translate(-4px, -50%) scale(.96); }
[data-tip][data-side=right]:hover::after { transform: translate(0, -50%) scale(1); }

/* auth */
.center-screen { min-height: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 520px at 20% 0, rgba(61,220,132,.2), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(25,194,160,.14), transparent 60%), var(--rail); }
.card { background: var(--side); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: min(420px, 100%); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .35s var(--ease); }
.card .logo { width: 52px; height: 52px; margin-bottom: 14px; }
.card h1 { font-size: 24px; }
.card .btn.primary { margin-top: 22px; padding: 12px; }
.card .link { margin-top: 14px; font-size: 14px; align-self: flex-start; }

/* layout */
#app { height: 100%; display: grid; grid-template-columns: 72px 248px minmax(0, 1fr) auto; animation: fade .25s; }
#rail { background: var(--rail); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.pill { width: 48px; height: 48px; border-radius: 24px; background: var(--raised); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; position: relative; color: var(--soft); transition: border-radius .22s var(--ease), background .2s, color .2s, transform .1s; }
.pill:hover, .pill.active { background: var(--accent); color: var(--accent-ink); border-radius: 16px; }
.pill:active { transform: translateY(1px); }
.pill::before { content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--text); transform: translateY(-50%); transition: height .2s var(--ease); }
.pill:hover::before { height: 20px; }
.pill.active::before { height: 36px; }
.pill.unread:not(.active)::before { height: 8px; }
.pill.add { color: var(--accent); }
.pill.add:hover { color: var(--accent-ink); }
.pill svg.logo { width: 30px; height: 30px; }
svg.logo .vein { fill: none; stroke: var(--rail); stroke-width: 3; stroke-linecap: round; transition: stroke .2s; }
.pill.home { color: var(--accent); }
.pill.home:hover svg.logo .vein, .pill.home.active svg.logo .vein { stroke: var(--accent); }
.pill.home:hover, .pill.home.active { color: var(--accent-ink); }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--line); flex: none; }

#side { background: var(--side); display: flex; flex-direction: column; min-height: 0; }
#side-head { padding: 0 10px 0 16px; height: 52px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); font-weight: 700; flex: none; }
#side-list { flex: 1; overflow-y: auto; padding: 8px; }
.section { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 16px 8px 6px; display: flex; align-items: center; justify-content: space-between; }
.section button { color: var(--faint); transition: color .15s, transform .15s; }
.section button:hover { color: var(--text); transform: rotate(90deg); }
.section svg.ic { width: 16px; height: 16px; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 8px; color: var(--muted); text-align: left; position: relative; transition: background .12s, color .12s; margin-bottom: 2px; }
.item:hover { background: var(--hover); color: var(--soft); }
.item.active { background: rgba(255,255,255,.08); color: var(--text); }
.item.unread { color: var(--text); font-weight: 600; }
.item.unread::before { content: ""; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }
.item .edit { opacity: 0; color: var(--muted); transition: opacity .12s; }
.item:hover .edit { opacity: 1; }
.item .edit:hover { color: var(--text); }
.item .edit svg.ic, .item > svg.ic { width: 18px; height: 18px; }
.count { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; animation: pop .25s var(--ease); }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 36px; font-size: 13px; color: var(--muted); animation: slide .2s var(--ease); }
#voicebar { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--rail); animation: slide .25s var(--ease); }
#voicebar .state { color: var(--accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
#voicebar .state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
#voicebar .row { margin-top: 8px; gap: 4px; }
#mebar { padding: 8px; background: var(--rail); display: flex; align-items: center; gap: 4px; flex: none; }
#mebar .who { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; text-align: left; transition: background .12s; }
#mebar .who:hover { background: var(--hover); }
#mebar .name { font-weight: 600; font-size: 14px; line-height: 1.2; }
#mebar .sub { font-size: 12px; color: var(--muted); line-height: 1.3; }

#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#main-head { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--line); font-weight: 700; flex: none; }
#main-head .topic { font-weight: 400; font-size: 14px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; }
#main-head > svg.ic { color: var(--faint); }
#content { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: fade .2s; }
#messages { flex: 1; overflow-y: auto; padding: 16px 0 10px; display: flex; flex-direction: column; }
#messages > :first-child { margin-top: auto; }
.msg { display: grid; grid-template-columns: 72px minmax(0, 1fr); padding: 2px 48px 2px 0; position: relative; transition: background .1s; }
.msg:hover, .msg.picking { background: rgba(255,255,255,.028); }
.msg.first { margin-top: 16px; }
.msg.new { animation: rise .22s var(--ease); }
.msg.mention { background: rgba(242,179,61,.08); box-shadow: inset 3px 0 0 var(--idle); }
.msg .gutter { display: flex; justify-content: center; }
.msg .gutter .av { cursor: pointer; margin-top: 2px; transition: transform .15s var(--ease); }
.msg .gutter .av:hover { transform: scale(1.06); }
.msg .gutter time { font-size: 11px; color: var(--faint); opacity: 0; line-height: 22px; }
.msg:hover .gutter time { opacity: 1; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; }
.msg .author { font-weight: 600; cursor: pointer; }
.msg .author:hover { text-decoration: underline; }
.msg .meta time { font-size: 12px; color: var(--faint); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--soft); }
.msg .body.jumbo { font-size: 44px; line-height: 1.15; }
.msg .body a { color: var(--accent); }
.msg .body code { background: var(--rail); border-radius: 5px; padding: 1px 5px; font: 13px ui-monospace, Consolas, monospace; }
.msg .edited { font-size: 11px; color: var(--faint); margin-left: 4px; }
.spoiler { background: #050605; color: transparent; border-radius: 4px; cursor: pointer; transition: color .2s, background .2s; }
.spoiler.shown { background: var(--input); color: inherit; cursor: auto; }
.at { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; cursor: pointer; }
.replyline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 2px; min-width: 0; }
.replyline::before { content: ""; width: 26px; height: 10px; margin-left: -38px; margin-top: 8px; border: 2px solid var(--faint); border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; flex: none; }
.replyline b { color: var(--soft); flex: none; }
.tools { position: absolute; right: 16px; top: -14px; display: flex; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 2px; opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s var(--ease); box-shadow: 0 4px 14px rgba(0,0,0,.35); z-index: 2; }
.msg:hover .tools, .msg.picking .tools { opacity: 1; transform: none; pointer-events: auto; }
.tools .iconbtn { width: 30px; height: 30px; }
.tools .iconbtn svg.ic { width: 18px; height: 18px; }
.tools .iconbtn.del:hover { color: var(--danger); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.rx { display: inline-flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid transparent; border-radius: 8px; padding: 2px 8px; font-size: 14px; transition: background .12s, border-color .12s, transform .1s; }
.rx b { font-size: 13px; color: var(--muted); }
.rx:hover { border-color: var(--faint); }
.rx:active { transform: scale(.93); }
.rx.mine { background: var(--accent-soft); border-color: var(--accent); }
.rx.mine b { color: var(--accent); }
.flash .rx { animation: pop .25s var(--ease); }
.editbox textarea { background: var(--input); resize: none; }
.editbox small { color: var(--muted); font-size: 12px; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 24px; max-width: 420px; animation: fade .3s; }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.welcome { padding: 16px 16px 8px; }
.welcome .badge { width: 68px; height: 68px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; margin-bottom: 12px; color: var(--text); }
.welcome .badge svg.ic { width: 38px; height: 38px; }
.welcome h2 { font-size: 28px; }
#typing { height: 22px; padding: 0 20px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex: none; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: bounce 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
#composer { padding: 0 16px 20px; flex: none; }
.replybar { display: flex; align-items: center; gap: 8px; background: var(--raised); border-radius: 10px 10px 0 0; padding: 7px 8px 7px 14px; font-size: 13px; color: var(--muted); animation: slide .18s var(--ease); }
.replybar + .inputrow { border-radius: 0 0 10px 10px; }
.inputrow { display: flex; align-items: flex-end; background: var(--input); border-radius: 10px; padding: 0 8px 0 4px; transition: box-shadow .15s; }
.inputrow:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.inputrow textarea { resize: none; background: transparent; border: 0; box-shadow: none !important; padding: 13px 12px; max-height: 220px; display: block; }
.inputrow .iconbtn { margin-bottom: 7px; }
.inputrow .iconbtn:hover { color: var(--accent); transform: scale(1.1) rotate(8deg); background: none; }
.more { align-self: center; margin-bottom: 8px; }

/* avatars */
.av { border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); position: relative; flex: none; user-select: none; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av .dot { position: absolute; right: -3px; bottom: -3px; width: 36%; height: 36%; min-width: 12px; min-height: 12px; border-radius: 50%; border: 3px solid var(--side); background: var(--faint); transition: background .25s; }
.av .dot.online { background: var(--accent); }
.av .dot.idle { background: var(--idle); }
.av .dot.dnd { background: var(--danger); }
#mebar .av .dot { border-color: var(--rail); }

/* friends */
.tabs { display: flex; gap: 6px; }
.tab { padding: 4px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .12s, color .12s; }
.tab:hover { background: var(--hover); color: var(--soft); }
.tab.active { background: rgba(255,255,255,.08); color: var(--text); }
.tab.add { background: var(--accent); color: var(--accent-ink); }
#friends { padding: 8px 24px 24px; overflow-y: auto; flex: 1; }
.friend { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-top: 1px solid var(--line); border-radius: 10px; transition: background .12s; animation: rise .2s var(--ease) backwards; }
.friend:hover { background: var(--hover); border-top-color: transparent; }
.friend .name { font-weight: 600; }
.addbox { display: flex; gap: 8px; margin-top: 14px; max-width: 560px; background: var(--rail); border-radius: 12px; padding: 8px; }
.addbox input { background: transparent; border: 0; box-shadow: none; }

/* members */
#members { width: 248px; background: var(--side); padding: 8px; overflow-y: auto; }
#members .item.offline { opacity: .45; }
#members .item.offline:hover { opacity: 1; }

/* call stage */
#stage { background: #050605; border-bottom: 1px solid var(--line); padding: 14px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-height: 55vh; overflow-y: auto; flex: none; animation: slide .25s var(--ease); }
.tile { background: var(--raised); border-radius: 14px; width: 190px; height: 124px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; animation: pop .25s var(--ease); }
.tile.video { width: min(680px, 100%); height: auto; overflow: hidden; position: relative; }
.tile.video video { width: 100%; display: block; background: #000; }
.tile.video span { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.7); padding: 3px 9px; border-radius: 6px; font-weight: 600; }

/* modals */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px; z-index: 10; animation: fade .15s; }
.modal { background: var(--side); border: 1px solid var(--line); border-radius: 16px; width: min(460px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); animation: pop .22s var(--ease); }
.modal.wide { width: min(680px, 100%); }
.modal .pad { padding: 24px; }
.modal h2 { font-size: 20px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; align-items: center; }
.closing { animation: fadeout .12s forwards; }
.banner { height: 120px; border-radius: 15px 15px 0 0; background-size: cover; background-position: center; }
.profile-head { padding: 0 20px; margin-top: -46px; display: flex; align-items: flex-end; justify-content: space-between; }
.profile-head .av { border: 6px solid var(--side); box-sizing: content-box; }
.profile-head .av .dot { border-color: var(--side); width: 26%; height: 26%; right: 0; bottom: 0; }
.profile-box { background: rgba(0,0,0,.35); border-radius: 12px; padding: 14px; margin-top: 14px; }
.profile-box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 5px; }
.profile-box h3:first-child { margin-top: 0; }
.profile-box p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--raised); border-radius: 6px; padding: 3px 9px; font-size: 13px; font-weight: 600; transition: opacity .15s, transform .1s; }
.chip i { width: 10px; height: 10px; border-radius: 50%; }
button.chip:active { transform: scale(.94); }
.chip.dim { opacity: .4; }
.pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.modes button { display: flex; align-items: center; justify-content: center; gap: 7px; background: var(--rail); border-radius: 8px; padding: 9px 4px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid transparent; transition: all .15s; }
.modes button i { width: 10px; height: 10px; border-radius: 50%; }
.modes button.active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 4px; }
.mtabs button { padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.mtabs button.active { color: var(--text); border-color: var(--accent); }
.rolerow { background: var(--rail); border-radius: 10px; padding: 12px; margin-top: 10px; animation: rise .2s var(--ease); }
.rolerow .checks { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--soft); }
.rolerow .checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* emoji picker */
#picker { position: fixed; z-index: 40; width: 348px; background: var(--side); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: pop .16s var(--ease); overflow: hidden; }
#picker .cats { display: flex; padding: 6px; gap: 2px; border-bottom: 1px solid var(--line); }
#picker .cats button { flex: 1; font-size: 18px; padding: 5px 0; border-radius: 8px; filter: grayscale(1); opacity: .6; transition: all .15s; }
#picker .cats button:hover, #picker .cats button.active { background: var(--hover); filter: none; opacity: 1; }
#picker .grid { height: 280px; overflow-y: auto; padding: 4px 8px 8px; }
#picker .grid h4 { margin: 8px 4px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#picker .grid div { display: grid; grid-template-columns: repeat(8, 1fr); }
#picker .grid button { font-size: 24px; height: 40px; border-radius: 8px; transition: transform .1s, background .1s; }
#picker .grid button:hover { background: var(--hover); transform: scale(1.2); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: #050605; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; max-width: 340px; box-shadow: var(--shadow); animation: toast .28s var(--ease); }
.toast.bad { border-left-color: var(--danger); }
.toast .row { margin-top: 10px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { opacity: 0; transform: translateY(6px); } }
@keyframes toast { from { opacity: 0; transform: translateX(24px); } }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes drift { 50% { transform: translate(40px, 30px) scale(1.1); } }

@media (max-width: 960px) { #members { display: none !important; } }
@media (max-width: 680px) { #app { grid-template-columns: 60px 176px minmax(0, 1fr); } .pill { width: 42px; height: 42px; } .msg { grid-template-columns: 56px minmax(0, 1fr); padding-right: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------------ landing page */
body.landing { background: var(--rail); overflow-x: hidden; }
.landing .glow { position: fixed; width: 620px; height: 620px; border-radius: 50%; filter: blur(110px); opacity: .28; pointer-events: none; animation: drift 16s ease-in-out infinite; }
.landing .glow.a { background: #3ddc84; top: -220px; left: -160px; }
.landing .glow.b { background: #19c2a0; top: 240px; right: -260px; animation-delay: -8s; }
.landing nav, .landing main, .landing footer { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.landing nav { display: flex; align-items: center; gap: 12px; height: 76px; }
.landing .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; }
.landing .brand svg { width: 34px; height: 34px; }
.landing a.btn { text-decoration: none; }
.hero { text-align: center; padding: 72px 0 40px; }
.hero > * { animation: rise .6s var(--ease) backwards; }
.hero > :nth-child(2) { animation-delay: .08s; }
.hero > :nth-child(3) { animation-delay: .16s; }
.hero > :nth-child(4) { animation-delay: .24s; }
.hero h1 { font-size: clamp(38px, 6.4vw, 68px); line-height: 1.04; letter-spacing: -.03em; font-weight: 800; max-width: 14ch; margin: 0 auto; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--soft); font-size: clamp(16px, 2vw, 19px); max-width: 56ch; margin: 22px auto 0; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.cta .btn { padding: 15px 26px; font-size: 17px; border-radius: 30px; }
.cta .btn.dark { background: var(--raised); color: var(--text); }
.cta .btn:hover { transform: translateY(-2px); }
.hero .note { color: var(--muted); font-size: 13px; margin-top: 14px; min-height: 20px; }
.mock { margin: 36px auto 0; max-width: 940px; background: var(--main); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 0 1px rgba(61,220,132,.08); display: grid; grid-template-columns: 58px 180px 1fr; height: 400px; overflow: hidden; text-align: left; animation: rise .8s .3s var(--ease) backwards, float 7s 1.2s ease-in-out infinite; }
.mock .m-rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.mock .m-rail i { width: 36px; height: 36px; border-radius: 18px; background: var(--raised); }
.mock .m-rail i:first-child { background: var(--accent); border-radius: 12px; }
.mock .m-side { background: var(--side); padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.mock .m-side b { height: 10px; border-radius: 5px; background: var(--raised); }
.mock .m-side b.on { background: rgba(255,255,255,.16); }
.mock .m-chat { padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; }
.mock .m-msg { display: flex; gap: 12px; animation: rise .5s var(--ease) backwards; }
.mock .m-msg:nth-child(1) { animation-delay: .7s; } .mock .m-msg:nth-child(2) { animation-delay: 1.1s; } .mock .m-msg:nth-child(3) { animation-delay: 1.5s; }
.mock .m-msg > i { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.mock .m-msg strong { font-size: 14px; }
.mock .m-msg p { color: var(--soft); font-size: 14px; }
.mock .m-msg .rx { margin-top: 5px; font-size: 13px; }
.mock .m-input { height: 42px; border-radius: 10px; background: var(--input); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; padding: 72px 0 32px; }
.feature { background: var(--side); border: 1px solid var(--line); border-radius: 16px; padding: 22px; transition: transform .25s var(--ease), border-color .25s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(61,220,132,.4); }
.feature .fi { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; }
.landing footer { color: var(--faint); font-size: 13px; padding: 32px 24px 40px; text-align: center; }
@media (max-width: 640px) { .mock { grid-template-columns: 48px 1fr; } .mock .m-side { display: none; } }
.mock .w45 { width: 45%; } .mock .w55 { width: 55%; } .mock .w70 { width: 70%; } .mock .w85 { width: 85%; }
.mock .c1 { background: #3ddc84; } .mock .c2 { background: #4fd1c5; } .mock .c3 { background: #c084fc; }
.mock .n1 { color: #f2b33d; } .mock .n3 { color: #c084fc; }

/* ------------------------------------------------------------ v3 additions */
#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--rail); z-index: 60; }
.boot-leaf { width: 64px; height: 64px; animation: sway 1.4s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-8deg) scale(.95); opacity: .7; } 50% { transform: rotate(8deg) scale(1.05); opacity: 1; } }
.card img.logo { width: 56px; height: 56px; margin-bottom: 16px; border-radius: 16px; }
.error.good { color: var(--accent); }
.steps { color: var(--soft); padding-left: 20px; margin: 18px 0 0; line-height: 1.6; }
.steps li + li { margin-top: 8px; }
.steps code, .card code { background: var(--rail); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.leafy { color: var(--accent); opacity: .5; margin: 0 auto 12px; width: 72px; animation: sway 4s ease-in-out infinite; }
.leafy svg.logo { width: 72px; height: 72px; }
.leafy svg.logo .vein { stroke: var(--main); }
.pcard { border-radius: 15px; }
.landing .brand img { width: 36px; height: 36px; border-radius: 11px; }
.install-steps { text-align: left; color: var(--soft); margin: 14px 0 0; padding-left: 20px; line-height: 1.7; }
