:root {
	--teu-green: #8bb725;
	--teu-green-dark: #739a1e;
	--teu-green-light: #eef6dc;
	--teu-text: #415161;
	--teu-text-muted: #6b7c8f;
	--teu-heading: #2f3e4d;
	--teu-bg: #f4f6f8;
	--teu-surface: #ffffff;
	--teu-border: #dde3ea;
	--teu-border-strong: #c9d3de;
	--teu-shadow: 0 2px 18px rgba(65, 81, 97, 0.08);
	--teu-shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.06);
	--teu-radius: 12px;
	--teu-radius-sm: 8px;
	--teu-container: min(100%, 1680px);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: 'Poppins', sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--teu-text);
	background: var(--teu-bg);
}

::selection {
	background: var(--teu-green);
	color: #000;
}

.site-container {
	max-width: var(--teu-container);
	margin: 0 auto;
	padding: 0 clamp(1rem, 2vw, 2rem);
}

.page-shell {
	background:
		radial-gradient(circle at top right, rgba(139, 183, 37, 0.08), transparent 28%),
		linear-gradient(180deg, #fafbfc 0%, var(--teu-bg) 100%);
}

.site-header {
	background: var(--teu-surface);
	border-bottom: 1px solid var(--teu-border);
	box-shadow: var(--teu-shadow-soft);
	position: sticky;
	top: 0;
	z-index: 20;
}

.site-header-inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 1rem 0;
	flex-wrap: wrap;
}

.brand-link {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.brand-logo {
	width: 180px;
	max-width: 180px;
	height: auto;
}

.header-copy {
	flex: 1;
	min-width: 220px;
}

.header-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--teu-heading);
	line-height: 1.3;
}

.header-subtitle {
	margin: 0.25rem 0 0;
	font-size: 0.875rem;
	color: var(--teu-text-muted);
}

.header-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--teu-green-dark);
	background: var(--teu-green-light);
	border: 1px solid rgba(139, 183, 37, 0.25);
}

.site-main {
	padding: 1.25rem 0 2rem;
}

.intro-strip {
	margin-bottom: 1.25rem;
	padding: 1rem 1.25rem;
	background: linear-gradient(90deg, rgba(139, 183, 37, 0.12), rgba(139, 183, 37, 0.04));
	border: 1px solid rgba(139, 183, 37, 0.18);
	border-left: 4px solid var(--teu-green);
	border-radius: var(--teu-radius-sm);
	color: var(--teu-text);
	font-size: 0.9375rem;
}

.app-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

.panel {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--teu-surface);
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius);
	box-shadow: var(--teu-shadow);
	overflow: hidden;
}

.panel-body-stack {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 1rem;
	min-height: 0;
}

.panel-ticket-textarea {
	flex: 1;
	min-height: 280px;
}

.output-box-grow {
	flex: 1;
	min-height: 220px;
	max-height: 520px;
}

.output-box-reply {
	min-height: 280px;
	max-height: none;
}

.panel-reply {
	grid-area: reply;
	overflow: visible;
}

.panel-reply-body {
	display: flex;
	flex-direction: column;
	gap: 1.35rem;
	padding: 1.35rem 1.5rem 1.5rem;
	overflow: visible;
}

.reply-section {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	width: 100%;
	min-width: 0;
}

.reply-section-result {
	gap: 0.75rem;
}

.reply-result-label {
	margin-bottom: 0.15rem;
}

.reply-points-editor {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	width: 100%;
	padding: 0.85rem;
	background: #fff;
	border: 1px solid var(--teu-border-strong);
	border-radius: var(--teu-radius-sm);
	min-height: 120px;
}

.reply-points-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
}

.reply-points-list:empty {
	display: none;
}

.reply-point-chip {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	width: 100%;
	padding: 0.7rem 0.85rem;
	background: var(--teu-surface-muted, #f4f7fb);
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius-sm);
}

.reply-point-chip-text {
	flex: 1;
	min-width: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--teu-text);
	word-break: break-word;
}

