.quote-body {
  min-height: 100dvh;
  background: #edf1f7;
  --quote-sticky-top: calc(var(--topbar-h, 64px) + 14px);
}

.quote-shell {
  width: min(1500px, calc(100% - 28px));
  margin: 14px auto 34px;
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.quote-intake {
  position: sticky;
  top: var(--quote-sticky-top);
  max-height: calc(100dvh - var(--quote-sticky-top) - 14px);
  overflow: auto;
  border: 1px solid #d8dfec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 34, 64, .10);
}

.quote-result {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.quote-mobile-result-bar {
  display: none;
}

.quote-head {
  padding: 12px 16px 11px;
  color: #fff;
  background: linear-gradient(135deg, #081126, #111b33);
}

.quote-head span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}

.quote-head h1 {
  margin-top: 6px;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.12;
  letter-spacing: 0;
}

.quote-head p {
  max-width: 620px;
  margin-top: 6px;
  color: var(--txt-2);
  font-size: 11px;
  line-height: 1.4;
}

.quote-form {
  padding: 12px 14px 10px;
  display: grid;
  gap: 6px;
}

.quote-row {
  display: grid;
  gap: 9px;
}

.quote-row.two {
  grid-template-columns: 1fr 1fr;
}

.quote-row.three {
  grid-template-columns: minmax(0, 1fr) minmax(76px, .62fr) minmax(0, .88fr);
}

.quote-form label > span,
.quote-form legend {
  display: block;
  margin-bottom: 5px;
  color: var(--ltxt-2);
  font-size: 11px;
  font-weight: 900;
}

.quote-form input,
.quote-form select,
.quote-form textarea {
  width: 100%;
  border: 1px solid var(--lline);
  border-radius: 12px;
  background: #fff;
  color: var(--ltxt);
  outline: 0;
}

.quote-form input,
.quote-form select {
  height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.quote-form textarea {
  min-height: 48px;
  resize: vertical;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.5;
}

.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
  border-color: var(--laccent);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, .12);
}

.quote-form fieldset {
  border: 1px solid var(--lline);
  border-radius: 12px;
  padding: 8px;
}

.quote-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quote-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ltxt);
  font-size: 12px;
  line-height: 1.4;
}

.quote-check input {
  width: auto;
  height: auto;
  accent-color: var(--laccent);
}

.quote-samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.quote-samples button {
  min-height: 40px;
  border: 1px solid #d7e2ff;
  border-radius: 10px;
  padding: 6px 8px;
  background: #f5f8ff;
  color: #315185;
  text-align: left;
}

.quote-samples button strong {
  display: block;
  color: #1f3767;
  font-size: 11.5px;
  line-height: 1.2;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-samples button span {
  display: block;
  margin-top: 2px;
  color: #61739b;
  font-size: 10px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-submit {
  min-height: 40px;
  border-radius: 12px;
  background: var(--laccent);
  color: #fff;
  font-size: 14px;
  font-weight: 950;
}

.quote-submit:disabled {
  opacity: .58;
  cursor: wait;
}

.quote-status {
  display: none;
  min-height: 0;
  color: var(--ltxt-2);
  font-size: 11px;
  line-height: 1.25;
}

.quote-status:not(:empty) {
  display: block;
}

.quote-session {
  border-top: 1px solid var(--lline);
  padding-top: 8px;
}

.quote-session[hidden] {
  display: none;
}

.quote-session-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.quote-session-head strong {
  color: var(--ltxt);
  font-size: 12px;
  font-weight: 950;
}

.quote-session-head span {
  color: var(--ltxt-3);
  font-size: 10px;
  font-weight: 800;
}

.quote-history {
  display: grid;
  gap: 6px;
}

.quote-history button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dbe4f5;
  border-radius: 10px;
  padding: 7px 9px;
  background: #fbfcff;
  color: var(--ltxt);
  text-align: left;
}

.quote-history button strong,
.quote-history button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-history button strong {
  font-size: 11px;
  line-height: 1.25;
  font-weight: 900;
}

.quote-history button span {
  margin-top: 3px;
  color: var(--ltxt-3);
  font-size: 10px;
  line-height: 1.2;
}

.quote-empty {
  min-height: calc(100dvh - 116px);
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid #d8dfec;
  border-radius: 18px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 34, 64, .08);
  text-align: center;
  color: var(--ltxt-2);
}

.quote-empty span {
  color: var(--laccent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .1em;
}

.quote-empty h2 {
  margin-top: 8px;
  color: var(--ltxt);
  font-size: clamp(18px, 1.8vw, 24px);
  letter-spacing: 0;
}

.quote-empty p {
  max-width: 460px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.quote-loading {
  color: var(--ltxt);
}

.quote-loading span {
  color: #526fd8;
}

.quote-loading h2::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--laccent);
  animation: quotePulse 1s ease-in-out infinite;
}

.quote-error span {
  color: #d34d4d;
}

