* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: #20231c;
  background: #f6f7ef;
  --paper: #f6f7ef;
  --panel: #fcfdf8;
  --ink: #20231c;
  --muted: #68705d;
  --line: #dce1d2;
  --green: #b7d778;
  --deep-green: #36502a;
  --lime: #d9ff83;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 0 49.94%, #87966b0b 50%, transparent 50.06%),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #6f923d;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.topbar {
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: #f8f9f3e8;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 25px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0;
}

.branddot {
  color: #86a949;
}

.brand-mark {
  width: 34px;
  height: 34px;
  position: relative;
  overflow: hidden;
  flex: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

nav button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #4c5344;
  font-size: 13px;
  transition: background-color 140ms ease, border-color 140ms ease;
}

nav button:hover {
  border-color: var(--line);
  background: #edf0e5;
}

nav button:last-child {
  border-color: #d5ddc8;
  background: #eef2e7;
}

i[data-i] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-style: normal;
}

i svg {
  display: block;
  width: 17px;
  height: 17px;
}

main {
  min-height: 0;
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 25%, #e8eddc 0, #e8eddc00 51%),
    repeating-linear-gradient(0deg, #5c6e3d08 0, #5c6e3d08 1px, transparent 1px, transparent 28px);
}

.workspace {
  width: min(940px, calc(100% - 40px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 24px;
}

#welcome {
  width: 100%;
  margin: auto 0;
  animation: rise-in 500ms ease both;
}

.hero {
  min-height: 270px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: clamp(18px, 4vw, 56px);
  padding: 15px 3.5% 22px;
}

.heroText {
  position: relative;
  z-index: 1;
  max-width: 495px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #667451;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 1.6px;
}

.eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8db649;
  box-shadow: 0 0 0 4px #b7d77835;
}

h1 {
  margin: 19px 0 12px;
  font-size: clamp(54px, 6vw, 78px);
  font-weight: 540;
  line-height: 0.99;
  letter-spacing: 0;
}

h1 em {
  color: #688448;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.heroText > p {
  max-width: 370px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.sculpture {
  display: block;
  width: min(100%, 360px);
  height: auto;
  aspect-ratio: 360 / 260;
  object-fit: contain;
  animation: mark-arrive 650ms 80ms ease both;
}

.starts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 20px 3.5% 22px;
  border-top: 1px solid #dfe4d5;
  border-bottom: 1px solid #dfe4d5;
}

.starts button {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  text-align: left;
  border: 1px solid #dce2d2;
  border-radius: 4px;
  background: #fafbf6b5;
  color: #41483a;
  font-size: 13px;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.starts button:hover {
  transform: translateY(-2px);
  border-color: #a7be7e;
  background: #fff;
}

.starts button i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #dae4c8;
  border-radius: 3px;
  background: #eef4e2;
  color: #58733a;
}

.footnote {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin: 15px 3.5% 0;
  color: #777e6c;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.footnote svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: #72815d;
}

#composer {
  flex: none;
  width: 100%;
  padding: 14px 15px 10px;
  border: 1px solid #cbd4bd;
  border-radius: 5px;
  background: var(--panel);
  box-shadow: 0 8px 24px #303a200c;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#composer:focus-within {
  border-color: #8da969;
  box-shadow: 0 0 0 3px #a8c87722;
}

#message {
  display: block;
  width: 100%;
  max-height: 116px;
  min-height: 56px;
  padding: 4px 5px 8px;
  resize: none;
  border: 0;
  outline: 0 !important;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
}

#message::placeholder {
  color: #8a9180;
}

.tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 37px;
}

.attach,
.actionBtn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #59614f;
  font-size: 12px;
}

.attach:hover,
.actionBtn.secondary:hover {
  border-color: #d6dfc9;
  background: #f0f3e9;
}

.sendGroup {
  display: flex;
  align-items: center;
  gap: 7px;
}

.send,
.stopBtn,
.icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #59614f;
}

.send {
  background: #354d2b;
  color: #f7f9f0;
}

.send:hover:not(:disabled) {
  background: #4e6b3b;
}

.send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stopBtn {
  background: #8d4034;
  color: white;
}