.reply-point-chip-remove {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	margin: -0.15rem -0.25rem 0 0;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--teu-text-muted);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.reply-point-chip-remove:hover,
.reply-point-chip-remove:focus-visible {
	background: rgba(0, 0, 0, 0.06);
	color: var(--teu-text);
}

.reply-points-input {
	width: 100%;
	border: none;
	background: transparent;
	color: var(--teu-text);
	padding: 0.15rem 0.1rem;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.reply-points-input:focus {
	outline: none;
}

.reply-points-input::placeholder {
	color: var(--teu-text-muted);
	opacity: 0.85;
}

.field-label-row {
	position: relative;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

.field-label-inline {
	display: inline-block;
	margin-bottom: 0;
}

.field-info-tip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.field-info-tip-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.125rem;
	height: 1.125rem;
	border-radius: 50%;
	border: 1px solid var(--teu-border-strong);
	background: var(--teu-surface);
	color: var(--teu-text-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	font-style: italic;
	font-family: Georgia, 'Times New Roman', serif;
	line-height: 1;
	cursor: help;
	transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.field-label-row:has(.field-info-tip:hover) .field-info-tip-icon,
.field-label-row:has(.field-info-tip:focus) .field-info-tip-icon,
.field-label-row:has(.field-info-tip:focus-within) .field-info-tip-icon {
	border-color: var(--teu-green);
	color: var(--teu-green-dark);
	background: var(--teu-green-light);
}

.field-info-tip-bubble {
	position: absolute;
	left: 0;
	top: calc(100% + 0.35rem);
	z-index: 40;
	width: min(22rem, 100%);
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--teu-border-strong);
	border-radius: var(--teu-radius-sm);
	background: var(--teu-surface);
	box-shadow: var(--teu-shadow);
	color: var(--teu-text);
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.field-label-row:has(.field-info-tip:hover) .field-info-tip-bubble,
.field-label-row:has(.field-info-tip:focus) .field-info-tip-bubble,
.field-label-row:has(.field-info-tip:focus-within) .field-info-tip-bubble {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.field-info-tip-title {
	display: block;
	margin-bottom: 0.45rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--teu-heading);
}

.field-info-tip-list {
	margin: 0;
	padding-left: 1.1rem;
}

.field-info-tip-list li + li {
	margin-top: 0.35rem;
}

.field-info-tip-list strong {
	color: var(--teu-heading);
	font-weight: 600;
}

.reply-tone-select {
	max-width: 320px;
}

.btn-primary-reply {
	width: 100%;
	max-width: none;
	justify-content: center;
}

.panel-reply-form,
.panel-reply-result {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

.panel-reply-result {
	min-height: 0;
}

.panel-reply-fields {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

.btn-primary-auto {
	width: auto;
	align-self: flex-start;
}

@media (min-width: 768px) {
	.panel-reply-fields {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 1024px) {
	.app-grid {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
		grid-template-areas:
			"ticket history"
			"summary history"
			"similar history"
			"checks checks"
			"reply reply";
		align-items: stretch;
	}

	.panel-ticket {
		grid-area: ticket;
	}

	.panel-summary {
		grid-area: summary;
	}

	.panel-similar {
		grid-area: similar;
	}

	.panel-history {
		grid-area: history;
		grid-row: 1 / 4;
	}

	.panel-checks {
		grid-area: checks;
	}

	.panel-reply {
		grid-area: reply;
	}

	.panel-ticket-textarea {
		min-height: 340px;
	}

	.output-box-grow {
		min-height: 260px;
	}
}

@media (min-width: 1400px) {
	:root {
		--teu-container: min(100%, 1760px);
	}

	.app-grid {
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr) minmax(0, 1fr);
		grid-template-areas:
			"ticket ticket history"
			"summary summary history"
			"similar similar history"
			"checks checks checks"
			"reply reply reply";
	}

	.panel-history {
		grid-row: 1 / 4;
	}

	.panel-ticket-textarea {
		min-height: 300px;
	}
}

.panel-header {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--teu-border);
	background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.panel-header-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
}

.panel-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--teu-heading);
}

.panel-subtitle {
	margin: 0.25rem 0 0;
	font-size: 0.8125rem;
	color: var(--teu-text-muted);
}

.panel-body {
	padding: 1.25rem;
}

.char-count-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.char-count-warn {
	color: #b45309;
	font-weight: 600;
}

.char-count-danger {
	color: #b42318;
	font-weight: 700;
}

.char-warning {
	font-size: 0.75rem;
	color: #b45309;
	line-height: 1.4;
}

.whmcs-load-row {
	display: flex;
	align-items: flex-end;
	gap: 0.75rem;
}

.whmcs-load-field {
	flex: 1 1 0;
	min-width: 0;
}

.whmcs-load-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
}

@media (max-width: 720px) {
	.whmcs-load-row {
		flex-wrap: wrap;
	}

	.whmcs-load-field {
		flex: 1 1 100%;
	}

	.whmcs-load-actions {
		flex: 1 1 100%;
	}
}

.btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	background: #fff;
	color: var(--teu-heading);
	font-family: 'Poppins', sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	border: 1px solid var(--teu-green);
	border-radius: var(--teu-radius-sm);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
	background: var(--teu-green-light);
	color: var(--teu-green-dark);
}

