@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/GoogleSans.woff2") format("woff2");
}
:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-strong: #f1f3f4;
  --border: #e4e7eb;
  --fg: #202124;
  --muted: #70757a;
  --blue: #1a73e8;
  --blue-soft: #e8f0fe;
  --gold: #c08a13;
  --gold-soft: #fff7df;
  --bull: #188038;
  --bull-soft: #e6f4ea;
  --bear: #d93025;
  --bear-soft: #fce8e6;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-width: 300px;
  background: var(--bg);
  color: var(--fg);
  font-family: "Google Sans", "Google Sans Text", "Product Sans", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; padding: 12px 18px; border-bottom: 1px solid #f0f1f2;
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(160,32,240,.25)); }
h1 { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: 0; }
.sub { margin: 2px 0 0; font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.head-right { display: flex; align-items: center; gap: 5px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bull); box-shadow: 0 0 0 3px var(--bull-soft); }
.live-label { color: var(--bull); font-size: 11px; font-weight: 500; }

.content { flex: 1; overflow-y: auto; padding: 24px 18px 12px; scrollbar-width: thin; scrollbar-color: #dadce0 transparent; }
.intro { margin-bottom: 22px; }
.intro h2 { margin: 0 0 5px; font-size: 17px; line-height: 1.35; font-weight: 500; letter-spacing: 0; }
.intro p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.market { padding: 16px; border-radius: 16px; border: 1px solid #edf0f2; background: var(--surface); }
.market-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.market-label { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.trend { border-radius: 999px; padding: 4px 8px; background: var(--surface-strong); color: var(--muted); font-size: 10px; font-weight: 500; }
.trend.bull { background: var(--bull-soft); color: var(--bull); }
.trend.bear { background: var(--bear-soft); color: var(--bear); }
.quote { display: flex; align-items: baseline; gap: 5px; margin-top: 9px; }
.currency { font-size: 17px; font-weight: 400; }
.hprice { font-size: 25px; line-height: 1.2; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.hchange { margin-left: 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
.hchange.bull { color: var(--bull); }
.hchange.bear { color: var(--bear); }

.row { display: flex; gap: 4px; margin-top: 13px; padding: 3px; border-radius: 10px; background: var(--surface-strong); }
.row button.tab { flex: 1; }
button {
  cursor: pointer; border-radius: 999px; border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); padding: 7px 11px; font-size: 12px; font-family: inherit; transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
button:active { transform: scale(.97); }
button.tab { border: 0; background: transparent; padding: 5px 6px; font-size: 11px; }
button.tab.active { background: var(--bg); color: var(--fg); font-weight: 500; box-shadow: 0 1px 3px rgba(60,64,67,.14); }

.screenbar { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; min-height: 34px; }
button.share { display: inline-flex; align-items: center; gap: 7px; border-color: #d2e3fc; color: var(--blue); background: #f8fbff; font-weight: 500; }
button.share svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
button.share.on { background: var(--bull-soft); border-color: #b7dfc2; color: var(--bull); }
.watch { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.small { font-size: 11px; }
.muted { color: var(--muted); }

.thread { padding: 17px 0 10px; display: flex; flex-direction: column; gap: 15px; min-height: 160px; }
.msg { max-width: 94%; line-height: 1.56; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--blue-soft); color: #174ea6; border-radius: 18px 18px 5px 18px; padding: 9px 13px; }
.msg.ai { align-self: flex-start; position: relative; padding-left: 32px; }
.msg.ai::before { content: "✦"; position: absolute; left: 0; top: 0; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.msg.ai h4 { margin: 10px 0 3px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.msg.err { color: var(--bear); }
.msg .shot { display: block; max-width: 150px; border-radius: 10px; margin-bottom: 7px; border: 1px solid var(--border); }
.typing { color: var(--muted); font-style: italic; }
.empty { position: relative; padding-left: 34px; color: #3c4043; line-height: 1.58; }
.empty::before { content: "✦"; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.empty strong { font-weight: 500; }

.quick { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.quick button { background: var(--bg); border-color: #dadce0; font-size: 11px; padding: 6px 10px; }
.quick button:hover { background: var(--surface); color: var(--blue); border-color: #c6dafc; }

.composer-wrap { padding: 8px 14px 10px; background: var(--bg); }
.composer { display: flex; align-items: flex-end; gap: 5px; border: 1px solid transparent; border-radius: 24px; padding: 7px 7px 7px 16px; background: var(--surface-strong); transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.composer:focus-within { background: var(--bg); border-color: #d2e3fc; box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
textarea { flex: 1; max-height: 110px; resize: none; background: transparent; border: none; color: var(--fg); font-family: inherit; font-size: 14px; line-height: 1.45; outline: none; padding: 6px 0; }
textarea::placeholder { color: #80868b; }
button.icon, button.send { flex: none; border: none; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }
button.icon { background: transparent; color: var(--muted); }
button.icon:hover { color: var(--blue); background: var(--blue-soft); }
button.send { background: var(--blue); color: #fff; }
button.icon svg, button.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
button.send:disabled { opacity: .5; cursor: default; }
button.link { border: none; background: none; padding: 0; color: var(--blue); font-size: 11px; }

footer { padding-top: 7px; text-align: center; color: #9aa0a6; font-size: 9px; line-height: 1.4; }
#attached { padding: 0 8px 6px; }
.hidden { display: none !important; }
video, canvas { display: none; }

@media (max-width: 330px) {
  header { padding-inline: 12px; }
  .content { padding-inline: 12px; }
  .sub { display: none; }
  .intro h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.updated{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:11px;color:#5f6368}
.dot{width:7px;height:7px;border-radius:50%;background:#9aa0a6;display:inline-block}
.dot.live{background:#1e8e3e;animation:pulse 1.6s infinite}
.dot.off{background:#d93025}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.25}}
.hprice.tick-up{animation:tickUp .6s ease}
.hprice.tick-down{animation:tickDown .6s ease}
@keyframes tickUp{0%{color:#1e8e3e}100%{color:inherit}}
@keyframes tickDown{0%{color:#d93025}100%{color:inherit}}
