/* Brand palette, derived from the exact swatch supplied (#5ab0f9) —
   scoped to .tna-widget so these custom properties never leak into the
   surrounding theme. Every accent color below reads from these, so a
   future brand-color change is a one-place edit. */
.tna-widget {
	--tna-brand: #5ab0f9;
	--tna-brand-deep: #0d89f2;
	--tna-brand-dark: #0c7edf;
	--tna-brand-text: #14578f;
	--tna-brand-tint: #e7f3fd;
	--tna-brand-border: #a8cff0;
	--tna-gradient: linear-gradient(135deg, var(--tna-brand), var(--tna-brand-deep));

	max-width: 760px;
	margin: 0 auto;
	font-family: inherit;
	color: #1f2937;
	padding: 18px;
	border-radius: 28px;
	background: linear-gradient(135deg, #eaf5ff 0%, #dbecff 100%);
	/* Some themes/page builders set a smaller base font or a text-size
	   adjustment on mobile that shrinks everything inside this widget
	   well below the sizes set explicitly below — pin it back to 100%
	   so those explicit sizes are what actually renders. */
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.tna-widget .tna-loading {
	text-align: center;
	padding: 40px 0;
	color: #6b7280;
}

.tna-panel {
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 10px 30px rgba(13, 137, 242, 0.10), 0 1px 2px rgba(30, 41, 59, 0.04);
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	max-height: 78vh;
}

/* ---- top value-prop banner -------------------------------------------- */

.tna-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid #eef1f5;
}

.tna-banner-icon {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tna-gradient);
	color: #ffffff;
}

.tna-banner-icon svg {
	width: 16px;
	height: 16px;
}

.tna-banner-text {
	font-size: 12.5px;
	color: #4b5563;
	line-height: 1.4;
}

/* ---- persistent stage/time strip, visible from the first screen ------- */

.tna-stage-strip {
	padding-bottom: 12px;
	margin-bottom: 12px;
}

.tna-stage-total {
	font-size: 11.5px;
	color: #9ca3af;
	margin-bottom: 7px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.tna-stage-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tna-stage {
	font-size: 11px;
	padding: 5px 10px;
	border-radius: 999px;
	background: #f3f4f6;
	color: #9ca3af;
	white-space: nowrap;
}

.tna-stage-active {
	background: var(--tna-gradient);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(13, 137, 242, 0.35);
}

.tna-stage-done {
	background: var(--tna-brand-tint);
	color: var(--tna-brand-text);
}

/* ---- chat thread -------------------------------------------------------- */

.tna-thread {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 4px 2px;
	margin-bottom: 14px;
}

.tna-bubble {
	max-width: 85%;
	padding: 11px 15px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
}

.tna-bubble-bot {
	align-self: flex-start;
	background: #f5f6fa;
	color: #1f2937;
	border-bottom-left-radius: 4px;
}

.tna-bubble-user {
	align-self: flex-end;
	background: var(--tna-gradient);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.tna-bubble-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/* ---- "thinking" / "drafting" indicator, shown while waiting on the AI - */

.tna-bubble-loading {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tna-typing-dots {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
}

.tna-typing-dots .tna-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--tna-brand-deep);
	opacity: 0.35;
	animation: tna-dot-bounce 1.2s infinite ease-in-out;
}

.tna-typing-dots .tna-dot:nth-child(2) {
	animation-delay: 0.15s;
}

.tna-typing-dots .tna-dot:nth-child(3) {
	animation-delay: 0.3s;
}

.tna-loading-text {
	font-size: 13px;
	color: #4b5563;
}

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

@media (prefers-reduced-motion: reduce) {
	.tna-typing-dots .tna-dot {
		animation: none;
		opacity: 0.7;
	}
}

/* ---- inline icons ------------------------------------------------------- */

.tna-icon {
	display: inline-flex;
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
}

.tna-icon svg {
	width: 100%;
	height: 100%;
}

/* ---- chips, pinned above the chat input, not per-message --------------- */

.tna-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
	margin-bottom: 12px;
}

.tna-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid #e5e7eb;
	background: #fafbfc;
	border-radius: 999px;
	padding: 9px 15px;
	cursor: pointer;
	font-size: 13px;
	color: #374151;
}

.tna-chip .tna-icon {
	color: #9ca3af;
}

