:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697489;
  --line: #dfe4ec;
  --line-strong: #cbd3df;
  --blue: #1e5eff;
  --blue-dark: #1748c9;
  --blue-soft: #edf3ff;
  --green: #12805c;
  --green-soft: #e9f7f1;
  --amber: #b76905;
  --amber-soft: #fff5df;
  --sidebar: #172033;
  --sidebar-muted: #97a3b7;
  --shadow: 0 8px 28px rgba(22, 32, 51, .08);
  --radius: 12px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 24px 14px 18px;
  color: #fff;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 24px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  background: var(--blue);
  border-radius: 7px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: .07em;
}

.brand-copy small,
.profile small {
  color: var(--sidebar-muted);
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  color: var(--sidebar-muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.nav-item svg {
  width: 19px;
}

.nav-item span:nth-child(2) {
  font-size: 13px;
  line-height: 1.25;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .09);
}

.nav-item.active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 26px;
  content: "";
  background: #6f9cff;
  border-radius: 0 3px 3px 0;
}

.nav-count {
  min-width: 20px;
  padding: 2px 6px;
  color: #c7d8ff;
  font-size: 11px;
  text-align: center;
  background: rgba(30, 94, 255, .4);
  border-radius: 10px;
}

.sidebar-bottom {
  display: grid;
  gap: 16px;
  margin-top: auto;
}

.demo-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  color: #bec8d7;
  font-size: 11px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #5ee4ac;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(94, 228, 172, .12);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.profile > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile strong {
  font-size: 12px;
}

.avatar,
.company-avatar {
  display: grid;
  place-items: center;
  font-weight: 700;
  border-radius: 50%;
}

.avatar {
  width: 34px;
  height: 34px;
  color: #dce6f9;
  font-size: 11px;
  background: #344157;
}

.main {
  min-height: 100vh;
  margin-left: 248px;
  padding: 0 30px 132px;
}

.topbar {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 -30px 24px;
  padding: 17px 30px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.02em;
}

