:root {
  color-scheme: light;
  --ink: #17221e;
  --muted: #66736d;
  --line: #dce3de;
  --paper: #f7f8f4;
  --white: #ffffff;
  --green: #176b4d;
  --green-dark: #0d4f38;
  --green-soft: #e3f1e9;
  --amber: #9a5b13;
  --amber-soft: #fff0d8;
  --red: #a23b32;
  --red-soft: #fbe9e6;
  --navy: #213a52;
  --shadow: 0 20px 50px rgba(28, 47, 39, 0.08);
  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;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(35, 111, 79, 0.09), transparent 28rem),
    var(--paper);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: white;
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }

.topbar {
  height: 76px;
  padding: 0 2.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 0.8rem; color: inherit; text-decoration: none; }
.brand-symbol { width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.98rem; letter-spacing: -0.01em; }
.brand small { margin-bottom: 0.13rem; color: var(--muted); font-size: 0.58rem; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase; }
.trust-signals { display: flex; gap: 1.15rem; align-items: center; color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.trust-signals span { display: flex; gap: 0.42rem; align-items: center; white-space: nowrap; }
.trust-dot { width: 8px; height: 8px; border-radius: 50%; background: #477a9f; box-shadow: 0 0 0 4px #e7eff7; }
.trust-dot.rules { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.trust-dot.human { background: #b46b19; box-shadow: 0 0 0 4px var(--amber-soft); }

.demo-banner { min-height: 34px; padding: 0.46rem 2.2rem; display: flex; justify-content: center; align-items: center; gap: 0.65rem; background: #f1f5f1; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.68rem; }
.demo-banner strong { color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.07em; }

.data-warning {
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  color: #60420f;
  background: #fff7e8;
  border: 1px solid #ecd19b;
  border-radius: 11px;
  font-size: 0.68rem;
  line-height: 1.5;
}
.data-warning strong { display: block; margin-bottom: 0.2rem; color: #744d0b; font-size: 0.74rem; }
.data-warning p { margin: 0 0 0.35rem; }
.data-warning a { color: #65420a; font-weight: 700; text-underline-offset: 2px; }

.workspace {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.rail { display: grid; gap: 1rem; position: sticky; top: 124px; max-height: calc(100vh - 142px); overflow: auto; padding-bottom: 1rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.intake, .inbox { padding: 1.2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.section-heading.compact { align-items: center; margin-bottom: 0.7rem; }
.eyebrow { display: block; color: var(--green); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.38rem; letter-spacing: -0.035em; }
h2 { margin-bottom: 0; font-size: 1.12rem; letter-spacing: -0.025em; }
h3 { font-size: 0.92rem; }
.step { color: #b9c5be; font: 500 0.8rem/1 ui-monospace, monospace; }
.mail-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--green-dark); background: var(--green-soft); font-size: 1rem; }

label { display: block; margin-bottom: 0.4rem; font-size: 0.76rem; font-weight: 700; }
textarea, input[type="text"], input[type="number"], input[type="date"] {
  width: 100%;
  border: 1px solid #cbd5ce;
  border-radius: 10px;
  padding: 0.72rem 0.78rem;
  color: var(--ink);
  background: #fcfdfb;
  outline: none;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.48; }
textarea:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.12); }
.email-fields { display: grid; gap: 0.65rem; margin-bottom: 0.65rem; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0.65rem 0; }
.attachment-control { position: relative; display: flex; align-items: center; gap: 0.65rem; margin: 0.7rem 0 0; padding: 0.68rem; color: var(--green-dark); background: #f7faf7; border: 1px dashed #b9cdbf; border-radius: 10px; cursor: pointer; }
.attachment-control:hover { background: var(--green-soft); border-color: var(--green); }
.attachment-control strong, .attachment-control small { display: block; }
.attachment-control small { margin-top: 0.12rem; color: var(--muted); font-weight: 500; font-size: 0.63rem; }
.attachment-plus { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--green); border-radius: 8px; font-size: 1rem; }
.attachment-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}
.attachment-list { display: grid; gap: 0.4rem; margin-top: 0.45rem; }
.attachment-chip { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.45rem; padding: 0.46rem 0.55rem; background: var(--green-soft); border-radius: 9px; font-size: 0.67rem; }
.attachment-chip strong, .attachment-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip small { margin-top: 0.08rem; color: var(--muted); }
.attachment-chip button { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: rgba(255, 255, 255, 0.65); }
.scenario-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.8rem 0 1rem; color: var(--muted); font-size: 0.68rem; }
.chip, .ghost, .icon-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 650;
}
.chip:hover, .ghost:hover { border-color: var(--green); color: var(--green); }
.icon-button { width: 32px; height: 32px; padding: 0; font-size: 1rem; }
.primary, .danger, .secondary {
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-weight: 750;
}
.primary { color: white; background: var(--green-dark); }
.primary:hover { background: #083d2b; }
.secondary { color: var(--green-dark); background: var(--green-soft); }
.danger { color: var(--red); background: var(--red-soft); }
.full { width: 100%; display: flex; justify-content: space-between; }
.processing-note { margin: 0.5rem 0 0; color: var(--muted); text-align: center; font-size: 0.62rem; }

.inbox-list { display: grid; gap: 0.45rem; max-height: 340px; overflow: auto; }
.inbox-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.7rem; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.48rem; color: var(--muted); background: white; font-size: 0.59rem; font-weight: 700; }
.filter-chip span { margin-left: 0.18rem; color: var(--ink); }
.filter-chip.active { color: var(--green-dark); border-color: #b8d3c3; background: var(--green-soft); }
.inbox-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.5rem;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f8faf7;
  padding: 0.72rem;
  color: inherit;
}
.inbox-item:hover, .inbox-item.active { background: var(--green-soft); border-color: #c9dfd2; }
.inbox-ref { font: 700 0.75rem/1.2 ui-monospace, monospace; }
.inbox-subject { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; font-weight: 750; }
.inbox-sender { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.65rem; }
.inbox-item .inbox-ref { grid-column: 1 / -1; color: #929f98; font-size: 0.57rem; font-weight: 550; }
.inbox-date { color: var(--muted); font-size: 0.67rem; }

.detail { min-width: 0; }
.empty-state { min-height: calc(100vh - 160px); display: grid; place-content: center; text-align: center; padding: 3rem; }
.empty-state h2 { margin: 0.55rem 0; font-size: 1.7rem; }
.empty-state p { color: var(--muted); max-width: 540px; line-height: 1.6; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 1.2rem; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 1.3rem; }
.promise-grid { width: min(720px, 100%); margin: 2rem auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: left; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.promise-grid div { min-width: 0; padding: 1rem; background: #fafcf9; border-right: 1px solid var(--line); }
.promise-grid div:last-child { border-right: 0; }
.promise-grid span, .promise-grid strong, .promise-grid small { display: block; }
.promise-grid span { margin-bottom: 0.45rem; color: var(--green); font: 650 0.65rem/1 ui-monospace, monospace; }
.promise-grid strong { font-size: 0.78rem; }
.promise-grid small { margin-top: 0.2rem; color: var(--muted); font-size: 0.64rem; }

.case-header { padding: 1.25rem 1.4rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.case-title { display: flex; gap: 0.8rem; align-items: center; }
.case-title h1 { font: 750 1.15rem/1.2 ui-monospace, monospace; }
.case-title p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.74rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.33rem 0.6rem; font-size: 0.66rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.045em; }
.badge.received, .badge.quote_ready { color: var(--green-dark); background: var(--green-soft); }
.badge.needs_review, .badge.pending_approval { color: var(--amber); background: var(--amber-soft); }
.badge.failed, .badge.rejected { color: var(--red); background: var(--red-soft); }
.badge.approved, .badge.closed { color: white; background: var(--green); }
.badge.draft { color: var(--navy); background: #e7eff7; }
.badge.category { text-transform: none; letter-spacing: 0; white-space: nowrap; }
.badge.ready_to_quote { color: var(--green-dark); background: var(--green-soft); }
.badge.needs_clarification { color: var(--amber); background: var(--amber-soft); }
.badge.human_review { color: var(--red); background: var(--red-soft); }
.badge.not_rfq { color: var(--navy); background: #e7eff7; }
.badge.to_analyze { color: var(--muted); background: #eef1ef; }

.journey { list-style: none; margin: 0 0 1rem; padding: 0.85rem 1.1rem; display: grid; grid-template-columns: repeat(4, 1fr); background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(28, 47, 39, 0.05); }
.journey li { position: relative; display: flex; align-items: center; gap: 0.55rem; color: #9ba69f; font-size: 0.7rem; }
.journey li:not(:last-child)::after { content: ""; position: absolute; left: calc(100% - 1.2rem); right: 0.75rem; top: 50%; height: 1px; background: var(--line); }
.journey li > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 0.65rem; }
.journey li.complete, .journey li.current { color: var(--ink); }
.journey li.complete > span { color: white; background: var(--green); border-color: var(--green); }
.journey li.current > span { color: var(--green-dark); background: var(--green-soft); border-color: #b5d7c4; }
.compact-journey { grid-template-columns: repeat(3, 1fr); }

.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.panel { padding: 1.25rem; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); }
.panel-heading p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.72rem; }
.source-text { margin: 1rem 0 0; padding: 1rem; min-height: 230px; white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8f5; border-radius: 12px; font: 500 0.8rem/1.6 ui-monospace, monospace; }
.email-card { margin-top: 1rem; min-height: 230px; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fcfdfb; }
.email-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.65rem; align-items: center; }
.email-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-size: 0.68rem; font-weight: 750; }
.email-meta { min-width: 0; }
.email-meta strong, .email-meta span { display: block; overflow-wrap: anywhere; }
.email-meta strong { font-size: 0.72rem; }
.email-meta span { margin-top: 0.15rem; color: var(--muted); font-size: 0.62rem; }
.email-channel { align-self: start; padding: 0.25rem 0.45rem; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; font-size: 0.58rem; font-weight: 750; }
.email-subject { margin: 1rem 0 0.7rem; font-size: 0.9rem; }
.email-body { padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.75rem; line-height: 1.55; }
.email-attachments { display: grid; gap: 0.45rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.66rem; }
.email-attachments details { padding: 0.5rem 0.6rem; color: var(--ink); background: #f5f8f5; border-radius: 8px; }
.email-attachments pre { margin: 0.55rem 0 0; white-space: pre-wrap; font-size: 0.66rem; }
.conversation-thread { display: grid; gap: 0.7rem; margin-top: 1rem; }
.conversation-thread .email-card { margin-top: 0; min-height: 0; }
.thread-heading { padding: 0.65rem 0.75rem; display: flex; justify-content: space-between; gap: 0.6rem; color: var(--muted); background: #f4f7f4; border-radius: 10px; font-size: 0.65rem; }
.thread-heading small { font-family: ui-monospace, monospace; }
.email-avatar.reply { background: var(--green); }
.thread-reply { margin-left: 1.4rem; border-color: #bfd7c9; box-shadow: -4px 0 0 var(--green-soft); }
.thread-reply time { display: block; margin-top: 0.7rem; color: var(--muted); font-size: 0.6rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1rem; }
.field { min-width: 0; }
.field dt { color: var(--muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; }
.field dd { margin: 0.25rem 0 0; font-size: 0.82rem; overflow-wrap: anywhere; }
.line-list, .reason-list, .evidence-list, .timeline { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.55rem; }
.line-item, .reason, .evidence { padding: 0.7rem; border-radius: 9px; background: #f6f8f5; font-size: 0.76rem; }
.line-item { display: flex; justify-content: space-between; gap: 1rem; }
.reason { display: grid; gap: 0.2rem; background: var(--amber-soft); color: #6e430f; }
.reason.blocking { background: var(--red-soft); color: #76302a; }
.reason span { line-height: 1.4; }
.reason small { color: inherit; opacity: 0.75; font: 600 0.64rem/1.2 ui-monospace, monospace; }
.evidence { border-left: 3px solid #a8cbb9; font-style: italic; }
.success-note { margin: 1rem 0; padding: 0.7rem; color: var(--green-dark); background: var(--green-soft); border-radius: 9px; font-size: 0.74rem; }
.technical-details { margin-top: 0.7rem; color: var(--muted); font-size: 0.68rem; }
.technical-details p { margin: 0.5rem 0 0; }

.quote-card { padding: 1.3rem; margin-bottom: 1rem; }
.authority-strip { margin: 1rem 0; padding: 0.75rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; background: #f7faf7; border-radius: 11px; }
.authority-strip > span { min-width: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.55rem; align-items: center; }
.authority-icon { grid-row: 1 / 3; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: white; background: #477a9f; font: 750 0.6rem/1 ui-sans-serif, sans-serif; }
.authority-icon.rules { background: var(--green); }
.authority-icon.human { background: #b46b19; }
.authority-strip strong { font-size: 0.69rem; }
.authority-strip small { color: var(--muted); font-size: 0.59rem; }
.quote-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.metric { padding: 0.85rem; background: #f6f8f5; border-radius: 10px; }
.metric span { display: block; color: var(--muted); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; }
.metric strong { display: block; margin-top: 0.3rem; font-size: 1rem; }
.metric.total { color: white; background: var(--green-dark); }
.metric.total span { color: rgba(255, 255, 255, 0.72); }
.table-wrap { width: 100%; overflow-x: auto; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.quote-table th, .quote-table td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); }
.quote-table th { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; }
.quote-table td:last-child, .quote-table th:last-child { text-align: right; }

.editor { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.editor-line { display: grid; grid-template-columns: 1fr 120px 34px; gap: 0.5rem; margin-bottom: 0.5rem; align-items: end; }
.remove-line { height: 42px; border: 0; border-radius: 8px; color: var(--red); background: var(--red-soft); }
.editor-actions { display: flex; justify-content: space-between; gap: 0.7rem; margin-top: 0.8rem; }

.next-action { padding: 1.3rem; margin-bottom: 1rem; overflow: hidden; border-color: #c9dfd2; }
.next-action.ready { box-shadow: 0 22px 54px rgba(23, 107, 77, 0.12); }
.next-action.clarification { border-color: #ead2ac; box-shadow: 0 22px 54px rgba(154, 91, 19, 0.1); }
.next-action.blocked { border-color: #e5c1bc; box-shadow: 0 22px 54px rgba(162, 59, 50, 0.09); }
.next-action.out-of-scope { border-color: #c9d8e5; box-shadow: 0 22px 54px rgba(33, 58, 82, 0.08); }
.next-action-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.85rem; align-items: center; }
.next-action-header h2 { margin-top: 0.16rem; font-size: 1.25rem; }
.next-action-header p { max-width: 720px; margin: 0.3rem 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.5; }
.action-symbol { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 13px; font-size: 1rem; font-weight: 800; }
.clarification .action-symbol { background: var(--amber); }
.blocked .action-symbol { background: var(--red); }
.out-of-scope .action-symbol { background: var(--navy); }
.pending .action-symbol { color: var(--green-dark); background: var(--green-soft); }
.action-badge { padding: 0.38rem 0.6rem; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; font-size: 0.61rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0.045em; }
.clarification .action-badge { color: var(--amber); background: var(--amber-soft); }
.blocked .action-badge { color: var(--red); background: var(--red-soft); }
.out-of-scope .action-badge { color: var(--navy); background: #e7eff7; }
.classification-summary { margin-top: 1rem; padding: 1rem; display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: center; background: #f2f6f9; border-radius: 12px; }
.classification-summary > span { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 10px; }
.classification-summary p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.reply-simulator { margin-bottom: 1rem; padding: 1.2rem 1.3rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 0.8fr) auto; gap: 1rem; align-items: center; border-color: #ead2ac; }
.reply-simulator h2 { margin-top: 0.2rem; }
.reply-simulator p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.reply-simulator blockquote { margin: 0; padding: 0.75rem 0.85rem; color: #6e430f; background: var(--amber-soft); border-radius: 10px; font-size: 0.7rem; line-height: 1.45; }
.reply-simulator blockquote strong, .reply-simulator blockquote span { display: block; }
.reply-simulator blockquote span { margin-top: 0.2rem; }
.reply-simulator > small { grid-column: 1 / -1; color: var(--muted); font-size: 0.61rem; }
.reply-simulator.resolved { grid-template-columns: auto 1fr; border-color: #bdd8c8; background: #fbfdfb; }
.reply-simulator.resolved > span { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; }
.action-issues { margin-top: 1rem; padding: 0.8rem 1rem; background: #f7f9f6; border-radius: 10px; }
.blocked .action-issues { color: #76302a; background: var(--red-soft); }
.clarification .action-issues { color: #6e430f; background: var(--amber-soft); }
.action-issues > strong { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.055em; }
.action-issues ul { margin: 0.45rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; font-size: 0.72rem; line-height: 1.4; }
.action-email { margin-top: 1rem; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.action-email-toolbar { padding: 0.65rem 0.8rem; display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: #f5f7f4; border-bottom: 1px solid var(--line); font-size: 0.64rem; }
.action-email-toolbar span { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.action-email-toolbar i { width: 22px; height: 22px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 6px; font-style: normal; }
.action-email-toolbar strong { color: var(--red); font-size: 0.59rem; text-transform: uppercase; letter-spacing: 0.05em; }
.action-email-field { padding: 0.65rem 0.85rem 0; }
.action-email-field label { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.045em; }
.action-email-field input, .action-email-field textarea { background: white; }
.action-email-field textarea { min-height: 185px; font-size: 0.77rem; line-height: 1.55; }
.action-validation { margin-top: 0.75rem; padding: 0.85rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #f7faf7; border-top: 1px solid var(--line); }
.action-validation p, .action-validation strong, .action-validation span { margin: 0; display: block; }
.action-validation strong { font-size: 0.7rem; }
.action-validation span { margin-top: 0.15rem; color: var(--muted); font-size: 0.61rem; }
.action-lock { margin-top: 1rem; padding: 1.1rem; display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: center; color: #76302a; background: #fff8f7; border: 1px dashed #dfb6b1; border-radius: 12px; }
.action-lock > span { width: 36px; height: 36px; display: grid; place-items: center; background: var(--red-soft); border-radius: 50%; font-size: 1rem; }
.action-lock strong { font-size: 0.76rem; }
.action-lock p { margin: 0.25rem 0 0; font-size: 0.69rem; line-height: 1.45; }

.history { padding: 1.25rem; }
.timeline { position: relative; }
.timeline li { display: grid; grid-template-columns: 18px 1fr auto; gap: 0.6rem; align-items: start; font-size: 0.73rem; }
.timeline-dot { width: 9px; height: 9px; margin-top: 0.2rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.timeline time { color: var(--muted); font-size: 0.65rem; }
.muted { color: var(--muted); font-size: 0.76rem; }
.error-box { padding: 1rem; background: var(--red-soft); color: var(--red); border-radius: 10px; }
.toast { position: fixed; right: 1.4rem; bottom: 1.4rem; max-width: 380px; padding: 0.8rem 1rem; border-radius: 10px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 310px minmax(0, 1fr); padding-inline: 1rem; }
  .comparison { grid-template-columns: 1fr; }
  .reply-simulator { grid-template-columns: 1fr; }
  .reply-simulator > small { grid-column: 1; }
  .quote-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 1rem; }
  .trust-signals { display: none; }
  .demo-banner { padding-inline: 1rem; text-align: center; }
  .workspace { display: block; padding: 1rem; }
  .rail { position: static; max-height: none; overflow: visible; margin-bottom: 1rem; }
  .inbox-list { max-height: 250px; }
  .case-header { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .field-grid, .editor-grid { grid-template-columns: 1fr; }
  .editor-line { grid-template-columns: 1fr 90px 34px; }
  .journey { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .journey li::after { display: none; }
  .authority-strip { grid-template-columns: 1fr; }
  .next-action-header { grid-template-columns: auto 1fr; }
  .next-action-header .action-badge { grid-column: 2; justify-self: start; }
  .action-validation { align-items: stretch; flex-direction: column; }
  .promise-grid { grid-template-columns: 1fr 1fr; }
  .promise-grid div:nth-child(2) { border-right: 0; }
  .promise-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 430px) {
  .workspace { padding-inline: 0.65rem; }
  .intake, .inbox, .panel, .quote-card, .next-action, .history { padding: 1rem; }
  .demo-banner span { display: none; }
  .quote-summary { grid-template-columns: 1fr; }
  .email-channel { display: none; }
  .email-header { grid-template-columns: auto minmax(0, 1fr); }
  .editor-line { grid-template-columns: minmax(0, 1fr) 76px 32px; }
  .editor-actions { align-items: stretch; flex-direction: column; }
}

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

.embed-mode { background: var(--paper); }
.embed-mode .topbar, .embed-mode .demo-banner, .embed-mode .skip-link { display: none; }
.embed-mode .workspace { width: 1440px; max-width: 100%; padding: 0.8rem; grid-template-columns: 320px minmax(0, 1fr); gap: 0.8rem; }
.embed-mode .rail { position: static; max-height: none; overflow: visible; }
.embed-mode .intake { display: none; }
.embed-mode .empty-state { min-height: 590px; }
