/* ==========================================================================
   Nihongo Craft — main stylesheet
   CSS-first, no framework. Mobile-first, then progressively enhanced.
   ========================================================================== */

:root {
	--color-navy: #16324f;
	--color-navy-dark: #0f2438;
	--color-red: #d84332;
	--color-red-dark: #b7362a;
	--color-white: #ffffff;
	--color-bg-light: #f6f8fa;
	--color-border: #e5e7eb;
	--color-text: #20252b;
	--color-text-muted: #5b6470;

	--font-jp: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
	--font-en: "Inter", system-ui, -apple-system, sans-serif;

	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 16px;
	--shadow-card: 0 1px 2px rgba(22, 50, 79, 0.06), 0 4px 14px rgba(22, 50, 79, 0.06);
	--shadow-card-hover: 0 6px 20px rgba(22, 50, 79, 0.12);
	--header-height: 64px;
	--max-width: 1160px;
}

/* -------------------------------------------------------------------- */
/* Base                                                                  */
/* -------------------------------------------------------------------- */

body {
	font-family: var(--font-jp);
	font-size: 16px;
	line-height: 1.8;
	color: var(--color-text);
	background: var(--color-white);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--font-en), var(--font-jp);
	font-weight: 700;
	line-height: 1.4;
	color: var(--color-navy);
	margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

a {
	color: var(--color-navy);
	text-decoration: none;
}
a:hover { color: var(--color-red); }

ul, ol { padding-left: 1.3em; }

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

button, input, textarea, select { font-family: inherit; font-size: inherit; }

:focus-visible {
	outline: 3px solid var(--color-red);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--color-navy);
	color: var(--color-white);
	padding: 10px 16px;
	z-index: 1000;
	border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { top: 0; }

.site-main { display: block; }

/* -------------------------------------------------------------------- */
/* Buttons / tags / pills                                               */
/* -------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 22px;
	border-radius: var(--radius-sm);
	font-weight: 700;
	font-size: 15px;
	border: 2px solid transparent;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
	background: var(--color-red);
	color: var(--color-white);
}
.btn--primary:hover { background: var(--color-red-dark); color: var(--color-white); }
.btn--outline {
	background: transparent;
	border-color: var(--color-navy);
	color: var(--color-navy);
}
.btn--outline:hover { background: var(--color-navy); color: var(--color-white); }

.tag {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	font-family: var(--font-en);
	letter-spacing: 0.02em;
}
.tag--navy { background: rgba(22, 50, 79, 0.08); color: var(--color-navy); }
.tag--red { background: rgba(216, 67, 50, 0.1); color: var(--color-red-dark); }
.tag--gray { background: var(--color-bg-light); color: var(--color-text-muted); border: 1px solid var(--color-border); }

.filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}
.filter-pill {
	padding: 7px 16px;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: 14px;
	font-weight: 600;
}
.filter-pill:hover { border-color: var(--color-navy); color: var(--color-navy); }
.filter-pill.is-active {
	background: var(--color-navy);
	border-color: var(--color-navy);
	color: var(--color-white);
}

/* -------------------------------------------------------------------- */
/* Header                                                                */
/* -------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: saturate(180%) blur(8px);
	border-bottom: 1px solid var(--color-navy);
}
.site-header__inner {
	max-width: var(--max-width);
	margin: 0 auto;
	height: var(--header-height);
	padding: 0 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.site-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--color-navy);
}
.site-logo__img { display: block; border-radius: 4px; }
.site-logo__text {
	font-family: var(--font-en);
	font-weight: 800;
	font-size: 18px;
	letter-spacing: -0.01em;
	white-space: nowrap;
}
.site-logo:hover { color: var(--color-navy); }

.site-nav--primary { display: none; }
.site-nav__list {
	display: flex;
	align-items: center;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.site-nav__list a {
	font-family: var(--font-en);
	font-weight: 600;
	font-size: 15px;
	color: var(--color-text);
	padding: 8px 0;
	border-bottom: 2px solid transparent;
}
.site-nav__list a:hover {
	color: var(--color-navy);
	border-bottom-color: var(--color-red);
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
}
.site-header__search-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 999px;
	color: var(--color-navy);
}
.site-header__search-icon:hover { background: var(--color-bg-light); }

.menu-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 4px;
	width: 38px;
	height: 38px;
	background: transparent;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.menu-toggle:hover { background: var(--color-bg-light); }
.menu-toggle__bar {
	width: 20px;
	height: 2px;
	background: var(--color-navy);
	display: block;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* -------------------------------------------------------------------- */
/* Mobile nav panel                                                     */
/* -------------------------------------------------------------------- */

.mobile-nav {
	position: fixed;
	inset: var(--header-height) 0 0 0;
	background: var(--color-white);
	z-index: 99;
	padding: 20px 16px 32px;
	overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }

.mobile-nav__search {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
}
.mobile-nav__search input {
	flex: 1;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
}
.mobile-nav__search button {
	padding: 12px 18px;
	background: var(--color-red);
	color: var(--color-white);
	border: none;
	border-radius: var(--radius-sm);
	font-weight: 700;
}

.mobile-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.mobile-nav__list li { border-bottom: 1px solid var(--color-border); }
.mobile-nav__list a {
	display: block;
	padding: 16px 4px;
	font-size: 17px;
	font-weight: 700;
	color: var(--color-navy);
}

@media (min-width: 900px) {
	.site-nav--primary { display: block; }
	.menu-toggle { display: none; }
}

