/* Wizool — host shell styles (v4: soft-hero redesign) */
:root {
  --bg: #F8F9F7;
  --surface: #FFFFFF;
  --ink: #1C2321;
  --muted: #5C6763;
  --line: #E3E7E2;
  --accent: #0E7466;
  --accent-ink: #0A5A50;
  --accent-soft: #E2F0EC;
  --danger: #A33D2A;
  --star: #C99B00;
  --hero-a: #E3F2ED;
  --hero-b: #EDEFF8;
  --shadow-sm: 0 1px 3px rgba(28, 35, 33, .06), 0 1px 2px rgba(28, 35, 33, .04);
  --shadow-md: 0 6px 24px rgba(28, 35, 33, .10), 0 2px 6px rgba(28, 35, 33, .05);
  --shadow-lg: 0 12px 40px rgba(28, 35, 33, .14);
}
html[data-theme="dark"] {
  --bg: #131817;
  --surface: #1D2422;
  --ink: #E7ECE9;
  --muted: #98A39E;
  --line: #2B3430;
  --accent: #4FB3A4;
  --accent-ink: #7BCBBF;
  --accent-soft: #1A302B;
  --danger: #D97B66;
  --star: #E3BE4B;
  --hero-a: #17221F;
  --hero-b: #191D26;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

/* ---------- layout: sidebar + full-width content ---------- */
.layout { display: flex; min-height: 100vh; align-items: stretch; }
.side {
  width: 224px; flex: none;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; z-index: 10;
}
.brand { font-weight: 800; font-size: 20px; text-decoration: none; color: var(--ink); white-space: nowrap; letter-spacing: -.02em; padding: 0 12px; }
.brand span { color: var(--accent); }
.sidenav { display: flex; flex-direction: column; gap: 4px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--muted); font-size: 14.5px;
  padding: 10px 14px; border-radius: 12px;
}
.sidenav a:hover { color: var(--ink); background: var(--bg); }
.sidenav a.active { color: var(--accent-ink); background: var(--accent-soft); font-weight: 700; }
/* result history tray */
.side-hist { margin-top: 4px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.sh-title { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 12px; letter-spacing: .02em; }
#side-history { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 0 2px; }
.sh-empty { font-size: 11.5px; color: var(--muted); padding: 0 12px; line-height: 1.5; }
.sh-item { border-radius: 10px; padding: 6px 10px; font-size: 12px; background: var(--bg); }
.sh-row1 { display: flex; align-items: center; gap: 6px; }
.sh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; cursor: pointer; }
.sh-name:hover { color: var(--accent-ink); }
.sh-size { color: var(--muted); font-size: 10.5px; font-family: Consolas, monospace; }
.sh-item button { border: none; background: transparent; cursor: pointer; font-size: 12px; color: var(--muted); padding: 1px 2px; }
.sh-item button:hover { color: var(--accent); }
.sh-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; align-items: center; }
.sh-lbl { font-size: 11px; color: var(--muted); }
.sh-tools button {
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  font-size: 11px; background: var(--surface); color: var(--ink);
}
.sh-tools button:hover { border-color: var(--accent); color: var(--accent-ink); }

.side-legal { font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 0 12px; margin-top: auto; }
.side-legal:hover { color: var(--accent-ink); }
.side-foot { display: flex; gap: 8px; padding: 0 8px; margin-top: 8px; }
.side-foot button {
  flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 0; cursor: pointer; font-size: 13px;
}
.side-foot button:hover { border-color: var(--accent); }
.content { flex: 1; min-width: 0; }

main { padding: 0 40px 72px; }

/* ---------- hero (index) ---------- */
.hero {
  text-align: center;
  margin: 0 -40px;
  padding: 56px 24px 44px;
  background: linear-gradient(160deg, var(--hero-a) 0%, var(--hero-b) 55%, var(--bg) 100%);
}

/* mobile: sidebar becomes a top bar */
@media (max-width: 840px) {
  .layout { flex-direction: column; }
  .side {
    width: auto; height: auto; position: sticky;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 14px;
  }
  .brand { padding: 0; }
  .sidenav { flex-direction: row; gap: 2px; }
  .sidenav a { padding: 6px 10px; font-size: 13px; }
  .side-hist { display: none; }
  .side-foot { margin-top: 0; margin-inline-start: auto; padding: 0; }
  .side-foot button { padding: 6px 12px; }
  main { padding: 0 16px 56px; }
  .hero { margin: 0 -16px; }
}
.hero-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
  margin: 0 0 6px;
  background: linear-gradient(90deg, var(--accent-ink), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent);
}
.hero-sub { color: var(--muted); margin: 0 auto 24px; max-width: 56ch; font-size: 15.5px; }

