@font-face {
  font-family: "Unbounded";
  src: url("/assets/unbounded.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/ibm-plex-mono.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --canvas: #eff6f3;
  --panel: #f7faf8;
  --surface: #ffffff;
  --surface-raised: #e2efea;
  --line: #d6e3de;
  --line-bright: #aac9bd;
  --text: #0c1f1c;
  --muted: #46645c;
  --subtle: #557168;
  --accent: #276c61;
  --accent-light: #164d44;
  --accent-dim: #dceee5;
  --mint: #9df0da;
  --violet: #9364ff;
  --sidebar-width: 228px;
  --profile-width: 302px;
  --topbar-height: 72px;
  --chat-inline: clamp(26px, 3vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--text); }
button, textarea, input { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
a { color: inherit; }
:where(a, button, textarea, input, [tabindex]):focus-visible {
  outline: 2px solid #26725d;
  outline-offset: 3px;
}
:where(h1, h2, h3, p, ul) { margin: 0; }
[hidden] { display: none !important; }
::selection { color: #fff; background: #0f766e; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 12; top: 12px; left: 12px; transform: translateY(calc(-100% - 16px)); padding: 10px 13px; border-radius: 8px; background: var(--mint); color: #15302f; font-size: .875rem; font-weight: 800; text-decoration: none; }
.skip-link:focus { transform: none; }
.icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--profile-width);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  grid-area: 1 / 1 / -1 / 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  background: #f8fbf9;
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 0 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #143c33;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.04em;
  white-space: nowrap;
 font-family: "Unbounded", system-ui, sans-serif; }
.brand-quest { color: #377e6e; font-weight: 700; }
.brand-symbol {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid #a97bff;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #72b9a6, #296f61 65%, #194c41);
  box-shadow: inset 0 1px 0 #d4fff180, 0 3px 0 #174c40, 0 5px 12px #347c6040;
 border-color: #6aa891; }
.brand-symbol svg { width: 33px; height: 33px; }
.sidebar-content { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; padding: 18px 2px; }
.new-chat {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #a1f3dc;
  border-radius: 10px;
  background: linear-gradient(165deg, #438c7c, #246356);
  box-shadow: inset 0 1px 0 #b0e0ce80, 0 3px 0 #164438, 0 7px 15px #255b4320;
  color: #fff;
  font-size: .875rem;
  font-weight: 750;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
 border-color: #538f7f; }
.new-chat:hover {
  transform: translateY(-1px);
  background: linear-gradient(165deg, #559c8b, #2a7161);
  box-shadow: inset 0 1px 0 #c0eee080, 0 4px 0 #164438, 0 9px 18px #255b432c;
}
.new-chat:active { transform: translateY(1px); }
.new-chat .icon { width: 17px; height: 17px; stroke-width: 2; }
.nav-list { display: grid; gap: 4px; margin-top: 25px; }
.nav-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: .875rem;
  font-weight: 650;
}
.nav-item .icon { width: 19px; height: 19px; }
.nav-item:hover { color: var(--text); background: #e7f0eb; }
.nav-item.is-active {
  border-color: #c5ddd0;
  background: #deeee6;
  color: #205e4f;
  box-shadow: inset 3px 0 0 #397d68;
}
.nav-item.is-active .icon { color: #2e7560; }
.history-section { margin-top: 29px; padding-top: 21px; border-top: 1px solid var(--line); }
.history-section h2 {
  margin: 0 8px 11px;
  color: #526c61;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.history-empty {
  padding: 5px 8px;
  color: var(--subtle);
  font-size: .8125rem;
  line-height: 1.65;
}
.chat-list { display: grid; gap: 3px; padding: 0; list-style: none; }
.history-item { display: flex; align-items: center; min-width: 0; min-height: 40px; border-radius: 8px; }
.history-item:hover, .history-item:focus-within, .history-item.is-active, .history-item[aria-current="true"] { background: #e0eee5; }
.history-link {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: 7px;
  padding: 9px 7px;
  border-radius: 8px;
  color: #305d4f;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: .875rem;
}
.history-link .icon { width: 16px; height: 16px; color: #557c69; }
.history-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-actions { display: flex; flex-shrink: 0; align-items: center; padding-right: 3px; opacity: 0; }
.history-item:hover .history-actions, .history-item:focus-within .history-actions { opacity: 1; }
.history-action {
  display: grid;
  width: 25px;
  height: 29px;
  padding: 0;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}
.history-action:hover { color: var(--text); background: #c9dfd2; }
.history-action .icon { width: 14px; height: 14px; }
@media (hover: none) { .history-actions { opacity: 1; } }
.sidebar-footer {
  display: flex;
  min-height: 70px;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-top: 1px solid var(--line);
}
.network-icon {
  display: grid;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid #3c2e57;
  border-radius: 9px;
  background: #e1efe6;
  color: var(--accent);
 border-color: #c6dcd0; }
.network-icon .icon { width: 17px; height: 17px; }
.sidebar-footer strong, .sidebar-footer div span { display: block; }
.sidebar-footer strong { color: #254a3d; font-size: .8125rem; font-weight: 700; }
.sidebar-footer div span { margin-top: 3px; color: var(--subtle); font-size: .75rem; }

.topbar {
  grid-area: 1 / 2 / 2 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 24px 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfbea;
}
.topbar-leading, .topbar-actions, .topbar-title {
  display: flex;
  min-width: 0;
  align-items: center;
}
.topbar-leading { gap: 6px; }
.topbar-title { gap: 10px; color: #163c31; font-size: 1rem; font-weight: 750; }
#chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title-icon { display: inline-flex; color: #45786b; }
.topbar-title-icon .icon { width: 19px; height: 19px; }
.topbar-actions { flex-shrink: 0; gap: 12px; }
.mode-pill {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  white-space: nowrap;
  border: 1px solid #3a2d51;
  border-radius: 8px;
  background: #e3f1ec;
  color: #2f6b61;
  font-size: .8125rem;
  font-weight: 650;
 border-color: #bfdcd2; }
.status-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #3aa28f; box-shadow: 0 0 8px #3aa28f86; }
body[data-mode="live"] .status-dot { background: #70e6ba; box-shadow: 0 0 8px #70e6ba78; }
body[data-mode="offline"] .status-dot { background: #f7a591; box-shadow: 0 0 8px #f7a59160; }
.wallet-button {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #53817a;
  border-radius: 9px;
  background: linear-gradient(160deg, #f5fcf8, #e1eee6);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #d1dfd4;
  color: #244f40;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 750;
 border-color: #b5cfc0; }
.wallet-button:hover { border-color: #83ab97; background: #d9ede1; color: #1b4435; }
.wallet-button .icon { width: 17px; height: 17px; color: #3e7962; }
.icon-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border-radius: 8px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--text); background: #dbeadf; }
.mobile-nav-toggle, .mobile-profile-toggle, .drawer-close, .drawer-backdrop { display: none; }

.chat-area {
  grid-area: 2 / 2 / 3 / 3;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: radial-gradient(ellipse at 80% 10%, #dceee5, transparent 55%), #eff6f3;
}
.chat-scroll { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #accabb transparent; }
.chat-scroll:focus-visible { outline-offset: -3px; }
.chat-empty, .messages, .composer-inner { width: min(100%, 1050px); margin-inline: auto; padding-inline: var(--chat-inline); }
.chat-empty { padding-block: clamp(21px, 4dvh, 43px) 25px; }
.hero {
  position: relative;
  display: flex;
  min-height: clamp(276px, 36dvh, 340px);
  align-items: center;
  overflow: hidden;
  border: 1px solid #2f6b61;
  border-radius: 19px;
  background: #0d2421;
  box-shadow: 0 12px 30px #355b4830;
 isolation: isolate; }
.hero::before, .hero::after, .hero-grid { position: absolute; content: ""; pointer-events: none; }
.hero::before {
  z-index: 0;
  inset: 0;
  background: radial-gradient(ellipse at 75% 49%, #1d5a52, #12332f 50%, #0c2421 77%);
  background-image: url("/assets/quest-hero.webp"), radial-gradient(ellipse at 75% 49%, #1d5a52, #12332f 50%, #0c2421 77%);
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  /* The artwork is rendered in violet; shift it to the kinetta teal palette. */
  filter: hue-rotate(-82deg) saturate(.9);
}
.hero::after {
  z-index: 1;
  inset: 0;
  background: linear-gradient(90deg, #0d2421 1%, #0d2420 19%, #0d2420e8 35%, #0b1f1c40 61%, #0d241f00 79%), linear-gradient(0deg, #06161431, transparent 37%);
}
.hero-grid {
  z-index: 2;
  inset: 0;
  opacity: .68;
  mask-image: linear-gradient(90deg, #000 0%, transparent 48%);
  background: linear-gradient(#7fffe00a 1px, transparent 1px), linear-gradient(90deg, #7fffe00a 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero-content { position: relative; z-index: 3; width: max-content; max-width: 100%; padding: 30px clamp(20px, 3vw, 43px); }
.hero-tag {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #3f8c80;
  border-radius: 6px;
  background: #134039b5;
  color: #c9f5ea;
  font: 400 .6875rem/1 var(--mono);
  letter-spacing: .075em;
  text-transform: uppercase;
 font-size: .75rem; }
.hero-tag .icon { width: 13px; height: 13px; }
.hero h1 {
  margin-top: 15px;
  color: #f4fffb;
  font-size: clamp(1.8rem, 2.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1.17;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 2px 16px #06201bb0;
 font-family: "Unbounded", system-ui, sans-serif; }
.hero h1 span { color: #9df0da; }
.hero p { max-width: 29ch; margin-top: 16px; color: #d3e8e2; font-size: 1rem; font-weight: 500; line-height: 1.65; }
.starters { margin-top: 27px; }
.starters h2 { margin-bottom: 13px; font-size: .9375rem; font-weight: 750; letter-spacing: -.015em; }
.starter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.starter-card {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid #3d3153;
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff, #f5faf6);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #d9e6dd, 0 7px 16px #45644d08;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
 border-color: #cbded2; }
.starter-card:hover {
  transform: translateY(-2px);
  border-color: #8fb6a1;
  box-shadow: inset 0 1px 0 #fff, 0 5px 0 #cbded1, 0 10px 18px #45644d20;
}
.starter-card:active { transform: translateY(0); }
.starter-icon {
  display: grid;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid #3f8c80;
  border-radius: 8px;
  color: #bff5e6;
  background: linear-gradient(153deg, #2f8576, #1d5a52);
  box-shadow: inset 0 1px 0 #a9f0dc35, 0 2px 0 #123d37;
}
.starter-icon .icon { width: 17px; height: 17px; }
.starter-cyan .starter-icon { border-color: #3a6972; color: #9ee9e3; background: linear-gradient(153deg, #2e515e, #213747); box-shadow: inset 0 1px 0 #9ae3e133, 0 2px 0 #16242c; }
.starter-peach .starter-icon { border-color: #87546b; color: #ffb8cb; background: linear-gradient(153deg, #65384f, #422a43); box-shadow: inset 0 1px 0 #ecb0c735, 0 2px 0 #2e1a2d; }
.starter-card strong, .starter-card small { display: block; overflow-wrap: anywhere; }
.starter-card strong { color: #244436; font-size: .875rem; font-weight: 750; line-height: 1.35; }
.starter-card small { margin-top: 3px; color: #597062; font-size: .75rem; font-weight: 550; line-height: 1.35; }

.messages { display: grid; align-content: start; gap: 25px; padding-block: 34px 24px; }
.message-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.message-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #3f8c80;
  border-radius: 11px;
  background: linear-gradient(155deg, #3f9a8b, #1d5a52);
  color: #e6fff8;
  font-size: .75rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 #b0f0e053, 0 2px 0 #123d37;
}
.message-avatar .icon { width: 17px; height: 17px; }
.message-row.user .message-avatar { border-color: #558c71; background: linear-gradient(155deg, #528774, #285642); box-shadow: inset 0 1px 0 #b1dcc680, 0 2px 0 #234533; }
.message-main { min-width: 0; flex: 1; padding: 0 1px; }
.message-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: #254f3c; font-size: .875rem; font-weight: 750; line-height: 1.45; }
.message-header time { color: var(--subtle); font: 400 .6875rem var(--mono); }
.message-text { margin-top: 6px; color: #183a2c; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-text :where(h3, p, pre, ul, ol, blockquote) + :where(h3, p, pre, ul, ol, blockquote) { margin-top: 11px; }
.message-text :where(h3) { color: #163b2c; font-size: 1rem; }
.message-text :where(pre, code) { font: 400 .85rem/1.55 var(--mono); }
.message-text pre { max-width: 100%; overflow: auto; padding: 11px 13px; border: 1px solid var(--line-bright); border-radius: 8px; background: #e7efe9; white-space: pre; }
.message-text code:not(pre code) { padding: 2px 4px; border-radius: 4px; background: #dce9e1; color: #1e5840; }
.message-text a { color: #267657; text-underline-offset: 3px; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 5px; color: var(--subtle); font-size: .75rem; }
.message-meta:empty { display: none; }
.copy-message { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 0 7px; border-radius: 6px; background: transparent; color: var(--muted); }
.copy-message:hover { background: var(--accent-dim); color: var(--accent-light); }
.copy-message .icon { width: 15px; height: 15px; }
.message-row.is-pending .message-text { color: #476e5c; }
.thinking-dots { display: inline-flex; gap: 4px; margin-inline: 6px; vertical-align: 3px; }
.thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: #3aa28f; animation: thinking 1.2s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes thinking { 45% { transform: translateY(-4px); opacity: .55; } }

.composer-dock { flex-shrink: 0; padding-block: 12px max(17px, env(safe-area-inset-bottom)); }
.composer-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #51766f;
  border-radius: 23px;
  background: linear-gradient(160deg, #ffffff, #f8fcf9);
  box-shadow: inset 0 1px 0 #fff, 0 12px 35px #245a3e1f;
 border-color: #d1e1d7; }
.composer-form:focus-within { border-color: #6eac8f; box-shadow: 0 0 0 3px #76bea521, 0 12px 35px #245a3e1f; }
.composer-form textarea {
  width: 100%;
  min-height: 49px;
  max-height: 128px;
  overflow: auto;
  padding: 14px 17px 0;
  border: 0;
  resize: none;
  background: transparent;
  color: #143b2b;
  font-size: 1rem;
  line-height: 1.45;
}
.composer-form textarea:focus-visible { outline: none; }
.composer-form textarea::placeholder { color: #687e70; opacity: 1; }
.composer-actions { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 5px 10px 9px 13px; }
.model-pill { display: inline-flex; min-height: 31px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid #415f64; border-radius: 16px; background: #ecf4ef; color: #416f57; font: 400 .6875rem/1.2 var(--mono);  border-color: #d3e2d7;  font-size: .75rem; }
.model-pill .icon { width: 15px; height: 15px; color: #4b8668; }
.send-button {
  display: grid;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  border: 1px solid #a9f4df;
  border-radius: 12px;
  background: linear-gradient(160deg, #478d74, #28684f);
  box-shadow: inset 0 1px 0 #a9e3c780, 0 3px 0 #19492e;
  color: white;
 border-color: #4c8b6b; }
.send-button:not(:disabled):hover { background: linear-gradient(160deg, #59a387, #377d5f); }
.send-button:not(:disabled):active { transform: translateY(1px); }
.send-button:disabled { border-color: #ccded1; background: #d8e6dd; color: #597968; box-shadow: inset 0 1px 0 #fff; }
.send-button .icon { width: 18px; height: 18px; stroke-width: 1.85; }
.composer-hint { margin-top: 12px; color: #617569; text-align: center; font-size: .75rem; }
.composer-hint kbd { color: #526d5d; font: inherit; }
.composer-hint > span { margin: 0 4px; }
.error-box, .connection-notice { margin-bottom: 10px; padding: 9px 12px; border: 1px solid #725071; border-radius: 9px; background: #fff0ec; color: #863d2f; font-size: .875rem; line-height: 1.55;  border-color: #dbb3a8; }
.error-box { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.error-box .quiet-button { flex-shrink: 0; }
.connection-notice { border-color: #b9d3c2; background: #e4f0e8; color: #345e45; }

.profile-panel {
  grid-area: 2 / 3 / 3 / -1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #f8fbf9;
}
.profile-panel:focus-visible { outline-offset: -3px; }
.profile-heading {
  display: flex;
  flex: 0 0 auto;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.profile-heading > div { display: flex; align-items: center; gap: 9px; }
.profile-heading h2 { color: #254332; font-size: .9375rem; font-weight: 800; letter-spacing: -.015em; }
.profile-heading-icon { display: inline-flex; color: #517962; }
.profile-heading-icon .icon { width: 19px; height: 19px; }
.profile-content { min-height: 0; flex: 1; overflow-y: auto; padding: 17px 17px max(23px, env(safe-area-inset-bottom)); scrollbar-width: thin; scrollbar-color: #accabb transparent; }
.level-card {
  position: relative;
  overflow: hidden;
  padding: 12px 12px 13px;
  border: 1px solid #503868;
  border-radius: 12px;
  background: radial-gradient(ellipse at 15% 10%, #c7e8de, transparent 65%), linear-gradient(155deg, #f4fbf8, #e1f1ec);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #c4dccf;
 border-color: #bcdad0; }
.level-top { display: flex; min-width: 0; min-height: 64px; align-items: center; gap: 8px; margin: 0 0 7px -2px; }
.level-top > div { min-width: 0; }
.level-emblem { display: block; width: 61px; height: 64px; flex: 0 0 auto; filter: drop-shadow(0 6px 8px #3aa28f40); }
.level-top h3 { color: #14504a; font-size: 1rem; font-weight: 800; letter-spacing: -.045em;  font-family: "Unbounded", system-ui, sans-serif; }
.level-top p { max-width: 160px; margin-top: 4px; overflow: hidden; color: #46645c; font-size: .8125rem; text-overflow: ellipsis; white-space: nowrap; }
.meter-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 7px; color: #46645c; font-size: .8125rem; line-height: 1.35; }
.meter-label strong { color: #14504a; white-space: nowrap; font: 400 .6875rem var(--mono);  font-size: .75rem; }
.meter-track { height: 8px; overflow: hidden; border: 1px solid #433052; border-radius: 10px; background: #d3e8e0; box-shadow: inset 0 1px 2px #3a7a6a33;  border-color: #b4d3c8; }
.meter-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f9c8a, #8fe6d0); box-shadow: inset 0 1px 0 #ffffff80, 0 0 7px #5fd6bcb0; transition: width .24s ease; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stat-card { display: flex; min-height: 57px; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid #352d45; border-radius: 9px; background: linear-gradient(160deg, #fff, #f0f6f1); box-shadow: inset 0 1px 0 #fff, 0 2px 0 #e0e9e1;  border-color: #d5e2d8; }
.stat-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 7px; }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-flame { border: 1px solid #69483f; background: #3e2829; color: #ffc09f; }
.stat-chat { border: 1px solid #3c5d5d; background: #253b3d; color: #9ae2d7; }
.stat-card strong, .stat-card div > span { display: block; }
.stat-card strong { color: #2c4934; font-size: .9375rem; font-weight: 800; line-height: 1.2; }
.stat-card div > span { margin-top: 2px; color: #576c5c; white-space: nowrap; font-size: .75rem; font-weight: 550; }

.quest-section, .achievement-section, .activity-section { margin-top: 22px; }
.quest-section h3, .achievement-section h3, .activity-section h3 { color: #304c39; font-size: .875rem; font-weight: 750; letter-spacing: -.01em; }
.quest-section h3 { margin-bottom: 9px; }
.quest-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #5a4455;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff5e5, #f6ecdc);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #e5d9c3;
 border-color: #e1cfb1; }
.quest-top { display: flex; align-items: center; gap: 8px; color: #62492a; font-size: .875rem; font-weight: 700; line-height: 1.35; }
.quest-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid #936150; border-radius: 8px; background: linear-gradient(153deg, #724f44, #493044); color: #ffd6a9; box-shadow: inset 0 1px 0 #e8c68f36, 0 2px 0 #34202a; }
.quest-icon .icon { width: 17px; height: 17px; }
.quest-meter { display: flex; align-items: center; gap: 8px; }
.quest-meter .meter-track { min-width: 0; flex: 1; height: 7px; border-color: #d4c1a2; background: #e9d9bd; }
.quest-meter .meter-track > span { background: linear-gradient(90deg, #ffab9c, #ffd8a6); box-shadow: inset 0 1px 0 #fff3d280, 0 0 7px #ffd6a673; }
#quest-progress { color: #765835; font: 400 .6875rem/1 var(--mono); white-space: nowrap;  font-size: .75rem; }
.quest-card.is-complete { border-color: #97c5a7; background: linear-gradient(150deg, #e1f5e6, #d4ebdc); }
.quest-card.is-complete .quest-icon { border-color: #539581; background: linear-gradient(151deg, #4e8374, #325854); color: #c5f9e8; }
.quest-card.is-complete .meter-track { border-color: #527769; }
.quest-card.is-complete .meter-track > span { background: linear-gradient(90deg, #83d5ba, #c1f4de); }
.quest-card.is-complete #quest-progress { color: #27663c; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.section-count { color: #60715f; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.achievement-list { display: grid; gap: 5px; padding: 0; list-style: none; }
.achievement-item { display: flex; min-height: 43px; align-items: center; gap: 8px; min-width: 0; padding: 4px 3px; }
.achievement-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #4e405e;
  border-radius: 9px;
  background: linear-gradient(150deg, #f5f7f4, #dfe8df);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #c2cfbf;
  color: #6c8067;
  font-size: .9rem;
 border-color: #becdbd; }
.achievement-icon .icon { width: 16px; height: 16px; }
.achievement-text { min-width: 0; flex: 1; }
.achievement-name, .achievement-detail { display: block; }
.achievement-name { color: #355135; font-size: .875rem; font-weight: 750; line-height: 1.35; }
.achievement-detail { margin-top: 2px; color: #647660; font-size: .8125rem; line-height: 1.35; }
.achievement-item .achievement-state { width: 14px; height: 14px; color: #6c8362; }
.achievement-item.is-unlocked .achievement-icon { border-color: #3f9a8b; background: linear-gradient(150deg, #3f9a8b, #1d5a52); box-shadow: inset 0 1px 0 #b0f0e070, 0 2px 0 #123d37, 0 4px 10px #2f9c8a4d; color: #e6fff8; }
.achievement-item.is-unlocked .achievement-icon:is([data-icon="flame"], [data-icon="bolt"]) { border-color: #a97569; background: linear-gradient(150deg, #a46460, #683948); box-shadow: inset 0 1px 0 #f6d2b950, 0 2px 0 #442539; color: #ffe4c3; }
.achievement-item.is-unlocked .achievement-icon:is([data-icon="layers"], [data-icon="compass"]) { border-color: #6aa7a0; background: linear-gradient(150deg, #619995, #315b60); box-shadow: inset 0 1px 0 #c9fff054, 0 2px 0 #25434c; color: #e4fff5; }
.achievement-item.is-unlocked .achievement-name { color: #14504a; }
.achievement-item.is-unlocked .achievement-state { color: #257646; }
.achievement-open { margin-top: 6px; }
.achievement-section:focus { outline: none; }
.achievement-section:focus-visible .section-heading h3 { border-radius: 3px; outline: 2px solid #3aa28f; outline-offset: 4px; }
.profile-panel.is-highlighted .section-heading h3 { color: #14724f; }

.activity-section { padding-top: 10px; border-top: 1px solid var(--line); }
.activity-section h3 { margin: 0 0 8px; }
.activity-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.activity-day { display: grid; min-height: 29px; place-items: center; border: 1px solid #39314b; border-radius: 5px; background: #e8efe8; color: #5e7656; font: 400 .625rem var(--mono);  border-color: #d3e0d1;  font-size: .75rem; }
.activity-day.is-active { border-color: #4a8f85; background: linear-gradient(155deg, #4a857f, #285b59); color: #ddfff3; box-shadow: inset 0 1px 0 #a1eee648; }

.quiet-button { min-height: 30px; padding: 4px 8px; border: 1px solid #654980; border-radius: 6px; background: #e3eee4; color: #365b32; font-size: .8125rem; font-weight: 750;  border-color: #b9d0b7; }
.quiet-button:hover { background: #d1e5d0; }
.app-dialog {
  width: min(435px, calc(100vw - 34px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #644d84;
  border-radius: 17px;
  background: linear-gradient(150deg, #fbfefb, #eff7f0);
  color: var(--text);
  box-shadow: inset 0 1px 0 #fff, 0 20px 65px #1d3f3560;
 border-color: #bed5bf; }
.app-dialog::backdrop { background: #080610b9; backdrop-filter: blur(4px); }
.dialog-body { position: relative; display: grid; gap: 11px; padding: 26px; }
.dialog-body h2 { color: #1c4b34; font-size: 1.2rem; font-weight: 800; letter-spacing: -.045em;  font-family: "Unbounded", system-ui, sans-serif; }
.dialog-body > p { color: #426b4c; font-size: 1rem; line-height: 1.65; }
.dialog-body > .dialog-error { color: #a23c3c; font-size: .875rem; }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.dialog-emblem { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid #3f8c80; border-radius: 12px; background: linear-gradient(150deg, #2f8576, #1d5a52); box-shadow: inset 0 1px 0 #a9f0dc4f, 0 2px 0 #123d37; color: #d6fff2; }
.dialog-actions { display: grid; gap: 8px; margin-top: 4px; }
.primary-button, .secondary-button { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border: 1px solid #695186; border-radius: 8px; color: #375e3f; background: #e7f1e6; font-size: .875rem; font-weight: 750;  border-color: #b1c9ab; }
.primary-button { border-color: #9affea; background: linear-gradient(160deg, #9ff4df, #62cbb8); box-shadow: inset 0 1px 0 #e0fff3a0, 0 2px 0 #37766f; color: #15302f; }
.primary-button:hover { background: #adf6e4; }
.primary-button:disabled { opacity: .7; }
.secondary-button:hover { background: #d5e9d1; }
.primary-button .icon, .secondary-button .icon { width: 17px; height: 17px; }
.dialog-input { min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid #725795; border-radius: 8px; background: white; color: #284e2b;  border-color: #aac5a1; }
.toast-region { position: fixed; z-index: 10; right: 18px; bottom: 18px; display: grid; max-width: min(348px, calc(100vw - 36px)); gap: 8px; }
.toast { padding: 9px 12px; border: 1px solid #607e75; border-radius: 9px; background: #f3fff0; box-shadow: 0 4px 18px #32572930; color: #2e5c27; font-size: .875rem; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere;  border-color: #9abc90; }

@media (max-width: 1220px) {
  :root { --sidebar-width: 197px; --profile-width: 270px; --chat-inline: 24px; }
  .sidebar { padding-inline: 12px; }
  .profile-heading, .profile-content { padding-inline: 13px; }
  .starter-card { gap: 6px; padding: 9px 7px; }
  .starter-card small { font-size: .6875rem; }
  .starter-icon { width: 29px; height: 29px; }
  .starter-icon .icon { width: 15px; height: 15px; }
}

@media (max-width: 1050px) {
  :root { --sidebar-width: 197px; --chat-inline: clamp(24px, 4vw, 38px); }
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .topbar { padding-inline: 20px; }
  .mobile-profile-toggle { display: grid; }
  .profile-panel { position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: min(320px, calc(100vw - 34px)); transform: translateX(100%); transition: transform .22s ease, visibility .22s; visibility: hidden; box-shadow: -12px 0 35px #09061570; }
  .profile-panel .drawer-close { display: grid; }
  body[data-mobile-panel="profile"] .profile-panel { transform: translateX(0); visibility: visible; }
  body[data-mobile-panel="profile"] .profile-backdrop { display: block; }
  .drawer-backdrop { position: fixed; z-index: 4; inset: 0; padding: 0; background: #08060da6; }
  .hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
}

@media (max-width: 690px) {
  :root { --topbar-height: 102px; --chat-inline: 15px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { grid-column: 1; flex-wrap: wrap; align-content: center; padding: 4px 12px; gap: 2px; }
  .topbar-leading { width: 100%; }
  .topbar-title { font-size: .875rem; }
  .topbar-title-icon { display: none; }
  .topbar-actions { width: 100%; justify-content: flex-end; gap: 8px; }
  .mode-pill { min-height: 32px; margin-right: auto; padding: 0 10px; gap: 6px; font-size: .8125rem; }
  .status-dot { width: 5px; height: 5px; }
  .wallet-button { min-height: 42px; padding-inline: 10px; gap: 6px; font-size: .875rem; }
  .wallet-button .icon { width: 14px; height: 14px; }
  .mobile-nav-toggle { display: grid; }
  .mobile-profile-toggle { width: 42px; height: 42px; }
  .sidebar { position: fixed; z-index: 5; top: 0; left: 0; bottom: 0; width: min(239px, calc(100vw - 34px)); transform: translateX(-100%); transition: transform .22s ease, visibility .22s; visibility: hidden; box-shadow: 12px 0 35px #09061570; }
  .sidebar .drawer-close { display: grid; }
  body[data-mobile-panel="sidebar"] .sidebar { transform: translateX(0); visibility: visible; }
  body[data-mobile-panel="sidebar"] .sidebar-backdrop { display: block; }
  .chat-area { grid-column: 1; }
  .chat-empty { padding-block: 13px 19px; }
  .hero { min-height: 246px; }
  .hero::before { left: 0; background-position: right center; }
  .hero::after { background: linear-gradient(90deg, #0d2421 2%, #0d2420f2 40%, #0d2420c4 62%, #0b1f1c70 88%), linear-gradient(0deg, #06161456, transparent 43%); }
  .hero h1 { font-size: clamp(1.45rem, 5.5vw, 2.2rem); }
  .hero p { max-width: 24ch; margin-top: 10px; font-size: 1rem; }
  .hero-tag { min-height: 25px; font-size: .75rem; }
  .starters { margin-top: 16px; }
  .starters h2 { margin-bottom: 8px; }
  .starter-grid { grid-template-columns: 1fr; gap: 8px; }
  .starter-card { min-height: 49px; gap: 12px; padding: 9px 12px; }
  .starter-card strong { font-size: .875rem; }
  .starter-card small { display: none; }
  .starter-icon { width: 24px; height: 24px; border-radius: 6px; }
  .starter-icon .icon { width: 13px; height: 13px; }
  .composer-dock { padding-block: 7px max(9px, env(safe-area-inset-bottom)); }
  .composer-form textarea { min-height: 37px; padding-top: 11px; }
  .composer-actions { padding-top: 0; }
  .composer-hint { display: none; }
  .messages { gap: 21px; padding-block: 21px 16px; }
  .message-avatar { width: 30px; height: 30px; border-radius: 8px; }
  .message-row { gap: 8px; }
}

@media (max-width: 365px) {
  :root { --chat-inline: 10px; }
  .topbar-title { font-size: .875rem; }
  .hero-content { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
