:root {
  --bg: #0b0c0e;
  --panel: #121418;
  --panel-2: #16191e;
  --line: #1f2328;
  --text: #e8e6e1;
  --soft: #cfd3d8;
  --muted: #8b9099;
  --accent: #e2b45c;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  height: 52px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 14, 0.92);
  backdrop-filter: blur(10px);
  flex: none;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tick {
  color: var(--accent);
  margin-left: 1px;
}

.balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.balance:hover {
  border-color: #2c3138;
}

.balance-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(226, 180, 92, 0.12);
}

.balance-value {
  font-variant-numeric: tabular-nums;
}

.balance-unit {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 16px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.empty {
  margin-top: 4vh;
  max-width: 40ch;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0 0 12px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.lede {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #a7acb4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.chip:hover {
  background: var(--panel);
}

.msg {
  max-width: 88%;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-user {
  align-self: flex-end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  background: var(--panel-2);
}

.msg-assistant {
  align-self: flex-start;
  padding-left: 12px;
  border-left: 2px solid rgba(226, 180, 92, 0.45);
  color: #d5d8dd;
}

.msg-meta {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.composer textarea:focus {
  border-color: #33383f;
}

.composer textarea::placeholder {
  color: #6f747c;
}

.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #15181d;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.send:disabled {
  opacity: 0.35;
  cursor: default;
}

.send:not(:disabled):hover {
  background: #1b1f25;
}

.banner {
  flex: none;
  padding: 8px 16px;
  border-top: 1px solid #3a2b1a;
  background: #241b11;
  color: #e5c491;
  font-size: 12px;
  line-height: 1.4;
}

.sheet {
  width: calc(100% - 24px);
  max-width: 420px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1114;
  color: var(--text);
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.sheet h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.sheet-close {
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.sheet-note,
.sheet-foot {
  margin: 8px 0 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sheet-foot {
  margin: 0;
  padding-bottom: 16px;
}

.offers {
  margin: 12px 0 0;
  padding: 0 8px;
  list-style: none;
}

.offer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}

.offer:last-child {
  border-bottom: 0;
}

.offer-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.offer-price {
  font-size: 15px;
}

.offer-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.offer-nectar {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid rgba(226, 180, 92, 0.8);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
