/* TimeTogether, AI-Led Interviews: respondent page. Tokens first; the study's accent colour arrives as --ttg-accent. */
.ttg-app {
	--ttg-accent: #1f5f8b;
	--ttg-bg: #f6f5f2;
	--ttg-surface: #ffffff;
	--ttg-fg: #1d1d1b;
	--ttg-muted: #6b6a66;
	--ttg-line: #e3e1db;
	--ttg-bubble-user: var(--ttg-accent);
	--ttg-bubble-user-fg: #ffffff;
	--ttg-bubble-ai: #efede8;
	--ttg-error: #a3321f;
	--ttg-radius: 14px;
	--ttg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--ttg-fg);
	font-family: var(--ttg-font);
	font-size: 17px;
	line-height: 1.55;
	max-width: 720px;
	margin: 0 auto;
	padding-inline: 16px;
	box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
	.ttg-app {
		--ttg-bg: #15171a;
		--ttg-surface: #1f2226;
		--ttg-fg: #ecebe7;
		--ttg-muted: #a3a29c;
		--ttg-line: #32363b;
		--ttg-bubble-ai: #2a2e33;
		--ttg-error: #ff8a70;
	}
}
.ttg-app *, .ttg-app *::before, .ttg-app *::after { box-sizing: border-box; }
.ttg-app [hidden] { display: none !important; }

/* Standalone page chrome */
body.ttg-standalone {
	margin: 0;
	background: #f6f5f2;
	min-height: 100vh;
}
@media (prefers-color-scheme: dark) {
	body.ttg-standalone { background: #15171a; }
}
.ttg-page {
	padding-block: clamp(24px, 6vh, 64px) 32px;
}
.ttg-footer {
	text-align: center;
	color: #6b6a66;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	margin-top: 32px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Cards */
.ttg-card {
	background: var(--ttg-surface);
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	padding: clamp(20px, 4vw, 36px);
}
.ttg-eyebrow {
	margin: 0 0 6px;
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ttg-muted);
}
.ttg-title {
	margin: 0 0 16px;
	font-size: clamp(26px, 4.5vw, 34px);
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.ttg-title-small { font-size: 24px; }
.ttg-intro-text p { margin: 0 0 12px; }
.ttg-ai-note {
	margin: 18px 0 0;
	padding: 12px 14px;
	border-left: 3px solid var(--ttg-accent);
	background: color-mix(in srgb, var(--ttg-accent) 7%, transparent);
	border-radius: 0 8px 8px 0;
	font-size: 15px;
	color: var(--ttg-fg);
}

/* Start form */
.ttg-start-form { margin-top: 24px; display: grid; gap: 16px; }
.ttg-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ttg-field { display: grid; gap: 6px; font-size: 15px; }
.ttg-field span small { color: var(--ttg-muted); font-weight: normal; }
.ttg-field input, .ttg-composer textarea {
	font: inherit;
	color: var(--ttg-fg);
	background: var(--ttg-surface);
	border: 1px solid var(--ttg-line);
	border-radius: 10px;
	padding: 10px 12px;
	width: 100%;
}
.ttg-field input:focus, .ttg-composer textarea:focus {
	outline: 2px solid var(--ttg-accent);
	outline-offset: 1px;
	border-color: transparent;
}
.ttg-field-code { max-width: 260px; }
.ttg-field-code input { letter-spacing: 0.08em; font-weight: 600; }
.ttg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ttg-consent {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
	align-items: start;
	font-size: 15px;
	color: var(--ttg-fg);
}
.ttg-consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ttg-accent); }
.ttg-button {
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: var(--ttg-accent);
	border: 0;
	border-radius: 999px;
	padding: 12px 26px;
	cursor: pointer;
	justify-self: start;
	transition: filter 120ms ease, transform 120ms ease;
}
.ttg-button:hover { filter: brightness(1.08); }
.ttg-button:active { transform: translateY(1px); }
.ttg-button:disabled { opacity: 0.6; cursor: default; }
.ttg-button.is-busy::after { content: "…"; }
.ttg-button:focus-visible, .ttg-link-button:focus-visible { outline: 2px solid var(--ttg-accent); outline-offset: 3px; }
.ttg-error {
	margin: 0;
	color: var(--ttg-error);
	font-size: 15px;
}