.topbar h1 span {
  color: var(--muted);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.safe-mode {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: var(--green);
  font-size: 11px;
  font-weight: 650;
  background: var(--green-soft);
  border-radius: 7px;
}

.safe-mode svg {
  width: 16px;
}

.icon-button,
.document-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.icon-button svg {
  width: 18px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  background: #ef5454;
  border: 1px solid #fff;
  border-radius: 50%;
}

.mobile-menu {
  display: none;
}

.workflow {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  max-width: 920px;
  margin: 0 auto 25px;
}

.workflow > i {
  height: 1px;
  margin: 0 12px;
  background: var(--line-strong);
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.workflow-step > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #7a8598;
  font-size: 12px;
  font-weight: 750;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.workflow-step > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.workflow-step strong {
  font-size: 12px;
}

.workflow-step small {
  color: #929bad;
  font-size: 10px;
}

.workflow-step.active {
  color: var(--ink);
}

.workflow-step.active > span,
.workflow-step.done > span {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.workflow-step.done > span {
  font-size: 0;
}

.workflow-step.done > span::after {
  font-size: 14px;
  content: "✓";
}

.workflow-step.done + i {
  background: var(--blue);
}

.stage {
  display: none;
  animation: stage-in .24s ease both;
}

.stage.active {
  display: block;
}

@keyframes stage-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-grid {
  display: grid;
  gap: 18px;
}

.inbox-grid {
  grid-template-columns: minmax(240px, 300px) minmax(560px, 1fr);
  max-width: 1180px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(22, 32, 51, .025);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 18px 15px;
}

.panel-head h2,
.review-summary h2,
.offer-complete h2,
.mail-ready-head h2 {
  margin: 0;
  letter-spacing: -.025em;
}

.panel-head h2 {
  font-size: 17px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 750;
  border-radius: 5px;
}

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

.badge.neutral {
  color: #657086;
  background: #eef1f5;
}

.mail-item {
  position: relative;
  display: flex;
  width: 100%;
  gap: 8px;
  padding: 15px 17px;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.mail-item.selected {
  background: var(--blue-soft);
}

.mail-item.selected::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--blue);
}

.mail-item.muted {
  opacity: .66;
}

.mail-unread {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 6px;
  background: var(--blue);
  border-radius: 50%;
}

.mail-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.mail-copy > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mail-copy strong,
.mail-copy b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-copy b {
  font-weight: 650;
}

.mail-copy small,
.mail-copy time {
  color: var(--muted);
  font-size: 10px;
}

.email-card {
  overflow: hidden;
}

.email-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

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

.sender > div,
.email-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.company-avatar {
  width: 38px;
  height: 38px;
  color: var(--blue);
  font-size: 11px;
  background: var(--blue-soft);
}

.sender strong {
  font-size: 12px;
}

.sender small,
.email-meta {
  color: var(--muted);
  font-size: 10px;
}

.email-meta {
  text-align: right;
}

.email-body {
  min-height: 375px;
  padding: 27px 32px;
}

.email-body h2 {
  margin: 12px 0 24px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.email-body p {
  max-width: 680px;
  margin: 0 0 14px;
  color: #455064;
  font-size: 13px;
  line-height: 1.6;
}

.email-body .signature {
  margin-top: 21px;
  color: var(--muted);
}

.attachment,
.compose-attachment {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 11px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attachment > span:nth-child(2),
.compose-attachment > span:nth-child(2),
.source-file > span:last-child {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.attachment strong,
.compose-attachment strong,
.source-file strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment small,
.compose-attachment small,
.source-file small {
  color: var(--muted);
  font-size: 10px;
}

.file-icon {
  display: grid;
  width: 36px;
  height: 39px;
  flex: 0 0 36px;
  place-items: center;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  background: #278056;
  border-radius: 5px;
}

.file-icon.small {
  width: 31px;
  height: 34px;
  flex-basis: 31px;
}

.file-icon.pdf {
  background: #d95050;
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 650;
}

.scan-status svg {
  width: 15px;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  background: #f8faff;
  border-top: 1px solid #dce5f7;
}

.automation-note {
  display: flex;
  align-items: center;
  gap: 10px;
}

.automation-note > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.automation-note strong {
  font-size: 11px;
}

.automation-note small {
  color: var(--muted);
  font-size: 10px;
}

.spark-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 8px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button svg {
  width: 16px;
}

.button.primary {
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button.secondary {
  color: #465166;
  background: #fff;
  border: 1px solid var(--line-strong);
}

.button:disabled {
  color: #9ba4b4;
  background: #e9edf2;
  border-color: #e2e6ec;
  cursor: not-allowed;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  visibility: hidden;
  place-items: center;
  padding: 20px;
  background: rgba(17, 25, 40, .48);
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity .2s ease, visibility .2s ease;
}

.loading-overlay.visible {
  visibility: visible;
  opacity: 1;
}

.loader-card {
  width: min(420px, 100%);
  padding: 32px;
  text-align: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 25px 80px rgba(11, 18, 32, .25);
}

.loader-symbol {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 17px;
  place-items: center;
  color: var(--blue);
  font-size: 23px;
  background: var(--blue-soft);
  border-radius: 13px;
  animation: loader-pulse 1s ease infinite alternate;
}

@keyframes loader-pulse {
  to { transform: scale(1.08); background: #dce8ff; }
}

.loader-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.loader-card p,
.loader-card small {
  color: var(--muted);
  font-size: 11px;
}

.progress {
  height: 6px;
  margin: 22px 0 14px;
  overflow: hidden;
  background: #e9edf4;
  border-radius: 3px;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.loading-overlay.visible .progress span {
  animation: progress 1.55s ease forwards;
}

@keyframes progress {
  0% { width: 3%; }
  45% { width: 61%; }
  75% { width: 84%; }
  100% { width: 100%; }
}

.review-summary {
  display: flex;
  max-width: 1220px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto 16px;
}

.review-summary h2,
.offer-complete h2,
.mail-ready-head h2 {
  font-size: 23px;
}

.review-summary p:last-child,
.offer-complete > p,
.mail-ready-head p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.summary-chips {
  display: flex;
  gap: 8px;
}

.summary-chips span {
  padding: 8px 10px;
  color: var(--green);
  font-size: 11px;
  background: var(--green-soft);
  border-radius: 6px;
}

.summary-chips span.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.summary-chips b {
  font-size: 13px;
}

.specification-panel {
  max-width: 1220px;
  margin: 0 auto;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}

.source-file {
  display: flex;
  align-items: center;
  gap: 9px;
}

.legend {
  display: flex;
  gap: 15px;
  color: var(--muted);
  font-size: 10px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}

.status-dot.attention {
  background: var(--amber);
}

.spec-table-wrap {
  overflow-x: auto;
}

.spec-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  table-layout: fixed;
}

.spec-table th {
  padding: 10px 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-align: left;
  text-transform: uppercase;
  background: #f5f7fa;
  border-bottom: 1px solid var(--line);
}

.spec-table th:nth-child(1) { width: 4%; }
.spec-table th:nth-child(2) { width: 21%; }
.spec-table th:nth-child(3) { width: 24%; }
.spec-table th:nth-child(4) { width: 10%; }
.spec-table th:nth-child(5) { width: 11%; }
.spec-table th:nth-child(6) { width: 12%; }
.spec-table th:nth-child(7) { width: 18%; }

.spec-table td {
  padding: 13px 9px;
  color: #4b566a;
  font-size: 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.spec-table td > strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
}

.spec-table td > small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.catalog-code {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 8px;
  font-weight: 750;
}

.spec-table tr.needs-attention {
  background: #fffbf1;
}

.select-label {
  display: block;
  margin-bottom: 5px;
  color: var(--amber);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.spec-table select {
  width: 100%;
  padding: 7px 26px 7px 8px;
  color: var(--ink);
  font-size: 10px;
  background: #fff;
  border: 1px solid #e5ba74;
  border-radius: 5px;
  outline: none;
}

.spec-table select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 94, 255, .11);
}

.match-status {
  display: inline-flex;
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 5px;
}

.match-status.matched {
  color: var(--green);
  background: var(--green-soft);
}

.match-status.attention {
  color: var(--amber);
  background: var(--amber-soft);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 17px;
  background: #fafbfc;
}

.table-footer > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.totals {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 9px;
}

.totals strong {
  color: var(--ink);
}

.grand-total {
  padding-left: 17px;
  border-left: 1px solid var(--line-strong);
}

.grand-total strong {
  margin-left: 4px;
  font-size: 14px;
}

.review-actions {
  display: flex;
  max-width: 1220px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 14px auto 0;
}

.validation-message {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  color: var(--amber);
  font-size: 10px;
  font-weight: 650;
}

.validation-message svg {
  width: 16px;
}

.validation-message.resolved {
  color: var(--green);
}

.offer-layout {
  display: grid;
  grid-template-columns: minmax(320px, .75fr) minmax(520px, 1.25fr);
  max-width: 1120px;
  align-items: center;
  gap: 50px;
  margin: 0 auto;
}

.success-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
}

.success-icon svg {
  width: 23px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 25px 0 27px;
}

.check-list span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #465166;
  font-size: 11px;
}

.check-list i {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  background: var(--green-soft);
  border-radius: 50%;
}

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

.document-preview {
  overflow: hidden;
  background: #dfe4eb;
  border: 1px solid #ccd4df;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  color: #526076;
  font-size: 10px;
  background: #f4f6f8;
  border-bottom: 1px solid #d3d9e2;
}

.document-toolbar button {
  gap: 6px;
  padding: 5px 8px;
  color: #526076;
  font-size: 9px;
  border-radius: 5px;
}

.document-toolbar svg {
  width: 13px;
}

.paper {
  width: 76%;
  min-height: 650px;
  margin: 24px auto;
  padding: 32px 34px;
  color: #273044;
  background: #fff;
  box-shadow: 0 3px 18px rgba(22, 32, 51, .16);
}

.paper-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--blue);
}

.paper-brand .brand-mark {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 15px;
}

.paper-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.paper-brand strong {
  font-size: 10px;
  letter-spacing: .08em;
}

.paper-brand small {
  color: #68748a;
  font-size: 6px;
}

.paper-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 15px;
  padding: 18px 0;
}

.paper-heading span {
  color: #68748a;
  font-size: 6px;
}

.paper-heading span:nth-child(2) {
  text-align: right;
}

.paper-heading h3,
.paper-heading p {
  grid-column: 1 / -1;
  margin: 0;
}

.paper-heading h3 {
  margin-top: 16px;
  font-size: 17px;
}

.paper-heading p {
  color: #68748a;
  font-size: 7px;
}

.paper-table {
  width: 100%;
  border-collapse: collapse;
}

.paper-table th {
  padding: 6px;
  color: #fff;
  font-size: 6px;
  text-align: left;
  background: #25334a;
}

.paper-table td {
  padding: 7px 6px;
  font-size: 6px;
  border-bottom: 1px solid #dfe4eb;
}

.paper-table th:not(:first-child),
.paper-table td:not(:first-child) {
  text-align: right;
}

.paper-total {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 13px;
  padding: 11px 0 18px;
  font-size: 7px;
}

.paper-total strong {
  font-size: 11px;
}

.paper-terms {
  padding: 10px 12px;
  color: #606b7e;
  font-size: 6px;
  line-height: 1.45;
  background: #f5f7fa;
}

.paper-terms p {
  margin: 0 0 4px;
}

.paper-sign {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  color: #606b7e;
  font-size: 6px;
}

.mail-ready-card {
  max-width: 980px;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.mail-ready-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 25px 28px;
  background: #f8faff;
  border-bottom: 1px solid #dce5f7;
}

.draft-badge {
  padding: 6px 9px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 750;
  background: var(--amber-soft);
  border-radius: 5px;
}

.compose {
  padding: 0 28px;
}

.compose-field {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  padding: 13px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.compose-field label {
  color: var(--muted);
}

.compose-body {
  padding: 22px 0 12px;
  color: #465166;
  font-size: 12px;
  line-height: 1.6;
}

.compose-body p {
  margin: 0 0 13px;
}

.compose-attachment {
  max-width: 390px;
  margin: 3px 0 22px;
}

.final-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  background: #fafbfc;
  border-top: 1px solid var(--line);
}

.manual-send {
  display: flex;
  align-items: center;
  gap: 13px;
}

.manual-send > span {
  max-width: 230px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  text-align: right;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  visibility: hidden;
  max-width: 380px;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: .22s ease;
}

.toast.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--green);
  font-size: 12px;
  background: var(--green-soft);
  border-radius: 50%;
}

