:root {
  --bg: #ffffff;
  --panel: #f6f6f6;
  --text: #383838;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #fff3eb;
  --color-orange-200: rgb(255, 94, 0);
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --green-50: #F0FDF4;
  --green-100: #DCFCE7;
  --amber-50: #FFFBEB;
  --amber-200: #FDE68A;
}

html,
body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  background: #FFF3EB;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 980px;
  width: 100%;
  padding: 24px;
  flex: 1 0 auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

h1 {
  color: #383838;
  font-size: 54px;
  margin: 0;
  letter-spacing: -1.08px;
  font-weight: 400;
  font-family: serif;
  line-height: 64px;
  padding: 16px 0;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  height: 72px;
  display: flex;
  align-items: center;
  width: 100%;
  flex: 0 0 auto;
}

.topbar-inner {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand img {
  height: 28px;
  width: auto;
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 4px 24px 0 rgba(33, 33, 33, .08);
}

#uploadBox {
  background: #ffffff;
}

.upload-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.uploadedFileWrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: #F5F5F5;
  height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}

.status.success {
  background: #F0FDF4;
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.danger {
  background: #fdf0f0;
  color: var(--danger);
}

.status.info {
  color: var(--muted);
}

.status.loading {
  position: relative;
  padding-left: 28px;
}

.status.loading::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -8px;
  display: block;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  border-top-color: var(--color-orange-200);
  animation: spin 0.8s linear infinite;
  will-change: transform;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.spacer {
  height: 8px;
}

.btn {
  border: 1px solid var(--color-orange-200);
  background: #fff;
  color: var(--color-orange-200);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(.98);
}

.btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--color-orange-200);
  color: #fff;
  border-color: var(--color-orange-200);
}

.btn.ghost {
  background: transparent;
  color: var(--color-orange-200);
}

.btn.cta {
  background: white;
  color: var(--color-orange-200);
  border-color: var(--color-orange-200);
  line-height: 1;
  padding: 8px 24px;
  border-radius: 8px;
  border: 2px solid var(--color-orange-200);
}

.btn.small {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.1;
}

.btn-filled {
  background: var(--color-orange-200);
  color: #fff;
  border-color: var(--color-orange-200);
}

.btn-line {
  background: #fff;
  border-color: var(--color-orange-200);
  color: var(--color-orange-200);
}

.phoneBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dropzone {
  border: 1px dashed #CCC;
  border-radius: 12px;
  background: #fff;
  min-height: 180px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone.is-dragover {
  outline: 2px solid var(--color-orange-200);
  outline-offset: -4px;
  background: #fff;
}

.file-input-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.dz-trigger {
  display: grid;
  grid-auto-rows: min-content;
  width: 100%;
  gap: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  padding: 16px 8px;
  border-radius: 10px;
}

.dz-trigger:focus {
  outline: 2px solid var(--color-orange-200);
  outline-offset: 2px;
  border-radius: 10px;
}

.dz-icon {
  font-size: 22px;
  line-height: 1;
}

.dz-title {
  font-weight: 600;
}

.dz-alt {
  color: var(--muted);
  font-weight: 400;
}

.dz-help {
  font-size: 12px;
  color: var(--muted);
}

.dz-fileName {
  font-size: 12px;
  color: var(--text);
}

.dz-actions {
  justify-content: center;
}

.chatCard {
  background: #fff;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 12px;
}

.chatHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.subtle {
  color: var(--muted);
}

.qBlock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-top: 12px;
}

.questionPreview {
  min-height: 32px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  color: var(--text);
  background: #F5F5F5;
  display: none;
  align-items: center;
  margin-left: auto;
}

.questionPreview.visible {
  display: flex;
  margin-bottom: 6px;
}

.responseArea {
  padding: 0;
  background: transparent;
  border: 0;
  min-height: 40px;
}

.answerBlock {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.answerBlock + .answerBlock {
  margin-top: 12px;
}

.answerCard {
  max-width: 580px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 12px;
  padding: 12px;
}

.answerCard-header {
  font-weight: 700;
  margin-bottom: 8px;
}

.questionChip {
  background: #fff;
  border: 1px solid var(--green-100);
  color: #111827;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 10px;
}

.answerText {
  white-space: pre-wrap;
}

.sectionTitle {
  margin-top: 12px;
  font-weight: 700;
  font-size: 14px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--green-100);
  color: #1f2937;
}