/* -------------------------------------------------------------------- */
/* Hero (front page search home)                                        */
/* -------------------------------------------------------------------- */

.hero {
	background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-white) 100%);
	padding: 56px 16px 48px;
	text-align: center;
	border-bottom: 1px solid var(--color-navy);
}
.hero__inner { max-width: 720px; margin: 0 auto; }
.hero__title {
	font-size: clamp(28px, 5vw, 42px);
	margin-bottom: 0.3em;
}
.hero__subtitle {
	font-size: 16px;
	color: var(--color-text-muted);
	margin-bottom: 28px;
}
.hero__search {
	display: flex;
	gap: 8px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: 6px;
	box-shadow: var(--shadow-card);
}
.hero__search-input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 12px 14px;
	font-size: 16px;
	color: var(--color-text);
}
.hero__search-input:focus { outline: none; }
.hero__search-btn {
	background: var(--color-red);
	color: var(--color-white);
	border: none;
	border-radius: var(--radius-sm);
	padding: 0 24px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}
.hero__search-btn:hover { background: var(--color-red-dark); }

.hero__popular {
	margin-top: 18px;
	font-size: 14px;
	color: var(--color-text-muted);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 12px;
}
.hero__popular a { font-weight: 600; color: var(--color-navy); }
.hero__popular a:hover { color: var(--color-red); }

/* -------------------------------------------------------------------- */
/* Sections / layout                                                    */
/* -------------------------------------------------------------------- */

.section { padding: 48px 16px; }
.section__inner { max-width: var(--max-width); margin: 0 auto; }
.section__title { font-size: 24px; margin-bottom: 20px; }
.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}
.section__head .section__title { margin-bottom: 0; }
.section__more { font-weight: 700; font-size: 14px; white-space: nowrap; }

.tools-section { background: var(--color-white); }

/* -------------------------------------------------------------------- */
/* Tool cards                                                           */
/* -------------------------------------------------------------------- */

.tool-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}
@media (min-width: 640px) {
	.tool-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
	.tool-card-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.tool-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 24px 20px;
	box-shadow: var(--shadow-card);
	color: var(--color-text);
	transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover {
	box-shadow: var(--shadow-card-hover);
	transform: translateY(-2px);
	border-color: var(--color-navy);
	color: var(--color-text);
}
.tool-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-sm);
	background: var(--color-navy);
	color: var(--color-white);
	font-weight: 800;
	font-size: 16px;
	margin-bottom: 6px;
}
.tool-card__title {
	font-family: var(--font-en), var(--font-jp);
	font-weight: 800;
	font-size: 18px;
	color: var(--color-navy);
}
.tool-card__desc {
	font-size: 14.5px;
	color: var(--color-text-muted);
	line-height: 1.7;
}
.tool-card__example {
	font-size: 13px;
	color: var(--color-text-muted);
	background: var(--color-bg-light);
	border-radius: var(--radius-sm);
	padding: 8px 10px;
	margin-top: 4px;
}
.tool-card__cta {
	margin-top: auto;
	padding-top: 10px;
	font-weight: 700;
	font-size: 14px;
	color: var(--color-red);
}

/* -------------------------------------------------------------------- */
/* Learn / Teach path cards                                             */
/* -------------------------------------------------------------------- */

.learn-teach-section { background: var(--color-bg-light); }
.learn-teach-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}
@media (min-width: 720px) {
	.learn-teach-grid { grid-template-columns: 1fr 1fr; }
}
.path-card {
	display: flex;
	flex-direction: column;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 32px;
	color: var(--color-text);
	box-shadow: var(--shadow-card);
	border-top: 4px solid var(--color-navy);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.path-card--teach { border-top-color: var(--color-red); }
.path-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); color: var(--color-text); }
.path-card__title { font-size: 22px; margin-bottom: 10px; }
.path-card__desc { color: var(--color-text-muted); font-size: 15px; margin-bottom: 16px; }
.path-card__cta { margin-top: auto; font-weight: 700; color: var(--color-navy); }
.path-card--teach .path-card__cta { color: var(--color-red); }

/* -------------------------------------------------------------------- */
/* Post cards (articles)                                                */
/* -------------------------------------------------------------------- */

.post-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}
@media (min-width: 640px) {
	.post-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
	.post-card-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-card);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.post-card__link { display: block; color: var(--color-text); }
.post-card__thumb { aspect-ratio: 3 / 2; overflow: hidden; background: var(--color-bg-light); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 18px 20px 20px; }
.post-card__cat {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	color: var(--color-red);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 8px;
}
.post-card__title { font-size: 17px; margin-bottom: 8px; color: var(--color-navy); }
.post-card__excerpt { font-size: 14.5px; color: var(--color-text-muted); margin-bottom: 10px; }
.post-card__date { font-size: 13px; color: var(--color-text-muted); }

/* -------------------------------------------------------------------- */
/* Verb cards (database search-result style)                            */
/* -------------------------------------------------------------------- */

.verb-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 28px;
}
@media (min-width: 640px) {
	.verb-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
	.verb-card-grid { grid-template-columns: repeat(3, 1fr); }
}

.search-results-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	margin-top: 24px;
}
.search-results-list .post-card { max-width: none; }

