/* Alphabet Symbol - one stylesheet for the whole site.
   Sections: 1 base · 2 layout (main, breadcrumbs, share) · 3 header · 4 footer · 5 home · 6 alphabet page · 7 learning guides
             · 8 download pages · 9 printable sheets · 10 static pages · 11 404 */

/* ===================================================== 1. base */
:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --text: #3d3d3a;
  --text-muted: rgba(61, 61, 58, 0.72);
  --border: rgba(61, 61, 58, 0.14);
  --key-bg: #ffffff;
  --key-shadow: rgba(0, 0, 0, 0.04);
  --key-border: rgba(61, 61, 58, 0.14);
  --key-active: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --key-highlight: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent: #d97757;
  --accent-hover: #c86447;
  --header-bg: rgba(250, 249, 245, 0.86);
  --footer-bg: #faf9f5;
  --menu-bg: rgba(255, 255, 255, 0.96);
  --overlay: rgba(0, 0, 0, 0.45);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --radius-key: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.10);
  --transition: 0.2s ease;
}
html[data-theme='dark'] {
  --bg: #0f0f0e;
  --surface: #171615;
  --text: #f3f3f0;
  --text-muted: rgba(243, 243, 240, 0.72);
  --border: rgba(243, 243, 240, 0.16);
  --key-bg: #1c1b1a;
  --key-shadow: rgba(0, 0, 0, 0.22);
  --key-border: rgba(243, 243, 240, 0.16);
  --key-active: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --key-highlight: color-mix(in srgb, var(--accent) 26%, transparent);
  --header-bg: rgba(15, 15, 14, 0.86);
  --footer-bg: #0f0f0e;
  --menu-bg: rgba(23, 22, 21, 0.96);
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; color-scheme: light; }
html[data-theme='dark'] { color-scheme: dark; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }
.page-title { text-align: center; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 734px) { .container { padding: 0 16px; } }

/* FAQ blocks (used inside page content) */
.faq-section { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 25px; }
.faq-section h3 { margin: 0 0 20px 0; font-size: 1.15rem; font-weight: 600; color: var(--text); text-align: center; }
.faq-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.faq-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.faq-item p { margin: 0; line-height: 1.6; }
.faq-item p:first-child { color: var(--text-muted); font-weight: 400; margin-bottom: 8px; font-size: 0.95rem; }
.faq-item p:first-child::before { content: "» "; color: var(--text-muted); font-weight: 400; }
.faq-item p:nth-child(2) { color: #4c4c4e; font-size: 0.9375rem; padding-left: 20px; position: relative; }
.faq-item p:nth-child(2)::before { content: ""; position: absolute; left: 0; color: var(--text-muted); font-weight: 500; }
@media (max-width: 734px) {
  .faq-section { margin-top: 32px; padding: 20px 0; }
  .faq-section h3 { font-size: 1.15rem; margin-bottom: 20px; }
  .faq-item { margin-bottom: 16px; padding-bottom: 16px; }
  .faq-item p:first-child { font-size: 0.9rem; }
  .faq-item p:nth-child(2) { font-size: 0.875rem; padding-left: 16px; }
}
.hero-title::after { content: ''; display: block; width: 80px; height: 3px; background-color: #d7745b; margin: 20px auto 0; border-radius: 2px; opacity: 0.8; }

/* ===================================================== 2. layout */
.main { min-height: calc(100vh - 52px - 120px); display: flex; flex-direction: column; }
.breadcrumbs-wrap { padding-top: 12px; padding-bottom: 8px; }
.breadcrumbs-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.breadcrumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.875rem; color: var(--text-muted); }
.breadcrumbs-actions { position: relative; flex: none; }
.share-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background var(--transition), border-color var(--transition); }
.share-icon { width: 18px; height: 18px; display: block; background: currentColor; mask-image: url('/share.svg'); mask-repeat: no-repeat; mask-position: center; mask-size: contain; -webkit-mask-image: url('/share.svg'); -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain; }
.share-btn:hover { background: var(--key-active); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.share-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 6px; z-index: 60; }
.share-menu[hidden] { display: none !important; }
.share-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 72%, var(--surface)); color: var(--text); text-decoration: none; font: inherit; cursor: pointer; font-size: 0.92rem; line-height: 1; }
.share-item svg { width: 16px; height: 16px; flex: none; }
.share-item:hover { background: var(--key-active); text-decoration: none; }
.copy-link { text-align: left; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 500; }
.bc-sep { margin: 0 2px; user-select: none; }

