/* === Foresportia Agent — chat-first UX === */

/* ─── Design tokens ─── */
:root {
  --at-bg: #f4f7fb;
  --at-panel: rgba(255, 255, 255, 0.86);
  --at-panel-border: rgba(148, 163, 184, 0.22);
  --at-card: #ffffff;
  --at-card-soft: #f8fbff;
  --at-text: #162235;
  --at-text-soft: #526277;
  --at-text-muted: #7a8a9d;
  --at-line: #d9e3ef;
  --at-line-strong: #c7d5e6;
  --at-blue: #1d4ed8;
  --at-blue-soft: #dcecff;
  --at-blue-wash: linear-gradient(180deg, rgba(234, 244, 255, 0.92), rgba(255, 255, 255, 0.94));
  --at-green: #15803d;
  --at-green-soft: #def7e5;
  --at-warn: #b45309;
  --at-warn-soft: #fff4db;
  --at-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --at-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --at-bg: #08111f;
  --at-panel: rgba(9, 17, 30, 0.84);
  --at-panel-border: rgba(71, 85, 105, 0.5);
  --at-card: #0f1a2c;
  --at-card-soft: #102036;
  --at-text: #e5edf8;
  --at-text-soft: #bfd0e6;
  --at-text-muted: #8ea1b8;
  --at-line: #27364b;
  --at-line-strong: #35506d;
  --at-blue: #7cb6ff;
  --at-blue-soft: rgba(29, 78, 216, 0.18);
  --at-blue-wash: linear-gradient(180deg, rgba(18, 34, 58, 0.98), rgba(12, 25, 42, 0.98));
  --at-green: #4ade80;
  --at-green-soft: rgba(34, 197, 94, 0.12);
  --at-warn: #fbbf24;
  --at-warn-soft: rgba(251, 191, 36, 0.12);
  --at-shadow: 0 28px 70px rgba(2, 8, 23, 0.45);
  --at-shadow-soft: 0 12px 30px rgba(2, 8, 23, 0.28);
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.09), transparent 28%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.07), transparent 24%),
    var(--at-bg);
}

/* ─── Page layout ─── */
.at-page {
  position: relative;
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

/* ─── Compact hero banner ─── */
.at-hero-compact {
  padding: clamp(2.4rem, 5vw, 3.6rem) 1rem clamp(1.6rem, 4vw, 2.5rem);
  background:
    radial-gradient(1200px 360px at 50% -10%, rgba(255, 255, 255, 0.33), transparent 60%),
    linear-gradient(110deg, #1e40af, #2563eb);
  color: #ffffff;
  text-align: center;
  overflow: hidden;
}

[data-theme="dark"] .at-hero-compact {
  background:
    radial-gradient(1200px 360px at 50% -10%, rgba(124, 182, 255, 0.18), transparent 60%),
    linear-gradient(110deg, #0f1f3a, #153c7a);
}

.at-hero-inner {
  width: min(1120px, calc(100% - 40px));
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.at-hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  max-width: 760px;
  text-align: center;
}

.at-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.at-hero-compact h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #ffffff;
  margin: 0;
  white-space: normal;
  text-wrap: balance;
}

.at-hero-sub {
  max-width: 720px;
  font-size: clamp(0.98rem, 0.92rem + 0.24vw, 1.08rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.94);
  margin: 0;
  white-space: normal;
}

.at-hero-sub em {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.48rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78em;
}

.at-hero-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.at-hero-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.15s ease;
}

.at-hero-nav a:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* ─── Chat shell ─── */
.at-shell {
  position: relative;
  padding: clamp(1rem, 2.6vw, 1.45rem) 1rem 0;
  z-index: 1;
}

.at-wrap {
  max-width: 940px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 180px);
  box-sizing: border-box;
  color: var(--at-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.62));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

[data-theme="dark"] .at-wrap {
  background: linear-gradient(180deg, rgba(8, 17, 31, 0.88), rgba(8, 17, 31, 0.78));
  border-color: rgba(51, 65, 85, 0.88);
  box-shadow: 0 32px 64px rgba(2, 8, 23, 0.42);
}

/* ─── Toolbar ─── */
.at-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--at-panel-border);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .at-toolbar {
  background: rgba(15, 23, 42, 0.4);
}

.at-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.at-toolbar-logo {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(29, 78, 216, 0.14), rgba(34, 197, 94, 0.08));
  flex-shrink: 0;
  overflow: hidden;
  padding: 0.22rem;
  box-sizing: border-box;
}

.at-toolbar-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.at-toolbar-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--at-text);
}