.toast p {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 2px;
}

.toast strong {
  font-size: 11px;
}

.toast small {
  color: var(--muted);
  font-size: 9px;
}

.demo-controls {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 248px;
  z-index: 50;
  min-height: 82px;
  padding: 12px 30px 14px;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(22, 32, 51, .06);
  backdrop-filter: blur(12px);
}

.demo-progress {
  height: 3px;
  overflow: hidden;
  background: #e5e9ef;
  border-radius: 10px;
}

.demo-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #72a1ff);
  border-radius: inherit;
}

.demo-progress span.playing {
  animation: demo-progress 34s linear forwards;
}

.demo-control-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
}

.demo-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: #4e5a6e;
  font-size: 11px;
  font-weight: 750;
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.demo-button svg {
  width: 14px;
}

.demo-button.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.demo-button.primary.playing {
  background: var(--green);
  border-color: var(--green);
}

.demo-timer {
  margin-left: 5px;
  color: #8a94a6;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.demo-timer b {
  color: var(--ink);
}

.demo-note {
  margin-left: auto;
  color: #929bad;
  font-size: 10px;
}

.tour-caption {
  position: fixed;
  right: 28px;
  bottom: 98px;
  z-index: 49;
  display: flex;
  visibility: hidden;
  width: min(390px, calc(100vw - 30px));
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid #cfd9eb;
  border-left: 3px solid var(--blue);
  border-radius: 9px;
  box-shadow: 0 12px 40px rgba(22, 32, 51, .14);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.tour-caption.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.tour-caption > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  background: var(--blue-soft);
  border-radius: 6px;
}

