:root {
  --ask-ink: #1f2933;
  --ask-blue: #165d8f;
  --ask-blue-soft: #e7f2f8;
  --ask-green: #1d7a5b;
  --ask-amber: #9a5a08;
  --ask-border: #d7e0e6;
  --ask-paper: #fbfcfd;
}

body {
  max-width: 1180px;
}

.ask-eyebrow {
  margin: 0 0 5px;
  color: var(--ask-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ask-layout {
  display: grid;
  gap: 24px;
}

.ask-panel,
.response {
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--ask-border);
  border-radius: 14px;
  background: var(--ask-paper);
  box-shadow: 0 8px 30px rgba(33, 57, 73, 0.07);
}

.ask-heading-row,
.response-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.ask-heading-row h2,
.response-heading h2 {
  margin: 0 0 7px;
}

.ask-heading-row p {
  max-width: 760px;
  margin: 0;
}

.route-scope {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #99bdd2;
  border-radius: 999px;
  background: var(--ask-blue-soft);
  color: #154b6d;
  font-size: 12px;
  font-weight: 750;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 18px;
}

.suggestion,
.secondary-button {
  padding: 7px 11px;
  border: 1px solid #b9c9d3;
  border-radius: 999px;
  background: #fff;
  color: #23495e;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.suggestion:hover,
.secondary-button:hover {
  border-color: var(--ask-blue);
  color: var(--ask-blue);
}

#ask-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 750;
}

#question {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid #aebfc9;
  border-radius: 9px;
  background: #fff;
  color: var(--ask-ink);
  font: inherit;
  line-height: 1.55;
}

#question:focus {
  border-color: var(--ask-blue);
  outline: 3px solid rgba(22, 93, 143, 0.14);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 1px 13px;
  color: #647682;
  font-size: 11px;
}

.thread-state {
  margin: -4px 1px 12px;
  color: #536b78;
  font-size: 12px;
}

#ask-button {
  min-width: 138px;
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: var(--ask-blue);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

#ask-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.limit-card {
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 4px solid var(--ask-blue);
  border-radius: 7px;
  background: var(--ask-blue-soft);
  color: #244657;
  font-size: 12px;
  line-height: 1.55;
}

.limit-card p {
  margin: 6px 0 0;
}

.limit-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa7ae;
}

.status-dot.ready { background: var(--ask-green); }
.status-dot.busy { background: var(--ask-amber); }
.status-dot.offline { background: #a92d2d; }

.message {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid #ddaeb0;
  border-radius: 6px;
  background: #fff1f1;
  color: #7d2025;
  font-size: 13px;
}

.timeframes {
  display: grid;
  gap: 8px;
  margin: 15px 0;
}

.thread-history {
  margin: 18px 0 16px;
  padding: 14px 16px;
  border: 1px solid #c8d9e3;
  border-radius: 9px;
  background: #f4f8fa;
}

.thread-history h3 {
  margin: 0 0 10px;
  color: #345260;
  font-size: 13px;
}

.thread-history ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.followup-form-home:not(:empty) {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #c8d9e3;
}

.followup-form-home #question {
  min-height: 92px;
}

.followup-form-home .question-meta {
  margin-bottom: 10px;
}

.followup-form-home .message {
  background: #fff;
}

.thread-history li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #fff;
  color: var(--ask-ink);
  font-size: 13px;
  line-height: 1.45;
}

.thread-question-label {
  color: var(--ask-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.thread-question-text {
  overflow-wrap: anywhere;
}

.thread-current {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ask-blue-soft);
  color: #154b6d;
  font-size: 10px;
  font-weight: 750;
}

.timeframe-note {
  padding: 10px 12px;
  border: 1px solid #dcc99d;
  border-radius: 6px;
  background: #fff9e8;
  color: #624b14;
  font-size: 12px;
}

.timeframe-note.explicit {
  border-color: #bbd2df;
  background: #f1f7fa;
  color: #31576b;
}

.answer {
  max-width: 820px;
  color: var(--ask-ink);
  font-size: 16px;
  line-height: 1.65;
}

.answer p {
  margin: 0 0 0.8em;
}

.warnings {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.warning {
  padding: 8px 10px;
  border-left: 3px solid var(--ask-amber);
  background: #fff8eb;
  color: #6c4715;
  font-size: 12px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 18px;
  margin-top: 22px;
}

.chart-card {
  min-height: 330px;
  padding: 14px;
  border: 1px solid var(--ask-border);
  border-radius: 9px;
  background: #fff;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.chart-card.heatmap-card {
  grid-column: 1 / -1;
  min-height: 0;
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.heatmap-note {
  margin: -4px 0 10px;
  color: #58707d;
  font-size: 12px;
}

.heatmap-scroll {
  overflow-x: auto;
  border: 1px solid var(--ask-border);
  border-radius: 7px;
}

.heatmap {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 2px;
  background: #f4f7f8;
  font-size: 10px;
}

.heatmap th {
  min-width: 32px;
  padding: 5px 3px;
  color: #405b68;
  font-weight: 650;
  text-align: center;
}

.heatmap tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 48px;
  background: #edf3f6;
}

.heatmap td {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 3px;
  color: #24323c;
  font-weight: 700;
  text-align: center;
}

.heatmap td[tabindex="0"]:focus {
  outline: 2px solid #165d8f;
  outline-offset: 1px;
}

.heatmap td.no-service {
  background: #fff;
  color: #9aa8af;
  font-weight: 400;
}

.heatmap-legend {
  display: grid;
  grid-template-columns: auto minmax(120px, 240px) auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-top: 9px;
  color: #58707d;
  font-size: 11px;
}

.heatmap-legend i {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(177, 61, 88, 0.08), rgba(177, 61, 88, 0.9));
}

.table-stack {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.result-table h3 {
  margin-bottom: 9px;
  font-size: 15px;
}

.table-scroll {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--ask-border);
  border-radius: 7px;
}

.result-table table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.result-table th,
.result-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e7ecef;
  text-align: left;
  white-space: nowrap;
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f6;
  color: #345260;
}

.sources-wrap {
  margin-top: 22px;
  color: #50626c;
  font-size: 12px;
}

.sources-wrap summary {
  cursor: pointer;
  font-weight: 750;
}

.sources-wrap ul {
  padding-left: 20px;
}

@media (max-width: 640px) {
  .ask-heading-row,
  .response-heading,
  .question-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .route-scope {
    align-self: flex-start;
  }

  #ask-button {
    width: 100%;
  }

  .thread-history li {
    grid-template-columns: 1fr auto;
  }

  .thread-question-text {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