.at-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.at-meta-pill {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(203, 213, 225, 0.6);
  font-size: 0.7rem;
  color: var(--at-text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.at-meta-pill:empty {
  display: none;
}

[data-theme="dark"] .at-meta-pill {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(71, 85, 105, 0.72);
}

/* ─── Language toggle (improved) ─── */
.at-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--at-line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--at-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1;
}

.at-lang-label {
  font-size: 0.74rem;
}

.at-lang-mode {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--at-text-muted);
  opacity: 0.7;
}

.at-lang-toggle:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: #fff;
}

.at-lang-toggle[data-manual="true"] {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(219, 234, 254, 0.5);
}

[data-theme="dark"] .at-lang-toggle {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(71, 85, 105, 0.76);
}

[data-theme="dark"] .at-lang-toggle[data-manual="true"] {
  background: rgba(29, 78, 216, 0.15);
}

/* ─── Quick suggestions (pre-chat) ─── */
.at-quick-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--at-panel-border);
  animation: at-fade-in 0.3s ease;
}

.at-quick-suggestions[hidden] {
  display: none;
}

.at-quick-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.7), rgba(255, 255, 255, 0.9));
  color: var(--at-blue);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.at-quick-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12);
  background: rgba(219, 234, 254, 0.95);
}

[data-theme="dark"] .at-quick-chip {
  background: rgba(17, 35, 59, 0.9);
  border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .at-quick-chip:hover {
  background: rgba(29, 55, 90, 0.95);
  border-color: rgba(59, 130, 246, 0.5);
}

/* ─── History panel ─── */
.at-history {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
  min-height: 0;
}

.at-history::-webkit-scrollbar {
  width: 5px;
}

.at-history::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 999px;
}

/* ─── Messages ─── */
.at-msg {
  padding: 0.95rem 1.08rem;
  border-radius: 18px;
  line-height: 1.78;
  word-break: break-word;
  font-size: 0.95rem;
  max-width: min(88%, 680px);
  animation: at-fade-in 0.22s ease;
}

@keyframes at-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User message */
.at-msg-user {
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

/* Bot message */
.at-msg-bot {
  background: var(--at-blue-wash);
  color: var(--at-text);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--at-shadow-soft);
}

.at-msg-bot p {
  margin: 0;
  color: var(--at-text-soft);
}

.at-msg-bot p + p {
  margin-top: 0.5rem;
}

.at-msg-bot strong {
  color: var(--at-text);
  font-weight: 800;
}

.at-msg-bot a {
  color: var(--at-blue);
  font-weight: 700;
  text-decoration: none;
}

.at-msg-bot a:hover {
  text-decoration: underline;
}

.at-inline-code {
  background: rgba(148, 163, 184, 0.16);
  padding: 0.12em 0.38em;
  border-radius: 6px;
  font-size: 0.84em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ─── Inner blocks (sections within bot message) ─── */
.at-block + .at-block {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(203, 213, 225, 0.5);
}

[data-theme="dark"] .at-block + .at-block {
  border-top-color: rgba(51, 65, 85, 0.6);
}

.at-block--matches {
  margin-top: 0;
}

.at-block-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--at-text);
}

.at-block-title::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--at-blue), #38bdf8);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  flex-shrink: 0;
}

/* Section labels (pills) */
.at-section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.15rem 0 0.55rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: rgba(59, 130, 246, 0.07);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--at-blue);
}

.at-section-label--analysis {
  background: rgba(59, 130, 246, 0.09);
}

.at-section-label--why {
  background: rgba(16, 185, 129, 0.08);
  color: var(--at-green);
  border-color: rgba(16, 185, 129, 0.16);
}

.at-section-label--conclusion {
  background: rgba(245, 158, 11, 0.1);
  color: var(--at-warn);
  border-color: rgba(245, 158, 11, 0.16);
}

.at-section-label--nav {
  background: rgba(29, 78, 216, 0.1);
}

/* ─── Lists ─── */
.at-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.at-list li {
  position: relative;
  padding: 0.4rem 0 0.4rem 0.9rem;
  color: var(--at-text-soft);
  line-height: 1.55;
  font-size: 0.88rem;
}

.at-list li + li {
  border-top: 1px dashed rgba(203, 213, 225, 0.55);
}

[data-theme="dark"] .at-list li + li {
  border-top-color: rgba(51, 65, 85, 0.6);
}

.at-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--at-blue), #60a5fa);
}

.at-match-line {
  display: block;
  padding: 0.18rem 0;
  color: var(--at-text-soft);
}

