/* ============================================================
   TWT AEO Ultimate — AI Visibility board
   The owner's marketing screenshot: white cards on the admin
   grey, a strong header band, solid verdict chips, the 2×2
   donut grid, the stacked allocation bar. No external libs.
   ============================================================ */

.twt-aeo-vis {
	max-width: 1200px;
	font-variant-numeric: tabular-nums;
}

/* ── Header band ── */
.twt-aeo-vis__header {
	background: linear-gradient(120deg, var(--aeo-primary) 0%, #16213e 55%, #0b3a55 100%);
	border-radius: 0 0 var(--aeo-radius) var(--aeo-radius);
}

/* ── The honesty banner (the caveat IS the product) ── */
.twt-aeo-vis__honesty {
	background: #eff8ff;
	border: 1px solid #b6e0fe;
	border-left: 4px solid var(--aeo-accent);
	border-radius: var(--aeo-radius);
	padding: 14px 18px;
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--aeo-text);
}
.twt-aeo-vis__honesty strong { display: block; margin-bottom: 2px; }

.twt-aeo-vis__lede {
	font-size: 13px;
	color: var(--aeo-text-muted);
	line-height: 1.6;
	max-width: 900px;
	margin: 0 0 26px;
}

/* ── Sections ── */
.twt-aeo-vis__section { margin: 0 0 30px; }
.twt-aeo-vis__section-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	margin: 0 0 10px;
}
.twt-aeo-vis__section-head h2 {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	color: var(--aeo-text);
}
.twt-aeo-vis__muted { color: var(--aeo-text-muted); font-size: 12px; font-weight: 400; }

.twt-aeo-vis .twt-aeo-card { border-radius: var(--aeo-radius); }

