@font-face {
	font-family: "Noto Sans Ethiopic";
	src: url("vendor/noto-sans-ethiopic.woff2")
		format("woff2");
	font-display: swap;
	unicode-range: U+030E, U+1200-1399, U+2D80-2DDE,
		U+AB01-AB2E, U+1E7E0-1E7E6, U+1E7E8-1E7EB,
		U+1E7ED-1E7EE, U+1E7F0-1E7FE;
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

:focus-visible {
	outline: 3px solid #0a4bb0;
	outline-offset: 2px;
	border-radius: 4px;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI",
		Roboto, "Noto Sans Ethiopic", sans-serif;
	font-size: 18px;
	line-height: 1.5;
	color: #1c1c1c;
	background: #fafaf7;
}

#app {
	max-width: 40rem;
	margin: 0 auto;
	padding: 1rem;
}

.home-header h1 {
	font-size: 1.5rem;
	margin: 0.5rem 0 0.25rem;
}

.tagline {
	margin: 0 0 0.75rem;
	color: #3d3d3d;
	font-size: 0.95rem;
	max-width: 32rem;
}

.noscript {
	max-width: 40rem;
	margin: 2rem auto;
	padding: 0 1rem;
	color: #3d3d3d;
}

.search {
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	border: 2px solid #767676;
	border-radius: 8px;
	background: #fff;
	color: inherit;
}

.search::placeholder {
	color: #5f5f5f;
}

.back-link {
	display: inline-block;
	min-height: 44px;
	padding: 0.5rem 0;
	color: #0a58ca;
	text-decoration: none;
}

.language-section {
	margin: 1rem 0 2rem;
	scroll-margin-top: 0.5rem;
}

.section-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 0;
	border: 0;
	background: none;
	font: inherit;
	/* Not link-blue: it toggles, it does not navigate. */
	color: #1c1c1c;
	text-align: left;
	cursor: pointer;
}

.section-toggle:hover {
	color: #0a4bb0;
}

.chevron {
	flex: none;
	transform-origin: center;
	transition: transform 120ms ease-out;
}

.is-collapsed .chevron {
	transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
	.chevron {
		transition: none;
	}
}

.is-collapsed .guidance {
	margin-bottom: 0;
}

.language-section h2 {
	font-size: 1.2rem;
	margin: 0 0 0.25rem;
	position: sticky;
	top: 0;
	z-index: 5;
	padding: 0.35rem 0;
	background: #fafaf7;
	border-bottom: 1px solid #e5e5e0;
}

.guidance {
	margin: 0 0 0.75rem;
	color: #555;
	font-size: 0.9rem;
}

.phrase-table {
	width: 100%;
	border-collapse: collapse;
}

.phrase-table td {
	padding: 0.6rem 0.4rem;
	border-top: 1px solid #e5e5e0;
	vertical-align: top;
	/* Indic and other non-breaking scripts have no break
	   opportunity inside a word, so at 320px their min-content
	   pushed the table past the viewport. `anywhere` lowers
	   min-content and only breaks when there is no
	   alternative — nothing changes at 390px and up. */
	overflow-wrap: anywhere;
}

.phrase-table .english {
	width: 30%;
	color: #555;
	font-size: 0.9rem;
}

.phrase-table .context {
	font-size: 0.75rem;
	color: #595959;
}

.phrase-table .native {
	width: 30%;
	font-size: 1.05rem;
}

.phrase-table .respelling {
	font-weight: 600;
}

.phrase-table .note {
	font-weight: 400;
	font-size: 0.85rem;
	color: #3d3d3d;
	margin-top: 0.15rem;
}

.badge {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0 0.4rem;
	font-size: 0.65rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6f5700;
	background: #fdf3cf;
	border-radius: 999px;
	vertical-align: middle;
}

.phrase-table .slang-native,
.phrase-table .slang-resp {
	margin-top: 0.35rem;
	padding-top: 0.35rem;
	border-top: 1px dashed #ddd;
}

.chip-slang {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0 0.4rem;
	font-size: 0.65rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #1c5e8a;
	background: #ddeffb;
	border-radius: 999px;
	vertical-align: middle;
}

.badge-verified {
	color: #1c6e2e;
	background: #d9f2e0;
}

.badge-verified a {
	color: inherit;
	text-decoration: underline;
}

.audio-btn {
	margin-left: 0.4rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.35rem;
	font-size: 0.8rem;
	line-height: 1;
	color: #0a58ca;
	background: #eef4ff;
	border: 1px solid #5b83c4;
	border-radius: 999px;
	cursor: pointer;
	vertical-align: middle;
}

.audio-btn:hover {
	background: #dfeaff;
}

.entry-actions {
	margin-top: 0.35rem;
}

.entry-action {
	display: inline-block;
	min-height: 44px;
	padding: 0.75rem 0;
	font-size: 0.75rem;
	font-weight: 400;
	color: #5f5f5f;
	text-decoration: underline;
	text-decoration-color: #bdbdbd;
	text-underline-offset: 2px;
}

.entry-action:hover {
	color: #1c1c1c;
	text-decoration-color: #1c1c1c;
}

.section-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
	margin: 0.75rem 0 0;
	font-size: 0.8rem;
}

