:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f4f4f4;
  --hover: #e9e9e9;
  --text: #0d0d0d;
  --muted: #616161;
  --border: #dedede;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; scroll-padding-bottom: 150px; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button { transition: background .18s ease, color .18s ease; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
button:disabled { opacity: .4; cursor: default; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.model-pill { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.model-pill img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.model-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.top-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 10px; color: var(--text); background: transparent; }
.top-btn:hover { background: var(--surface); }
.chat { width: min(100%, 816px); margin: 0 auto; flex: 1; padding: 44px 24px 48px; display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: flex-start; gap: 16px; }
.row.u { justify-content: flex-start; flex-direction: row-reverse; }
.av { display: none; }
.bbl { min-width: 0; font-size: 18px; line-height: 1.75; overflow-wrap: anywhere; }
.bbl.b { max-width: 100%; padding: 0; background: transparent; }
.bbl.u { max-width: 85%; padding: 10px 20px; border-radius: 24px; background: var(--surface); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chat > .btns { margin-top: -10px; }
.cb { padding: 10px 20px; min-height: 44px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font-size: 16px; line-height: 1.4; }
.cb:hover { background: var(--surface); }
.cb:active { background: var(--hover); }
.scanbox { background: var(--surface); border-radius: 16px; padding: 20px; font-size: 16px; color: var(--muted); line-height: 1.65; }
.sl { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.sl:not(.on) { display: none; }
.sd { width: 7px; height: 7px; border-radius: 50%; background: var(--text); flex-shrink: 0; }
.sd.sp { animation: pulse 1s infinite; }
.pbar { height: 4px; background: #dedede; border-radius: 4px; margin-top: 16px; overflow: hidden; }
.pfill { height: 100%; background: var(--text); width: 0; transition: width .45s ease; }
.plbl { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: right; }
.rescard { border: 1px solid var(--border); border-radius: 16px; padding: 24px; text-align: left; }
.badge { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.rtitle { font-size: 22px; font-weight: 600; margin-bottom: 10px; text-wrap: balance; }
.rdesc { font-size: 17px; line-height: 1.7; color: var(--muted); margin-bottom: 22px; text-wrap: pretty; }
.cta { display: block; width: 100%; padding: 13px 20px; background: var(--text); color: #ffffff; border: 0; border-radius: 999px; font-size: 17px; font-weight: 600; }
.cta:hover { background: #333333; }
.typing { display: flex; align-items: center; gap: 5px; min-height: 28px; padding: 8px 0; }
.td { width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: pulse 1s infinite; }
.td:nth-child(2) { animation-delay: .15s; }
.td:nth-child(3) { animation-delay: .3s; }
.inputbar { position: sticky; bottom: 0; z-index: 10; padding: 12px 24px max(24px, env(safe-area-inset-bottom)); background: var(--bg); }
.inputwrap { max-width: 768px; margin: auto; background: var(--surface); border-radius: 28px; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 24px; }
.inputwrap:focus-within { box-shadow: 0 0 0 1px #666; }
.inputwrap input { width: 100%; min-width: 0; min-height: 32px; flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-size: 18px; }
.inputwrap input::placeholder { color: var(--muted); }
.send { width: 36px; height: 36px; border-radius: 50%; background: var(--text); border: 0; color: #ffffff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.send:hover { background: #333333; }
.hid { display: none !important; }
.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .65); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 30; animation: fade .18s ease; }
.mcard { width: 100%; max-width: 420px; background: var(--bg); border-radius: 16px; padding: 28px; }
.mtitle { font-size: 24px; font-weight: 600; margin-bottom: 12px; text-wrap: balance; }
.mtext { font-size: 17px; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.mno { display: block; width: 100%; margin-top: 8px; padding: 12px; border-radius: 999px; background: none; border: 0; color: var(--text); font-size: 16px; }
.mno:hover { background: var(--hover); }
#btn-install { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); padding: 12px 24px; background: var(--text); color: #ffffff; border: 0; border-radius: 999px; font-size: 16px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 1100px) { .chat { padding-top: 64px; } }
@media (max-width: 600px) {
  .topbar { min-height: 56px; padding: 8px 12px; }
  .model-pill { font-size: 19px; }
  .chat { padding: 28px 20px 32px; gap: 24px; }
  .inputbar { padding: 10px 12px max(16px, env(safe-area-inset-bottom)); }
  .inputwrap { padding-left: 18px; }
  .bbl.u { max-width: 90%; }
  .rescard { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