.tna-chip:hover {
	border-color: var(--tna-brand-border);
	background: var(--tna-brand-tint);
}

.tna-chip.tna-active {
	background: var(--tna-brand-tint);
	border-color: var(--tna-brand);
	color: var(--tna-brand-text);
	font-weight: 600;
}

.tna-chip.tna-active .tna-icon {
	color: var(--tna-brand-deep);
}

.tna-hint {
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 8px;
}

.tna-zero-spam {
	/* Now sits below the input row (moved at Natasha's request) instead of
	   snug under the consent line above it, so it needs its own top
	   spacing rather than the negative margin that used to pull it up. */
	margin: 10px 0 0;
	color: #4a8a5c;
}

/* ---- controls (bottom of thread, changes per step) ---------------------- */

.tna-control {
	border-top: 1px solid #eef1f5;
	padding-top: 14px;
}

.tna-input-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: nowrap;
	background: #f7f8fb;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	padding: 6px 6px 6px 12px;
}

.tna-input-avatar {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tna-gradient);
	color: #ffffff;
	cursor: pointer;
	animation: tna-avatar-breathe 2.6s infinite ease-in-out;
}

.tna-input-avatar:hover,
.tna-input-avatar:focus-visible {
	animation-play-state: paused;
	box-shadow: 0 0 0 4px rgba(13, 137, 242, 0.18);
	outline: none;
}

.tna-input-avatar .tna-icon {
	width: 14px;
	height: 14px;
}

@keyframes tna-avatar-breathe {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(13, 137, 242, 0.35);
		transform: scale(1);
	}
	50% {
		box-shadow: 0 0 0 5px rgba(13, 137, 242, 0);
		transform: scale(1.06);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tna-input-avatar {
		animation: none;
	}
}

.tna-chat-input {
	flex: 1;
	min-width: 100px;
	border: none;
	background: transparent;
	padding: 8px 4px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
}

.tna-send-btn {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tna-gradient);
	color: #ffffff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(13, 137, 242, 0.4);
}

.tna-send-btn .tna-icon {
	width: 15px;
	height: 15px;
}

.tna-send-btn:disabled {
	opacity: 0.4;
	cursor: default;
	box-shadow: none;
}

.tna-checkbox-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	color: #4b5563;
	margin: 6px 0 10px;
	line-height: 1.4;
}

.tna-btn {
	border: 1px solid #d1d5db;
	background: #ffffff;
	border-radius: 999px;
	padding: 10px 18px;
	font-size: 14px;
	cursor: pointer;
}

.tna-btn-primary {
	background: var(--tna-gradient);
	color: #ffffff;
	border-color: transparent;
	box-shadow: 0 2px 8px rgba(13, 137, 242, 0.35);
}

.tna-btn:disabled {
	opacity: 0.5;
	cursor: default;
	box-shadow: none;
}

/* ---- draft card, appears inline in the thread ---------------------------- */

.tna-card {
	border: 1px solid #eef1f5;
	border-radius: 16px;
	padding: 16px;
	background: #fbfcfe;
	align-self: stretch;
}

.tna-card h4 {
	margin: 0 0 8px;
	font-size: 14px;
}

.tna-draft-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.tna-draft-card-header h4 {
	margin: 0;
}

.tna-draft-expand-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--tna-brand-border);
	background: var(--tna-brand-tint);
	color: var(--tna-brand-text);
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.tna-draft-expand-btn:hover {
	border-color: var(--tna-brand);
}

.tna-draft-expand-btn .tna-icon {
	width: 13px;
	height: 13px;
}

.tna-draft-text {
	white-space: pre-wrap;
	background: #ffffff;
	border: 1px solid #eef1f5;
	border-radius: 10px;
	padding: 14px;
	font-size: 12.5px;
	max-height: 340px;
	overflow-y: auto;
}

/* ---- full-screen draft view, appended to <body>, outside .tna-panel ----- */

body.tna-modal-open {
	overflow: hidden;
}

.tna-draft-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 999999;
}

.tna-draft-modal {
	background: #ffffff;
	border-radius: 16px;
	width: 100%;
	max-width: 760px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
}

.tna-draft-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid #eef1f5;
	flex: 0 0 auto;
}

.tna-draft-modal-header h4 {
	margin: 0;
	font-size: 16px;
}

.tna-draft-modal-close {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #e5e7eb;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #4b5563;
}