footer {
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 76px);
  border-top: 1px solid var(--line);
  color: #727968;
  font-size: 11px;
  letter-spacing: 0.3px;
}

body.chatting main {
  background: #f5f6ef;
}

body.chatting .workspace {
  justify-content: flex-start;
  width: min(800px, calc(100% - 40px));
  padding: 18px 0 13px;
}

#thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.threadHeader {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 3px 11px;
  border-bottom: 1px solid var(--line);
}

#threadTitle {
  overflow: hidden;
  margin: 0;
  color: #373d30;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtleBtn {
  flex: none;
  padding: 6px 10px;
  border: 1px solid #dce1d2;
  border-radius: 3px;
  color: #656d5c;
  font-size: 11px;
}

.subtleBtn:hover {
  background: #edf0e6;
}

#scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px 3px 10px;
  scrollbar-color: #c3cdb5 transparent;
  scrollbar-width: thin;
}

.msg {
  max-width: 100%;
  margin: 0 0 22px;
  line-height: 1.6;
  animation: rise-in 220ms ease both;
}

.who {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  color: #525a48;
  font-size: 11px;
  font-weight: 700;
}

.who .miniMark {
  width: 19px;
  height: 19px;
  display: inline-flex;
  overflow: hidden;
}

.miniMark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bubble {
  overflow-wrap: anywhere;
  color: #30362a;
  font-size: 14px;
}

.msg.user {
  width: fit-content;
  max-width: min(84%, 620px);
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid #dce4ce;
  border-radius: 5px 5px 1px 5px;
  background: #edf2e4;
}

.msg.user .who {
  color: #566a3e;
}

.msg.user .bubble {
  white-space: pre-wrap;
}

.markdownBody > :first-child { margin-top: 0; }
.markdownBody > :last-child { margin-bottom: 0; }
.markdownBody p { margin: 0 0 9px; }
.markdownBody h1,
.markdownBody h2,
.markdownBody h3 { margin: 13px 0 6px; line-height: 1.3; }
.markdownBody h1 { font-size: 1.25rem; }
.markdownBody h2 { font-size: 1.12rem; }
.markdownBody h3 { font-size: 1rem; }
.markdownBody ul,
.markdownBody ol { margin: 6px 0 10px; padding-left: 22px; }
.markdownBody blockquote { margin: 8px 0; padding: 3px 12px; border-left: 2px solid #8eac62; color: #606853; }
.markdownBody code.inline-code { padding: 1px 5px; border-radius: 3px; background: #ebeee5; font-family: ui-monospace, Consolas, monospace; font-size: 0.88em; }
.markdownBody table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 13px; }
.markdownBody th,
.markdownBody td { padding: 6px 9px; border: 1px solid var(--line); text-align: left; }
.markdownBody th { background: #edf0e6; }
.markdownBody a { color: #42632f; }

.code-block-wrap {
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid #323a2e;
  border-radius: 4px;
  background: #1d241d;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid #ffffff1b;
  color: #c5d0b9;
  font-size: 11px;
}

.copy-code-btn {
  padding: 3px 8px;
  border: 1px solid #ffffff35;
  border-radius: 3px;
  color: #ecf1e6;
  font-size: 11px;
}

.code-block-wrap pre {
  overflow-x: auto;
  margin: 0;
  padding: 12px;
  color: #ecf1e6;
  font: 12px/1.5 ui-monospace, Consolas, monospace;
}

.msgAttachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.msgAttachments img {
  max-width: 220px;
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: cover;
}

.textAttachBadge {
  padding: 4px 9px;
  border-radius: 3px;
  background: #edf1e5;
  color: #58664a;
  font-size: 11px;
}

.typingCursor {
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 3px;
  background: #77994e;
  vertical-align: text-bottom;
  animation: cursor-blink 850ms steps(1) infinite;
}

.threadActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}

.actionBtn {
  border-color: #ccd7bc;
  background: #eaf0dd;
  color: #3c542e;
  font-weight: 620;
}

.actionBtn:hover {
  border-color: #9eb675;
  background: #dfe9cc;
}

.actionBtn.secondary {
  border-color: #dce1d2;
  background: transparent;
  color: #626b57;
  font-weight: 500;
}

#fileLine {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 3px 8px;
}

.attachChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #d6dfc9;
  border-radius: 3px;
  background: #f2f5eb;
  color: #536147;
  font-size: 11px;
}

