/* AIVP Core blocks. Uses the theme's tokens, with fallbacks so blocks still look right under another theme. */
.aivp-estimator, .aivp-compare, .aivp-ranked, .aivp-samples, .aivp-box, .aivp-fit, .aivp-badges, .aivp-sample, .aivp-disclosure-box {
	--a-bg: var(--wp--preset--color--bg, #0E0F11);
	--a-surface: var(--wp--preset--color--surface, #16181C);
	--a-raised: var(--wp--preset--color--raised, #1D2025);
	--a-line: var(--wp--preset--color--line, #2A2E35);
	--a-line-strong: var(--wp--preset--color--line-strong, #3A3F47);
	--a-text: var(--wp--preset--color--text, #F3F0EA);
	--a-soft: var(--wp--preset--color--text-soft, #C9C5BD);
	--a-muted: var(--wp--preset--color--muted, #A8A49C);
	--a-faint: var(--wp--preset--color--faint, #6E6A63);
	--a-accent: var(--wp--preset--color--accent, #A98BFF);
	--a-accent-hover: var(--wp--preset--color--accent-hover, #C9B8FF);
	--a-ink: var(--wp--preset--color--accent-ink, #0E0F11);
	--a-mine: var(--wp--preset--color--mine, #9CC3F5);
	--a-mine-line: var(--wp--preset--color--mine-line, #3B5470);
	--a-display: var(--wp--preset--font-family--display, system-ui, sans-serif);
	--a-mono: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	color: var(--a-text);
}

/* ---------- Badges ---------- */
.aivp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.aivp-badge {
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	line-height: 1.5;
	color: var(--a-soft, #C9C5BD);
	border: 1px solid var(--a-line, #2A2E35);
	border-radius: 999px;
	padding: 3px 12px;
	white-space: nowrap;
}
.aivp-badge--mine {
	color: var(--a-mine, #9CC3F5);
	border-color: var(--a-mine-line, #3B5470);
	font-weight: 600;
}
.aivp-badge--plain { border-style: dashed; }
.aivp-player .aivp-badge, .aivp-ranked .aivp-badge { font-size: 12px; padding: 1px 9px; }

/* ---------- Player basics ---------- */
.aivp-play {
	--aivp-btn: 44px;
	box-sizing: border-box;
	width: var(--aivp-btn);
	height: var(--aivp-btn);
	flex: none;
	border-radius: 999px;
	border: none;
	background: var(--a-line);
	color: var(--a-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background-color .15s ease, transform .1s ease;
}
.aivp-play:hover:not([disabled]) { background: var(--a-line-strong); }
.aivp-play:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 3px; }
.aivp-play[disabled] { cursor: not-allowed; opacity: .55; }
.aivp-play .aivp-i-pause { display: none; }
.is-playing .aivp-play { background: var(--a-accent); color: var(--a-ink); }
.is-playing .aivp-play .aivp-i-play { display: none; }
.is-playing .aivp-play .aivp-i-pause { display: block; }
/* Ranked list and big player use the accent button at rest, as in the mockup. */
.aivp-ranked .aivp-play:not([disabled]),
.aivp-player--big .aivp-play:not([disabled]) { background: var(--a-accent); color: var(--a-ink); }
.aivp-ranked .aivp-play:not([disabled]):hover,
.aivp-player--big .aivp-play:not([disabled]):hover { background: var(--a-accent-hover); }

.aivp-wave { display: flex; align-items: center; gap: 2px; height: 24px; overflow: hidden; }
.aivp-wave i { display: block; flex: none; width: 3px; border-radius: 2px; background: var(--a-line-strong); }
.aivp-wave i.is-played { background: var(--a-accent); }

.aivp-time, .aivp-elapsed { font-family: var(--a-mono); font-size: 12px; color: var(--a-muted); flex: none; font-variant-numeric: tabular-nums; }

.aivp-player__name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aivp-name { font-weight: 600; font-size: 15px; }

/* Compact row (comparison card, single player) */
.aivp-player--row {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--a-raised);
	border-radius: 14px;
	padding: 14px 16px;
}
.aivp-player--row .aivp-player__body { flex: 1 1 auto; min-width: 0; }
.aivp-player--row .aivp-wave { margin-top: 6px; }

/* ---------- Same-script comparison card ---------- */
.aivp-compare {
	background: var(--a-surface);
	border: 1px solid var(--a-line);
	border-radius: 20px;
	padding: 28px;
}
.aivp-compare__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.aivp-compare__title { font-family: var(--a-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
.aivp-compare__label { font-family: var(--a-mono); font-size: 12px; color: var(--a-muted); }
.aivp-compare__rows { display: flex; flex-direction: column; gap: 12px; }
.aivp-compare__foot { font-size: 13px; color: var(--a-muted); margin: 18px 0 0; }

/* ---------- Ranked list ---------- */
.aivp-ranked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aivp-ranked__row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px;
	background: var(--a-surface);
	border: 1px solid var(--a-line);
	border-radius: 16px;
	padding: 18px 22px;
	margin: 0;
}
.aivp-ranked__row.is-mine { border-color: var(--a-mine-line); }
.aivp-rank { font-family: var(--a-mono); font-size: 22px; color: var(--a-faint); width: 36px; flex: none; }
.aivp-ranked__info { flex: 1 1 240px; min-width: 0; }
.aivp-ranked__name { font-family: var(--a-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; margin: 0; }
.aivp-ranked__name a { color: var(--a-text); text-decoration: none; }
.aivp-ranked__name a:hover { color: var(--a-accent-hover); }
.aivp-ranked__tags { color: var(--a-muted); font-size: 14px; }
.aivp-ranked .aivp-wave { flex: 1 1 260px; height: 32px; }
.aivp-ranked__more { font-weight: 600; font-size: 15px; padding: 10px 4px; min-height: 44px; display: inline-flex; align-items: center; color: var(--a-text); text-decoration: none; }
.aivp-ranked__more:hover { color: var(--a-accent-hover); }
@media (max-width: 600px) {
	.aivp-ranked__row { gap: 14px; padding: 16px; }
	.aivp-rank { width: auto; font-size: 18px; }
	.aivp-ranked__info { flex: 1 1 0; }
	.aivp-ranked .aivp-wave { order: 5; flex-basis: 100%; height: 24px; }
	.aivp-ranked__more { order: 6; padding-block: 0; }
}

/* ---------- Sample tabs (voice page) ---------- */
.aivp-samples {
	background: var(--a-surface);
	border: 1px solid var(--a-line);
	border-radius: 20px;
	padding: 28px;
	margin-block: 0 56px;
}
.aivp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.aivp-tab {
	box-sizing: border-box;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 10px 18px;
	min-height: 44px;
	border-radius: 999px;
	cursor: pointer;
	border: 1px solid var(--a-line-strong);
	background: transparent;
	color: var(--a-soft);
}
.aivp-tab:hover { color: var(--a-text); border-color: var(--a-muted); }
.aivp-tab[aria-selected="true"] { background: var(--a-text); border-color: var(--a-text); color: var(--a-bg); }
.aivp-tab:focus-visible, .aivp-tabpanel:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 3px; }
.aivp-tabpanel:focus-visible { border-radius: 12px; }

.aivp-player--big { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.aivp-player--big .aivp-player__body { flex: 1 1 320px; min-width: 0; }
.aivp-player--big .aivp-wave { height: 56px; gap: 3px; }
.aivp-player--big .aivp-wave i { flex: 1 1 0; width: auto; max-width: 4px; min-width: 2px; }
.aivp-player__times { display: flex; justify-content: space-between; margin-top: 8px; }
.aivp-script { font-size: 15px; color: var(--a-soft); margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--a-line); }
.aivp-script__label { font-family: var(--a-mono); font-size: 12px; color: var(--a-muted); margin-right: 10px; }

/* ---------- Good fit / look elsewhere ---------- */
.aivp-fit { margin-block: 0 56px; }
.aivp-fit h2 { margin: 0 0 20px; }
.aivp-fit__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.aivp-fit__card { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 16px; padding: 24px; }
.aivp-fit__label { font-family: var(--a-mono); font-weight: 400; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 12px; }
.aivp-fit__label--good { color: var(--wp--preset--color--good, #7FD1B9); }
.aivp-fit__label--caution { color: var(--wp--preset--color--caution, #F0B4C8); }
.aivp-fit__card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: #D9D5CE; }

/* ---------- Sidebar boxes ---------- */
.aivp-box { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 20px; padding: 24px; }
.aivp-box__title { font-family: var(--a-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 16px; }
.aivp-notes { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.aivp-notes dt { color: var(--a-muted); }
.aivp-notes dd { margin: 0; }

.aivp-btn {
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	min-height: 48px;
	padding: 12px 16px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
	margin-bottom: 10px;
}
.aivp-btn--primary { background: var(--a-accent); color: var(--a-ink); }
.aivp-btn--primary:hover { background: var(--a-accent-hover); color: var(--a-ink); }
.aivp-btn--secondary { border: 1px solid var(--a-line-strong); color: var(--a-text); }
.aivp-btn--secondary:hover { border-color: var(--a-accent-hover); color: var(--a-accent-hover); }
.aivp-btn:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 3px; }
.aivp-cta__note { font-size: 12px; color: var(--a-muted); margin: 12px 0 0; line-height: 1.5; }

.aivp-related { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.aivp-related li { margin: 0; }
.aivp-related a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--a-line); color: var(--a-text); text-decoration: none; }
.aivp-related a:hover { color: var(--a-accent-hover); }
.aivp-related a span:last-child { color: var(--a-muted); }

/* ---------- Disclosure box (when the theme isn't providing it) ---------- */
.aivp-disclosure-box { margin-block: 0 32px; }

/* ---------- Editor-only notes ---------- */
.aivp-editor-note {
	border: 1px dashed #6E6A63;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 14px;
	color: #A8A49C;
	background: rgba(255, 255, 255, 0.02);
}

/* ---------- Estimator ---------- */
.aivp-estimator textarea, .aivp-estimator select, .aivp-estimator input {
	box-sizing: border-box;
	width: 100%;
	font: inherit;
	color: var(--a-text);
	background: var(--a-raised);
	border: 1px solid var(--a-line-strong);
	border-radius: 12px;
	padding: 12px 14px;
	min-height: 44px;
}
.aivp-estimator textarea { resize: vertical; line-height: 1.6; }
.aivp-estimator :is(textarea, select, input):focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; }
.aivp-est__label { display: block; font-weight: 600; margin-bottom: 8px; }
.aivp-est__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
.aivp-est__opts label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--a-muted); }
.aivp-est__out { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 0; }
.aivp-est__out > div { background: var(--a-raised); border-radius: 12px; padding: 12px 14px; }
.aivp-est__out dt { font-family: var(--a-mono); font-size: 12px; color: var(--a-muted); text-transform: uppercase; letter-spacing: .04em; }
.aivp-est__out dd { margin: 4px 0 0; font-family: var(--a-display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }

.aivp-ranked-empty { color: var(--wp--preset--color--text-soft, #C9C5BD); background: var(--wp--preset--color--surface, #16181C); border: 1px dashed var(--wp--preset--color--line-strong, #3A3F47); border-radius: 16px; padding: 22px; margin: 0; }
.aivp-ranked-empty a { color: var(--wp--preset--color--accent, #A98BFF); font-weight: 600; white-space: nowrap; }