/* Chat */
.ttg-chat {
	background: var(--ttg-surface);
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	display: flex;
	flex-direction: column;
	min-height: min(70vh, 640px);
	overflow: hidden;
}
.ttg-chat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--ttg-line);
}
.ttg-chat-header .ttg-eyebrow { margin: 0; }
.ttg-chat-with { margin: 2px 0 0; font-size: 14px; color: var(--ttg-muted); }
.ttg-link-button {
	font: inherit;
	font-size: 14px;
	color: var(--ttg-muted);
	background: none;
	border: 1px solid var(--ttg-line);
	border-radius: 999px;
	padding: 6px 12px;
	cursor: pointer;
	white-space: nowrap;
}
.ttg-link-button:hover { color: var(--ttg-fg); border-color: var(--ttg-muted); }
.ttg-messages {
	flex: 1;
	padding: 20px 18px 8px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	overflow-y: auto;
}
.ttg-msg { display: flex; flex-direction: column; max-width: 85%; }
.ttg-msg-assistant { align-self: flex-start; }
.ttg-msg-user { align-self: flex-end; }
.ttg-msg-who { font-size: 12px; color: var(--ttg-muted); margin: 0 0 4px 4px; }
.ttg-bubble {
	padding: 11px 15px;
	border-radius: 16px;
	background: var(--ttg-bubble-ai);
	animation: ttg-in 200ms ease-out;
}
.ttg-msg-assistant .ttg-bubble { border-bottom-left-radius: 6px; }
.ttg-msg-user .ttg-bubble {
	background: var(--ttg-bubble-user);
	color: var(--ttg-bubble-user-fg);
	border-bottom-right-radius: 6px;
}
.ttg-bubble p { margin: 0; }
.ttg-bubble p + p { margin-top: 8px; }
@keyframes ttg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ttg-typing .ttg-bubble { display: inline-flex; gap: 5px; padding: 14px 16px; }
.ttg-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--ttg-muted);
	animation: ttg-dot 1.2s infinite ease-in-out;
}
.ttg-typing span:nth-child(2) { animation-delay: 0.15s; }
.ttg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ttg-dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ttg-composer {
	display: flex;
	gap: 10px;
	align-items: flex-end;
	padding: 12px 18px 6px;
	border-top: 1px solid var(--ttg-line);
}
.ttg-composer textarea { resize: none; max-height: 220px; line-height: 1.45; }
.ttg-send {
	padding: 0;
	width: 44px; height: 44px;
	flex: 0 0 44px;
	display: inline-grid; place-items: center;
}
.ttg-composer-error { padding: 6px 18px 0; }
.ttg-hint {
	margin: 0;
	padding: 4px 18px 12px;
	font-size: 12px;
	color: var(--ttg-muted);
}
.ttg-done { margin-top: 16px; }
.ttg-decide {
	margin: 0 18px 16px;
	padding: 14px 16px;
	border: 1px solid var(--ttg-line);
	border-left: 3px solid var(--ttg-accent);
	border-radius: 0 10px 10px 0;
	background: color-mix(in srgb, var(--ttg-accent) 6%, transparent);
}
.ttg-decide-title { margin: 0 0 4px; font-weight: 600; }
.ttg-decide-text { margin: 0 0 12px; font-size: 15px; color: var(--ttg-muted); }
.ttg-decide-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ttg-decide-actions .ttg-button { padding: 10px 18px; font-size: 15px; }
.ttg-button-quiet { background: transparent; color: var(--ttg-fg); border: 1px solid var(--ttg-line); }
.ttg-button-quiet:hover { filter: none; border-color: var(--ttg-muted); }
.ttg-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
	.ttg-bubble, .ttg-typing span { animation: none; }
}
@media (max-width: 480px) {
	.ttg-msg { max-width: 92%; }
	.ttg-hint { display: none; }
}


/* 0.8.0: the finish control and the one-last-step note */
.ttg-finish { font-size: 15px; padding: 8px 15px; white-space: nowrap; }
.ttg-note { text-align: center; font-size: 14px; color: var(--ttg-muted); margin: 10px 0 4px; }
