/* ==========================================================================
   AI Insurance Quote: the product theme for Case Study 04.
   One portfolio design system, multiple product expressions: the portfolio page keeps the site's
   tokens, and everything inside a recreated product frame (.qt) uses this identity: conversational,
   modern, customer-friendly and transparent. Light surfaces, a conversation panel beside a visible
   application panel (the structured record is never hidden in chat bubbles), source tags on every
   answer, quote cards, and a quiet "assistant is helping" indicator. Sky accent only, no glow.
   Frames stay light in both site themes, like a real screenshot, and adapt to their own width
   (container queries). Synthetic data only. Shared by ai-quote*.html and social-src/quote-thumbnail.html.
   ========================================================================== */

.qt {
  --qt-bg: #f5f7fb;
  --qt-surface: #ffffff;
  --qt-soft: #f0f4f9;
  --qt-ink: #111827;          /* 17:1 on white */
  --qt-ink-2: #4b5563;        /* 7.6:1 on white */
  --qt-ink-3: #5b6474;        /* 6.1:1 on white: hints and meta */
  --qt-line: #e3e8ef;
  --qt-line-2: #cdd5e0;
  --qt-accent: #0369a1;       /* Sky 700: 5.9:1 on white */
  --qt-accent-soft: #e0f2fe;
  --qt-accent-ink: #075985;
  --qt-user: #0c4a6e;         /* Sky 900: the customer's own messages */
  --qt-ok: #067647;
  --qt-ok-soft: #e7f6ed;
  --qt-warn: #8a3a06;
  --qt-warn-soft: #fff4dd;
  --qt-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  container-type: inline-size;
  font-family: var(--qt-font);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--qt-ink);
  background: var(--qt-bg);
  -webkit-font-smoothing: antialiased;
}
.qt *,
.qt *::before,
.qt *::after {
  box-sizing: border-box;
}
.qt p,
.qt ul,
.qt ol {
  margin: 0;
}

.qt-app {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #cfd8e3;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px -24px rgba(16, 24, 40, 0.35);
}

/* Top bar: brand, the assistant indicator, and the ways out that are always there */
.qt-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 16px;
  background: var(--qt-surface);
  border-bottom: 1px solid var(--qt-line);
}
.qt-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 12.5px;
}
.qt-brand svg {
  width: 18px;
  height: 18px;
  color: var(--qt-accent);
}
.qt-helping { /* the assistant is helping: a word and a small mark, no glow */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--qt-accent-soft);
  color: var(--qt-accent-ink);
  font-size: 10.5px;
  font-weight: 600;
}
.qt-helping i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.qt-ways {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--qt-accent);
}

/* Body: conversation beside the application */
.qt-body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  min-height: 100%;
}
.qt-body--wide-app {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}
.qt-body--one {
  grid-template-columns: minmax(0, 1fr);
}
.qt-chat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px;
  min-width: 0;
}
.qt-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px 16px;
  background: var(--qt-surface);
  border-left: 1px solid var(--qt-line);
  min-width: 0;
}
.qt-pad {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px 16px 16px;
  min-width: 0;
}

