/* Ventra: every style for index.html (moved out of the page on 12 Nov 2026, TODO.md #36).
   Later blocks override earlier ones: CHAT UI v2, UI v3, UI v4, then the ideas batches. */
:root{
  --text:#111111;
  --muted:#555555;
  --line:rgba(0,0,0,.12);
  --pink:#F3AAC0;
  --teal:#8FCFCF;
  --surface:rgba(255,255,255,.92);
  --bubble-bg:rgba(255,255,255,.85);
  --bubble-user:#f5bbcc;
  --bg-grad-a:#ffffff;
  --composer-bg:rgba(255,255,255,.97);
  --sidebar-bg:#f7f5f5;
  --modal-bg:rgba(255,255,255,.98);
  --card-bg:rgba(255,255,255,.85);
  --input-bg:rgba(255,255,255,.8);
  --btn-primary-bg:#1a1a1a;
  --btn-primary-text:#fff;
  --btn-primary-hover:#333;
  --toggle-track:rgba(0,0,0,.06);
  --toggle-active:#fff;
  --scroll-btn-bg:rgba(255,255,255,1);
  --ghost-color:#6c63ff;
  --error-bg:rgba(176,0,32,.07);
  --error-text:#b00020;
}

[data-theme="dark"]{
  --text:#ffffff;
  --muted:#a0a0a0;
  --line:rgba(255,255,255,.1);
  --pink:#9a4a62;
  --teal:#3a7878;
  --surface:rgba(42,38,42,.95);
  --bubble-bg:rgba(52,48,52,.9);
  --bubble-user:#6b3348;
  --bg-grad-a:#242024;
  --composer-bg:rgba(46,42,46,.98);
  --sidebar-bg:#1f1c1f;
  --modal-bg:rgba(38,34,38,.98);
  --card-bg:rgba(50,46,50,.88);
  --input-bg:rgba(58,54,58,.85);
  --btn-primary-bg:#f0eded;
  --btn-primary-text:#111111;
  --btn-primary-hover:#d4d0d0;
  --toggle-track:rgba(255,255,255,.08);
  --toggle-active:rgba(255,255,255,.3);
  --scroll-btn-bg:rgba(52,48,52,1);
  --ghost-color:#9d97ff;
  --error-bg:rgba(176,0,32,.2);
  --error-text:#ff7070;
}