.verb-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.verb-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); border-color: var(--color-navy); }
.verb-card__link { display: block; padding: 20px 22px; color: var(--color-text); }
.verb-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
}
.verb-card__title { font-size: 20px; margin-bottom: 0; color: var(--color-navy); }
.verb-card__tags { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.verb-card__meaning { font-size: 14px; color: var(--color-text-muted); margin-bottom: 12px; }
.verb-card__forms {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 14px;
	border-top: 1px dashed var(--color-border);
	padding-top: 10px;
}
.verb-card__forms li { display: flex; justify-content: space-between; }
.verb-card__forms span { color: var(--color-text-muted); }
.verb-card__cta { font-weight: 700; font-size: 13.5px; color: var(--color-red); }

/* -------------------------------------------------------------------- */
/* Archive / search page shell                                          */
/* -------------------------------------------------------------------- */

.archive-page, .error-404, .article-page {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 24px 16px 64px;
}
.archive-page__header { padding: 8px 0 8px; }
.archive-page__title { font-size: 28px; margin-bottom: 8px; }
.archive-page__desc { color: var(--color-text-muted); margin-bottom: 20px; }
.archive-page__search {
	display: flex;
	gap: 8px;
	max-width: 520px;
	margin-bottom: 6px;
}
.archive-page__search input {
	flex: 1;
	padding: 11px 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
}
.archive-page__search button {
	padding: 0 20px;
	background: var(--color-navy);
	color: var(--color-white);
	border: none;
	border-radius: var(--radius-sm);
	font-weight: 700;
	cursor: pointer;
}
.search-page__query { color: var(--color-red); }

.no-results { padding: 32px 0; color: var(--color-text-muted); }
.no-results__suggestions { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.no-results__suggestions a { font-weight: 700; }

.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 36px;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--color-border);
	color: var(--color-text);
	font-weight: 600;
}
.pagination .page-numbers.current { background: var(--color-navy); border-color: var(--color-navy); color: var(--color-white); }
.pagination .page-numbers:hover { border-color: var(--color-navy); }

/* -------------------------------------------------------------------- */
/* Breadcrumbs                                                          */
/* -------------------------------------------------------------------- */

.breadcrumb { margin: 16px 0; }
.breadcrumb__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	font-size: 13.5px;
	color: var(--color-text-muted);
}
.breadcrumb__item:not(:last-child)::after {
	content: "›";
	margin-left: 6px;
	color: var(--color-border);
}
.breadcrumb__item a { color: var(--color-text-muted); font-weight: 600; }
.breadcrumb__item a:hover { color: var(--color-navy); }
.breadcrumb__item span[aria-current] { color: var(--color-text); }

/* -------------------------------------------------------------------- */
/* Verb single page                                                     */
/* -------------------------------------------------------------------- */

.verb-page { max-width: var(--max-width); margin: 0 auto; padding-bottom: 64px; }

.verb-page__seo-title {
	margin: 20px 16px 14px;
	font-size: 14.5px;
	font-weight: 500;
	color: #9aa3ad;
}

.verb-hero {
	background: var(--color-bg-light);
	border-radius: var(--radius-lg);
	padding: 32px 24px;
	margin: 8px 16px 0;
	border: 1px solid var(--color-border);
}
.verb-hero__inner { max-width: 640px; }

.verb-hero__reading {
	font-size: clamp(16px, 3vw, 19px);
	color: var(--color-text-muted);
	margin: 0 0 4px;
}

.verb-hero__word-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
}
.verb-hero__word {
	font-size: clamp(32px, 7vw, 48px);
	font-weight: 800;
	color: var(--color-red);
	line-height: 1;
	margin: 0;
}
.speak-btn {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: none;
	background: var(--color-white);
	color: var(--color-navy);
	box-shadow: var(--shadow-card);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease, color 0.15s ease;
}
.speak-btn:hover { background: var(--color-navy); color: var(--color-white); }
.speak-btn:active { transform: scale(0.94); }
.speak-btn.is-speaking { background: var(--color-red); color: var(--color-white); }

.speak-btn--sm {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	background: transparent;
	color: var(--color-text-muted);
	box-shadow: none;
}
.speak-btn--sm:hover { background: var(--color-bg-light); color: var(--color-navy); }
.speak-btn--sm.is-speaking { background: transparent; color: var(--color-red); }

