/* Replica Gemini mobile web, measured from iPhone 16 Pro screenshots (402pt wide). */
:root {
  --bg: #f9f9f9; --ink: #1f1f1f; --dim: #5f6368; --legal: #444746; --pill: #fff;
  --bubble: #f0eff0; --fab: #fff; --line: rgba(0,0,0,.08);
  --g1: #f9f9f9; --g2: #f1f7fc; --g3: #d1e7fb; --g4: #c3e3fc;
  --font: "Google Sans", "Google Sans Text", Roboto, -apple-system, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131314; --ink: #e3e3e3; --dim: #9aa0a6; --legal: #c4c7c5; --pill: #1e1f20;
    --bubble: #282a2c; --fab: #282a2c; --line: rgba(255,255,255,.1);
    --g1: #131314; --g2: #151a22; --g3: #17263c; --g4: #1a3050;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

#app { position: fixed; left: 0; right: 0; top: 0; height: 100%; display: flex; flex-direction: column;
  background: var(--bg); transition: background .45s ease; }
#app.empty {
  background:
    radial-gradient(90% 38% at 92% 100%, rgba(173,214,252,.55), rgba(173,214,252,0) 70%),
    linear-gradient(180deg, var(--g1) 0%, var(--g1) 38%, var(--g2) 55%, var(--g3) 85%, var(--g4) 100%);
}

/* ---- header ---- */
#hdr { flex: none; display: flex; align-items: center; gap: 0;
  height: calc(70px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 12px; }
.ib { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
#menu { margin-left: 0; }
#model { display: flex; align-items: center; gap: 0; margin-left: 12px; min-width: 0; flex: 0 1 auto;
  font-size: 18px; line-height: 24px; height: 44px; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; }
#model .gem { color: var(--ink); font-weight: 500; }
#model .ver { color: var(--dim); margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#model svg { flex: none; margin-left: 10px; color: var(--ink); }
#newchat { margin-left: auto; margin-right: 6px; }
#newchat[hidden] { display: none; }

/* ---- chat scroller ---- */
#chat { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; display: flex; flex-direction: column; position: relative; }
#hero { margin: auto 0; padding: 0 20px 150px; text-align: center; display: flex; flex-direction: column; align-items: center; }
#hero h1 { margin: 22px 0 0; font-weight: 400; font-size: 32px; line-height: 38px; letter-spacing: -.2px; color: var(--ink); }
.spark { display: block; width: 38px; height: 38px; flex: none;
  background: conic-gradient(from 25deg at 50% 50%, #ea4335 0deg, #4285f4 95deg, #4285f4 150deg, #34a853 200deg, #fbbc04 290deg, #ea4335 360deg);
  -webkit-mask: var(--star) center/100% 100% no-repeat; mask: var(--star) center/100% 100% no-repeat;
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.5 6.8 17.2 11.5 24 12 17.2 12.5 12.5 17.2 12 24 11.5 17.2 6.8 12.5 0 12 6.8 11.5 11.5 6.8 12 0Z'/%3E%3C/svg%3E"); }
#app:not(.empty) #hero { display: none; }
#app.empty #thread { display: none; }
#thread { padding: 6px 24px 190px; }

/* ---- messages ---- */
.me { display: flex; justify-content: flex-end; margin: 18px 0 34px 40px; padding-right: 8px; }
.me span { background: var(--bubble); border-radius: 32px; padding: 17px 28px; font-size: 18px; line-height: 26px;
  max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
.bot { font-size: 17px; line-height: 24px; }
.bot p { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.think { display: block; width: 26px; height: 26px; margin: 4px 0 16px; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; height: 32px; line-height: 24px; contain: layout style; }
.row .w { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acts { display: flex; gap: 12px; margin: 14px 0 12px -12px; color: var(--ink); }
.acts .ib { width: 36px; height: 36px; }
.bot .tail { font-size: 14px; color: var(--legal); margin: 4px 0 0; }

/* ---- dock: composer + legal ---- */
#dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 16px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none; }
#app:not(.empty) #dock { background: linear-gradient(to bottom, rgba(249,249,249,0), var(--bg) 42%); }
@media (prefers-color-scheme: dark) { #app:not(.empty) #dock { background: linear-gradient(to bottom, rgba(19,19,20,0), var(--bg) 42%); } }
#app.empty #dock { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
#app.kb #dock { padding-bottom: 8px; }
#dock > * { pointer-events: auto; }
#composer { display: flex; align-items: center; min-height: 80px; background: var(--pill); border-radius: 40px;
  padding: 0 14px 0 14px; box-shadow: 0 1px 2px rgba(60,64,67,.06), 0 2px 10px rgba(60,64,67,.05); }
#composer .ib { width: 46px; height: 46px; }
#ask { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink);
  font: 400 20px/28px var(--font); padding: 26px 8px 26px 10px; max-height: 168px; overflow-y: auto; caret-color: #0b57d0; }
#app:not(.empty) #ask { font-size: 17px; }
#ask::placeholder { color: #747775; opacity: 1; }
#send { color: #0b57d0; }
#legal { margin: 14px 0 0; text-align: center; font-size: 14px; line-height: 17px; color: var(--legal); }
#legal .ai { display: block; }
#legal .terms { display: block; }
#legal a { text-decoration: underline dotted; text-underline-offset: 3px; }
#app:not(.empty) #legal { margin-top: 12px; }
#app:not(.empty) #legal .terms { display: none; }
#app.kb #legal { display: none; }
#fab { position: absolute; left: 50%; top: -14px; transform: translate(-50%, -100%); width: 39px; height: 39px; border-radius: 50%;
  background: var(--fab); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
#fab[hidden] { display: none; }

/* ---- performer-only overlays ---- */
#setup, #card { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px;
  background: rgba(0,0,0,.28); }
#setup[hidden], #card[hidden] { display: none; }
#setupForm, .cardbox { width: 100%; max-width: 340px; background: var(--pill); border-radius: 28px; padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2); }
#setupForm h2 { margin: 0 0 14px; font-size: 22px; font-weight: 500; }
#setupForm label, .lab { display: block; font-size: 13px; color: var(--dim); margin-bottom: 12px; }
#setupForm input { display: block; width: 100%; margin-top: 6px; font: 400 18px var(--font); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: 0; }
.seg { display: flex; gap: 6px; margin: 6px 0 16px; }
.seg button { flex: 1; height: 42px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 16px; }
.seg button[aria-checked="true"] { background: #0b57d0; color: #fff; border-color: #0b57d0; }
.go { width: 100%; height: 48px; border-radius: 24px; background: #0b57d0; color: #fff; font-size: 16px; font-weight: 500; }
.alt { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.alt button { height: 40px; font-size: 14px; color: #0b57d0; border-radius: 20px; }
#sMsg { min-height: 18px; margin: 6px 0 0; font-size: 13px; color: #b3261e; text-align: center; }
.cardbox { padding: 20px; }
#cWord { font-size: 15px; color: var(--dim); margin-bottom: 10px; }
#cLetters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
#cLetters button { min-width: 40px; height: 44px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  font-size: 20px; text-transform: uppercase; }
#cLetters button.done { opacity: .4; }
#cLetters button.cur { background: #0b57d0; color: #fff; border-color: #0b57d0; opacity: 1; }
#cInfo { font-size: 13px; color: var(--dim); min-height: 18px; margin-bottom: 12px; }
.row2 { display: flex; gap: 8px; }
.row2 button { flex: 1; height: 42px; border-radius: 21px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }

@media (min-width: 560px) {
  #app { max-width: 560px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); }
}

[hidden] { display: none !important; }