/* ── Dark mode component overrides ─── */
[data-theme="dark"] .ghostBtn.active{ background:rgba(157,151,255,.15); }
[data-theme="dark"] .ghostBanner{ background:rgba(157,151,255,.1); border-bottom-color:rgba(157,151,255,.2); }
[data-theme="dark"] .plan-pro{ color:#d4a0b5; }
[data-theme="dark"] .plan-premium{ color:#7ecfcf; }
[data-theme="dark"] .msgAction.copied{ color:#4ade94; }
[data-theme="dark"] .badgeBtn:hover{ background:rgba(255,255,255,.08); }
[data-theme="dark"] .upgradeActionBtn:hover{ background:rgba(255,255,255,.08); }
[data-theme="dark"] .pricingCta:hover{ background:rgba(255,255,255,.08); }
/* Sidebar interactions */
[data-theme="dark"] .chatHistoryItem:hover{ background:rgba(255,255,255,.06); }
[data-theme="dark"] .chatHistoryItem.active{ background:rgba(255,255,255,.11); }
[data-theme="dark"] .chatHistoryItemMode{ background:rgba(255,255,255,.08); color:var(--muted); }
[data-theme="dark"] .chatHistoryItemAction:hover{ background:rgba(255,255,255,.1); color:var(--text); }
[data-theme="dark"] .newChatBtn:hover{ background:rgba(255,255,255,.06); }
/* Skeleton shimmer in dark */
[data-theme="dark"] .skeleton{ background:linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.11) 50%,rgba(255,255,255,.06) 75%); background-size:200% 100%; }
/* Misc */
[data-theme="dark"] .pricingBadge{ color:var(--text); }
[data-theme="dark"] .pill{ background:var(--bubble-bg); }
[data-theme="dark"] .msgAction:hover{ background:rgba(255,255,255,.1); }
/* Flat grey background — no pink/teal glow in dark mode */
[data-theme="dark"] body::before{ background:#242024; transition:none; }
[data-theme="dark"] body::after{ background:#242024; transition:none; }
/* Toggle slider — white-channel border so depth reads on dark surface */
[data-theme="dark"] .toggleSlider{ box-shadow:0 1px 4px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.12); }
/* Hover states that use black-channel (invisible on dark bg) */
[data-theme="dark"] .ghostBtn:hover{ background:rgba(255,255,255,.07); }
[data-theme="dark"] .sidebarToggle:hover{ background:rgba(255,255,255,.07); }
[data-theme="dark"] .sidebarFooterBtn:hover{ background:rgba(255,255,255,.06); }
/* Typing indicator dots */
[data-theme="dark"] .typingDots .dot{ background:rgba(255,255,255,.55); }
/* Input placeholder */
[data-theme="dark"] textarea::placeholder{ color:rgba(200,185,190,.68); }

*{
  box-sizing:border-box;
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

body{
  margin:0;
  color:var(--text);
  background:none;
  min-height:100dvh;
  position:relative;
}

body::before,
body::after{
  content:'';
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  transition:opacity .7s ease;
}

body::before{
  background:linear-gradient(to top, var(--pink) 0%, var(--bg-grad-a) 45%);
  opacity:1;
}

body::after{
  background:linear-gradient(to top, var(--teal) 0%, var(--bg-grad-a) 45%);
  opacity:0;
}

body.solution-mode::before{ opacity:0; }
body.solution-mode::after{  opacity:1; }

.wrap{
  max-width:980px;
  margin:0 auto;
  padding:18px 24px calc(170px + env(safe-area-inset-bottom, 0px));
}

.card{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:6px 0 14px;
  border-bottom:1px solid var(--line);
  background:transparent;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

.avatar{
  width:34px;
  height:34px;
  border-radius:10px;
  overflow:hidden;
  background:transparent;
  display:grid;
  place-items:center;
}

.avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

h1{ margin:0; font-size:18px; letter-spacing:.2px; font-family:'Dancing Script', cursive; font-weight:700; }
.sub{ color:var(--muted); font-size:12px; }

.pill{
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.65);
}

/* ── User badge ─────────────────────────── */
.userBadge{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.userEmail{
  font-size:12px;
  color:var(--muted);
  max-width:160px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.planChip{
  font-size:10px;
  font-weight:600;
  padding:3px 8px;
  border-radius:999px;
  text-transform:uppercase;
  letter-spacing:.3px;
}

.plan-basic   { background:var(--toggle-track);      color:var(--muted); }
.plan-pro     { background:rgba(243,170,192,.40);    color:#7a3050; }
.plan-premium { background:rgba(143,207,207,.40);    color:#1a5f5f; }

.badgeBtn{
  font-size:11px;
  color:var(--muted);
  border:1px solid var(--line);
  padding:5px 10px;
  border-radius:999px;
  background:var(--bubble-bg);
  cursor:pointer;
  font-family:inherit;
  transition:background .2s;
}

.badgeBtn:hover{ background:rgba(255,255,255,.95); }
.badgeBtn.danger{ color:var(--error-text); }
.badgeBtn.danger:hover{ background:rgba(192,57,43,.08); }

/* ── Usage bar ──────────────────────────── */
.usageBar{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 0 2px;
}

.usageText{
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
  min-width:120px;
}

.usageTrack{
  flex:1;
  height:3px;
  background:var(--line);
  border-radius:2px;
  overflow:hidden;
}

.usageFill{
  height:100%;
  background:var(--pink);
  border-radius:2px;
  transition:width .4s ease;
}

.upgradeLink{
  font-size:11px;
  color:var(--muted);
  background:none;
  border:none;
  cursor:pointer;
  font-family:inherit;
  padding:0;
  white-space:nowrap;
  text-decoration:underline;
  text-decoration-color:var(--line);
}

.upgradeLink:hover{ color:var(--text); }

/* ── Mode toggle ────────────────────────── */
.modebar{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  margin-top:18px;
}

.toggle{
  display:inline-flex;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--toggle-track);
  position:relative;
}

.toggleSlider{
  position:absolute;
  top:3px; bottom:3px;
  left:0; width:0;
  background:var(--toggle-active);
  border-radius:999px;
  box-shadow:0 1px 4px rgba(0,0,0,.10), inset 0 0 0 1px rgba(0,0,0,.08);
  transition:left 0.24s cubic-bezier(0.34,1.56,0.64,1), width 0.24s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events:none;
  z-index:0;
}

.toggle button{
  flex:0 0 auto;
  background:transparent;
  color:var(--muted);
  border:none;
  padding:10px 18px;
  cursor:pointer;
  font-size:13px;
  border-radius:999px;
  font-family:inherit;
  transition:color .2s;
  position:relative;
  z-index:1;
  white-space:nowrap;
}

.toggle button.active{
  color:var(--text);
}

.toggle button:disabled{
  opacity:.35;
  cursor:not-allowed;
}

.modeDesc{
  font-size:13px;
  color:var(--text);
  text-align:center;
}

/* ── Chat ───────────────────────────────── */
.chat{
  flex:1;
  overflow-y:auto;
  padding:20px max(24px, calc(50% - 390px));
  min-height:0;
  scrollbar-width:thin;
}

/* ── Loading skeleton ───────────────────── */
.skeletonWrap{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:20px 0;
}
.skeleton{
  border-radius:16px;
  background:linear-gradient(90deg, var(--line) 25%, rgba(0,0,0,.06) 50%, var(--line) 75%);
  background-size:200% 100%;
  animation:shimmer 1.4s infinite;
  min-height:40px;
}
@keyframes shimmer{
  from{ background-position:200% 0; }
  to{   background-position:-200% 0; }
}

/* ── Empty state ────────────────────────── */
.emptyState{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:48px 24px 16px;
  gap:20px;
  animation:msgSlideUp .3s ease both;
}
.emptyGreeting{
  margin:0;
  font-size:22px;
  font-weight:500;
  color:var(--text);
  letter-spacing:-.01em;
  text-align:center;
}
.emptyGreetingSub{
  margin:6px 0 0;
  font-size:14px;
  color:var(--muted);
  text-align:center;
}
.emptyPrompts{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  max-width:560px;
}
.emptyPrompt{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 16px;
  font-size:13px;
  color:var(--muted);
  cursor:pointer;
  font-family:inherit;
  transition:background .15s, color .15s, border-color .15s;
  text-align:left;
}
.emptyPrompt:hover{
  background:var(--bubble-bg);
  color:var(--text);
  border-color:rgba(243,170,192,.5);
}

.msg{
  width:100%;
  margin:12px 0;
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.role{
  min-width:78px;
  color:var(--muted);
  font-size:12px;
  padding-top:8px;
}

.msgBody{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  min-width:0;
}
.msg.user .msgBody{ align-items:flex-end; }

.bubble{
  width:fit-content;
  max-width:640px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid var(--line);
  line-height:1.45;
  background:var(--bubble-bg);
}

.msg.user{
  justify-content:flex-end;
  flex-direction:row;
}

.msg.bot .role{ display:none; }

.msg.user .role{
  min-width:auto;
  margin-left:10px;
  text-align:left;
}

.msg.user .bubble{
  background:var(--bubble-user);
  border-color:rgba(0,0,0,.08);
}

.bubble p{ margin:0 0 .55em; }
.bubble p:last-child{ margin-bottom:0; }
.bubble ul{ margin:.2em 0 .55em; padding-left:20px; }
.bubble ul:last-child{ margin-bottom:0; }
.bubble li{ margin:.15em 0; }
.bubble strong{ font-weight:600; }
.bubble em{ font-style:italic; }

/* ── Message actions (copy, regenerate, edit) ── */
.msgActions{
  display:flex;
  flex-direction:column;
  gap:3px;
  padding-top:10px;
  opacity:0;
  transition:opacity .15s;
  flex-shrink:0;
  width:28px;
}
.msg:hover .msgActions{ opacity:1; }
.msg.user .msgActions{ order:-1; }
.msgAction{
  background:none;
  border:none;
  cursor:pointer;
  padding:4px 5px;
  border-radius:6px;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .12s, color .12s;
}
.msgAction:hover{ background:rgba(0,0,0,.07); color:var(--text); }
.msgAction.copied{ color:#22a06b; }

/* ── Message timestamp ──────────────────── */
.msgTime{
  font-size:10.5px;
  color:var(--muted);
  opacity:0;
  margin-top:4px;
  transition:opacity .15s;
  text-align:right;
  padding-right:2px;
}
.msg.user .msgTime{ text-align:right; }
.msg.bot  .msgTime{ text-align:left; }
.msg:hover .msgTime{ opacity:.7; }

/* ── System / info messages in chat ─────── */
.msg.system{
  justify-content:center;
  margin:6px 0;
}
.msg.system .systemBubble{
  display:inline-flex;
  align-items:center;
  gap:8px;
  max-width:420px;
  padding:9px 14px;
  background:var(--surface);
  border:1px solid rgba(128,128,128,.18);
  border-radius:10px;
  font-size:13px;
  color:var(--muted);
  line-height:1.4;
}
.msg.system .systemBubble a,
.msg.system .systemBubble button.sysLink{
  font-weight:600;
  color:var(--btn-primary);
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
  font-size:inherit;
  text-decoration:underline;
}
[data-theme="dark"] .msg.system .systemBubble{
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.1);
}

/* ── Scroll-to-bottom button ────────────── */
#mainArea{ position:relative; }
.scrollToBottom{
  position:absolute;
  bottom:96px;
  left:50%;
  transform:translateX(-50%);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:999px;
  padding:5px 14px 5px 10px;
  font-size:12.5px;
  color:var(--muted);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:5px;
  box-shadow:0 2px 10px rgba(0,0,0,.1);
  font-family:inherit;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s;
  z-index:10;
}
.scrollToBottom.show{ opacity:1; pointer-events:auto; }
.scrollToBottom:hover{ background:var(--scroll-btn-bg); }

/* ── Composer ───────────────────────────── */
.composer{
  position:relative;
  width:100%;
  max-width:780px;
  margin:0 auto;
  display:flex;
  align-items:flex-end;
  gap:8px;
  background:var(--composer-bg);
  border:1.5px solid rgba(243,170,192,.3);
  border-radius:28px;
  padding:8px 8px 8px 20px;
  box-shadow:0 4px 24px rgba(243,170,192,.2), 0 1px 6px rgba(0,0,0,.05);
  backdrop-filter:blur(16px);
  transition:border-color .3s ease, box-shadow .3s ease;
}

.composer:focus-within{
  border-color:rgba(243,170,192,.65);
  box-shadow:0 4px 32px rgba(243,170,192,.32), 0 1px 6px rgba(0,0,0,.05), 0 0 0 5px rgba(243,170,192,.1);
}

.textarea-wrap{
  flex:1;
  display:flex;
  align-items:center;
  min-height:44px;
}

textarea{
  width:100%;
  min-height:44px;
  max-height:220px;
  height:44px;
  resize:none;
  border:none;
  outline:none;
  overflow-y:auto;
  background:transparent;
  color:var(--text);
  padding:11px 0;
  line-height:1.47;
  font-size:15px;
  font-family:inherit;
  scrollbar-width:none;
  transition:height .1s ease;
}

textarea::-webkit-scrollbar{ display:none; }
textarea::placeholder{ color:rgba(100,80,85,.65); }

.right{
  display:flex;
  align-items:flex-end;
  padding-bottom:2px;
}

.btn{
  width:40px;
  height:40px;
  border-radius:14px;
  border:none;
  background:var(--text);
  color:var(--surface);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  position:relative;
  overflow:hidden;
  transition:opacity .2s ease, transform .15s ease, background .2s ease;
}

.cancelBtn{ background:rgba(0,0,0,.15) !important; }
[data-theme="dark"] .cancelBtn{ background:rgba(255,255,255,.12) !important; }

/* ── Mic button ─────────────────────────── */
.micBtn{
  width:36px;
  height:36px;
  border-radius:12px;
  border:none;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  margin-bottom:2px;
  transition:background .15s, color .15s;
}
.micBtn:hover{ background:rgba(0,0,0,.06); color:var(--text); }
[data-theme="dark"] .micBtn:hover{ background:rgba(255,255,255,.08); }
.micBtn.recording{
  color:#e74c3c;
  background:rgba(231,76,60,.1);
  animation:micPulse 1.4s ease-in-out infinite;
}
[data-theme="dark"] .micBtn.recording{ background:rgba(231,76,60,.18); }
@keyframes micPulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(231,76,60,.35); }
  50%    { box-shadow:0 0 0 5px rgba(231,76,60,.0); }
}
.btn svg{ width:15px; height:15px; transition:transform .2s ease; }
.btn:not(:disabled):hover{ background:var(--muted); transform:scale(1.06); }
.btn:not(:disabled):hover svg{ transform:translateY(-1px); }
.btn:not(:disabled):active{ transform:scale(0.93); }
.btn:disabled{ opacity:.28; cursor:not-allowed; }

.footer{
  text-align:center;
  color:var(--muted);
  font-size:12px;
  line-height:1.3;
  padding:4px 0 0;
  max-width:780px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.kbdHint{
  font-size:11px;
  color:var(--muted);
  opacity:.7;
  display:none;
}
.kbdHint.show{ display:block; }

.modeRow{
  width:100%;
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
}

.modeRow .toggle{ margin:0 auto; }

.reportBtn{
  position:absolute;
  right:0;
  cursor:pointer;
  user-select:none;
  font-family:inherit;
}

.reportBtn:disabled{ opacity:.5; cursor:not-allowed; }
.reportBtn.locked{ opacity:.55; }

.warn{ color:var(--error-text); }

.typingLabel{
  font-size:11px;
  color:var(--muted);
  margin-bottom:4px;
  font-style:italic;
  opacity:.8;
}

/* ── Typing dots ────────────────────────── */
.typingDots{
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:flex-start;
  min-width:60px;
}

.typingDots .dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(0,0,0,.35);
  display:inline-block;
  animation:bounce 1.1s infinite ease-in-out;
}

.typingDots .dot:nth-child(2){ animation-delay:.15s; }
.typingDots .dot:nth-child(3){ animation-delay:.30s; }

@keyframes bounce{
  0%, 80%, 100% { transform:translateY(0); opacity:.35; }
  40% { transform:translateY(-6px); opacity:.9; }
}

/* ── Landing view ───────────────────────── */
.landingView{
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.landingWrap{
  max-width:760px;
  width:100%;
  position:relative;
}

.landingTop{
  position:absolute;
  top:-8px;
  right:0;
}

.landingHero{
  text-align:center;
  margin-bottom:36px;
  padding-top:40px;
}

.landingTitle{
  font-family:'Dancing Script', cursive;
  font-size:96px;
  font-weight:700;
  margin:0 0 12px;
  letter-spacing:0;
  line-height:1;
}

.landingTagline{
  font-size:18px;
  color:var(--text);
  margin:0 0 6px;
}

.landingSub{
  font-size:14px;
  color:var(--muted);
  margin:0;
}

.landingFeatures{
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:48px;
}

.featurePill{
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--line);
  padding:6px 12px;
  border-radius:999px;
  background:var(--bubble-bg);
}

/* ── Pricing ────────────────────────────── */
.pricingSection{ margin-bottom:36px; }
.billingToggleWrap{
  display:flex; justify-content:center; gap:0;
  margin:0 auto 28px; width:fit-content;
  background:var(--toggle-track); border-radius:999px; padding:4px;
}
.billingToggleBtn{
  padding:8px 20px; border:none; background:transparent;
  border-radius:999px; font-size:14px; font-weight:500;
  color:var(--muted); cursor:pointer; transition:all .18s;
  display:flex; align-items:center; gap:6px;
}
.billingToggleBtn.active{
  background:var(--toggle-active); color:var(--text);
  box-shadow:0 1px 4px rgba(0,0,0,.12);
}
.billingSaveBadge{
  font-size:11px; font-weight:600; color:#fff;
  background:var(--pink); border-radius:999px;
  padding:2px 7px; letter-spacing:.02em;
}
.pricingAnnualNote{
  font-size:12px; color:var(--muted); margin:-2px 0 8px;
  text-align:center; letter-spacing:.01em;
}
.pricingSavingsBadge{
  display:inline-flex; align-items:center; gap:4px;
  padding:4px 11px; border-radius:999px;
  font-size:11.5px; font-weight:700; letter-spacing:.05em;
  background:linear-gradient(120deg,#F3AAC0 0%,#C4A8DF 100%);
  color:var(--btn-primary-text);
  text-shadow:0 1px 2px rgba(120,70,160,.18);
  box-shadow:0 2px 14px rgba(196,168,224,.45), inset 0 1px 0 rgba(255,255,255,.28);
  opacity:0;
  transform:translateY(7px) scale(.92);
  transition:opacity .32s cubic-bezier(.34,1.56,.64,1),
             transform .32s cubic-bezier(.34,1.56,.64,1);
  position:relative; overflow:hidden;
  margin-bottom:6px;
}
.pricingSavingsBadge::after{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(105deg,transparent 30%,rgba(255,255,255,.38) 50%,transparent 70%);
  transform:translateX(-120%);
  transition:transform .65s ease;
}
.pricingSavingsBadge.visible{
  opacity:1;
  transform:translateY(0) scale(1);
}
.pricingSavingsBadge.visible::after{
  transform:translateX(120%);
}

.pricingTitle{
  text-align:center;
  font-size:20px;
  font-weight:600;
  margin:0 0 24px;
}

.pricingGrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
}

.pricingCard{
  background:var(--card-bg);
  border:1px solid var(--line);
  border-radius:20px;
  padding:24px;
  position:relative;
  display:flex;
  flex-direction:column;
  gap:6px;
  backdrop-filter:blur(8px);
  transition:transform 0.25s ease, box-shadow 0.25s ease;
}

.pricingCard:hover{
  transform:translateY(-5px);
  box-shadow:0 12px 32px rgba(243,170,192,.28);
}

.pricingFeatured:hover{
  box-shadow:0 12px 36px rgba(243,170,192,.45);
}

.pricingFeatured{
  border-color:rgba(243,170,192,.7);
  box-shadow:0 4px 24px rgba(243,170,192,.22);
}

.pricingBadge{
  position:absolute;
  top:-11px;
  left:50%;
  transform:translateX(-50%);
  background:var(--pink);
  font-size:10px;
  font-weight:700;
  padding:3px 10px;
  border-radius:999px;
  color:#555;
  letter-spacing:.3px;
  text-transform:uppercase;
  white-space:nowrap;
}

.pricingPlan{
  font-size:13px;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
}

.pricingPrice{
  font-size:30px;
  font-weight:300;
  color:var(--text);
  margin:4px 0 2px;
  letter-spacing:-.02em;
}

.pricingPrice span{
  font-size:14px;
  font-weight:400;
  color:var(--muted);
}

.pricingFeatureList{
  list-style:none;
  padding:0;
  margin:8px 0 16px;
  display:flex;
  flex-direction:column;
  gap:6px;
  flex:1;
}

.pricingFeatureList li{
  font-size:13px;
  color:var(--muted);
  padding-left:14px;
  position:relative;
}

.pricingFeatureList li::before{
  content:'•';
  position:absolute;
  left:0;
  color:var(--pink);
  font-weight:700;
}

.pricingCta{
  width:100%;
  padding:10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--bubble-bg);
  font-size:13px;
  cursor:pointer;
  font-family:inherit;
  color:var(--text);
  transition:background .2s;
  margin-top:auto;
}

.pricingCta:hover{ background:var(--surface); }

.pricingCtaPrimary{
  background:var(--btn-primary-bg);
  color:var(--btn-primary-text);
  border-color:transparent;
}

.pricingCtaPrimary:hover{ background:var(--btn-primary-hover); }

/* ── Trial CTA ──────────────────────────── */
.landingTrial{
  text-align:center;
  padding-top:8px;
}

.trialBtn{
  background:none;
  border:none;
  font-size:14px;
  color:var(--muted);
  cursor:pointer;
  font-family:inherit;
  text-decoration:underline;
  text-decoration-color:var(--line);
}

.trialBtn:hover{ color:var(--text); }

.trialNote{
  font-size:12px;
  color:var(--muted);
  margin:6px 0 0;
}

/* ── Modals ─────────────────────────────── */
.modalOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.28);
  backdrop-filter:blur(6px);
  z-index:200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.modalBox{
  background:var(--modal-bg);
  border-radius:24px;
  padding:32px;
  width:100%;
  max-width:400px;
  position:relative;
  border:1px solid var(--line);
  box-shadow:0 16px 48px rgba(0,0,0,.12);
}

.modalClose{
  position:absolute;
  top:14px;
  right:18px;
  background:none;
  border:none;
  font-size:22px;
  cursor:pointer;
  color:var(--muted);
  line-height:1;
  padding:4px;
  font-family:inherit;
}

.modalTitle{
  font-size:18px;
  font-weight:600;
  margin:0 0 16px;
}

/* Auth modal */
.modalTabs{
  display:flex;
  border:1px solid var(--line);
  border-radius:999px;
  overflow:hidden;
  margin-bottom:20px;
}

.modalTab{
  flex:1;
  background:transparent;
  border:none;
  padding:10px;
  font-size:13px;
  cursor:pointer;
  font-family:inherit;
  color:var(--muted);
}

.modalTab.active{
  background:var(--toggle-active);
  color:var(--text);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);
}

.authInput{
  width:100%;
  padding:12px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  font-size:14px;
  font-family:inherit;
  background:var(--input-bg);
  color:var(--text);
  outline:none;
  margin-bottom:10px;
  display:block;
  transition:border-color .2s, box-shadow .2s;
}

.authInput:focus{
  border-color:rgba(243,170,192,.7);
  box-shadow:0 0 0 3px rgba(243,170,192,.15);
}

.authPwWrap{
  position:relative;
  margin-bottom:0;
}
.authPwWrap .authInput{ margin-bottom:10px; padding-right:44px; }
.authPwToggle{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-60%);
  background:none;
  border:none;
  cursor:pointer;
  color:var(--muted);
  padding:4px;
  display:flex;
  align-items:center;
}
.authPwToggle:hover{ color:var(--text); }

.authForgotBtn{
  background:none;
  border:none;
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
  font-family:inherit;
  padding:6px 0 0;
  display:block;
  width:100%;
  text-align:center;
  transition:color .15s;
}
.authForgotBtn:hover{ color:var(--text); }

.authSubmitBtn{
  width:100%;
  padding:12px;
  background:var(--text);
  color:var(--surface);
  border:none;
  border-radius:999px;
  font-size:14px;
  font-family:inherit;
  cursor:pointer;
  margin-top:4px;
  transition:background .2s;
}

.authSubmitBtn:hover{ background:var(--muted); }
.authSubmitBtn:disabled{ opacity:.5; cursor:not-allowed; }

.authError{
  background:var(--error-bg);
  color:var(--error-text);
  border-radius:10px;
  padding:10px 14px;
  font-size:13px;
  margin-bottom:14px;
  line-height:1.4;
}

.authNote{
  font-size:12px;
  color:var(--muted);
  margin:0 0 12px;
  line-height:1.4;
}

.authSuccess{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  margin-top:16px;
  line-height:1.5;
}

/* Upgrade modal */
.upgradeMessage{
  font-size:14px;
  color:var(--muted);
  margin:0 0 20px;
  line-height:1.5;
}

.upgradeActions{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.upgradeActionBtn{
  padding:12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--bubble-bg);
  font-size:13px;
  cursor:pointer;
  font-family:inherit;
  color:var(--text);
  transition:background .2s;
}

.upgradeActionBtn:hover{ background:var(--surface); }

.upgradeActionBtn.primary{
  background:var(--btn-primary-bg);
  color:var(--btn-primary-text);
  border-color:transparent;
}

.upgradeActionBtn.primary:hover{ background:var(--btn-primary-hover); }

/* Toast notification */
.toast{
  position:fixed;
  bottom:calc(100px + env(safe-area-inset-bottom,0px));
  left:50%;
  transform:translateX(-50%) translateY(10px);
  background:var(--btn-primary-bg);
  color:var(--btn-primary-text);
  padding:10px 20px;
  border-radius:999px;
  font-size:13px;
  z-index:300;
  opacity:0;
  transition:opacity .3s ease, transform .3s ease;
  pointer-events:none;
  white-space:nowrap;
}

.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* ── App shell layout ───────────────────── */
#appView{
  height:100dvh;
  overflow:hidden;
}

/* ── Sidebar ────────────────────────────── */
#sidebar{
  width:240px;
  flex-shrink:0;
  height:100dvh;
  display:flex;
  flex-direction:column;
  background:var(--surface);
  backdrop-filter:blur(16px);
  border-right:1px solid var(--line);
  overflow:hidden;
  transition:transform .25s ease, width .25s ease;
  z-index:100;
}
#appView.sidebar-collapsed #sidebar{
  width:0;
  border-right:none;
}

.sidebarHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px 10px;
  flex-shrink:0;
  gap:8px;
}

.sidebarBrand{
  font-family:'Dancing Script', cursive;
  font-weight:700;
  font-size:26px;
  margin:0;
  color:var(--text);
}

.newChatBtn{
  display:flex;
  align-items:center;
  gap:5px;
  background:none;
  border:1px solid var(--line);
  border-radius:8px;
  padding:5px 9px;
  font-size:12px;
  cursor:pointer;
  color:var(--muted);
  font-family:inherit;
  transition:background .2s;
  white-space:nowrap;
  flex-shrink:0;
}
.newChatBtn:hover{ background:rgba(0,0,0,.06); }

.chatHistoryList{
  flex:1;
  overflow-y:auto;
  padding:4px 8px;
  scrollbar-width:thin;
}

.chatHistoryEmpty{
  font-size:12px;
  color:var(--muted);
  text-align:center;
  margin:24px 0;
  line-height:1.5;
}

.chatHistoryItem{
  display:block;
  width:100%;
  text-align:left;
  background:none;
  border:none;
  border-radius:8px;
  padding:8px 10px;
  cursor:pointer;
  font-family:inherit;
  transition:background .15s;
  margin-bottom:2px;
}
.chatHistoryItem:hover{ background:rgba(0,0,0,.06); }
.chatHistoryItem.active{ background:rgba(0,0,0,.09); }
.chatHistoryItemPreview{
  font-size:13px;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:block;
}
.chatHistoryItemMeta{
  display:flex;
  gap:6px;
  align-items:center;
  margin-top:3px;
}
.chatHistoryItemDate{ font-size:11px; color:var(--muted); }
.chatHistoryItemMode{
  font-size:10px;
  color:var(--muted);
  background:rgba(0,0,0,.07);
  border-radius:4px;
  padding:1px 5px;
  text-transform:capitalize;
}

