/* Ablitron playground. Values follow the Paper file "Ablitron · Website" (Chat · Empty / Conversation / Out of credits / Mobile). */
:root{--bg:#04090a;--side:#070f10;--surface:#0c1617;--line:#ffffff14;--line-strong:#ffffff1f;--ink:#f2f5f5;--body:#ffffffdb;--soft:#ffffffbf;--muted:#8a9a99;--faint:#5e6e6d;--accent:#22d3c5;--bright:#5cefe0;--on-accent:#04201e;--code:#e6f2f1;--sans:'Geist',system-ui,sans-serif;--mono:'Geist Mono',ui-monospace,monospace;color-scheme:dark}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/20px var(--sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-synthesis:none;overflow:hidden}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
button:disabled{cursor:not-allowed}
:focus-visible{outline:2px solid var(--bright);outline-offset:2px}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip-link{position:absolute;left:12px;top:-60px;z-index:50;padding:8px 12px;border-radius:8px;background:var(--accent);color:var(--on-accent)}.skip-link:focus{top:12px}
.mobile-only{display:none!important}

.chat-app{display:flex;height:100vh;height:100dvh;overflow:hidden}

/* Sidebar */
.sidebar{width:272px;flex-shrink:0;display:flex;flex-direction:column;justify-content:space-between;gap:16px;padding:18px 14px;background:var(--side);border-right:1px solid #ffffff12;min-height:0}
.sb-top{display:flex;flex-direction:column;gap:16px;min-height:0;flex:1}
.sb-logo{display:flex;align-items:center;padding:4px 6px}.sb-logo img{display:block;width:112px;height:30px}
.sb-new{display:flex;align-items:center;justify-content:space-between;padding:11px 14px;border-radius:12px;background:var(--accent);color:var(--on-accent);font-weight:600;line-height:18px;transition:background .15s}
.sb-new:hover{background:var(--bright)}
.sb-new kbd{font:12px/16px var(--sans);color:#0b5551}
.sb-search input{width:100%;padding:9px 14px;border:1px solid var(--line);border-radius:12px;background:transparent;font-size:13px;line-height:16px;outline:0}
.sb-search input::placeholder{color:#ffffff73}
.sb-search input:focus{border-color:#5cefe059}
.sb-history{display:flex;flex-direction:column;gap:2px;padding-top:6px;overflow-y:auto;min-height:0;margin-inline:-4px;padding-inline:4px;scrollbar-width:thin;scrollbar-color:#ffffff1a transparent}
.sb-group{padding:6px 10px;color:var(--faint);font-size:12px;line-height:16px}
.sb-group:not(:first-child){padding-top:14px}
.sb-item{position:relative;display:flex;align-items:center;border-radius:8px}
.sb-item:hover,.sb-item[aria-current=true]{background:#ffffff0f}
.sb-item>button:first-child{flex:1;min-width:0;padding:9px 10px;text-align:left;color:var(--soft);font-size:14px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sb-item[aria-current=true]>button:first-child{color:#fff}
.sb-delete{flex-shrink:0;width:28px;height:28px;margin-right:4px;border-radius:6px;color:var(--muted);opacity:0}
.sb-item:hover .sb-delete,.sb-delete:focus-visible{opacity:1}
.sb-delete:hover{color:var(--ink);background:#ffffff14}
.sb-none{padding:9px 10px;color:var(--faint);font-size:13px}
.sb-bottom{display:flex;flex-direction:column;gap:10px;flex-shrink:0}
.sb-plan{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.sb-plan-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sb-plan-row strong{font-size:13px;line-height:16px;font-weight:500}
.sb-plan-row span{color:var(--muted);font-size:12px;line-height:16px;font-variant-numeric:tabular-nums}
.sb-bar{display:flex;height:6px;border-radius:3px;background:#ffffff14;overflow:hidden}
.sb-bar span{display:block;width:0;height:6px;border-radius:3px;background:var(--accent);transition:width .3s}
.sb-plan-action{padding:9px;border:1px solid #5cefe059;border-radius:10px;color:var(--bright);font-size:13px;font-weight:500;line-height:16px}
.sb-plan-action:hover{background:#22d3c514}
.sb-account{display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:10px;color:inherit;text-decoration:none}
.sb-account:hover{background:#ffffff0a}
.sb-avatar{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:15px;background:#11706b;color:#fff;font-size:13px;font-weight:600}
.sb-account-text{display:flex;flex-direction:column;min-width:0}
.sb-account-text strong{font-size:13px;line-height:16px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sb-account-text span{color:var(--faint);font-size:12px;line-height:16px}
.scrim{display:none}

/* Main column */
.chat-main{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}
.chat-top{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 24px}
.top-left{display:flex;align-items:center;gap:8px;min-width:0}
.model-pill{position:relative;display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;background:#ffffff0d}
.model-pill select{appearance:none;-webkit-appearance:none;border:0;background:transparent;padding:8px 32px 8px 12px;font-size:14px;font-weight:500;line-height:18px;cursor:pointer;outline:0}
.model-pill select option{background:var(--surface);color:var(--ink)}
.model-pill:focus-within{border-color:#5cefe080}
.model-pill .caret{position:absolute;right:12px;color:var(--muted);font-size:11px;line-height:14px;pointer-events:none}
.pill-guard{display:flex;align-items:center;gap:6px;padding:8px 12px;border-radius:10px;background:#22d3c51a;color:var(--bright);font-size:13px;line-height:16px;white-space:nowrap}
.pill-guard i{width:6px;height:6px;border-radius:3px;background:var(--bright)}
.pill-quiet{padding:8px 12px;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:13px;line-height:16px;white-space:nowrap;cursor:default}
.icon-button{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;color:var(--ink)}
.icon-button:hover{background:#ffffff0d}
.glow{position:absolute;z-index:0;top:120px;left:50%;width:800px;height:300px;margin-left:-404px;border-radius:50%;background:#22d3c529;filter:blur(100px);pointer-events:none;transition:opacity .4s}
.chat-app[data-mode=thread] .glow{opacity:.5}

/* Empty state: the composer moves in here (see chat.js) */
.empty{position:relative;z-index:1;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:36px;padding:0 24px 40px;overflow-y:auto}
.empty-head{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.empty h1{margin:0;font-size:44px;line-height:54px;font-weight:500;letter-spacing:-.04em}
.empty p{margin:0;color:var(--muted);font-size:16px;line-height:20px}
.suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;width:min(760px,100%)}
.suggestions button{padding:10px 16px;border:1px solid var(--line);border-radius:100px;background:#ffffff08;color:var(--soft);font-size:14px;line-height:18px;transition:background .15s,border-color .15s}
.empty-code{padding:6px 10px;border-radius:8px;color:var(--muted);font-size:14px;line-height:18px;transition:color .15s}
.empty-code:hover{color:var(--bright)}
.empty-code[hidden]{display:none}
.suggestions button:hover{background:#ffffff12;border-color:#ffffff24;color:var(--ink)}
.chat-app[data-mode=thread] .empty,.chat-app[data-mode=empty] .thread{display:none}

/* Composer */
.composer{display:flex;width:min(760px,100%);border:1px solid var(--line-strong);border-radius:22px;background:var(--surface);transition:border-color .15s}
.composer:focus-within{border-color:#5cefe04d}
.composer textarea{flex:1;min-width:0;max-height:220px;margin:0;padding:0;border:0;background:transparent;resize:none;outline:0;font-size:15px;line-height:22px;color:var(--ink)}
.composer textarea::placeholder{color:#ffffff66}
.composer textarea:disabled{cursor:not-allowed}
.composer-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.composer-hint{color:var(--faint);font-size:13px;line-height:16px}
.send{display:flex;align-items:center;justify-content:center;width:36px;height:36px;flex-shrink:0;margin-left:auto;border-radius:18px;background:var(--accent);color:var(--on-accent);transition:background .15s,opacity .15s}
.send:hover:not(:disabled){background:var(--bright)}
.send:disabled{opacity:.35}
.send[hidden]{display:none}
/* Hero composer (empty state): text on top, controls row below */
.empty .composer{flex-direction:column;gap:14px;padding:18px 18px 14px 22px;box-shadow:0 20px 60px #00000073}
.empty .composer textarea{font-size:16px;line-height:22px;min-height:22px}
.empty .send{width:38px;height:38px;border-radius:19px}
/* Docked composer (conversation): one row */
.dock{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:10px;padding:16px 24px 22px}
.chat-app[data-mode=empty] .dock{display:none}
.dock .composer{align-items:flex-end;gap:12px;padding:14px 14px 14px 22px}
.dock .composer textarea{align-self:center;padding:7px 0}
.dock .composer-hint{display:none}
.dock-note{margin:0;color:var(--faint);font-size:12px;line-height:16px;text-align:center}

/* Thread */
.thread{position:relative;z-index:1;flex:1;overflow-y:auto;padding:24px 24px 28px;scrollbar-width:thin;scrollbar-color:#ffffff1a transparent}
.thread-inner{display:flex;flex-direction:column;gap:28px;width:min(760px,100%);margin:0 auto}
.msg-user{display:flex;justify-content:flex-end}
.msg-user .bubble{max-width:min(560px,85%);padding:14px 18px;border-radius:18px 18px 4px 18px;background:#ffffff12;font-size:15px;line-height:24px;white-space:pre-wrap;overflow-wrap:anywhere}
.msg-bot{display:flex;gap:14px}
.bot-mark{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border:1px solid #5cefe059;border-radius:9px;background:var(--surface);color:var(--bright);font-size:13px;font-weight:700}
.bot-head{display:none}
.bot-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:14px}
.md{display:flex;flex-direction:column;gap:14px;color:var(--body);font-size:15px;line-height:25px;overflow-wrap:anywhere}
.md p,.md ul,.md ol{margin:0}
.md ul,.md ol{padding-left:22px;display:flex;flex-direction:column;gap:4px}
.md .md-h{color:var(--ink);font-weight:600}
.md strong{color:var(--ink);font-weight:600}
.md :not(pre)>code{padding:1px 6px;border-radius:6px;background:#ffffff12;font:13px/20px var(--mono);color:var(--code)}
.code-block{border:1px solid var(--line);border-radius:14px;background:var(--surface);overflow:hidden}
.code-head{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid #ffffff0f;font:12px/16px var(--mono)}
.code-head span{color:var(--muted)}
.code-head button{color:var(--bright)}
.code-head button:hover{text-decoration:underline}
.code-block pre{margin:0;padding:14px 16px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#ffffff1a transparent}
.code-block code{font:13px/22px var(--mono);color:var(--code);white-space:pre}
.thinking{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:14px;line-height:25px}
.thinking::before{content:'';width:8px;height:8px;border-radius:4px;background:var(--bright);animation:pulse 1.2s ease-in-out infinite}
.md.streaming>:last-child::after{content:'▍';margin-left:2px;color:var(--bright);animation:blink 1s steps(2) infinite}
@keyframes pulse{50%{opacity:.25;transform:scale(.7)}}
@keyframes blink{50%{opacity:0}}
.bot-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px 16px;font-size:13px;line-height:16px}
.bot-actions button{color:var(--muted)}
.bot-actions button:hover{color:var(--ink)}
.bot-meta{color:var(--faint);font:12px/16px var(--mono);font-variant-numeric:tabular-nums}
.bot-note{color:var(--muted);font-size:13px}

/* Toast */
.toast{position:fixed;z-index:40;left:50%;bottom:110px;transform:translate(-50%,8px);max-width:min(520px,calc(100vw - 32px));padding:10px 16px;border:1px solid var(--line-strong);border-radius:12px;background:#101c1d;color:var(--ink);font-size:14px;line-height:20px;box-shadow:0 12px 40px #00000080;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast[data-error=true]{border-color:#ff8a7a59}

/* Credit modal */
.overlay{position:fixed;inset:0;z-index:30;display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;overscroll-behavior:contain;padding:20px;background:#020607b8;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.overlay[hidden]{display:none}
.modal{display:flex;flex-direction:column;gap:24px;width:min(620px,100%);flex-shrink:0;margin:auto;padding:32px;border:1px solid #ffffff1a;border-radius:24px;background:var(--surface);box-shadow:0 40px 100px #00000099}
.modal-head{display:flex;flex-direction:column;gap:8px}
.modal h2{margin:0;font-size:26px;line-height:32px;font-weight:500;letter-spacing:-.03em}
.modal-head p{margin:0;color:var(--muted);font-size:15px;line-height:24px}
.plan-cards{display:flex;gap:12px}
.plan-cards:empty{display:none}
.plan-card{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:10px;padding:20px;border:1px solid #ffffff1a;border-radius:16px;text-align:left;transition:border-color .15s}
.plan-card:hover{border-color:#ffffff33}
.plan-card[aria-pressed=true]{border-color:#5cefe080;background-color:#123a37;background-image:linear-gradient(in oklab 180deg,oklab(28.2% -.042 -.009) 0%,oklab(44% -.071 -.01) 100%)}
.plan-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:20px}
.plan-top strong{font-size:15px;line-height:18px;font-weight:500}
.plan-badge{padding:3px 9px;border-radius:100px;background:var(--accent);color:var(--on-accent);font-size:11px;font-weight:600;line-height:14px;white-space:nowrap}
.plan-price{display:flex;align-items:baseline;gap:4px}
.plan-price b{font-size:32px;line-height:40px;font-weight:500;letter-spacing:-.04em}
.plan-price span,.plan-card p{color:var(--muted);font-size:13px}
.plan-card p{margin:0;line-height:20px}
.plan-card[aria-pressed=true] .plan-price span{color:#ffffffb3}
.plan-card[aria-pressed=true] p{color:#ffffffcc}
.modal-actions{display:flex;flex-direction:column;gap:10px}
.modal-cta{padding:14px;border-radius:100px;background:var(--accent);color:var(--on-accent);font-size:15px;font-weight:600;line-height:18px;transition:background .15s}
.modal-cta:hover:not(:disabled){background:var(--bright)}
.modal-cta:disabled{opacity:.5}
.modal-link{padding:4px;color:var(--bright);font-size:14px;line-height:18px}
.modal-link:hover{text-decoration:underline}
.modal-later{padding:10px;color:var(--muted);font-size:14px;line-height:18px}
.modal-later:hover{color:var(--ink)}
.modal-cta[hidden],.modal-link[hidden]{display:none}

/* Mobile (Chat · Mobile, 390px) */
@media (max-width:820px){
  .mobile-only{display:flex!important}
  .desktop-only{display:none!important}
  .sidebar{position:fixed;z-index:20;inset:0 auto 0 0;width:min(300px,86vw);transform:translateX(-100%);transition:transform .25s ease;box-shadow:20px 0 60px #00000080}
  .chat-app[data-drawer=open] .sidebar{transform:none}
  .sb-new kbd{display:none}
  .chat-app[data-drawer=open] .scrim{display:block;position:fixed;inset:0;z-index:15;background:#020607b8}
  .chat-top{padding:6px 12px 12px;border-bottom:1px solid #ffffff12}
  .top-left{position:absolute;left:50%;transform:translateX(-50%)}
  .model-pill{border-radius:100px}
  .model-pill select{padding:7px 28px 7px 12px}
  .model-pill .caret{font-size:10px;line-height:12px}
  .glow{top:80px;width:360px;height:220px;margin-left:-180px;filter:blur(80px)}
  .empty{justify-content:flex-start;gap:24px;padding:48px 16px 16px}
  .empty h1{font-size:32px;line-height:40px}
  .empty p{font-size:15px}
  .empty .composer{padding:14px 12px 12px 16px}
  .empty .composer-hint{display:none}
  .suggestions{justify-content:flex-start}
  .suggestions button{font-size:13px;padding:9px 14px}
  .thread{padding:20px 16px 24px}
  .thread-inner{gap:20px}
  .msg-user .bubble{max-width:290px;padding:12px 14px;border-radius:16px 16px 4px 16px;line-height:22px}
  .msg-bot{flex-direction:column;gap:12px}
  .msg-bot>.bot-mark{display:none}
  .bot-head{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;line-height:16px}
  .bot-head .bot-mark{width:24px;height:24px;border-radius:7px;font-size:11px}
  .bot-body{gap:12px}
  .md{font-size:15px;line-height:23px;gap:12px}
  .code-block{border-radius:12px}
  .code-head{padding:8px 12px;font-size:11px;line-height:14px}
  .code-block pre{padding:10px 12px}
  .code-block code{font-size:11.5px;line-height:19px}
  .bot-meta{font-size:11px;line-height:14px}
  .dock{gap:8px;padding:10px 12px calc(28px + env(safe-area-inset-bottom));border-top:1px solid #ffffff0f;background:var(--bg)}
  .chat-app[data-mode=empty] .dock{display:flex}
  .chat-app[data-mode=empty] .dock .composer{display:none}
  .dock .composer{padding:10px 10px 10px 16px}
  .dock .composer textarea{padding:6px 0}
  .dock .send{width:34px;height:34px;border-radius:17px}
  .dock-meta{justify-content:space-between;width:100%;padding:0 6px;font-size:12px;line-height:16px}
  .dock-meta .guard-text{color:var(--bright)}
  .dock-meta span:last-child{color:var(--faint)}
  .toast{bottom:120px}
  .modal{padding:24px;gap:20px;border-radius:20px}
  .modal h2{font-size:22px;line-height:28px}
  .plan-cards{flex-direction:column}
  .plan-price b{font-size:28px;line-height:34px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