.verb-hero__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 32px;
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid var(--color-border);
}
.verb-hero__fact dt { font-size: 12.5px; color: var(--color-text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.verb-hero__fact dd { margin: 0; font-size: 18px; font-weight: 700; color: var(--color-navy); }

.verb-page__body { padding: 0 16px; }
.verb-section { margin-top: 36px; }
.verb-section__title { font-size: 20px; margin-bottom: 14px; }
.verb-section__title--muted { color: var(--color-text-muted); font-size: 16px; }
.verb-section__content { line-height: 1.9; }

.conjugation-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
}
.conjugation-table { font-size: 15px; }
.conjugation-table th,
.conjugation-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--color-navy);
}
.conjugation-table thead th {
	background: var(--color-navy);
	color: var(--color-white);
	font-weight: 700;
	font-size: 13.5px;
}
.conjugation-table tbody th {
	font-weight: 700;
	color: var(--color-text-muted);
	width: 35%;
	background: var(--color-bg-light);
}
.conjugation-table tbody td {
	font-weight: 600;
	font-size: 17px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.conjugation-table tbody tr:last-child th,
.conjugation-table tbody tr:last-child td { border-bottom: none; }

/* Adjective database (shares the verb page building blocks) */
.adjective-answer {
	margin: 14px 0 0;
	font-size: clamp(20px, 4.2vw, 26px);
	font-weight: 700;
	color: var(--color-text);
	line-height: 1.5;
}
.adjective-answer__type {
	display: inline-block;
	padding: 0 0.35em;
	border-radius: var(--radius-sm);
	background: rgba(22, 50, 79, 0.08);
	color: var(--color-navy);
}
.adjective-answer__type--na { background: rgba(216, 67, 50, 0.1); color: var(--color-red-dark); }
.conjugation-table__forms { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; }
.conjugation-table__alt { color: var(--color-text-muted); font-weight: 400; font-size: 15px; }
.conjugation-table__footnote { margin: 10px 0 0; font-size: 13px; color: var(--color-text-muted); }
.filter-pills--kana { margin-top: 8px; }
.filter-pills--kana .filter-pill { min-width: 2.4em; text-align: center; }
.archive-page__count { margin: 0 16px 12px; font-size: 13px; color: var(--color-text-muted); }

.verb-example {
	background: var(--color-bg-light);
	border-left: 3px solid var(--color-navy);
	padding: 14px 18px;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.verb-example__text { flex: 1; }

.callout {
	display: flex;
	gap: 14px;
	padding: 18px 20px;
	border-radius: var(--radius-md);
	border: 1px solid rgba(216, 67, 50, 0.25);
	background: rgba(216, 67, 50, 0.06);
}
.callout__icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: var(--color-red);
	color: var(--color-white);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
}
.callout__title { font-weight: 700; color: var(--color-red-dark); margin-bottom: 4px; }
.callout__text { margin: 0; color: var(--color-text); font-size: 15px; }

.callout--notice {
	border-color: var(--color-border);
	background: var(--color-bg-light);
}
.callout--notice .callout__icon { background: var(--color-navy); }
.callout--notice .callout__title { color: var(--color-navy); }

.cta-band {
	margin-top: 40px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	background: var(--color-navy);
	color: var(--color-white);
	padding: 22px 26px;
	border-radius: var(--radius-lg);
}
.cta-band p { margin: 0; font-weight: 700; font-size: 16px; }
.cta-band .btn--outline { border-color: var(--color-white); color: var(--color-white); }
.cta-band .btn--outline:hover { background: var(--color-white); color: var(--color-navy); }

.teacher-note {
	background: var(--color-bg-light);
	border-radius: var(--radius-md);
	padding: 18px 22px;
	border: 1px solid var(--color-border);
}
.teacher-note__text { color: var(--color-text-muted); font-size: 14.5px; margin: 0; }

/* -------------------------------------------------------------------- */
/* Articles                                                              */
/* -------------------------------------------------------------------- */

.article-page__header { padding-top: 8px; max-width: 760px; margin: 0 auto; }
.article-page__cat {
	display: inline-block;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--color-red);
	text-transform: uppercase;
	margin-bottom: 10px;
}
.article-page__title { font-size: clamp(22px, 3.4vw, 28px); }
.article-page__meta { color: var(--color-text-muted); font-size: 14px; margin-bottom: 14px; }
.article-page__lead { font-size: 18px; color: var(--color-text-muted); }
.article-page__thumb { margin: 20px 0; border-radius: var(--radius-lg); overflow: hidden; }
.article-page__body {
	max-width: 760px;
	margin: 24px auto 0;
	font-size: 17px;
	line-height: 1.9;
}
.article-page__body h2 {
	/* Stays below the h1 (22–28px) at every width. */
	font-size: clamp(20px, 2.8vw, 24px);
	margin-top: 2.4em;
	padding-bottom: 0.4em;
	border-bottom: 1px solid var(--color-navy);
}
.article-page__body h3 {
	font-size: clamp(18px, 2.4vw, 21px); /* below the h2 (20–24px) at every width */
	margin-top: 1.8em;
	padding: 0.15em 0 0.15em 12px;
	border-left: 4px solid var(--color-navy);
	line-height: 1.5;
}
.article-page__body img { border-radius: var(--radius-md); }
.article-page__body blockquote {
	margin: 1.4em 0;
	padding: 4px 20px;
	border-left: 3px solid var(--color-red);
	color: var(--color-text-muted);
}
.article-page__comments { max-width: 760px; margin: 40px auto 0; }

.related-articles { max-width: 760px; margin: 48px auto 0; }

/* -------------------------------------------------------------------- */
/* 404                                                                   */
/* -------------------------------------------------------------------- */

.error-404 { text-align: center; padding: 80px 16px; }
.error-404__title { font-size: 26px; }
.error-404__desc { color: var(--color-text-muted); margin-bottom: 28px; }
.error-404__search { max-width: 480px; margin: 0 auto 24px; }

/* -------------------------------------------------------------------- */
/* Footer                                                                */
/* -------------------------------------------------------------------- */

.site-footer {
	background: var(--color-navy);
	color: rgba(255, 255, 255, 0.85);
	margin-top: 48px;
}
.site-footer__inner {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 48px 16px 28px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}
@media (min-width: 720px) {
	.site-footer__inner { grid-template-columns: 1.2fr 1fr; }
}
.site-footer .site-logo { color: var(--color-white); }
.site-footer__tagline { margin-top: 12px; font-size: 14px; color: rgba(255, 255, 255, 0.65); max-width: 320px; }
.site-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px 20px;
}
.site-footer__list a { color: rgba(255, 255, 255, 0.85); font-size: 14.5px; }
.site-footer__list a:hover { color: var(--color-white); text-decoration: underline; }
.site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: 18px 16px;
	text-align: center;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.55);
}

/* -------------------------------------------------------------------- */
/* Oral cross-section diagram (口腔断面図)                              */
/* -------------------------------------------------------------------- */

.oral-diagram-wrap {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 20px;
	display: flex;
	justify-content: center;
}
.oral-diagram {
	width: 100%;
	max-width: 440px;
	height: auto;
}