.btn-secondary:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.btn-copy {
	padding: 0.45rem 0.85rem;
	background: var(--teu-green-light);
	color: var(--teu-green-dark);
	font-family: 'Poppins', sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	border: 1px solid rgba(139, 183, 37, 0.35);
	border-radius: var(--teu-radius-sm);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-copy:hover:not(:disabled) {
	background: var(--teu-green);
	color: #fff;
	border-color: var(--teu-green);
}

.btn-copy:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.btn-copy-sm {
	padding: 0.35rem 0.7rem;
	font-size: 0.75rem;
}

.btn-copy-whmcs {
	background: var(--teu-green);
	color: #fff;
	border-color: var(--teu-green);
}

.btn-copy-whmcs:hover {
	background: var(--teu-green-dark);
	border-color: var(--teu-green-dark);
}

.reply-copy-bar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.85rem;
	flex-wrap: wrap;
	padding: 0.75rem 0.9rem;
	background: #f8fafc;
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius-sm);
}

.reply-copy-label {
	display: block;
	margin: 0 0 0.2rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--teu-heading);
}

.reply-copy-help {
	margin: 0;
	font-size: 0.75rem;
	color: var(--teu-text-muted);
	max-width: 36rem;
}

.reply-copy-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.reply-preview {
	white-space: pre-wrap;
}

.reply-preview-html p {
	margin: 0 0 0.85rem;
}

.reply-preview-html p:last-child {
	margin-bottom: 0;
}

.reply-preview-html ul,
.reply-preview-html ol {
	margin: 0 0 0.85rem 1.25rem;
	padding: 0;
}

.reply-preview-html li + li {
	margin-top: 0.35rem;
}

.reply-preview-html code {
	font-family: Consolas, 'Courier New', monospace;
	font-size: 0.875em;
	background: #eef2f6;
	padding: 0.1rem 0.3rem;
	border-radius: 0.2rem;
}

.ticket-meta {
	font-size: 0.8125rem;
	color: var(--teu-green-dark);
	background: var(--teu-green-light);
	border: 1px solid rgba(139, 183, 37, 0.2);
	border-radius: var(--teu-radius-sm);
	padding: 0.5rem 0.75rem;
}

.input-loading {
	opacity: 0.7;
	pointer-events: none;
}

.loading-state {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--teu-text-muted);
	font-style: italic;
}

.loading-spinner {
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid rgba(139, 183, 37, 0.2);
	border-top-color: var(--teu-green);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	flex-shrink: 0;
}

.loading-message {
	font-size: 0.875rem;
	color: var(--teu-heading);
}