.sidebarSearch{
  padding:6px 10px 2px;
  flex-shrink:0;
}
.sidebarSearchInput{
  width:100%;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(0,0,0,.04);
  color:var(--text);
  font-size:12.5px;
  font-family:inherit;
  outline:none;
  transition:border-color .15s;
}
[data-theme="dark"] .sidebarSearchInput{ background:rgba(255,255,255,.05); }
.sidebarSearchInput:focus{ border-color:rgba(243,170,192,.6); }
.sidebarSearchInput::placeholder{ color:var(--muted); }

.chatHistoryDateGroup{
  font-size:10px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
  padding:10px 10px 3px;
}
.chatHistoryDateGroup:first-child{ padding-top:3px; }

.chatHistoryItemWrap{
  position:relative;
}
.chatHistoryItemWrap:hover .chatHistoryItemPreview{
  padding-right:50px;
}
.chatHistoryItemActions{
  position:absolute;
  right:4px;
  top:50%;
  transform:translateY(-50%);
  display:flex;
  gap:1px;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s;
}
.chatHistoryItemWrap:hover .chatHistoryItemActions{
  opacity:1;
  pointer-events:auto;
}
.chatHistoryItemAction{
  background:none;
  border:none;
  cursor:pointer;
  padding:3px 6px;
  border-radius:4px;
  font-size:13px;
  color:var(--muted);
  font-family:inherit;
  line-height:1;
}
.chatHistoryItemAction:hover{ background:rgba(0,0,0,.1); color:var(--text); }

.chatHistoryRenameInput{
  width:100%;
  background:var(--surface);
  border:1px solid var(--accent,#8b7cf8);
  border-radius:5px;
  padding:1px 5px;
  font-size:13px;
  font-family:inherit;
  color:var(--text);
  outline:none;
}

.sidebarFooter{
  flex-shrink:0;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:4px;
}

.sidebarFooterBtn{
  background:none;
  border:none;
  padding:8px 10px;
  border-radius:8px;
  font-size:13px;
  color:var(--muted);
  cursor:pointer;
  font-family:inherit;
  text-align:left;
  width:100%;
  transition:background .2s;
}
.sidebarFooterBtn:hover{ background:rgba(0,0,0,.05); }
[data-theme="dark"] .sidebarFooterBtn:hover{ background:rgba(255,255,255,.05); }

/* ── User row ───────────────────────────── */
.userRowWrap{ position:relative; }

.userRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  transition:background .15s;
  user-select:none;
}
.userRow:hover{ background:rgba(0,0,0,.05); }
[data-theme="dark"] .userRow:hover{ background:rgba(255,255,255,.06); }

.userAvatar{
  width:32px; height:32px;
  border-radius:50%;
  background:var(--pink);
  color:#fff;
  font-size:13px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
[data-theme="dark"] .userAvatar{ background:#9a4a62; }

.userRowInfo{
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:1px;
}
.userRowName{
  font-size:13px; font-weight:500;
  color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.userRowChevron{ color:var(--muted); flex-shrink:0; }

/* ── User popover ───────────────────────── */
.userPopover{
  position:absolute;
  bottom:calc(100% + 6px);
  left:0; right:0;
  background:var(--modal-bg);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 8px 32px rgba(0,0,0,.16);
  z-index:200;
  padding:6px;
}
.popoverHeader{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px 10px;
}
.popoverAvatar{
  width:36px; height:36px; border-radius:50%;
  background:var(--pink); color:#fff;
  font-size:14px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
[data-theme="dark"] .popoverAvatar{ background:#9a4a62; }
.popoverHeaderInfo{ min-width:0; }
.popoverName{ font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.popoverPlanLine{ font-size:11px; color:var(--muted); margin-top:1px; }
.popoverDivider{ height:1px; background:var(--line); margin:4px 0; }
.popoverItem{
  display:flex; align-items:center; gap:10px;
  width:100%; padding:9px 10px;
  border:none; background:none; border-radius:8px;
  font-size:13px; color:var(--text);
  cursor:pointer; font-family:inherit; text-align:left;
  transition:background .12s;
}
.popoverItem:hover{ background:rgba(0,0,0,.05); }
[data-theme="dark"] .popoverItem:hover{ background:rgba(255,255,255,.06); }
.popoverItem svg{ flex-shrink:0; }

/* ── Settings modal ─────────────────────── */
.settingsBox{
  background:var(--modal-bg);
  border-radius:20px;
  width:100%; max-width:680px;
  max-height:min(580px, 85vh);
  position:relative;
  border:1px solid var(--line);
  box-shadow:0 16px 48px rgba(0,0,0,.14);
  display:flex; overflow:hidden;
}
.settingsNav{
  width:196px; flex-shrink:0;
  border-right:1px solid var(--line);
  padding:14px 8px;
  display:flex; flex-direction:column; gap:2px;
  overflow-y:auto;
}
.settingsNavHeading{
  font-size:15px; font-weight:600; color:var(--text);
  padding:4px 10px 12px; margin:0;
}
.settingsNavItem{
  display:flex; align-items:center; gap:10px;
  width:100%; padding:9px 10px;
  border:none; background:none; border-radius:8px;
  font-size:13px; color:var(--muted);
  cursor:pointer; font-family:inherit; text-align:left;
  transition:background .12s, color .12s;
}
.settingsNavItem:hover{ background:rgba(0,0,0,.05); color:var(--text); }
[data-theme="dark"] .settingsNavItem:hover{ background:rgba(255,255,255,.05); }
.settingsNavItem.active{ background:rgba(0,0,0,.07); color:var(--text); font-weight:500; }
[data-theme="dark"] .settingsNavItem.active{ background:rgba(255,255,255,.09); }
.settingsNavItem svg{ flex-shrink:0; }

.settingsContent{ flex:1; overflow-y:auto; min-width:0; }
.settingsPane{ padding:24px 28px; }
.settingsPaneTitle{
  font-size:16px; font-weight:600; color:var(--text);
  margin:0 0 20px; padding-bottom:14px;
  border-bottom:1px solid var(--line);
}

.settingsRow{ display:flex; flex-direction:column; gap:6px; margin-bottom:18px; }
.settingsRowBetween{
  flex-direction:row; align-items:center;
  justify-content:space-between; gap:16px;
}
.settingsRowBetween > div{ min-width:0; }
.settingsNameGrid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px; }

.settingsLabel{ font-size:13px; font-weight:500; color:var(--text); }
.settingsSub{ font-size:12px; color:var(--muted); line-height:1.4; margin-top:2px; }
.settingsValueText{ font-size:13px; color:var(--muted); }

.settingsInput{
  width:100%; padding:10px 14px;
  border:1px solid var(--line); border-radius:10px;
  font-size:13px; font-family:inherit;
  background:var(--input-bg); color:var(--text);
  outline:none; transition:border-color .2s, box-shadow .2s;
  box-sizing:border-box;
}
.settingsInput:focus{
  border-color:rgba(243,170,192,.7);
  box-shadow:0 0 0 3px rgba(243,170,192,.12);
}

.settingsDivider{ height:1px; background:var(--line); margin:6px 0 20px; }

.settingsSaveRow{ display:flex; align-items:center; gap:12px; margin-top:6px; }
.settingsSaveBtn{
  padding:9px 22px; border-radius:999px; border:none;
  background:var(--btn-primary-bg); color:var(--btn-primary-text);
  font-size:13px; font-family:inherit; cursor:pointer; font-weight:500;
  transition:background .2s;
}
.settingsSaveBtn:hover{ background:var(--btn-primary-hover); }
.settingsSaveBtn:disabled{ opacity:.5; cursor:not-allowed; }
.settingsSaveStatus{
  font-size:12px; color:var(--muted);
  opacity:0; transition:opacity .3s;
}
.settingsSaveStatus.show{ opacity:1; }

.settingsActionBtn{
  padding:8px 16px; border-radius:999px;
  border:1px solid var(--line); background:var(--bubble-bg);
  font-size:12px; cursor:pointer; font-family:inherit;
  color:var(--text); white-space:nowrap;
  transition:background .15s;
}
.settingsActionBtn:hover{ background:var(--surface); }
.settingsActionBtn.primary{
  background:var(--btn-primary-bg); color:var(--btn-primary-text); border-color:transparent;
}
.settingsActionBtn.primary:hover{ background:var(--btn-primary-hover); }
.settingsActionBtn.danger{ color:var(--error-text); border-color:rgba(176,0,32,.2); }
.settingsActionBtn.danger:hover{ background:rgba(176,0,32,.06); }

.settingsCloseBtn{
  position:absolute; top:14px; right:16px;
  background:none; border:none; font-size:20px;
  cursor:pointer; color:var(--muted);
  padding:4px 7px; border-radius:7px; line-height:1; z-index:1;
  font-family:inherit;
}
.settingsCloseBtn:hover{ background:rgba(0,0,0,.06); color:var(--text); }
[data-theme="dark"] .settingsCloseBtn:hover{ background:rgba(255,255,255,.06); }

@media (max-width:640px){
  .settingsBox{ flex-direction:column; border-radius:20px 20px 0 0; max-height:88vh; align-self:flex-end; }
  .settingsNav{
    width:100%; border-right:none; border-bottom:1px solid var(--line);
    flex-direction:row; padding:6px 8px; overflow-x:auto; gap:0;
  }
  .settingsNavHeading{ display:none; }
  .settingsNavItem{ padding:8px 12px; font-size:12px; flex-shrink:0; }
  .settingsNavItem svg{ display:none; }
  .settingsPane{ padding:18px 20px; }
  .settingsNameGrid{ grid-template-columns:1fr; }
}

/* ── Main area ──────────────────────────── */
#mainArea{
  flex:1;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  min-width:0;
}

.mainHeader{
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 16px 10px;
  border-bottom:1px solid var(--line);
  background:transparent;
}

.mainHeaderCenter{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

.mainHeaderSide{
  width:34px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.ghostBtn{
  background:none;
  border:none;
  cursor:pointer;
  padding:5px;
  border-radius:7px;
  color:var(--muted);
  display:flex;
  align-items:center;
  transition:background .15s, color .15s;
}
.ghostBtn:hover{ background:rgba(0,0,0,.06); color:var(--text); }
.ghostBtn.active{ color:var(--ghost-color); background:rgba(108,99,255,.1); }

.ghostBanner{
  display:none;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:11.5px;
  color:var(--ghost-color);
  background:rgba(108,99,255,.07);
  border-bottom:1px solid rgba(108,99,255,.15);
  padding:5px 16px;
  font-weight:500;
  letter-spacing:.01em;
}
.ghostBanner.show{ display:flex; }

.sidebarToggle{
  display:flex;
  background:none;
  border:none;
  cursor:pointer;
  padding:5px;
  border-radius:8px;
  color:var(--muted);
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  transition:background .2s;
}
.sidebarToggle:hover{ background:rgba(0,0,0,.06); }

.composerArea{
  flex-shrink:0;
  padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));
  background:transparent;
}

/* Sidebar overlay (mobile) */
#sidebarOverlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.3);
  z-index:99;
}

/* ── Animations ────────────────────────── */
@keyframes landingSlideUp{
  from{ opacity:0; transform:translateY(22px); }
  to{   opacity:1; transform:translateY(0);    }
}

.landingHero{
  animation:landingSlideUp 0.55s ease both;
}
.pricingTitle{
  animation:landingSlideUp 0.5s 0.08s ease both;
}
.pricingCard:nth-child(1){
  animation:landingSlideUp 0.5s 0.15s ease both;
}
.pricingCard:nth-child(2){
  animation:landingSlideUp 0.5s 0.24s ease both;
}
.pricingCard:nth-child(3){
  animation:landingSlideUp 0.5s 0.33s ease both;
}
.landingTrial{
  animation:landingSlideUp 0.5s 0.40s ease both;
}

@keyframes msgSlideUp{
  from{ opacity:0; transform:translateY(10px); }
  to{   opacity:1; transform:translateY(0);    }
}

.msg{
  animation:msgSlideUp 0.22s ease both;
}

@keyframes shake{
  0%,100%{ transform:translateX(0);  }
  20%    { transform:translateX(-7px); }
  40%    { transform:translateX(7px);  }
  60%    { transform:translateX(-4px); }
  80%    { transform:translateX(4px);  }
}

.shake{ animation:shake 0.38s ease; }

@keyframes blink{
  0%,100%{ opacity:1; }
  50%    { opacity:0; }
}

.bubble.streaming::after{
  content:'▋';
  animation:blink 0.75s step-end infinite;
  margin-left:1px;
}

@keyframes rippleAnim{
  from{ transform:scale(0); opacity:0.45; }
  to{   transform:scale(3.8); opacity:0;  }
}

.rippleSpan{
  position:absolute;
  inset:0;
  border-radius:50%;
  background:rgba(255,255,255,.45);
  transform:scale(0);
  animation:rippleAnim 0.45s ease-out forwards;
  pointer-events:none;
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  #sidebar{
    position:fixed;
    left:0;
    top:0;
    transform:translateX(-100%);
  }
  #sidebar.open{
    transform:translateX(0);
    box-shadow:4px 0 24px rgba(0,0,0,.12);
  }
  #sidebarOverlay.show{ display:block; }
  .sidebarToggle{ display:flex; }
  .mainHeaderSide{ width:36px; }
}

@media (max-width: 640px) {
  textarea{ resize:none; }
  .role{ min-width:44px; font-size:11px; }
  .toggle button{ padding:12px 20px; font-size:14px; }
  .modeRow{ flex-wrap:wrap; justify-content:center; }
  .reportBtn{ position:static; margin-top:4px; }
  .composerArea{ padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px)); }
  .chat{ padding:16px 14px; }
  .pricingGrid{ grid-template-columns:1fr; }
  .userEmail{ display:none; }
  .usageText{ min-width:auto; }
  .landingTitle{ font-size:64px; }
  .landingTagline{ font-size:16px; }
}

/* ══════════════════════════════════════════════════════════════════════
   CHAT UI v2 (9 Nov 2026): ChatGPT and Claude's layout, shaped for Ventra.
   A flat, calm background; one 768 px reading column; Ventra's replies as plain
   text, the person's words in a soft bubble; one composer card that holds the
   Vent / Solution switch (where ChatGPT and Claude keep their tools); a new chat
   centred like theirs, suggestions under the composer; a crisis line under it.
   Everything here overrides the older rules above. The landing page is untouched.
══════════════════════════════════════════════════════════════════════ */
:root{
  --app-bg:#fbf9f8;
  --app-sidebar:#f4f0ef;
  --user-bubble:#f7e4ea;
  --edge:rgba(0,0,0,.10);
  --hover:rgba(0,0,0,.05);
  --pressed:rgba(0,0,0,.08);
  --vent-ink:#b84a71;
  --solution-ink:#2b7a7a;
}
[data-theme="dark"]{
  --app-bg:#1f1d1e;
  --app-sidebar:#181617;
  --user-bubble:#3b2d33;
  --edge:rgba(255,255,255,.10);
  --hover:rgba(255,255,255,.06);
  --pressed:rgba(255,255,255,.10);
  --vent-ink:#eba3bb;
  --solution-ink:#8fd0d0;
  --composer-bg:#2a2729;
}

#appView{ background:var(--app-bg); }

