:root {
  --ink: #221f1b;
  --ink-soft: #3a352e;
  --muted: #766f66;
  --soft: #a69b8a;
  --paper: #f7f1e7;
  --paper-deep: #efe4d4;
  --panel: #fffaf1;
  --panel-strong: #fff5e5;
  --line: #dfd1bd;
  --line-strong: #c8ad89;
  --bronze: #9c6a2f;
  --bronze-dark: #68441d;
  --olive: #4e5e42;
  --sage: #dfe5d6;
  --danger: #8b3f32;
  --shadow: 0 22px 50px rgba(52, 38, 20, 0.12);
  --shadow-soft: 0 10px 30px rgba(52, 38, 20, 0.08);
  --sidebar-width: 292px;
  --rail-width: 334px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.96), rgba(242, 229, 211, 0.92)),
    repeating-linear-gradient(0deg, rgba(104, 68, 29, 0.04) 0, rgba(104, 68, 29, 0.04) 1px, transparent 1px, transparent 5px);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(104, 68, 29, 0.08), transparent 22%, transparent 78%, rgba(78, 94, 66, 0.07)),
    radial-gradient(circle at 50% 0%, rgba(255, 250, 241, 0.8), transparent 42%);
  content: "";
}

.is-hidden {
  display: none !important;
}

.global-controls {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 80;
  display: flex;
  gap: 8px;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.88);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.is-active {
  color: #fffaf1;
  background: var(--ink);
}

.landing-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 80px;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 241, 231, 0.88);
  backdrop-filter: blur(16px);
}

