:root {
  --spruce: #02463A;
  --leaf: #85BE00;
  --limestone: #F7F5F2;
  --shade: #EAE7E4;
  --quartz: #69625D;
  --slate: #3D3936;
  --danger: #B42318;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--slate);
  background: linear-gradient(180deg, #ffffff 0%, var(--limestone) 100%);
  font-family: "Proxima Nova", "Segoe UI", Arial, sans-serif;
}
.qa-shell { max-width: 1240px; margin: 0 auto; padding: 18px; }
.qa-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 28px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, #02463A, #386C66);
  box-shadow: 0 18px 46px rgba(61,57,54,.16);
}
.qa-kicker { margin-bottom: 8px; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.qa-hero h1 { margin: 0; color: #fff; font-size: 44px; line-height: 1.05; font-weight: 900; letter-spacing: -.03em; }
.qa-hero p { max-width: 860px; margin: 10px 0 0; color: rgba(255,255,255,.88); line-height: 1.45; }
.qa-health { flex: 0 0 auto; padding: 9px 15px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 12px; font-weight: 900; }
.qa-health-busy { background: #FFF7E6; color: #A15C00; }
.qa-health-error { background: #FFF2EF; color: var(--danger); }
.qa-health-done { background: #ECFDF3; color: #15803D; }
.qa-card {
  margin-top: 16px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(2,70,58,.12);
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 28px rgba(61,57,54,.10);
}
.qa-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.qa-card h2 { margin: 0; color: var(--spruce); font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.qa-card p { margin: 7px 0 0; color: var(--quartz); line-height: 1.42; }
.qa-email { width: 100%; min-height: 190px; padding: 14px; border: 1px solid rgba(105,98,93,.28); border-radius: 16px; font: inherit; resize: vertical; outline: none; }
.qa-email:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(133,190,0,.20); }
.qa-file-upload { margin-top: 14px; padding: 13px 15px; border: 1px dashed rgba(2,70,58,.28); border-radius: 16px; background: var(--limestone); }
.qa-file-upload label { display: block; color: var(--spruce); font-size: 13px; margin-bottom: 8px; }
.qa-file-input { width: 100%; }
.qa-file-note { margin-top: 8px; color: var(--quartz); font-size: 12px; line-height: 1.35; }
.qa-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.qa-btn, .qa-ghost {
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.qa-btn { background: var(--spruce); color: #fff; }
.qa-btn-secondary { background: var(--leaf); color: var(--spruce); }
.qa-btn:disabled { opacity: .55; cursor: not-allowed; }
.qa-ghost { background: #fff; color: var(--spruce); border: 1px solid rgba(2,70,58,.14); }
.qa-error, .qa-debug { margin-top: 13px; padding: 12px 14px; border-radius: 14px; font-weight: 800; }
.qa-error { color: var(--danger); background: #FFF2EF; border: 1px solid rgba(180,35,24,.22); }
.qa-debug { color: var(--spruce); background: #EEF8D6; border: 1px solid rgba(133,190,0,.30); font-size: 12px; }
.qa-score-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.qa-score { padding: 16px; border-radius: 18px; border: 1px solid rgba(105,98,93,.14); background: #fff; }
.qa-score strong { display: block; color: var(--spruce); font-size: 28px; line-height: 1; font-weight: 900; }
.qa-score span { display: block; margin-top: 8px; color: var(--quartz); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.qa-score-green { background: #ECFDF3; }
.qa-score-red { background: #FFF2EF; }
.qa-score-yellow { background: #FFF7E6; }
.qa-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.qa-bucket-title { margin: 0 0 10px; font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.qa-green-text { color: #15803D; }
.qa-red-text { color: var(--danger); }
.qa-yellow-text { color: #A15C00; }
.qa-list { display: grid; gap: 10px; }
.qa-field-card { padding: 13px 14px; border-radius: 16px; border: 1px solid rgba(105,98,93,.16); background: #fff; }
.qa-field-green { background: #ECFDF3; border-color: rgba(21,128,61,.22); }
.qa-field-red { background: #FFF2EF; border-color: rgba(180,35,24,.22); }
.qa-field-yellow { background: #FFF7E6; border-color: rgba(161,92,0,.24); }
.qa-field-card strong { display: block; color: var(--spruce); font-weight: 900; }
.qa-field-value { display: block; margin-top: 6px; color: var(--slate); }
.qa-field-card em { display: block; margin-top: 8px; color: var(--quartz); font-size: 12px; font-style: normal; }
.qa-field-card b { display: block; margin-top: 8px; color: var(--slate); font-size: 12px; }
.qa-empty { padding: 13px; border-radius: 14px; border: 1px dashed rgba(105,98,93,.20); color: var(--quartz); background: #fff; }
.qa-chat-log { min-height: 88px; max-height: 260px; overflow: auto; padding: 12px; border-radius: 16px; background: var(--limestone); border: 1px solid rgba(105,98,93,.14); }
.qa-chat-msg { margin-bottom: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; }
.qa-chat-msg strong { display: block; color: var(--spruce); margin-bottom: 4px; }
.qa-chat-user { margin-left: 30px; background: #ECFDF3; }
.qa-chat-assistant { margin-right: 30px; }
.qa-chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin-top: 12px; }
.qa-chat-input { min-height: 42px; padding: 10px 13px; border-radius: 999px; border: 1px solid rgba(105,98,93,.28); font: inherit; }
.qa-apply-card { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 -10px 26px rgba(61,57,54,.10); }
.qa-apply-head { align-items: center; }
.qa-thinking { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(2,70,58,.45); backdrop-filter: blur(2px); }
.qa-thinking-box { width: min(380px, calc(100vw - 32px)); padding: 24px; border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 20px 55px rgba(0,0,0,.22); }
.qa-spinner { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 999px; border: 6px solid rgba(2,70,58,.14); border-top-color: var(--leaf); animation: qaSpin .75s linear infinite; }
.qa-thinking-box strong { display: block; color: var(--spruce); font-size: 18px; font-weight: 900; }
.qa-thinking-box span { display: block; margin-top: 6px; color: var(--quartz); font-size: 13px; line-height: 1.35; }
.qa-done-toast { position: fixed; right: 18px; bottom: 18px; z-index: 10000; display: flex; align-items: center; gap: 10px; max-width: min(360px, calc(100vw - 32px)); padding: 13px 15px; border-radius: 18px; background: var(--spruce); color: #fff; box-shadow: 0 16px 38px rgba(61,57,54,.24); font-weight: 900; }
.qa-done-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--leaf); color: var(--spruce); font-weight: 900; }
@keyframes qaSpin { to { transform: rotate(360deg); } }
@media (max-width: 840px) {
  .qa-shell { padding: 10px; }
  .qa-hero, .qa-card-head, .qa-apply-head { flex-direction: column; align-items: stretch; }
  .qa-hero h1 { font-size: 34px; }
  .qa-score-grid, .qa-columns { grid-template-columns: 1fr; }
  .qa-chat-form { grid-template-columns: 1fr; }
}