.attachChip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachChip img {
  width: 27px;
  height: 27px;
  border-radius: 2px;
  object-fit: cover;
}

.attachRemove {
  padding: 0 3px;
  color: #737b69;
  font-size: 15px;
}

dialog {
  width: min(460px, calc(100% - 28px));
  max-height: min(80dvh, 640px);
  padding: 20px;
  border: 1px solid #cfd7c2;
  border-radius: 5px;
  background: #fbfcf7;
  color: var(--ink);
  box-shadow: 0 18px 60px #25301c2b;
}

dialog::backdrop {
  background: #1a21145e;
  backdrop-filter: blur(2px);
}

.historyHead,
.query {
  display: flex;
  align-items: center;
  gap: 9px;
}

.historyHead {
  justify-content: space-between;
  margin-bottom: 13px;
}

.historyHead h2 {
  margin: 0;
  font-size: 17px;
}

.query {
  padding: 8px 11px;
  border: 1px solid #dce1d2;
  border-radius: 3px;
  background: #f1f3eb;
  color: #717966;
}

.query input {
  width: 100%;
  min-width: 0;
  padding: 3px;
  border: 0;
  outline: none;
  background: transparent;
}

#matches {
  max-height: 48dvh;
  overflow: auto;
  margin-top: 11px;
}

#matches p {
  color: var(--muted);
  font-size: 13px;
}

.recentRow {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 3px;
}

.recent {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 3px;
  text-align: left;
  font-size: 13px;
}

.recent span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent.active,
.recent:hover,
.deleteChatBtn:hover {
  background: #edf1e5;
}

.deleteChatBtn {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: #737b69;
}

#notice:not(:empty) {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 56px;
  max-width: calc(100vw - 28px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid #516a3d;
  border-radius: 4px;
  background: #34472a;
  color: #f7f9f2;
  font-size: 13px;
  box-shadow: 0 8px 24px #26331e2b;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mark-arrive {
  from { opacity: 0; transform: translateY(7px) rotate(1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

@media (max-width: 700px) {
  .topbar {
    height: 62px;
    flex-basis: 62px;
    padding: 0 16px;
  }

  .wordmark { font-size: 23px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark img { width: 100%; height: 100%; }
  nav { gap: 2px; }
  nav button { min-height: 36px; gap: 6px; padding: 7px 9px; font-size: 12px; }
  nav button svg { width: 15px; height: 15px; }

  .workspace {
    width: calc(100% - 28px);
    padding: 22px 0 16px;
  }

  .hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 36%);
    gap: 4px;
    padding: 5px 0 18px;
  }

  .eyebrow { font-size: 9px; letter-spacing: 1.2px; }
  h1 { margin-top: 15px; font-size: clamp(45px, 11vw, 62px); }
  .heroText > p { max-width: 255px; margin-top: 13px; font-size: 13px; }
  .sculpture { width: 100%; }
  .starts { grid-template-columns: 1fr; gap: 7px; padding: 14px 0; }
  .starts button { min-height: 47px; padding: 7px 10px; }
  .starts button i { width: 28px; height: 28px; }
  .footnote { margin: 12px 0 0; font-size: 10px; }
  #composer { padding: 11px 10px 8px; }
  #message { min-height: 51px; font-size: 14px; }

  body.chatting .workspace {
    width: calc(100% - 24px);
    padding: 11px 0 8px;
  }

  .msg.user { max-width: 92%; }
  .bubble { font-size: 13px; }
  #scroll { padding-top: 13px; }
  footer { height: 36px; flex-basis: 36px; padding: 0 14px; font-size: 10px; }
}

@media (max-width: 400px) {
  nav button { padding: 7px; }
  nav button span { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr) 108px; }
  h1 { font-size: 45px; }
}

@media (max-height: 660px) and (min-width: 701px) {
  .workspace { padding-top: 12px; padding-bottom: 10px; }
  .hero { min-height: 210px; }
  .sculpture { width: 300px; }
  .starts { padding-top: 12px; padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}