/* Sidebar */
#sidebar{ width:260px; background:var(--app-sidebar); backdrop-filter:none; border-right:none; }
#appView.sidebar-collapsed #sidebar{ width:0; }
.sidebarHeader{ padding:14px 16px 6px; }
.newChatBtn{
  display:flex; align-items:center; gap:10px;
  margin:4px 8px 6px; padding:9px 10px;
  border:none; border-radius:10px; background:none;
  font-size:14px; color:var(--text); width:auto;
}
.newChatBtn:hover, [data-theme="dark"] .newChatBtn:hover{ background:var(--hover); }
.sidebarSearch{ padding:0 8px 6px; }
.sidebarLabel{ padding:12px 18px 4px; font-size:12px; color:var(--muted); font-weight:500; }
.chatHistoryList{ padding:0 8px 8px; }
.chatHistoryItem{ border-radius:10px; padding:8px 10px; }
.chatHistoryItem:hover{ background:var(--hover); }
.chatHistoryItem.active{ background:var(--pressed); }
.chatHistoryEmpty{ text-align:left; margin:6px 10px; }
.sidebarFooter{ border-top:none; }

/* The contents keep their width while the sidebar opens and closes, so the
   text is clipped as it slides instead of rewrapping one letter per line */
.sidebarInner{ width:260px; flex:1; min-height:0; display:flex; flex-direction:column; }
@media (min-width:769px){
  .sidebarInner{ transition:visibility 0s; }
  #appView.sidebar-collapsed .sidebarInner{ visibility:hidden; transition:visibility 0s .25s; }
}

/* Search: a flat row lined up with New chat, like theirs */
.sidebarSearchInput,
[data-theme="dark"] .sidebarSearchInput{
  border:none; border-radius:10px; padding:9px 10px 9px 36px; font-size:14px;
  background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23908a8c' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center;
}
.sidebarSearchInput:hover, .sidebarSearchInput:focus{ background-color:var(--hover); }

/* Chats: one line per chat, titles only; ⋯ on hover (always on touch)
   opens Rename / Delete */