.quotesBlock summary {
  cursor: pointer;
}

.quotesBlock .quotesList {
  margin-top: 8px;
}

.quotesBlock p {
  margin: 0 0 6px 0;
}

.callout {
  max-width: 580px;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.callout.warn {
  background: var(--amber-50);
  border-color: var(--amber-200);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.callout-body {
  color: #374151;
}

.cardLite {
  max-width: 580px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  margin-top: 10px;
}

.disclaimer {
  background: #FFEBEB;
  border: 1px solid #FD8A8A;
}

.itemRow {
  max-width: 580px;
  margin-top: 8px;
}

.recsList {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 580px;
  margin-top: 8px;
}

.partnerCard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.partnerCard--v2 {
  padding: 14px;
}

.partnerHeader {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.partnerIndex {
  font-weight: 700;
  font-size: 18px;
  min-width: 20px;
}

.partnerTitle {
  display: grid;
  gap: 2px;
}

.partnerName {
  font-weight: 700;
  font-size: 18px;
}

.partnerSubtle {
  font-size: 13px;
  color: var(--muted);
}

.quotePanel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.metric {
  background: #F5F5F5;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.metricLabel {
  font-size: 12px;
  color: var(--muted);
}

.metricValue {
  font-weight: 700;
  margin-top: 2px;
}

.metricSub {
  font-size: 12px;
  color: #6b7280;
}

.featuresTitle {
  font-weight: 700;
  margin-bottom: 4px;
}

.featuresList {
  margin: 0 0 10px 0;
  padding: 0;
  color: #374151;
}

.featuresList li {
  margin: 0 0 4px 0;
}

.featuresList {
  list-style: none;
  padding-left: 0;
}

.ctaRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.validLine {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.inputBar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #F5F5F5;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.inputBar input {
  width: 100%;
  flex: 1 1 auto;
  height: 44px;
  padding: 0 14px;
  background: #F5F5F5;
  border: 0;
  outline: none;
  color: var(--text);
}

.inputBar input:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn.round {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-orange-200);
  background: var(--color-orange-200);
  color: #fff;
  font-weight: 700;
  padding: 0;
}

.statusWrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#uploadBox.compact .spacer,
#uploadBox.compact #dropzone,
#uploadBox.compact #dzActions {
  display: none !important;
}

#uploadBox.compact {
  padding-top: 14px;
  padding-bottom: 14px;
}

.fileSummary {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: #F5F5F5;
  border-radius: 12px;
  padding: 10px 12px;
}

.fileBadge {
  font-size: 18px;
  line-height: 1;
}

.fileNameSummary {
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

.analyzing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-left: auto;
  max-width: 100%;
}

.analyzing.inline {
  align-self: flex-end;
  margin: 0;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  border-top-color: var(--color-orange-200);
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  will-change: transform;
}

.askMsg .error {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.footer {
  background: #383838;
  color: #ffffff;
  width: 100%;
  flex: 0 0 auto;
  margin-top: auto;
}

.footer-inner {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer .brand img {
  height: 28px;
  width: auto;
  display: block;
}

.footer .copyright {
  color: #e5e7eb;
  font-size: 13px;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.chatWrap,
.chatList {
  display: none;
}

.policySummary { background: #fff; }

.summaryHeader h2 {
  margin: 0 0 6px 0;
  font-weight: 700;
}

.summaryBox {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.summaryGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  max-width: 100%;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
}

.kv .label {
  font-size: 13px;
  color: var(--muted);
}

.kv .value {
  font-weight: 400;   
  color: #111827;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 720px) {
  .summaryGrid { grid-template-columns: 1fr; } 
  .kv { grid-template-columns: 140px 1fr; }
}

@media (max-width: 640px) {
  .summaryGrid { grid-template-columns: 1fr; }
}

.summaryItem .label { 
  font-size: 13px; 
  color: var(--muted); 
}

.summaryItem .value { 
  font-weight: 600; 
  color: #111827; 
  margin-top: 2px; 
  word-break: break-word;
 }