.output-box-actions {
	background: #fffdf8;
	border-color: rgba(154, 107, 0, 0.2);
}

.checks-list {
	margin: 0;
	padding-left: 1.25rem;
	color: var(--teu-heading);
}

.checks-list li {
	margin-bottom: 0.5rem;
	line-height: 1.5;
}

.checks-list li:last-child {
	margin-bottom: 0;
}

.panel-meta {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem;
	font-size: 0.75rem;
	color: var(--teu-text-muted);
}

.summary-stats-meta {
	margin-top: 0.35rem;
	margin-bottom: 0;
	align-items: flex-start;
}

.summary-operator-fields {
	margin-top: 0.75rem;
	padding-top: 1rem;
	border-top: 1px solid var(--teu-border);
}

.panel-meta-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.ticket-full-process-row {
	display: flex;
	justify-content: center;
	padding-top: 0.35rem;
}

.error-message-centered {
	text-align: center;
}

.field-label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--teu-heading);
	margin-bottom: 0.5rem;
}

.field-label-optional {
	font-weight: 500;
	color: var(--teu-text-muted);
}

.field-help {
	margin: -0.15rem 0 0.5rem;
	font-size: 0.8125rem;
	color: var(--teu-text-muted);
	line-height: 1.45;
}

.reply-exclude-input {
	min-height: 88px;
	max-height: none;
}

.input-field,
.input-textarea {
	width: 100%;
	background: #fff;
	border: 1px solid var(--teu-border-strong);
	border-radius: var(--teu-radius-sm);
	color: var(--teu-text);
	padding: 0.75rem 1rem;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9375rem;
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-field:focus,
.input-textarea:focus {
	outline: none;
	border-color: var(--teu-green);
	box-shadow: 0 0 0 3px rgba(139, 183, 37, 0.15);
}

.input-textarea {
	resize: vertical;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 0.875rem;
	background: #fcfdfc;
}

.btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.8rem 1rem;
	background: var(--teu-green);
	color: #fff;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9375rem;
	font-weight: 600;
	border: none;
	border-radius: var(--teu-radius-sm);
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(139, 183, 37, 0.25);
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
	background: var(--teu-green-dark);
	box-shadow: 0 6px 16px rgba(139, 183, 37, 0.28);
	transform: translateY(-1px);
}

.btn-primary:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-primary.btn-full-process {
	width: auto;
	max-width: none;
	min-width: 0;
	padding-left: 5px;
	padding-right: 5px;
	flex-shrink: 0;
}

.btn-ghost {
	padding: 0.45rem 0.85rem;
	background: #fff;
	color: var(--teu-text);
	font-family: 'Poppins', sans-serif;
	font-size: 0.8125rem;
	font-weight: 500;
	border: 1px solid var(--teu-border-strong);
	border-radius: var(--teu-radius-sm);
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-ghost-sm {
	font-size: 0.75rem;
	padding: 0.35rem 0.7rem;
}

.btn-ghost:hover:not(.btn-ghost-danger):not(.btn-ghost-warn) {
	color: var(--teu-green-dark);
	border-color: var(--teu-green);
	background: var(--teu-green-light);
}

.btn-ghost-danger {
	color: #b91c1c;
	border-color: #dc2626;
}

.btn-ghost-danger:hover {
	color: #fff;
	border-color: #dc2626;
	background: #dc2626;
}

.btn-ghost-warn {
	color: #a16207;
	border-color: #ca8a04;
}

.btn-ghost-warn:hover {
	color: #fff;
	border-color: #ca8a04;
	background: #ca8a04;
}

.output-box {
	background: #fbfcfd;
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius-sm);
	padding: 1rem;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 0.875rem;
	line-height: 1.65;
	color: var(--teu-text);
}

.output-placeholder {
	color: var(--teu-text-muted);
	font-style: italic;
}

.output-content {
	color: var(--teu-heading);
}

.output-section-title {
	font-weight: 700;
	color: var(--teu-green-dark);
	margin-top: 1rem;
	margin-bottom: 0.35rem;
}

