:root {
  --font-title: "r41-stop-rounder", "Open Sans", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0d0b0a;
  --bg-elevated: rgba(24, 20, 18, 0.86);
  --panel: rgba(26, 22, 20, 0.72);
  --border: rgba(255, 235, 211, 0.12);
  --text: #f5eee5;
  --muted: rgba(245, 238, 229, 0.68);
  --accent: #e8b980;
  --accent-soft: rgba(232, 185, 128, 0.2);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  --max-width: 500px;
  --transition: 180ms ease;
  --title-color-idle: #f5eee5;
  --title-color-active: #f0c28f;
}

body.theme-light {
  --bg: #efe6da;
  --bg-elevated: rgba(255, 251, 247, 0.84);
  --panel: rgba(255, 249, 243, 0.82);
  --border: rgba(90, 60, 36, 0.14);
  --text: #261b14;
  --muted: rgba(38, 27, 20, 0.62);
  --accent: #8e5625;
  --accent-soft: rgba(142, 86, 37, 0.12);
  --shadow: 0 24px 80px rgba(65, 35, 15, 0.14);
  --title-color-idle: #261b14;
  --title-color-active: #9b5d28;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background:
	radial-gradient(circle at 50% 5%, rgba(77, 177, 208, 0.38), transparent 30%), 
	linear-gradient(180deg, rgba(151, 214, 11, 0.89), rgb(242, 242, 221));
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  /* animation: backgroundPulse 12s ease-in-out infinite; */
}

body.theme-light {
  background:
/*
	radial-gradient(circle at 50% 5%, rgba(77, 177, 208, 0.38), transparent 30%), 
	linear-gradient(180deg, rgba(151, 214, 11, 0.89), rgb(242, 242, 221));
*/
radial-gradient(circle at 50% 5%, rgba(77, 208, 110, 0.38), transparent 30%), linear-gradient(180deg, rgba(11, 195, 214, 0.89), rgb(242, 242, 221));
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  padding: 22px 22px 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar,
.conversation,
.chat-form {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto 30px;
}

.topbar-spacer {
  min-height: 1px;
}

.site-title {
  margin-bottom: 0;
margin-top:10px;
  font-family: var(--font-title);
font-family:"eco";
font-family:"r41-stop-rounder";
  font-size: 4.5rem;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--title-color-idle);
  justify-self: center;
  text-align: center;
  animation: titlePulse 4.5s ease-in-out infinite;
}

.conversation {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  padding: 0 0 15vh;
  overflow-y: auto;
  scrollbar-width: none;
  overflow-anchor: none;
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 80%, transparent 80%);
}

.conversation::-webkit-scrollbar {
  display: none;
}

.message {
  margin: 0 0 26px;
  display: flex;
  animation: lift-in 360ms ease;
}

.message:first-child {
  margin-top: 7vh;
}

.message.is-fading {
  opacity: 0.82;
}

.message--user {
  justify-content: flex-end;
}

.message-content {
  white-space: pre-wrap;
  line-height: 1.3;
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  color: var(--text);
  max-width: 100%;
}

.message-content p {
  margin: 0 0 1.2em;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 650;
}

.message-content em {
  font-style: italic;
}

.message--user .message-content {
  max-width: min(88%, 430px);
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255, 246, 232, 0.12);
  border: 1px solid rgba(255, 235, 211, 0.14);
}

body.theme-light .message--user .message-content {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(90, 60, 36, 0.1);
}

.message--assistant .message-content {
  max-width: min(100%, 500px);
}

.chat-form {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px max(22px, env(safe-area-inset-right)) calc(30px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
/*
  background: linear-gradient(180deg, rgba(13, 11, 10, 0), rgba(13, 11, 10, 0.78) 38%, rgba(13, 11, 10, 0.94));
*/
}

body.theme-light .chat-form {
/*
  background: linear-gradient(180deg, rgba(239, 230, 218, 0), rgba(239, 230, 218, 0.78) 38%, rgba(239, 230, 218, 0.95));
*/
}

.input-shell {
  display: flex;
  align-items: flex-end;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(56, 47, 42, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
}

body.theme-light .input-shell {
  background: rgba(255, 252, 247, 0.95);
}

.chat-input {
  width: 100%;
  max-height: 180px;
  resize: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.3;
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  caret-color: var(--accent);
  outline: none;
  overflow-y: auto;
  scrollbar-width: none;
}

.chat-input::-webkit-scrollbar {
  display: none;
}

.chat-input::placeholder {
  color: rgba(245, 238, 229, 0.4);
}

body.theme-light .chat-input::placeholder {
  color: rgba(38, 27, 20, 0.52);
}

.command-note {
  max-width: var(--max-width);
  margin: 10px auto 0;
margin-bottom:15px;
  padding: 0 4px;
  color: rgba(245, 238, 229, 0.52);
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: center;
}

body.theme-light .command-note {
  color: rgba(38, 27, 20, 0.48);
}

.reset-warning {
  position: fixed;
  left: 50%;
  bottom: calc(134px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 4;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(20, 17, 15, 0.88);
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

body.theme-light .reset-warning {
  background: rgba(255, 251, 246, 0.92);
}

body.theme-light .overlay {
  background: rgba(239, 230, 218, 0.66);
}

.message--thinking {
  align-items: flex-start;
}

.message-content--thinking {
  display: flex;
  align-items: center;
  min-height: 1.3em;
  padding-left: 0.14em;
  padding-top: 1px;
  padding-bottom: 1px;
  overflow: visible;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  overflow: visible;
}

.thinking-dot {
  width: 0.72em;
  height: 0.72em;
  border-radius: 999px;
  background: currentColor;
  animation: thinkingPulse 1.15s ease-in-out infinite;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(20px);
  display: grid;
  place-items: center;
  z-index: 5;
  padding: 24px;
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.overlay-title {
  margin: 0 0 20px;
  font-family: var(--font-title);
font-family: "r41-stop-rounder","Open Sans";
font-size:1.2em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.overlay-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.overlay-input,
.overlay-button {
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.overlay-input {
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.overlay-input:focus-visible {
  border-color: var(--accent-soft);
}

.overlay-button {
  padding: 0 18px;
  background: rgba(232, 185, 128, 0.1);
  color: var(--text);
  cursor: pointer;
}

.overlay-message,
.overlay-help {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hidden-panel {
  text-align: center;
}

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

@keyframes thinkingPulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.62;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.96;
  }
}

@keyframes backgroundPulse {
  0%, 100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.08) brightness(1.08);
  }
}

@keyframes titlePulse {
  0%, 100% {
    color: var(--title-color-idle);
    text-shadow: 0 0 12px rgba(232, 185, 128, 0.08);
  }
  50% {
    color: color-mix(in srgb, var(--title-color-idle) 84%, white 10%);
    text-shadow: 0 0 18px rgba(232, 185, 128, 0.14);
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px 16px 18px;
  }

  .topbar {
    grid-template-columns: 1fr auto 1fr;
  }

  .topbar-actions {
    gap: 8px;
  }

  .site-title {
/*
    font-size: clamp(1.4rem, 6vw, 2rem);
*/
line-height:4.2rem;
margin-top:30px;
  }

  .overlay-form {
    grid-template-columns: 1fr;
  }
}