.oral-diagram__nasal {
	fill: var(--color-white);
	stroke: var(--color-border);
	stroke-width: 1.5;
}
.oral-diagram__nasal.is-active {
	fill: rgba(216, 67, 50, 0.08);
	stroke: var(--color-red);
}
.oral-diagram__nostril { fill: var(--color-navy); }

.oral-diagram__tract {
	fill: var(--color-bg-light);
	stroke: var(--color-navy);
	stroke-width: 3;
	stroke-linejoin: round;
}

.oral-diagram__velum {
	fill: none;
	stroke: var(--color-navy);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.oral-diagram__uvula { fill: var(--color-navy); }

.oral-diagram__teeth-upper,
.oral-diagram__teeth-lower {
	stroke: var(--color-text-muted);
	stroke-width: 2.5;
	stroke-linecap: round;
}

.oral-diagram__lip {
	fill: none;
	stroke: var(--color-navy);
	stroke-width: 4;
	stroke-linecap: round;
}

.oral-diagram__glottis path {
	stroke: var(--color-red);
	stroke-width: 3;
	stroke-linecap: round;
}

.oral-diagram__contact {
	stroke: var(--color-red-dark);
	stroke-width: 4.5;
	stroke-linecap: round;
}
.oral-diagram__gap {
	stroke: var(--color-red-dark);
	stroke-width: 2.5;
	stroke-dasharray: 2 4;
	stroke-linecap: round;
}

.oral-diagram__tongue {
	fill: rgba(216, 67, 50, 0.18);
	stroke: var(--color-red-dark);
	stroke-width: 2.5;
	stroke-linejoin: round;
}

.oral-diagram__airflow {
	stroke: var(--color-red);
	stroke-width: 2.5;
	stroke-dasharray: 5 5;
	opacity: 0.85;
}

/* -------------------------------------------------------------------- */
/* Pronunciation single page + cards + archive                          */
/* -------------------------------------------------------------------- */

.pronunciation-hero .verb-hero__word { color: var(--color-navy); }

.pronunciation-audio {
	height: 40px;
	max-width: 220px;
}

.pronunciation-explainer {
	font-size: 16px;
	line-height: 1.9;
	background: var(--color-bg-light);
	border-radius: var(--radius-md);
	padding: 16px 20px;
}

.pronunciation-detail-list {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 40px;
	margin: 0;
}
.pronunciation-detail-list dt {
	font-size: 12.5px;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 4px;
}
.pronunciation-detail-list dd {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--color-navy);
}

.pronunciation-word-list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
}
.pronunciation-word-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: var(--color-bg-light);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	font-weight: 600;
}

.related-sounds-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.related-sounds-list__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	padding: 8px 14px;
	border-radius: var(--radius-sm);
	background: var(--color-bg-light);
	border: 1px solid var(--color-border);
	font-weight: 700;
	color: var(--color-navy);
}
a.related-sounds-list__item:hover { border-color: var(--color-navy); }
.related-sounds-list__item--muted { color: var(--color-text-muted); }

/* pronunciation card (archive / search results) */
.pronunciation-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 28px;
}
@media (min-width: 640px) {
	.pronunciation-card-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
	.pronunciation-card-grid { grid-template-columns: repeat(4, 1fr); }
}
.pronunciation-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.pronunciation-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); border-color: var(--color-navy); }
.pronunciation-card__link { display: block; padding: 20px; color: var(--color-text); }
.pronunciation-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pronunciation-card__kana { font-size: 28px; margin-bottom: 0; color: var(--color-red); }
.pronunciation-card__reading { display: flex; gap: 8px; font-size: 14px; color: var(--color-text-muted); margin-bottom: 10px; }
.pronunciation-card__ipa { font-family: var(--font-en); }
.pronunciation-card__tags { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pronunciation-card__cta { font-weight: 700; font-size: 13.5px; color: var(--color-red); }

/* gojuon-grouped archive index */
.gojuon-row { margin-top: 36px; }
.gojuon-row__title { font-size: 18px; color: var(--color-navy); margin-bottom: 12px; }
.gojuon-row__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.gojuon-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 14px;
	border-radius: var(--radius-md);
	background: var(--color-white);
	border: 1px solid var(--color-border);
	font-size: 18px;
	font-weight: 700;
	color: var(--color-navy);
	box-shadow: var(--shadow-card);
}
.gojuon-chip:hover { border-color: var(--color-red); color: var(--color-red); box-shadow: var(--shadow-card-hover); }

/* -------------------------------------------------------------------- */
/* Pitch accent diagram (高低アクセント図)                              */
/* -------------------------------------------------------------------- */

.pitch-accent-wrap {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 24px 20px;
	text-align: center;
}
.pitch-accent-svg {
	width: 100%;
	max-width: 700px;
	height: auto;
}
.pitch-accent-svg__line {
	stroke: var(--color-navy);
	stroke-width: 3;
	stroke-linecap: round;
}
.pitch-accent-svg__line.is-drop { stroke: var(--color-red); }
.pitch-accent-svg__circle {
	fill: var(--color-navy);
	stroke: var(--color-white);
	stroke-width: 2;
}
.pitch-accent-svg__circle.is-core {
	fill: var(--color-red);
}
.pitch-accent-svg__label {
	fill: var(--color-white);
	font-size: 15px;
	font-weight: 700;
	font-family: var(--font-jp);
	text-anchor: middle;
	dominant-baseline: central;
}
.pitch-accent-caption {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--color-text-muted);
}
.pitch-accent-note {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: var(--color-text-muted);
}

