:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #20231f;
  --muted: #667064;
  --line: #d9ded5;
  --accent: #e05b2a;
  --accent-2: #1f6f68;
  --soft: #edf4f1;
  --warn: #fff2d8;
  --danger: #fae3dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.assistant-panel,
.quote-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.assistant-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.brand-row,
.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.conversation {
  overflow: auto;
  padding: 22px 24px;
}

.message {
  max-width: 820px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.48;
}

.message.agent {
  background: var(--soft);
  border: 1px solid #d4e6df;
}

.message.user {
  margin-left: auto;
  background: #fff6ef;
  border: 1px solid #f0cbb7;
}

.message strong {
  display: block;
  margin-bottom: 6px;
}

.message ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.composer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 64px 96px;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  outline: none;
}

textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.13);
}

.icon-button,
.send-button,
.file-button,
.actions button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  font-weight: 750;
}

.icon-button {
  background: var(--accent);
  color: white;
  font-size: 18px;
}

.icon-button.listening {
  background: #b73222;
}

.send-button {
  background: var(--ink);
  color: white;
}

.file-button {
  display: grid;
  place-items: center;
  background: #eef0ec;
  color: var(--ink);
  font-size: 13px;
}

.file-button input {
  display: none;
}

.quote-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.quote-summary {
  overflow: auto;
  padding: 18px;
}

.empty,
.note {
  color: var(--muted);
}

.section {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.section:first-child {
  padding-top: 0;
}

.section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #edf0eb;
}

.line-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.quote-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 84px;
  border-top: 1px solid #edf0eb;
}

.quote-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 0;
  text-transform: uppercase;
}

.quote-position,
.quote-qty,
.quote-price {
  border-top: 1px solid #edf0eb;
  padding: 10px 0;
}

.quote-position {
  padding-right: 12px;
}

.quote-position small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 4px;
}

.quote-qty,
.quote-price {
  color: var(--ink);
  font-weight: 750;
  text-align: right;
}

.badge {
  display: inline-block;
  margin: 4px 6px 0 0;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--soft);
  color: #174f4a;
  font-size: 12px;
  font-weight: 700;
}

.warning {
  background: var(--warn);
  border: 1px solid #f0d38e;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
}

.problem {
  background: var(--danger);
  border-color: #edb2a5;
}

.recommendation {
  background: #e9f4ff;
  border-color: #b5d4ef;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.actions button {
  background: #eef0ec;
  color: var(--ink);
}

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

  .quote-panel {
    min-height: 520px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .file-button,
  .send-button {
    grid-column: 1 / -1;
  }

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

  .quote-table-head {
    display: none;
  }

  .quote-qty,
  .quote-price {
    border-top: 0;
    padding: 0 0 8px;
    text-align: left;
  }
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-box {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  display: grid;
  gap: 14px;
}

.auth-box label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.auth-box input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 750;
  text-align: left;
  padding: 0;
}

.auth-message {
  min-height: 22px;
  color: var(--muted);
}