.tour-caption p {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 3px;
}

.tour-caption strong {
  font-size: 11px;
}

.tour-caption small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.tour-focus {
  position: relative;
  z-index: 3;
  outline: 3px solid rgba(30, 94, 255, .24);
  outline-offset: 3px;
  animation: tour-focus 1.25s ease-in-out infinite alternate;
}

.spec-table tbody tr.tour-concealed {
  opacity: .18;
  filter: grayscale(.45);
}

.spec-table tbody tr.tour-revealed {
  animation: row-reveal .45s ease both;
}

@keyframes demo-progress {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes tour-focus {
  to {
    outline-color: rgba(30, 94, 255, .5);
    box-shadow: 0 0 0 7px rgba(30, 94, 255, .06);
  }
}

@keyframes row-reveal {
  from { opacity: .18; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1100px) {
  .sidebar {
    width: 218px;
  }

  .main {
    margin-left: 218px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .demo-controls {
    left: 218px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .topbar {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .inbox-grid {
    grid-template-columns: 235px minmax(500px, 1fr);
  }

  .safe-mode {
    display: none;
  }

  .offer-layout {
    gap: 25px;
  }

  .paper {
    width: 84%;
  }

  .totals {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
  }
}

@media (max-width: 860px) {
  .sidebar {
    visibility: hidden;
    width: 248px;
    opacity: 0;
    transform: translateX(-100%);
    transition: .22s ease;
  }

  body.menu-open .sidebar {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  body.menu-open::after {
    position: fixed;
    inset: 0;
    z-index: 15;
    content: "";
    background: rgba(15, 23, 37, .42);
  }

  .main {
    margin-left: 0;
  }

  .demo-controls {
    left: 0;
  }

  .mobile-menu {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-content: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .mobile-menu span {
    width: 17px;
    height: 1.5px;
    background: var(--ink);
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .workflow {
    grid-template-columns: repeat(4, 1fr);
    max-width: 540px;
  }

  .workflow > i {
    display: none;
  }

  .workflow-step {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .workflow-step small {
    display: none;
  }

  .inbox-grid,
  .offer-layout {
    grid-template-columns: 1fr;
  }

  .inbox-list {
    display: none;
  }

  .review-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .totals {
    align-self: stretch;
    justify-content: flex-start;
  }

  .offer-complete {
    max-width: 600px;
  }

  .document-preview {
    max-width: 700px;
  }
}

@media (max-width: 600px) {
  .main {
    padding: 0 12px 155px;
  }

  .topbar {
    min-height: 72px;
    margin: 0 -12px 16px;
    padding: 12px;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .topbar .eyebrow,
  .icon-button {
    display: none;
  }

  .workflow {
    margin-bottom: 16px;
  }

  .workflow-step > span {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }

  .workflow-step strong {
    font-size: 9px;
  }

  .email-head {
    align-items: flex-start;
    padding: 14px;
  }

  .email-meta {
    display: none;
  }

  .email-body {
    min-height: auto;
    padding: 20px 16px;
  }

  .email-body h2 {
    font-size: 18px;
  }

  .attachment {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .scan-status {
    width: 100%;
    margin-left: 47px;
  }

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

  .action-bar .button {
    width: 100%;
  }

  .automation-note small {
    display: none;
  }

  .review-summary h2,
  .offer-complete h2,
  .mail-ready-head h2 {
    font-size: 19px;
  }

  .summary-chips {
    flex-wrap: wrap;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    flex-wrap: wrap;
  }

  .table-footer > p {
    max-width: none;
  }

  .totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .grand-total {
    grid-column: 1 / -1;
    padding: 9px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .validation-message {
    margin: 0 0 4px;
  }

  .review-actions .button {
    width: 100%;
  }

  .offer-layout {
    gap: 25px;
  }

  .offer-actions {
    flex-direction: column-reverse;
  }

  .offer-actions .button {
    width: 100%;
  }

  .paper {
    width: 90%;
    min-height: 520px;
    margin: 14px auto;
    padding: 22px 19px;
  }

  .mail-ready-head {
    padding: 20px 17px;
  }

  .compose {
    padding: 0 17px;
  }

  .compose-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .final-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: 14px 17px;
  }

  .manual-send {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-send > span {
    max-width: none;
    text-align: left;
  }

  .final-actions .button {
    width: 100%;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .demo-controls {
    min-height: 115px;
    padding: 10px 12px 12px;
  }

  .demo-control-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .demo-button {
    justify-content: center;
  }

  .demo-button.primary {
    grid-column: 1 / -1;
  }

  .demo-note {
    display: none;
  }

  .tour-caption {
    right: 12px;
    bottom: 128px;
    left: 12px;
    width: auto;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .document-preview,
  .document-preview * {
    visibility: visible;
  }

  .document-preview {
    position: absolute;
    inset: 0;
    background: #fff;
    border: 0;
  }

  .document-toolbar {
    display: none;
  }

  .paper {
    width: 100%;
    min-height: 0;
    margin: 0;
    box-shadow: none;
  }

  .demo-controls,
  .tour-caption {
    display: none;
  }
}

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