@font-face {
	font-family: 'BpmfHuninn';
	src: url('../fonts/BpmfHuninn.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

.eltmh-translator-widget {
	max-width: 640px;
	margin: 1em 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.eltmh-form {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.eltmh-input-wrap {
	position: relative;
}

.eltmh-input {
	width: 100%;
	padding: 0.5em;
	font-size: 1em;
	border: 1px solid #ccc;
	border-radius: 4px;
	resize: vertical;
	box-sizing: border-box;
}

.eltmh-clear {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 22px;
	height: 22px;
	padding: 0;
	line-height: 20px;
	text-align: center;
	font-size: 16px;
	background: rgba(0,0,0,0.12);
	color: #555;
	border: none;
	border-radius: 50%;
	cursor: pointer;
}

.eltmh-clear:hover {
	background: rgba(0,0,0,0.25);
	color: #111;
}

.eltmh-submit {
	align-self: flex-start;
}

.eltmh-spinner {
	margin-top: 0.75em;
	color: #666;
	font-style: italic;
}

.eltmh-error {
	margin-top: 0.75em;
	color: #c00;
}

.eltmh-history-nav {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-top: 0.75em;
}

.eltmh-history-pos {
	font-size: 0.85em;
	color: #666;
	min-width: 3em;
	text-align: center;
}

.eltmh-history-nav .button:disabled {
	opacity: 0.4;
	cursor: default;
}

.eltmh-results {
	margin-top: 1em;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 1em;
	background: #fafafa;
}

.eltmh-result-row {
	margin-bottom: 0.75em;
	line-height: 1.6;
}

.eltmh-result-row:last-child {
	margin-bottom: 0;
}

.eltmh-label {
	display: block;
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #666;
	margin-bottom: 0.2em;
}

.eltmh-copy {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.3em;
	padding: 0 0 0 0.3em;
	opacity: 0.45;
	vertical-align: middle;
	line-height: 1;
	color: inherit;
}

.eltmh-copy:hover {
	opacity: 1;
}

.eltmh-counter-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.15em;
}

.eltmh-version {
	font-size: 0.7em;
	color: #bbb;
}

.eltmh-char-count {
	font-size: 0.7em;
	color: #999;
}

.eltmh-char-count.eltmh-char-over {
	color: #c00;
	font-weight: 600;
}

.eltmh-chinese {
	font-size: 1.8em;
	line-height: 1.4;
}

.eltmh-pinyin {
	font-size: 1em;
	color: #444;
}

.eltmh-bopomofo {
	font-family: 'BpmfHuninn', serif;
	font-size: 1.8em;
	line-height: 2;
}

/* Dictionary word annotations */
.eltmh-bopomofo .eltmh-word {
	font-family: inherit; /* keep BpmfHuninn so Bopomofo annotations render */
}

.eltmh-word {
	cursor: help;
	border-bottom: 1px dotted #aaa;
	transition: background 0.1s;
}

.eltmh-word:hover {
	background: rgba(255, 210, 60, 0.35);
	border-radius: 2px;
}

/* Floating tooltip */
.eltmh-tooltip {
	position: absolute;
	z-index: 99999;
	display: none;
	background: #222;
	color: #f0f0f0;
	border-radius: 6px;
	padding: 7px 11px;
	max-width: 240px;
	pointer-events: none;
	box-shadow: 0 3px 10px rgba(0,0,0,0.35);
	line-height: 1.5;
	font-size: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.eltmh-tt-word {
	display: block;
	font-size: 1.3em;
	font-weight: 700;
	margin-bottom: 2px;
}

.eltmh-tt-pinyin {
	display: block;
	font-size: 0.88em;
	color: #8ef;
	font-style: italic;
	margin-bottom: 2px;
}

.eltmh-tt-def {
	display: block;
	font-size: 0.88em;
	color: #ddd;
}

