.public-site .footer { padding-bottom: 132px; }
.greg-launch {
  position: fixed;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 910;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  padding: 15px 20px;
  border: 1px solid #c8b9ff66;
  border-radius: 22px;
  background: linear-gradient(135deg, #46336ff5, #241c3ff5);
  color: #f5f2ff;
  text-align: left;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.greg-launch[hidden] { display: none; }
.greg-launch:hover { background: #493780; border-color: #c8b9ff; }
.greg-launch strong { display: block; font-size: 1.7rem; }
.greg-launch small { display: block; color: #ddd5f1; font-size: 1.2rem; margin-top: 3px; }
.greg-launch > span:last-child { font-size: 2.4rem; margin-left: 12px; }
.greg-greeting {
  position: fixed;
  right: 24px;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 96px);
  z-index: 910;
  width: min(340px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--border-glow);
  border-radius: 22px 22px 4px 22px;
  background: var(--dialog-surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  color: var(--text-body);
  box-shadow: var(--shadow-glow);
  font-size: 1.4rem;
}
.greg-greeting[hidden] { display: none; }
.greg-greeting-title { color: var(--heading); font-size: 2rem; font-weight: 800; padding-right: 36px; margin-bottom: 12px; }
.greg-greeting .greg-icon-button { position: absolute; top: 10px; right: 10px; }
.greg-greeting-start { display: flex; justify-content: space-between; gap: 20px; margin-block: 16px 10px; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 12px; background: #58468d; color: #ffffff; font-weight: 700; }
.greg-greeting small { color: var(--muted); font-size: 1.1rem; }
.greg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, #7660bc, #493780);
  color: #ffffff;
  font-family: "Sora", sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
}
.greg-dialog {
  position: fixed;
  inset: auto 24px 24px auto;
  margin: 0;
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  height: min(680px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--border-glow);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text-body);
  box-shadow: 0 24px 100px #08071850;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  overflow: hidden;
  font-size: 1.4rem;
  line-height: 1.6;
}
.greg-dialog[open] { display: flex; flex-direction: column; }
.greg-dialog::backdrop { background: #08071866; }
.greg-heading { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--border-glass); }
.greg-heading h2 { font-size: 1.9rem; color: var(--heading); line-height: 1.4; }
.greg-heading p { color: var(--muted); font-size: 1.2rem; }
.greg-icon-button { margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--heading); font-size: 2.6rem; }
.greg-notice { padding: 12px 20px; color: var(--muted); font-size: 1.15rem; background: var(--paper); }
.greg-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px; scrollbar-width: thin; }
.greg-message { width: fit-content; max-width: 95%; padding: 12px 15px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); color: var(--text-body); margin-bottom: 12px; overflow-wrap: anywhere; white-space: pre-line; }
.greg-message-user { margin-left: auto; background: #58468d; color: #ffffff; border-radius: 16px 16px 4px 16px; }
.greg-message a { display: block; margin-top: 10px; color: var(--violet-blue-crayola); text-underline-offset: 3px; font-weight: 700; min-height: 28px; }
.greg-topics { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 20px; border-top: 1px solid var(--border-glass); }
.greg-topics button { padding: 6px 11px; min-height: 44px; border: 1px solid var(--border-glass); border-radius: 24px; background: var(--paper); color: var(--violet-blue-crayola); font-size: 1.2rem; }
.greg-topics button:hover { border-color: var(--violet-blue-crayola); }
.greg-form { display: flex; align-items: center; gap: 8px; padding: 8px 20px 10px; }
.greg-form input { flex: 1; min-width: 0; width: 0; min-height: 48px; padding: 11px 12px; border: 1px solid var(--border-glass); border-radius: 12px; background: var(--paper); color: var(--heading); font-size: 16px; }
.greg-form input::placeholder { color: var(--muted); opacity: 1; }
.greg-send { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border: 0; border-radius: 14px; background: #58468d; color: #ffffff; }
.greg-send:hover { background: #493780; }
.greg-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 20px; font-size: 1.2rem; }
.greg-bottom button { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.greg-bottom a { color: var(--violet-blue-crayola); min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: 3px; font-weight: 700; }
.greg-storage-note { padding: 0 20px 16px; color: var(--muted); font-size: 1.05rem; }
.greg-dialog > :not(.greg-messages) { flex-shrink: 0; }
@media (max-width: 640px) {
  .greg-launch { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .greg-launch > span:nth-child(2) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .greg-launch > span:last-child { display: none; }
  .greg-greeting { right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 64px); }
  .greg-dialog { inset: auto 16px 16px auto; border-radius: 22px; }
  .greg-topics { flex-wrap: nowrap; overflow-x: auto; }
  .greg-topics button { flex-shrink: 0; }
}
@media (max-height: 560px) {
  .greg-greeting { max-height: calc(100dvh - 116px); overflow-y: auto; }
  .greg-dialog { height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); bottom: 8px; }
  .greg-heading { padding-block: 8px; }
  .greg-topics { display: none; }
  .greg-notice, .greg-storage-note { padding-block: 6px; }
}