@keyframes quotePulse {
  0%, 100% {
    opacity: .35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.quote-paper {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8dfec;
  border-radius: 18px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 34, 64, .08);
}

.quote-paper.is-streaming::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #3267ff, #29d3ff, #3267ff);
  transform-origin: left;
  animation: quoteStreamBar 2.6s ease-out forwards;
}

.quote-reveal {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  transition: opacity .62s ease, transform .62s ease, filter .62s ease;
}

.quote-paper.is-streaming .quote-reveal:not(.is-entering):not(.is-visible) {
  display: none;
}

.quote-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.quote-reveal.is-visible .quote-item,
.quote-reveal.is-visible .quote-check-item,
.quote-reveal.is-visible .quote-note-item,
.quote-reveal.is-visible .quote-alt {
  animation: quoteItemRise .48s ease both;
}

.quote-reveal.is-visible .quote-item:nth-child(2),
.quote-reveal.is-visible .quote-check-item:nth-child(2),
.quote-reveal.is-visible .quote-note-item:nth-child(2),
.quote-reveal.is-visible .quote-alt:nth-child(2) {
  animation-delay: .05s;
}

.quote-reveal.is-visible .quote-item:nth-child(3),
.quote-reveal.is-visible .quote-check-item:nth-child(3),
.quote-reveal.is-visible .quote-note-item:nth-child(3),
.quote-reveal.is-visible .quote-alt:nth-child(3) {
  animation-delay: .12s;
}

.quote-reveal.is-visible .quote-item:nth-child(4),
.quote-reveal.is-visible .quote-check-item:nth-child(4),
.quote-reveal.is-visible .quote-note-item:nth-child(4),
.quote-reveal.is-visible .quote-alt:nth-child(4) {
  animation-delay: .18s;
}

@keyframes quoteStreamBar {
  0% {
    transform: scaleX(.08);
    opacity: .55;
  }
  70% {
    transform: scaleX(.86);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes quoteItemRise {
  from {
    opacity: .2;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quote-stale {
  margin-bottom: 12px;
  border: 1px solid #f0cf88;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fffaf0;
  color: #7a4b00;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.quote-paper-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--lline);
}

.quote-paper-head span {
  color: var(--laccent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
}

.quote-paper-head h2 {
  margin-top: 6px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.22;
  letter-spacing: 0;
}

.quote-paper-head p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--ltxt-2);
  font-size: 12px;
  line-height: 1.5;
}

.quote-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quote-actions button,
.quote-actions a {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  background: #eef3ff;
  color: var(--laccent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.quote-actions .primary {
  background: var(--laccent);
  color: #fff;
}

.quote-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.quote-metric {
  border: 1px solid var(--lline);
  border-radius: 12px;
  padding: 10px;
  background: #fbfcff;
}

.quote-metric span {
  display: block;
  color: var(--ltxt-3);
  font-size: 11px;
  font-weight: 900;
}

.quote-metric b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.quote-section {
  margin-top: 20px;
}

.quote-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
  letter-spacing: 0;
}

.quote-note {
  border: 1px solid #dce5ff;
  border-radius: 12px;
  padding: 13px;
  background: #f3f7ff;
  color: #253149;
  line-height: 1.58;
  font-size: 13px;
}

.md-note {
  display: grid;
  gap: 10px;
}

.md-note h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  color: #18223a;
  font-size: 13px;
  letter-spacing: 0;
}

.md-note h4 span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--laccent);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  flex: 0 0 auto;
}

.md-note p {
  margin: 0;
}

.md-note ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.md-note li {
  position: relative;
  padding-left: 16px;
  line-height: 1.52;
}

.md-note li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--laccent);
}

.md-note strong {
  color: #111a2e;
  font-weight: 900;
}

.md-note code {
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(47, 107, 255, .10);
  color: var(--laccent);
  font-family: inherit;
  font-size: .95em;
}


.quote-allocation {
  display: grid;
  gap: 10px;
}

.quote-item {
  border: 1px solid var(--lline);
  border-radius: 13px;
  padding: 13px;
  background: #fff;
}

.quote-item-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.quote-role {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef3ff;
  color: var(--laccent);
  font-size: 10px;
  font-weight: 950;
}

.quote-score {
  flex: 0 0 auto;
  color: var(--laccent);
  font-weight: 950;
}

.quote-item h4 {
  margin-top: 8px;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.3;
}

.quote-item p {
  margin-top: 6px;
  color: var(--ltxt-2);
  font-size: 12px;
  line-height: 1.5;
}

.quote-price {
  margin-top: 9px;
  border-top: 1px solid var(--lline);
  border-bottom: 1px solid var(--lline);
  padding: 8px 0;
  display: grid;
  gap: 3px;
}

.quote-price b {
  font-size: 15px;
}

.quote-price span {
  color: var(--ltxt-3);
  font-size: 12px;
}

.quote-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.quote-tags span {
  border-radius: 999px;
  padding: 4px 7px;
  background: #eef3ff;
  color: var(--laccent);
  font-size: 10px;
  font-weight: 850;
}

