@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

*{box-sizing:border-box}
:root{
  --bg:#fff;
  --soft:#f7f7f5;
  --soft2:#f1f1ee;
  --line:#e7e7e3;
  --line2:#d7d7d2;
  --text:#171715;
  --muted:#73736d;
  --faint:#a2a29c;
  --green:#17834a;
  --red:#d63f35;
  --blue:#365edb;
}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif}
button,textarea,select{font:inherit}
button{cursor:pointer}
.limit-chat-page{min-height:100vh}
.topbar{
  height:64px;border-bottom:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-between;padding:0 24px;position:sticky;top:0;background:#fffffff2;
  backdrop-filter:blur(16px);z-index:20
}
.wordmark{display:flex;align-items:center;gap:9px;color:var(--text);text-decoration:none;font-size:14px;letter-spacing:.02em}
.mark{width:27px;height:27px;border:1px solid var(--line2);border-radius:8px;display:grid;place-items:center;font-size:12px;font-weight:700}
.top-controls{display:flex;align-items:center;gap:8px}
.select-control{
  height:38px;border:1px solid var(--line);border-radius:10px;padding:0 9px 0 11px;
  display:flex;align-items:center;gap:8px;background:#fff
}
.select-control>span{font-size:10px;color:var(--faint);text-transform:uppercase;letter-spacing:.06em}
.select-control select{border:0;outline:0;background:transparent;color:var(--text);font-size:12px;font-weight:600;cursor:pointer}
.status-pill{
  height:38px;border:1px solid var(--line);border-radius:999px;background:#fff;
  padding:0 12px;display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11px
}
.status-pill i{width:7px;height:7px;border-radius:50%;background:#b7b7b0}
.status-pill.connected i{background:var(--green);box-shadow:0 0 0 4px #17834a12}
.status-pill.local i{background:#d59024}
.status-pill.error i{background:var(--red)}
.status-pill.checking i{animation:pulse 1.1s infinite}
.icon-button{
  width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:#fff;color:#555;font-size:20px
}
.icon-button:hover,.select-control:hover,.status-pill:hover{border-color:var(--line2);background:var(--soft)}

.chat-layout{min-height:calc(100vh - 64px)}
.chat-column{width:min(800px,100%);margin:0 auto;min-height:calc(100vh - 64px);display:flex;flex-direction:column}
.conversation{flex:1;padding:64px 24px 180px}
.welcome{max-width:650px;margin:8vh auto 0;text-align:center}
.model-symbol{
  width:48px;height:48px;margin:0 auto 20px;border:1px solid var(--line2);border-radius:15px;
  display:grid;place-items:center;font:500 26px/1 DM Mono;background:linear-gradient(145deg,#fff,#f1f1ed);
  box-shadow:0 8px 28px #1111110b
}
.welcome h1{font-size:34px;line-height:1.1;letter-spacing:-.045em;margin:0 0 13px}
.welcome>p{font-size:14px;line-height:1.6;color:var(--muted);margin:0}
.suggestions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:38px;text-align:left}
.suggestions button{
  border:1px solid var(--line);background:#fff;border-radius:13px;padding:15px 16px;transition:.16s ease;color:var(--text)
}
.suggestions button:hover{border-color:#cfcfc8;transform:translateY(-1px);box-shadow:0 8px 22px #11111108}
.suggestions span,.suggestions small{display:block}
.suggestions span{font-size:13px;font-weight:600}
.suggestions small{font-size:11px;color:var(--faint);margin-top:5px}

.message{max-width:720px;margin:0 auto 34px;animation:messageIn .28s ease both}
.user-message{display:flex;justify-content:flex-end}
.user-bubble{
  max-width:78%;background:var(--soft2);border:1px solid #ededE8;border-radius:16px 16px 4px 16px;
  padding:11px 14px;font-size:13px;line-height:1.55;white-space:pre-wrap
}
.assistant-message{display:grid;grid-template-columns:32px 1fr;gap:12px}
.ai-avatar{
  width:30px;height:30px;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;
  font:500 16px DM Mono;background:#fff
}
.ai-body{min-width:0;padding-top:2px}
.ai-name{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;margin-bottom:12px}
.ai-name .engine{font-weight:400;color:var(--faint);font-size:10px}
.thinking-card{
  border:1px solid var(--line);border-radius:13px;overflow:hidden;background:#fff
}
.thinking-head{padding:13px 15px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.thinking-title{display:flex;align-items:center;gap:9px;font-size:12px;font-weight:600}
.spinner{width:14px;height:14px;border:1.5px solid #ddd;border-top-color:#222;border-radius:50%;animation:spin .75s linear infinite}
.thinking-live{font:10px DM Mono;color:var(--faint)}
.thinking-stages{padding:7px 15px}
.stage{
  display:flex;align-items:center;justify-content:space-between;gap:15px;padding:9px 0;
  border-bottom:1px solid #f2f2ef;font-size:11px;color:var(--muted);animation:stageIn .25s ease both
}
.stage:last-child{border-bottom:0}
.stage b{font-weight:500;color:#474743}
.stage em{font-style:normal;font:10px DM Mono;color:var(--faint)}
.stage .check{color:var(--green);margin-right:6px}
.live-meter{height:3px;background:#f0f0ed;overflow:hidden}
.live-meter i{display:block;width:18%;height:100%;background:#222;animation:meter 1.4s ease-in-out infinite}

.result{
  border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden;
  box-shadow:0 8px 24px #11111106
}
.result-top{padding:18px 18px 16px}
.result-kicker{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.result-kicker span:first-child{font:10px DM Mono;color:var(--red);letter-spacing:.04em}
.result-kicker .incident{font:9px DM Mono;color:var(--faint)}
.result h3{font-size:17px;letter-spacing:-.02em;margin:0 0 8px}
.result p{font-size:13px;line-height:1.58;color:#5e5e58;margin:0}
.answer-lock{
  margin:0 18px 17px;border:1px dashed #d9d9d3;background:#fafaf8;border-radius:11px;padding:13px 14px;
  display:flex;align-items:center;justify-content:space-between;gap:12px
}
.lock-copy small,.lock-copy strong{display:block}
.lock-copy small{font:9px DM Mono;color:var(--faint);margin-bottom:4px}
.lock-copy strong{font-size:11px;font-weight:600}
.blur-answer{
  width:120px;height:16px;border-radius:5px;
  background:repeating-linear-gradient(90deg,#d8d8d3 0 11px,#efefec 11px 18px);
  filter:blur(2px);opacity:.75
}
.result-meta{
  border-top:1px solid var(--line);padding:11px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;
  font-size:10px;color:var(--faint);background:#fcfcfb
}
.result-meta strong{color:#555;font-weight:600}
.result-actions{display:flex;gap:7px;padding:0 18px 18px}
.result-actions button{
  border:1px solid var(--line2);border-radius:9px;background:#fff;padding:9px 11px;color:#444;font-size:11px;font-weight:600
}
.result-actions .primary-action{background:#181817;border-color:#181817;color:#fff}
.result-actions button:hover{transform:translateY(-1px)}
.small-joke{margin:10px 2px 0;font-size:10px;color:var(--faint)}
.network-failure{border:1px solid #f0cecb;background:#fff9f8;border-radius:12px;padding:15px}
.network-failure strong{font-size:12px;color:var(--red)}
.network-failure p{font-size:11px;color:#7c615f;margin:6px 0 0;line-height:1.5}

.composer-wrap{
  position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(800px,100%);
  padding:18px 24px 16px;background:linear-gradient(transparent,#fff 25%,#fff)
}
.composer{
  border:1px solid var(--line2);border-radius:16px;background:#fff;padding:8px 8px 8px 14px;
  display:flex;align-items:flex-end;gap:8px;box-shadow:0 10px 35px #1111110d;transition:.18s
}
.composer:focus-within{border-color:#b8b8b1;box-shadow:0 12px 36px #11111112}
.composer textarea{
  border:0;outline:0;resize:none;flex:1;max-height:160px;min-height:34px;padding:8px 0;
  color:var(--text);font-size:13px;line-height:1.45;background:transparent
}
.composer textarea::placeholder{color:#aaa}
.composer button{
  flex:0 0 36px;width:36px;height:36px;border:0;border-radius:10px;background:#181817;color:#fff;font-size:18px
}
.composer button:disabled{background:#c7c7c1;cursor:default}
.composer-foot{display:flex;justify-content:space-between;padding:7px 4px 0;color:var(--faint);font-size:9px}

.toast{
  position:fixed;right:22px;bottom:22px;background:#181817;color:#fff;border-radius:10px;padding:10px 13px;
  font-size:11px;opacity:0;transform:translateY(8px);pointer-events:none;transition:.2s;z-index:80
}
.toast.show{opacity:1;transform:none}
.modal-backdrop{
  position:fixed;inset:0;background:#1116;backdrop-filter:blur(3px);z-index:60;display:none;place-items:center;padding:20px
}
.modal-backdrop.show{display:grid}
.modal{width:min(410px,100%);background:#fff;border-radius:16px;border:1px solid var(--line);box-shadow:0 30px 90px #1113;padding:27px;position:relative}
.modal-close{position:absolute;right:14px;top:12px;border:0;background:none;color:#999;font-size:22px}
.modal-tag{font:9px DM Mono;color:var(--red);letter-spacing:.05em}
.modal h2{font-size:25px;letter-spacing:-.04em;margin:13px 0 8px}
.modal>p{font-size:13px;color:var(--muted);line-height:1.55}
.modal-price{display:flex;align-items:baseline;gap:7px;margin:24px 0}
.modal-price strong{font-size:34px;letter-spacing:-.04em}.modal-price span{font-size:10px;color:var(--faint)}
.modal-primary{width:100%;border:0;border-radius:10px;background:#181817;color:#fff;padding:12px;font-size:12px;font-weight:600}
.modal>small{display:block;text-align:center;color:var(--faint);font-size:9px;margin-top:10px}

@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pulse{50%{opacity:.3}}
@keyframes meter{0%{transform:translateX(-100%);width:20%}60%{width:60%}100%{transform:translateX(500%);width:20%}}
@keyframes messageIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes stageIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

@media(max-width:700px){
  .topbar{height:auto;min-height:58px;padding:10px 13px;gap:10px}
  .select-control>span{display:none}
  .select-control{padding:0 7px;height:36px}
  .select-control select{max-width:105px}
  .status-pill{width:36px;height:36px;padding:0;justify-content:center}
  .status-pill span{display:none}
  .icon-button{width:36px;height:36px}
  .conversation{padding:42px 14px 160px}
  .welcome{margin-top:3vh}
  .welcome h1{font-size:29px}
  .suggestions{grid-template-columns:1fr}
  .composer-wrap{padding:14px 12px 10px}
  .composer-foot span:last-child{display:none}
  .assistant-message{grid-template-columns:26px 1fr;gap:9px}
  .ai-avatar{width:26px;height:26px;border-radius:8px;font-size:13px}
  .user-bubble{max-width:88%}
  .result-actions{flex-wrap:wrap}
  .answer-lock{align-items:flex-start;flex-direction:column}
}
