:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-soft: #faf9f5;
  --panel: #fffdf9;
  --panel-strong: #ffffff;
  --text: #2b2722;
  --muted: #756f66;
  --line: #ddd8cf;
  --line-soft: #eeeae4;
  --black: #2c2825;
  --yellow: #f2b51f;
  --green: #46b990;
  --red: #f45d6d;
  --violet: #a77df2;
  --blue: #6ba3ff;
  --shadow: 0 10px 22px rgba(40, 35, 30, .045);
  --control-shadow: 0 1px 1px rgba(30, 28, 25, .03), inset 0 1px 0 rgba(255,255,255,.72);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, #f7f5f0 0%, var(--bg) 190px);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; line-height: 1.15; margin-bottom: 6px; letter-spacing: 0; }
h2 { font-size: 16px; margin-bottom: 4px; letter-spacing: 0; }
p { color: var(--muted); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.inline { display: inline; }

.app-topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  background: rgba(247, 245, 240, .97);
  border-bottom: 1px solid #e4ded5;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.topbar-left, .nav-group, .top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.topbar-left { gap: 10px; }
.app-brand {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 6px;
  font-weight: 850;
  color: #2f2924;
  white-space: nowrap;
}
.app-brand img {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  box-shadow: 0 4px 10px rgba(71, 55, 34, .07);
}
.nav-pill, .top-chip {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid #dfdbd3;
  border-radius: 9px;
  background: #f3f1ed;
  color: #4f483f;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: var(--control-shadow);
}
.nav-icon {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  color: #776f66;
  flex: 0 0 auto;
}
.nav-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-pill:hover, .top-chip:hover { border-color: #d5d0c8; background: #f8f6f2; }
.nav-pill.active {
  background: #e4ded5;
  color: #25211e;
  border-color: #d4ccc0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 2px rgba(40,35,30,.04);
}
.nav-pill.active .nav-icon { color: #3b352f; }
.balance-chip { background: #fffdf8; color: #3e3731; }
.avatar {
  width: 27px;
  height: 27px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #302b27;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.user-name { font-weight: 800; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.app-page { width: min(1220px, calc(100% - 28px)); margin: 24px auto 52px; }

.notice {
  width: min(760px, 100%);
  margin: 0 auto 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #bfe8da;
  background: #eefbf5;
  color: #146a4f;
  overflow-wrap: anywhere;
}
.notice.bad { border-color: #ffd0d5; background: #fff3f4; color: #b42334; }
.inline-notice { margin: 10px auto 0; }

.black-button, .soft-button, .muted-button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-weight: 850;
  white-space: nowrap;
}
.black-button {
  background: linear-gradient(180deg, #332f2c 0%, #292522 100%);
  color: #fff;
  border: 1px solid #292521;
  box-shadow: 0 8px 16px rgba(43, 38, 34, .16), inset 0 1px 0 rgba(255,255,255,.08);
}
.black-button:hover { background: linear-gradient(180deg, #2f2b28 0%, #211e1b 100%); }
.soft-button {
  background: #fffdf8;
  border: 1px solid #ded8cf;
  color: var(--black);
  box-shadow: var(--control-shadow);
}
.soft-button:hover { background: #ffffff; border-color: #d2cbc1; }
.muted-button {
  background: linear-gradient(180deg, #aaa49b, #979188);
  color: #fff;
  width: 100%;
  border: 1px solid #928b82;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.muted-button:disabled {
  cursor: not-allowed;
  background: #d3d0ca;
  color: #8b857d;
}
.small { min-height: 32px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.wide { width: 100%; }

.balance-hero {
  width: min(760px, 100%);
  min-height: 108px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 24px;
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: linear-gradient(95deg, #fffdfa 0%, #faf8f1 58%, #f0eee8 100%);
  box-shadow: 0 12px 28px rgba(72, 61, 49, .055);
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.balance-hero h1 { font-size: 34px; }
.balance-hero p { margin-bottom: 0; color: #9a7131; font-size: 12px; }
.hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric-grid.four-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card, .activity-card, .compact-card, .table-card, .step-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric-card {
  min-height: 124px;
  padding: 24px 22px 18px;
  position: relative;
  overflow: hidden;
}
.metric-card.flat { min-height: 82px; }
.metric-card p { font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.metric-card h2 { font-size: 24px; margin-bottom: 6px; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-icon {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 24px;
  height: 24px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.metric-icon.warm { color: #ed9b31; background: #fff3dd; }
.metric-icon.green { color: var(--green); background: #e9fbf5; }
.metric-icon.violet { color: var(--violet); background: #f1eafe; }
.sparkline { height: 36px; display: flex; align-items: end; gap: 4px; margin: 5px 0; }
.sparkline span { flex: 1; min-height: 5px; background: #57bea0; border-radius: 4px 4px 0 0; }
.sparkline span:nth-child(1) { height: 8px; }
.sparkline span:nth-child(2) { height: 34px; }
.sparkline span:nth-child(3) { height: 13px; }
.sparkline span:nth-child(4) { height: 22px; }
.sparkline span:nth-child(5) { height: 10px; }

.home-layout {
  display: grid;
  grid-template-columns: 1.85fr .9fr;
  gap: 16px;
}
.activity-card { padding: 20px; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.section-head p { margin-bottom: 0; font-size: 12px; }
.section-head a { font-size: 12px; font-weight: 800; }
.section-head select { width: auto; min-width: 148px; }
.activity-list { display: grid; gap: 12px; }
.activity-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
}
.activity-row > div { min-width: 0; }
.activity-row strong { display: block; overflow-wrap: anywhere; line-height: 1.35; }
.activity-row b { white-space: nowrap; }
.activity-row small { display: block; color: var(--muted); margin-top: 2px; }
.activity-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  font-weight: 900;
}
.activity-icon.up { background: #e8fff4; color: #18b977; }
.activity-icon.down { background: #fff0f2; color: var(--red); }
.positive { color: #18b977; }
.negative { color: var(--red); }
.empty-state { color: var(--muted); padding: 24px 0; }
.side-stack { display: grid; gap: 16px; align-content: start; }
.compact-card { padding: 18px; }
.model-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  margin-top: 12px;
  font-weight: 800;
  font-size: 13px;
}
.model-bar i {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: var(--black);
}
.quick-row {
  display: block;
  padding: 11px 12px;
  border: 1px solid #ded8cf;
  border-radius: 10px;
  margin-top: 8px;
  font-weight: 820;
  background: #fffdf8;
  box-shadow: var(--control-shadow);
}
.quick-row:hover { background: #ffffff; border-color: #d2cbc1; }
.copy-input, .search-input, input, textarea, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #ded8cf;
  border-radius: 10px;
  background: #fffdf8;
  color: var(--text);
  padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 4px 0 20px;
}
.page-title-row p { margin-bottom: 0; }
.table-card { padding: 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 900; }
td { font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: #efeee9;
  font-size: 12px;
  font-weight: 800;
}
.dots {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 18px;
  color: var(--muted);
}
.dots:hover { border-color: #ded8cf; background: #f7f5ef; }
.filters { display: flex; gap: 8px; align-items: center; min-width: min(440px, 100%); }

.chat-layout {
  width: calc(100vw - 28px);
  margin-left: calc(50% - 50vw + 14px);
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
}
.chat-sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 12px 0 0;
}
.chat-sidebar .black-button {
  min-height: 36px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0;
}
.chat-history-line { height: 1px; background: var(--line); margin-top: 14px; }
.chat-stage {
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding-bottom: 21vh;
  position: relative;
}
.chat-empty { text-align: center; align-self: end; margin-bottom: 30px; }
.chat-empty.is-hidden { display: none; }
.chat-empty h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.chat-empty p { margin: 0; color: var(--muted); font-size: 13px; }
.inline-notice {
  width: min(560px, 100%);
  margin: 0 auto 14px;
}
.inline-notice a { color: inherit; font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.messages {
  width: min(760px, 100%);
  max-height: 48vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: end;
}
.bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 12px;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}
.bubble.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #342f2b 0%, #292522 100%);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble.assistant {
  align-self: flex-start;
  background: #fffdf8;
  border: 1px solid #e2ddd4;
  border-bottom-left-radius: 5px;
}
.composer {
  width: min(560px, 100%);
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 13px 11px;
  border: 1px solid #d9d3ca;
  border-radius: 15px;
  background: #fffdf8;
  box-shadow: 0 12px 24px rgba(42, 36, 30, .055);
}
.composer textarea {
  border: 0;
  background: transparent;
  resize: none;
  min-height: 34px;
  padding: 2px 1px 0;
  outline: none;
  color: var(--black);
  line-height: 1.45;
}
.composer textarea::placeholder { color: #8d877f; }
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.composer-tools, .composer-meta { display: flex; align-items: center; gap: 6px; }
.chat-tool-button, .send-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: #f1eee8;
  color: #746d64;
  border: 1px solid #ded8cf;
  box-shadow: var(--control-shadow);
  transition: background .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
}
.chat-tool-button:hover, .model-pill:hover { background: #f7f4ef; border-color: #cbc3b8; color: var(--black); }
.chat-tool-button:active, .send-button:active, .model-pill:active { transform: translateY(1px); }
.chat-tool-button.is-active {
  background: #302b27;
  border-color: #302b27;
  color: #fff;
  box-shadow: 0 8px 14px rgba(43, 38, 34, .14);
}
.chat-tool-button:disabled, .send-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.chat-tool-button svg, .send-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.send-button {
  background: #e3ded6;
  color: #2b2724;
  border-color: #d5cec4;
  font-weight: 900;
}
.send-button:hover { background: #d9d3ca; border-color: #c9c1b6; }
.model-pill {
  height: 30px;
  max-width: 190px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: transparent;
  color: #6f685f;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-chip {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px 0 10px;
  border-radius: 99px;
  background: #f0ede7;
  border: 1px solid #ded8cf;
  color: #605950;
  font-size: 12px;
  font-weight: 760;
}
.attachment-chip[hidden] { display: none; }
.attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-chip button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: #6f685f;
  line-height: 1;
}
.model-select { color: var(--muted); font-size: 12px; font-weight: 800; padding-bottom: 6px; }

.knowledge-wrap { width: min(720px, 100%); margin: 0 auto; }
.knowledge-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.book-icon {
  width: 34px;
  height: 34px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #e9e7e0;
  font-weight: 900;
}
.knowledge-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #efede8;
  margin-bottom: 20px;
}
.knowledge-tabs a {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 820;
  font-size: 13px;
  color: var(--muted);
}
.knowledge-tabs a.active { background: #fffdf8; color: var(--black); box-shadow: 0 3px 8px rgba(40,35,30,.06), inset 0 1px 0 rgba(255,255,255,.7); }
.step-card { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 20px; margin-bottom: 20px; }
.step-num {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: var(--black);
  color: #fff;
  font-weight: 900;
}
.step-num.dark { margin-right: 8px; }
.tool-section h2 { display: flex; align-items: center; margin-bottom: 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-card {
  min-height: 62px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: var(--control-shadow);
}
.tool-card span {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #efede8;
}
.tool-card small { color: var(--muted); }
.tool-card b { grid-row: 1 / span 2; color: var(--muted); font-size: 20px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.guide-grid article, .guide-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}
.guide-grid h2, .guide-panel h2 { margin: 0 0 8px; font-size: 17px; }
.guide-grid p, .guide-panel p { margin: 0; color: var(--muted); line-height: 1.55; }
.guide-panel { margin-top: 14px; }
.guide-panel code { display: inline-block; margin-top: 10px; overflow-wrap: anywhere; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(29, 27, 24, .46);
  padding: 18px;
}
.modal-backdrop[hidden] { display: none; }
.billing-modal {
  width: min(390px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fffdfa;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(20, 18, 16, .24);
  padding: 28px 24px 20px;
  position: relative;
}
.close-modal {
  position: absolute;
  right: 16px;
  top: 14px;
  border: 0;
  background: transparent;
  font-size: 26px;
  color: var(--muted);
}
.amount-grid, .provider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 18px 0 8px; }
.amount-grid button, .provider-grid button {
  position: relative;
  min-height: 64px;
  border: 1px solid #ded8cf;
  border-radius: 14px;
  background: #fffdf8;
  display: grid;
  place-items: center;
  gap: 3px;
  box-shadow: var(--control-shadow);
}
.amount-grid button:hover, .provider-grid button:hover { border-color: #cfc7bb; background: #ffffff; }
.amount-grid b { font-size: 16px; }
.amount-grid span, .provider-grid span { color: var(--muted); font-size: 12px; }
.amount-grid i {
  position: absolute;
  right: -4px;
  top: -8px;
  min-width: 34px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: #0ac66f;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.custom-amount {
  min-height: 42px;
  border: 1px solid #ded8cf;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.custom-amount input { border: 0; min-height: 40px; padding: 0; outline: none; }
.provider-grid button:first-child { border-color: var(--black); box-shadow: 0 0 0 1px var(--black), var(--control-shadow); }
.promo-code { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 20px 0 12px; color: var(--muted); }
.promo-code span { height: 1px; background: var(--line); }
.promo-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.promo-row button {
  min-height: 38px;
  border: 1px solid #ded8cf;
  border-radius: 12px;
  background: #fffdf8;
  padding: 0 14px;
  color: #514940;
  font-weight: 800;
  box-shadow: var(--control-shadow);
}
.promo-hint {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
}
.promo-hint.ok { color: #15835e; }
.promo-hint.bad { color: #b42334; }

.auth-body { background: #f1f0ec; }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding-top: 90px;
}
.login-shell { width: min(384px, calc(100% - 32px)); text-align: center; }
.brand-logo-large {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 99px;
  box-shadow: var(--shadow);
  display: block;
}
.auth-brand-name {
  margin: -12px 0 18px;
  font-weight: 900;
  color: #2f2924;
}
.login-shell h1 { font-size: 24px; }
.login-shell > p { margin-bottom: 34px; }
.login-form { display: grid; gap: 18px; text-align: left; }
.login-form label { display: grid; gap: 8px; font-weight: 800; }
.login-form input {
  min-height: 42px;
  border-radius: 16px;
  background: transparent;
}
.checkline { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; color: #4b4741; }
.checkline input { width: 18px; min-height: 18px; }
.auth-link { text-align: center; color: #5d5751; margin-top: 10px; }
.auth-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 18px;
  color: var(--muted);
}

.landing-body {
  background:
    radial-gradient(circle at 18% 8%, rgba(219, 181, 116, .24), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(167, 126, 82, .14), transparent 26%),
    linear-gradient(180deg, #f7f1e7 0%, #efe8dc 100%);
}
.landing-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 64px;
}
.landing-nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(91, 75, 57, .14);
  border-radius: 16px;
  background: rgba(255, 253, 248, .72);
  box-shadow: 0 18px 50px rgba(71, 55, 34, .08);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 14px;
  z-index: 30;
}
.landing-logo, .landing-actions, .landing-nav nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.landing-logo b { font-size: 17px; }
.brand-logo-small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(71, 55, 34, .1);
}
.landing-nav nav a {
  color: #6f6254;
  font-weight: 800;
  font-size: 13px;
}
.landing-button, .outline-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 900;
  white-space: nowrap;
}
.landing-button {
  background: #2f2924;
  color: #fff;
  box-shadow: 0 12px 28px rgba(47, 41, 36, .18);
}
.outline-button {
  border: 1px solid #d7c9b8;
  color: #332b25;
  background: rgba(255, 253, 248, .68);
}
.big { min-height: 46px; padding: 0 20px; }
.landing-hero {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  gap: 50px;
  align-items: center;
  padding: 74px 0 50px;
}
.hero-copy h1 {
  max-width: 620px;
  font-size: 58px;
  line-height: .98;
  margin-bottom: 22px;
  letter-spacing: 0;
  color: #2c261f;
}
.hero-copy p {
  max-width: 560px;
  font-size: 18px;
  line-height: 1.6;
  color: #6f6254;
  margin-bottom: 28px;
}
.hero-badge {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8c5aa;
  border-radius: 99px;
  padding: 0 14px;
  background: rgba(255, 253, 248, .74);
  color: #7a5a31;
  font-weight: 900;
  margin-bottom: 18px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-stats span {
  display: inline-flex;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid rgba(91, 75, 57, .13);
  border-radius: 10px;
  background: rgba(255, 253, 248, .58);
  color: #756657;
}
.hero-stats b { color: #2f2924; }
.hero-product {
  border: 1px solid rgba(91, 75, 57, .16);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(251,246,237,.86));
  box-shadow: 0 28px 90px rgba(70, 55, 36, .16);
  padding: 16px;
  transform: rotate(1deg);
}
.preview-top {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6f6254;
  font-weight: 900;
}
.preview-top span {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #d3c4b0;
}
.preview-top b { margin-left: 8px; }
.preview-balance {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 20px;
  border: 1px solid #e6d7bf;
  border-radius: 18px;
  background: #fff9ec;
}
.preview-balance p { grid-column: 1 / -1; margin: 0; font-size: 12px; text-transform: uppercase; font-weight: 900; }
.preview-balance strong { font-size: 34px; }
.preview-balance a {
  border: 0;
  border-radius: 10px;
  background: #2f2924;
  color: #fff;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.preview-grid article {
  min-height: 120px;
  border: 1px solid #e1d4c4;
  border-radius: 18px;
  background: #fffdf8;
  padding: 18px;
}
.preview-grid article.wide { grid-column: 1 / -1; min-height: 100px; }
.preview-grid p { font-weight: 900; font-size: 12px; }
.preview-grid b { font-size: 26px; }
.preview-grid small { display: block; color: var(--muted); margin-top: 8px; }
.preview-grid span {
  display: block;
  height: 7px;
  background: #2f2924;
  border-radius: 99px;
  margin-top: 12px;
}
.landing-section {
  margin-top: 28px;
  padding: 48px;
  border: 1px solid rgba(91, 75, 57, .14);
  border-radius: 24px;
  background: rgba(255, 253, 248, .68);
  box-shadow: 0 18px 56px rgba(71, 55, 34, .08);
}
.section-kicker {
  color: #8b6a3e;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
}
.landing-section > h2,
.pricing-band h2,
.api-strip h2,
.landing-final h2 {
  font-size: 34px;
  max-width: 720px;
  margin-bottom: 14px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.feature-grid article {
  min-height: 180px;
  border: 1px solid #e1d4c4;
  border-radius: 18px;
  background: #fffdf8;
  padding: 22px;
}
.feature-grid span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eee4d5;
  margin-bottom: 18px;
  font-weight: 900;
}
.feature-grid h3 { margin: 0 0 8px; font-size: 18px; }
.feature-grid p { line-height: 1.5; }
.pricing-band, .api-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.price-cards {
  display: grid;
  grid-template-columns: repeat(3, 140px);
  gap: 10px;
}
.price-cards article {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px solid #e1d4c4;
  border-radius: 18px;
  background: #fff8ec;
}
.price-cards b { font-size: 22px; }
.price-cards span { color: #20a76f; font-weight: 900; }
.landing-final {
  text-align: center;
  padding: 64px 0 12px;
}
.landing-final p { max-width: 620px; margin: 0 auto 22px; font-size: 17px; line-height: 1.6; }

.floating-tools {
  position: fixed;
  right: 12px;
  top: 50%;
  z-index: 15;
  display: grid;
  gap: 8px;
}
.floating-tools a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: #fffefa;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: #615a51;
}
.floating-tools svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 900px) {
  .app-topbar { height: auto; min-height: 42px; flex-wrap: wrap; padding: 8px; }
  .nav-group, .top-actions { flex-wrap: wrap; }
  .metric-grid, .metric-grid.four-wide, .home-layout, .tool-grid { grid-template-columns: 1fr; }
  .balance-hero, .page-title-row { flex-direction: column; align-items: stretch; }
  .landing-page { width: min(100% - 24px, 720px); }
  .landing-nav { position: static; flex-wrap: wrap; }
  .landing-nav nav { display: none; }
  .landing-hero { grid-template-columns: 1fr; min-height: auto; padding: 42px 0 24px; gap: 28px; }
  .hero-copy h1 { font-size: 40px; }
  .hero-copy p { font-size: 16px; }
  .hero-product { transform: none; }
  .landing-section { padding: 26px; border-radius: 18px; }
  .feature-grid, .pricing-band, .api-strip { grid-template-columns: 1fr; }
  .price-cards { grid-template-columns: 1fr; }
  .landing-section > h2, .pricing-band h2, .api-strip h2, .landing-final h2 { font-size: 28px; }
  .chat-layout { grid-template-columns: 1fr; width: min(100%, calc(100vw - 28px)); margin: 0; }
  .chat-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
  .chat-stage { padding-bottom: 8vh; }
  .composer { grid-template-columns: 1fr; }
  .composer-tools, .model-select { display: none; }
  .knowledge-tabs { grid-template-columns: repeat(2, 1fr); }
  .tool-grid, .guide-grid { grid-template-columns: 1fr; }
}
