:root {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #f3ede2;
  --surface-3: #ebe3d3;
  --text: #1f1b16;
  --muted: #6f675d;
  --line: #ddd2bf;
  --accent: #dc6f47;
  --accent-deep: #b55533;
  --accent-soft: #fde2d7;
  --success: #2a7a53;
  --success-soft: #e1f3e8;
  --warning: #a96a16;
  --warning-soft: #f9ebcc;
  --shadow: 0 12px 32px rgba(64, 43, 18, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 280px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(180deg, #fbf8f2 0%, #f2ece1 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  border-right: 1px solid rgba(162, 145, 118, 0.25);
  background: rgba(255, 252, 246, 0.7);
  backdrop-filter: blur(12px);
}

.brand {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.sidebar-button,
.nav-item,
.recent-item {
  width: 100%;
  text-align: left;
  border-radius: 14px;
}

.sidebar-button {
  padding: 10px 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.nav-list,
.recent-list {
  display: grid;
  gap: 3px;
}

.nav-item,
.recent-item {
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
}

.nav-item.active,
.recent-item.active {
  background: rgba(220, 111, 71, 0.12);
  color: var(--text);
}

.sidebar-section-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 16px 10px 6px;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 10px 6px 4px;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(162, 145, 118, 0.18);
}

.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #3d3a34;
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.account-name {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.1;
}

.account-plan {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.1;
}

.account-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-caret-stack {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 0.8;
  place-items: center;
}

.sidebar-usage {
  margin-bottom: 10px;
  padding: 4px 2px 8px;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.sidebar-usage-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

.sidebar-usage-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 28px 14px;
}

.breadcrumbs {
  font-size: 0.95rem;
  color: var(--muted);
}

.share-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  padding: 12px 16px;
}

.share-button {
  background: var(--surface);
  border: 1px solid var(--line);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 28px 10px;
}

.hero-banner,
.status-banner,
.card,
.chat-composer,
.checkout-layout,
.detail-layout,
.confirmation-card,
.control-panel {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(169, 144, 102, 0.24);
  box-shadow: var(--shadow);
}

.hero-banner,
.status-banner {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-radius: 18px;
  padding: 18px 20px;
  margin: 4px auto 4px;
  width: 100%;
  max-width: 860px;
  border: 1px solid rgba(202, 191, 176, 0.7);
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 10px 26px rgba(64, 43, 18, 0.06);
}

.hero-banner {
  background: rgba(255, 253, 249, 0.98);
}

.offer-banner {
  border-color: rgba(202, 191, 176, 0.8);
  background: rgba(255, 253, 249, 0.99);
  box-shadow: 0 12px 30px rgba(64, 43, 18, 0.07);
}

.banner-eyebrow,
.badge,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.banner-eyebrow,
.badge.preview {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.badge.success {
  color: var(--success);
  background: var(--success-soft);
}

.badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.banner-title,
.detail-hero h1,
.checkout-title,
.confirmation-card h1 {
  margin: 10px 0 8px;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2rem, 2.6vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.banner-copy,
.muted {
  color: var(--muted);
}

.banner-title.compact {
  margin: 4px 0 4px;
  font-size: 1.32rem;
  line-height: 1.15;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.banner-copy.compact {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.38;
  max-width: 760px;
}

.banner-layout {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.banner-icon {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  color: #1f1b16;
  position: relative;
}

.banner-art {
  width: 66px;
  height: 66px;
  position: relative;
}

.banner-art-line {
  position: absolute;
  background: #1f1b16;
  border-radius: 999px;
}

.banner-art-line.vertical {
  width: 2px;
  height: 36px;
  left: 32px;
  top: 18px;
}

.banner-art-line.top-left {
  width: 2px;
  height: 20px;
  left: 25px;
  top: 18px;
  transform: rotate(58deg);
  transform-origin: top center;
}

.banner-art-line.top-right {
  width: 2px;
  height: 20px;
  left: 39px;
  top: 18px;
  transform: rotate(-58deg);
  transform-origin: top center;
}

.banner-art-line.mid-left {
  width: 2px;
  height: 18px;
  left: 24px;
  top: 31px;
  transform: rotate(56deg);
  transform-origin: top center;
}

.banner-art-line.mid-right {
  width: 2px;
  height: 18px;
  left: 40px;
  top: 31px;
  transform: rotate(-56deg);
  transform-origin: top center;
}

.banner-art-line.low-left {
  width: 2px;
  height: 20px;
  left: 19px;
  top: 41px;
  transform: rotate(66deg);
  transform-origin: top center;
}

.banner-art-line.low-right {
  width: 2px;
  height: 20px;
  left: 45px;
  top: 41px;
  transform: rotate(-66deg);
  transform-origin: top center;
}

.banner-art-node {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #1f1b16;
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.99);
}

.banner-art-node.root {
  width: 22px;
  height: 22px;
  left: 22px;
  top: 2px;
}

.banner-art-node.root::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f1b16;
  left: 5px;
  top: 5px;
}

.banner-art-node.top-left {
  left: 10px;
  top: 17px;
}

.banner-art-node.top-right {
  left: 44px;
  top: 17px;
}

.banner-art-node.mid-left {
  left: 12px;
  top: 34px;
}

.banner-art-node.mid-right {
  left: 42px;
  top: 34px;
}

.banner-art-node.low-left {
  left: 1px;
  top: 46px;
}

.banner-art-node.low-right {
  left: 54px;
  top: 46px;
}

.banner-text {
  min-width: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

.primary-button {
  border-radius: 14px;
  padding: 11px 18px;
  color: white;
  background: #171717;
  box-shadow: none;
  font-weight: 600;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(202, 191, 176, 0.9);
  font-weight: 600;
  border-radius: 14px;
  padding: 11px 18px;
}

.banner-button {
  padding: 10px 16px;
  border-radius: 14px;
  background: #171717;
  border: 1px solid #171717;
  color: white;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.banner-button.primary {
  background: #171717;
  color: white;
  border-color: #171717;
  box-shadow: none;
}

.banner-stack-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 18px;
}

.banner-feedback {
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: underline;
  padding: 0;
  margin-right: 6px;
}

.banner-actions-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-dismiss {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  padding: 0;
}

.offer-banner-dismiss {
  position: absolute;
  top: 14px;
  right: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.chat-stage.offer-chat-stage {
  justify-content: flex-end;
  gap: 4px;
  padding-bottom: 0;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.chat-thread {
  max-width: 820px;
  margin: 0 auto;
}

.message-block {
  margin-bottom: 14px;
}

.bubble {
  border-radius: 22px;
  padding: 16px 19px;
  margin-bottom: 14px;
  font-size: 0.98rem;
  line-height: 1.42;
  letter-spacing: -0.01em;
}

.bubble.user {
  margin-left: auto;
  max-width: 76%;
  background: #efe8dc;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.38;
}

.assistant-copy {
  max-width: 76%;
  padding: 4px 0 0;
  color: var(--text);
  background: transparent;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.03rem;
  line-height: 1.6;
  letter-spacing: -0.012em;
}

.control-panel,
.control-panel * {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.assistant-copy p {
  margin: 0 0 14px;
}

.assistant-copy p:last-child {
  margin-bottom: 0;
}

.bubble-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.bubble-action-button {
  border-radius: 999px;
  padding: 10px 16px;
  background: #1f1d1a;
  color: #fffaf5;
  font-size: 0.95rem;
  font-weight: 600;
}

.bubble-action-button.secondary {
  background: rgba(239, 232, 220, 0.95);
  color: #2b2721;
}

.usage-meter {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 244, 236, 0.8);
  border: 1px solid rgba(220, 111, 71, 0.18);
}

.usage-meter.sidebar-meter {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
  gap: 0;
}

.usage-meter.sidebar-meter .meter-track {
  height: 5px;
  background: rgba(220, 111, 71, 0.1);
}

.meter-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(220, 111, 71, 0.14);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #eb8c67, #dc6f47);
  border-radius: inherit;
}

.chat-composer {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  border-radius: 28px;
  padding: 9px 15px 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(162, 145, 118, 0.34);
  box-shadow: 0 14px 34px rgba(64, 43, 18, 0.07);
}

.composer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.composer-textarea {
  width: 100%;
  min-height: 34px;
  height: 34px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.25;
  overflow: hidden;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}

.composer-left-actions,
.composer-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: transparent;
  color: #423d35;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  line-height: 1;
  padding: 0;
}

.send-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #2b2721;
  font-size: 1.2rem;
}

.send-button-active {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #cf6a3d;
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
}

.model-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  padding: 0;
  background: transparent;
  position: relative;
}

.model-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 440px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 28px 60px rgba(64, 43, 18, 0.16);
  padding: 10px;
  z-index: 5;
}

.model-option {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}

.model-option.selected {
  background: transparent;
}

.model-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.model-option-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.model-option-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.model-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 7px 11px;
  background: #f4efe4;
  color: var(--text);
  font-size: 0.92rem;
}

.composer-disclaimer {
  max-width: 860px;
  margin: 1px auto 0;
  color: var(--muted);
  text-align: center;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.76rem;
  line-height: 1.1;
}

.model-divider {
  height: 1px;
  background: rgba(162, 145, 118, 0.22);
  margin: 6px 0 10px;
}

.model-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f2efe9;
}

