:root {
  --bg: #fffaf5;
  --panel: #ffffff;
  --sidebar: #fff3ea;
  --line: #f1dfd0;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #ff7a59;
  --secondary: #5b7cfa;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow: auto; background: var(--sidebar); border-right: 1px solid var(--line); padding: 22px; }
.brand-row { display:flex; align-items:center; gap:10px; margin-bottom: 18px; }
.brand { display: inline-block; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.1rem; }
.beta-badge { display:inline-flex; align-items:center; justify-content:center; padding:6px 10px; border-radius:999px; background:#fff; border:1px solid var(--line); color: var(--secondary); font-size: 0.72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.new-chat { width: 100%; border: 0; border-radius: 14px; padding: 12px 14px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; margin-bottom: 18px; }
.sidebar-section { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--secondary); font-weight: 700; margin-bottom: 10px; }
.chat-link { width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 12px; color: var(--muted); margin-bottom: 6px; cursor: pointer; }
.chat-link.active { background: #fff; color: var(--text); border: 1px solid var(--line); }
.main-area { display: grid; grid-template-rows: auto 1fr auto auto; min-width: 0; min-height: 100vh; }
.chat-topbar { position: sticky; top: 0; z-index: 25; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 28px; border-bottom: 1px solid var(--line); background: rgba(255,253,251,.96); backdrop-filter: blur(8px); }
.mode-badge { display: inline-block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--secondary); font-weight: 700; }
h1 { margin: 8px 0 0; font-size: 1.7rem; }
.parent-actions-cluster {
  display:flex; gap:8px; align-items:center; background: rgba(255,255,255,.9);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: 0 10px 24px rgba(31,41,55,.08);
}
.parent-pill {
  display:inline-flex; align-items:center; justify-content:center; text-decoration:none;
  border:0; border-radius:999px; padding:10px 14px; font-weight:700; background:#fff; color: var(--text); cursor:pointer;
}
.parent-pill.secondary {
  background: transparent; color: var(--muted); border: 1px solid transparent;
}
.messages { padding: 28px; max-width: 920px; width: 100%; margin: 0 auto; }
.message { display: flex; margin-bottom: 18px; }
.message.user { justify-content: flex-end; }
.message.ai { justify-content: flex-start; }
.bubble { max-width: 70%; padding: 14px 16px; border-radius: 18px; line-height: 1.7; white-space: normal; }
.message.user .bubble { background: var(--primary); color: #fff; }
.message.ai .bubble { background: #fff; border: 1px solid var(--line); }
.message.ai.typing .bubble::after {
  content: '▋';
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  animation: blink 1s step-end infinite;
}
.bubble p { margin: 0 0 10px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: 8px 0 10px 18px; padding: 0; }
.bubble li { margin: 0 0 6px; }
.prompt-row { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 28px 10px; max-width: 920px; width: 100%; margin: 0 auto; position: sticky; bottom: 86px; background: linear-gradient(180deg, rgba(255,250,245,0) 0%, rgba(255,250,245,.96) 30%, rgba(255,250,245,1) 100%); z-index: 20; transition: opacity .18s ease, transform .18s ease, max-height .18s ease, padding .18s ease; }
.prompt-row.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; max-height: 0; overflow: hidden; padding-top: 0; padding-bottom: 0; }
.prompt-row button { border: 1px solid var(--line); background: #fff; padding: 10px 14px; border-radius: 999px; cursor: pointer; color: var(--text); }
.composer-wrap { position: sticky; bottom: 0; padding: 10px 28px 18px; max-width: 920px; width: 100%; margin: 0 auto; background: linear-gradient(180deg, rgba(255,250,245,0) 0%, rgba(255,250,245,.96) 24%, rgba(255,250,245,1) 100%); z-index: 30; }
.composer { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 26px rgba(31,41,55,.08); }
.composer input { flex: 1; border: 0; outline: none; font: inherit; padding: 8px; }
.composer button { border: 0; background: var(--primary); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.composer-note { margin-top: 7px; color: var(--muted); font-size: 0.72rem; line-height: 1.35; text-align: center; opacity: .92; }
.scroll-bottom-btn {
  position: fixed; right: 18px; bottom: 110px; z-index: 35; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.94); color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 18px rgba(31,41,55,.10); align-items:center; justify-content:center;
}
.trial-modal {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); display:flex; align-items:center; justify-content:center; padding:20px; z-index:1000;
}
.trial-modal-card {
  width:min(420px, 100%); background:#fff; border:1px solid var(--line); border-radius:24px; padding:24px; box-shadow:0 20px 50px rgba(0,0,0,.18); text-align:center;
}
.trial-modal-card h2 { margin-top:0; margin-bottom:10px; }
.trial-modal-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:18px; }
.parent-link-btn { text-decoration:none; border:0; border-radius:12px; padding:12px 16px; font-weight:700; cursor:pointer; }
.parent-link-btn.primary { background: var(--primary); color:#fff; }
.parent-link-btn.secondary { background:#fff; color:var(--text); border:1px solid var(--line); }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } .sidebar { display: none; } .bubble { max-width: 85%; } }
