@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/plus-jakarta-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #19191d;
  --muted: #8d8d98;
  --faint: #b6b6bf;
  --line: #e6e6eb;
  --soft: #f5f5f7;
  --violet: #6d3cf3;
  --orange: #ef4e13;
}

* { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: relative;
  z-index: 30;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}
.brand {
  color: #18181b;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -.045em;
}
nav { display: flex; align-items: center; gap: 28px; color: #696973; font-size: 13px; }
nav a { transition: color .18s ease; }
nav a:hover { color: var(--ink); }
.github-link { padding: 9px 15px; border: 1px solid #dcdce2; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 650; }

.product-shell { height: calc(100% - 70px); background: #fff; }
.model-rail {
  position: relative;
  z-index: 20;
  height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
  overflow: hidden;
}
.model-rail-label, .model-rail-hint { color: #9b9ba5; font-size: 9px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.model-viewport { min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.model-track { display: flex; width: max-content; gap: 8px; animation: model-drift 42s linear infinite; }
.model-track:hover, .model-track:focus-within { animation-play-state: paused; }
@keyframes model-drift { to { transform: translateX(-50%); } }
.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 8px;
  border: 1px solid #e2e2e7;
  border-radius: 999px;
  background: #fff;
  color: #666670;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.model-chip:hover, .model-chip.active { border-color: #cfc9f6; background: #f7f5ff; color: #423b91; }
.model-logo {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #e4e4e9;
  border-radius: 6px;
  background: #fff;
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(24,24,32,.04);
  overflow: hidden;
}
.model-logo img { width: 14px; height: 14px; object-fit: contain; }
.model-logo.auto-mark { border-color: #25252a; background: #25252a; }
.model-chip small { color: #9b9ba5; font-size: 8px; }

.experience { position: relative; height: calc(100% - 52px); min-height: 520px; overflow: hidden; background: #fff; }
.conversation {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 58px max(24px, calc((100% - 780px) / 2)) 246px;
  scroll-behavior: smooth;
}
.turns { display: flex; width: min(780px,100%); margin: 0 auto; flex-direction: column; gap: 32px; }
.user-turn { align-self: flex-end; max-width: min(72%,560px); padding: 11px 15px; border-radius: 18px; background: #f1f1f2; color: #25252a; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.assistant-turn { align-self: flex-start; width: min(680px,100%); display: flex; align-items: flex-start; gap: 12px; color: #55555e; font-size: 13px; line-height: 1.65; }
.assistant-turn::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: #26262b; }
.assistant-turn.pending::before { border: 2px solid #dedee4; border-top-color: #222228; background: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.composer-wrap { position: absolute; z-index: 15; left: 50%; bottom: 28px; width: min(780px, calc(100% - 48px)); transform: translateX(-50%); }
.composer { position: relative; border: 1px solid #dcdce2; border-radius: 18px; background: rgba(255,255,255,.97); box-shadow: 0 16px 48px rgba(30,30,42,.12); backdrop-filter: blur(20px); }
.policy-bar { min-height: 58px; display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.policy-bar::-webkit-scrollbar { display: none; }
.policy-button { flex: 0 0 auto; height: 35px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: #888892; font-size: 12px; cursor: pointer; }
.policy-button:hover, .policy-button[aria-expanded="true"] { background: #f4f4f6; color: #4b4b53; }
.primary-policy { color: #3b3b41; font-weight: 680; }
.policy-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.policy-separator { flex: 0 0 auto; color: #c8c8ce; font-size: 12px; }
.provider-mark { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #e0e0e5; border-radius: 7px; background: #fff; color: #5d55cf; font-size: 8px; font-weight: 800; overflow: hidden; }
.provider-mark img { width: 16px; height: 16px; object-fit: contain; }
.auto-mark { background: #25252a; border-color: #25252a; color: #fff; }
.composer textarea { display: block; width: 100%; height: 96px; resize: none; padding: 20px 20px 8px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; line-height: 1.55; }
.composer textarea::placeholder { color: #b3b3bb; }
.composer-foot { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 6px 10px 10px; }
.icon-button, .submit-button { flex: 0 0 auto; display: grid; place-items: center; border: 0; cursor: pointer; }
.icon-button { width: 34px; height: 34px; border-radius: 9px; background: transparent; color: #8f8f98; }
.icon-button:hover { background: #f2f2f4; color: #494950; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.access-button { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--orange); cursor: pointer; }
.access-button:hover { background: #fff6f2; }
.access-button > span { width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; }
.access-button b { font-size: 11px; font-weight: 580; }
.local-state { margin-left: auto; color: #a1a1aa; font-size: 8.5px; }
.submit-button { width: 38px; height: 38px; margin-left: 4px; border-radius: 50%; background: #222227; color: #fff; transition: opacity .18s ease, transform .18s ease; }
.submit-button:hover:not(:disabled) { transform: translateY(-1px); }
.submit-button:disabled { opacity: .16; cursor: default; }
.submit-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.attachment-row { display: flex; gap: 7px; padding: 0 15px 6px; overflow-x: auto; }
.attachment-chip { flex: 0 0 auto; max-width: 190px; padding: 6px 9px; border: 1px solid #e4e4e8; border-radius: 8px; background: #f8f8f9; color: #74747d; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.model-menu { position: absolute; z-index: 30; left: 12px; bottom: calc(100% - 49px); width: min(470px, calc(100% - 24px)); border: 1px solid #dcdce2; border-radius: 14px; background: #fff; box-shadow: 0 22px 70px rgba(24,24,34,.17); overflow: hidden; }
.model-search { height: 51px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.model-search svg { width: 18px; height: 18px; fill: none; stroke: #92929b; stroke-width: 1.5; }
.model-search input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 12px; }
.model-options { max-height: 290px; padding: 7px; overflow-y: auto; }
.model-option { width: 100%; min-height: 48px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 7px 9px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.model-option:hover, .model-option.active { background: #f3f3f5; }
.model-option-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.model-option-copy strong { overflow: hidden; font-size: 10.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.model-option-copy small { color: #9797a0; font-size: 8.5px; }
.model-option > small { color: #8d8d97; font-size: 8px; white-space: nowrap; }

@media (max-width: 720px) {
  .site-header { padding: 0 18px; }
  nav { gap: 14px; font-size: 11px; }
  .github-link { padding: 8px 11px; }
  .model-rail { grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 0 18px; }
  .model-rail-hint { display: none; }
  .conversation { padding-inline: 18px; }
  .composer-wrap { bottom: 16px; width: calc(100% - 24px); }
  .local-state { display: none; }
  .policy-bar { padding-inline: 8px; }
  .policy-button { padding-inline: 7px; }
  .user-turn { max-width: 86%; }
}

@media (max-width: 500px) {
  .site-header { height: 62px; }
  .brand { font-size: 17px; }
  nav { gap: 10px; }
  nav a:nth-child(2) { display: none; }
  .product-shell { height: calc(100% - 62px); }
  .model-rail { height: 48px; }
  .experience { height: calc(100% - 48px); }
  .composer textarea { height: 88px; }
  .composer-wrap { width: calc(100% - 16px); }
}

@media (prefers-reduced-motion: reduce) {
  .model-track { animation: none; }
  * { scroll-behavior: auto !important; }
}
