/* JAccent dictionary + pitch-accent guide pages (generated by build_dictionary.py).
   Loaded after landing.css, so header, footer, buttons and every colour below come from the site's theme tokens
   (dark by default, light via data-theme). */

.dict-main { display: block; padding: clamp(28px, 4vw, 52px) 0 8px; }
.dict-wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 32px); }
.dict-cta-wrap { padding-bottom: clamp(36px, 5vw, 64px); }
:lang(ja) { letter-spacing: .02em; }

.jx-dict a { color: var(--green-text); }
.jx-dict .jx-nav a, .jx-dict .jx-footer a { color: inherit; }
.jx-dict .jx-nav .jx-btn-primary { color: var(--btn-ink); }
.jx-dict .jx-footer p a { color: var(--muted); }
.jx-dict .jx-footer p a:hover { color: var(--green); }
.jx-dict .dict-main a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- headings ---------- */
.dict-main h1 {
	margin: 4px 0 0;
	font-size: clamp(2rem, 1.2rem + 2.8vw, 3.1rem);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -.03em;
	text-wrap: balance;
	color: var(--heading);
}
.lede { margin: 14px 0 0; font-size: clamp(1rem, .95rem + .2vw, 1.1rem); line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.breadcrumb-trail { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--faint); }
.breadcrumb-trail a { color: var(--green-text); }

/* ---------- cards ---------- */
.card {
	margin: 18px 0;
	padding: 22px 24px;
	border-radius: 20px;
	background: var(--card-bg);
	border: 1px solid var(--line);
	box-shadow: var(--card-shadow);
}
.card > h2 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; color: var(--heading); }
.card > *:last-child { margin-bottom: 0; }
.card p { margin: 0 0 12px; color: var(--text-3); }
.dict-main h1 + .lede + .card, .dict-main .lede + .dict-search { margin-top: 26px; }

/* ---------- word page ---------- */
.word-head { padding: 26px 26px 24px; }
.word-head h1 { font-size: clamp(2.4rem, 1.6rem + 3.2vw, 3.6rem); letter-spacing: -.01em; line-height: 1.15; }
.word-head .reading { margin: 10px 0 0; font-size: 1.05rem; color: var(--muted); }
.word-head .romaji { color: var(--faint); }