/* mode pills */
.mode-pills { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mode-pills button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 20px; cursor: pointer; font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.mode-pills button.active {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700;
}

/* the big box */
.bigbox {
  max-width: 680px; margin: 0 auto;
  background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden; text-align: start;
}
.bigbox:focus-within { box-shadow: var(--shadow-lg); }
.bigbox-input { display: flex; align-items: center; gap: 12px; padding: 8px 20px; }
.bigbox-input .icon { font-size: 18px; flex: none; }
.bigbox-input input {
  flex: 1; border: none; background: transparent; color: var(--ink);
  font-size: 16.5px; outline: none; min-width: 0; padding: 12px 0;
}
.bigbox-input input::placeholder { color: var(--muted); }
.bigbox-input .go {
  border: none; background: var(--accent); color: #fff; font-weight: 700;
  border-radius: 10px; padding: 10px 22px; cursor: pointer; font-size: 14px; white-space: nowrap;
}
.bigbox-input .go:hover { filter: brightness(1.08); }
.bigbox-chips {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 20px; background: var(--accent-soft);
}
.bigbox-chips button {
  border: 1px solid transparent; background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 4px 15px; cursor: pointer; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.bigbox-chips button.active { color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.ask-note { font-size: 13px; color: var(--muted); margin: 14px auto 0; max-width: 60ch; }
.ask-note.ok { color: var(--accent); font-weight: 600; }

/* ---------- tool cards ---------- */
.grid-head { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 16px; }
.grid-head h2 { font-size: 17px; margin: 0; }
.grid-head .count { font-size: 13px; color: var(--muted); }
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}
.tool-card {
  position: relative; display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid transparent; border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--accent-soft); }
.tool-card .emoji {
  font-size: 24px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border-radius: 12px;
}
.tool-card h3 { margin: 12px 0 4px; font-size: 15.5px; }
.tool-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.tool-card .cat {
  font-size: 11.5px; color: var(--muted); background: var(--bg);
  border-radius: 999px; padding: 2px 10px;
}
.fav-btn {
  position: absolute; top: 14px; inset-inline-end: 14px;
  border: none; background: transparent; cursor: pointer;
  font-size: 18px; color: var(--line); line-height: 1; padding: 4px;
}
.fav-btn:hover { color: var(--star); }
.fav-btn.on { color: var(--star); }
.empty-msg { color: var(--muted); padding: 28px 6px; }

@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
}

/* ---------- tool host page ---------- */
.tool-head { margin: 28px 0 16px; display: flex; align-items: flex-start; gap: 12px; }
.tool-head .txt { flex: 1; }
.tool-head h1 { font-size: 26px; margin: 0 0 2px; letter-spacing: -.01em; }
.tool-head p { margin: 0; color: var(--muted); font-size: 14px; }
.privacy-note {
  display: inline-block; margin-top: 10px; font-size: 12.5px;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 14px;
}
.fav-btn.big { position: static; font-size: 24px; }

#tool-frame {
  width: 100%; height: 560px; border: none;
  border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
#host-status { font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 20px; }
#host-status.error { color: var(--danger); }

/* ---------- chaining: continue-to bar ---------- */
.continue-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 18px;
  background: var(--accent-soft); border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.continue-bar .cb-label { font-size: 13.5px; font-weight: 700; color: var(--accent-ink); }