.output-section-title:first-child {
	margin-top: 0;
}

.output-section-title-suggested {
	color: #9a6b00;
	margin-top: 1rem;
}

.output-section-title-suggested:first-child {
	margin-top: 0;
}

.output-section-title-sysadmin {
	color: #9a6b00;
}

.output-section-title-history {
	color: var(--teu-heading);
}

.output-section-body {
	white-space: pre-wrap;
}

.panel-hint {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--teu-text-muted);
	line-height: 1.5;
}

.panel-hint code {
	font-size: 0.75rem;
	background: var(--teu-green-light);
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
}

.error-message {
	font-size: 0.8125rem;
	color: #b42318;
	background: #fef3f2;
	border: 1px solid #fecdca;
	border-radius: var(--teu-radius-sm);
	padding: 0.625rem 0.875rem;
}

.btn-spinner {
	width: 1rem;
	height: 1rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.toast {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 50;
	padding: 0.85rem 1rem;
	background: var(--teu-heading);
	color: #fff;
	border-left: 4px solid var(--teu-green);
	border-radius: var(--teu-radius-sm);
	font-size: 0.875rem;
	box-shadow: var(--teu-shadow);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

.toast.hidden {
	opacity: 0;
	transform: translateY(0.5rem);
	pointer-events: none;
}

.site-footer {
	margin-top: auto;
	background: #fff;
	border-top: 1px solid var(--teu-border);
}

.site-footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 1rem 0 1.25rem;
}

.footer-brand-link {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.footer-logo {
	display: block;
	width: 160px;
	max-width: min(160px, 100%);
	height: auto;
}

.site-footer p {
	margin: 0;
	font-size: 0.75rem;
	color: var(--teu-text-muted);
}

.panel-header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.legend-strip {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	padding: 0.65rem 0.85rem;
	background: #f8fafc;
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius-sm);
}

.legend-text {
	font-size: 0.75rem;
	color: var(--teu-text-muted);
}

.section-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.section-badge-fact {
	color: #166534;
	background: #dcfce7;
	border: 1px solid #86efac;
}

.section-badge-suggestion {
	color: #1d4ed8;
	background: #dbeafe;
	border: 1px solid #93c5fd;
}

.output-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 1rem;
	margin-bottom: 0.35rem;
}

.output-section-head:first-child,
.output-section:first-child .output-section-head {
	margin-top: 0;
}

.output-section-title-fact {
	color: #166534;
}

.output-section-title-suggestion {
	color: #1d4ed8;
}

.output-section + .output-section {
	margin-top: 0.75rem;
}

.token-estimate {
	font-size: 0.75rem;
	color: var(--teu-text-muted);
	line-height: 1.45;
}

.token-estimate strong {
	color: var(--teu-heading);
}

.radar-list {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.radar-alert {
	padding: 0.75rem 0.9rem;
	border-radius: var(--teu-radius-sm);
	border: 1px solid transparent;
}

.radar-alert strong {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.875rem;
}

.radar-alert p {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
}

.radar-alert-medium {
	background: #fffbeb;
	border-color: #fcd34d;
	color: #92400e;
}

.radar-alert-high {
	background: #fef2f2;
	border-color: #fca5a5;
	color: #991b1b;
}

.operator-fields {
	display: grid;
	gap: 0.85rem;
}

.operator-name-select {
	cursor: pointer;
	background-color: #fff;
}

.operator-name-select option[value=""] {
	color: var(--teu-text-muted);
}

.operator-evidence-input {
	min-height: 72px;
}

.internal-note-input {
	min-height: 96px;
}

.similar-tickets-output {
	min-height: 140px;
	max-height: 320px;
}

.similar-ticket-item + .similar-ticket-item {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px dashed var(--teu-border);
}

.similar-ticket-title {
	font-weight: 600;
	color: var(--teu-heading);
	margin-bottom: 0.25rem;
}

.similar-ticket-meta,
.similar-ticket-keywords {
	font-size: 0.8125rem;
	color: var(--teu-text-muted);
	margin: 0.15rem 0 0;
}

.similar-ticket-link {
	display: inline-block;
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--teu-green-dark);
	text-decoration: none;
}