/* ── Observed strip ── */
.twt-aeo-vis__observed-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 16px;
}
.twt-aeo-vis__observed-total { font-size: 14px; margin: 12px 0 4px; }
.twt-aeo-vis__observed-total strong { font-size: 20px; }
.twt-aeo-vis__observed-empty { margin-top: 0; }
.twt-aeo-vis__explainer { margin-bottom: 0; }
.twt-aeo-vis__querylist { margin: 0; padding-left: 18px; font-size: 12px; }
.twt-aeo-vis__querylist li { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.twt-aeo-vis__querylist .twt-aeo-vis__q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twt-aeo-vis__scalars { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Chips (referrals + per-engine results) ── */
.twt-aeo-vis__chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.twt-aeo-vis__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: var(--aeo-neutral);
	border-radius: 20px;
	padding: 5px 12px;
	line-height: 1.4;
}
.twt-aeo-vis__chip .twt-aeo-vis__muted { color: rgba(255,255,255,.75); }
.twt-aeo-vis__chip--ref   { background: var(--aeo-primary); }
.twt-aeo-vis__chip--ok    { background: #1f8f6f; }
.twt-aeo-vis__chip--warn  { background: #d9a21b; }
.twt-aeo-vis__chip--none  { background: #8c9196; }
.twt-aeo-vis__num { font-weight: 700; }

/* ── Engines ── */
.twt-aeo-vis__engines { margin: 0 0 12px; }
.twt-aeo-vis__engine {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 2px;
	border-bottom: 1px solid var(--aeo-border);
	margin: 0;
	font-size: 13px;
	flex-wrap: wrap;
}
.twt-aeo-vis__engine:last-child { border-bottom: 0; }
.twt-aeo-vis__engine--soon { opacity: .5; }
.twt-aeo-vis__engine-name { font-weight: 700; min-width: 130px; }
.twt-aeo-vis__model {
	margin-left: auto;
	font-size: 11px;
	background: var(--aeo-bg);
	border: 1px solid var(--aeo-border);
	border-radius: 4px;
	padding: 1px 6px;
	color: var(--aeo-text-muted);
}
.twt-aeo-vis__pill {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 10px;
	border-radius: 20px;
	white-space: nowrap;
}
.twt-aeo-vis__pill--ok   { background: #e3f6ef; color: #146b52; }
.twt-aeo-vis__pill--off  { background: #f1f1f2; color: #616a75; }
.twt-aeo-vis__pill--soon { background: #f1f1f2; color: #616a75; font-style: italic; }

/* ── Allocation ── */
.twt-aeo-vis__presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.twt-aeo-vis__preset .twt-aeo-vis__muted { margin-left: 6px; }
.twt-aeo-vis__alloc-fields {
	display: grid;
	/* auto-fit, not a fixed count: this was pinned to 5 columns and adding the
	   brand level made the 6th field wrap onto a row of its own, leaving a gap
	   that read as broken spacing. Fitting to the container means the next level
	   added cannot break it either. */
	grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
	gap: 10px 12px;
	margin: 0 0 14px;
}
.twt-aeo-vis__field { display: block; }
.twt-aeo-vis__field-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 4px;
	padding-left: 10px;
	border-left: 3px solid var(--level, var(--aeo-accent));
	line-height: 1.3;
}
.twt-aeo-vis__alloc-input { width: 100%; max-width: 110px; }
.twt-aeo-vis__engine-ticks { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 18px; font-size: 13px; }
.twt-aeo-vis__tick.is-disabled { opacity: .55; }
.twt-aeo-vis__bar svg { display: block; border-radius: 5px; }
.twt-aeo-vis__bar-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.twt-aeo-vis__bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.twt-aeo-vis__swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	flex: none;
}
.twt-aeo-vis__swatch--sm { width: 8px; height: 8px; }
.twt-aeo-vis__arith { font-size: 13px; margin: 12px 0 6px; }
.twt-aeo-vis__more { margin: 10px 0 6px; font-size: 13px; }
.twt-aeo-vis__more summary { cursor: pointer; color: var(--aeo-text-muted); }
.twt-aeo-vis__more-grid { display: grid; gap: 10px; margin-top: 10px; max-width: 520px; }
.twt-aeo-vis__more-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.twt-aeo-vis__actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.twt-aeo-vis__status { font-size: 12px; color: var(--aeo-text-muted); }
.twt-aeo-vis__status.is-ok { color: var(--aeo-success); }
.twt-aeo-vis__status.is-err { color: var(--aeo-danger); }

/* ── Questions ── */
.twt-aeo-vis__qsummary {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 13px;
	padding: 10px 0 2px;
}
.twt-aeo-vis__qlevel {
	border: 1px solid var(--aeo-border);
	border-radius: var(--aeo-radius);
	padding: 12px 16px;
	margin: 10px 0;
	background: #fbfcfe;
}
.twt-aeo-vis__qlevel-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.twt-aeo-vis__qlevel-head .button-link { margin-left: auto; }
.twt-aeo-vis__qlist { margin: 10px 0 0; }
.twt-aeo-vis__qlist li { margin: 0 0 8px; font-size: 13px; }
.twt-aeo-vis__qlist label { display: inline-flex; gap: 6px; align-items: baseline; }
.twt-aeo-vis__qmeta { display: block; padding-left: 26px; }

/* ── Run ── */
.twt-aeo-vis__run-controls { margin-top: 4px; }
.twt-aeo-vis__progress { font-size: 13px; font-weight: 600; }
.twt-aeo-vis__progress .err { color: var(--aeo-danger); font-weight: 400; }

/* ── Notices ── */
.twt-aeo-vis__notice {
	border: 1px solid var(--aeo-border);
	border-left-width: 4px;
	border-radius: var(--aeo-radius);
	padding: 12px 16px;
	margin: 12px 0;
	font-size: 13px;
	line-height: 1.55;
	background: var(--aeo-card-bg);
}
.twt-aeo-vis__notice--info    { border-left-color: var(--aeo-accent);  background: #eff8ff; }
.twt-aeo-vis__notice--warn    { border-left-color: var(--aeo-warning); background: #fff8ec; }
.twt-aeo-vis__notice--ok      { border-left-color: var(--aeo-success); background: #effaf3; }
.twt-aeo-vis__notice--err     { border-left-color: var(--aeo-danger);  background: #fdf1f1; }
.twt-aeo-vis__sample .button { margin-left: 10px; }

/* ── Results ── */
.twt-aeo-vis__empty p:first-child { font-size: 13px; }
.twt-aeo-vis__nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 13px; }
.twt-aeo-vis__navselect { max-width: 420px; }

.twt-aeo-vis__headline {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 4px 0 12px;
}
.twt-aeo-vis__stat {
	background: var(--aeo-card-bg);
	border: 1px solid var(--aeo-border);
	border-radius: var(--aeo-radius);
	padding: 16px 20px;
	box-shadow: var(--aeo-shadow);
}
.twt-aeo-vis__stat-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--aeo-text-muted); }
.twt-aeo-vis__stat-value { display: block; font-size: 32px; font-weight: 800; line-height: 1.15; color: var(--aeo-text); }
.twt-aeo-vis__stat-sub { display: block; font-size: 12px; color: var(--aeo-text-muted); margin-top: 2px; }
.twt-aeo-vis__stat.is-bad .twt-aeo-vis__stat-value { color: var(--aeo-danger); }
.twt-aeo-vis__headline.is-sample .twt-aeo-vis__stat { border-style: dashed; }

.twt-aeo-vis__block { margin: 26px 0 0; }
.twt-aeo-vis__block h3 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }

/* Trend sparklines */
.twt-aeo-vis__sparks { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 8px; }
.twt-aeo-vis__spark { display: grid; gap: 4px; font-size: 12px; }
.twt-aeo-vis__spark-label { font-weight: 700; }

/* Share-of-voice donuts: a fixed two-by-two grid — the screenshot layout */
.twt-aeo-vis__donuts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-top: 12px;
}
.twt-aeo-vis__donut-card {
	background: var(--aeo-card-bg);
	border: 1px solid var(--aeo-border);
	border-radius: var(--aeo-radius);
	padding: 16px 20px;
	box-shadow: var(--aeo-shadow);
	display: grid;
	gap: 8px;
	align-content: start;
}
.twt-aeo-vis__donut-card--empty {
	border-style: dashed;
	box-shadow: none;
	color: var(--aeo-text-muted);
}
.twt-aeo-vis__donut-title { font-size: 13px; }
.twt-aeo-vis__donut-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.twt-aeo-vis__donut { flex: none; }
.twt-aeo-vis__legend { margin: 0; font-size: 12px; min-width: 0; }
.twt-aeo-vis__legend li { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; min-width: 0; }
.twt-aeo-vis__legend li > :nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Question table */
.twt-aeo-vis__legend-line { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; margin: 4px 0 8px; }
.twt-aeo-vis__legend-line > span { display: inline-flex; align-items: center; gap: 4px; }
.twt-aeo-vis__table-wrap { overflow-x: auto; }
.twt-aeo-vis__table { border-radius: var(--aeo-radius); overflow: hidden; }
.twt-aeo-vis__table th { font-weight: 700; font-size: 12px; }
.twt-aeo-vis__table td { font-size: 13px; vertical-align: top; }
.twt-aeo-vis__th-e, .twt-aeo-vis__td-e { text-align: center; width: 84px; }
.twt-aeo-vis__td-q .twt-aeo-vis__truth { display: block; margin-top: 2px; }
.twt-aeo-vis__row.is-wrong { background: #fdf6f6; }
.twt-aeo-vis__row.is-wrong .twt-aeo-vis__td-q > span:first-child { font-weight: 600; }
.twt-aeo-vis__cell {
	background: none;
	border: 0;
	padding: 2px 4px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border-radius: 4px;
}
.twt-aeo-vis__cell:hover, .twt-aeo-vis__cell[aria-expanded="true"] { background: var(--aeo-bg); }
.twt-aeo-vis__dot { vertical-align: middle; }
.twt-aeo-vis__acc { font-size: 12px; font-weight: 700; }
.twt-aeo-vis__acc--correct    { color: #1f8f6f; }
.twt-aeo-vis__acc--wrong      { color: var(--aeo-danger); }
.twt-aeo-vis__acc--not_stated { color: #8c9196; }

/* Answer drawer */
.twt-aeo-vis__drawer > td { background: var(--aeo-bg); }
.twt-aeo-vis__drawer-box {
	border: 1px solid var(--aeo-border);
	border-radius: var(--aeo-radius);
	background: var(--aeo-card-bg);
	padding: 12px 16px;
	font-size: 13px;
}
.twt-aeo-vis__excerpt { margin: 6px 0; line-height: 1.55; }
.twt-aeo-vis__error { color: var(--aeo-danger); margin: 4px 0; }
.twt-aeo-vis__cited { margin: 2px 0 6px 16px; list-style: disc; font-size: 12px; }
.twt-aeo-vis__cited li { margin-bottom: 2px; word-break: break-all; }
.twt-aeo-vis__drawer-foot { margin: 6px 0 0; font-style: italic; }

/* ── Footnote ── */
.twt-aeo-vis__footnote {
	border-top: 1px solid var(--aeo-border);
	padding-top: 16px;
	margin-top: 8px;
}
.twt-aeo-vis__footnote h2 { font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.twt-aeo-vis__footnote p { font-size: 12px; color: var(--aeo-text-muted); max-width: 900px; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 1100px) {
	.twt-aeo-vis__observed-grid { grid-template-columns: 1fr 1fr; }
	.twt-aeo-vis__observed-main { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
	.twt-aeo-vis__donuts { grid-template-columns: 1fr; }
	.twt-aeo-vis__headline { grid-template-columns: 1fr; }
	.twt-aeo-vis__observed-grid { grid-template-columns: 1fr; }
}

/* ── Brand & company tracking ─────────────────────────────────────────────── */

.twt-aeo-vis__sub { margin: 18px 0 6px; font-size: 13px; font-weight: 700; }
.twt-aeo-vis__sub:first-child { margin-top: 0; }

.twt-aeo-vis__field { display: grid; gap: 4px; margin: 10px 0; font-size: 12px; font-weight: 600; }
.twt-aeo-vis__field textarea { font-size: 12px; line-height: 1.5; }
.twt-aeo-vis__field .twt-aeo-vis__muted { font-weight: 400; }

.twt-aeo-vis__brand-row {
	border: 1px solid var(--aeo-border, #dcdcde);
	border-radius: 6px;
	padding: 12px 14px;
	margin-bottom: 10px;
}
.twt-aeo-vis__brand-grid { display: grid; gap: 10px; grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) minmax(220px, 2fr); align-items: start; }
.twt-aeo-vis__brand-grid .twt-aeo-vis__field { margin: 0; }
.twt-aeo-vis__brand-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; }
.twt-aeo-vis__brand-remove { color: #b32d2e; }

.twt-aeo-vis__rejects {
	margin-top: 10px;
	padding: 10px 12px;
	border-left: 3px solid #d9a21b;
	background: rgba(217, 162, 27, .08);
	font-size: 12px;
}
.twt-aeo-vis__rejects ul { margin: 6px 0 0; padding-left: 18px; }
.twt-aeo-vis__rejects li { margin-bottom: 4px; }

/* ── Citation surface rollup ──────────────────────────────────────────────── */

.twt-aeo-vis__rollup { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--aeo-border, #dcdcde); }
.twt-aeo-vis__surfaces { display: flex; flex-wrap: wrap; gap: 18px; margin: 6px 0 10px; padding: 0; list-style: none; font-size: 12px; }
.twt-aeo-vis__surfaces strong { font-size: 15px; }

.twt-aeo-vis__brand-table { border-collapse: collapse; font-size: 12px; min-width: 320px; }
.twt-aeo-vis__brand-table th,
.twt-aeo-vis__brand-table td { text-align: left; padding: 5px 14px 5px 0; border-bottom: 1px solid var(--aeo-border, #dcdcde); }
.twt-aeo-vis__brand-table th { font-weight: 700; }

@media (max-width: 900px) {
	.twt-aeo-vis__brand-grid { grid-template-columns: 1fr; }
}

/* ── Content briefs: the questions you are losing ──────────────────────────── */

.twt-aeo-vis__briefs { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--aeo-border, #dcdcde); }
.twt-aeo-vis__brief-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.twt-aeo-vis__brief {
	border: 1px solid var(--aeo-border, #dcdcde);
	border-left: 3px solid #d0603f;
	border-radius: 4px;
	padding: 10px 12px;
}
.twt-aeo-vis__brief p { margin: 0 0 4px; }
.twt-aeo-vis__brief p:last-child { margin-bottom: 0; }
.twt-aeo-vis__brief-q { font-weight: 600; font-size: 13px; }
.twt-aeo-vis__brief-rivals { font-size: 12px; }
.twt-aeo-vis__brief-fix { font-size: 12px; font-weight: 600; text-decoration: none; }

.twt-aeo-vis__correlate { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--aeo-border, #dcdcde); }
.twt-aeo-vis__correlate .twt-aeo-vis__brand-table { min-width: 480px; }

.twt-aeo-vis__brand-trend { margin-top: 16px; }
.twt-aeo-vis__brand-trends { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.twt-aeo-vis__brand-trends li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.twt-aeo-vis__brand-trend-name { font-weight: 600; min-width: 140px; }
.twt-aeo-vis__brand-trend-now { font-size: 15px; font-weight: 700; }