.landing-brand,
.landing-nav nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.landing-brand {
  gap: 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.landing-brand strong,
.landing-brand span:last-child,
.landing-nav a,
.mono-kicker,
.language-line {
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.landing-brand span:last-child,
.landing-nav a {
  color: var(--muted);
}

.landing-nav a {
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.landing-nav a:hover {
  color: var(--bronze-dark);
}

.axiom-grid {
  position: relative;
  display: grid;
  width: 16px;
  height: 16px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.axiom-grid i {
  width: 4px;
  height: 4px;
  background: var(--ink);
}

.axiom-grid i:nth-child(2) {
  grid-column: 3;
}

.axiom-grid i:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.axiom-grid i:nth-child(4) {
  grid-column: 1;
  grid-row: 3;
}

.axiom-grid i:nth-child(5) {
  grid-column: 3;
  grid-row: 3;
}

.landing-hero,
.principles-band,
.verticals-band,
.legal-preview {
  width: min(1340px, calc(100vw - 72px));
  margin: 0 auto;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.65fr);
  gap: 68px;
  align-items: end;
  min-height: 690px;
  padding: 112px 0 80px;
}

.mono-kicker {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 1050px;
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(58px, 8vw, 118px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy h1 em,
.verticals-band h2 em {
  display: inline;
  color: var(--bronze);
  font-style: italic;
  font-weight: 400;
}

.hero-copy > p {
  max-width: 730px;
  margin: 34px 0 0;
  color: var(--ink-soft);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.primary-cta {
  min-height: 46px;
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
  padding: 0 18px;
  color: #fffaf1;
  background: var(--bronze-dark);
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(104, 68, 29, 0.18);
}

.primary-cta:hover {
  background: #7a4d20;
}

.secondary-link {
  color: var(--bronze-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.axiom-definition {
  padding: 24px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
}

.axiom-definition span,
.language-line {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.axiom-definition strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 34px;
}

.axiom-definition p {
  margin: 18px 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.principles-band,
.verticals-band {
  padding: 82px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}

.section-heading h2,
.legal-preview h2 {
  max-width: 760px;
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.principle-card {
  min-height: 236px;
  padding: 30px 24px;
  border-right: 1px solid var(--line);
}

.principle-card:last-child {
  border-right: 0;
}

.principle-card .number {
  color: var(--bronze);
  font-size: 32px;
  font-weight: 800;
}

.principle-card h3,
.vertical-card h3 {
  margin: 18px 0 10px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 25px;
  line-height: 1.15;
}

.principle-card p,
.vertical-card p,
.legal-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.vertical-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.vertical-card {
  min-height: 240px;
  padding: 28px;
  background: var(--panel);
}

.vertical-card.is-live {
  background: var(--panel-strong);
}

.vertical-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vertical-card .status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--bronze-dark);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.vertical-card button {
  margin-top: 22px;
  border: 0;
  padding: 0;
  color: var(--bronze-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.legal-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-top: 40px;
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.78);
  box-shadow: var(--shadow-soft);
}

.legal-preview p {
  max-width: 700px;
  margin-top: 16px;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(246, 236, 220, 0.94)),
    var(--panel);
  backdrop-filter: blur(22px);
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--bronze);
  border-radius: 50%;
  color: var(--bronze-dark);
  background: #fff7e9;
  box-shadow: inset 0 0 0 4px rgba(156, 106, 47, 0.08);
}

.brand-mark span {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.brand-name {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--bronze);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.platform-note {
  display: grid;
  gap: 3px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 245, 229, 0.74);
}

.platform-note span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.platform-note strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.new-chat-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
  color: #fffaf1;
  background: var(--bronze-dark);
  box-shadow: 0 12px 24px rgba(104, 68, 29, 0.18);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.new-chat-button {
  width: 100%;
  min-height: 46px;
  margin: 28px 0 24px;
  font-weight: 700;
}

.new-chat-button:hover,
.send-button:hover {
  background: #7a4d20;
  box-shadow: 0 16px 28px rgba(104, 68, 29, 0.22);
  transform: translateY(-1px);
}

.side-section {
  min-height: 0;
  margin-bottom: 22px;
}

.recent-section {
  flex: 1;
}

.section-label,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-label {
  margin-bottom: 10px;
}

.project-list,
.chat-list,
.tool-list,
.source-list,
.trust-list {
  display: grid;
  gap: 8px;
}

.project-button,
.chat-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.project-button {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
}

.chat-button {
  display: grid;
  gap: 5px;
  padding: 11px 10px;
}

.project-button:hover,
.chat-button:hover,
.project-button.is-active,
.chat-button.is-active {
  border-color: var(--line);
  background: rgba(255, 245, 229, 0.86);
}

.project-button.is-active,
.chat-button.is-active {
  box-shadow: inset 3px 0 0 var(--bronze);
}

.project-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--bronze-dark);
  background: #fff7e8;
}

.project-title,
.chat-title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-meta,
.chat-meta {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-card {
  display: grid;
  grid-template-columns: 38px 1fr 22px;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.settings-card strong,
.settings-card small {
  display: block;
}

.settings-card strong {
  font-size: 13px;
}

.settings-card small {
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fffaf1;
  background: var(--olive);
  font-size: 12px;
  font-weight: 800;
}

.settings-icon {
  color: var(--muted);
}

.workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 22px 24px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.mobile-menu {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
}

.assistant-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 4px rgba(78, 94, 66, 0.16);
}

.assistant-identity h1,
.chat-context h2 {
  margin: 2px 0 0;
  font-family: "Libre Baskerville", Georgia, serif;
  letter-spacing: 0;
}

.assistant-identity h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.eyebrow {
  margin: 0;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.select-shell,
.toggle-control,
.plan-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.select-shell {
  padding: 0 10px 0 12px;
}

.select-shell select {
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.toggle-control {
  position: relative;
  padding: 0 12px;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d3c5b1;
  transition: background 160ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffaf1;
  box-shadow: 0 2px 6px rgba(34, 31, 27, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.toggle-control input:checked + .toggle-track {
  background: var(--bronze);
}

.toggle-control input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.plan-pill {
  padding: 0 13px;
}

.plan-pill strong {
  color: var(--bronze-dark);
}

.usage-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 180px;
  gap: 10px;
  margin: 6px 0 18px;
}

.usage-item {
  display: grid;
  gap: 10px;
  min-height: 70px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.76);
  box-shadow: var(--shadow-soft);
}

.usage-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.usage-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.usage-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.usage-item strong {
  font-size: 17px;
}

.usage-item.compact {
  align-content: center;
}

.credit-button {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--bronze-dark);
  background: #fff4df;
  font-size: 12px;
  font-weight: 900;
}

.credit-button:hover {
  background: #ffe9c6;
}

.credit-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(680px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 28px 72px rgba(34, 31, 27, 0.26);
}

.credit-modal[hidden] {
  display: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff7e8, #fffaf1);
}

.modal-head h2 {
  max-width: 520px;
  margin: 4px 0 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}

.modal-close {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fffaf1;
}

.credit-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 22px;
}

.credit-option {
  display: grid;
  gap: 6px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--ink);
  background: #fff8ed;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.credit-option:hover,
.credit-option.is-featured {
  border-color: var(--bronze);
  background: #fff1dd;
}

.credit-option:hover {
  transform: translateY(-1px);
}

.credit-option strong {
  color: var(--bronze-dark);
  font-size: 28px;
}

.credit-option span {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.credit-option small,
.modal-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.modal-note {
  margin: 0;
  padding: 0 22px 22px;
}

.meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e9dcc8;
}

.meter span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bronze), #d1a35d);
  transition: width 220ms ease;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-width);
  gap: 18px;
  align-items: stretch;
}

.chat-panel,
.insight-rail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.84);
  box-shadow: var(--shadow);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 260px);
  min-height: 560px;
  overflow: hidden;
}

.chat-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 245, 229, 0.88), rgba(255, 250, 241, 0.62));
}

.chat-context h2 {
  max-width: 780px;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.18;
}

.context-badges,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.action-chip,
.attachment-chip,
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8ed;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge {
  padding: 0 10px;
}

.badge strong {
  color: var(--bronze-dark);
}

.quick-actions {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.action-chip {
  padding: 0 12px;
}

.action-chip:hover {
  border-color: var(--line-strong);
  background: #fff1dd;
}

.matter-strip {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.72);
}

.matter-card {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff8ed;
}

.matter-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.matter-card h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.matter-card p {
  margin: 0;
  color: #3a352e;
  font-size: 12px;
  line-height: 1.5;
}