.continue-bar button {
  border: 1px solid transparent; background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 16px; cursor: pointer; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.continue-bar button:hover { background: var(--accent); color: #fff; }

/* ---------- personal area ---------- */
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 30px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 30px; max-width: 62ch; font-size: 14.5px; }
.p-section { margin-bottom: 38px; }
.p-section h2 { font-size: 18px; margin: 0 0 14px; }
.nick-row { display: flex; gap: 8px; align-items: center; max-width: 400px; }
.nick-row input {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); padding: 10px 14px; font-size: 14px; outline: none; min-width: 0;
}
.nick-row input:focus { border-color: var(--accent); }
.nick-row button {
  border: none; background: var(--accent); color: #fff; font-weight: 600;
  border-radius: 12px; padding: 10px 18px; cursor: pointer; font-size: 13.5px;
}
.p-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.req-item .q { flex: 1; font-size: 14px; }
.req-item .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.req-item .status {
  font-size: 11.5px; color: var(--star); border: 1px solid var(--star);
  border-radius: 999px; padding: 1px 10px; white-space: nowrap;
}
.req-item .del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.req-item .del:hover { color: var(--danger); }
.req-item .status.st-active { color: var(--accent-ink); border-color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.req-item .status.st-done { color: #1a7f37; border-color: #1a7f37; }
html[data-theme="dark"] .req-item .status.st-done { color: #57c877; border-color: #57c877; }
.req-item .status.st-failed { color: var(--danger); border-color: var(--danger); }
.req-bar { height: 7px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 8px; max-width: 420px; }
.req-bar .fill { height: 100%; width: 0%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.req-eta { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.req-result { font-size: 13px; margin-top: 4px; color: var(--muted); }
.req-result a { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.req-result a:hover { text-decoration: underline; }
.req-error { font-size: 12.5px; margin-top: 4px; color: var(--danger); }
.ask-note.err { color: var(--danger); }
.ask-link { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.note-btn {
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; padding: 3px 14px; cursor: pointer; font-size: 12.5px; font-weight: 700;
}
.note-btn:hover { background: var(--accent); color: #fff; }
.ask-link:hover { text-decoration: underline; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .req-item .status.st-active { animation: none; } }

/* ---------- chain builder ---------- */
.chain-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.chain-add .lbl { font-size: 14px; font-weight: 600; }
.chain-add button {
  border: 1px dashed var(--accent); background: var(--surface); color: var(--accent-ink);
  border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 13.5px;
}
.chain-add button:hover { background: var(--accent-soft); }
.chain-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.chain-step {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.chain-step .num {
  width: 28px; height: 28px; flex: none; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.chain-step .sname { font-weight: 700; font-size: 14.5px; }
.chain-step .param { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chain-step .param select, .chain-step .param input[type="number"] {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-size: 13px; width: auto; max-width: 110px;
}
.chain-step .param input[type="range"] { accent-color: var(--accent); width: 110px; }
.chain-step .pval { font-family: Consolas, monospace; font-size: 12.5px; min-width: 3ch; }
.chain-step .rm { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; margin-inline-start: auto; }
.chain-step .rm:hover { color: var(--danger); }
.chain-drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 26px 16px;
  text-align: center; color: var(--muted); cursor: pointer; background: var(--surface);
  margin-bottom: 16px;
}
.chain-drop.over, .chain-drop:hover { border-color: var(--accent); }
.chain-files { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.chain-run-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.chain-run-row .primary {
  border: none; background: var(--accent); color: #fff; font-weight: 700;
  border-radius: 12px; padding: 12px 28px; cursor: pointer; font-size: 15px;
}
.chain-run-row .primary:disabled { opacity: .45; cursor: default; }
.chain-run-row .ghost {
  border: 1px solid var(--accent); background: transparent; color: var(--accent-ink); font-weight: 600;
  border-radius: 12px; padding: 11px 22px; cursor: pointer; font-size: 14px;
}
.chain-bar { height: 8px; background: var(--surface); border-radius: 99px; overflow: hidden; margin: 10px 0; box-shadow: var(--shadow-sm); }
.chain-bar .fill { height: 100%; width: 0%; background: var(--accent); transition: width .2s; }
.chain-status { font-size: 13.5px; color: var(--muted); min-height: 20px; }
.chain-status.error { color: var(--danger); }
.chain-results { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.chain-res {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow-sm);
}
.chain-res .fname { flex: 1; font-size: 13.5px; direction: ltr; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-res .fsize { font-size: 12.5px; color: var(--muted); font-family: Consolas, monospace; }
.chain-res a { background: var(--accent); color: #fff; text-decoration: none; font-size: 13px; border-radius: 8px; padding: 7px 14px; }
/* Chain worker frames must stay "on screen" — zero-size/hidden cross-origin iframes get
   their timers throttled by the browser and pdf.js rendering stalls. */
#chain-frames {
  position: fixed; bottom: 0; inset-inline-end: 0; z-index: -1;
  width: 320px; height: 240px;
  opacity: 0.01; pointer-events: none;
}
#chain-frames iframe { width: 100%; height: 100%; border: none; }

/* ---------- tool-finder chat widget (bottom corner, every page) ---------- */
.wz-chat-launch {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  border: none; cursor: pointer; font: inherit;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px;
  border-radius: 999px; padding: 12px 20px 12px 16px;
  box-shadow: var(--shadow-lg);
  transition: transform .18s, filter .18s;
}
.wz-chat-launch:hover { transform: translateY(-2px); filter: brightness(1.08); }
.wz-chat-launch .ico { font-size: 20px; line-height: 1; }
.wz-chat-launch[hidden] { display: none !important; }
.wz-chat {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 61;
  width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 44px));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); overflow: hidden;
}
.wz-chat[hidden] { display: none !important; }
.wz-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 12px 16px; background: var(--accent-soft); color: var(--accent-ink);
}
.wz-chat-head .ava {
  width: 34px; height: 34px; border-radius: 999px; flex: none;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.wz-chat-head .ttl { flex: 1; min-width: 0; line-height: 1.25; }
.wz-chat-head .ttl b { display: block; font-size: 14.5px; }
.wz-chat-head .ttl span { font-size: 12px; opacity: .85; }
.wz-chat-head button {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 15px; padding: 4px 6px; border-radius: 8px; opacity: .8;
}
.wz-chat-head button:hover { opacity: 1; background: var(--surface); }
.wz-chat-log {
  flex: 1; overflow-y: auto; padding: 14px 14px 6px;
  display: flex; flex-direction: column; gap: 10px; background: var(--bg);
}
.wz-msg { max-width: 88%; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.wz-msg .bubble { padding: 9px 13px; border-radius: 16px; box-shadow: var(--shadow-sm); }
.wz-msg.bot { align-self: flex-start; }
.wz-msg.bot .bubble { background: var(--surface); border-start-start-radius: 6px; }
.wz-msg.user { align-self: flex-end; }
.wz-msg.user .bubble { background: var(--accent); color: #fff; border-start-end-radius: 6px; }
.wz-msg.sys .bubble { background: transparent; box-shadow: none; color: var(--muted); font-size: 12.5px; padding: 2px 6px; }
.wz-msg.err .bubble { color: var(--danger); }
.wz-msg .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wz-msg .acts a, .wz-msg .acts button {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none; cursor: pointer; font: inherit;
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid transparent;
}
.wz-msg .acts a:hover, .wz-msg .acts button:hover { border-color: var(--accent); }
.wz-msg .acts button.build { background: var(--accent); color: #fff; font-weight: 700; }
.wz-msg .acts button:disabled { opacity: .5; cursor: default; }
.wz-typing .bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.wz-typing i { width: 6px; height: 6px; border-radius: 999px; background: var(--muted); animation: wzdot 1.2s infinite ease-in-out; }
.wz-typing i:nth-child(2) { animation-delay: .2s; }
.wz-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes wzdot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.wz-chat-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 8px; background: var(--bg); }
.wz-chat-sugg button {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit;
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
}
.wz-chat-sugg button:hover { color: var(--accent-ink); border-color: var(--accent); }
.wz-chat-form {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface);
}
.wz-chat-form input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 14px; outline: none;
}
.wz-chat-form input:focus { border-color: var(--accent); }
.wz-chat-form button {
  border: none; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; font: inherit;
  border-radius: 12px; padding: 0 16px; font-size: 14px;
}
.wz-chat-form button:disabled { opacity: .5; cursor: default; }
@media (max-width: 840px) {
  .wz-chat-launch { bottom: 14px; inset-inline-end: 14px; padding: 11px 16px 11px 13px; font-size: 13.5px; }
  .wz-chat { bottom: 0; inset-inline: 0; width: auto; max-width: 100%; height: min(78vh, 600px); border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wz-chat-launch { transition: none; }
  .wz-typing i { animation: none; opacity: .6; }
}

/* ---------- usage counters + sort control ---------- */
.tool-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-card .views { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid-head .sort { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.grid-head .sort select {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer;
}
.grid-head .sort select:focus { outline: none; border-color: var(--accent); }
.views-note {
  display: inline-block; margin-top: 10px; margin-inline-start: 8px; font-size: 12.5px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