/* Messages */
.qt-msg {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px;
  line-height: 1.45;
}
.qt-msg--ai {
  align-self: flex-start;
  background: var(--qt-surface);
  border: 1px solid var(--qt-line);
  border-top-left-radius: 4px;
}
.qt-msg--user {
  align-self: flex-end;
  background: var(--qt-user);
  color: #fff;
  border-top-right-radius: 4px;
}
.qt-who {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--qt-ink-3);
}
.qt-who svg {
  width: 11px;
  height: 11px;
  color: var(--qt-accent);
}
.qt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qt-chips span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--qt-line-2);
  background: var(--qt-surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--qt-ink);
}
.qt-chips .is-on {
  border-color: var(--qt-accent);
  background: var(--qt-accent-soft);
  color: var(--qt-accent-ink);
}
.qt-why {
  display: flex;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--qt-soft);
  color: var(--qt-ink-2);
  font-size: 11px;
}
.qt-why b {
  color: var(--qt-ink);
  font-weight: 600;
  white-space: nowrap;
}
.qt-compose {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--qt-line-2);
  border-radius: 10px;
  background: var(--qt-surface);
  color: var(--qt-ink-3);
  font-size: 11.5px;
}
.qt-compose b {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--qt-accent);
  color: #fff;
  font-size: 11px;
}
.qt-steps { /* the questions that change the price, in order */
  list-style: none;
  padding: 0;
  display: grid;
  gap: 4px;
  counter-reset: qt-step;
}
.qt-steps li {
  counter-increment: qt-step;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--qt-ink-2);
}
.qt-steps li::before {
  content: counter(qt-step);
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--qt-line-2);
  font-size: 9.5px;
  font-weight: 700;
}
.qt-steps li.is-on {
  color: var(--qt-ink);
  font-weight: 600;
}
.qt-steps li.is-on::before {
  background: var(--qt-accent);
  border-color: var(--qt-accent);
  color: #fff;
}
.qt-steps li.is-done::before {
  content: "";
  background: var(--qt-ok-soft) linear-gradient(var(--qt-ok), var(--qt-ok)) center / 6px 6px no-repeat;
  border-color: var(--qt-ok);
}

/* The application: structured, visible, editable, every answer with its source */
.qt-h {
  font-size: 13.5px;
  font-weight: 700;
}
.qt-h small {
  font-weight: 500;
  color: var(--qt-ink-3);
}
.qt-h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--qt-ink-3);
}
.qt-sub {
  color: var(--qt-ink-2);
}
.qt-meta {
  font-size: 10.5px;
  color: var(--qt-ink-3);
}
.qt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}
.qt-progress {
  display: grid;
  gap: 4px;
}
.qt-progress span {
  height: 6px;
  border-radius: 999px;
  background: var(--qt-line);
  overflow: hidden;
}
.qt-progress span i {
  display: block;
  height: 100%;
  width: var(--v, 50%);
  background: var(--qt-accent);
  border-radius: inherit;
}
.qt-fields { /* one shared column grid, so labels, values and sources line up on every row */
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr) auto;
  border: 1px solid var(--qt-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--qt-surface);
}
.qt-group {
  grid-column: 1 / -1;
  padding: 6px 10px;
  background: var(--qt-soft);
  border-top: 1px solid var(--qt-line);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--qt-ink-3);
}
.qt-group:first-child {
  border-top: 0;
}
.qt-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  gap: 4px 8px;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid var(--qt-line);
}
.qt-group + .qt-field {
  border-top: 0;
}
.qt-field > span:first-child {
  color: var(--qt-ink-3);
  font-size: 11px;
}
.qt-field > b {
  font-weight: 600;
  min-width: 0;
}
.qt-field.is-check {
  background: var(--qt-warn-soft);
}
.qt-field.is-wait > b,
.qt-field.is-later > b {
  font-weight: 500;
  color: var(--qt-ink-3);
}
/* Source tags: a word for where every answer came from (never color alone) */
.qt-src {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--qt-line-2);
  color: var(--qt-ink-2);
  background: var(--qt-surface);
}
.qt-src--said {
  border-color: #b9e1f8;
  background: var(--qt-accent-soft);
  color: var(--qt-accent-ink);
}
.qt-src--record {
  border-style: dashed;
  border-color: #9fb3c8;
  color: var(--qt-ink-2);
}
.qt-src--verified {
  border-color: #b7e2c7;
  background: var(--qt-ok-soft);
  color: var(--qt-ok);
}
.qt-src--assumed {
  border-color: #f4d9a3;
  background: var(--qt-warn-soft);
  color: var(--qt-warn);
}
.qt-src--later {
  color: var(--qt-ink-3);
  background: var(--qt-soft);
}
.qt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.qt-link {
  color: var(--qt-accent);
  font-weight: 600;
  font-size: 11px;
}
.qt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.qt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--qt-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.qt-btn--ghost {
  background: var(--qt-surface);
  color: var(--qt-ink);
  border: 1px solid var(--qt-line-2);
}
.qt-btn.is-off {
  background: #c3cad5;
  color: #3f4652;
}

