:root {
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #eff0f6;
  background: #101217;
  color-scheme: dark;
  --panel: #171b23;
  --line: #313848;
  --muted: #acb5c8;
  --accent: #baf5e2;
  --accent-text: #10251e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse 55rem 31rem at 50% 13rem, #1a2433, transparent); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: .6rem .9rem; font-weight: 650; white-space: nowrap; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid #97eacb; outline-offset: 3px; }
a { color: var(--accent); }
.top { height: 70px; display: flex; justify-content: space-between; align-items: center; padding: 0 clamp(1rem, 5vw, 4rem); border-bottom: 1px solid #2a3340; background: #101217bb; }
.brand { display: flex; gap: .7rem; align-items: center; text-decoration: none; color: inherit; font-size: 1.02rem; font-weight: 700; letter-spacing: .03em; }
.mark { width: 18px; height: 18px; border: 2px solid #90e7cb; border-radius: 50%; box-shadow: inset 0 0 8px #90e7cb70, 0 0 10px #90e7cb40; }
main { width: min(820px, 100% - 2rem); margin: 0 auto; padding: 2.35rem 0 1.25rem; }
.hero { text-align: center; margin-bottom: 1.75rem; }
.core { width: 144px; height: 144px; margin: 0 auto 1.1rem; position: relative; display: grid; place-items: center; }
.planet, .orbit { position: absolute; border-radius: 50%; }
.planet { width: 90px; height: 90px; background: radial-gradient(circle at 34% 25%, #f0fffe, #9efbd4 15%, #51b9af 41%, #31577a 68%, #181d38 88%); box-shadow: inset -6px -9px 18px #171632a0, 0 0 40px #73e4df58; transition: transform .3s; }
.orbit { width: 142px; height: 63px; border: 1px solid #9fe9d978; transform: rotate(-27deg); }
.orbit.two { transform: rotate(33deg); width: 136px; border-color: #9bbef755; }
.core[data-state="recording"] .planet, .core[data-state="speaking"] .planet { animation: breathe 1.35s ease-in-out infinite alternate; }
.core[data-state="working"] .one { animation: spin 3s linear infinite; }
@keyframes breathe { to { transform: scale(1.13); box-shadow: 0 0 56px #75e5c390; } }
@keyframes spin { from { transform: rotate(-27deg); } to { transform: rotate(333deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.signal { display: inline-flex; align-items: center; gap: .45rem; color: var(--accent); font-size: .82rem; }
.signal > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
h1 { margin: .26rem 0 .12rem; font-size: clamp(2.5rem, 8vw, 4rem); font-weight: 650; letter-spacing: -.07em; line-height: 1.1; }
.hero p, .foot { color: var(--muted); margin: .6rem 0 0; }
.card { padding: 1rem; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; }
#unlock { max-width: 440px; margin: auto; }
#unlock label { display: block; margin-bottom: .55rem; font-size: .9rem; }
.row { display: flex; align-items: stretch; gap: .65rem; }
.row input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; background: #10141d; color: inherit; }
.primary { background: var(--accent); color: var(--accent-text); }
.primary:hover:not(:disabled) { background: #d9fff1; }
.quiet, .mic { border-color: #3b465a; background: #1c2330; color: inherit; }
.quiet:hover:not(:disabled), .mic:hover:not(:disabled) { background: #273348; }
.toolbar, .compose-actions, .actions { display: flex; align-items: center; gap: .6rem; }
.toolbar, .compose-actions { justify-content: space-between; }
.toolbar { font-size: .9rem; font-weight: 650; padding: 0 0 .6rem; }
.history { min-height: 150px; max-height: 55vh; overflow: auto; border: 1px solid var(--line); background: #11151ed9; border-radius: 15px; padding: .95rem; overscroll-behavior: contain; }
.starter { text-align: center; color: var(--muted); padding: .25rem 0 .65rem; }
.message { background: #1b2230; border-radius: 12px; padding: .8rem .9rem; margin: 0 0 .7rem; overflow-wrap: anywhere; }
.message:last-child { margin-bottom: 0; }
.message.user { margin-left: clamp(0px, 6vw, 3rem); background: #20332f; }
.message header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--accent); font-size: .85rem; margin-bottom: .35rem; }
.message header button { font-size: .78rem; min-height: 36px; padding: .25rem .5rem; }
.message p { white-space: pre-wrap; line-height: 1.55; margin: .35rem 0; }
.message .meta { color: var(--muted); font-size: .82rem; }
.message a.inline { margin: 0 .13rem; font-weight: 650; }
.message details { color: var(--muted); margin-top: .65rem; font-size: .9rem; }
.message ol { padding-left: 1.5rem; margin-bottom: 0; }
.composer { margin-top: .75rem; }
textarea { display: block; width: 100%; resize: vertical; min-height: 4.2rem; max-height: 15rem; border: 0; background: #10141d; color: inherit; border-radius: 10px; padding: .8rem; line-height: 1.4; }
textarea::placeholder { color: #9ba6bc; }
.compose-actions { margin-top: .65rem; }
.mic { display: inline-flex; align-items: center; gap: .48rem; }
.mic[aria-pressed="true"] { color: #ffd4d6; border-color: #dd8c96; background: #432932; }
.mic-icon { height: 14px; width: 9px; border: 1.6px solid currentColor; border-radius: 7px; position: relative; margin: 0 .12rem .15rem; }
.mic-icon::after { content: ""; position: absolute; top: 6px; left: -4px; width: 13px; height: 9px; border: 1.5px solid currentColor; border-top: 0; border-radius: 0 0 8px 8px; }
.options { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: .8rem; color: var(--muted); font-size: .83rem; }
.options label { display: inline-flex; align-items: center; gap: .3rem; min-height: 28px; }
.options select { background: #10141d; border: 1px solid var(--line); border-radius: 6px; padding: .22rem; color: inherit; }
.options input { accent-color: var(--accent); }
.notice { padding: .55rem .7rem; border-radius: 8px; background: #452934; color: #ffdadf; margin: .6rem 0 0; font-size: .9rem; }
.foot { font-size: .78rem; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 540px) {
  .top { height: 56px; }
  main { padding-top: 1.2rem; }
  .hero { margin-bottom: 1rem; }
  .core { transform: scale(.82); margin-bottom: .25rem; }
  .history { max-height: 49vh; padding: .65rem; }
  .card { padding: .7rem; }
}
.model-card, .source-card { margin-bottom: 1.1rem; }
.source-card { margin-top: .9rem; }
.model-card summary, .source-card summary { cursor: pointer; font-weight: 650; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .85rem; }
.model-grid > div { display: grid; gap: .43rem; align-content: start; min-width: 0; }
.model-grid input { max-width: 100%; min-width: 0; }
.model-grid a, .source-card p { font-size: .88rem; }
.source-card input { max-width: 100%; }
@media (max-width: 540px) {
  .model-grid { grid-template-columns: 1fr; }
  .compose-actions { align-items: flex-start; }
}
.research-settings { display: grid; gap: .4rem; margin-top: .7rem; }
.research-settings input:not([type="checkbox"]) { width: 100%; padding: .55rem; border: 1px solid var(--line); border-radius: 8px; background: #10141d; color: inherit; }