.similar-ticket-link:hover {
	text-decoration: underline;
}

.similar-ticket-solution {
	margin: 0.5rem 0 0;
	padding: 0.55rem 0.65rem;
	border-left: 3px solid var(--teu-green);
	background: rgba(45, 125, 70, 0.06);
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--teu-text);
}

.similar-ticket-solution-label {
	display: block;
	font-weight: 600;
	color: var(--teu-green-dark);
	margin-bottom: 0.2rem;
}

.btn-secondary-sm {
	padding: 0.55rem 0.85rem;
	font-size: 0.8125rem;
}

.btn-secondary-sm .btn-spinner {
	border-color: rgba(65, 81, 97, 0.25);
	border-top-color: var(--teu-green);
}

.share-layout {
	display: grid;
	gap: 1.25rem;
	max-width: 960px;
}

.timeline-body {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.timeline-entry {
	line-height: 1.55;
}

.timeline-entry-plain {
	color: var(--teu-text);
}

.timeline-date {
	color: var(--teu-text-muted);
	font-size: 0.8125rem;
	white-space: nowrap;
}

.timeline-name {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.8125rem;
}

.timeline-name-client {
	color: #0369a1;
	background: #e0f2fe;
}

.timeline-name-staff {
	color: #c2410c;
	background: #ffedd5;
}

.timeline-legend-name {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	border-radius: 4px;
	font-size: 0.6875rem;
	font-weight: 700;
}

.timeline-sep {
	margin: 0 0.15rem;
}

.timeline-content {
	color: var(--teu-heading);
}

.share-pin-panel {
	max-width: 420px;
	margin: 2rem auto 0;
}

.share-pin-form {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.share-pin-input {
	max-width: 220px;
	letter-spacing: 0.15em;
	font-variant-numeric: tabular-nums;
}

.share-meta {
	padding: 1rem 1.25rem;
	background: #fff;
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius-sm);
}

.share-meta p {
	margin: 0.25rem 0;
	font-size: 0.875rem;
}

.share-meta-link {
	display: inline-block;
	margin-left: 0.35rem;
	font-weight: 600;
	color: var(--teu-green-dark);
	text-decoration: none;
}

.share-meta-link:hover {
	text-decoration: underline;
}

.share-expiry-notice {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--teu-radius-sm);
	font-size: 0.875rem;
	line-height: 1.45;
}

.share-expiry-notice p {
	margin: 0;
}

.share-expiry-notice-urgent {
	border: 1px solid #f59e0b;
	background: #fffbeb;
	color: #92400e;
}

.share-expiry-notice-warn {
	border: 1px solid #fcd34d;
	background: #fffef5;
	color: #854d0e;
}

.share-expiry-notice-expired {
	border: 1px solid #fca5a5;
	background: #fef2f2;
	color: #991b1b;
}

.share-top-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.btn-share-whmcs {
	width: auto;
	min-width: 0;
	padding: 0.65rem 1.1rem;
	font-weight: 600;
}

.share-internal-note {
	margin-bottom: 1.25rem;
	padding: 1rem 1.1rem;
	border: 2px solid #dc2626;
	border-radius: 0.65rem;
	background: #fef2f2;
}

.share-internal-note-top {
	margin-bottom: 1rem;
	padding: 1.1rem 1.2rem;
	box-shadow: 0 4px 16px rgba(220, 38, 38, 0.12);
}

.share-internal-note-header {
	margin-bottom: 0.65rem;
}

.share-internal-note-badge {
	display: inline-block;
	margin-bottom: 0.45rem;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.share-internal-note-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #991b1b;
}

.share-internal-note-subtitle {
	margin: 0.25rem 0 0;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #b91c1c;
}