/* Fact cards grid */
.at-list--facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.at-list--facts li,
.at-fact-card {
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.65);
  background: var(--at-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.at-list--facts li::before {
  display: none;
}

.at-list--facts li + li {
  border-top: 1px solid rgba(203, 213, 225, 0.65);
}

.at-fact-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--at-text-muted);
}

.at-fact-value {
  display: block;
  color: var(--at-text);
  font-size: 0.86rem;
  line-height: 1.4;
  font-weight: 700;
}

/* Link cards */
.at-list--links {
  display: grid;
  gap: 0.45rem;
}

.at-list--links li {
  padding: 0;
  border: none;
  background: transparent;
}

.at-list--links li::before {
  display: none;
}

.at-list--links li + li {
  border-top: none;
}

.at-link-card a,
.at-list--links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 2.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.7), rgba(255, 255, 255, 0.92));
  color: var(--at-blue);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.06);
}

[data-theme="dark"] .at-link-card a,
[data-theme="dark"] .at-list--links a {
  background: linear-gradient(135deg, rgba(17, 35, 59, 0.95), rgba(13, 28, 47, 0.95));
  border-color: rgba(59, 130, 246, 0.25);
}

.at-link-card a::after,
.at-list--links a::after {
  content: "Ouvrir";
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--at-blue);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

[data-theme="dark"] .at-link-card a::after,
[data-theme="dark"] .at-list--links a::after {
  background: rgba(124, 182, 255, 0.12);
}

.at-link-card a:hover,
.at-list--links a:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.1);
  text-decoration: none;
}

/* ─── Match cards ─── */
.at-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.at-match-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.98)),
    var(--at-card);
  border: 1px solid rgba(203, 213, 225, 0.65);
  border-radius: 16px;
  padding: 0.75rem 0.85rem 0.7rem;
  padding-left: calc(0.85rem + 3px);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.at-match-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--at-blue), #38bdf8);
}

.at-match-card:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .at-match-card {
  background:
    linear-gradient(180deg, rgba(17, 32, 54, 0.98), rgba(13, 27, 45, 0.98)),
    var(--at-card);
  border-color: rgba(51, 65, 85, 0.8);
}

.at-mc-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.at-mc-rank {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--at-blue), #2563eb);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.at-mc-teams {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--at-text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.at-mc-team {
  display: inline-flex;
  align-items: center;
}

.at-mc-vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--at-text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.at-mc-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.at-mc-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 2.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.6);
  line-height: 1.25;
}

[data-theme="dark"] .at-mc-stat {
  background: rgba(18, 36, 60, 0.75);
  border-color: rgba(51, 65, 85, 0.8);
}

.at-mc-stat-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--at-text-muted);
}

.at-mc-stat-value {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--at-text);
}

.at-mc-stat--good {
  background: var(--at-green-soft);
  border-color: rgba(22, 163, 74, 0.16);
}

.at-mc-stat--good .at-mc-stat-value {
  color: var(--at-green);
}

.at-mc-stat--warn {
  background: var(--at-warn-soft);
  border-color: rgba(217, 119, 6, 0.16);
}

.at-mc-stat--warn .at-mc-stat-value {
  color: var(--at-warn);
}

/* ─── Special message states ─── */
.at-empty {
  color: var(--at-text-muted);
  font-style: italic;
}

.at-msg-welcome {
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.85), rgba(220, 252, 231, 0.85)),
    #fff;
  border: 1px solid rgba(147, 197, 253, 0.45);
}

[data-theme="dark"] .at-msg-welcome {
  background:
    linear-gradient(135deg, rgba(23, 37, 84, 0.92), rgba(20, 83, 45, 0.88)),
    var(--at-card);
  border-color: rgba(59, 130, 246, 0.25);
}

.at-msg-clarify {
  border-left: 3px solid #f59e0b;
}

.at-msg-capacity,
.at-msg-quota {
  background: #fff4d6;
  color: #92400e;
  border: 1px solid #f4cf74;
  align-self: stretch;
  max-width: 100%;
  text-align: center;
  border-radius: 12px;
}

[data-theme="dark"] .at-msg-capacity,
[data-theme="dark"] .at-msg-quota {
  background: rgba(120, 53, 15, 0.3);
  color: #fcd34d;
  border-color: rgba(217, 119, 6, 0.35);
}

.at-msg-error {
  background: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
  align-self: stretch;
  max-width: 100%;
  border-radius: 12px;
}

[data-theme="dark"] .at-msg-error {
  background: rgba(127, 29, 29, 0.3);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.3);
}

