/* =================== MERIDIAN AI · professional theme =================== */
:root{
  --navy:#0f1f47; --navy-2:#1a2f66; --gold:#b8922e; --gold-2:#d9b65a; --gold-soft:#f6efdc;
  --bg:#ffffff; --side:#f7f6f2; --panel:#ffffff; --panel-2:#f4f2ec; --hover:#efece4;
  --line:#e7e3d9; --line-2:#d9d3c4; --text:#1b2238; --muted:#6b7084; --soft:#3c4358;
  --user:#f1eee6; --code:#f7f6f2; --danger:#c2413b; --ok:#1f7a4d;
  --r:14px; --shadow:0 1px 2px rgba(16,24,40,.06),0 8px 24px -8px rgba(16,24,40,.12);
  --serif:"Cinzel",Georgia,serif; --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; --mono:"JetBrains Mono",ui-monospace,Consolas,monospace;
}
[data-theme="dark"]{
  --bg:#0e1424; --side:#0a101e; --panel:#151d33; --panel-2:#1a2440; --hover:#1e2946;
  --line:#232e4d; --line-2:#2e3a5e; --text:#e8ebf3; --muted:#959cb3; --soft:#c5cadb;
  --user:#1c2645; --code:#0b1120; --gold-soft:#2a2615; --shadow:0 8px 28px -10px rgba(0,0,0,.6);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{background:var(--bg);color:var(--text);font:15px/1.65 var(--sans);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input,textarea{font:inherit;color:inherit}
.hidden{display:none!important}
.ic{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
::selection{background:rgba(184,146,46,.25)}
*::-webkit-scrollbar{width:10px;height:10px}*::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:10px;border:3px solid transparent;background-clip:content-box}
.emblem{display:block;width:100%;height:100%;overflow:visible}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--navy)}
[data-theme="dark"] .brand{color:#fff}
.mark{width:26px;height:30px;display:inline-block;flex-shrink:0}
.wordmark{font-family:var(--serif);font-weight:700;letter-spacing:.08em;font-size:16px}
.wordmark b{color:var(--gold)}
.muted{color:var(--muted);font-size:14px}
.link{color:var(--gold);font-weight:600;font-size:13px}.link:hover{text-decoration:underline}
.link.danger{color:var(--danger)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 16px;border-radius:10px;font-weight:600;font-size:14.5px;transition:background .15s,box-shadow .15s,transform .15s,border-color .15s}
.btn.lg{padding:13px 22px;font-size:15.5px;border-radius:12px}
.btn.block{width:100%;padding:12px}
.btn-primary{background:var(--navy);color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.1)}
.btn-primary:hover{background:var(--navy-2);transform:translateY(-1px);box-shadow:0 6px 16px -6px rgba(15,31,71,.5)}
.btn-primary:disabled{opacity:.6;cursor:wait;transform:none}
.btn-outline{border:1px solid var(--line-2);background:#fff;color:var(--navy)}.btn-outline:hover{border-color:var(--navy)}
.btn-ghost{color:var(--soft)}.btn-ghost:hover{background:var(--panel-2)}
.spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes up{from{opacity:0;transform:translateY(10px)}}
@keyframes fade{from{opacity:0}}

/* =================== LANDING =================== */
.landing{background:linear-gradient(180deg,#fbfaf6 0%,#fff 40%);min-height:100vh;color:var(--text)}
.l-nav{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;padding:14px 6vw;background:rgba(255,255,255,.82);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
.l-nav .wordmark{font-size:17px}.l-nav .mark{width:28px;height:32px}
.l-links{display:flex;align-items:center;gap:6px}
.l-links a{color:var(--soft);text-decoration:none;font-weight:500;font-size:14.5px;padding:8px 12px;border-radius:8px}.l-links a:hover{color:var(--navy);background:var(--panel-2)}
.l-hero{display:grid;grid-template-columns:1fr 1fr;gap:56px;align-items:center;max-width:1240px;margin:0 auto;padding:72px 6vw 80px}
.eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--gold);background:var(--gold-soft);padding:6px 12px;border-radius:999px;animation:up .6s both}
.eyebrow .dot{width:7px;height:7px;border-radius:50%;background:var(--gold)}
.l-copy h1{font-size:clamp(34px,4.6vw,56px);line-height:1.1;letter-spacing:-.03em;font-weight:700;color:var(--navy);margin:18px 0 16px;animation:up .6s .06s both}
.accent{color:var(--gold)}
.lead{font-size:18px;color:var(--muted);max-width:540px;animation:up .6s .12s both}
.cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:28px;animation:up .6s .18s both}
.ticks{display:flex;flex-wrap:wrap;gap:8px 20px;margin-top:22px;list-style:none;color:var(--muted);font-size:14px;animation:up .6s .24s both}
.ticks li::before{content:"✓";color:var(--ok);font-weight:700;margin-right:6px}

.l-demo{animation:up .8s .15s both}
.demo-win{border-radius:16px;background:#fff;border:1px solid var(--line);box-shadow:0 30px 70px -28px rgba(15,31,71,.35),0 2px 6px rgba(15,31,71,.05);overflow:hidden;transform:perspective(1400px) rotateY(-4deg) rotateX(2deg);transition:transform .5s}
.demo-win:hover{transform:none}
.demo-bar{display:flex;align-items:center;gap:6px;padding:10px 14px;background:#f7f6f2;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}
.demo-bar i{width:10px;height:10px;border-radius:50%;background:#e2ddd0}.demo-bar span{margin-left:10px}
.demo-body{padding:22px;display:flex;flex-direction:column;gap:16px;font-size:14px}
.demo-user{align-self:flex-end;background:var(--user);padding:9px 14px;border-radius:16px 16px 4px 16px}
.demo-ai{display:flex;gap:12px}.demo-ai p{margin-bottom:6px}
.demo-av{width:26px;height:30px;flex-shrink:0}
.demo-eq{padding:10px 14px;border-left:3px solid var(--gold);background:#faf8f2;border-radius:8px;margin:8px 0;overflow-x:auto}
.demo-final{color:var(--navy)}
.demo-input{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--line-2);border-radius:14px;padding:10px 10px 10px 16px;color:var(--muted)}
.demo-send{width:30px;height:30px;border-radius:9px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:700}

.features,.how{max-width:1180px;margin:0 auto;padding:72px 6vw;text-align:center}
.section-kicker{font-size:12.5px;font-weight:700;letter-spacing:.16em;color:var(--gold)}
.features h2,.how h2{font-size:clamp(26px,3vw,36px);letter-spacing:-.02em;color:var(--navy);margin:8px 0 36px}
.f-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;text-align:left}
.f-card{padding:24px;border-radius:16px;background:#fff;border:1px solid var(--line);transition:transform .25s,box-shadow .25s,border-color .25s}
.f-card:hover{transform:translateY(-4px);box-shadow:var(--shadow);border-color:var(--line-2)}
.f-ic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--gold-soft);color:var(--navy);font-weight:700;font-family:var(--mono);font-size:17px;margin-bottom:14px}
.f-card h3{font-size:16.5px;color:var(--navy);margin-bottom:6px}.f-card p{color:var(--muted);font-size:14.5px}
.how{background:linear-gradient(180deg,#fff,#fbfaf6)}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-bottom:36px;text-align:left}
.steps div{padding:22px;border-radius:16px;border:1px solid var(--line);background:#fff}
.steps span{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--navy);color:#fff;font-weight:700;margin-bottom:12px}
.steps h3{font-size:16px;color:var(--navy)}.steps p{color:var(--muted);font-size:14.5px}
.reveal{opacity:0;transform:translateY(18px);transition:opacity .6s,transform .6s}.reveal.in{opacity:1;transform:none}
.l-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;padding:26px 6vw;border-top:1px solid var(--line);color:var(--muted);font-size:13px}

/* =================== MODALS =================== */
.modal-backdrop{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:16px;background:rgba(10,16,32,.45);backdrop-filter:blur(4px);animation:fade .2s}
.modal{position:relative;width:min(420px,100%);max-height:92vh;overflow:auto;background:var(--panel);color:var(--text);border-radius:18px;padding:28px;box-shadow:0 30px 80px -20px rgba(0,0,0,.45);animation:up .25s}
.modal-x{position:absolute;top:12px;right:12px;width:32px;height:32px;border-radius:8px;font-size:22px;color:var(--muted)}.modal-x:hover{background:var(--panel-2)}
.auth-head{text-align:center;margin-bottom:20px}
.auth-mark{width:40px;height:46px;margin:0 auto 12px}
.auth-head h2{font-size:22px;letter-spacing:-.02em;color:var(--navy)}
[data-theme="dark"] .auth-head h2{color:#fff}
.auth-head p{color:var(--muted);font-size:14px;margin-top:2px}
.field{display:block;margin-bottom:14px}
.field>span,.lbl-row{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:600;color:var(--soft);margin-bottom:6px}
.field input,.s-pane textarea{width:100%;padding:11px 13px;border:1px solid var(--line-2);border-radius:10px;background:var(--panel);outline:0;transition:border-color .15s,box-shadow .15s;color:var(--text)}
.field input:focus,.s-pane textarea:focus{border-color:var(--navy);box-shadow:0 0 0 3px rgba(15,31,71,.1)}
.pw{position:relative}.pw input{padding-right:62px}
.pw-toggle{position:absolute;right:8px;top:50%;transform:translateY(-50%);font-size:12.5px;font-weight:600;color:var(--muted);padding:4px 8px;border-radius:6px}
.form-msg{padding:10px 12px;border-radius:10px;font-size:13.5px;margin-bottom:12px;background:#fdecea;color:var(--danger)}
.form-msg.ok{background:#e8f5ee;color:var(--ok)}
.auth-switch{text-align:center;font-size:14px;color:var(--muted);margin-top:16px}
.auth-switch button{color:var(--navy);font-weight:600}
[data-theme="dark"] .auth-switch button{color:var(--gold-2)}
.modal.auth[data-mode="login"] .f-name,.modal.auth[data-mode="forgot"] .f-name,.modal.auth[data-mode="forgot"] .f-pass,.modal.auth[data-mode="reset"] .f-name,.modal.auth[data-mode="reset"] .f-email{display:none}
.modal.auth:not([data-mode="login"]) #forgotLink{display:none}

.modal.settings{width:min(560px,100%);padding:22px 26px 26px}
.s-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:0 -26px 20px;padding:0 26px}
.s-tabs button{padding:10px 12px;font-weight:600;font-size:14px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px}
.s-tabs button.active{color:var(--text);border-color:var(--navy)}
[data-theme="dark"] .s-tabs button.active{border-color:var(--gold-2)}
.s-profile{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.s-profile b{display:block;font-size:16px}.s-profile small{color:var(--muted)}
.s-pane h3{font-size:15px;margin-bottom:12px}
.s-pane form{margin-bottom:16px}
.s-pane textarea{resize:vertical;margin:12px 0 10px}
.mem-list{display:flex;flex-direction:column;gap:8px;margin:8px 0 14px;max-height:300px;overflow:auto}
.mem-item{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font-size:13.5px;background:var(--panel-2)}
.mem-item p{flex:1;white-space:pre-wrap;max-height:84px;overflow:hidden;color:var(--soft)}
.mem-item .tag{font-size:11px;font-weight:700;color:var(--gold);text-transform:uppercase;letter-spacing:.06em}
.mem-item button{color:var(--muted);font-size:18px;line-height:1;padding:0 4px}.mem-item button:hover{color:var(--danger)}

/* =================== APP =================== */
.app{display:flex;height:100vh;height:100dvh;overflow:hidden;animation:fade .3s}
.sidebar{width:272px;flex-shrink:0;display:flex;flex-direction:column;gap:10px;padding:14px 10px 10px;background:var(--side);border-right:1px solid var(--line)}
.sb-top{display:flex;align-items:center;justify-content:space-between;padding:4px 8px 6px}
.new-chat{display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:10px;font-weight:600;font-size:14px;background:var(--panel);border:1px solid var(--line);box-shadow:0 1px 2px rgba(0,0,0,.04);transition:.15s}
.new-chat:hover{border-color:var(--line-2);background:var(--panel)}
.search{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:10px;color:var(--muted)}
.search:focus-within{background:var(--panel);box-shadow:0 0 0 1px var(--line-2)}
.search input{flex:1;min-width:0;background:none;border:0;outline:0;font-size:14px}
.chat-list{flex:1;overflow-y:auto;margin:0 -2px;padding:0 2px}
.group-label{font-size:12px;font-weight:600;color:var(--muted);padding:14px 10px 4px}
.chat-item{display:flex;align-items:center;gap:6px;padding:7px 10px;border-radius:8px;color:var(--soft);cursor:pointer;font-size:14px}
.chat-item:hover{background:var(--hover)}
.chat-item.active{background:var(--hover);color:var(--text);font-weight:500}
.chat-item .t{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-item .del{opacity:0;display:flex;color:var(--muted);padding:2px;border-radius:6px}
.chat-item:hover .del{opacity:1}.chat-item .del:hover{color:var(--danger)}
.chat-item .del .ic{width:15px;height:15px}
.empty-list{color:var(--muted);font-size:13px;padding:12px 10px}
.user-card{position:relative;border-top:1px solid var(--line);padding-top:8px}
.user-btn{display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;border-radius:10px;text-align:left;color:var(--muted)}
.user-btn:hover{background:var(--hover)}
.avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:13px;color:#fff;background:var(--navy);flex-shrink:0}
.avatar.lg{width:48px;height:48px;font-size:17px}
.u-meta{flex:1;min-width:0;line-height:1.3}.u-meta b{display:block;color:var(--text);font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.u-meta small{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.menu{position:absolute;z-index:40;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:6px;box-shadow:var(--shadow);animation:up .15s}
.menu button{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:8px;font-size:14px;text-align:left}
.menu button:hover{background:var(--panel-2)}.menu .danger{color:var(--danger)}
.menu hr{border:0;border-top:1px solid var(--line);margin:4px 0}
#userMenu{bottom:calc(100% + 6px);left:0;right:0}

.main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg);position:relative}
.topbar{display:flex;align-items:center;gap:8px;padding:10px 18px;min-height:52px}
.chat-title{flex:1;font-weight:500;font-size:14.5px;color:var(--soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-btn{padding:7px;border-radius:8px;color:var(--muted);display:inline-flex}.icon-btn:hover{background:var(--panel-2);color:var(--text)}
.only-mobile{display:none}
.banner{margin:0 auto 6px;max-width:760px;width:calc(100% - 32px);padding:10px 14px;border-radius:10px;font-size:13.5px;background:var(--gold-soft);border:1px solid #ecdcae}
.scroller{flex:1;overflow-y:auto}
.thread{max-width:780px;margin:0 auto;padding:16px 24px 24px;display:flex;flex-direction:column;gap:28px}

/* Empty state: composer in the centre (like Claude) */
.dock{width:100%;max-width:800px;margin:0 auto;padding:0 20px 14px}
.main.empty .scroller{flex:0 0 auto}
.main.empty .dock{margin:auto;padding-bottom:12vh}
.welcome{text-align:center;margin-bottom:26px}
.main:not(.empty) .welcome,.main:not(.empty) .chips{display:none}
.w-mark{width:46px;height:53px;margin:0 auto 14px;animation:up .5s both}
.welcome h1{font-family:var(--serif);font-weight:600;font-size:clamp(26px,3.6vw,36px);color:var(--navy);letter-spacing:.01em;animation:up .5s .05s both}
[data-theme="dark"] .welcome h1{color:#fff}
#greetName{color:var(--gold)}

.composer{position:relative;background:var(--panel);border:1px solid var(--line-2);border-radius:20px;padding:12px 12px 10px 16px;box-shadow:var(--shadow);transition:border-color .15s,box-shadow .15s}
.composer:focus-within{border-color:#bfb6a0;box-shadow:var(--shadow),0 0 0 3px rgba(184,146,46,.12)}
.composer.drag{border-color:var(--gold);border-style:dashed}
.drop-hint{display:none;position:absolute;inset:0;border-radius:20px;background:rgba(246,239,220,.92);place-items:center;font-weight:600;color:var(--navy);z-index:2}
.composer.drag .drop-hint{display:grid}
#input{width:100%;resize:none;border:0;outline:0;background:transparent;font-size:15.5px;line-height:1.55;max-height:260px;display:block;padding:4px 0}
#input::placeholder{color:var(--muted)}
.c-row{display:flex;align-items:center;justify-content:space-between;margin-top:8px}
.c-left{display:flex;align-items:center;gap:4px}
.c-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 9px;border-radius:9px;color:var(--muted);font-size:13.5px;font-weight:500;border:1px solid transparent}
.c-btn:hover{background:var(--panel-2);color:var(--text)}
.tools-btn.on{color:var(--navy);background:var(--gold-soft);border-color:#ecdcae}
[data-theme="dark"] .tools-btn.on{color:var(--gold-2)}
.tools-wrap{position:relative}
.tools-menu{bottom:calc(100% + 8px);left:0;width:260px}
.main.empty .tools-menu{bottom:auto;top:calc(100% + 8px)}
.tools-menu button{flex-direction:column;align-items:flex-start;gap:0}
.tools-menu b{font-weight:600;font-size:14px}.tools-menu small{color:var(--muted);font-size:12px}
.tools-menu button.active{background:var(--gold-soft)}
.send-btn{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:var(--navy);color:#fff;transition:.15s;flex-shrink:0}
.send-btn:not(:disabled):hover{background:var(--navy-2)}
.send-btn:disabled{background:var(--line-2);color:#fff;cursor:default}
[data-theme="dark"] .send-btn{background:var(--gold);color:#14110a}
.send-btn .i-stop{display:none;width:16px;height:16px;fill:currentColor}
.busy .send-btn .i-send{display:none}.busy .send-btn .i-stop{display:block}
.attachments{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.attachments:empty{display:none}
.att{position:relative;width:64px;height:64px;border-radius:10px;overflow:hidden;border:1px solid var(--line);animation:up .2s}
.att img{width:100%;height:100%;object-fit:cover}
.att button{position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;background:rgba(0,0,0,.6);color:#fff;font-size:13px;line-height:1}
.chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:16px}
.chips button{padding:7px 13px;border-radius:999px;border:1px solid var(--line);font-size:13.5px;color:var(--soft);background:var(--panel);transition:.15s;animation:up .5s both}
.chips button:hover{border-color:var(--line-2);background:var(--panel-2);color:var(--text)}
.hint{text-align:center;font-size:12px;color:var(--muted);margin-top:8px}
.main.empty .hint{display:none}

/* Messages */
.msg{display:flex;gap:14px;animation:up .3s both}
.msg.user{justify-content:flex-end}
.msg.user .u-wrap{max-width:80%;display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.msg.user .bubble{background:var(--user);padding:10px 16px;border-radius:18px 18px 4px 18px;white-space:pre-wrap;word-wrap:break-word}
.u-imgs{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.u-imgs img{width:140px;height:140px;object-fit:cover;border-radius:12px;border:1px solid var(--line);cursor:zoom-in}
.bot-av{width:28px;height:32px;flex-shrink:0;margin-top:2px}
.streaming .bot-av{animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{50%{opacity:.45}}
.msg .body{flex:1;min-width:0}
.via{display:inline-block;font-size:11px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:0 8px;margin-bottom:6px}.via:empty{display:none}
.think{margin:0 0 12px;border:1px solid var(--line);border-radius:10px;font-size:13.5px}
.think summary{cursor:pointer;padding:7px 12px;color:var(--muted);font-weight:500;list-style:none}
.think summary::-webkit-details-marker{display:none}
.think-body{padding:0 12px 10px;color:var(--muted);white-space:pre-wrap;max-height:220px;overflow-y:auto}

.content{word-wrap:break-word;font-size:15.5px;line-height:1.75}
.content>*+*{margin-top:.8em}.content>:first-child{margin-top:0}
.content h1,.content h2,.content h3,.content h4{font-weight:650;letter-spacing:-.01em;line-height:1.35;margin-top:1.4em;color:var(--text)}
.content h1{font-size:1.4em}.content h2{font-size:1.22em}.content h3{font-size:1.08em}
.content ul,.content ol{padding-left:1.4em}.content li+li{margin-top:.3em}.content li::marker{color:var(--muted)}
.content strong{font-weight:650}
.content a{color:var(--navy);text-underline-offset:3px}[data-theme="dark"] .content a{color:var(--gold-2)}
.content blockquote{border-left:3px solid var(--line-2);padding-left:14px;color:var(--soft)}
.content table{border-collapse:collapse;font-size:14px;display:block;overflow-x:auto;max-width:100%;width:max-content}
.content th,.content td{padding:8px 14px;border:1px solid var(--line);text-align:left}
.content th{background:var(--panel-2);font-weight:600}
.content :not(pre)>code{font:.87em var(--mono);background:var(--panel-2);padding:2px 5px;border-radius:5px}
.content pre{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--code)}
.code-head{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;font:12px var(--mono);color:var(--muted);border-bottom:1px solid var(--line);background:var(--panel-2)}
.copy-code{font:12px var(--sans);font-weight:500;padding:2px 8px;border-radius:6px;color:var(--muted)}.copy-code:hover{color:var(--text);background:var(--hover)}
.content pre code{display:block;padding:14px 16px;overflow-x:auto;font:13px/1.65 var(--mono);background:transparent!important}
.content hr{border:0;border-top:1px solid var(--line)}
.content img{max-width:100%;border-radius:12px;border:1px solid var(--line)}
.math-block{overflow-x:auto;overflow-y:hidden;padding:10px 4px;margin:.8em 0}
.katex{font-size:1.06em}.math-block .katex{font-size:1.16em}
.gen-img{display:inline-block;position:relative;max-width:520px;width:100%}
.gen-img img{width:100%;min-height:200px;background:linear-gradient(90deg,var(--panel-2),var(--hover),var(--panel-2));background-size:200% 100%;animation:shimmer 1.4s linear infinite}
.gen-img img.loaded{animation:none;background:none}
@keyframes shimmer{to{background-position:-200% 0}}
.gen-img a{position:absolute;right:10px;bottom:10px;background:rgba(15,31,71,.85);color:#fff;font-size:12.5px;font-weight:600;padding:6px 10px;border-radius:8px;text-decoration:none}

.actions{display:flex;gap:2px;margin-top:8px;opacity:0;transition:opacity .15s}
.msg:hover .actions,.msg:last-child .actions{opacity:1}
.act{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);padding:5px 8px;border-radius:7px}
.act:hover{background:var(--panel-2);color:var(--text)}.act .ic{width:15px;height:15px}
.error-box{margin-top:8px;padding:10px 14px;border-radius:10px;border:1px solid #f1c9c6;background:#fdf3f2;color:var(--danger);font-size:14px}
.error-box details{margin-top:6px;color:var(--muted);font-size:12px}.error-box pre{white-space:pre-wrap;font:11.5px var(--mono)}
.typing{display:inline-flex;align-items:center;gap:10px;color:var(--muted);font-size:14px}
.dots{display:inline-flex;gap:4px}.dots i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:bounce 1.2s infinite}
.dots i:nth-child(2){animation-delay:.15s}.dots i:nth-child(3){animation-delay:.3s}
@keyframes bounce{0%,80%,100%{opacity:.3;transform:none}40%{opacity:1;transform:translateY(-3px)}}
.lightbox{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.85);display:grid;place-items:center;cursor:zoom-out;animation:fade .2s}
.lightbox img{max-width:92vw;max-height:90vh;border-radius:10px}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#1b2238;color:#fff;padding:9px 16px;border-radius:10px;font-size:13.5px;box-shadow:var(--shadow);z-index:95;animation:up .2s}
.overlay{display:none}

@media (max-width:960px){
  .l-hero{grid-template-columns:1fr;padding-top:44px}.l-demo{max-width:560px}
  .f-grid{grid-template-columns:1fr 1fr}.steps{grid-template-columns:1fr}
  .l-links a{display:none}
}
@media (max-width:820px){
  .only-mobile{display:inline-flex}
  .sidebar{position:fixed;inset:0 auto 0 0;z-index:30;transform:translateX(-102%);transition:transform .25s ease;box-shadow:var(--shadow)}
  .sidebar.open{transform:none}
  .overlay.show{display:block;position:fixed;inset:0;background:rgba(10,16,32,.4);z-index:20}
  .thread{padding:12px 16px 20px}.dock{padding:0 12px calc(10px + env(safe-area-inset-bottom))}
  .bot-av{display:none}.msg.user .u-wrap{max-width:90%}
}
@media (max-width:560px){.f-grid{grid-template-columns:1fr}.btn-ghost{display:none}.l-nav{padding:12px 5vw}.main.empty .dock{padding-bottom:4vh}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
