:root {
  color-scheme: light;
  --ink: #171512;
  --muted: #6f6a63;
  --paper: #f3f0e8;
  --white: #fffdf8;
  --line: #d8d1c5;
  --soft-line: #e9e3da;
  --accent: #9e3f2d;
  --accent-dark: #783023;
  --success: #245d49;
  --success-bg: #e7f1eb;
  --preview-bg: #f5e9d4;
  --shadow: 0 18px 60px rgba(28, 24, 18, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(158, 63, 45, 0.3);
  outline-offset: 2px;
}

.topbar {
  min-height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--white);
  background: var(--ink);
  border-bottom: 1px solid #2b2824;
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  letter-spacing: 0.24em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #c8c1b6;
  font-size: 0.84rem;
}

.demo-badge {
  padding: 7px 10px;
  border: 1px solid #4d4942;
  border-radius: 999px;
  color: var(--white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(560px, 1.22fr);
  max-width: 1500px;
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  border-inline: 1px solid var(--line);
  background: var(--white);
}

.conversation-pane {
  padding: 32px;
  background: #ebe7de;
  border-right: 1px solid var(--line);
}

.pane-heading,
.app-heading,
.lookup-header,
.message-author,
.action-bar,
.label-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.card-kicker,
.meta-label,
.label-route span {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1,
h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.08;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.55rem);
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.conversation-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
}

.conversation-meta,
.conversation-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.42);
}

.conversation-meta > div,
.conversation-fields > div {
  min-width: 0;
  padding: 15px 16px;
}

.conversation-meta > div + div,
.conversation-fields > div:nth-child(even) {
  border-left: 1px solid var(--line);
}

.conversation-fields > div:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.conversation-meta strong,
.conversation-fields strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.thread {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.message {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.message p {
  margin: 16px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.55;
}

.message-author {
  justify-content: flex-start;
}

.message-author > div {
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
}

.message-author span,
.message-author time {
  color: var(--muted);
  font-size: 0.75rem;
}

.message-author time {
  margin-left: auto;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink) !important;
  font-size: 0.69rem !important;
  font-weight: 700;
}

.avatar-dark {
  color: var(--white) !important;
  background: var(--ink);
}

.internal-note {
  background: #fff7df;
  border-color: #d7c69b;
}

.internal-note p {
  margin-top: 8px;
  font-family: inherit;
  font-size: 0.89rem;
}

.note-label {
  color: #705d2d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-pane {
  min-width: 0;
  padding: 46px clamp(28px, 4.5vw, 72px) 60px;
  background: var(--white);
}

.app-shell {
  max-width: 820px;
  margin: 0 auto;
}

.text-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-size: 0.83rem;
}

.mobile-context {
  display: none;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 30px 0 26px;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.step {
  padding: 13px 8px;
  color: #9b958d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.step + .step {
  border-left: 1px solid var(--line);
}

.step span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.68rem;
}

.step.is-current,
.step.is-complete {
  color: var(--ink);
}

.step.is-current {
  background: #f0ebe2;
}

.step.is-complete span {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.screen {
  animation: appear 180ms ease-out;
}

.screen[hidden] {
  display: none;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.lookup-card,
.form-card,
.preview-card,
.shipment-summary,
.confirmation,
.draft-card {
  border: 1px solid var(--line);
}

.lookup-card,
.form-card {
  padding: 22px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-ok {
  color: var(--success);
  background: var(--success-bg);
}

.source-note,
.field-group p,
.demo-explanation {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.source-note {
  margin: 7px 0 20px;
}

.order-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding-block: 18px;
  border-block: 1px solid var(--soft-line);
}

.product-swatch {
  width: 48px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #e8dcc4;
  background: #61513b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.product-copy {
  display: grid;
  gap: 6px;
}

.product-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.selection-control {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.79rem;
  font-weight: 700;
}

input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--ink);
}

.order-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
  margin: 20px 0 0;
}

.order-facts div {
  display: grid;
  gap: 5px;
}

.order-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.order-facts dd {
  margin: 0;
  font-size: 0.87rem;
  font-weight: 700;
}

.form-card {
  display: grid;
  gap: 18px;
  margin-top: 14px;
  background: #faf7f1;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.field-group p {
  margin: 7px 0 0;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #aaa399;
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  font-size: 0.86rem;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 42px;
}

.input-suffix span {
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
  font-size: 0.8rem;
}

