:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --brand: #2563eb;
  --accent: #0f766e;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }

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

.workspace-nav {
  padding: 18px 14px;
  background: #101827;
  color: white;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 800;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  text-align: left;
}

.nav-item.active, .nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.conversation-list,
.conversation,
.checkout,
.ticket,
.message,
.selection-empty,
.selection-card,
.offer {
  border: 1px solid var(--line);
  background: var(--surface);
}

.conversation-list {
  padding: 20px;
  border-top: 0;
  border-bottom: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.ok { background: var(--accent); }
.status-dot.warn { background: var(--danger); }

.ticket {
  position: relative;
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 14px 44px 14px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.ticket.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.ticket span, .ticket b, .message span, .fine-print, .offer p {
  color: var(--muted);
}

.ticket b {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.82rem;
}

.conversation {
  display: grid;
  grid-template-rows: auto 1fr 1fr auto;
  gap: 14px;
  padding: 20px;
  border-top: 0;
  border-bottom: 0;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.thread-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.thread-header strong {
  display: block;
  margin-top: 4px;
}

.thread-header button,
.composer button,
.offer button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.thread-header button { padding: 0 14px; }

.message {
  max-width: 620px;
  padding: 14px;
  border-radius: 8px;
}

.message.agent {
  justify-self: end;
  background: #eef6ff;
  border-color: #c7dcff;
}

.composer {
  display: grid;
  gap: 10px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checkout {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 22px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

.offers {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.offer {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
}

.price {
  color: var(--brand);
  font-weight: 800;
}

.selection-empty,
.selection-card {
  min-height: 110px;
  margin: 14px 0;
  padding: 14px;
  border-radius: 8px;
}

.selection-empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--surface-soft);
}

.primary-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #9ca3af;
}

@media (max-width: 1180px) {
  .inbox-shell { grid-template-columns: 190px 320px minmax(0, 1fr); }
  .checkout {
    position: static;
    grid-column: 2 / -1;
    min-height: auto;
    margin: 0 20px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
}

@media (max-width: 820px) {
  .inbox-shell { grid-template-columns: 1fr; }
  .workspace-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .brand-row { grid-column: 1 / -1; margin-bottom: 8px; }
  .conversation-list, .conversation { border-left: 0; border-right: 0; }
  .checkout { grid-column: 1; margin: 18px; }
}


.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}

.legal-footer a,
.back-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.legal-page {
  width: min(720px, calc(100% - 36px));
  margin: 0 auto;
  padding: 48px 0;
  line-height: 1.7;
}

.legal-page h1 {
  margin: 18px 0;
  font-size: 2rem;
}