.pitch-card { text-align: center; }
.pitch-card > h2 { text-align: left; }
.pitch-row { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0; padding: 16px 0; }
.pitch-row + .pitch-row { border-top: 1px solid var(--line); }
.pitch-row .form-label { font-size: .9rem; color: var(--muted); }
.pitch-svg { max-width: 100%; overflow-x: auto; }
.pitch-svg svg { display: block; margin: 0 auto; }
.pitch-svg svg text { fill: var(--muted); }
.pitch-svg svg path { stroke: #f87171; }
:root[data-theme="light"] .pitch-svg svg path { stroke: #dc2626; }
.pitch-meta { display: inline-flex; align-items: center; gap: 10px; }
.accent-type {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	background: rgba(var(--green-rgb), .12);
	border: 1px solid rgba(var(--green-rgb), .28);
	font-size: .82rem;
	font-weight: 600;
	color: var(--green-text);
	white-space: nowrap;
}
.audio-btn {
	display: inline-flex;
	align-items: center;
	padding: 6px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--green-text);
	line-height: 0;
	cursor: pointer;
	transition: background-color .2s, transform .3s var(--ease);
}
.audio-btn:hover { background: rgba(var(--green-rgb), .14); transform: scale(1.08); }

.senses { margin: 0; padding: 0; list-style: none; }
.senses li { margin: 8px 0; padding-left: 1.15em; text-indent: -1.15em; color: var(--text-3); }
.senses li::before { content: "・"; color: var(--faint); }

.meta { display: flex; flex-direction: column; gap: 8px; }
.meta p { margin: 0; font-size: .95rem; color: var(--muted); }
.lvl-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.lvl-beg { background: #38bdf8; } .lvl-int { background: #fb923c; } .lvl-adv { background: #a78bfa; }

.examples ul { margin: 0; padding: 0; list-style: none; }
.examples li { margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--line); list-style: none; }
.examples li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.examples .ex-hira, .examples .ex-meaning { font-size: .92rem; color: var(--muted); }

.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related h2 { flex-basis: 100%; }
.related a {
	display: inline-block;
	padding: 5px 14px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	font-size: .9rem;
	color: var(--text-2);
	transition: border-color .25s, background-color .25s, color .25s;
}
.related a:hover { border-color: rgba(var(--mint-rgb), .55); background: var(--surface-2); color: var(--heading); text-decoration: none; }

/* ---------- hub / listings ---------- */
.word-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.word-grid li { margin: 0; list-style: none; }
.word-grid a { display: inline-block; padding: 3px 0; color: var(--text-2); transition: color .2s; }
.word-grid a:hover { color: var(--green-text); text-decoration: none; }
.dict-search { display: flex; gap: 10px; margin: 22px 0; }
.dict-search input[type=search] {
	flex: 1;
	min-width: 0;
	height: 48px;
	padding: 0 18px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}
.dict-search input[type=search]::placeholder { color: var(--faint); }
.dict-search input[type=search]:focus { outline: 2px solid var(--green); outline-offset: 2px; }
.dict-search button {
	height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--btn-grad);
	color: var(--btn-ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 30px -12px rgba(74, 222, 128, .7);
	transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.dict-search button:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(74, 222, 128, .85); }
.pager { margin-top: 14px; }
.pager a { margin-right: 18px; font-weight: 600; }

/* level links under "Explore" */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.chip-list li { margin: 0; list-style: none; }
.chip-list a {
	display: inline-block;
	padding: 5px 14px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	font-size: .9rem;
	color: var(--text-2);
	transition: border-color .25s, background-color .25s, color .25s;
}
.chip-list a:hover { border-color: rgba(var(--mint-rgb), .55); background: var(--surface-2); color: var(--heading); text-decoration: none; }

/* the pitch diagram is the hero of a word page: show it larger */
.pitch-card .pitch-svg svg { zoom: 1.45; }

/* ---------- pillar (guide) ---------- */
.pattern { margin: 0 0 22px; }
.pattern:last-child { margin-bottom: 0; }
.pattern h3 { margin: 0 0 4px; font-size: 1.08rem; font-weight: 700; color: var(--heading); }
.pattern p { margin: 0 0 8px; }
.pattern-example { margin: 12px 0 0; }
/* -7px on the wrapper lands the SVG's internal kana baseline on the label's text baseline */
.pattern-example .pitch-svg { display: inline-block; margin-right: 12px; vertical-align: -7px; }
.pattern-example .pitch-svg svg { display: block; margin: 0; }

/* ---------- app call-to-action + store links ---------- */
.app-cta {
	padding: 26px 28px;
	border-radius: 22px;
	color: #f2fff6;
	background: linear-gradient(150deg, #15803d, #166534 58%, #1e3a8a 140%);
	border: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 30px 60px -32px rgba(22, 163, 74, .7);
}
.app-cta p { margin: 0 0 12px; font-size: .98rem; line-height: 1.65; color: rgba(242, 255, 246, .88); }
.app-cta > *:last-child { margin-bottom: 0; }
.app-cta .app-cta-lead { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; }
.store-links a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 18px;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-weight: 600;
	font-size: .92rem;
	transition: background-color .25s, border-color .25s, transform .3s var(--ease);
}
.store-links a:hover { background: var(--surface-2); border-color: rgba(var(--mint-rgb), .55); text-decoration: none; transform: translateY(-2px); }
.store-links svg { flex: none; }
/* all three chips on one line, or stacked and centred, never 2 + 1 */
.app-cta { container-type: inline-size; }
@container (max-width: 445px) {
	.store-links { flex-direction: column; align-items: center; }
	.store-links a { justify-content: center; width: min(100%, 260px); }
}
.app-cta .store-links a { border-color: rgba(255, 255, 255, .55); background: transparent; color: #fff; }
.app-cta .store-links a:hover { background: #fff; color: #14532d; border-color: #fff; }

/* ---------- "listen" dialog ---------- */
.audio-dialog {
	/* fixed, not relative: dialog:modal is anchored to the viewport; overriding it dropped it into the document flow
	   and showModal() scrolled the whole page back up */
	position: fixed;
	width: calc(100% - 32px);
	max-width: 360px;
	padding: 26px 26px 24px;
	border: 1px solid var(--line-2);
	border-radius: 22px;
	background: var(--bg-2);
	color: var(--text);
	box-shadow: var(--pop-shadow);
}
.audio-dialog::backdrop { background: rgba(2, 8, 5, .62); backdrop-filter: blur(4px); }
.audio-dialog h2 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; color: var(--heading); }
.audio-dialog p { margin: 0 0 16px; font-size: .95rem; color: var(--muted); }
.audio-links { display: flex; flex-direction: column; gap: 10px; }
.audio-links a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 16px;
	border: 1px solid var(--line-2);
	border-radius: 14px;
	background: var(--surface);
	color: var(--text);
	font-weight: 600;
	transition: border-color .25s, background-color .25s;
}
.audio-links a:hover { border-color: rgba(var(--mint-rgb), .55); background: var(--surface-2); text-decoration: none; }
.audio-links svg { flex: none; }
.audio-x { position: absolute; top: 10px; right: 12px; padding: 4px 8px; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--faint); cursor: pointer; }
.audio-x:hover { color: var(--heading); }
.audio-try { margin: 0 0 14px; font-weight: 700; color: var(--heading); }

@media (max-width: 520px) {
	.word-grid { grid-template-columns: 1fr; }
	.card { padding: 20px; }
	.dict-search { flex-direction: column; }
	/* column direction: flex: 1 would make the height basis 0 and squash the field */
	.dict-search input[type=search] { flex: none; width: 100%; }
	.dict-search button { flex: none; width: 100%; }
}