.accent-detail-list {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 40px;
	margin: 16px 0 0;
}
.accent-detail-list dt {
	font-size: 12.5px;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 4px;
}
.accent-detail-list dd {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--color-navy);
}

.mora-breakdown {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 16px;
}
.mora-breakdown__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: var(--radius-sm);
	background: var(--color-bg-light);
	font-weight: 700;
	font-size: 17px;
	color: var(--color-navy);
}

.accent-word-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.accent-word-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); border-color: var(--color-navy); }
.accent-word-card__link { display: block; padding: 20px; color: var(--color-text); }
.accent-word-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.accent-word-card__word { font-size: 22px; margin-bottom: 0; color: var(--color-navy); }
.accent-word-card__kana { font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 10px; }
.pitch-accent-wrap--sm { padding: 12px 8px; margin-bottom: 10px; }
.pitch-accent-wrap--sm .pitch-accent-svg { max-width: 100%; }

/* -------------------------------------------------------------------- */
/* Learner background (country/region) pages + cards                    */
/* -------------------------------------------------------------------- */

.learner-background-hero__title { font-size: clamp(28px, 6vw, 40px); }

.prefecture-ranking {
	list-style: none;
	counter-reset: pref;
	margin: 0;
	padding: 0;
	max-width: 420px;
}
.prefecture-ranking li {
	counter-increment: pref;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--color-navy);
	font-weight: 600;
}
.prefecture-ranking li::before {
	content: counter(pref) ".";
	color: var(--color-text-muted);
	font-weight: 700;
	margin-right: 10px;
	width: 1.5em;
	display: inline-block;
}
.prefecture-ranking__name { flex: 1; }
.prefecture-ranking__count { color: var(--color-navy); }

.related-articles-list {
	list-style: disc;
	margin: 0 0 0 20px;
	padding: 0;
}
.related-articles-list li { margin-bottom: 6px; }

.learner-background-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.learner-background-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); border-color: var(--color-navy); }
.learner-background-card__link { display: block; padding: 20px; color: var(--color-text); }
.learner-background-card__title { font-size: 20px; margin-bottom: 6px; color: var(--color-navy); }
.learner-background-card__meta { font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 10px; }
.learner-background-card__stats { font-size: 14px; color: var(--color-text); margin-bottom: 10px; }
.learner-background-card__cta { font-weight: 700; font-size: 13.5px; color: var(--color-red); }

/* -------------------------------------------------------------------- */
/* Comments (minimal, inherits WP core markup)                          */
/* -------------------------------------------------------------------- */

.comment-list { list-style: none; padding: 0; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	margin-bottom: 12px;
}

/* -------------------------------------------------------------------- */
/* JLPT Database                                                         */
/* Data-first: big numbers, one bar hue, tables alongside every chart.   */
/* -------------------------------------------------------------------- */

.jlpt-page { max-width: var(--max-width); margin: 0 auto; padding: 0 16px 64px; }
.jlpt-page .breadcrumb { padding-left: 0; padding-right: 0; }

.jlpt-muted { color: var(--color-text-muted); }
.jlpt-small { font-size: 12.5px; font-weight: 400; }
.jlpt-note { font-size: 13px; color: var(--color-text-muted); margin-top: 10px; line-height: 1.7; }

.jlpt-hero { padding: 24px 0 8px; }
.jlpt-hero__eyebrow { font-family: var(--font-en); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--color-red); margin: 0 0 6px; }
.jlpt-hero__eyebrow a { color: inherit; text-decoration: underline; }
.jlpt-hero__title { font-size: 26px; margin-bottom: 8px; }
.jlpt-hero__lead { color: var(--color-text-muted); max-width: 640px; }
@media (min-width: 720px) {
	.jlpt-hero__title { font-size: 32px; }
}

.jlpt-section { margin-top: 40px; }
.jlpt-section__title { font-size: 20px; margin-bottom: 14px; }

/* Search */
.jlpt-search {
	position: relative;
	display: flex;
	gap: 8px;
	max-width: 640px;
	margin-top: 18px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: 6px;
	box-shadow: var(--shadow-card);
}
.jlpt-search__input { flex: 1; min-width: 0; border: none; background: transparent; padding: 10px 12px; font-size: 16px; color: var(--color-text); }
.jlpt-search__input:focus { outline: none; }
.jlpt-search:focus-within { border-color: var(--color-navy); }
.jlpt-search__btn { background: var(--color-red); color: var(--color-white); border: none; border-radius: var(--radius-sm); padding: 0 20px; font-weight: 700; cursor: pointer; }
.jlpt-search__btn:hover { background: var(--color-red-dark); }
.jlpt-search__list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 20;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card-hover);
}
.jlpt-search__list a,
.jlpt-search__empty { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--color-text); font-size: 15px; }
.jlpt-search__empty { color: var(--color-text-muted); }
.jlpt-search__list li.is-active a,
.jlpt-search__list a:hover { background: var(--color-bg-light); }

.jlpt-place-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.jlpt-place-list a { display: block; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text); }
.jlpt-place-list a:hover { border-color: var(--color-navy); }

/* Chips (exam switcher, level nav) */
.jlpt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.jlpt-chip {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	color: var(--color-navy);
	background: var(--color-white);
}
.jlpt-chip:hover { border-color: var(--color-navy); color: var(--color-navy); }
.jlpt-chip.is-active { background: var(--color-navy); border-color: var(--color-navy); color: var(--color-white); }
.jlpt-chips--levels .jlpt-chip { font-family: var(--font-en); min-width: 56px; justify-content: center; }

