/* Google-search–style chat page. Loaded after style.css (admin keeps style.css only). */
:root {
  --g-blue: #4285f4;
  --g-red: #ea4335;
  --g-yellow: #fbbc05;
  --g-green: #34a853;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #202124;
  --muted: #70757a;
  --border: #dfe1e5;
  --pill: #f1f3f4;
  --shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
  --accent: #1a73e8;
  font-family: 'Google Sans', 'Product Sans', 'Segoe UI', Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202124;
    --surface: #303134;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --border: #5f6368;
    --pill: #303134;
    --shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    --accent: #8ab4f8;
  }
}

body { background: var(--bg); color: var(--text); }

/* ---------- logo ---------- */
.logo {
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
  margin: 0;
}
.logo .a { color: var(--g-blue); }
.logo .s { color: var(--g-red); }
.logo .k { color: var(--g-yellow); }
.logo.big { font-size: clamp(72px, 18vw, 120px); }
.logo.small { font-size: 30px; text-decoration: none; }

/* ---------- layout ---------- */
.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
}
.top button {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  color: var(--text);
}
.top button:hover { background: var(--pill); }

.hero { text-align: center; }
.hero p { color: var(--muted); margin: 14px 0 26px; font-size: 15px; }

/* ---------- search box (the one window) ---------- */
.searchbox {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 5px 6px 5px 16px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.searchbox:hover,
.searchbox:focus-within { box-shadow: var(--shadow); border-color: transparent; }
.searchbox .icon { flex: none; width: 20px; height: 20px; margin-bottom: 9px; color: var(--muted); }
.searchbox textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  padding: 8px 4px;
  min-height: 38px;
  max-height: 160px;
  font-size: 16px;
  line-height: 1.4;
}
.searchbox textarea:focus { outline: none; }
.searchbox button {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--g-blue);
}
.searchbox button:hover:not(:disabled) { background: var(--pill); }
.searchbox button svg { width: 22px; height: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.chips button {
  background: var(--pill);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text);
}
.chips button:hover { border-color: var(--border); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); }

.note { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 14px; }

/* ---------- messages ---------- */
#messages { flex: 1; overflow-y: auto; padding: 8px 2px 16px; display: flex; flex-direction: column; gap: 18px; }
.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--pill);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 20px 20px 4px 20px;
  white-space: pre-wrap;
}
.msg.assistant {
  align-self: stretch;
  background: none;
  border: 0;
  padding: 0 4px;
  border-radius: 0;
}

/* ---------- two states: home (empty) and chatting ---------- */
body.home .shell { justify-content: center; padding-bottom: 12vh; }
body.home .top,
body.home #messages { display: none; }
body.chatting .hero,
body.chatting .chips { display: none; }
body.chatting .searchbox { margin-bottom: 4px; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login form {
  width: 100%; max-width: 420px; display: grid; gap: 14px; text-align: center;
  background: none; border: 0; padding: 0;
}
.login input { border-radius: 24px; padding: 12px 18px; border: 1px solid var(--border); background: var(--surface); }
.login button.primary { justify-self: center; border-radius: 6px; background: var(--pill); color: var(--text); border: 1px solid transparent; padding: 9px 22px; }

/* links and the "searching the web" notice */
.msg.assistant a { color: var(--accent); text-decoration: none; }
.msg.assistant a:hover { text-decoration: underline; }
.msg.assistant .notice { color: var(--muted); }