/* ===================================================== 3. header */
.header { position: sticky; top: 0; z-index: 100; background: var(--header-bg); border-bottom: 1px solid var(--border); transition: background var(--transition), box-shadow var(--transition), border-color var(--transition); }
.header.is-scrolled { background: color-mix(in srgb, var(--header-bg) 80%, transparent); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); border-color: color-mix(in srgb, var(--accent) 10%, var(--border)); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 20px; max-width: 1200px; margin: 0 auto; transition: height var(--transition); }
.header.is-scrolled .header-inner { height: 58px; }
@media (max-width: 734px) { .header-inner { padding: 0 14px; } }
.menu-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text); cursor: pointer; border-radius: var(--radius); transition: background var(--transition); }
.menu-btn:hover { background: var(--key-active); }
.hamburger { display: flex; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px; }
.logo { position: absolute; left: 50%; transform: translateX(-50%); text-decoration: none; color: var(--text); }
.logo:hover { text-decoration: none; opacity: 0.85; }
.logo-mark { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 70px; background: #efeadd; box-shadow: none; font-size: 21px; transition: padding var(--transition), font-size var(--transition); }
.logo-pill { display: inline-flex; align-items: center; padding: 8px 15px 10px 15px; border-radius: 70px; background: #d7745b; color: #fff; font-weight: 700; font-size: 21px; line-height: 1; transition: padding var(--transition), font-size var(--transition); }
.logo-word { color: #d7745b; font-weight: 700; line-height: 1; padding-right: 6px; font-size: 21px; transition: font-size var(--transition); }
.header.is-scrolled .logo-mark { padding: 6px 7px; font-size: 18px; }
.header.is-scrolled .logo-pill { padding: 7px 12px 8px 12px; font-size: 18px; }
.header.is-scrolled .logo-word { font-size: 18px; }
html[data-theme='dark'] .logo-mark { background: #1c1b1a; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34); }
html[data-theme='dark'] .logo-word { color: #f3f3f0; }
@media (max-width: 420px) {
  .header-inner { padding: 0 10px; }
  .logo-mark { gap: 8px; padding: 6px; }
  .logo-pill { padding: 7px 12px; }
}
.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text); cursor: pointer; border-radius: var(--radius); transition: background var(--transition); }
.icon-btn:hover { background: var(--key-active); }
.theme-icon { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
.nav-drawer { position: fixed; top: 0; left: 0; width: min(320px, 85vw); height: 100vh; background: var(--menu-bg); box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12); transform: translateX(-100%); transition: transform 0.3s ease; z-index: 200; overflow-y: auto; }
.nav-drawer[aria-hidden="false"] { transform: translateX(0); }
.nav-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.nav-drawer-title { font-weight: 600; font-size: 1.1rem; }
.lang-list { list-style: none; margin: 0; padding: 12px 0; columns: 2; column-gap: 8px; }
.lang-list li { margin: 0; break-inside: avoid-column; border-bottom: 1px solid var(--border); }
.lang-link { display: block; padding: 12px 24px; color: var(--text); text-decoration: none; transition: background var(--transition); font-size: .95rem; }
.lang-link:hover { background: var(--key-active); text-decoration: none; }
.search-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 150; display: flex; align-items: flex-start; justify-content: center; padding: 80px 20px 0; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; }
.search-overlay[aria-hidden="false"] { opacity: 1; visibility: visible; }
.search-box { background: var(--surface); border-radius: var(--radius); padding: 14px; width: 100%; max-width: 480px; box-shadow: var(--shadow); }
.search-input { width: 100%; height: 52px; padding: 0 16px; font-size: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); transition: border-color var(--transition), box-shadow var(--transition); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search-results { list-style: none; margin: 12px 0 0; padding: 6px; max-height: 60vh; overflow-y: auto; border-radius: 10px; border: 1px solid var(--border); display: grid; gap: 6px; }
.search-results[aria-hidden='true'] { display: none; }
.search-results li { margin: 0; }
.search-results a { display: block; padding: 12px 14px; color: var(--text); text-decoration: none; border-radius: 10px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 72%, var(--surface)); }
.search-results a:hover { background: var(--key-active); text-decoration: none; }
.search-result-name { font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-native { margin-top: 2px; font-size: 0.9rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border: none; background: var(--surface); color: var(--text); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ===================================================== 4. footer */
.footer { background: var(--footer-bg); border-top: 1px solid var(--border); padding: 24px 20px; margin-top: auto; }
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.social-icons { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; }
.social-icons a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--key-bg); border: 1px solid var(--key-border); color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.social-icons a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.social-icons svg { width: 18px; height: 18px; }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin-top: 18px; }
.footer-nav a { color: var(--text-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.sep { color: var(--text-muted); font-weight: 300; }
.footer-copy { margin: 12px 0 0; font-size: 0.875rem; color: var(--text-muted); }

/* ===================================================== 5. home */
.home { padding-bottom: 56px; }
.hero { padding: 40px 0 0; }
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; text-align: center; }
.hero-title { margin: 0; font-size: 2.1rem; font-weight: 650; letter-spacing: -0.03em; color: var(--text); }
.hero-subtitle { margin: 8px 0 18px; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.directory { padding: 20px 20px 0; }
.section-header { text-align: center; margin: 0 auto 18px; max-width: 720px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--text); transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08); text-decoration: none; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
.card-native { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.card-intro { margin-top: 10px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 0.875rem; }
.card-cta { color: var(--accent); font-weight: 600; }
@media (max-width: 734px) {
  .hero { padding: 34px 0 22px; }
  .hero-inner { padding: 0 16px; }
  .hero-title { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
}

/* ===================================================== 6. alphabet page */
.alphabet-page { padding: 24px 20px 56px; }
.alphabet-title { font-size: 2rem; font-weight: 650; margin: 0 0 12px; text-align: center; letter-spacing: -0.02em; }
.case-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 520px; margin: 0 auto 18px; border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.case-tab { display: flex; align-items: center; justify-content: center; height: 44px; color: color-mix(in srgb, var(--text) 78%, transparent); text-decoration: none; font-weight: 750; letter-spacing: -0.01em; border-bottom: 2px solid transparent; transition: color var(--transition), border-color var(--transition); }
.case-tab:hover { color: var(--text); text-decoration: none; }
.case-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.case-panels { width: 100%; }
.case-panel { display: none; }
.case-panels[data-active='uppercase'] #uppercase { display: block; }
.case-panels[data-active='lowercase'] #lowercase { display: block; }
.case-panels[data-active='hiragana'] #hiragana { display: block; }
.case-panels[data-active='katakana'] #katakana { display: block; }
.alphabet-page .alphabet-intro { text-align: center; font-size: 1rem; color: var(--text-muted); margin: 0 auto 28px; max-width: 920px; line-height: 1.7; }
.alphabet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 0 0 32px; }
.letter-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.letter-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06); }
.letter-display { font-size: 2.25rem; font-weight: 500; line-height: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.speak-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: none; align-items: center; justify-content: center; cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition); }
.speak-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--text); }
.letter-info { width: 100%; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.letter-pronunciation { font-size: 0.75rem; color: var(--text-muted); background: color-mix(in srgb, var(--bg) 70%, var(--surface)); padding: 3px 6px; border-radius: 6px; display: inline-flex; align-items: center; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.download-section { border: none; border-radius: var(--radius); background: #f5f2e9; padding: 18px; margin: 0 0 28px; text-align: center; }
.download-section h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 650; }
.download-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.download-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; min-width: 170px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: #ffffff; text-decoration: none; font-weight: 750; transition: background var(--transition), border-color var(--transition), transform var(--transition); }
.download-link:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); text-decoration: none; }
.dl-icon { width: 18px; height: 18px; flex: none; }
.download-note { margin: 10px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.alphabet-content { display: grid; gap: 18px; }
/* NOTE: the old Astro site had card styling for ".content-section" (the text blocks under the letters) but it never took effect,
   because Astro scoped it away from the guide components. The live site therefore shows them as plain text, and so does this one.
   To switch the card look on, remove this comment markers around the rules below:
.content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.content-section h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 650; }
.content-section p { margin: 0; color: var(--text-muted); line-height: 1.75; font-size: 0.95rem; }
.content-section p + p { margin-top: 10px; }
.content-section ul, .content-section ol { margin: 0; padding-left: 1.3rem; color: var(--text-muted); line-height: 1.75; font-size: 0.95rem; }
.content-section p + ul, .content-section p + ol, .content-section ul + p, .content-section ol + p { margin-top: 10px; }
.content-section li + li { margin-top: 4px; }
.content-section li::marker { color: var(--accent, currentColor); }
.content-section li strong, .content-section p strong { color: var(--text); font-weight: 650; }
.content-section a { text-decoration: underline; text-underline-offset: 2px; }
*/
.quadoo-glyph { display: block; }
@media (max-width: 734px) {
  .alphabet-page { padding: 20px 16px 48px; }
  .alphabet-title { font-size: 1.5rem; }
  .alphabet-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
}

/* ===================================================== 7. learning guides (the text + tables under the letters) */
.alphabet-learning { margin-top: 18px; display: grid; gap: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--bg) 92%, #ffffff); margin: 16px 0; }
.letter-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.alphabet-content[data-guide="french"] .letter-table { min-width: 720px; }
.letter-table th, .letter-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent); vertical-align: top; }
.letter-table th { font-weight: 750; background: color-mix(in srgb, var(--bg) 85%, #ffffff); }
.letter-table tr:last-child td { border-bottom: none; }
.letter-table .letter-cell { font-weight: 700; font-size: 1.05em; white-space: nowrap; }
.learning-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px; }
.learning-section h2 { margin: 0 0 10px; font-size: 1.25rem; letter-spacing: -0.02em; }
.learning-section p { margin: 0 0 10px; color: color-mix(in srgb, var(--text) 86%, transparent); line-height: 1.75; }
.learning-section p:last-child { margin-bottom: 0; }

/* ===================================================== 8. download pages (PDF / image / worksheet) */
.dl-page { padding: 22px 20px 56px; }
.dl-page .page-title { font-size: 1.75rem; font-weight: 650; margin: 0 0 16px; text-align: center; letter-spacing: -0.02em; }
.dl-page .alphabet-intro { text-align: center; font-size: 1rem; color: var(--text-muted); margin: 0 auto 22px; max-width: 920px; line-height: 1.7; }
.viewer { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.pdf-guide, .image-guide, .worksheet-guide { margin-top: 22px; display: grid; gap: 18px; }
.viewer-bar { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 12px 12px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, var(--surface)); }
.viewer-tabs { padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
.bar-actions { display: flex; justify-content: flex-end; gap: 8px; }
.bar-btn, .bar-link { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: #f5f2e9; color: var(--text); text-decoration: none; font-weight: 650; cursor: pointer; transition: background var(--transition), border-color var(--transition); }
.bar-link { width: 44px; padding: 0; }
.bar-btn.primary { background: var(--accent); border-color: var(--accent); color: #ffffff; min-width: 140px; }
.bar-btn:hover, .bar-link:hover { border-color: var(--accent); text-decoration: none; }
.bar-link:hover { background: #efe7d6; }
.bar-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.viewer-body { padding: 16px; background: var(--bg); }
.viewer-frame { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 12px; display: flex; align-items: center; justify-content: center; min-height: 420px; overflow: auto; }
.dl-page[data-kind="image"] .viewer-frame { position: relative; }
.dl-page[data-kind="pdf"] .viewer-frame { padding: 0; min-height: 520px; overflow: hidden; }
.viewer-placeholder { width: min(980px, 100%); height: 420px; border-radius: 12px; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 70%, var(--surface)) 0%, color-mix(in srgb, var(--bg) 55%, var(--surface)) 40%, color-mix(in srgb, var(--bg) 70%, var(--surface)) 80%); background-size: 200% 100%; animation: viewerShimmer 1200ms ease-in-out infinite; border: 1px dashed color-mix(in srgb, var(--text) 12%, transparent); }
.viewer-placeholder[hidden] { display: none !important; }
.viewer-loading { color: var(--text-muted); font-weight: 600; padding: 16px; }
.viewer-loading[hidden] { display: none !important; }
.dl-page[data-kind="image"] .viewer-loading { display: inline-flex; align-items: center; gap: 10px; position: absolute; inset: auto; padding: 0; }
.dl-page[data-kind="image"] .viewer-loading::before { content: ''; width: 18px; height: 18px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); border-top-color: var(--accent); animation: viewerSpin 800ms linear infinite; }
@keyframes viewerSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes viewerShimmer { 0% { background-position: 0% 0%; } 100% { background-position: 100% 0%; } }
.viewer-asset { max-width: 100%; height: auto; display: block; }
.viewer-asset[hidden] { display: none !important; }
.viewer-pdf { width: 100%; height: 72vh; min-height: 520px; border: none; background: #fff; }
.viewer-pdf[hidden] { display: none !important; }
.viewer-hidden { position: fixed; left: -9999px; top: -9999px; width: auto; height: auto; pointer-events: none; opacity: 0; }
@media (max-width: 734px) {
  .viewer-bar { grid-template-columns: auto 1fr auto; }
  .viewer-pdf { height: 70vh; }
}
.download-case-tabs, .download-script-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 520px; margin: 0 auto; border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent); position: relative; }
.download-case-tab, .download-script-tab { display: flex; align-items: center; justify-content: center; height: 44px; font-weight: 750; letter-spacing: -0.01em; text-decoration: none; color: color-mix(in srgb, var(--text) 78%, transparent); border-bottom: 2px solid transparent; transition: color var(--transition), border-color var(--transition); }
.download-case-tab:hover, .download-script-tab:hover { color: var(--text); text-decoration: none; }
.download-case-tab.active, .download-script-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.download-case-progress, .download-script-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; opacity: 0; pointer-events: none; overflow: hidden; }
.download-case-tabs.is-loading .download-case-progress, .download-script-tabs.is-loading .download-script-progress { opacity: 1; }
.download-case-progress::before, .download-script-progress::before { content: ''; position: absolute; left: -35%; top: 0; height: 100%; width: 35%; background: var(--accent); animation: downloadProgress 900ms ease-in-out infinite; }
@keyframes downloadProgress { 0% { transform: translateX(0); } 100% { transform: translateX(380%); } }