.action-bar {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.action-bar > div {
  display: grid;
  gap: 4px;
}

.action-bar span {
  color: var(--muted);
  font-size: 0.78rem;
}

.primary-button,
.secondary-button,
.draft-button {
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 700;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

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

.primary-button:hover:not(:disabled) {
  background: #37332e;
  transform: translateY(-1px);
}

.primary-button:disabled {
  color: #8e8880;
  background: #d8d3cb;
  border-color: #d8d3cb;
  cursor: not-allowed;
}

.secondary-button {
  color: var(--ink);
  background: transparent;
}

.secondary-button:hover {
  background: #f0ece4;
}

.notice {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid;
}

.notice-preview {
  color: #6b5022;
  background: var(--preview-bg);
  border-color: #d7bf8d;
}

.notice-success {
  color: var(--success);
  background: var(--success-bg);
  border-color: #a8c7b8;
}

.notice-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.notice p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.preview-card {
  padding: 20px;
}

.preview-card address {
  margin: 12px 0 16px;
  color: #4f4a44;
  font-style: normal;
  font-size: 0.86rem;
  line-height: 1.55;
}

.verification {
  color: var(--success);
  font-size: 0.73rem;
  font-weight: 700;
}

.shipment-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
}

.shipment-summary > div {
  min-width: 0;
  padding: 17px;
}

.shipment-summary > div + div {
  border-left: 1px solid var(--line);
}

.shipment-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.confirmation {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 18px;
  background: #faf7f1;
  cursor: pointer;
}

.confirmation input {
  margin: 2px 0 0;
}

.confirmation span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.confirmation strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.preview-actions {
  justify-content: flex-end;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
  margin-top: 14px;
}

.label-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 2px solid var(--ink);
  background: #fff;
  font-family: Arial, sans-serif;
}

.label-warning {
  margin: -18px -18px 15px;
  padding: 8px 10px;
  color: #fff;
  background: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.label-topline {
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
  font-size: 0.78rem;
}

.label-topline strong {
  font-size: 1.2rem;
}

.label-route > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--ink);
}

.label-route span {
  margin-bottom: 4px;
  color: #555;
}

.label-route strong {
  display: block;
  font-size: 0.9rem;
}

.label-route p {
  margin: 4px 0 0;
  font-size: 0.66rem;
  line-height: 1.3;
}

.tracking-mark {
  margin: 15px 0 10px;
  font-size: clamp(0.78rem, 1.8vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
}

.barcode {
  height: 58px;
  background: repeating-linear-gradient(
    90deg,
    #111 0,
    #111 2px,
    transparent 2px,
    transparent 5px,
    #111 5px,
    #111 6px,
    transparent 6px,
    transparent 9px
  );
}

.label-card small {
  display: block;
  margin-top: 8px;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.draft-card {
  padding: 20px;
  background: #faf7f1;
}

.draft-header {
  display: grid;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.draft-header div {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  font-size: 0.8rem;
}

.draft-header span {
  color: var(--muted);
}

.draft-body {
  padding: 15px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  line-height: 1.5;
}

.attachment {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  background: var(--white);
}

.pdf-icon {
  width: 36px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
}

.attachment div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.attachment strong,
.attachment span {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.attachment span {
  color: var(--muted);
}

.draft-button {
  width: 100%;
  margin-top: 14px;
  color: #827d75;
  background: #e5e0d8;
  border-color: #d5d0c8;
  cursor: not-allowed;
}

.demo-explanation {
  margin: 8px 0 0;
  text-align: center;
}

.complete-bar {
  margin-top: 22px;
}

footer {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 12px 20px;
  color: #777169;
  background: #e8e3da;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  text-align: center;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .conversation-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .conversation-pane .thread {
    grid-template-columns: repeat(2, 1fr);
  }

  .internal-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 62px;
    padding: 0 18px;
  }

  .topbar-meta > span:first-child {
    display: none;
  }

  .workspace {
    min-height: 0;
    border-inline: 0;
  }

  .conversation-pane,
  .app-pane {
    padding: 26px 18px 34px;
  }

  .conversation-pane .thread,
  .preview-grid,
  .result-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .order-facts {
    grid-template-columns: 1fr;
  }

  .shipment-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .shipment-summary > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .shipment-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .conversation-pane {
    display: none;
  }

  .mobile-context {
    display: block;
  }
}

@media (max-width: 430px) {
  .topbar-meta {
    gap: 0;
  }

  .wordmark {
    font-size: 0.94rem;
  }

  .app-heading {
    align-items: flex-start;
  }

  .text-button {
    white-space: nowrap;
  }

  .step {
    font-size: 0.68rem;
  }

  .step span {
    display: none;
  }

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

  .product-swatch {
    width: 42px;
    height: 52px;
  }

  .selection-control {
    grid-column: 2;
  }

  .conversation-meta,
  .conversation-fields {
    grid-template-columns: 1fr;
  }

  .conversation-meta > div + div,
  .conversation-fields > div:nth-child(even),
  .conversation-fields > div:nth-child(n + 3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

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