/* ─── Suggestion chips (in-chat, after bot message) ─── */
.at-suggestions {
  align-self: flex-start;
  max-width: min(92%, 680px);
  padding: 0.1rem 0;
  animation: at-fade-in 0.25s ease;
}

.at-suggestions-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  padding: 0.12rem 0.15rem;
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--at-text-muted);
}

.at-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.at-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.78);
  color: var(--at-text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  line-height: 1.2;
  text-align: left;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.at-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.3);
  background: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
}

.at-chip:active {
  transform: translateY(0);
}

[data-theme="dark"] .at-chip {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(51, 65, 85, 0.85);
}

[data-theme="dark"] .at-chip:hover {
  background: rgba(18, 36, 60, 0.95);
  border-color: rgba(59, 130, 246, 0.4);
}

/* ─── Typing indicator ─── */
.at-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.8rem;
  align-self: flex-start;
  flex-shrink: 0;
}

.at-typing[hidden] {
  display: none;
}

.at-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--at-text-muted);
  animation: at-bounce 0.9s infinite;
}

.at-dot:nth-child(2) { animation-delay: 0.15s; }
.at-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes at-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ─── Input bar (sticky bottom) ─── */
.at-input-bar {
  flex-shrink: 0;
  padding: 0.6rem 0.85rem 0.65rem;
  border-top: 1px solid var(--at-panel-border);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
}

[data-theme="dark"] .at-input-bar {
  background: rgba(8, 17, 31, 0.5);
}

.at-beta-consent {
  margin-bottom: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.94));
  color: var(--at-text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .at-beta-consent {
  background: linear-gradient(135deg, rgba(54, 31, 8, 0.8), rgba(15, 23, 42, 0.92));
  border-color: rgba(251, 191, 36, 0.3);
}

.at-beta-consent[hidden] {
  display: none;
}

.at-beta-consent__title {
  margin: 0 0 0.28rem;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--at-text);
}

.at-beta-consent__text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--at-text-soft);
}

.at-beta-consent__check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--at-text);
  cursor: pointer;
}

.at-beta-consent__check input {
  margin: 0.16rem 0 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--at-blue);
  flex-shrink: 0;
}

.at-beta-consent__btn {
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.at-beta-consent__btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.2);
}

.at-beta-consent__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.at-form {
  display: flex;
  gap: 0.5rem;
}

.at-input {
  flex: 1;
  min-height: 2.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--at-line-strong);
  border-radius: 14px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.86);
  color: var(--at-text);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

[data-theme="dark"] .at-input {
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
}

.at-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.at-input:disabled {
  opacity: 0.5;
}

.at-input::placeholder {
  color: var(--at-text-muted);
  opacity: 0.65;
}

.at-btn {
  border: none;
  cursor: pointer;
}

.at-btn-send {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.at-btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.at-btn-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.at-btn-reset {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  background: none;
  color: var(--at-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0;
  text-align: center;
  transition: color 0.14s ease;
}

.at-btn-reset:hover {
  color: var(--at-text-soft);
}

.at-quick-suggestions--locked {
  opacity: 0.62;
}

/* ─── SEO content (below chat) ─── */
.at-content {
  width: min(1120px, calc(100% - 2rem));
  margin: clamp(1.8rem, 4vw, 2.8rem) auto 0;
  padding: clamp(2.3rem, 5vw, 3.4rem) clamp(1rem, 3vw, 2.6rem);
  border-radius: 28px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.98)),
    var(--at-card);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.07);
  box-sizing: border-box;
  text-align: center;
}

[data-theme="dark"] .at-content {
  border-color: rgba(51, 65, 85, 0.9);
  background:
    linear-gradient(180deg, rgba(11, 22, 38, 0.96), rgba(10, 20, 34, 0.98)),
    var(--at-card);
  box-shadow: 0 24px 56px rgba(2, 8, 23, 0.3);
}

.at-content .container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.at-content p {
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.85;
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.06rem);
  color: var(--at-text-soft);
  text-align: center;
  text-wrap: pretty;
}

.at-content p + p {
  margin-top: 1rem;
}

.at-content h2 {
  max-width: 16ch;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  line-height: 1.18;
  margin: 0 auto 1rem;
  color: var(--at-text);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.at-content .tp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.7rem auto 0;
}

.at-content .cta-button {
  margin: 0;
  min-width: 220px;
}

.seo-faq-block {
  margin-top: 2rem;
  max-width: 960px;
  margin-inline: auto;
  padding: 0 1rem;
}

.seo-faq-block h2 {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  margin-bottom: 1rem;
  text-align: center;
  color: var(--at-text);
}