.matter-card .status {
  border: 1px solid rgba(78, 94, 66, 0.25);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--olive);
  background: var(--sage);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.message-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 22px 24px 18px;
  scroll-behavior: smooth;
}

.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  max-width: 920px;
}

.message.user {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 38px;
  max-width: 760px;
}

.message-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff7e8;
  color: var(--bronze-dark);
  font-size: 12px;
  font-weight: 900;
}

.message.user .message-avatar {
  grid-column: 2;
  color: #fffaf1;
  background: var(--olive);
}

.message.user .message-body {
  grid-column: 1;
  grid-row: 1;
  background: #f0eadf;
}

.message-body {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
}

.message-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.message-body header strong {
  font-size: 13px;
}

.message-body header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.message-body p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

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

.message-body ul,
.message-body ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.message-body li {
  margin: 6px 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.message-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.source-chip {
  padding: 0 9px;
  color: var(--bronze-dark);
}

.composer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 245, 229, 0.92);
}

.attachment-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  padding: 0 9px;
}

.file-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--bronze-dark);
  background: var(--panel);
  transition: border-color 160ms ease, background 160ms ease;
}

.file-button:hover {
  border-color: var(--line-strong);
  background: #fff1dd;
}

#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.composer textarea {
  width: 100%;
  max-height: 140px;
  min-height: 42px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffaf1;
  line-height: 1.4;
}

.composer textarea:focus,
.select-shell:focus-within,
.toggle-control:focus-within,
.file-button:focus-within,
.new-chat-button:focus-visible,
.send-button:focus-visible,
.project-button:focus-visible,
.chat-button:focus-visible,
.mobile-menu:focus-visible {
  outline: 2px solid rgba(156, 106, 47, 0.35);
  outline-offset: 2px;
}

.send-button {
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.insight-rail {
  display: grid;
  align-content: start;
  gap: 12px;
  height: calc(100vh - 260px);
  min-height: 560px;
  overflow-y: auto;
  padding: 14px;
}

.rail-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.78);
}

.rail-header {
  margin-bottom: 14px;
}

.rail-header strong {
  display: block;
  margin-top: 4px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 18px;
}

.case-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.case-facts div {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.case-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.case-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.tool-item,
.source-item,
.trust-item {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff8ed;
}

.tool-item:first-child,
.source-item:first-child {
  border-color: rgba(156, 106, 47, 0.32);
  background: linear-gradient(180deg, #fff7e8, #fffaf1);
}

.tool-item strong,
.source-item strong,
.trust-item strong {
  font-size: 13px;
}

.tool-item span,
.source-item span,
.trust-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.trust-section {
  border-color: rgba(78, 94, 66, 0.24);
  background: linear-gradient(180deg, rgba(243, 247, 237, 0.82), rgba(255, 250, 241, 0.76));
}

.trust-item {
  grid-template-columns: 18px 1fr;
  align-items: start;
}

.trust-item::before {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fffaf1;
  background: var(--olive);
  font-size: 11px;
  font-weight: 900;
  content: "";
}

.trust-item strong,
.trust-item span {
  grid-column: 2;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 31, 27, 0.28);
  z-index: 15;
}

@media (max-width: 1180px) {
  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 104px;
  }

  .axiom-definition {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    padding-left: 0;
  }

  .principle-grid,
  .vertical-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .insight-rail {
    height: auto;
    min-height: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 920px) {
  .global-controls {
    position: sticky;
    top: 0;
    justify-content: flex-end;
    padding: 10px;
    background: rgba(247, 241, 231, 0.92);
    backdrop-filter: blur(14px);
  }

  .landing-nav {
    position: static;
    display: grid;
    padding: 18px 20px;
  }

  .landing-nav nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .landing-hero,
  .principles-band,
  .verticals-band,
  .legal-preview {
    width: min(100% - 28px, 720px);
  }

  .landing-hero {
    padding: 56px 0 64px;
  }

  .legal-preview {
    display: grid;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: min(var(--sidebar-width), calc(100vw - 32px));
    transition: transform 180ms ease;
  }

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

  .mobile-menu {
    display: grid;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .usage-strip {
    grid-template-columns: 1fr;
  }

  .insight-rail {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    height: auto;
    min-height: calc(100vh - 160px);
  }
}

@media (max-width: 680px) {
  .global-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }

  .hero-copy h1 {
    font-size: 48px;
  }

  .principle-grid,
  .vertical-grid {
    grid-template-columns: 1fr;
  }

  .principle-card {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .principle-card:last-child {
    border-bottom: 0;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .select-shell,
  .toggle-control,
  .plan-pill {
    flex: 1;
  }

  .chat-context {
    display: grid;
    padding: 18px;
  }

  .matter-strip {
    grid-template-columns: 1fr;
    padding-inline: 18px;
  }

  .quick-actions,
  .message-list {
    padding-inline: 18px;
  }

  .message,
  .message.user {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .message-avatar {
    display: none;
  }

  .message.user .message-body,
  .message.user .message-avatar {
    grid-column: auto;
    grid-row: auto;
  }

  .composer {
    grid-template-columns: 42px 1fr;
  }

  .composer textarea {
    grid-column: 2;
  }

  .send-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .credit-options {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