.share-internal-note-body {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: #450a0a;
	white-space: normal;
}

.share-operator-evidence {
	margin: 0.75rem 0 0.25rem;
	padding: 0.85rem 1rem;
	border: 2px solid #ea580c;
	border-radius: 0.65rem;
	background: #fff7ed;
}

.share-operator-evidence-header {
	margin-bottom: 0.55rem;
}

.share-operator-evidence-title {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #c2410c;
}

.share-operator-evidence-body {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: #7c2d12;
	white-space: normal;
}

.share-link-box {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 0.75rem;
}

.share-link-input {
	flex: 1;
	min-width: 220px;
	font-size: 0.8125rem;
}

.app-modal {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.75rem, 2vw, 1.5rem);
}

.app-modal.hidden {
	display: none;
}

.app-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(47, 62, 77, 0.48);
}

.app-modal-dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(100%, 680px);
	max-height: min(82vh, 760px);
	background: var(--teu-surface);
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius);
	box-shadow: 0 16px 48px rgba(47, 62, 77, 0.22);
	overflow: hidden;
}

.app-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.1rem 0.85rem;
	border-bottom: 1px solid var(--teu-border);
	background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.app-modal-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--teu-heading);
	line-height: 1.3;
}

.app-modal-subtitle {
	margin: 0.2rem 0 0;
	font-size: 0.8125rem;
	color: var(--teu-text-muted);
	line-height: 1.45;
}

.app-modal-header-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
}

.app-modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 1px solid var(--teu-border);
	border-radius: var(--teu-radius-sm);
	background: #fff;
	color: var(--teu-text-muted);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.app-modal-close:hover {
	color: var(--teu-heading);
	border-color: var(--teu-border-strong);
	background: #f8fafc;
}

.app-modal-body {
	padding: 0.85rem 1.1rem 1.1rem;
	overflow-y: auto;
}

.active-shares-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.active-share-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.45rem 0.75rem;
	padding: 0.55rem 0.65rem;
	border: 1px solid var(--teu-border);
	border-radius: 0.5rem;
	background: #fff;
}

.active-share-main {
	min-width: 0;
	flex: 1 1 180px;
}

.active-share-ticket {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--teu-text);
}

.active-share-meta {
	font-size: 0.75rem;
	color: var(--teu-text-muted);
	line-height: 1.45;
	margin-top: 0.15rem;
}

.active-share-expiry-warn {
	margin-top: 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.active-share-expiry-warn-urgent {
	color: #b45309;
}

.active-share-expiry-warn-warn {
	color: #a16207;
}

.active-share-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}

.btn-section-regen {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.65rem;
	height: 1.65rem;
	padding: 0;
	border: 1px solid var(--teu-border);
	border-radius: 0.375rem;
	background: #fff;
	color: var(--teu-text-muted);
	font-size: 0.95rem;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-section-regen:hover:not(:disabled) {
	color: var(--teu-primary);
	border-color: #93c5fd;
	background: #eff6ff;
}

.btn-section-regen:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.btn-section-regen.is-loading {
	animation: section-regen-spin 0.8s linear infinite;
}

@keyframes section-regen-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.output-section-head-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	flex-shrink: 0;
}

.output-section-head-main {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	flex-wrap: wrap;
	min-width: 0;
}

body.modal-open {
	overflow: hidden;
}

@media (max-width: 768px) {
	.site-header-inner {
		align-items: flex-start;
	}

	.brand-logo {
		width: 150px;
	}

	.header-badge {
		display: none;
	}

	.site-footer-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.app-modal {
		padding: 0.5rem;
	}

	.app-modal-dialog {
		max-height: 92vh;
	}

	.app-modal-header {
		padding: 0.85rem 0.9rem 0.75rem;
	}

	.app-modal-body {
		padding: 0.75rem 0.9rem 0.9rem;
	}

	.active-share-item {
		flex-direction: column;
		align-items: stretch;
	}

	.active-share-actions {
		justify-content: flex-end;
	}
}