/* Headline numbers */
.jlpt-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
@media (min-width: 900px) {
	.jlpt-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
.jlpt-stat { padding: 14px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-white); }
.jlpt-stat--hero { grid-column: 1 / -1; background: var(--color-bg-light); }
@media (min-width: 900px) {
	.jlpt-stat--hero { grid-column: auto; }
}
.jlpt-stat__label { font-size: 12.5px; color: var(--color-text-muted); margin-bottom: 2px; }
.jlpt-stat__value { margin: 0; font-family: var(--font-en), var(--font-jp); font-size: 22px; font-weight: 700; color: var(--color-navy); font-variant-numeric: tabular-nums; line-height: 1.3; }
.jlpt-stat--hero .jlpt-stat__value { font-size: 34px; }
.jlpt-stat__note { margin: 2px 0 0; font-size: 12.5px; color: var(--color-text-muted); }

/* Level bar chart */
.jlpt-bars { margin: 20px 0 0; }
.jlpt-bars__caption { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }
.jlpt-bars__list { list-style: none; margin: 0; padding: 0; }
.jlpt-bars__row {
	position: relative;
	display: grid;
	grid-template-columns: 36px 1fr minmax(88px, auto);
	align-items: center;
	gap: 10px;
	padding: 5px 0;
	border-radius: var(--radius-sm);
	outline-offset: 0;
}
.jlpt-bars__label { font-family: var(--font-en); font-weight: 700; color: var(--color-navy); font-size: 15px; }
.jlpt-bars__track { height: 24px; display: flex; align-items: center; }
.jlpt-bars__bar { display: block; height: 100%; min-width: 2px; background: var(--color-navy); border-radius: 0 4px 4px 0; transition: width 0.25s ease; }
.jlpt-bars--has-highlight .jlpt-bars__bar { background: #b9c3cf; }
.jlpt-bars--has-highlight .is-active .jlpt-bars__bar { background: var(--color-navy); }
.jlpt-bars__value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-text); font-size: 15px; white-space: nowrap; }
.jlpt-bars__value small { display: inline-block; min-width: 48px; margin-left: 6px; font-weight: 400; font-size: 12.5px; color: var(--color-text-muted); }
.jlpt-bars__tip {
	position: absolute;
	left: 46px;
	bottom: calc(100% - 2px);
	z-index: 5;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	background: var(--color-navy-dark);
	color: var(--color-white);
	font-size: 12.5px;
	max-width: calc(100% - 46px);
	width: max-content;
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.12s, transform 0.12s;
}
.jlpt-bars__row:hover .jlpt-bars__tip,
.jlpt-bars__row:focus .jlpt-bars__tip { opacity: 1; transform: none; }
.jlpt-bars__row:hover { background: var(--color-bg-light); }

/* Named rows (country names instead of N1–N5) */
.jlpt-bars--named .jlpt-bars__row { grid-template-columns: 7.5em 1fr minmax(64px, auto); }
.jlpt-bars--named .jlpt-bars__label { font-family: inherit; font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jlpt-bars--named a.jlpt-bars__label:hover { text-decoration: underline; }
.jlpt-bars--named .jlpt-bars__tip { left: 0; max-width: 100%; }
.jlpt-bars--named .jlpt-bars__value small { min-width: 64px; }
@media (max-width: 480px) {
	.jlpt-bars--named .jlpt-bars__row { grid-template-columns: 6.5em 1fr auto; gap: 8px; }
	.jlpt-bars--named .jlpt-bars__value small { display: none; }
}
.lb-share-bars__source { margin-top: 10px; font-size: 12px; }

/* Tables */
.jlpt-table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); -webkit-overflow-scrolling: touch; }
.jlpt-table { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.jlpt-table th,
.jlpt-table td { padding: 9px 12px; border-bottom: 1px solid var(--color-border); text-align: left; white-space: nowrap; }
.jlpt-table thead th { background: var(--color-bg-light); font-size: 12.5px; color: var(--color-text-muted); font-weight: 700; }
.jlpt-table tbody th { font-weight: 700; }
.jlpt-table tfoot th,
.jlpt-table tfoot td { font-weight: 700; border-bottom: none; background: var(--color-bg-light); }
.jlpt-table tbody tr:last-child th,
.jlpt-table tbody tr:last-child td { border-bottom: none; }
.jlpt-table .num { text-align: right; }
.jlpt-table tr.is-current { background: rgba(22, 50, 79, 0.05); }
.jlpt-table tbody tr:hover { background: var(--color-bg-light); }
.jlpt-table--ranking tbody th { position: sticky; left: 0; background: var(--color-white); }
.jlpt-table--ranking tbody tr:hover th { background: var(--color-bg-light); }

/* Explorer */
.jlpt-explorer { padding: 20px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-white); box-shadow: var(--shadow-card); }
@media (min-width: 720px) {
	.jlpt-explorer { padding: 28px; }
}
.jlpt-explorer__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (min-width: 900px) {
	.jlpt-explorer__form { grid-template-columns: 110px 160px minmax(0, 1fr); }
}
.jlpt-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 0; border: none; }
.jlpt-field label,
.jlpt-field legend { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); padding: 0; }
.jlpt-field select { width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-white); color: var(--color-text); }
.jlpt-field--wide,
.jlpt-field--levels { grid-column: 1 / -1; }
@media (min-width: 900px) {
	.jlpt-field--wide { grid-column: auto; }
}
.jlpt-segmented { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.jlpt-segmented__item { position: relative; margin: 0; }
.jlpt-segmented__item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.jlpt-segmented__item span { display: flex; align-items: center; justify-content: center; min-height: 44px; font-family: var(--font-en), var(--font-jp); font-weight: 700; font-size: 14px; color: var(--color-navy); border-left: 1px solid var(--color-border); }
.jlpt-segmented__item:first-child span { border-left: none; font-size: 12.5px; }
.jlpt-segmented__item input:checked + span { background: var(--color-navy); color: var(--color-white); }
.jlpt-segmented__item input:focus-visible + span { outline: 3px solid var(--color-red); outline-offset: -3px; }
.jlpt-explorer__result { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); transition: opacity 0.15s; }
.jlpt-explorer__result.is-loading { opacity: 0.5; }
.jlpt-explorer__heading { font-weight: 700; color: var(--color-navy); margin: 0; }