/* ===================================================== 9. printable sheets (hidden; photographed by the browser to make a PNG / PDF) */
.chart-sheet { width: min(100%, 11.69in); margin: 0 auto; background: #ffffff; color: #1d1d1f; border: none; border-radius: 0; padding: 0.34in 0.34in 0.52in; position: relative; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif; }
.sheet-watermark { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase; color: rgba(0, 0, 0, 0.35); user-select: none; pointer-events: none; }
.sheet-header { display: flex; justify-content: center; text-align: center; margin-bottom: 0.30in; }
.sheet-title { width: 100%; margin: 0; font-size: 22pt; font-weight: 700; letter-spacing: -0.02em; }
.sheet-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 12px; }
.sheet-grid[dir='rtl'] { direction: rtl; }
.sheet-card { border: 1px solid rgba(0, 0, 0, 0.10); border-radius: 12px; background: #ffffff; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.sheet-letter { font-size: 52pt; font-weight: 500; line-height: 1; display: flex; align-items: center; justify-content: center; }
.sheet-label { margin-top: 10px; font-size: 14pt; font-weight: 650; letter-spacing: 0.02em; }
.ws-sheet { width: min(100%, 11.69in); margin: 0 auto; background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.10); border-radius: 14px; padding: 18px; }
.sheet-wrap { display: flex; justify-content: center; overflow: auto; }
.worksheet { max-width: 100%; height: auto; }
@media (max-width: 734px) {
  .chart-sheet { padding: 20px; }
  .sheet-grid { grid-template-columns: repeat(4, 1fr); }
  .sheet-letter { font-size: 40pt; }
  .sheet-label { font-size: 12pt; }
}
@media print {
  .chart-sheet { width: 11.69in; border: none; border-radius: 0; padding: 0.34in 0.34in 0.52in; box-shadow: none; }
  .ws-sheet { width: 11.69in; border: none; border-radius: 0; padding: 0; }
}

