:root {
	--ink: #101820;
	--ink-soft: #4a5560;
	--line: #dde3e9;
	--bg: #ffffff;
	--bg-alt: #f4f6f8;
	--accent: #f26722;
	--accent-dark: #d3541a;
	--p1: #c62828;
	--p2: #ef6c00;
	--p3: #2e7d32;
	--radius: 12px;
	--composer-h: 76px;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Tamil", "Noto Sans Devanagari", Arial, sans-serif;
	overflow-x: hidden;
}

body {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ink);
	color: #fff;
	padding: 10px 14px;
	z-index: 50;
}

.skip:focus { left: 8px; top: 8px; }

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: max(10px, env(safe-area-inset-top)) 16px 10px;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand__mark { color: var(--accent); font-size: 20px; }
.brand__name { font-weight: 700; letter-spacing: .06em; font-size: 15px; }

.topbar__close {
	min-width: 44px;
	min-height: 44px;
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--ink-soft);
}

.shell {
	flex: 1 1 auto;
	padding: 18px 16px calc(var(--composer-h) + 64px);
	max-width: 780px;
	width: 100%;
	margin: 0 auto;
}

.intro__title {
	margin: 4px 0 8px;
	font-size: 25px;
	line-height: 1.25;
	font-weight: 700;
}

.intro__promise {
	margin: 0 0 18px;
	color: var(--ink-soft);
	font-size: 16px;
}

.examples {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	margin: 0 0 18px;
}

.example {
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg-alt);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
	cursor: pointer;
}

.example:hover, .example:focus-visible {
	border-color: var(--accent);
	color: var(--accent-dark);
}

.privacy {
	margin: 0;
	padding: 12px 14px;
	background: var(--bg-alt);
	border-radius: var(--radius);
	color: var(--ink-soft);
	font-size: 13.5px;
}

.thread { display: grid; gap: 14px; margin-top: 18px; }

.msg {
	border-radius: var(--radius);
	padding: 13px 15px;
	font-size: 15.5px;
}

.msg--you {
	background: var(--ink);
	color: #fff;
	justify-self: end;
	max-width: 88%;
	white-space: pre-wrap;
	word-break: break-word;
}

.msg--star {
	background: var(--bg-alt);
	border: 1px solid var(--line);
}

.msg--safety {
	background: #fdecea;
	border: 1px solid #f5c6c2;
}

.msg h3 {
	margin: 14px 0 6px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ink-soft);
}

.msg p { margin: 0 0 10px; }
.msg p:last-child { margin-bottom: 0; }

.msg ul { margin: 0; padding-left: 20px; }
.msg li { margin-bottom: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }

.chip {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 5px 9px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 13px;
	word-break: break-all;
}

.badge {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	color: #fff;
}

.badge--p1 { background: var(--p1); }
.badge--p2 { background: var(--p2); }
.badge--p3 { background: var(--p3); }

.teams { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }

.team {
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 6px;
	padding: 5px 10px;
	font-size: 13px;
}

.team--active { border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }

.note {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed var(--line);
	color: var(--ink-soft);
	font-size: 13px;
}

.consent { margin-top: 12px; display: grid; gap: 9px; }

.consent input[type="text"],
.consent input[type="tel"],
.consent input[type="email"] {
	font: inherit;
	font-size: 16px;
	min-height: 48px;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	width: 100%;
}

.consent label { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft); }
.consent label input { margin-top: 3px; min-width: 18px; min-height: 18px; }

.handoff {
	border-color: rgba(242, 103, 34, .45);
}

.handoff > h3:first-child {
	margin-top: 0;
	color: var(--accent-dark);
}

.handoff__fields {
	display: grid;
	gap: 9px;
}

.handoff__fields[hidden] {
	display: none;
}

.handoff__submit {
	width: 100%;
}

.primarybtn, .ghostbtn {
	min-height: 48px;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	padding: 12px 18px;
}

.primarybtn { border: 0; background: var(--accent); color: #fff; }
.primarybtn:disabled { opacity: .45; cursor: not-allowed; }
.ghostbtn { border: 1px solid var(--line); background: #fff; color: var(--ink); }

.dock {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	background: var(--bg);
	border-top: 1px solid var(--line);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

.composer {
	padding: 10px 12px 4px;
}

.composer__row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 780px;
	margin: 0 auto;
}

.composer textarea {
	flex: 1 1 auto;
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 22px;
	resize: none;
	max-height: 132px;
	min-height: 48px;
}

.composer textarea:focus-visible,
.example:focus-visible,
.iconbtn:focus-visible,
.sendbtn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.iconbtn {
	flex: 0 0 auto;
	min-width: 44px;
	width: 44px;
	height: 44px;
	min-height: 44px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: #fff;
	font-size: 18px;
	cursor: pointer;
}

.iconbtn[aria-pressed="true"] { background: var(--p1); border-color: var(--p1); }

.sendbtn {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.sendbtn:disabled { opacity: .5; cursor: not-allowed; }

.composer__hint {
	max-width: 780px;
	margin: 7px auto 0;
	font-size: 13px;
	color: var(--ink-soft);
	min-height: 1em;
}

.composer__hint--error { color: var(--p1); }

.fallbacks {
	display: flex;
	gap: 14px;
	justify-content: center;
	flex-wrap: wrap;
	padding: 2px 12px 8px;
}

.fallback {
	color: var(--ink-soft);
	font-size: 13px;
	text-decoration: underline;
	min-height: 24px;
}

.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(8, 18, 32, .55); }

.sheet__panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: #fff;
	border-radius: 16px 16px 0 0;
	padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
	max-height: 82vh;
	overflow: auto;
	display: grid;
	gap: 13px;
}

.sheet__panel h2 { margin: 0; font-size: 18px; }
.sheet__panel a { color: var(--accent-dark); font-weight: 600; }

[dir="rtl"] .msg--you { justify-self: start; }

@media (min-width: 720px) {
	.intro__title { font-size: 30px; }
	.sheet__panel {
		left: 50%;
		right: auto;
		bottom: 50%;
		transform: translate(-50%, 50%);
		width: min(520px, calc(100vw - 40px));
		border-radius: 16px;
	}
}