.tna-draft-modal-close:hover {
	background: #f7f8fb;
}

.tna-draft-modal-close .tna-icon {
	width: 15px;
	height: 15px;
}

.tna-draft-modal-text {
	white-space: pre-wrap;
	margin: 0;
	padding: 22px 24px;
	font-size: 14.5px;
	line-height: 1.6;
	overflow-y: auto;
	flex: 1 1 auto;
}

@media (max-width: 600px) {
	.tna-draft-modal-overlay {
		padding: 0;
	}

	.tna-draft-modal {
		max-width: none;
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.tna-draft-modal-text {
		font-size: 14px;
		padding: 16px 18px;
	}
}

.tna-missing-info {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	padding: 10px 14px;
	margin: 12px 0;
	font-size: 12.5px;
}

.tna-disclaimer {
	font-size: 11px;
	color: #6b7280;
	border-top: 1px solid #eef1f5;
	padding-top: 10px;
	margin-top: 12px;
}

/* ---- evidence upload ------------------------------------------------------- */

.tna-file-list {
	list-style: none;
	padding: 0;
	margin: 10px 0;
	font-size: 13px;
}

/* ---- plans ------------------------------------------------------------------ */

.tna-plans {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	align-items: stretch;
}

.tna-plan-card {
	flex: 1;
	min-width: 190px;
	border: 1px solid #eef1f5;
	border-radius: 16px;
	padding: 18px 16px;
	text-align: center;
	background: #fbfcfe;
	/* Equal-height cards with the button pinned to the bottom of each,
	   regardless of how many lines the description above it wraps to -
	   otherwise a short description (e.g. "Plus") left its button
	   floating well above the other cards' buttons. */
	display: flex;
	flex-direction: column;
}

.tna-plan-card p {
	flex: 1;
	margin: 0 0 16px;
}

.tna-plan-card .tna-btn {
	margin-top: auto;
}

.tna-plan-price {
	font-size: 21px;
	font-weight: 700;
	margin: 6px 0 2px;
	background: var(--tna-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.tna-plan-gst-line {
	font-size: 12.5px;
	color: #7a8598;
	margin: 0 0 10px;
}

@media (max-width: 600px) {
	.tna-widget {
		padding: 10px;
		border-radius: 20px;
	}
	.tna-panel {
		padding: 14px;
		max-height: 88vh;
	}
	.tna-banner {
		gap: 8px;
	}
	.tna-banner-text {
		font-size: 13px;
		line-height: 1.45;
	}
	.tna-stage-total {
		font-size: 11.5px;
	}
	.tna-stage {
		font-size: 12px;
		padding: 6px 11px;
	}
	.tna-bubble {
		max-width: 92%;
		font-size: 14.5px;
		padding: 12px 14px;
	}
	.tna-chips {
		gap: 9px;
	}
	.tna-chip {
		font-size: 13.5px;
		padding: 10px 14px;
	}
	.tna-hint {
		font-size: 12.5px;
	}
	/* 16px prevents iOS Safari from auto-zooming the whole page when this
	   input receives focus — anything smaller than 16px triggers it. */
	.tna-chat-input {
		font-size: 16px;
	}
	.tna-input-row {
		padding: 5px 5px 5px 12px;
	}
	.tna-send-btn {
		width: 38px;
		height: 38px;
	}
	.tna-input-avatar {
		width: 28px;
		height: 28px;
	}
	.tna-btn {
		font-size: 14.5px;
		padding: 11px 16px;
	}
	.tna-checkbox-row {
		font-size: 12.5px;
	}
	.tna-card {
		padding: 14px;
	}
	.tna-draft-text {
		font-size: 13px;
		padding: 12px;
	}
	.tna-missing-info,
	.tna-disclaimer {
		font-size: 12.5px;
	}
	.tna-plans {
		flex-direction: column;
	}
	.tna-plan-card {
		min-width: 0;
		padding: 16px 14px;
	}
	.tna-plan-price {
		font-size: 22px;
	}
	.tna-file-list {
		font-size: 13.5px;
	}
}

@media (max-width: 360px) {
	.tna-widget {
		padding: 8px;
	}
	.tna-panel {
		padding: 12px;
	}
	.tna-bubble {
		font-size: 14px;
		padding: 10px 12px;
	}
}