.model-utility-copy {
  display: grid;
  gap: 4px;
}

.model-utility-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.model-utility-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.toggle {
  width: 62px;
  height: 38px;
  border-radius: 999px;
  background: #d7d2c8;
  position: relative;
  flex: 0 0 auto;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 1px solid rgba(111, 103, 93, 0.3);
}

.model-link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 6px;
  font-size: 0.95rem;
  font-weight: 500;
}

.checkmark {
  color: #2f79e8;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  line-height: 1;
}

.detail-layout,
.checkout-layout,
.confirmation-wrap {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  border-radius: 30px;
  padding: 28px;
}

.offer-modal-scrim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 24px;
  background: rgba(247, 241, 232, 0.72);
}

.offer-modal {
  width: 80%;
  max-height: calc(100vh - 180px);
  overflow: auto;
  border-radius: 28px;
  padding: 28px;
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid rgba(220, 111, 71, 0.26);
  box-shadow: 0 30px 70px rgba(64, 43, 18, 0.16);
}

.offer-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.offer-modal-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 22px;
}

.modal-dismiss {
  flex: 0 0 auto;
}

.detail-grid,
.checkout-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
}

.detail-list,
.stack {
  display: grid;
  gap: 14px;
}

.detail-bullets {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
}

.card {
  border-radius: 22px;
  padding: 10px 20px 20px;
}

