/* NMA Chat — our own widget. Self-contained: no web fonts, no external assets. */
#nma-chat,
#nma-chat * { box-sizing: border-box; }

#nma-chat {
	--nc-accent-1: #00b7d7;
	--nc-accent-2: #00d294;
	--nc-panel: #0a0e14;
	--nc-panel-2: #05080d;
	--nc-text: #e7eef7;
	--nc-dim: #8892a0;
	--nc-line: rgba(255, 255, 255, .08);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	font-family: inherit;
	color: var(--nc-text);
}

/* Launcher */
#nma-chat-launch {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--nc-accent-1), var(--nc-accent-2));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
	transition: transform .18s ease, box-shadow .18s ease;
}
#nma-chat-launch:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
#nma-chat-launch svg { width: 27px; height: 27px; fill: currentColor; display: block; }
/* SVGs ignore the HTML `hidden` attribute, so icon state is driven by CSS on
   the launcher's data-open flag — otherwise both icons render at once. */
#nma-chat-launch[data-open="0"] #nma-chat-icon-close { display: none; }
#nma-chat-launch[data-open="1"] #nma-chat-icon-open { display: none; }

#nma-chat-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #ff4d4f;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

/* Panel */
#nma-chat-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	display: flex;
	flex-direction: column;
	width: 340px;
	max-width: calc(100vw - 40px);
	max-height: min(560px, calc(100vh - 120px));
	background: var(--nc-panel);
	border: 1px solid var(--nc-line);
	border-radius: 16px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
	overflow: hidden;
}
#nma-chat-panel[hidden] { display: none; }

#nma-chat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px 13px;
	background: var(--nc-panel-2);
	border-bottom: 1px solid var(--nc-line);
}
#nma-chat-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: linear-gradient(135deg, var(--nc-accent-1), var(--nc-accent-2));
	color: #04121a;
	font-weight: 800;
	font-size: 15px;
}
#nma-chat-id { display: flex; flex-direction: column; line-height: 1.25; }
#nma-chat-title { font-size: 14.5px; }
#nma-chat-sub { font-size: 12px; color: var(--nc-dim); }
#nma-chat-min {
	margin-left: auto;
	background: none;
	border: 0;
	color: var(--nc-dim);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}
#nma-chat-min:hover { color: var(--nc-text); }

/* Log */
#nma-chat-log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 140px;
}
.nma-chat-note {
	font-size: 12.5px;
	color: var(--nc-dim);
	line-height: 1.5;
}
.nma-b {
	max-width: 86%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 13.5px;
	line-height: 1.5;
	word-wrap: break-word;
	white-space: pre-wrap;
}
.nma-b.visitor {
	align-self: flex-end;
	background: linear-gradient(135deg, var(--nc-accent-1), var(--nc-accent-2));
	color: #04121a;
	font-weight: 500;
	border-bottom-right-radius: 4px;
}
.nma-b.agent {
	align-self: flex-start;
	background: rgba(255, 255, 255, .06);
	border: 1px solid var(--nc-line);
	border-bottom-left-radius: 4px;
}
.nma-b.agent.auto { border-color: rgba(0, 210, 148, .35); }
.nma-b time { display: block; margin-top: 4px; font-size: 10.5px; opacity: .6; }

/* Intake card — details before the conversation, like a support centre */
#nma-chat-intake {
	padding: 14px;
	border-top: 1px solid var(--nc-line);
	background: var(--nc-panel-2);
}
#nma-chat-intake[hidden] { display: none; }
.nc-intake-hello {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--nc-text);
}
.nc-step { display: block; }
.nc-step[hidden] { display: none; }
.nc-step label {
	display: block;
	font-size: 12px;
	color: var(--nc-dim);
	margin-bottom: 5px;
}
.nc-step input {
	width: 100%;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--nc-line);
	border-radius: 8px;
	color: var(--nc-text);
	font: inherit;
	font-size: 13px;
	padding: 9px 11px;
}
.nc-step input:focus { outline: 2px solid var(--nc-accent-1); }
.nc-step input.nc-bad { border-color: #ff6b6b; }
.nc-step-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 9px;
}
.nc-steps { font-size: 11.5px; color: var(--nc-dim); }
.nc-next {
	background: linear-gradient(135deg, var(--nc-accent-1), var(--nc-accent-2));
	border: 0;
	border-radius: 8px;
	color: #04121a;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 16px;
	cursor: pointer;
}
.nc-skip {
	margin-top: 12px;
	background: none;
	border: 0;
	color: var(--nc-dim);
	font: inherit;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}
.nc-skip:hover { color: var(--nc-text); }

/* Suggested openers */
#nma-chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 12px 10px;
}
#nma-chat-chips[hidden] { display: none; }
.nc-chip {
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--nc-line);
	border-radius: 999px;
	color: var(--nc-text);
	font: inherit;
	font-size: 12.5px;
	line-height: 1.3;
	padding: 7px 11px;
	cursor: pointer;
	text-align: left;
}
.nc-chip:hover,
.nc-chip:focus-visible {
	border-color: var(--nc-accent-1);
	color: #fff;
}

/* Composer */
#nma-chat-compose { border-top: 1px solid var(--nc-line); padding: 10px 12px 12px; background: var(--nc-panel-2); }
#nma-chat-identity { display: flex; gap: 8px; margin-bottom: 8px; }
#nma-chat-identity[hidden] { display: none; }
#nma-chat-identity input {
	flex: 1 1 0;
	min-width: 0;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--nc-line);
	border-radius: 8px;
	color: var(--nc-text);
	font: inherit;
	font-size: 13px;
	padding: 8px 10px;
}
#nma-chat-row { display: flex; align-items: flex-end; gap: 8px; }
#nma-chat-input {
	flex: 1 1 auto;
	min-height: 40px;
	max-height: 120px;
	resize: none;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--nc-line);
	border-radius: 10px;
	color: var(--nc-text);
	font: inherit;
	font-size: 13.5px;
	line-height: 1.45;
	padding: 10px 12px;
}
#nma-chat-input:focus,
#nma-chat-identity input:focus { outline: 2px solid var(--nc-accent-1); outline-offset: 0; }
#nma-chat-send {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--nc-accent-1), var(--nc-accent-2));
	color: #04121a;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
#nma-chat-send svg { width: 19px; height: 19px; fill: currentColor; }
#nma-chat-send[disabled] { opacity: .5; cursor: default; }
#nma-chat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#nma-chat-foot { margin: 9px 0 0; font-size: 11.5px; color: var(--nc-dim); line-height: 1.5; }
#nma-chat-foot a { color: var(--nc-accent-1); }

@media (max-width: 480px) {
	#nma-chat { right: 14px; bottom: 14px; }
	#nma-chat-launch { width: 52px; height: 52px; }
	#nma-chat-panel { bottom: 64px; max-height: calc(100vh - 110px); }
}

@media (prefers-reduced-motion: reduce) {
	#nma-chat-launch { transition: none; }
}