.seo-faq-block details {
  border: 1px solid var(--at-line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  background: var(--at-card);
  transition: border-color 0.15s ease;
}

.seo-faq-block details:hover {
  border-color: rgba(59, 130, 246, 0.25);
}

.seo-faq-block summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.seo-faq-block p {
  margin-top: 0.4rem;
  color: var(--at-text-soft);
  font-size: 0.88rem;
}

/* Hover CTA */
.cta-button:hover {
  transform: translateY(-1px);
}

/* ─── Skeleton loading ─── */
.at-skeleton {
  animation: at-pulse 1.5s ease-in-out infinite;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  height: 1rem;
  margin-bottom: 0.4rem;
}

.at-skeleton:nth-child(2) { width: 75%; }
.at-skeleton:nth-child(3) { width: 60%; }

@keyframes at-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ─── Mobile ─── */
@media (max-width: 720px) {
  .at-page {
    padding-bottom: 1.5rem;
  }

  .at-hero-compact {
    padding: 1.3rem 0.75rem 1rem;
  }

  .at-hero-inner {
    width: calc(100% - 20px);
    gap: 0.8rem;
    padding: 1rem 0.9rem;
  }

  .at-hero-text {
    gap: 0.6rem;
  }

  .at-hero-compact h1 {
    font-size: 1.7rem;
  }

  .at-hero-sub {
    font-size: 0.95rem;
  }

  .at-hero-nav {
    gap: 0.45rem;
  }

  .at-shell {
    padding: 0.75rem 0.35rem 0;
  }

  .at-wrap {
    border-radius: 18px;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
  }

  /* Toolbar compact */
  .at-toolbar {
    padding: 0.5rem 0.75rem;
  }

  .at-toolbar-logo {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1rem;
    border-radius: 10px;
  }

  .at-toolbar-title {
    font-size: 0.84rem;
  }

  /* Quick suggestions: horizontal scroll */
  .at-quick-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.45rem 0.75rem;
    gap: 0.35rem;
    scrollbar-width: none;
  }

  .at-quick-suggestions::-webkit-scrollbar {
    display: none;
  }

  .at-quick-chip {
    font-size: 0.73rem;
    padding: 0.3rem 0.55rem;
  }

  .at-history {
    padding: 0.75rem;
  }

  .at-msg {
    max-width: 95%;
    padding: 0.8rem 0.86rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.72;
  }

  .at-block-title {
    font-size: 0.9rem;
  }

  /* Grids to 1 column */
  .at-list--facts,
  .at-mc-stats {
    grid-template-columns: 1fr;
  }

  .at-link-card a,
  .at-list--links a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
  }

  .at-link-card a::after,
  .at-list--links a::after {
    content: "Voir";
  }

  /* Input bar sticky feel */
  .at-input-bar {
    padding: 0.5rem 0.65rem;
  }

  .at-beta-consent {
    padding: 0.8rem 0.85rem;
    border-radius: 14px;
  }

  .at-beta-consent__text {
    font-size: 0.8rem;
  }

  .at-beta-consent__check {
    gap: 0.55rem;
    font-size: 0.78rem;
  }

  .at-beta-consent__btn {
    width: 100%;
  }

  .at-input {
    min-height: 2.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.88rem;
    border-radius: 12px;
  }

  .at-btn-send {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
  }

  /* Suggestions chips */
  .at-chips {
    gap: 0.3rem;
  }

  .at-chip {
    font-size: 0.74rem;
    padding: 0.32rem 0.6rem;
    min-height: 1.8rem;
  }

  /* Match cards tighter */
  .at-match-card {
    padding: 0.6rem 0.7rem 0.55rem;
    padding-left: calc(0.7rem + 3px);
    border-radius: 14px;
  }

  .at-mc-rank {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.65rem;
  }

  .at-mc-teams {
    font-size: 0.84rem;
  }

  .at-mc-stat {
    padding: 0.4rem 0.5rem;
    min-height: 2.2rem;
    border-radius: 8px;
  }

  .at-content {
    width: calc(100% - 1rem);
    padding: 1.8rem 0.95rem;
    border-radius: 22px;
  }

  .at-content h2 {
    max-width: 100%;
  }

  .at-content p {
    font-size: 0.98rem;
    line-height: 1.8;
  }

  .at-content .tp-hero-actions {
    width: 100%;
    gap: 0.7rem;
  }

  .at-content .cta-button {
    width: 100%;
    min-width: 0;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .at-hero-nav a {
    width: 100%;
  }

  .at-toolbar-right .at-meta-pill {
    display: none;
  }
}