.chatHistoryItemWrap{ position:relative; margin-bottom:1px; }
.chatHistoryItem{ display:flex; align-items:center; min-height:36px; margin:0; padding:8px 10px; }
.chatHistoryItemPreview{ flex:1; min-width:0; font-size:14px; line-height:20px; }
.chatHistoryItemPreview::first-letter{ text-transform:uppercase; }
.chatHistoryItemWrap:hover .chatHistoryItemPreview,
.chatHistoryItemWrap.menuOpen .chatHistoryItemPreview,
.chatHistoryItem.active .chatHistoryItemPreview{ padding-right:26px; }
.chatHistoryItemWrap.menuOpen .chatHistoryItem{ background:var(--hover); }
.chatMoreBtn{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:28px; height:28px; display:flex; align-items:center; justify-content:center;
  border:none; border-radius:8px; background:none; color:var(--muted);
  cursor:pointer; opacity:0;
}
.chatHistoryItemWrap:hover .chatMoreBtn,
.chatHistoryItemWrap.menuOpen .chatMoreBtn,
.chatHistoryItem.active ~ .chatMoreBtn,
.chatMoreBtn:focus-visible{ opacity:1; }
.chatMoreBtn:hover{ color:var(--text); background:var(--pressed); }
@media (hover:none){
  .chatMoreBtn{ opacity:1; }
  .chatHistoryItemPreview{ padding-right:26px; }
}
.chatMenu{
  position:fixed; z-index:300; min-width:150px; padding:5px;
  background:var(--modal-bg); border:1px solid var(--edge); border-radius:12px;
  box-shadow:0 8px 28px rgba(0,0,0,.16);
}
.chatMenu button{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:8px 10px; border:none; border-radius:8px; background:none;
  font:inherit; font-size:14px; color:var(--text); cursor:pointer; text-align:left;
}
.chatMenu button:hover, .chatMenu button:focus-visible{ background:var(--hover); outline:none; }
.chatMenu button.danger{ color:#c8443a; }
[data-theme="dark"] .chatMenu button.danger{ color:#f28b82; }

/* Account row: the plan as quiet text under the name, not a stretched pill */
.userRowInfo .planChip{
  align-self:flex-start; background:none; padding:0;
  font-size:12px; font-weight:400; letter-spacing:0; text-transform:none;
  color:var(--muted);
}

/* Header: the menu on the left; the report, sign-in and temporary chat on the right */
.mainHeader{ border-bottom:none; padding:10px 14px; min-height:56px; }
.mainHeaderSide{ width:auto; gap:6px; }
.reportBtn{
  position:static; background:transparent; border:1px solid var(--edge);
  color:var(--text); font-size:13px; padding:6px 12px; cursor:pointer;
}
.reportBtn:hover:not(:disabled){ background:var(--hover); }
.hdrAuth{ display:none; align-items:center; gap:6px; }
.hdrBtn{
  font-family:inherit; font-size:14px; font-weight:500; cursor:pointer;
  padding:7px 14px; border-radius:999px; border:1px solid var(--edge);
  background:transparent; color:var(--text); white-space:nowrap;
}
.hdrBtn:hover{ background:var(--hover); }
.hdrBtn.primary{ background:var(--btn-primary-bg); color:var(--btn-primary-text); border-color:transparent; }
.hdrBtn.primary:hover{ background:var(--btn-primary-hover); }
.ghostBtn{ padding:7px; border-radius:10px; }

/* The conversation: one 768 px column */
.chat{ padding:24px max(20px, calc(50% - 384px)) 40px; }
.msg{ margin:0 0 20px; flex-direction:column; align-items:stretch; gap:2px; }
.msg.user{ align-items:flex-end; flex-direction:column; }
.msg .role, .msg.user .role{ display:none; }
.msgBody{ width:100%; }
.bubble{
  max-width:100%; width:100%; padding:0; border:none; border-radius:0;
  background:none; font-size:16px; line-height:1.7;
}
.msg.user .bubble{
  width:fit-content; max-width:min(80%, 560px);
  background:var(--user-bubble); border:none; border-radius:22px;
  padding:10px 18px; line-height:1.55;
}
.bubble.typingDots{ width:auto; padding:8px 0; }
.typingLabel{ margin-bottom:2px; }
.msgActions{ flex-direction:row; width:auto; padding:0; gap:2px; margin-left:-5px; }
.msg.user .msgActions{ order:0; align-self:flex-end; margin:0 -5px 0 0; }
.msgAction{ padding:6px; border-radius:8px; }
.msgAction:hover{ background:var(--hover); }
.msgTime{ margin-top:2px; }
@media (hover:none){ .msgActions{ opacity:.7; } }

/* Notes from Ventra (plan limits, the trial): calm and centred, links inline */
.msg.system{ align-items:center; margin:4px 0 22px; }
.msg.system .systemBubble,
[data-theme="dark"] .msg.system .systemBubble{
  display:block; max-width:560px; text-align:center;
  background:transparent; border:1px solid var(--edge); border-radius:14px;
  padding:10px 16px; font-size:13px; line-height:1.55;
}
.msg.system .systemBubble a,
.msg.system .systemBubble button.sysLink{ color:var(--text); font-weight:500; text-underline-offset:2px; }

/* A new chat: the greeting and the composer centred together */
.emptyState{ padding:0 0 4px; gap:6px; }
.emptyGreeting{ font-size:28px; font-weight:500; letter-spacing:-.02em; }
.emptyGreetingSub{ font-size:15px; margin:0; }
#mainArea.isEmpty .chat{ flex:0 0 auto; margin-top:auto; overflow:visible; padding-top:0; padding-bottom:18px; }
#mainArea.isEmpty .composerArea{ margin-bottom:auto; padding-bottom:12vh; }
.emptyExtras{ display:none; width:100%; max-width:768px; margin:14px auto 0; }
#mainArea.isEmpty .emptyExtras{ display:block; }
.emptyPrompts{ max-width:none; gap:8px; justify-content:center; }
.emptyPrompt{
  background:transparent; border:1px solid var(--edge); border-radius:999px;
  padding:8px 14px; font-size:14px; color:var(--muted);
}
.emptyPrompt:hover{ background:var(--hover); color:var(--text); border-color:var(--edge); }

/* The composer: one card, the words on top, the switch and buttons underneath */
.composerArea{ display:flex; flex-direction:column; padding:0 16px calc(10px + env(safe-area-inset-bottom,0px)); }
.composer{
  max-width:768px; flex-direction:column; align-items:stretch; gap:4px;
  background:var(--composer-bg); border:1px solid var(--edge); border-radius:26px;
  padding:8px 10px 8px; box-shadow:0 2px 12px rgba(0,0,0,.05); backdrop-filter:none;
}
.composer:focus-within{ border-color:var(--edge); box-shadow:0 2px 16px rgba(0,0,0,.09); }
[data-theme="dark"] .composer, [data-theme="dark"] .composer:focus-within{ box-shadow:0 2px 16px rgba(0,0,0,.3); }
.textarea-wrap{ min-height:0; padding:0 8px; }
textarea{ font-size:16px; line-height:1.5; padding:10px 0; }
textarea::placeholder{ color:var(--muted); opacity:.8; }
.composerBar{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.right{ align-items:center; padding:0; gap:4px; }
.micBtn{ width:36px; height:36px; border-radius:50%; margin:0; }
.btn{ width:36px; height:36px; border-radius:50%; }
.btn:not(:disabled):hover{ transform:none; }
.composer .toggle{ border:none; background:var(--toggle-track); }
.composer .toggle button{ padding:7px 14px; font-size:13px; font-weight:500; }
.composer .toggle button.active[data-mode="vent"]{ color:var(--vent-ink); }
.composer .toggle button.active[data-mode="solution"]{ color:var(--solution-ink); }
[data-theme="dark"] .composer .toggleSlider{ background:rgba(255,255,255,.12); box-shadow:none; }
.footer{ max-width:768px; padding-top:8px; font-size:12px; line-height:1.45; }
.footer a{ color:inherit; text-decoration:underline; text-underline-offset:2px; }
.scrollToBottom{
  width:34px; height:34px; padding:0; gap:0; font-size:0;
  border-radius:50%; justify-content:center; bottom:150px;
}

@media (max-width: 640px) {
  .chat{ padding:16px 16px 28px; }
  .msg.user .bubble{ max-width:88%; }
  .hdrBtn:not(.primary){ display:none; }
  .hdrBtn{ font-size:13px; padding:6px 12px; }
  /* Phones keep the composer at the bottom (the keyboard opens there) and the
     greeting in the middle; suggestions scroll sideways above the composer */
  #mainArea.isEmpty .chat{ flex:1 1 auto; margin-top:0; display:flex; flex-direction:column; justify-content:center; }
  #mainArea.isEmpty .composerArea{ margin-bottom:0; padding-bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
  .emptyExtras{ order:-1; margin:0 auto 10px; }
  .emptyPrompts{ flex-wrap:nowrap; justify-content:flex-start; overflow-x:auto; scrollbar-width:none; padding:0 2px 2px; }
  .emptyPrompts::-webkit-scrollbar{ display:none; }
  .emptyPrompt{ flex:0 0 auto; white-space:nowrap; font-size:13px; }
  .scrollToBottom{ bottom:140px; }
  .kbdHint, .kbdHint.show{ display:none; }
}

/* ══════════════════════════════════════════════════════════════════════
   UI v3 (12 Nov 2026): the finish. ChatGPT and Claude's structure for the
   header, the account menu, Settings and dialogs, in Ventra's colours: quiet
   surfaces, hairline edges, one radius family (10 / 16 / 20), real focus rings.
   Overrides the rules above.
══════════════════════════════════════════════════════════════════════ */
:root{
  --focus-ring:rgba(184,74,113,.55);
  --tip-bg:#262224; --tip-text:#fff;
  --danger:#c8443a; --danger-edge:rgba(200,68,58,.35); --danger-bg:rgba(200,68,58,.08);
}
[data-theme="dark"]{
  --focus-ring:rgba(235,163,187,.65);
  --tip-bg:#f4f0ef; --tip-text:#1f1d1e;
  --danger:#f28b82; --danger-edge:rgba(242,139,130,.4); --danger-bg:rgba(242,139,130,.1);
}
:focus-visible{ outline:2px solid var(--focus-ring); outline-offset:2px; }
textarea:focus-visible, .settingsInput:focus-visible, .sidebarSearchInput:focus-visible{ outline:none; }

/* Header: the sidebar button, New chat when the sidebar is closed, the chat's title */
.mainHeader{ gap:2px; }
.hdrIconBtn, .sidebarToggle.hdrIconBtn, .ghostBtn.hdrIconBtn{
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  width:36px; height:36px; padding:0; border:none; border-radius:10px;
  background:none; color:var(--muted); cursor:pointer;
}
.hdrIconBtn:hover, [data-theme="dark"] .hdrIconBtn:hover{ background:var(--hover); color:var(--text); }
#hdrNewChat{ display:none; }
#appView.sidebar-collapsed #hdrNewChat{ display:flex; }
.hdrTitle{
  display:flex; align-items:center; gap:4px; min-width:0; max-width:min(40vw, 420px);
  height:36px; margin-left:2px; padding:0 8px 0 10px; border:none; border-radius:10px;
  background:none; color:var(--text); font:inherit; font-size:15px; font-weight:500; cursor:pointer;
}
.hdrTitle[hidden]{ display:none; }
.hdrTitle span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hdrTitle svg{ flex-shrink:0; color:var(--muted); }
.hdrTitle:hover{ background:var(--hover); }
.ghostBtn.hdrIconBtn.active{ color:var(--ghost-color); background:rgba(108,99,255,.1); }

/* Tooltips for icon-only buttons (mouse only) */
[data-tip]{ position:relative; }
@media (hover:hover){
  [data-tip]:hover::after{
    content:attr(data-tip); position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%);
    padding:5px 9px; border-radius:8px; background:var(--tip-bg); color:var(--tip-text);
    font-size:12px; font-weight:500; line-height:1.2; letter-spacing:0; white-space:nowrap;
    pointer-events:none; z-index:400; animation:tipIn .12s ease .4s both;
  }
  [data-tip-end]:hover::after{ left:auto; right:0; transform:none; }
  .sidebarToggle[data-tip]:hover::after{ left:0; transform:none; }
  .msgAction[data-tip]:hover::after{ top:auto; bottom:calc(100% + 6px); }
}
@keyframes tipIn{ from{ opacity:0; } to{ opacity:1; } }

/* Message actions */
.msgAction{ padding:6px; border-radius:8px; }
.msgAction:hover, [data-theme="dark"] .msgAction:hover{ background:var(--hover); color:var(--text); }
.msgAction.speaking{ color:var(--vent-ink); }

/* The composer: a touch more depth */
.composer{ border-radius:28px; box-shadow:0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06); }
.composer:focus-within{ box-shadow:0 1px 2px rgba(0,0,0,.05), 0 10px 32px rgba(0,0,0,.09); }

/* Sidebar footer: the account row, or a card for people without an account */
.sidebarFooter{ padding:8px 8px calc(10px + env(safe-area-inset-bottom,0px)); }
.userRow{ border-radius:12px; padding:8px; }
.userRow:hover, [data-theme="dark"] .userRow:hover{ background:var(--hover); }
.guestCard{ margin:0 4px; padding:14px; border:1px solid var(--edge); border-radius:16px; }
.guestTitle{ margin:0 0 4px; font-size:14px; font-weight:600; color:var(--text); }
.guestText{ margin:0 0 10px; font-size:13px; line-height:1.45; color:var(--muted); }
.guestBtn{
  display:block; width:100%; margin-top:6px; padding:9px 12px; border:1px solid var(--edge); border-radius:999px;
  background:transparent; color:var(--text); font:inherit; font-size:14px; font-weight:500; cursor:pointer;
}
.guestBtn:hover{ background:var(--hover); }
.guestBtn.primary{ background:var(--btn-primary-bg); color:var(--btn-primary-text); border-color:transparent; }
.guestBtn.primary:hover{ background:var(--btn-primary-hover); }
.guestSettings{
  display:flex; align-items:center; gap:8px; width:100%; margin-top:12px; padding:10px 2px 0;
  border:none; border-top:1px solid var(--edge); background:none; color:var(--muted);
  font:inherit; font-size:13px; cursor:pointer;
}
.guestSettings:hover{ color:var(--text); }

/* The account menu, like ChatGPT's */
.userPopover, [data-theme="dark"] .userPopover{
  bottom:calc(100% + 8px); padding:6px; border-radius:16px; border:1px solid var(--edge);
  background:var(--modal-bg); box-shadow:0 12px 40px rgba(0,0,0,.16);
}
.popoverHeader{ padding:8px 10px; }
.popoverDivider{ margin:6px 4px; background:var(--edge); }
.popoverItem{ font-size:14px; border-radius:10px; text-decoration:none; box-sizing:border-box; }
.popoverItem:hover, [data-theme="dark"] .popoverItem:hover{ background:var(--hover); }
.popoverItem svg{ flex-shrink:0; color:var(--muted); }
.popoverChev{ margin-left:auto; transition:transform .15s ease; }
#popoverHelpBtn[aria-expanded="true"] .popoverChev{ transform:rotate(90deg); }
.popoverSub{ padding-left:26px; }
.popoverSub[hidden]{ display:none; }
.popoverSub .popoverItem{ padding:7px 10px; font-size:13.5px; color:var(--muted); }
.popoverSub .popoverItem:hover{ color:var(--text); }

/* A plan that's ending: a calm note */
.endingNote{ margin:8px; padding:12px; border:1px solid var(--edge); border-radius:14px; font-size:13px; line-height:1.45; color:var(--muted); }
.endingTitle{ display:block; margin-bottom:3px; color:var(--text); font-weight:600; }
.endingBtn{
  margin-top:8px; padding:6px 12px; border:1px solid var(--edge); border-radius:999px;
  background:transparent; color:var(--text); font:inherit; font-size:13px; font-weight:500; cursor:pointer;
}
.endingBtn:hover{ background:var(--hover); }

/* Settings: the layout ChatGPT and Claude use, rows with hairlines between */
.settingsBox, [data-theme="dark"] .settingsBox{
  width:100%; max-width:760px; height:min(620px, 86vh); max-height:none;
  border-radius:20px; border:1px solid var(--edge); background:var(--modal-bg);
  box-shadow:0 24px 64px rgba(0,0,0,.2);
}
.settingsNav{ width:208px; padding:16px 10px; border-right:1px solid var(--edge); background:var(--app-sidebar); }
.settingsNavHeading{ padding:2px 10px 14px; font-size:16px; }
.settingsNavItem, [data-theme="dark"] .settingsNavItem{ padding:9px 10px; border-radius:10px; font-size:14px; color:var(--text); }
.settingsNavItem svg{ color:var(--muted); }
.settingsNavItem:hover, [data-theme="dark"] .settingsNavItem:hover{ background:var(--hover); color:var(--text); }
.settingsNavItem.active, [data-theme="dark"] .settingsNavItem.active{ background:var(--pressed); font-weight:500; }
#settingsModal.signedOut .needsAccount{ display:none; }
.guestOnly{ display:none; }
#settingsModal.signedOut .guestOnly{ display:block; }
.settingsContent{ position:relative; }
.settingsPane{ padding:22px 28px 28px; }
.settingsPane[hidden]{ display:none; }
.settingsPaneTitle{ margin:0 0 4px; padding:2px 44px 14px 0; font-size:18px; font-weight:600; border-bottom:1px solid var(--edge); }
.settingsCloseBtn, [data-theme="dark"] .settingsCloseBtn{
  top:16px; right:16px; width:34px; height:34px; padding:0;
  display:flex; align-items:center; justify-content:center; border-radius:10px; color:var(--muted);
}
.settingsCloseBtn:hover, [data-theme="dark"] .settingsCloseBtn:hover{ background:var(--hover); color:var(--text); }
.setRow{ display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 0; border-bottom:1px solid var(--edge); }
.setText{ min-width:0; }
.setLabel{ display:block; font-size:14px; font-weight:500; color:var(--text); }
.setSub{ margin-top:3px; font-size:13px; line-height:1.45; color:var(--muted); }
.setValue{ font-size:14px; color:var(--muted); text-align:right; overflow-wrap:anywhere; }
.setSelect{
  -webkit-appearance:none; appearance:none; flex-shrink:0; min-width:150px; max-width:220px;
  padding:8px 34px 8px 12px; border:1px solid var(--edge); border-radius:10px; cursor:pointer;
  background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23908a8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color:var(--text); font:inherit; font-size:14px;
}
.setSelect:hover{ background-color:var(--hover); }
.setSelect option{ background:var(--app-bg); color:var(--text); }
.setBtn{
  flex-shrink:0; padding:8px 16px; border:1px solid var(--edge); border-radius:999px;
  background:transparent; color:var(--text); font:inherit; font-size:14px; font-weight:500;
  white-space:nowrap; cursor:pointer;
}
.setBtn:hover{ background:var(--hover); }
.setBtn:disabled{ opacity:.5; cursor:default; }
.setBtn.primary{ background:var(--btn-primary-bg); color:var(--btn-primary-text); border-color:transparent; }
.setBtn.primary:hover{ background:var(--btn-primary-hover); }
.setBtn.danger{ color:var(--danger); border-color:var(--danger-edge); }
.setBtn.danger:hover{ background:var(--danger-bg); }
.setBtn.danger.solid{ background:var(--danger); color:#fff; border-color:transparent; }
[data-theme="dark"] .setBtn.danger.solid{ color:#1f1d1e; }
.setBtn.danger.solid:hover{ background:var(--danger); filter:brightness(.94); }
.setBtnRow{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.switch{ position:relative; display:inline-flex; flex-shrink:0; width:42px; height:24px; }
.switch input{ position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.switch span{ position:absolute; inset:0; border-radius:999px; background:var(--toggle-track); transition:background .2s ease; pointer-events:none; }
.switch span::after{
  content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .2s ease;
}
.switch input:checked + span{ background:var(--btn-primary-bg); }
.switch input:checked + span::after{ transform:translateX(18px); }
[data-theme="dark"] .switch input:checked + span::after{ background:#1f1d1e; }
.switch input:focus-visible + span{ outline:2px solid var(--focus-ring); outline-offset:2px; }
.setField{ display:flex; flex-direction:column; gap:7px; margin-top:16px; }
.settingsNameGrid{ margin:0; gap:12px; }
.settingsInput, [data-theme="dark"] .settingsInput{
  padding:10px 12px; border:1px solid var(--edge); border-radius:12px; background:transparent; font-size:14px;
}
.settingsInput:focus{ border-color:var(--focus-ring); box-shadow:0 0 0 3px rgba(184,74,113,.12); }
.setArea{ min-height:96px; resize:vertical; line-height:1.5; }
.setCount{ align-self:flex-end; font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.setFinePrint{ margin-top:14px; }
.setFinePrint a{ color:inherit; text-underline-offset:2px; }
.setNote{ margin:18px 0 0; font-size:13px; line-height:1.5; color:var(--muted); }
.settingsSaveRow{ margin-top:18px; }
.settingsSaveStatus.isError{ color:var(--danger); }

/* Dialogs: confirm and keyboard shortcuts */
.dialogBox, [data-theme="dark"] .dialogBox{
  max-width:420px; padding:24px; border-radius:20px; border:1px solid var(--edge);
  background:var(--modal-bg); box-shadow:0 24px 64px rgba(0,0,0,.2);
}
.dialogTitle{ margin:0 0 8px; padding-right:32px; font-size:18px; font-weight:600; color:var(--text); }
.dialogBody{ margin:0; font-size:14px; line-height:1.55; color:var(--muted); }
.dialogActions{ display:flex; justify-content:flex-end; gap:8px; margin-top:22px; }
.dialogClose{
  position:absolute; top:14px; right:14px; width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  border:none; border-radius:10px; background:none; color:var(--muted); cursor:pointer;
}
.dialogClose:hover{ background:var(--hover); color:var(--text); }
.shortcutList{ margin:12px 0 0; }
.shortcutRow{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 0; border-bottom:1px solid var(--edge); }
.shortcutRow:last-child{ border-bottom:none; }
.shortcutRow dt{ font-size:14px; color:var(--text); }
.shortcutRow dd{ display:flex; gap:4px; margin:0; }
kbd{
  min-width:26px; padding:3px 7px; border:1px solid var(--edge); border-bottom-width:2px; border-radius:7px;
  background:var(--app-bg); color:var(--text); font:inherit; font-size:12px; text-align:center;
}

@media (max-width:768px){
  #hdrNewChat{ display:flex; }
  .hdrTitle{ max-width:52vw; }
}
@media (max-width:640px){
  .settingsBox, [data-theme="dark"] .settingsBox{ height:auto; max-height:90vh; border-radius:20px 20px 0 0; }
  .settingsNav{ width:100%; padding:8px 52px 8px 10px; border-right:none; border-bottom:1px solid var(--edge); background:none; }
  .settingsNavItem, [data-theme="dark"] .settingsNavItem{ flex-shrink:0; padding:7px 12px; font-size:13px; }
  .settingsCloseBtn, [data-theme="dark"] .settingsCloseBtn{ top:7px; right:10px; }
  .settingsPane{ padding:14px 18px 24px; }
  .settingsPaneTitle{ font-size:16px; padding-right:0; }
  .setRow{ flex-wrap:wrap; gap:10px 16px; }
  .setSelect{ min-width:0; max-width:100%; }
  .settingsNameGrid{ grid-template-columns:1fr; }
  .dialogBox{ padding:20px; }
}
@media (prefers-reduced-motion:reduce){
  .sidebarInner, #sidebar, .popoverChev, .switch span, .switch span::after{ transition:none !important; }
  [data-tip]:hover::after{ animation:none; }
}

/* ══════════════════════════════════════════════════════════════════════
   UI v4 (12 Nov 2026, later): the centre screen and the sidebar as close to
   ChatGPT and Claude as Ventra allows, and the mode's glow back at the bottom.
══════════════════════════════════════════════════════════════════════ */
/* The glow: Vent's pink or Solution's teal rising from the bottom, crossfading with the mode */
:root{ --glow-vent:rgba(243,170,192,.8); --glow-solution:rgba(143,207,207,.75); }
[data-theme="dark"]{ --glow-vent:rgba(154,74,98,.4); --glow-solution:rgba(58,120,120,.42); }
#mainArea{ position:relative; isolation:isolate; }
#mainArea::before, #mainArea::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:min(58vh, 560px);
  z-index:-1; pointer-events:none; transition:opacity .7s ease;
}
#mainArea::before{ background:linear-gradient(to top, var(--glow-vent), transparent); }
#mainArea::after{ background:linear-gradient(to top, var(--glow-solution), transparent); opacity:0; }
body.solution-mode #mainArea::before{ opacity:0; }
body.solution-mode #mainArea::after{ opacity:1; }

/* The centre: one big line, then the box; no timestamps or key hints */
.emptyGreeting{
  margin:0 0 10px; font-family:'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size:30px; font-weight:500; line-height:1.2; letter-spacing:-.02em; color:var(--text); text-align:center;
}
.emptyGreetingSub{ display:none; }
.msgTime{ display:none; }
.kbdHint, .kbdHint.show{ display:none; }

/* Sidebar: the brand and a close button on top; New chat and Search as rows */
.sidebarHeader{ display:flex; align-items:center; justify-content:space-between; padding:10px 8px 6px 16px; }
.newChatBtn{ margin:1px 8px; }
#sidebarSearchWrap .newChatBtn{ width:calc(100% - 16px); }
.sidebarLabel{ padding-top:16px; }

/* Closed on a computer: a rail of icons, with the avatar at the bottom */
.sidebarRail{ display:none; }
.railBtn{
  display:flex; align-items:center; justify-content:center; width:40px; height:40px;
  border:none; border-radius:10px; background:none; color:var(--muted); cursor:pointer;
}
.railBtn:hover{ background:var(--hover); color:var(--text); }
.railBtn[hidden], .railAvatar[hidden]{ display:none; }
.railSpacer{ flex:1; }
.railAvatar{
  width:32px; height:32px; margin-bottom:4px; border:none; border-radius:50%;
  background:var(--pink); color:#fff; font:inherit; font-size:13px; font-weight:600; cursor:pointer;
}
[data-theme="dark"] .railAvatar{ background:#9a4a62; }
@media (min-width:769px){
  #sidebar{ position:relative; }
  #appView.sidebar-collapsed #sidebar{ width:56px; }
  .sidebarRail{
    position:absolute; top:0; bottom:0; left:0; z-index:2; width:56px;
    display:flex; flex-direction:column; align-items:center; gap:2px; padding:10px 0 14px;
    background:var(--app-sidebar); opacity:0; pointer-events:none; transition:opacity .1s ease;
  }
  #appView.sidebar-collapsed .sidebarRail{ opacity:1; pointer-events:auto; transition:opacity .15s ease .12s; }
  #sidebarToggle, #hdrNewChat, #appView.sidebar-collapsed #hdrNewChat{ display:none; }
}

/* Account row: an Upgrade pill below Premium */
.rowUpgrade{
  flex-shrink:0; margin-left:auto; padding:5px 11px; border:1px solid var(--edge); border-radius:999px;
  background:transparent; color:var(--text); font:inherit; font-size:12.5px; font-weight:500; cursor:pointer;
}
.rowUpgrade:hover{ background:var(--hover); }
.rowUpgrade[hidden]{ display:none; }

/* Search chats */
.searchBox, [data-theme="dark"] .searchBox{
  align-self:flex-start; max-width:620px; margin-top:12vh; padding:0; overflow:hidden;
  border-radius:20px; border:1px solid var(--edge); background:var(--modal-bg); box-shadow:0 24px 64px rgba(0,0,0,.2);
}
.searchHead{ display:flex; align-items:center; gap:10px; padding:12px 12px 12px 18px; border-bottom:1px solid var(--edge); color:var(--muted); }
.searchHead input{ flex:1; min-width:0; border:none; outline:none; background:none; color:var(--text); font:inherit; font-size:16px; }
.searchHead input::-webkit-search-cancel-button{ display:none; }
.searchHead .dialogClose{ position:static; flex-shrink:0; }
.searchResults{ max-height:min(440px, 60vh); overflow-y:auto; padding:8px; }
.searchItem{
  display:flex; align-items:center; gap:12px; width:100%; padding:10px 12px; border:none; border-radius:12px;
  background:none; color:var(--text); font:inherit; font-size:14px; text-align:left; cursor:pointer;
}
.searchItem span{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.searchItem time{ flex-shrink:0; font-size:12px; color:var(--muted); }
.searchItem svg{ flex-shrink:0; color:var(--muted); }
.searchItem.active, .searchItem:hover{ background:var(--hover); }
.searchEmpty{ margin:0; padding:18px 12px; font-size:14px; color:var(--muted); }
/* Titles start with a capital everywhere, as in the sidebar */
.searchItem span::first-letter, .hdrTitle span::first-letter{ text-transform:uppercase; }

@media (max-width:640px){
  .emptyGreeting{ font-size:26px; }
  .searchBox, [data-theme="dark"] .searchBox{ margin-top:6vh; }
}

/* ══════════════════════════════════════════════════════════════════════
   Ideas batch 1 (12 Nov 2026): the glow as a setting, help near you,
   breathe and ground, the welcome, the owner's numbers.
══════════════════════════════════════════════════════════════════════ */
/* The glow only when it's switched on (Settings → General) */
body:not(.glow-on) #mainArea::before, body:not(.glow-on) #mainArea::after{ display:none; }

/* Help near you, under a crisis reply */
.helpCard{ margin:14px 0 4px; padding:14px; border:1px solid var(--edge); border-radius:16px; background:var(--composer-bg); }
.helpTitle{ margin:0 0 10px; font-size:13px; font-weight:600; color:var(--text); }
.helpRow{ display:flex; flex-wrap:wrap; gap:8px; }
.helpBtn{
  display:inline-flex; align-items:center; padding:8px 14px; border:1px solid var(--edge); border-radius:999px;
  color:var(--text); font-size:14px; font-weight:500; text-decoration:none;
}
.helpBtn:hover{ background:var(--hover); }
.helpBtn.urgent{ background:var(--danger); border-color:transparent; color:#fff; }
[data-theme="dark"] .helpBtn.urgent{ color:#1f1d1e; }
.helpBtn.urgent:hover{ background:var(--danger); filter:brightness(.94); }
#footerCrisis a{ color:inherit; }

/* Offer to breathe, under a reply to a panicked message */
.breatheOffer{
  margin-top:12px; padding:8px 14px; border:1px solid var(--edge); border-radius:999px;
  background:var(--composer-bg); color:var(--text); font:inherit; font-size:14px; cursor:pointer;
}
.breatheOffer:hover{ background:var(--hover); }

/* Take a breath */
.breatheBox{ max-width:440px; text-align:center; }
.breatheTabs{ display:inline-flex; gap:2px; margin:0 auto 18px; padding:3px; border-radius:999px; background:var(--toggle-track); }
.breatheTab{ padding:6px 16px; border:none; border-radius:999px; background:none; color:var(--muted); font:inherit; font-size:14px; cursor:pointer; }
.breatheTab.active{ background:var(--modal-bg); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.breatheBox .dialogTitle{ padding:0; }
.breatheStage{ position:relative; display:flex; align-items:center; justify-content:center; height:220px; margin:8px 0; }
.breatheCircle{
  position:absolute; width:90px; height:90px; border-radius:50%;
  background:radial-gradient(circle at 35% 35%, rgba(243,170,192,.95), rgba(196,168,223,.85));
  transform:scale(1); transition:transform 4s ease-in-out;
}
body.solution-mode .breatheCircle{ background:radial-gradient(circle at 35% 35%, rgba(143,207,207,.95), rgba(168,196,223,.85)); }
.breatheCircle.in, .breatheCircle.hold{ transform:scale(2.1); }
.breatheCircle.out, .breatheCircle.rest{ transform:scale(1); }
.breatheCue{ position:relative; margin:0; font-size:17px; font-weight:500; color:var(--text); font-variant-numeric:tabular-nums; }
.breatheHow{ margin-top:4px; }
.breatheBox .dialogActions{ justify-content:center; }
.groundList{ margin:14px auto; padding:0; max-width:260px; list-style:none; text-align:left; }
.groundList li{ padding:9px 0; border-bottom:1px solid var(--edge); font-size:15px; color:var(--text); }
.groundList li:last-child{ border-bottom:none; }
.groundList b{ display:inline-block; width:28px; font-size:17px; }
@media (prefers-reduced-motion:reduce){ .breatheCircle{ transition:none; } }

/* The first-run welcome */
.welcomeBox{ max-width:460px; }
.welcomeBox .dialogTitle{ font-size:20px; }
.welcomeChips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.welcomeChip{
  padding:8px 14px; border:1px solid var(--edge); border-radius:999px; background:transparent;
  color:var(--text); font:inherit; font-size:14px; cursor:pointer;
}
.welcomeChip:hover{ background:var(--hover); }
.welcomeChip[aria-pressed="true"]{ background:var(--btn-primary-bg); color:var(--btn-primary-text); border-color:transparent; }
.welcomeModes{ display:grid; gap:10px; margin-top:14px; }
.welcomeMode{
  display:flex; flex-direction:column; gap:2px; padding:14px 16px; border:1px solid var(--edge); border-radius:14px;
  background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer;
}
.welcomeMode b{ font-size:15px; }
.welcomeMode span{ font-size:13px; color:var(--muted); }
.welcomeMode[aria-pressed="true"]{ border-color:var(--text); box-shadow:inset 0 0 0 1px var(--text); }
.welcomeDots{ display:flex; justify-content:center; gap:6px; margin-top:18px; }
.welcomeDots span{ width:6px; height:6px; border-radius:50%; background:var(--edge); }
.welcomeDots span.on{ background:var(--text); }

/* Report, birth year, the owner's numbers */
.reportActions{ margin-top:12px; }
.setYear{ max-width:160px; }
.authBirthNote{ display:block; margin:-2px 0 10px; }
.ownerStats{ padding:14px 0; border-bottom:1px solid var(--edge); }
.ownerStats[hidden]{ display:none; }
.statGrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:8px; margin:10px 0; }
.statGrid div{ display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid var(--edge); border-radius:12px; }
.statGrid b{ font-size:20px; font-weight:600; color:var(--text); font-variant-numeric:tabular-nums; }
.statGrid span{ font-size:12px; color:var(--muted); }
.setRow[hidden]{ display:none; }

/* ── Ideas batch 2: pinned heading, ratings, moods and Insights, Memory and Archived lists ── */
.listLabel{ padding:12px 10px 4px; }
.chatHistoryList .listLabel:first-child{ padding-top:2px; }
.sidebarLabel[hidden]{ display:none; }
.rateBtn[aria-pressed="true"]{ color:var(--text); }
.rateBtn.down svg{ transform:rotate(180deg); }
.moodFaces{ display:flex; justify-content:center; gap:6px; flex-wrap:wrap; }
.moodFace{
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--edge); border-radius:50%; background:transparent; font-size:22px; cursor:pointer;
  transition:transform .12s ease, background .12s ease;
}
.moodFace:hover{ background:var(--hover); transform:scale(1.06); }
.moodPrompt{ display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; max-width:768px; margin:12px auto 0; }
.moodPrompt[hidden], #mainArea:not(.isEmpty) .moodPrompt{ display:none; }
.moodPrompt .moodFace{ width:38px; height:38px; font-size:19px; }
.moodAsk, .moodThanks{ font-size:14px; color:var(--muted); }
.insightsBox{ max-width:440px; }
.insightsBox .moodFaces{ margin:12px 0 20px; }
.insightsChart svg{ width:100%; height:auto; display:block; }
.insightsChart rect{ fill:var(--vent-ink); opacity:.75; }
body.solution-mode .insightsChart rect{ fill:var(--solution-ink); }
.chartBase{ stroke:var(--edge); stroke-width:1; }
.chartAxis{ font-size:9px; fill:var(--muted); font-family:inherit; }
.insightsNote{ margin-top:4px; }
.listBox{ max-width:480px; }
.plainList{ max-height:min(50vh, 380px); overflow-y:auto; margin:14px 0 0; padding:0; list-style:none; }
.plainList li{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--edge); font-size:14px; color:var(--text); }
.plainList li:last-child{ border-bottom:none; }
.plainList li span{ min-width:0; overflow-wrap:anywhere; }
.plainList li.setSub{ display:block; color:var(--muted); border:none; }
.plainList .setBtn{ padding:6px 12px; font-size:13px; }
.setBtn[hidden]{ display:none; }
/* Memory (project 3, step 1): notes grouped by kind, edited in place, added under the list */
.plainList li.memGroup{ display:block; padding:16px 0 4px; border-bottom:none; font-size:12px; font-weight:600; color:var(--muted); }
.plainList li.memGroup:first-child{ padding-top:2px; }
.plainList .setBtnRow{ flex-wrap:nowrap; }
.memDate{ font-style:normal; color:var(--muted); white-space:nowrap; }
.plainList li.memEditing{ flex-wrap:wrap; gap:8px; }
.memEditing .memInput{ flex:1 1 220px; }
.memEditing .memDateInput{ flex:0 1 160px; }
.memEditing .setBtnRow{ margin-left:auto; }
.memAdd{ display:flex; flex-direction:column; gap:8px; margin-top:14px; padding-top:14px; border-top:1px solid var(--edge); }
.memAddRow{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.memAddRow .setSelect{ flex:1 1 120px; max-width:none; min-width:0; }
.memAddDate{ flex:0 1 140px; width:auto; min-width:0; }
.memAdd [hidden]{ display:none; }
.memAddRow .setBtn{ margin-left:auto; }
/* Step 2, the people list: each person, then the notes about them, set in a little */
.plainList li.memPerson strong{ font-weight:600; }
.plainList li.memPerson .memDate{ white-space:normal; }
.plainList li.memSub{ padding-left:16px; font-size:13.5px; }
.memField{ display:flex; flex-direction:column; gap:4px; flex:1 1 100%; }
.memField small{ font-size:12px; color:var(--muted); }
.memEditing .memField .memInput{ flex:none; width:100%; }
/* "Don't bring this up" (the ChatGPT / Claude study): the box in an editor, the tag in the list */
.memQuiet{ flex:1 1 100%; display:flex; align-items:center; gap:6px; cursor:pointer; }
.memQuiet small{ font-size:13px; color:var(--muted); }
.memQuiet input{ width:15px; height:15px; margin:0; accent-color:var(--vent-ink); }
/* "Memory updated" under a reply: quiet, one line, Manage at the end */
.memUpdated{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; margin-top:8px; font-size:12.5px; color:var(--muted); line-height:1.4; }
.memUpdated svg{ flex:none; }
.memUpdatedLabel{ font-weight:600; }
.memUpdatedItems{ min-width:0; overflow-wrap:anywhere; }
.memUpdatedLink{ padding:0; border:none; background:none; color:inherit; font:inherit; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.memUpdatedLink:hover{ color:var(--text); }
/* The one-time offer under the box on a new chat */
.memoryOffer{ display:flex; align-items:center; justify-content:center; gap:10px 14px; flex-wrap:wrap; max-width:768px; margin:12px auto 0; padding:0 4px; text-align:center; }
.memoryOffer[hidden], #mainArea:not(.isEmpty) .memoryOffer{ display:none; }
.memOfferText{ font-size:14px; line-height:1.45; color:var(--muted); }
.memoryOffer .setBtn{ padding:6px 14px; font-size:13px; }

/* ── Batch 4: Google, check-ins ── */
.oauthBtn{
  display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:11px 14px;
  border:1px solid var(--edge); border-radius:999px; background:transparent; color:var(--text);
  font:inherit; font-size:15px; font-weight:500; cursor:pointer;
}
.oauthBtn:hover{ background:var(--hover); }
.oauthOr{ display:flex; align-items:center; gap:10px; margin:14px 0; color:var(--muted); font-size:13px; }
.oauthOr::before, .oauthOr::after{ content:""; flex:1; height:1px; background:var(--edge); }
#oauthBox[hidden]{ display:none; }
#settingsModal.signedOut .accountOnly{ display:none; }
.welcomeError{ margin:6px 0 0; font-size:13px; color:var(--danger); }
.welcomeError[hidden]{ display:none; }

/* Temporary chat: the heading and a quiet line, no strip under the header */
.ghostBanner, .ghostBanner.show{ display:none !important; }
.ghostNote{ margin:-2px auto 6px; max-width:440px; font-size:14px; line-height:1.5; color:var(--muted); text-align:center; }

/* Help near you: numbers as plain text */
.helpItem{
  display:inline-flex; align-items:baseline; gap:6px; padding:8px 14px; border:1px solid var(--edge); border-radius:999px;
  font-size:14px; color:var(--muted);
}
.helpItem b{ color:var(--text); font-weight:600; font-variant-numeric:tabular-nums; }
.helpItem small{ font-size:12px; }

/* ── Voice mode (#16) ── */
.voiceModeBtn{ background:var(--text); color:var(--app-bg); overflow:visible; }
.voiceModeBtn:hover{ opacity:.88; }
.composer.hasText .voiceModeBtn, .composer.pending .voiceModeBtn, .composer.noVoice .voiceModeBtn{ display:none; }
.composer:not(.hasText):not(.pending):not(.noVoice) #sendBtn{ display:none !important; }
.srOnly{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.voiceOverlay{
  position:fixed; inset:0; z-index:500; display:flex; flex-direction:column; align-items:center; justify-content:space-between;
  padding:max(24px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom, 0px)); background:var(--app-bg);
}
.voiceOverlay[hidden]{ display:none; }
body.voiceOn{ overflow:hidden; }
.voiceCenter{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; max-width:560px; text-align:center; }
.voiceOrb{
  position:relative; width:180px; height:180px; padding:0; border:none; border-radius:50%; cursor:pointer;
  background:radial-gradient(circle at 35% 30%, #fbe3ec 0%, #f3aac0 45%, #c4a8df 100%);
  box-shadow:0 20px 60px rgba(196,168,223,.45); transition:transform .4s ease, filter .3s ease;
}
body.solution-mode .voiceOrb{ background:radial-gradient(circle at 35% 30%, #e3f6f6 0%, #8fcfcf 45%, #a8c4df 100%); box-shadow:0 20px 60px rgba(143,207,207,.45); }
.voiceOrb span{ position:absolute; inset:0; border-radius:50%; }
.voiceOverlay[data-state="listening"] .voiceOrb{ animation:orbBreathe 3.2s ease-in-out infinite; }
.voiceOverlay[data-state="thinking"] .voiceOrb span{ background:conic-gradient(from 0deg, transparent, rgba(255,255,255,.55), transparent 40%); animation:orbSpin 1.6s linear infinite; }
.voiceOverlay[data-state="speaking"] .voiceOrb{ animation:orbSpeak .9s ease-in-out infinite; }
.voiceOverlay[data-state="muted"] .voiceOrb, .voiceOverlay[data-state="connecting"] .voiceOrb{ filter:grayscale(.7) opacity(.75); }
@keyframes orbBreathe{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.06); } }
@keyframes orbSpeak{ 0%,100%{ transform:scale(1.02); } 50%{ transform:scale(1.12); } }
@keyframes orbSpin{ to{ transform:rotate(360deg); } }
.voiceStatus{ margin:0; font-size:18px; font-weight:500; color:var(--text); }
.voiceHeard{ margin:0; min-height:1.5em; font-size:15px; line-height:1.5; color:var(--muted); }
.voiceControls{ display:flex; gap:18px; }
.voiceCtl{
  width:60px; height:60px; display:flex; align-items:center; justify-content:center; border:none; border-radius:50%;
  background:var(--toggle-track); color:var(--text); cursor:pointer;
}
.voiceCtl:hover{ filter:brightness(.96); }
.voiceCtl[aria-pressed="true"]{ background:var(--text); color:var(--app-bg); }
.voiceCtl.end{ background:var(--danger); color:#fff; }
[data-theme="dark"] .voiceCtl.end{ color:#1f1d1e; }
.voiceNote{ max-width:520px; margin:18px 0 0; font-size:12px; line-height:1.45; color:var(--muted); text-align:center; }
.voiceNote a{ color:inherit; }
@media (prefers-reduced-motion:reduce){ .voiceOrb, .voiceOrb span{ animation:none !important; } }

/* ── Memory step 7: bring your memory from another AI (the import dialog) ── */
.importQuestion{ display:flex; gap:10px; align-items:flex-start; margin:4px 0 12px; padding:10px 12px; border-radius:12px; background:var(--toggle-track); font-size:14px; line-height:1.45; color:var(--text); }
.importQuestion span{ flex:1; }
.importText{ width:100%; box-sizing:border-box; min-height:140px; resize:vertical; font:inherit; line-height:1.45; }
.importList{ max-height:46vh; overflow:auto; }
.importItem{ display:flex; gap:10px; align-items:flex-start; cursor:pointer; font-size:14px; line-height:1.45; }
.importItem input{ margin-top:3px; flex:none; }
#memoryModal .dialogActions{ flex-wrap:wrap; }

/* ── Ventra's mascot (the owner's 3D model, 27 Nov; mascot/mascot.js). Placed quickly: the new
   look (step 8) places it properly. In a Vivi call it takes the orb's place (the orb stays without WebGL) ── */
.viviMascotCanvas{ display:block; width:100%; height:100%; }
.voiceOrb.hasMascot{
  width:min(420px, 92vw); height:auto; aspect-ratio:3 / 2; border-radius:28px;
  background:none !important; box-shadow:none !important; animation:none !important; -webkit-tap-highlight-color:transparent;
}
.voiceOrb.hasMascot > span{ display:none; }
.voiceOrb.hasMascot .viviMascotCanvas{ position:absolute; inset:0; }
.voiceOrb.hasMascot:focus-visible{ outline:2px solid var(--text); outline-offset:4px; }
.landingMascot{ width:min(360px, 88vw); height:220px; margin:-32px auto 0; -webkit-tap-highlight-color:transparent; }
.landingMascot.noMascot{ display:none; }
.landingMascot .viviMascotCanvas{ cursor:pointer; }
.landingMascotNote{ margin:10px 0 0; font-size:13px; color:var(--muted); }
@media (max-width:640px){ .landingMascot{ height:190px; margin-top:-20px; } }

/* ── The new plans (23 Nov): four cards. Wider landing; 4 across, 2 × 2 on mid screens, 1 on phones ── */
.landingWrap{ max-width:1040px; }
.pricingGrid{ grid-template-columns:repeat(4,1fr); }
.pricingCard{ padding:22px 20px; }
@media (max-width:1000px){ .pricingGrid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .pricingGrid{ grid-template-columns:1fr; } }

/* ── The control system (24 Nov): Vivi's meter in Ventra's words, a tip, the owner's control room ── */
.voiceMeter{ margin:10px auto 0; padding:4px 12px; border:0; border-radius:999px; background:transparent; color:var(--muted); font:inherit; font-size:13px; cursor:pointer; }
.voiceMeter:hover, .voiceMeter:focus-visible{ background:var(--edge); color:var(--text); }
.voiceMeter[hidden], .voiceTip[hidden]{ display:none; }
.voiceTip{ max-width:420px; margin:14px auto 0; font-size:12px; line-height:1.45; color:var(--muted); text-align:center; }
.controlRoom{ margin-top:14px; display:flex; flex-direction:column; gap:8px; }
.ctlTable{ width:100%; border-collapse:collapse; font-size:12.5px; font-variant-numeric:tabular-nums; }
.ctlTable th, .ctlTable td{ padding:6px 6px; border-bottom:1px solid var(--edge); text-align:left; }
.ctlTable th{ color:var(--muted); font-weight:500; }
.ctlTable td.neg{ color:#d9534f; }
.ctlTable small{ color:var(--muted); }
.ctlTable .flag{ font-size:11px; padding:1px 6px; border-radius:999px; background:rgba(217,83,79,.15); color:#d9534f; }
.ctlAlarm{ color:#d9534f; }
.ctlSettings{ display:flex; flex-direction:column; gap:8px; }
.ctlSetting{ display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13px; }
.ctlSetting input[type=number]{ width:90px; padding:4px 8px; border:1px solid var(--edge); border-radius:8px; background:transparent; color:var(--text); font:inherit; }
@media (max-width:640px){ .ctlTable{ font-size:11.5px; } .ctlTable th, .ctlTable td{ padding:5px 3px; } }

/* ══ TICKETS (promotion 1, 24 Nov): the friend's banner, the box before Stripe, the invite screen ══ */
.ticketBanner{
  display:flex; align-items:flex-start; gap:10px; max-width:560px; margin:0 auto 18px; padding:12px 16px;
  border:1px dashed var(--vent-ink); border-radius:14px; background:var(--card-bg);
  color:var(--text); font-size:14px; line-height:1.5; text-align:left;
}
.ticketBanner[hidden]{ display:none; }
.ticketBanner svg{ flex:none; margin-top:1px; color:var(--vent-ink); }
.ticketBanner p{ margin:0; }
.pricingTicketNote{ margin:6px 0 0; font-size:13px; font-weight:500; color:var(--vent-ink); }

.payBox{ max-width:440px; }
.payAgree{
  display:flex; gap:10px; align-items:flex-start; margin-top:18px; padding:12px 14px;
  border:1px solid var(--edge); border-radius:12px; font-size:13.5px; line-height:1.5; color:var(--text); cursor:pointer;
}
.payAgree input{ flex:none; width:18px; height:18px; margin:1px 0 0; accent-color:var(--btn-primary-bg); cursor:pointer; }
.payFine{ margin:10px 0 0; font-size:12px; color:var(--muted); }
.payFine a{ color:inherit; text-underline-offset:2px; }
.payError{ margin:12px 0 0; padding:10px 12px; border-radius:10px; background:var(--error-bg); color:var(--error-text); font-size:13px; line-height:1.5; }
.payError[hidden]{ display:none; }

.ticketsBox{ max-width:480px; max-height:calc(100vh - 32px); overflow-y:auto; }
.ticketsIntro{ margin:0 0 16px; font-size:14px; line-height:1.55; color:var(--muted); }
.ticketList{ display:flex; flex-direction:column; gap:12px; }
.ticketCard{
  --t-ink:var(--solution-ink);
  position:relative; padding:14px 20px; border:1px solid var(--edge); border-left:4px solid var(--t-ink);
  border-radius:14px; background:var(--card-bg);
}
.ticketCard.plan-premium{ --t-ink:var(--vent-ink); }
.ticketCard.plan-ultimate{ --t-ink:#8a6a1f; }
[data-theme="dark"] .ticketCard.plan-ultimate{ --t-ink:#e0c27a; }
/* The ticket's notch on the right */
.ticketCard::after{
  content:""; position:absolute; top:50%; right:-9px; width:16px; height:16px; margin-top:-8px;
  border-radius:50%; background:var(--modal-bg); border:1px solid var(--edge);
}
.ticketCard.isDone{ opacity:.7; }
.ticketTop{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.ticketPlan{ font-size:15px; font-weight:600; color:var(--text); }
.ticketOff{ font-size:13px; font-weight:600; color:var(--t-ink); white-space:nowrap; }
.ticketState{ margin:6px 0 0; font-size:13.5px; line-height:1.5; color:var(--muted); }
.ticketActions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.ticketBadge{
  display:inline-flex; align-items:center; gap:6px; margin:0 0 10px; padding:4px 12px; border-radius:999px;
  background:rgba(138,106,31,.12); color:#8a6a1f; font-size:13px; font-weight:600;
}
[data-theme="dark"] .ticketBadge{ background:rgba(224,194,122,.14); color:#e0c27a; }
.ticketsFine{ margin:16px 0 0; font-size:12px; line-height:1.5; color:var(--muted); }
.ticketsFine a{ color:inherit; text-underline-offset:2px; }
@media (max-width:480px){ .ticketCard{ padding:12px 16px; } .ticketActions .setBtn{ flex:1; } }

/* Number boxes (the birth year): no white spinner arrows, and in dark mode the browser's own
   parts (autofill lists, scrollbars, pickers) turn dark too (owner, 24 Nov: "white… doesn't go
   with the background") */
input[type=number]{ -moz-appearance:textfield; appearance:textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button{ -webkit-appearance:none; margin:0; }
[data-theme="dark"]{ color-scheme:dark; }

/* ══════════════════════════════════════════════════════════════════════
   JOURNAL (step 2, the diary; the owner's Claude Design prototype, "Quiet page", 27 Nov).
   journal.js fills it. Its own colours (the prototype's), in both themes.
══════════════════════════════════════════════════════════════════════ */
#journalView{
  --j-card:#fff; --j-page:#fffdf9; --j-chip:rgba(70,45,60,.06); --j-active:rgba(70,45,60,.08);
  --j-line:rgba(70,45,60,.11); --j-line3:rgba(70,45,60,.2);
  --j-ink:#2b2330; --j-ink2:#665c6b; --j-ink3:#9a909e;
  --j-accent:#3a2b3f; --j-accent-ink:#fff8fb;
  --j-pink:oklch(0.72 0.12 10); --j-pink-ink:oklch(0.50 0.13 10); --j-pink-soft:oklch(0.95 0.03 10);
  --j-teal-soft:oklch(0.955 0.025 190); --j-link:oklch(0.45 0.08 200);
  --j-glow-p:oklch(0.88 0.07 10 / .75); --j-glow-t:oklch(0.9 0.06 190 / .65);
  --j-shadow:0 1px 2px rgba(60,30,50,.04), 0 8px 28px rgba(60,30,50,.06);
  --j-pop:0 10px 36px rgba(40,20,40,.14);
}
[data-theme="dark"] #journalView{
  --j-card:#2a2529; --j-page:#252024; --j-chip:rgba(255,235,250,.06); --j-active:rgba(255,235,250,.09);
  --j-line:rgba(255,235,250,.10); --j-line3:rgba(255,235,250,.2);
  --j-ink:#f2ebf1; --j-ink2:#b3a9b7; --j-ink3:#7f7585;
  --j-accent:oklch(0.84 0.07 10); --j-accent-ink:#231820;
  --j-pink:oklch(0.78 0.11 10); --j-pink-ink:oklch(0.82 0.09 10); --j-pink-soft:oklch(0.31 0.05 10);
  --j-teal-soft:oklch(0.29 0.035 195); --j-link:oklch(0.82 0.08 195);
  --j-glow-p:oklch(0.42 0.09 10 / .5); --j-glow-t:oklch(0.40 0.07 195 / .45);
  --j-shadow:0 1px 2px rgba(0,0,0,.2), 0 8px 28px rgba(0,0,0,.25);
  --j-pop:0 10px 36px rgba(0,0,0,.5);
}
#journalView[hidden], #journalView [hidden], .jHdrTitle[hidden]{ display:none !important; }

/* In the journal, the chat steps aside (it's all still there behind it) */
#appView.journalOn #chat, #appView.journalOn .composerArea, #appView.journalOn #scrollToBottom,
#appView.journalOn #hdrTitle, #appView.journalOn #usageBar, #appView.journalOn #reportBtn,
#appView.journalOn #ghostBtn{ display:none !important; }
#appView.journalOn #mainArea::before, #appView.journalOn #mainArea::after{ opacity:0 !important; }
.newChatBtn.journalNav.active, .railBtn.journalNav.active{ background:var(--pressed); }
.jHdrTitle{ font-size:15px; font-weight:600; color:var(--text); }
.landingTrial .trialNote + .trialBtn{ margin-top:14px; }

.journalView{
  position:relative; flex:1; min-height:0; display:flex; flex-direction:column;
  color:var(--j-ink); overflow:hidden; isolation:isolate;
}
.journalView::before, .journalView::after{ content:""; position:absolute; border-radius:50%; z-index:-1; pointer-events:none; }
.journalView::before{ top:-240px; right:-200px; width:600px; height:600px; background:radial-gradient(circle, var(--j-glow-p), transparent 65%); }
.journalView::after{ bottom:-280px; left:-240px; width:640px; height:640px; background:radial-gradient(circle, var(--j-glow-t), transparent 65%); }
.journalView button{ font-family:inherit; }

.jTabsWrap{ flex:none; display:flex; justify-content:center; padding:2px 12px 10px; }
.jTabs{ display:flex; gap:2px; padding:4px; border-radius:999px; background:var(--j-chip); }
.jTabs button{
  white-space:nowrap; height:36px; padding:0 16px; border:0; border-radius:999px; background:transparent;
  color:var(--j-ink2); font-size:14px; font-weight:500; cursor:pointer;
}
.jTabs button.on{ background:var(--j-card); color:var(--j-ink); box-shadow:0 1px 3px rgba(40,20,40,.12); }

.jScroll{ flex:1; min-height:0; overflow-y:auto; position:relative; }
.jPane{ box-sizing:border-box; width:100%; max-width:748px; margin:0 auto; padding:6px 24px 48px; display:flex; flex-direction:column; gap:12px; }
.jToday{ padding-bottom:150px; }
.jMonth{ max-width:668px; gap:16px; }
.jPages{ max-width:768px; gap:16px; }

/* Today */
.jTop{ display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:28px; }
.jHello{ font-family:'Nanum Pen Script', cursive; font-size:28px; line-height:1; color:var(--j-pink-ink); }
.jSaved{ display:flex; align-items:center; gap:4px; font-size:13px; color:var(--j-ink2); white-space:nowrap; }
.jDate{
  margin:-2px 0 0; font-family:'Newsreader', Georgia, serif; font-weight:400;
  font-size:clamp(32px, 8vw, 44px); line-height:1.08; letter-spacing:-.015em; color:var(--j-ink);
}
.jTypeWrap{ position:relative; display:flex; align-items:center; gap:8px; margin-top:4px; }
.jTypeBtn{
  white-space:nowrap; display:flex; align-items:center; gap:2px; height:38px; padding:0 8px 0 15px;
  border-radius:999px; border:1px solid var(--j-line3); background:var(--j-card); color:var(--j-ink);
  cursor:pointer; font-size:14px; font-weight:500;
}
.jMenu{
  position:absolute; z-index:6; min-width:250px; padding:6px; border-radius:16px; background:var(--j-card);
  border:1px solid var(--j-line); box-shadow:var(--j-pop); display:flex; flex-direction:column;
}
.jTypeMenu{ top:44px; left:0; }
.jMenu button{
  display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:0 12px;
  border:0; border-radius:10px; background:transparent; color:var(--j-ink); text-align:left; font-size:14.5px; cursor:pointer;
}
.jMenu button:hover, .jMenu button.on{ background:var(--j-active); }
.jMenu button.danger{ color:var(--j-pink-ink); }
.jMenu svg{ flex:none; }
.jPromptCard{ display:flex; flex-wrap:wrap; align-items:baseline; column-gap:14px; row-gap:2px; padding-top:4px; }
.jPromptText{ font-family:'Newsreader', Georgia, serif; font-style:italic; font-size:20px; line-height:1.4; color:var(--j-ink2); text-wrap:pretty; }
.jPromptActions{ display:flex; gap:16px; }
.jLinkBtn{ border:0; background:transparent; padding:8px 0; font-size:14px; color:var(--j-ink2); cursor:pointer; }
.jLinkBtn.strong{ font-weight:600; color:var(--j-ink); }
.jLinkBtn:hover{ color:var(--j-ink); }
.jShowPrompt{
  align-self:flex-start; border:0; background:transparent; padding:4px 0; font-size:14px; color:var(--j-ink2);
  cursor:pointer; text-decoration:underline; text-underline-offset:3px;
}
.jPage{
  position:relative; margin-top:4px; border-radius:22px; background-color:var(--j-page);
  background-image:radial-gradient(var(--j-line3) 1px, transparent 1.2px); background-size:22px 22px; background-position:11px 11px;
  border:1px solid var(--j-line); box-shadow:var(--j-shadow); padding:16px 18px 18px;
}
.jPageQ{ display:flex; gap:8px; align-items:flex-start; padding-bottom:8px; }
.jPageQ span{ flex:1; font-family:'Newsreader', Georgia, serif; font-style:italic; font-size:17px; line-height:1.4; color:var(--j-ink2); }
.jPageQX{ flex:none; width:30px; height:30px; margin:-4px -6px 0 0; border:0; border-radius:50%; background:transparent; color:var(--j-ink3); cursor:pointer; display:grid; place-items:center; }
.jPageQX:hover{ background:var(--j-active); color:var(--j-ink); }
.jText{
  display:block; width:100%; box-sizing:border-box; min-height:340px; border:0; outline:0; resize:none; padding:0;
  background:transparent; color:var(--j-ink); font-family:'Newsreader', Georgia, serif; font-size:19.5px; line-height:1.65; overflow:hidden;
}
.jText::placeholder{ color:var(--j-ink3); }
.jRead{ white-space:pre-wrap; font-family:'Newsreader', Georgia, serif; font-size:19px; line-height:1.65; text-wrap:pretty; overflow-wrap:anywhere; min-height:60px; }
.jMuted{ color:var(--j-ink3); font-style:italic; }

/* The help card under a flagged page (plain-text numbers, owner 12 Nov) */
.jHelp{ border-radius:20px; padding:18px 18px 16px; background:var(--j-teal-soft); display:flex; flex-direction:column; gap:8px; }
.jHelpTitle{ font-size:16px; font-weight:600; }
.jHelp p{ margin:0; font-size:14.5px; line-height:1.55; color:var(--j-ink2); text-wrap:pretty; }
.jHelp .jHelpLine{ font-size:15px; color:var(--j-ink); }
.jHelp .jHelpSmall{ font-size:13.5px; }
.jHelp a{ align-self:flex-start; font-size:14.5px; font-weight:500; padding:6px 0; color:var(--j-link); text-underline-offset:3px; }

.jSaveCard{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 14px 14px 16px; border-radius:18px; background:var(--j-card); border:1px solid var(--j-line);
}
.jSaveCard span{ flex:1 1 200px; font-size:14px; line-height:1.45; color:var(--j-ink2); }
.jPrimary{
  white-space:nowrap; height:42px; padding:0 18px; border:0; border-radius:999px; background:var(--j-accent);
  color:var(--j-accent-ink); font-size:14px; font-weight:500; cursor:pointer;
}
.jPill{
  align-self:flex-start; display:flex; align-items:center; gap:7px; height:42px; padding:0 16px 0 13px;
  border-radius:999px; border:1px solid var(--j-line3); background:var(--j-card); color:var(--j-ink);
  font-size:14px; font-weight:500; cursor:pointer;
}
.jPill.strong{ background:var(--j-accent); color:var(--j-accent-ink); border-color:transparent; }
.jPill.round{ width:42px; padding:0; justify-content:center; }
.jRound{ width:44px; height:44px; border:0; border-radius:50%; background:transparent; color:var(--j-ink); display:grid; place-items:center; cursor:pointer; flex:none; }
.jRound:hover:not(:disabled){ background:var(--j-active); }
.jRound:disabled{ opacity:.3; cursor:default; }

/* The dock: five mood faces and the mic */
.jDockWrap{
  position:absolute; left:0; right:0; bottom:calc(18px + env(safe-area-inset-bottom, 0px)); z-index:4;
  display:flex; justify-content:center; padding:0 14px; pointer-events:none;
}
.jDock{
  pointer-events:auto; display:flex; align-items:center; gap:4px; padding:6px 6px 6px 10px; border-radius:999px;
  background:var(--j-card); border:1px solid var(--j-line); box-shadow:var(--j-pop); max-width:100%; box-sizing:border-box;
}
.jMoods, .jEditMoods{ display:flex; }
.jMood{ width:44px; height:44px; border:0; background:transparent; cursor:pointer; display:grid; place-items:center; padding:0; border-radius:50%; }
.jMood span{ display:block; border-radius:50%; transition:opacity .2s, box-shadow .2s; }
.jMood.dim span{ opacity:.35; }
.jMood.on span{ box-shadow:0 0 0 2.5px var(--j-card), 0 0 0 4.5px var(--mc); }
.jDockSep{ width:1px; height:28px; background:var(--j-line3); margin:0 6px; }
.jMic{ width:50px; height:50px; border-radius:50%; border:0; background:var(--j-accent); color:var(--j-accent-ink); cursor:pointer; display:grid; place-items:center; }
.jListening, .jDock .jDone{ display:none; }
.jDock .jDone{ height:50px; padding:0 22px; font-size:14.5px; }
.jDockWrap.listening .jMoods, .jDockWrap.listening .jDockSep, .jDockWrap.listening .jMic{ display:none; }
.jDockWrap.listening .jListening{ display:flex; align-items:center; gap:10px; padding:0 10px 0 6px; font-size:14.5px; font-weight:500; }
.jDockWrap.listening .jDone{ display:block; }
.jWave{ display:flex; align-items:center; gap:3px; height:20px; }
.jWave i{ width:3px; height:18px; border-radius:2px; background:var(--j-pink); animation:jBar 1s ease-in-out infinite; }
.jWave i:nth-child(2){ animation-delay:.15s; } .jWave i:nth-child(3){ animation-delay:.3s; } .jWave i:nth-child(4){ animation-delay:.45s; }
@keyframes jBar{ 0%,100%{ transform:scaleY(.3); } 50%{ transform:scaleY(1); } }
@media (prefers-reduced-motion: reduce){ .jWave i{ animation:none; } }

/* Month */
.jMonthHead{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.jMonthTitle{ margin:0; font-family:'Newsreader', Georgia, serif; font-weight:400; font-size:34px; line-height:1.1; letter-spacing:-.01em; color:var(--j-ink); }
.jMonthNav{ display:flex; gap:2px; }
.jCal{ border-radius:24px; background:var(--j-card); border:1px solid var(--j-line); box-shadow:var(--j-shadow); padding:14px 8px 10px; }
.jCalWeek, .jCalGrid{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); }
.jCalWeek{ text-align:center; font-size:12px; font-weight:600; color:var(--j-ink3); padding-bottom:6px; }
.jCalGrid{ row-gap:2px; }
.jCell{
  height:58px; border:0; background:transparent; padding:0; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:3px; color:var(--j-ink); font-size:15px; cursor:default;
}
.jCell.has{ cursor:pointer; }
.jCell .jNum{ width:34px; height:34px; border-radius:50%; display:grid; place-items:center; }
.jCell.has:hover .jNum{ background:var(--j-active); }
.jCell.today .jNum{ box-shadow:inset 0 0 0 1.5px var(--j-ink); font-weight:600; }
.jCell.future .jNum{ color:var(--j-ink3); }
.jDot{ width:9px; height:9px; border-radius:50%; flex:none; display:inline-block; }
.jDot.none{ background:transparent; }
.jLegend{ display:flex; flex-wrap:wrap; justify-content:center; gap:8px 16px; font-size:13px; color:var(--j-ink2); }
.jLegend span{ display:flex; align-items:center; gap:6px; }
.jLegend i{ width:9px; height:9px; border-radius:50%; display:inline-block; }
.jHint{ margin:0; text-align:center; font-size:13.5px; color:var(--j-ink3); }

/* Pages */
.jSearch{
  display:flex; align-items:center; gap:10px; height:50px; padding:0 6px 0 16px; border-radius:999px;
  background:var(--j-card); border:1px solid var(--j-line); box-shadow:var(--j-shadow); color:var(--j-ink2);
}
.jSearch input{ flex:1; min-width:0; height:44px; border:0; outline:0; background:transparent; font:inherit; font-size:16px; color:var(--j-ink); }
.jSearch input::placeholder{ color:var(--j-ink3); }
.jSearch input::-webkit-search-cancel-button{ display:none; }
.jDayHead{ display:flex; flex-direction:column; gap:4px; }
.jGroupLabel{ font-size:12.5px; font-weight:600; letter-spacing:.08em; color:var(--j-ink2); padding:4px 6px 8px; }
.jList{ display:flex; flex-direction:column; border-radius:20px; background:var(--j-card); border:1px solid var(--j-line); box-shadow:var(--j-shadow); margin-bottom:16px; }
.jRow{ position:relative; display:flex; align-items:flex-start; gap:4px; padding:12px 6px 12px 14px; }
.jRow + .jRow{ border-top:1px solid var(--j-line); }
.jRowOpen{ flex:1; min-width:0; display:flex; gap:14px; border:0; background:transparent; padding:2px 0; text-align:left; cursor:pointer; color:var(--j-ink); }
.jRowDate{ flex:none; width:38px; display:flex; flex-direction:column; align-items:center; padding-top:2px; }
.jRowNum{ font-family:'Newsreader', Georgia, serif; font-size:27px; line-height:1; }
.jRowWd{ font-size:12px; color:var(--j-ink2); }
.jRowMain{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.jRowType{ display:flex; align-items:center; gap:7px; font-size:13px; color:var(--j-ink2); }
.jRowSnip{
  font-family:'Newsreader', Georgia, serif; font-size:16.5px; line-height:1.4; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.jRowMore{ flex:none; width:44px; height:44px; border:0; border-radius:50%; background:transparent; display:grid; place-items:center; cursor:pointer; color:var(--j-ink2); }
.jRowMore:hover{ background:var(--j-active); }
.jRow .jMenu{ top:50px; right:8px; min-width:200px; }
.jRow .jMenu button{ justify-content:flex-start; gap:10px; }
.jEmpty{ margin:20px 0; text-align:center; font-size:15px; color:var(--j-ink2); }
.jExportAll{ align-self:center; text-decoration:underline; text-underline-offset:3px; }

/* One page */
.jBack{
  align-self:flex-start; display:flex; align-items:center; gap:2px; height:40px; padding:0 10px 0 2px; margin-left:-8px;
  border:0; background:transparent; font-size:14px; color:var(--j-ink2); cursor:pointer;
}
.jBack:hover{ color:var(--j-ink); }
.jEntryMeta{ display:flex; align-items:center; gap:9px; font-size:14px; color:var(--j-ink2); }
.jEntryActions{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:2px; }

@media (max-width:768px){
  .jPane{ padding:6px 20px 40px; }
  .jToday{ padding-bottom:140px; }
  .jText{ min-height:300px; }
  .jTabs button{ padding:0 14px; }
  .jMonthTitle{ font-size:30px; }
}

/* ── Since 29 Nov: the week, a month as PDF, the PIN lock (step 5), the mic's language (11.5) ── */
.jWeek{ border-radius:20px; background:var(--j-card); border:1px solid var(--j-line); box-shadow:var(--j-shadow); padding:14px 16px 12px; display:flex; flex-direction:column; gap:10px; }
.jWeekTop{ display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px 12px; }
.jWeekTitle{ font-size:12.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--j-ink2); }
.jWeekSum{ font-size:14px; color:var(--j-ink); }
.jWeekRow{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); }
.jWeekDay{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.jWeekLetter{ width:28px; height:28px; border-radius:50%; display:grid; place-items:center; font-size:12px; font-weight:600; color:var(--j-ink2); }
.jWeekDay.today .jWeekLetter{ box-shadow:inset 0 0 0 1.5px var(--j-ink); color:var(--j-ink); }
.jWeekDay.future .jWeekLetter{ color:var(--j-ink3); }
.jWeekDay .jDot{ width:11px; height:11px; }
.jWeekDay .jDot.none{ background:transparent; box-shadow:inset 0 0 0 1.5px var(--j-line3); }
.jWeekDay.future .jDot.none{ box-shadow:none; }

.jLockRow{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:4px 16px; font-size:14px; color:var(--j-ink2); }
.jLockRow .jLinkBtn{ display:inline-flex; align-items:center; gap:7px; text-decoration:underline; text-underline-offset:3px; }
.jLock{ max-width:440px; padding-top:min(10vh, 80px); }
.jLockBox{ display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; }
.jLockIcon{ width:56px; height:56px; border-radius:50%; display:grid; place-items:center; background:var(--j-pink-soft); color:var(--j-pink-ink); }
.jLockSub{ margin:0; font-size:15px; line-height:1.5; color:var(--j-ink2); text-wrap:pretty; }
.jPin{
  width:180px; height:56px; box-sizing:border-box; border-radius:16px; border:1px solid var(--j-line3); background:var(--j-card);
  color:var(--j-ink); text-align:center; font:inherit; font-size:28px; letter-spacing:.5em; padding-left:.5em; outline:0;
}
.jPin:focus{ border-color:var(--j-ink2); box-shadow:0 0 0 3px var(--j-active); }
.jPin::placeholder{ color:var(--j-ink3); letter-spacing:.3em; }
.jLockErr{ margin:0; min-height:20px; font-size:14px; color:var(--j-pink-ink); }
.jLock .jPrimary{ min-width:180px; }
.jLock .jHint{ max-width:340px; text-wrap:pretty; }

/* The mic's language, shown while it listens; a tap opens the list (body-level, app colours) */
.langChip{
  display:inline-flex; align-items:center; gap:5px; height:32px; max-width:190px; padding:0 8px 0 9px; border-radius:999px;
  border:1px solid var(--edge); background:transparent; color:var(--muted); font:inherit; font-size:12.5px; cursor:pointer; white-space:nowrap;
}
.langChip span{ overflow:hidden; text-overflow:ellipsis; }
.langChip svg{ flex:none; }
.langChip:hover{ background:var(--hover); color:var(--text); }
.langChip[hidden]{ display:none; }
.micLang{ align-self:center; margin-right:2px; }
#journalView .jLangChip{ display:none; border-color:var(--j-line3); color:var(--j-ink2); height:36px; }
#journalView .jLangChip:hover{ background:var(--j-active); color:var(--j-ink); }
#journalView .jDockWrap.listening .jLangChip{ display:inline-flex; }
.voiceLangMenu{
  position:fixed; z-index:9000; overflow-y:auto; padding:6px; border-radius:16px; border:1px solid var(--edge);
  background:var(--modal-bg); box-shadow:0 12px 40px rgba(0,0,0,.18); display:flex; flex-direction:column; box-sizing:border-box;
}
.voiceLangMenu button{
  flex:none; min-height:40px; padding:0 12px; border:0; border-radius:10px; background:transparent; color:var(--text);
  font:inherit; font-size:14px; text-align:left; cursor:pointer;
}
.voiceLangMenu button:hover{ background:var(--hover); }
.voiceLangMenu button.on{ background:var(--pressed); font-weight:600; }
@media (max-width:480px){
  .micLang{ max-width:112px; }
  .jDockWrap.listening .jListening{ padding-right:2px; }
  #journalView .jLangChip{ max-width:120px; }
}