/* ===================================================== 10. static pages (about / contact / privacy) */
.static-page { padding: 24px 20px 48px; }
/* about */
.about-container { max-width: 860px; margin: 0 auto; padding: 12px 0; color: var(--text); line-height: 1.65; }
.about-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.about-hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.about-block { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-top: 12px; }
.about-container h1 { font-size: 2rem; margin: 0 0 14px; letter-spacing: -0.02em; text-align: center; }
.about-container h2 { font-size: 1.25rem; margin: 0 0 10px; letter-spacing: -0.01em; }
.about-container p { margin: 0 0 12px; color: var(--text-muted); }
.about-container ul { margin: 0; padding-left: 18px; color: var(--text-muted); }
.about-container li { margin: 6px 0; }
@media (max-width: 820px) { .about-hero { grid-template-columns: 1fr; } }
/* privacy */
.privacy-page h1 { font-size: 1.75rem; margin: 0 0 10px; text-align: center; }
.privacy-page .lead { margin: 0 0 18px; color: var(--text-muted); line-height: 1.6; }
.privacy-page .block { max-width: 860px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.privacy-page .block h2 { margin: 18px 0 10px; font-size: 1.05rem; letter-spacing: -0.01em; }
.privacy-page .block h2:first-of-type { margin-top: 0; }
.privacy-page .block p { margin: 0 0 10px; color: var(--text-muted); line-height: 1.7; }
.privacy-page .block p:last-child { margin-bottom: 0; }
.privacy-page .block ul { margin: 0 0 10px; padding-left: 18px; color: var(--text-muted); }
.privacy-page .block li { margin: 6px 0; }
/* contact */
.contact-page h1 { font-size: 1.75rem; margin: 0 0 16px; text-align: center; }
.contact { max-width: 720px; margin: 0 auto; padding-top: 8px; }
.contact .lead { color: var(--text-muted); margin: 0 0 18px; line-height: 1.6; }
.status-message { max-width: 720px; margin: 0 auto 14px; padding: 12px 14px; border-radius: 12px; color: var(--text); font-weight: 650; }
.status-message[hidden] { display: none; }
.status-message.success { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.status-message.error { border: 1px solid color-mix(in srgb, #d14b4b 45%, var(--border)); background: color-mix(in srgb, #d14b4b 10%, var(--surface)); }
.blocks { display: grid; gap: 12px; }
.block { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.block-title { margin: 0 0 12px; font-size: 1.05rem; letter-spacing: -0.01em; }
.block-text { margin: 0; color: var(--text-muted); line-height: 1.6; }
.contact-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.label { font-weight: 650; color: var(--text); font-size: 0.95rem; }
.input, .textarea { width: 100%; border-radius: 12px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 75%, var(--surface)); color: var(--text); padding: 10px 12px; font: inherit; outline: none; }
.textarea { resize: vertical; }
.submit { justify-self: start; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.submit:disabled { opacity: 0.7; cursor: wait; }
.tips { margin: 0; padding-left: 18px; color: var(--text-muted); }
.tips li { margin: 8px 0; line-height: 1.6; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ===================================================== 11. 404 */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.error-content { text-align: center; max-width: 600px; margin: 0 auto; }
.error-code { font-size: 6rem; font-weight: 700; color: var(--accent); margin: 0 0 16px; line-height: 1; }
.error-title { font-size: 2rem; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.error-description { font-size: 1.125rem; color: var(--text-muted); margin: 0 0 32px; line-height: 1.6; }
.error-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 48px; }
.error-page .btn-primary, .error-page .btn-secondary { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 500; text-decoration: none; transition: all var(--transition); }
.error-page .btn-primary { background: var(--accent); color: white; border: 2px solid var(--accent); }
.error-page .btn-primary:hover { background: var(--key-active); border-color: var(--key-active); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.error-page .btn-secondary { background: transparent; color: var(--text); border: 2px solid var(--border); }
.error-page .btn-secondary:hover { border-color: var(--text); transform: translateY(-2px); }
.popular-links { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.popular-links h3 { font-size: 1.25rem; font-weight: 600; color: var(--text); margin: 0 0 20px; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.links-grid a { padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.9375rem; transition: all var(--transition); }
.links-grid a:hover { border-color: var(--accent); background: var(--bg); transform: translateY(-2px); }
@media (max-width: 734px) {
  .error-code { font-size: 4rem; }
  .error-title { font-size: 1.5rem; }
  .error-description { font-size: 1rem; }
  .error-actions { flex-direction: column; }
  .error-page .btn-primary, .error-page .btn-secondary { width: 100%; }
  .links-grid { grid-template-columns: 1fr; }
}

/* ===== tools: pronunciation guide, practice (flashcards + quiz), FAQ, teachers page ===== */
.tool-page .download-section { margin-bottom: 22px; }
.tool-page .content-section { margin-bottom: 18px; }
.tool-page .content-section h2 { margin-bottom: 12px; }
button.download-link { font: inherit; cursor: pointer; }
.pin-link { background: #fff; color: #bd081c; border-color: #bd081c; }
.pin-link:hover { background: #bd081c; border-color: #bd081c; color: #fff; }
.practice-links { margin-top: 8px; }
.sound-table td, .sound-table th { text-align: left; }
.sound-table .letter-cell { font-size: 1.6rem; line-height: 1.2; white-space: nowrap; }
.sound-table td:last-child { width: 1%; }
.sound-table .speak-btn { margin: 0 auto; }
.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; margin: 0; }
.chip-list li { display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.92rem; color: var(--text-muted); }
.chip-glyph { font-size: 1.25rem; color: var(--text); }
.chip-glyph svg { width: 22px; height: 22px; vertical-align: middle; }
.faq-list details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 16px; margin-bottom: 10px; }
.faq-list summary { cursor: pointer; padding: 14px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list details p { margin: 0 0 14px; color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }
.pack-list { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.pack-list li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); padding: 6px 0; }
.pack-list li span a { color: var(--accent); }
.teachers-page h1 { text-align: center; }
/* practice */
.practice-app { max-width: 720px; margin: 0 auto 28px; }
.pr-sets { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.pr-chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; color: var(--text-muted); }
.pr-chip.active { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pr-stage { text-align: center; }
.pr-card { width: 100%; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); cursor: pointer; font: inherit; color: var(--text); padding: 24px; }
.pr-card.back { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.pr-card:focus-visible, .pr-option:focus-visible, .pr-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.pr-glyph { font-size: 5.5rem; line-height: 1.15; }
.pr-glyph.small { font-size: 2.6rem; }
.pr-glyph.big { font-size: 6rem; display: block; margin: 8px 0 18px; }
.pr-glyph.opt { font-size: 2.4rem; }
.pr-glyph svg { width: 1em; height: 1em; }
.pr-name { font-size: 1.8rem; font-weight: 700; }
.pr-sound, .pr-hint, .pr-info, .pr-note, .pr-feedback { color: var(--text-muted); font-size: 0.95rem; }
.pr-info { margin: 12px 0; }
.pr-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.pr-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 650; cursor: pointer; color: var(--text); }
.pr-btn:hover { border-color: var(--accent); }
.pr-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pr-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pr-question { padding: 8px 0 4px; }
.pr-ask { font-size: 1.1rem; font-weight: 650; margin: 8px 0; }
.pr-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.pr-option { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 16px 10px; font: inherit; font-size: 1.15rem; font-weight: 650; cursor: pointer; color: var(--text); min-height: 62px; }
.pr-option:hover:not(:disabled) { border-color: var(--accent); }
.pr-option.right { background: #e3f4e6; border-color: #3a9a4f; color: #1d5e2c; }
.pr-option.wrong { background: #fbe4e1; border-color: #c4473a; color: #8c2a20; }
.pr-feedback { min-height: 1.4em; font-weight: 650; }
.pr-result { padding: 24px 8px; }
.pr-result h2 { margin: 0 0 8px; }
.pr-result .chip-list { justify-content: center; margin-bottom: 16px; }
@media (max-width: 520px) { .pr-glyph { font-size: 4.4rem; } .pr-options { grid-template-columns: 1fr 1fr; } }
@media print {
  .header, .footer, .breadcrumbs-wrap, .download-section, .speak-btn, .related-downloads, .related-alphabets, .faq, .nav-drawer, .search-overlay { display: none !important; }
  .tool-page { padding: 0; } .sound-table .letter-cell { font-size: 1.5rem; }
}
.download-sub { margin: 20px 0 10px; font-size: 1rem; font-weight: 650; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== compact tool pages: one small navigation row, the tool right under it ===== */
.tool-page .alphabet-intro { margin-bottom: 14px; }
.tool-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 auto 18px; max-width: 760px; }
.tool-nav a, .tool-nav span { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 0.92rem; font-weight: 600; text-decoration: none; line-height: 1.4; }
.tool-nav a:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.tool-nav .active { background: var(--accent); border-color: var(--accent); color: #fff; }
a.pr-btn { display: inline-block; text-decoration: none; }
a.pr-btn.primary { color: #fff; }
.tool-page .practice-app { margin-bottom: 20px; }
.tool-page .pr-card { min-height: 240px; }
.tool-page .download-section { padding: 14px; margin-bottom: 16px; }
.tool-page .download-section .download-link { min-width: 0; padding: 10px 16px; }
.tool-page .content-section ul, .tool-page .content-section ol { margin-bottom: 0; }
@media print { .tool-nav { display: none !important; } }