.card h3 {
  margin-top: 8px;
  margin-bottom: 14px;
}

.price-card {
  display: grid;
  gap: 18px;
  align-content: start;
  align-self: start;
  height: fit-content;
}

.price {
  font-size: 2.4rem;
  font-weight: 700;
}

.key-value {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(162, 145, 118, 0.22);
}

.checkout-input,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: white;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.confirmation-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  padding-top: 28px;
}

.confirmation-card {
  max-width: 700px;
  border-radius: 30px;
  padding: 34px;
  text-align: center;
}

.control-panel {
  padding: 20px;
  border-left: 1px solid rgba(162, 145, 118, 0.22);
  overflow: auto;
}

.control-panel h2 {
  margin-top: 0;
}

.control-section {
  margin-bottom: 22px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border-radius: 999px;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}

.pill.active {
  background: rgba(220, 111, 71, 0.16);
  color: var(--accent-deep);
}

.slider {
  width: 100%;
}

.static-email {
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,244,236,0.95));
  border: 1px dashed rgba(169, 144, 102, 0.45);
}

.cta-card {
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 248, 239, 0.92);
  border: 1px solid rgba(220, 111, 71, 0.18);
}

.empty-state {
  max-width: 700px;
  margin: 80px auto 0;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .control-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid rgba(162, 145, 118, 0.22);
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .detail-grid,
  .checkout-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .topbar,
  .content,
  .control-panel {
    padding-left: 18px;
    padding-right: 18px;
  }
}
