/* Texto invisible. Scoped under .lti; same palette as the cursive tool. */

.lti {
	--g: #296e47;
	--g-deep: #1d5234;
	--mint: #eef6f1;
	--mint-2: #dcede2;
	--line: #d9e7de;
	--ink: #15241b;
	--muted: #5a6d61;
	--r: 22px;

	--lti-w: 80vw;

	box-sizing: border-box;
	/* Break out of narrow theme columns to the chosen share of the screen, centred. */
	width: min(var(--lti-w), 1600px);
	max-width: none;
	margin: 2rem calc(50% - min(var(--lti-w), 1600px) / 2);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r);
	box-shadow: 0 24px 48px -28px rgba(29, 82, 52, 0.45), 0 2px 6px rgba(29, 82, 52, 0.06);
	color: var(--ink);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}
.lti *, .lti *::before, .lti *::after { box-sizing: border-box; }
.lti p, .lti ul { margin: 0; }
.lti ul { padding: 0; list-style: none; }
.lti li::before, .lti li::marker { content: none; }
.lti [hidden] { display: none !important; }
.lti button {
	-webkit-appearance: none; appearance: none; margin: 0; font: inherit; line-height: 1.2;
	letter-spacing: normal; text-transform: none; box-shadow: none; min-height: 0; cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.lti button:focus { outline: none; }
.lti :focus-visible { outline: 3px solid var(--g); outline-offset: 2px; }
.lti-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ----------------------------------------------------------- copy section */

.lti-copy { padding: 26px 28px 22px; }

.lti .lti-h { margin: 0 0 10px; font-size: 0.95rem; font-weight: 700; color: var(--g-deep); line-height: 1.3; }

.lti-platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.lti .lti-pill {
	padding: 8px 14px; background: var(--mint); border: 1px solid transparent; border-radius: 999px;
	color: var(--g-deep); font-size: 0.9rem; font-weight: 600;
}
.lti .lti-pill:hover { background: var(--mint-2); color: var(--g-deep); }
.lti .lti-pill[aria-pressed="true"] { background: var(--g); color: #fff; }

.lti-stage {
	display: grid;
	justify-items: center;
	gap: 14px;
	margin-top: 20px;
	padding: 24px 20px;
	border-radius: 18px;
	background: var(--mint);
	text-align: center;
}
.lti-option { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* The one visual idea: invisible characters shown as a hatched slot so you can see their width. */
.lti-preview { max-width: 100%; overflow: hidden; }
.lti-slot {
	display: inline-block;
	min-width: 14px;
	height: 48px;
	padding: 0 2px;
	border: 2px dashed var(--g);
	border-radius: 8px;
	background: repeating-linear-gradient(-45deg, rgba(41, 110, 71, 0.16) 0 4px, transparent 4px 9px);
	font-size: 32px;
	line-height: 44px;
	white-space: pre;
	vertical-align: middle;
}

.lti-qty { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.lti-qty-label { margin-right: 4px; font-size: 0.85rem; color: var(--muted); }
.lti .lti-chip {
	min-width: 42px; padding: 7px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
	color: var(--g-deep); font-weight: 700; font-variant-numeric: tabular-nums;
}
.lti .lti-chip:hover { border-color: var(--g); background: #fff; color: var(--g-deep); }
.lti .lti-chip[aria-pressed="true"] { background: var(--g-deep); border-color: var(--g-deep); color: #fff; }
.lti .lti-qty-input {
	width: 88px; height: 36px; margin: 0; padding: 0 10px; background: #fff; border: 1px solid var(--line);
	border-radius: 10px; color: var(--ink); font: inherit; font-weight: 700; text-align: center; box-shadow: none;
}

.lti .lti-main {
	width: min(100%, 420px);
	min-height: 56px;
	padding: 14px 24px;
	background: var(--g);
	border: 0;
	border-radius: 14px;
	color: #fff;
	font-size: 1.1rem;
	font-weight: 800;
	transition: background-color 0.15s ease, transform 0.1s ease;
}
.lti .lti-main:hover { background: var(--g-deep); color: #fff; }
.lti .lti-main:active { transform: scale(0.98); }
.lti .lti-main.is-done { background: var(--g-deep); }

.lti .lti-next {
	padding: 4px 8px; background: none; border: 0; color: var(--g-deep);
	font-size: 0.9rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.lti .lti-next:hover { background: none; color: var(--ink); }

.lti-tips { display: grid; gap: 6px; margin-top: 18px; }
.lti-tips li { position: relative; padding-left: 22px; font-size: 0.92rem; color: var(--ink); }
.lti .lti-tips li::before {
	content: ""; position: absolute; left: 4px; top: 0.6em; width: 8px; height: 8px;
	border-radius: 50%; background: var(--g);
}

.lti-manual { margin-top: 14px; font-size: 0.9rem; }
.lti-manual summary { cursor: pointer; color: var(--g-deep); font-weight: 600; }
.lti-manual p { margin: 8px 0; color: var(--muted); }
.lti-manual-row { display: flex; gap: 8px; }
.lti .lti-manual-text {
	flex: 1; min-width: 0; height: 44px; margin: 0; padding: 8px 12px; resize: none;
	background: repeating-linear-gradient(-45deg, rgba(41, 110, 71, 0.08) 0 4px, transparent 4px 9px);
	border: 1px dashed var(--g); border-radius: 10px; font: inherit; color: var(--ink);
}

/* ------------------------------------------------------------- work tabs */

.lti-work { border-top: 1px solid var(--line); }

.lti-tabs {
	display: flex; gap: 4px; padding: 12px 28px 0; overflow-x: auto; scrollbar-width: none;
	border-bottom: 1px solid var(--line);
}
.lti-tabs::-webkit-scrollbar { display: none; }
.lti .lti-tab {
	flex: none; padding: 10px 14px; background: none; border: 0; border-bottom: 3px solid transparent;
	border-radius: 0; color: var(--muted); font-size: 0.92rem; font-weight: 700; white-space: nowrap;
}
.lti .lti-tab:hover { background: none; color: var(--g-deep); }
.lti .lti-tab[aria-selected="true"] { color: var(--g-deep); border-bottom-color: var(--g); }

.lti-panel { display: grid; gap: 12px; padding: 20px 28px 24px; }

.lti .lti-label { display: block; margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--g-deep); }

.lti .lti-field {
	width: 100%; margin: 0; padding: 12px 14px; background: var(--mint); border: 2px solid var(--line);
	border-radius: 12px; color: var(--ink); font: inherit; font-size: 1.05rem; box-shadow: none;
}
.lti .lti-field:focus { outline: none; background: #fff; border-color: var(--g); box-shadow: 0 0 0 4px rgba(41, 110, 71, 0.14); }
.lti textarea.lti-field { resize: vertical; }

.lti-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lti-row .lti-nick-input { flex: 1 1 220px; }
.lti-opts label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.lti .lti-select-field {
	height: 40px; margin: 0; padding: 0 10px; background: #fff; border: 1px solid var(--line);
	border-radius: 10px; color: var(--ink); font: inherit; font-size: 0.92rem;
}

.lti .lti-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
	padding: 0 16px; background: #fff; border: 1.5px solid var(--g); border-radius: 999px;
	color: var(--g); font-size: 0.9rem; font-weight: 700; white-space: nowrap;
}
.lti .lti-btn:hover, .lti .lti-btn.is-done { background: var(--g); color: #fff; }
.lti .lti-btn--solid { background: var(--g); color: #fff; }
.lti .lti-btn--solid:hover { background: var(--g-deep); border-color: var(--g-deep); }
.lti .lti-btn--ghost { border-color: var(--line); color: var(--g-deep); }

.lti-out {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
	padding: 14px 16px; border: 1.5px dashed var(--line); border-radius: 14px;
}
.lti-nick-preview { font-size: 1.5rem; line-height: 1.4; overflow-wrap: anywhere; }
.lti-bio-preview { flex: 1 1 100%; font-size: 0.95rem; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.lti-out--bio .lti-meter { margin-left: auto; }
.lti-placeholder { color: var(--muted); font-size: 0.95rem; }

.lti .lti-inv {
	display: inline-block; width: 0.7em; height: 1em; margin: 0 1px; padding: 0; vertical-align: -0.12em;
	border: 1.5px dashed var(--g); border-radius: 3px;
	background: repeating-linear-gradient(-45deg, rgba(41, 110, 71, 0.18) 0 3px, transparent 3px 6px);
}

.lti-meter { padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lti-meter:empty { display: none; }
.lti-meter.is-ok { background: #dcf0e3; color: var(--g-deep); }
.lti-meter.is-over { background: #fbe3e3; color: #8f2424; }

.lti .lti-warn { padding: 8px 12px; border-radius: 10px; background: #fbf1dc; color: #6e4a0e; font-size: 0.88rem; }
.lti .lti-note { font-size: 0.82rem; color: var(--muted); }
.lti .lti-link { color: var(--g-deep); font-size: 0.9rem; font-weight: 600; text-underline-offset: 3px; }
.lti-check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; }
.lti-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--g); }

.lti-char-meta { max-width: 460px; font-size: 0.82rem; color: var(--muted); }
.lti-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.lti .lti-pick-btn {
	padding: 4px 10px; background: transparent; border: 1px solid var(--line); border-radius: 999px;
	color: var(--muted); font-size: 0.8rem; font-weight: 600;
}
.lti .lti-pick-btn:hover { border-color: var(--g); background: #fff; color: var(--g-deep); }
.lti .lti-pick-btn[aria-pressed="true"] { background: #fff; border-color: var(--g); color: var(--g-deep); box-shadow: inset 0 0 0 1px var(--g); }
.lti-stepper { display: inline-flex; align-items: center; gap: 4px; }
.lti .lti-step {
	width: 36px; height: 36px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px;
	color: var(--g-deep); font-size: 1.1rem; font-weight: 700;
}
.lti .lti-step:hover { border-color: var(--g); background: #fff; color: var(--g-deep); }
.lti-insert-group { display: inline-flex; gap: 6px; }
.lti-show-label { margin-top: 10px !important; font-size: 0.8rem; font-weight: 600; }
.lti-show {
	margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--ink);
	font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto;
}
.lti .lti-reviewed { grid-column: 1 / -1; padding: 0 28px 8px; font-size: 0.82rem; font-weight: 600; color: var(--g-deep); }

/* WhatsApp link */
.lti .lti-wa {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
	border: 1.5px solid #1f8f4e; border-radius: 12px; background: #fff; color: #17783f;
	font-size: 0.95rem; font-weight: 700; text-decoration: none;
}
.lti .lti-wa:hover { background: #e7f7ee; color: #17783f; }

/* Cleaner and secret message */
.lti-clean-box { display: grid; gap: 10px; }
.lti-clean-msg { font-weight: 700; color: var(--g-deep); font-size: 0.92rem; }
.lti-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px 28px; }
.lti-split-col { display: grid; gap: 10px; align-content: start; }
.lti .lti-h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.lti-secret-text { margin-top: 6px !important; font-size: 1.05rem; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }

/* Detector result */
.lti-result { padding: 12px 14px; border-radius: 12px; background: var(--mint); color: var(--muted); font-size: 0.92rem; }
.lti-result.is-ok { background: #dcf0e3; color: var(--g-deep); }
.lti-result.is-warn { background: #fbf1dc; color: #6e4a0e; }
.lti-result.is-info { background: var(--mint); color: var(--ink); }
.lti-result-msg { font-weight: 700; }
.lti-found { display: grid; gap: 4px; margin-top: 8px !important; }
.lti-found li { font-size: 0.88rem; }
.lti code { padding: 1px 5px; border-radius: 5px; background: rgba(21, 36, 27, 0.07); font-size: 0.8em; }
.lti-bytes { margin-top: 6px !important; font-size: 0.8rem; opacity: 0.8; }
.lti-result .lti-warn { margin-top: 8px; }

/* All characters */
.lti-chars { display: grid; }
.lti-char {
	display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
	padding: 12px 0; border-top: 1px solid var(--line);
}
.lti-char:first-child { border-top: 0; }
.lti-char-slot {
	display: inline-block; min-width: 10px; height: 36px; padding: 0 1px; border: 1.5px dashed var(--g);
	border-radius: 6px; font-size: 26px; line-height: 32px; white-space: pre;
	background: repeating-linear-gradient(-45deg, rgba(41, 110, 71, 0.16) 0 3px, transparent 3px 7px);
}
.lti-char-info { display: grid; gap: 2px; font-size: 0.92rem; }
.lti-char-info span { color: var(--muted); font-size: 0.85rem; }

.lti .lti-disclaimer { padding: 0 28px 22px; font-size: 0.8rem; color: var(--muted); }

/* Toast */
.lti-toast {
	position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 99999;
	max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px; background: var(--g-deep);
	color: #fff; font-size: 0.92rem; font-weight: 600; box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.45);
	opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 0.18s, transform 0.18s;
}
.lti-toast:empty { display: none; }
.lti-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.lti-toast.is-error { background: #9b2c2c; }

@media (min-width: 1100px) {
	.lti {
		display: grid;
		grid-template-columns: minmax(380px, 5fr) minmax(0, 7fr);
		align-items: start;
	}
	.lti-copy { position: sticky; top: 24px; }
	body.admin-bar .lti-copy { top: 56px; }
	.lti-work { border-top: 0; border-left: 1px solid var(--line); min-height: 100%; }
	.lti-tabs { flex-wrap: wrap; padding-top: 18px; overflow: visible; }
	.lti .lti-disclaimer { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
	.lti-stage { margin-top: 18px; }
}

@media (max-width: 782px) {
	.lti { width: auto; margin-left: 0; margin-right: 0; }
}

@media (max-width: 640px) {
	.lti { margin: 1.25rem 0; --r: 18px; }
	.lti-copy { padding: 18px 16px; }
	.lti-platforms { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
	.lti-platforms::-webkit-scrollbar { display: none; }
	.lti .lti-pill { flex: none; }
	.lti-stage { padding: 20px 12px; }
	.lti-qty { gap: 5px; }
	.lti-qty-label { flex-basis: 100%; margin: 0; }
	.lti .lti-chip { min-width: 0; flex: 1; }
	.lti .lti-qty-input { width: 64px; }
	.lti-stepper { flex-basis: 100%; justify-content: center; }
	.lti .lti-main { width: 100%; }
	.lti-tabs { padding: 8px 16px 0; }
	.lti-panel { padding: 16px; }
	.lti-opts label { flex: 1 1 140px; }
	.lti-opts .lti-select-field { flex: 1; min-width: 0; }
	.lti-char { grid-template-columns: auto minmax(0, 1fr); }
	.lti-char .lti-btn { grid-column: 1 / -1; }
	.lti .lti-disclaimer { padding: 0 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.lti *, .lti-toast { transition: none !important; }
}
