@font-face {
  font-family: "Söhne";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/soehne-buch.woff2") format("woff2");
}

@font-face {
  font-family: "Söhne";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/soehne-halbfett.woff2") format("woff2");
}

@font-face {
  font-family: "Söhne";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/soehne-kraftig.woff2") format("woff2");
}

@font-face {
  font-family: "Söhne Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/soehne-mono-buch.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --sidebar: #202123;
  --sidebar-hover: #2a2b32;
  --main: #343541;
  --assistant: #444654;
  --composer: #40414f;
  --card: #3e3f4b;
  --card-hover: #202123;
  --border: rgba(255, 255, 255, 0.2);
  --subtle-border: rgba(255, 255, 255, 0.09);
  --text: #ececf1;
  --chat-text: rgba(236, 236, 241, 0.85);
  --muted: #c5c5d2;
  --quiet: #8e8ea0;
  --green: #19c37d;
  --logo-green: #10a37f;
  --danger: #ef4146;
  --shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  --font-book: 400;
  --font-halbfett: 600;
  --font-kraftig: 700;
  font-family: "Söhne", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  font-synthesis: none;
}

:root.light {
  color-scheme: light;
  --sidebar: #202123;
  --sidebar-hover: #ececf1;
  --main: #ffffff;
  --assistant: #f7f7f8;
  --composer: #ffffff;
  --card: #f7f7f8;
  --card-hover: #ececf1;
  --border: rgba(0, 0, 0, 0.18);
  --subtle-border: rgba(0, 0, 0, 0.1);
  --text: #343541;
  --chat-text: rgba(52, 53, 65, 0.82);
  --muted: #565869;
  --quiet: #6e6e80;
  --shadow: 0 0 15px rgba(0, 0, 0, 0.08);
}

.moon-icon {
  display: none;
}

:root.light .sidebar {
  color: #ececf1;
}

:root.light .sidebar .menu-button {
  color: #ececf1;
}

:root.light .sidebar .new-chat-button {
  border-color: rgba(255, 255, 255, 0.2);
}

:root.light .sidebar .new-chat-button:hover,
:root.light .sidebar .menu-button:hover,
:root.light .sidebar .conversation-item:hover,
:root.light .sidebar .conversation-item.active {
  background: #2a2b32;
}

:root.light .sidebar .conversation-action {
  color: #c5c5d2;
}

:root.light .sidebar .conversation-action:hover {
  color: #fff;
}

:root.light .sidebar-menu {
  border-top-color: rgba(255, 255, 255, 0.09);
}

:root.light .sun-icon {
  display: none;
}

:root.light .moon-icon {
  display: block;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background: var(--main);
  color: var(--text);
  font-size: 15px;
  font-weight: var(--font-book);
  text-rendering: optimizeLegibility;
}

button,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: flex;
  height: 100dvh;
  min-height: 100%;
}

.sidebar {
  background: var(--sidebar);
  display: flex;
  flex: 0 0 260px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 8px;
  position: relative;
  z-index: 30;
}

.sidebar-top {
  min-height: 0;
  overflow: hidden;
}

.new-chat-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  font-size: 14px;
  gap: 12px;
  height: 46px;
  padding: 0 13px;
  text-align: left;
  transition: background 120ms ease;
  width: 100%;
}

.new-chat-button:hover,
.menu-button:hover,
.conversation-item:hover,
.conversation-item.active {
  background: var(--sidebar-hover);
}

.new-chat-button svg,
.menu-button svg,
.menu-button .discord-icon,
.conversation-icon,
.conversation-action svg {
  height: 18px;
  width: 18px;
}

.discord-icon {
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  max-height: calc(100dvh - 300px);
  overflow-y: auto;
}

.conversation-item {
  align-items: center;
  border-radius: 6px;
  display: flex;
  min-height: 44px;
  padding: 0 8px 0 11px;
  transition: background 120ms ease;
}