.jlpt-more { font-weight: 700; color: var(--color-red); }

/* Cities */
.jlpt-city-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) {
	.jlpt-city-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
	.jlpt-city-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.jlpt-city-list__item a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text); }
.jlpt-city-list__item a:hover { border-color: var(--color-navy); }
.jlpt-city-list__name { font-weight: 700; min-width: 0; }
.jlpt-city-list__value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-navy); white-space: nowrap; }
.jlpt-city-list__item.is-empty .jlpt-city-list__value { font-weight: 400; font-size: 13px; color: var(--color-text-muted); }

.jlpt-links { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.jlpt-links a { font-weight: 700; }

/* Source + disclaimer */
.jlpt-source { margin-top: 56px; padding: 20px; border-radius: var(--radius-md); background: var(--color-bg-light); font-size: 13.5px; color: var(--color-text-muted); }
.jlpt-source__title { font-size: 15px; margin-bottom: 6px; }
.jlpt-source__text { margin-bottom: 8px; }
.jlpt-source__files { margin: 0 0 12px; padding-left: 1.2em; }
.jlpt-source__notice { border-top: 1px solid var(--color-border); padding-top: 12px; }
.jlpt-source__notice p { margin: 0 0 4px; }
.jlpt-source a { text-decoration: underline; }

/* Trend line chart. Series colors validated for CVD separation on white. */
.jlpt-line { --jlpt-s1: #2f6db5; --jlpt-s2: #d84332; margin: 20px 0 0; }
.jlpt-line--s1 { --c: var(--jlpt-s1); }
.jlpt-line--s2 { --c: var(--jlpt-s2); }
.jlpt-line__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; color: var(--color-text); }
.jlpt-line__legend li { display: inline-flex; align-items: center; gap: 6px; }
.jlpt-line__swatch { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 4px; }
.jlpt-line__legend .jlpt-line__swatch { margin-right: 0; }
.jlpt-line__plot { position: relative; height: 220px; margin: 12px 88px 32px 56px; }
@media (min-width: 720px) {
	.jlpt-line__plot { height: 260px; }
}
.jlpt-line__grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--color-border); }
.jlpt-line__grid--base { border-top-color: #c9ced6; }
.jlpt-line__grid span { position: absolute; right: calc(100% + 8px); top: -9px; font-size: 12px; line-height: 18px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jlpt-line__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jlpt-line__svg polyline { fill: none; stroke: var(--c); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.jlpt-line__dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--color-white); pointer-events: none; }
.jlpt-line__end { position: absolute; margin-left: 12px; transform: translateY(50%); font-size: 12.5px; font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.jlpt-line__end em { font-style: normal; font-weight: 400; color: var(--color-text-muted); margin-right: 4px; }
.jlpt-line__col { position: absolute; top: 0; bottom: 0; outline: none; }
.jlpt-line__col::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--color-text-muted); opacity: 0; }
.jlpt-line__x { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); font-size: 12.5px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.jlpt-line__tip {
	position: absolute;
	left: 50%;
	top: -8px;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	background: var(--color-navy-dark);
	color: var(--color-white);
	font-size: 12.5px;
	line-height: 1.5;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -100%);
	transition: opacity 0.12s;
}
.jlpt-line__col.is-first .jlpt-line__tip { left: 0; transform: translate(0, -100%); }
.jlpt-line__col.is-last .jlpt-line__tip { left: auto; right: 0; transform: translate(0, -100%); }
.jlpt-line__col:hover::before,
.jlpt-line__col:focus-visible::before,
.jlpt-line__col:hover .jlpt-line__tip,
.jlpt-line__col:focus-visible .jlpt-line__tip { opacity: 1; }
.jlpt-line__col:focus-visible .jlpt-line__x { color: var(--color-red); font-weight: 700; }

.jlpt-line__col:not(.is-major) .jlpt-line__x { visibility: hidden; }
@media (max-width: 639px) {
	.jlpt-line__col .jlpt-line__x { visibility: hidden; }
	.jlpt-line__col.is-major-sm .jlpt-line__x { visibility: visible; }
}
.jlpt-line__col:hover .jlpt-line__x,
.jlpt-line__col:focus-visible .jlpt-line__x { visibility: visible; color: var(--color-red); font-weight: 700; }

.jlpt-chips__more { display: contents; }
.jlpt-chips__more > summary {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 1px dashed var(--color-border);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text-muted);
	cursor: pointer;
	list-style: none;
}
.jlpt-chips__more > summary::-webkit-details-marker { display: none; }
.jlpt-chips__more[open] > summary { color: var(--color-navy); border-color: var(--color-navy); }