.section-actions a {
	display: inline-block;
	min-height: 44px;
	padding: 0.75rem 0;
	color: #0a58ca;
	text-decoration: none;
}

.section-actions a:hover {
	text-decoration: underline;
}

.add-lang-cta {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
}

.add-lang-cta a {
	color: #0a58ca;
	text-decoration: none;
}

.add-lang-cta a:hover {
	text-decoration: underline;
}

.not-found {
	text-align: center;
	padding: 3rem 0;
}

.retry-btn {
	display: inline-block;
	min-height: 44px;
	margin: 0.5rem 0 1rem;
	padding: 0.6rem 1.25rem;
	border: 1px solid #1c1c1c;
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 0.95rem;
	color: #1c1c1c;
	cursor: pointer;
}

.retry-btn:hover {
	background: #f2f2ee;
}

.globe-error {
	padding: 2rem 0;
	text-align: center;
}

.site-footer {
	max-width: 40rem;
	margin: 2.5rem auto 0;
	padding: 1rem 1rem 2rem;
	border-top: 1px solid #e5e5e0;
	font-size: 0.85rem;
	color: #5f5f5f;
}

.site-footer a {
	color: #0a58ca;
	min-height: 44px;
	display: inline-block;
	padding: 0.6rem 0;
}

.globe-slot {
	min-height: 20rem;
}

.globe-wrap {
	display: flex;
	justify-content: center;
	margin: 1rem 0 0.5rem;
	position: relative;
}

.globe-canvas {
	touch-action: none;
	cursor: grab;
	max-width: 100%;
	aspect-ratio: 1;
	border-radius: 50%;
}

.globe-hint {
	text-align: center;
	color: #666;
	font-size: 0.85rem;
	margin: 0.25rem 0;
}

.globe-toast {
	text-align: center;
	color: #6f5700;
	background: #fdf3cf;
	border-radius: 8px;
	padding: 0.5rem;
	margin: 0.5rem auto;
	max-width: 20rem;
}

.globe-tooltip {
	position: absolute;
	pointer-events: none;
	max-width: 16rem;
	padding: 0.4rem 0.6rem;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	font-size: 0.85rem;
}

.globe-tooltip .tip-name {
	font-weight: 600;
}

.globe-tooltip .tip-langs {
	color: #666;
	font-size: 0.8rem;
}

.search-wrap {
	position: relative;
}

.search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 10;
	margin-top: 0.25rem;
	background: #fff;
	border: 1px solid #8a8a8a;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	max-height: 50vh;
	overflow-y: auto;
}

.result-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	text-decoration: none;
	color: inherit;
}

.result-row:hover,
.result-row.is-active {
	background: #e8eefb;
}

.result-row.is-active {
	box-shadow: inset 3px 0 0 #0a4bb0;
}

.result-row .match-why {
	margin-left: auto;
	padding-left: 0.5rem;
	font-size: 0.75rem;
	color: #5f5f5f;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.result-row mark {
	background: none;
	font-weight: 700;
	color: inherit;
}

.result-empty {
	margin: 0;
	padding: 0.75rem;
	color: #3d3d3d;
	font-size: 0.9rem;
}

.lang-section > h2 {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #666;
	margin: 1.25rem 0 0.5rem;
}

.lang-list {
	display: grid;
	grid-template-columns: repeat(
		auto-fill, minmax(9.5rem, 1fr));
	gap: 0.5rem;
}

.lang-pill {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 44px;
	padding: 0.6rem;
	border: 1px solid #8a8a8a;
	border-radius: 10px;
	background: #fff;
	text-decoration: none;
	color: inherit;
}

.lang-pill:hover {
	background: #f2f2ee;
	border-color: #1c1c1c;
}

.lang-pill .lang-name {
	font-weight: 600;
}

.lang-pill .lang-native {
	font-size: 0.8rem;
	color: #5f5f5f;
}

.lang-pill .pill-sub {
	font-size: 0.8rem;
	color: #5f5f5f;
}

.lang-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 1.25rem;
	padding: 0;
	list-style: none;
}

.lang-nav button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.4rem 0.7rem;
	border: 1px solid #8a8a8a;
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 0.85rem;
	color: inherit;
	cursor: pointer;
}

.lang-nav button:hover {
	background: #f2f2ee;
	border-color: #1c1c1c;
}

.loading {
	padding: 2rem 0;
	color: #5f5f5f;
}

.jump {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 20;
	display: none;
}

.jump.is-visible {
	display: block;
}

.jump-toggle {
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 1px solid #1c1c1c;
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 0.9rem;
	color: #1c1c1c;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.jump-toggle:hover {
	background: #f2f2ee;
}

.jump-panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.5rem);
	min-width: 13rem;
	max-height: 60vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #8a8a8a;
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.jump-list {
	margin: 0;
	padding: 0.25rem;
	list-style: none;
}

.jump-list button {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: 6px;
	background: none;
	font: inherit;
	font-size: 0.9rem;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.jump-list button:hover {
	background: #f2f2ee;
}

.jump-list li:first-child button {
	font-weight: 600;
	border-bottom: 1px solid #e5e5e0;
	border-radius: 6px 6px 0 0;
}