.conversation-select {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  flex: 1;
  gap: 11px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.conversation-title {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-actions {
  align-items: center;
  display: none;
}

.conversation-item.active .conversation-actions,
.conversation-item:hover .conversation-actions {
  display: flex;
}

.conversation-action {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 5px;
}

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

.sidebar-menu {
  border-top: 1px solid var(--subtle-border);
  padding-top: 6px;
}

.menu-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  display: flex;
  font-size: 14px;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.main-panel {
  background: var(--main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.mobile-header {
  display: none;
}

.landing,
.chat-view {
  bottom: 118px;
  left: 0;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: 0;
}

.landing {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 48px 24px 40px;
}

.landing-inner {
  max-width: 768px;
  transform: translateY(-5vh);
  width: 100%;
}

.landing h1 {
  font-size: 34px;
  font-weight: var(--font-book);
  letter-spacing: -0.8px;
  margin: 0 0 54px;
  text-align: center;
}

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

.intro-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro-heading {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1px;
}

.intro-heading svg {
  height: 25px;
  width: 25px;
}

.intro-heading h2 {
  font-size: 17px;
  font-weight: var(--font-book);
  margin: 0;
}

.prompt-card,
.info-card {
  align-items: center;
  background: var(--card);
  border: 0;
  border-radius: 6px;
  display: flex;
  font-size: 13.5px;
  justify-content: center;
  line-height: 1.35;
  min-height: 66px;
  padding: 12px;
  text-align: center;
}

.prompt-card:hover {
  background: var(--card-hover);
}

.chat-view {
  bottom: 0;
}

.messages {
  padding-bottom: 190px;
}

.message-row {
  border-bottom: 1px solid var(--subtle-border);
  width: 100%;
}

.message-row.assistant {
  background: var(--assistant);
}

.message-inner {
  display: grid;
  gap: 24px;
  grid-template-columns: 30px minmax(0, 1fr) 62px;
  margin: 0 auto;
  max-width: 800px;
  padding: 27px 18px 28px;
}

.avatar {
  align-items: center;
  border-radius: 2px;
  color: #fff;
  display: flex;
  font-size: 13px;
  height: 30px;
  justify-content: center;
  overflow: hidden;
  width: 30px;
}

.user-avatar {
  background: #9b51e0;
}

.assistant-avatar {
  background: var(--logo-green);
}

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

.message-content {
  color: var(--chat-text);
  font-size: 16px;
  font-weight: var(--font-book);
  line-height: 1.65;
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-content p {
  margin: 0 0 16px;
}

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

.message-content pre {
  background: #000;
  border-radius: 6px;
  color: #fff;
  font-family: "Söhne Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: var(--font-book);
  line-height: 1.55;
  overflow-x: auto;
  padding: 15px;
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-start;
}

.message-action {
  background: transparent;
  border: 0;
  color: var(--quiet);
  height: 28px;
  padding: 4px;
  width: 28px;
}

.message-action:hover,
.message-action.selected {
  color: var(--text);
}

.message-action.selected {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.message-action svg {
  height: 19px;
  width: 19px;
}

.typing-cursor::after {
  animation: blink 850ms infinite;
  background: var(--text);
  content: "";
  display: inline-block;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: -2px;
  width: 6px;
}

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

.composer-area {
  background: linear-gradient(180deg, rgba(53, 53, 65, 0), var(--main) 28%);
  bottom: 0;
  left: 0;
  padding: 42px 24px 12px;
  position: absolute;
  right: 0;
  z-index: 15;
}

:root.light .composer-area {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--main) 28%);
}

.composer {
  align-items: flex-end;
  background: var(--composer);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: flex;
  margin: 0 auto;
  max-width: 768px;
  min-height: 50px;
  padding: 10px 44px 10px 13px;
  position: relative;
}

:root.light .composer {
  border-color: rgba(0, 0, 0, 0.1);
}

.composer textarea {
  background: transparent;
  border: 0;
  max-height: 200px;
  min-height: 26px;
  outline: none;
  overflow-y: auto;
  padding: 2px 0;
  resize: none;
  width: 100%;
}

.send-button {
  background: transparent;
  border: 0;
  bottom: 10px;
  color: var(--muted);
  height: 30px;
  padding: 5px;
  position: absolute;
  right: 10px;
  width: 30px;
}

.send-button:not(:disabled):hover {
  background: var(--sidebar-hover);
  border-radius: 4px;
  color: var(--text);
}

.send-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.send-button svg {
  height: 19px;
  width: 19px;
}

.regenerate-button {
  align-items: center;
  background: var(--main);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  font-size: 14px;
  gap: 8px;
  margin: -34px auto 10px;
  min-height: 38px;
  padding: 7px 12px;
}

.regenerate-button:hover {
  background: var(--card);
}

.regenerate-button svg {
  height: 16px;
  width: 16px;
}

.footer-copy {
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.4;
  margin: 10px auto 0;
  max-width: 900px;
  text-align: center;
}

.footer-copy a {
  color: inherit;
}

.toast {
  background: #202123;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  bottom: 102px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  color: #fff;
  left: 50%;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  z-index: 100;
}

.disclaimer-overlay {
  align-items: center;
  background: rgba(32, 33, 35, 0.76);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 90;
}

.disclaimer-dialog {
  background: #202123;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color: #ececf1;
  max-width: 512px;
  padding: 32px 24px 24px;
  width: 100%;
}

.disclaimer-dialog h2 {
  font-size: 24px;
  font-weight: var(--font-kraftig);
  letter-spacing: -0.3px;
  margin: 0;
}

.disclaimer-divider {
  background: rgba(255, 255, 255, 0.14);
  height: 1px;
  margin: 24px 0 26px;
}

.disclaimer-intro {
  font-size: 16px;
  font-weight: var(--font-kraftig);
  margin: 0 0 18px;
}

.disclaimer-card {
  align-items: center;
  background: #343541;
  border-radius: 5px;
  display: grid;
  gap: 20px;
  grid-template-columns: 32px minmax(0, 1fr);
  margin-top: 14px;
  min-height: 74px;
  padding: 14px 20px;
}

.disclaimer-card p {
  font-size: 14px;
  font-weight: var(--font-halbfett);
  line-height: 1.45;
  margin: 0;
}

.disclaimer-symbol {
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.disclaimer-symbol-large {
  font-size: 28px;
}

.disclaimer-card a {
  color: #fff;
  font-weight: var(--font-kraftig);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.disclaimer-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}

.disclaimer-back,
.disclaimer-next {
  background: #343541;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 5px;
  color: #fff;
  font-size: 14px;
  min-height: 40px;
  padding: 8px 17px;
}

.disclaimer-next {
  margin-left: auto;
}

.disclaimer-next.done {
  background: #10a37f;
  border-color: #10a37f;
}

.disclaimer-back:hover,
.disclaimer-back:focus-visible,
.disclaimer-next:hover,
.disclaimer-next:focus-visible {
  background: #40414f;
  outline: 2px solid #8e8eff;
  outline-offset: 2px;
}

.disclaimer-next.done:hover,
.disclaimer-next.done:focus-visible {
  background: #0e8f70;
}

.mobile-backdrop {
  background: rgba(0, 0, 0, 0.55);
  inset: 0;
  position: fixed;
  z-index: 25;
}

@media (max-width: 767px) {
  .sidebar {
    bottom: 0;
    left: 0;
    position: fixed;
    top: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-panel {
    width: 100%;
  }

  .mobile-header {
    align-items: center;
    background: var(--main);
    border-bottom: 1px solid var(--subtle-border);
    display: flex;
    height: 44px;
    justify-content: space-between;
    padding: 0 9px;
  }

  .mobile-header span {
    font-size: 14px;
  }

  .icon-button {
    background: transparent;
    border: 0;
    height: 34px;
    padding: 7px;
    width: 34px;
  }

  .icon-button svg {
    height: 20px;
    width: 20px;
  }

  .landing,
  .chat-view {
    top: 44px;
  }

  .landing {
    align-items: flex-start;
    padding: 30px 12px 155px;
  }

  .landing-inner {
    transform: none;
  }

  .landing h1 {
    font-size: 32px;
    margin-bottom: 34px;
  }

  .intro-grid {
    gap: 24px;
    grid-template-columns: 1fr;
  }

  .intro-column {
    gap: 9px;
  }

  .prompt-card,
  .info-card {
    min-height: 52px;
  }

  .message-inner {
    gap: 14px;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 20px 14px 22px;
  }

  .message-actions {
    grid-column: 2;
  }

  .composer-area {
    padding: 38px 10px 9px;
  }

  .footer-copy {
    font-size: 10px;
  }

  .disclaimer-overlay {
    padding: 16px;
  }

  .disclaimer-dialog {
    padding: 25px 18px 20px;
  }

  .disclaimer-card {
    gap: 12px;
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 13px 14px;
  }
}