/* Verification: a secure step outside the chat, with exactly what will be retrieved */
.qt-secure {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--qt-accent);
  background: var(--qt-surface);
}
.qt-secure__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qt-secure__head svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--qt-accent);
}
.qt-checks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}
.qt-checks li {
  position: relative;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 1px 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--qt-soft);
}
.qt-checks li::before {
  content: "";
  grid-row: span 2;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  border-radius: 3px;
  background: var(--qt-accent);
}
.qt-checks li:not(.is-off)::after { /* the check mark */
  content: "";
  position: absolute;
  left: 13px;
  top: 11px;
  width: 6px;
  height: 3px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg);
}
.qt-checks li.is-off::before {
  background: var(--qt-surface);
  border: 1.5px solid var(--qt-line-2);
}
.qt-checks small {
  font-size: 10.5px;
  color: var(--qt-ink-3);
}
.qt-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--qt-ink-2);
}
.qt-lock svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--qt-ok);
}

/* Quotes */
.qt-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--qt-surface);
  border: 1px solid var(--qt-line);
  border-left: 3px solid var(--qt-accent);
}
.qt-quotes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.qt-quote {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 11px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--qt-line);
  background: var(--qt-surface);
}
.qt-quote.is-pick {
  border: 1.5px solid var(--qt-accent);
}
.qt-quote__c {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 700;
}
.qt-price {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.qt-price small {
  font-size: 11px;
  font-weight: 500;
  color: var(--qt-ink-3);
}
.qt-quote ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: var(--qt-ink-2);
}
.qt-quote li b {
  color: var(--qt-ink);
  font-weight: 600;
}
.qt-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  background: var(--qt-accent-soft);
  color: var(--qt-accent-ink);
}
.qt-tag--warn {
  background: var(--qt-warn-soft);
  color: var(--qt-warn);
}
.qt-note {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--qt-soft);
  color: var(--qt-ink-2);
  font-size: 11px;
}
.qt-note b {
  color: var(--qt-ink);
}

/* Ways out and the final confirmation */
.qt-out {
  display: grid;
  gap: 8px;
}
.qt-out > div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 1px 9px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid var(--qt-line);
  background: var(--qt-surface);
}
.qt-out svg {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  color: var(--qt-accent);
}
.qt-out b {
  font-weight: 600;
}
.qt-out small {
  font-size: 10.5px;
  color: var(--qt-ink-2);
}
.qt-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px dashed var(--qt-line-2);
  font-size: 11px;
  color: var(--qt-ink);
}
.qt-confirm i {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  border-radius: 3px;
  border: 1.5px solid var(--qt-ink-3);
}
.qt-dl {
  display: grid;
  gap: 5px;
}
.qt-dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--qt-line);
}
.qt-dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.qt-dl dt {
  color: var(--qt-ink-3);
}
.qt-dl dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

/* Medium frames (a case-study column): the two panes stack, the application first where it matters */
@container (max-width: 640px) {
  .qt-body,
  .qt-body--wide-app {
    grid-template-columns: minmax(0, 1fr);
  }
  .qt-panel {
    border-left: 0;
    border-top: 1px solid var(--qt-line);
  }
  .qt-quotes {
    grid-template-columns: minmax(0, 1fr);
  }
  .qt-compose {
    margin-top: 2px;
  }
}
/* Narrow frames (phones) */
@container (max-width: 420px) {
  .qt-ways {
    margin-left: 0;
    width: 100%;
  }
  .qt-chat,
  .qt-panel,
  .qt-pad {
    padding: 12px;
  }
  .qt-msg {
    max-width: 94%;
  }
  .qt-fields {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .qt-field > span:first-child {
    grid-column: 1 / -1;
  }
}