.quote-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.quote-card-actions button,
.quote-card-actions a {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e2f7;
  background: #f5f8ff;
  color: var(--laccent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.quote-card-actions button:hover,
.quote-card-actions a:hover {
  border-color: var(--laccent);
  background: #eef3ff;
}

.quote-card-actions a {
  background: var(--laccent);
  border-color: var(--laccent);
  color: #fff;
}

.quote-checks,
.quote-notes {
  display: grid;
  gap: 10px;
}

.quote-check-item,
.quote-note-item {
  border: 1px solid var(--lline);
  border-radius: 12px;
  padding: 12px;
  background: #fbfcff;
}

.quote-check-item.required {
  border-color: #f0cf88;
  background: #fffaf0;
}

.quote-check-item strong,
.quote-note-item strong {
  display: block;
  margin-bottom: 5px;
}

.quote-check-item p,
.quote-note-item p {
  color: var(--ltxt-2);
  font-size: 13px;
  line-height: 1.6;
}

.quote-alt-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-alt {
  border: 1px solid var(--lline);
  border-radius: 13px;
  padding: 13px;
  background: #fbfcff;
}

.quote-alt strong {
  display: block;
  line-height: 1.35;
}

.quote-alt span {
  display: block;
  margin-top: 5px;
  color: var(--ltxt-3);
  font-size: 12px;
}

.quote-alt .quote-card-actions {
  margin-top: 9px;
}

.quote-warning {
  color: #6d4600;
  font-size: 13px;
  line-height: 1.7;
  padding-left: 18px;
}

.quote-modal-loading {
  padding: 58px;
  color: var(--ltxt-3);
  text-align: center;
  font-size: 14px;
}

.quote-modal-note {
  color: var(--ltxt-3);
  font-size: 12px;
  font-weight: 700;
}

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

  .quote-intake {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .quote-shell {
    width: min(100% - 16px, 1440px);
    margin-top: 10px;
    margin-bottom: 18px;
    gap: 10px;
  }

  .quote-body > footer {
    display: none;
  }

  .quote-intake {
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(20, 34, 64, .08);
  }

  .quote-head {
    padding: 10px 12px 9px;
  }

  .quote-head span {
    font-size: 9px;
  }

  .quote-head h1 {
    margin-top: 4px;
    font-size: 20px;
  }

  .quote-head p {
    margin-top: 4px;
    font-size: 10.5px;
    line-height: 1.35;
  }

  .quote-form {
    padding: 10px 10px 9px;
    gap: 5px;
  }

  .quote-form label > span,
  .quote-form legend {
    margin-bottom: 4px;
    font-size: 10.5px;
  }

  .quote-form fieldset {
    padding: 7px;
  }

  .quote-form input,
  .quote-form select {
    height: 34px;
    border-radius: 10px;
    padding: 0 9px;
    font-size: 12px;
  }

  .quote-form textarea {
    height: 82px;
    min-height: 82px;
    border-radius: 10px;
    padding: 8px 9px;
    font-size: 12px;
    line-height: 1.38;
  }

  .quote-body:not(.quote-mobile-result-open) .quote-result {
    display: none;
  }

  .quote-body.quote-mobile-result-open .quote-intake {
    display: none;
  }

  .quote-row,
  .quote-priority-grid,
  .quote-samples {
    gap: 6px;
  }

  .quote-mobile-result-bar {
    position: sticky;
    top: calc(var(--topbar-h, 64px) + 8px);
    z-index: 8;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #d8dfec;
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 30px rgba(20, 34, 64, .10);
    backdrop-filter: blur(14px);
  }

  .quote-mobile-result-bar button {
    min-height: 36px;
    border-radius: 10px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf3ff;
    color: var(--laccent);
    font-size: 13px;
    font-weight: 900;
  }

  .quote-mobile-result-bar span {
    min-width: 0;
    overflow: hidden;
    color: var(--ltxt-2);
    font-size: 12px;
    font-weight: 900;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quote-priority-grid,
  .quote-metrics,
  .quote-alt-list {
    grid-template-columns: 1fr;
  }

  .quote-row.three {
    grid-template-columns: minmax(0, 1fr) 64px 86px;
  }

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

  .quote-samples button {
    min-height: 34px;
    padding: 5px 7px;
  }

  .quote-samples button strong {
    font-size: 10.5px;
  }

  .quote-samples button span {
    font-size: 9px;
  }

  .quote-check {
    font-size: 11.5px;
  }

  .quote-submit {
    min-height: 38px;
    border-radius: 10px;
    font-size: 13px;
  }

  .quote-session {
    padding-top: 6px;
  }

  .quote-paper {
    padding: 20px;
  }

  .quote-paper-head {
    display: grid;
  }

  .quote-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quote-paper.is-streaming::before,
  .quote-reveal.is-visible .quote-item,
  .quote-reveal.is-visible .quote-check-item,
  .quote-reveal.is-visible .quote-note-item,
  .quote-reveal.is-visible .quote-alt {
    animation: none;
  }

  .quote-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
