/* RYU Network sites (เรียนภาษาญี่ปุ่น.online, คันจิ.online, ...).
   Monochrome "showcase" look: white rounded panels on a near-black page, black pill buttons, a floating capsule
   header, tilted pinned cards, pastel sticky notes and gradient highlights.  --ms-accent (set per site) tints the
   gradient and small marks only. */
:root {
  --ms-dark: #12151c; --ms-dark-2: #1b1f29; --ms-ink: #0b0d12; --ms-text: #3f4654; --ms-muted: #7a8291;
  --ms-line: #e7e8ec; --ms-soft: #f5f5f7; --ms-radius: 20px; --ms-panel-radius: 32px;
  --ms-grad: linear-gradient(92deg, var(--ms-accent) 0%, #ec4899 48%, #6366f1 100%);
  --ms-accent-soft: color-mix(in srgb, var(--ms-accent) 12%, #fff);
}
.ms { font-family: "Noto Sans Thai", "IBM Plex Sans Thai", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ms-text); background: var(--ms-dark); line-height: 1.7; -webkit-font-smoothing: antialiased; }
.ms a { color: inherit; }
.ms h1, .ms h2, .ms h3 { color: var(--ms-ink); letter-spacing: -.01em; }
.ms-ic { display: inline-block; vertical-align: -.14em; flex-shrink: 0; }
.ms-glyph { font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; font-weight: 700; line-height: 1; }
.ms-jp { font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; }

/* ── header: floating capsule ─────────────────────────────── */
.ms-preview { background: #fde68a; color: #78350f; text-align: center; font-size: 13px; padding: 6px 12px; }
.ms-preview a { color: #78350f; font-weight: 700; }
.ms-header { position: sticky; top: 12px; z-index: 40; padding: 0 12px; height: 0; }
.ms-bar { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(15,23,42,.08); border-radius: 999px; padding: 7px 7px 7px 14px; box-shadow: 0 8px 30px -12px rgba(0,0,0,.25); }
.ms-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; }
.ms-brand img { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ms-brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ms-brand b { color: var(--ms-ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-brand small { color: var(--ms-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-nav { gap: 4px; }
.ms-nav a { color: var(--ms-text); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.ms-nav a:hover { background: var(--ms-soft); color: var(--ms-ink); }

/* ── buttons ─────────────────────────────── */
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; border-radius: 999px;
  background: var(--ms-ink); color: #fff !important; font-weight: 600; text-decoration: none; border: 1px solid var(--ms-ink);
  transition: transform .15s, background .15s; white-space: nowrap; }
.ms-btn:hover { transform: translateY(-1px); background: #262a33; }
.ms-btn-sm { padding: 8px 18px; font-size: 14px; flex-shrink: 0; }
.ms-btn-ghost { background: #fff; color: var(--ms-ink) !important; border-color: #d4d6dc; }
.ms-btn-ghost:hover { background: var(--ms-soft); }
.ms-btn-light { background: #fff; color: var(--ms-ink) !important; border-color: #fff; }
.ms-btn-light:hover { background: #eef0f3; }
.ms-btn-outline-light { background: transparent; border-color: rgba(255,255,255,.35); color: #fff !important; }
.ms-btn-outline-light:hover { background: rgba(255,255,255,.08); }
.ms-link { font-weight: 600; text-decoration: none; color: var(--ms-ink) !important; border-bottom: 1.5px solid currentColor; }
.ms-dark-sec .ms-link { color: #fff !important; }

/* ── type accents ─────────────────────────────── */
.ms-grad { background: var(--ms-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ms-script { font-family: "Bradley Hand", "Segoe Script", "Chalkboard SE", "Comic Sans MS", cursive; font-weight: 400; font-style: italic; }
.ms-scribble { position: relative; display: inline-block; white-space: nowrap; }
.ms-scribble svg { position: absolute; left: -2%; bottom: -.32em; width: 104%; height: .5em; overflow: visible; }
.ms-scribble path { fill: none; stroke: var(--ms-ink); stroke-width: 3; stroke-linecap: round; }
.ms-dark-sec .ms-scribble path { stroke: #fff; }
.ms-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; background: var(--ms-soft);
  border: 1px solid var(--ms-line); color: var(--ms-ink); font-size: 13px; font-weight: 600; }
.ms-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ms-accent); }
.ms-h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 700; line-height: 1.22; margin: 16px 0 18px; }
.ms-h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.ms-lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--ms-text); max-width: 40rem; }
.ms-sub { color: var(--ms-muted); font-size: 1.02rem; margin: 0; }
.ms-note { font-size: 12px; color: var(--ms-muted); }

/* ── page structure: white panels on a dark page ─────────────────────────────── */
/* overflow: clip (not hidden) keeps rounded corners without breaking position: sticky inside the panel */
.ms-panel { background: #fff; border-radius: var(--ms-panel-radius); margin: 0 12px 12px; position: relative; overflow: hidden; overflow: clip; }
.ms-panel-first { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.ms-sec { padding-top: 88px; padding-bottom: 88px; }   /* top/bottom only: keep .container side padding */
.ms-dark-sec { color: #c9ced8; }
.ms-dark-sec h2, .ms-dark-sec h3 { color: #fff; }
.ms-dark-sec .ms-sub { color: #9aa1ad; }

/* ── hero with pinned, tilted cards ─────────────────────────────── */
.ms-hero { min-height: min(92vh, 860px); display: flex; align-items: center; padding: 120px 0 80px; text-align: center; }
.ms-hero .container { position: relative; z-index: 2; }
.ms-hero .ms-lead { margin: 0 auto; }
.ms-float { position: absolute; z-index: 1; background: #fff; padding: 7px; border-radius: 18px; border: 1px solid var(--ms-line);
  box-shadow: 0 24px 50px -24px rgba(15,23,42,.45); animation: ms-bob 7s ease-in-out infinite; }
.ms-float img { display: block; width: 100%; border-radius: 12px; }
.ms-float figcaption { font-size: 12px; font-weight: 600; color: var(--ms-ink); padding: 6px 4px 1px; display: flex; align-items: center; gap: 6px; }
.ms-float figcaption::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.ms-float:nth-of-type(1) { width: 190px; left: -30px; top: 130px; transform: rotate(-8deg); }
.ms-float:nth-of-type(2) { width: 160px; left: 6%; bottom: 40px; transform: rotate(6deg); animation-delay: -2s; }
.ms-float:nth-of-type(3) { width: 170px; right: -24px; top: 120px; transform: rotate(7deg); animation-delay: -4s; }
.ms-float:nth-of-type(4) { width: 150px; right: 7%; bottom: 60px; transform: rotate(-5deg); animation-delay: -1s; }
.ms-float:nth-of-type(5) { width: 120px; left: 15%; top: 84px; transform: rotate(4deg); animation-delay: -3s; }
.ms-float:nth-of-type(6) { width: 210px; right: 15%; top: 78px; transform: rotate(-3deg); animation-delay: -5s; }
.ms-float.kana { width: 112px !important; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 54px; font-weight: 700; color: var(--ms-ink); line-height: 1; }
.ms-float.kana small { font-size: 12px; color: var(--ms-muted); font-weight: 500; margin-top: 8px; font-family: inherit; }
.ms-float.kana.alt { color: var(--ms-accent); }
@keyframes ms-bob { 50% { translate: 0 -10px; } }
.ms-scroll-hint { display: inline-flex; align-items: center; gap: 4px; position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); font-size: 13px; color: var(--ms-muted); z-index: 2; text-decoration: none; }

/* ── sticky notes (problems / myths) on dark ─────────────────────────────── */
.ms-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 40px; }
.ms-note-card { width: 230px; min-height: 170px; padding: 22px 20px; background: var(--c); color: #1f2937; border-radius: 4px;
  rotate: var(--r); box-shadow: 0 18px 30px -18px rgba(0,0,0,.6); font-size: 1.05rem; font-weight: 600; line-height: 1.5;
  transition: opacity .7s ease, transform .7s ease, rotate .2s, scale .2s; }
.ms-note-card:hover { rotate: 0deg; scale: 1.03; }
.ms-note-card small { display: block; font-weight: 400; font-size: .92rem; margin-top: 10px; color: #374151; }
.ms-note-card .tag { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .03em; opacity: .7; margin-bottom: 6px; }
.ms-notes-wide .ms-note-card { width: 300px; }

/* ── alternating feature rows with pastel mockup cards ─────────────────────────────── */
.ms-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-bottom: 72px; }
.ms-feature:last-child { margin-bottom: 0; }
.ms-feature:nth-child(even) .ms-feature-text { order: 2; }
.ms-kicker { font-size: 13px; font-weight: 700; color: var(--ms-muted); letter-spacing: .06em; text-transform: uppercase; }
.ms-feature h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; line-height: 1.3; margin: 6px 0 14px; }
.ms-feature h3 .ms-grad { display: block; }
.ms-pastel { aspect-ratio: 4 / 3; border-radius: 26px; padding: 26px; display: flex; align-items: center; justify-content: center; position: relative;
  overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #fef3c7 0%, transparent 55%), radial-gradient(100% 90% at 100% 100%, #c7d2fe 0%, transparent 60%), #eef6f7; }
.ms-feature:nth-child(2) .ms-pastel { background: radial-gradient(110% 90% at 100% 0%, #fbcfe8 0%, transparent 55%), radial-gradient(100% 90% at 0% 100%, #bae6fd 0%, transparent 60%), #f3f0ff; }
.ms-feature:nth-child(3) .ms-pastel { background: radial-gradient(110% 90% at 0% 100%, #bbf7d0 0%, transparent 55%), radial-gradient(100% 90% at 100% 0%, #fde68a 0%, transparent 60%), #f0f9ff; }
.ms-mock { width: 100%; max-width: 360px; background: #fff; border-radius: 18px; box-shadow: 0 20px 40px -24px rgba(15,23,42,.45); padding: 14px; font-size: 13px; }
.ms-mock-top { display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--ms-ink); margin-bottom: 10px; }
.ms-mock-top .live { font-size: 11px; color: #fff; background: #ef4444; border-radius: 999px; padding: 1px 8px; }
.ms-mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ms-mock-grid span { aspect-ratio: 4/3; border-radius: 10px; background: linear-gradient(135deg, #e5e7eb, #f3f4f6); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #9ca3af; }
.ms-mock-grid span.teacher { grid-column: span 2; grid-row: span 2; background: linear-gradient(135deg, #fed7aa, #fde68a); font-size: 34px; color: #9a3412; }
.ms-mock-player { aspect-ratio: 16/9; border-radius: 12px; background: #0f172a; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; }
.ms-mock-bar { height: 5px; border-radius: 3px; background: #e5e7eb; margin: 10px 0 8px; overflow: hidden; }
.ms-mock-bar i { display: block; width: 62%; height: 100%; background: var(--ms-grad); }
.ms-mock-row { display: flex; justify-content: space-between; color: var(--ms-muted); font-size: 12px; }
.ms-mock-file { display: flex; font-size: 13px; gap: 8px; align-items: center; background: var(--ms-soft); border-radius: 10px; padding: 7px 10px; margin-top: 8px; color: var(--ms-ink); }
.ms-bubble { max-width: 82%; padding: 8px 12px; border-radius: 16px; margin-bottom: 8px; line-height: 1.45; }
.ms-bubble.me { margin-left: auto; background: var(--ms-ink); color: #fff; border-bottom-right-radius: 4px; }
.ms-bubble.them { background: var(--ms-soft); color: var(--ms-ink); border-bottom-left-radius: 4px; }

/* ── generic cards / steps ─────────────────────────────── */
.ms-card { background: #fff; border: 1px solid var(--ms-line); border-radius: var(--ms-radius); padding: 24px; transition: transform .2s, box-shadow .2s; }
.ms-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -28px rgba(15,23,42,.45); }
.ms-card-center { text-align: center; }
.ms-card-ic { color: var(--ms-ink); display: inline-flex; width: 46px; height: 46px; align-items: center; justify-content: center; border-radius: 14px;
  background: var(--ms-soft); font-size: 22px; margin-bottom: 14px; }
.ms-dark-sec .ms-card { background: var(--ms-dark-2); border-color: rgba(255,255,255,.08); color: #c9ced8; }
.ms-dark-sec .ms-card-ic { background: rgba(255,255,255,.08); color: #fff; }
.ms-step { border-top: 2px solid var(--ms-ink); padding-top: 18px; }
.ms-step-no { font-size: 13px; font-weight: 700; color: var(--ms-muted); display: block; margin-bottom: 6px; }

/* ── roadmap ─────────────────────────────── */
.ms-roadmap { list-style: none; padding: 0; margin: 0 auto; max-width: 56rem; position: relative; }
.ms-roadmap::before { content: ""; position: absolute; left: 27px; top: 12px; bottom: 12px; width: 2px;
  background: repeating-linear-gradient(to bottom, #d4d6dc 0 6px, transparent 6px 12px); }
.ms-level { display: flex; gap: 18px; margin-bottom: 16px; position: relative; }
.ms-level-badge { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; background: var(--ms-ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; z-index: 1; box-shadow: 0 0 0 6px #fff; }
.ms-level:last-child .ms-level-badge { background: var(--ms-grad); }
.ms-level-body { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--ms-line); border-radius: var(--ms-radius); padding: 18px 22px; transition: box-shadow .2s; }
.ms-level-body:hover { box-shadow: 0 18px 36px -26px rgba(15,23,42,.45); }
.ms-ticks { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ms-ticks li { font-size: 13px; background: var(--ms-soft); border-radius: 999px; padding: 3px 12px; color: var(--ms-ink); }
.ms-can { margin: 0 0 10px; font-size: 14px; }
.ms-meta { font-size: 12px; color: var(--ms-muted); }
.ms-price-tag { font-size: 13px; font-weight: 700; color: var(--ms-ink); border: 1px solid var(--ms-line); border-radius: 999px; padding: 2px 12px; }

/* ── price table ─────────────────────────────── */
.ms-table-wrap { overflow-x: auto; border-radius: var(--ms-radius); border: 1px solid var(--ms-line); background: #fff; }
.ms-table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: center; font-size: 15px; }
.ms-table th, .ms-table td { padding: 15px 10px; border-bottom: 1px solid var(--ms-line); }
.ms-table thead th { background: var(--ms-ink); color: #fff; font-weight: 600; font-size: 14px; }
.ms-table tbody th { color: var(--ms-ink); font-weight: 700; }
.ms-table small { display: block; font-size: 11px; color: #16a34a; font-weight: 600; }
.ms-table .life { background: var(--ms-soft); font-weight: 700; color: var(--ms-ink); }
.ms-table .life small { color: var(--ms-muted); }
.ms-table tbody tr:last-child > * { border-bottom: 0; }
.ms-lifetime { border: 1px dashed #c5c8d0; border-radius: var(--ms-radius); padding: 16px 20px; }
.ms-lifetime span { display: inline-block; font-size: 14px; background: var(--ms-soft); border-radius: 999px; padding: 4px 14px; color: var(--ms-ink); }

/* ── final CTA: dark, dimmed collage behind ─────────────────────────────── */
.ms-final { position: relative; overflow: hidden; text-align: center; padding: 110px 20px; color: #fff; }
.ms-final h2 { color: #fff; }
.ms-final p { color: #aab0bb; max-width: 36rem; margin: 0 auto 28px; }
.ms-final-bg { position: absolute; inset: -20px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; opacity: .16;
  transform: rotate(-4deg) scale(1.1); pointer-events: none; }
.ms-final-bg img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }
.ms-final > :not(.ms-final-bg) { position: relative; }

/* ── FAQ ─────────────────────────────── */
.ms-faq .accordion-item { border: 0; border-bottom: 1px solid var(--ms-line); border-radius: 0 !important; background: transparent; }
.ms-faq .accordion-button { font-weight: 600; color: var(--ms-ink); background: transparent; padding: 20px 4px; font-size: 1.02rem; }
.ms-faq .accordion-button:not(.collapsed) { color: var(--ms-ink); box-shadow: none; }
.ms-faq .accordion-button:focus { box-shadow: none; }
.ms-faq .accordion-body { padding: 0 4px 20px; }

/* ── ภาษาญี่ปุ่น.online ─────────────────────────────── */
.ms-goals { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }
.ms-goal { border: 1px solid #d4d6dc; background: #fff; border-radius: 999px; padding: 10px 20px; font-weight: 600; color: var(--ms-text); transition: all .15s; }
.ms-goal { display: inline-flex; align-items: center; gap: 8px; }
.ms-goal .ms-ic { font-size: 18px; }
.ms-goal.active { border-color: var(--ms-ink); background: var(--ms-ink); color: #fff; }
.ms-goal-result { display: flex; gap: 24px; align-items: center; background: var(--ms-soft); border-radius: 24px; padding: 26px; }
.ms-goal-level { flex-shrink: 0; text-align: center; background: #fff; border-radius: 18px; padding: 16px 22px; box-shadow: 0 12px 30px -20px rgba(15,23,42,.5); }
.ms-goal-level small { display: block; font-size: 12px; color: var(--ms-muted); }
.ms-goal-level b { font-size: 24px; white-space: nowrap; }
.ms-path { list-style: none; padding: 0; margin: 0 auto; max-width: 48rem; display: grid; gap: 12px; }
.ms-path a { display: flex; align-items: center; gap: 16px; background: var(--ms-dark-2); border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; padding: 16px 20px; text-decoration: none; color: #c9ced8; transition: transform .15s, border-color .15s; }
.ms-path a:hover { transform: translateX(6px); border-color: var(--c); }
.ms-path .no { font-weight: 700; color: #6b7280; width: 18px; }
.ms-path .ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.ms-path .txt { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.ms-path b { color: #fff; }
.ms-path small { color: #9aa1ad; }
.ms-path em { font-style: normal; font-size: 12px; color: var(--c); font-weight: 600; filter: brightness(1.3); }
.ms-course-box { display: flex; gap: 28px; align-items: center; justify-content: space-between; background: var(--ms-soft); border-radius: 28px; padding: 34px; }
.ms-level-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-level-chips a { text-decoration: none; font-size: 13px; background: #fff; border: 1px solid var(--ms-line); border-radius: 999px; padding: 6px 14px; color: var(--ms-text); }
.ms-level-chips b { color: var(--ms-ink); margin-right: 6px; }

/* ── เรียนภาษาญี่ปุ่นกับพี่ริว.online : profile showcase card ─────────────────────────────── */
.ms-profile { max-width: 620px; margin: 0 auto; background: #fff; border: 1px solid var(--ms-line); border-radius: 26px; overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(15,23,42,.5); text-align: left; }
.ms-profile-cover { height: 180px; background: center / cover no-repeat; position: relative; }
.ms-profile-body { padding: 0 24px 20px; }
.ms-profile-avatar { width: 92px; height: 92px; border-radius: 50%; border: 5px solid #fff; object-fit: cover; margin-top: -46px; position: relative; background: #fff; box-shadow: 0 6px 16px -8px rgba(0,0,0,.4); }
.ms-profile h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 700; margin: 8px 0 2px; }
.ms-profile .handle { font-size: 13px; color: var(--ms-muted); }
.ms-profile .bio { margin: 10px 0 14px; }
.ms-profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ms-line); border-radius: 16px; text-align: center; }
.ms-profile-stats div { padding: 10px 4px; }
.ms-profile-stats div + div { border-left: 1px solid var(--ms-line); }
.ms-profile-stats b { display: block; color: var(--ms-ink); font-size: 16px; }
.ms-profile-stats small { font-size: 11.5px; color: var(--ms-muted); }
.ms-profile-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--ms-line); margin-top: 16px; font-size: 14px; }
.ms-profile-tabs a { text-decoration: none; padding: 8px 0; color: var(--ms-muted); }
.ms-profile-tabs a:first-child { color: var(--ms-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ms-ink); }
.ms-video { border-radius: var(--ms-radius); overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.1); }
.ms-checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.ms-checklist li { display: flex; gap: 12px; align-items: flex-start; background: var(--ms-soft); border-radius: 18px; padding: 16px 18px; }
.ms-checklist li > span { font-size: 22px; color: var(--ms-ink); display: inline-flex; padding-top: 2px; }
.ms-checklist b { display: block; color: var(--ms-ink); }
.ms-checklist small { color: var(--ms-muted); }
.ms-line { display: block; text-align: center; text-decoration: none; background: #06c755; color: #fff !important; border-radius: 999px; padding: 14px; }
.ms-line b { display: block; font-size: 17px; }
.ms-line small { opacity: .9; }
.ms-social { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border: 1px solid var(--ms-line); border-radius: 999px;
  padding: 6px 14px 6px 6px; font-size: 14px; font-weight: 600; color: var(--ms-ink) !important; background: #fff; }
.ms-social span { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.ms-shot { display: block; width: 100%; max-width: 320px; margin: 0 auto; border-radius: var(--ms-radius); border: 1px solid var(--ms-line); }

/* ── coming soon / 404 ─────────────────────────────── */
.ms-soon-ic { display: inline-flex; width: 110px; height: 110px; align-items: center; justify-content: center; border-radius: 30px; background: #fff;
  border: 1px solid var(--ms-line); box-shadow: 0 24px 50px -24px rgba(15,23,42,.45); font-size: 56px; font-weight: 700; color: var(--ms-ink);
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; transform: rotate(-6deg); margin-bottom: 18px; }

/* ── network footer ─────────────────────────────── */
.ms-network { color: #aab0bb; padding: 56px 0 28px; }
.ms-network h2 { color: #fff; }
.ms-network a { color: #e2e8f0; }
.ms-net-card { display: flex; align-items: center; gap: 10px; height: 100%; padding: 12px; border-radius: 16px; text-decoration: none;
  background: var(--ms-dark-2); border: 1px solid rgba(255,255,255,.07); transition: border-color .15s, transform .15s; }
.ms-net-card:hover { border-color: var(--c); transform: translateY(-2px); }
.ms-net-card.current { border-color: var(--c); }
.ms-net-card .ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--c); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.ms-net-card .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ms-net-card b { color: #fff; font-size: 13px; overflow-wrap: anywhere; }
.ms-net-card small { color: #8b93a1; font-size: 11.5px; }
.ms-foot { color: #6b7280; font-size: 13px; padding: 18px 0 26px; border-top: 1px solid rgba(255,255,255,.06); }
.ms-foot a { color: #9aa1ad; }

/* ── scroll reveal ─────────────────────────────── */
.ms-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.ms-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .ms-reveal { opacity: 1; transform: none; transition: none; }
  .ms-float { animation: none; }
}

@media (max-width: 991.98px) {
  .ms-float:nth-of-type(n+5) { display: none; }
  .ms-float:nth-of-type(1), .ms-float:nth-of-type(3) { width: 130px; top: 100px; }
  .ms-float:nth-of-type(2), .ms-float:nth-of-type(4) { width: 110px; bottom: 24px; }
  .ms-float.kana { width: 80px !important; font-size: 38px; }
}
@media (max-width: 767.98px) {
  .ms-panel { margin: 0 6px 6px; border-radius: 24px; }
  .ms-panel-first { border-top-left-radius: 0; border-top-right-radius: 0; }
  .ms-header { padding: 0 8px; top: 8px; }
  .ms-hero { min-height: 0; padding: 104px 0 64px; }
  .ms-float { display: none; }
  .ms-sec { padding-top: 60px; padding-bottom: 60px; }
  .ms-feature { grid-template-columns: 1fr; gap: 24px; margin-bottom: 52px; }
  .ms-feature:nth-child(even) .ms-feature-text { order: 0; }
  .ms-roadmap::before { left: 21px; }
  .ms-level { gap: 12px; }
  .ms-level-badge { width: 44px; height: 44px; font-size: 14px; }
  .ms-goal-result, .ms-course-box { flex-direction: column; align-items: stretch; text-align: left; }
  .ms-path .no { display: none; }
  .ms-note-card, .ms-notes-wide .ms-note-card { width: 100%; max-width: 320px; min-height: 0; }
  .ms-profile-stats { grid-template-columns: repeat(2, 1fr); }
  .ms-profile-stats div:nth-child(3) { border-left: 0; }
  .ms-profile-stats div:nth-child(n+3) { border-top: 1px solid var(--ms-line); }
  .ms-final-bg { grid-template-columns: repeat(3, 1fr); }
}
.ms-dark-sec .ms-step { border-color: #fff; }
.ms-dark-sec .ms-step-no { color: #8b93a1; }

/* ── คันจิ.online/kana (RYU KANA) ─────────────────────────────── */
.kn-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 34rem; margin: 0 auto; }
.kn-progress > div { display: flex; align-items: center; gap: 10px; background: var(--ms-soft); border-radius: 999px; padding: 8px 16px; font-size: 13px; }
.kn-progress b { color: var(--ms-ink); font-size: 13px; white-space: nowrap; }
.kn-bar { flex: 1; height: 6px; border-radius: 3px; background: #e2e4e9; overflow: hidden; }
.kn-bar i { display: block; height: 100%; width: 0; background: var(--ms-grad); transition: width .4s; }
.kn-switch { display: inline-flex; background: var(--ms-soft); border-radius: 999px; padding: 4px; }
.kn-switch button { border: 0; background: transparent; border-radius: 999px; padding: 8px 20px; font-weight: 600; color: var(--ms-text); }
.kn-switch button.active { background: var(--ms-ink); color: #fff; }
.kn-group { margin-bottom: 28px; }
.kn-group-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.kn-group-title small { font-weight: 500; color: var(--ms-muted); margin-left: 6px; }
.kn-grid { display: grid; gap: 8px; }
.kn-cols-5 { grid-template-columns: repeat(5, 1fr); }
.kn-cols-3 { grid-template-columns: repeat(3, 1fr); max-width: 75%; }
.kn-cell { position: relative; border: 1px solid var(--ms-line); background: #fff; border-radius: 16px; padding: 10px 4px 8px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; transition: transform .12s, border-color .12s, box-shadow .12s; }
.kn-cell .ms-jp { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 600; color: var(--ms-ink); line-height: 1.2; }
.kn-cell small { font-size: 12px; color: var(--ms-muted); }
.kn-cell:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -18px rgba(15,23,42,.5); }
.kn-cell.active { border-color: var(--ms-ink); box-shadow: 0 0 0 2px var(--ms-ink) inset; }
.kn-cell.learned { background: var(--ms-accent-soft); border-color: transparent; }
.kn-done { position: absolute; top: 5px; right: 6px; font-size: 12px; color: var(--ms-accent); display: none; font-style: normal; }
.kn-cell.learned .kn-done { display: block; }
.kn-empty { visibility: hidden; }
.kn-detail { position: sticky; top: 86px; background: var(--ms-soft); border-radius: 26px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.kn-detail-glyph { font-size: clamp(5rem, 12vw, 7.5rem); line-height: 1; font-weight: 600; color: var(--ms-ink); text-align: center; background: #fff;
  border-radius: 20px; padding: 22px 0; box-shadow: 0 16px 36px -28px rgba(15,23,42,.5); }
.kn-detail-read { display: flex; align-items: baseline; gap: 12px; }
.kn-detail-read b { font-size: 1.9rem; color: var(--ms-ink); }
.kn-detail-other { font-size: 14px; color: var(--ms-muted); }
.kn-detail-other .ms-jp { color: var(--ms-ink); font-weight: 600; font-size: 1.1rem; }
.kn-detail-ex { background: #fff; border-radius: 16px; padding: 12px 14px; margin-top: 10px; }
.kn-detail-ex small { color: var(--ms-muted); font-size: 12px; }
.kn-detail-ex .ms-jp { font-size: 1.3rem; font-weight: 600; color: var(--ms-ink); }
.kn-ex-meaning { font-size: 14px; }
.kn-learn[aria-pressed="true"] { background: var(--ms-ink); color: #fff !important; border-color: var(--ms-ink); }
.kn-quiz { background: var(--ms-dark-2); border: 1px solid rgba(255,255,255,.08); border-radius: 28px; padding: 28px; }
.kn-opt { margin-bottom: 16px; }
.kn-opt > span { display: block; font-size: 13px; color: #9aa1ad; margin-bottom: 8px; }
.kn-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.kn-pills button { border: 1px solid rgba(255,255,255,.18); background: transparent; color: #e5e7eb; border-radius: 999px; padding: 7px 16px; font-size: 14px; }
.kn-pills button.active { background: #fff; color: var(--ms-ink); border-color: #fff; font-weight: 600; }
.kn-quiz-count, .kn-quiz-score { font-size: 13px; color: #9aa1ad; }
.kn-quiz-score { color: #86efac; font-weight: 600; }
.kn-quiz-prompt { text-align: center; font-size: clamp(4rem, 14vw, 6rem); font-weight: 600; color: #fff; line-height: 1.2; margin: 6px 0 22px;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; }
.kn-quiz-prompt.romaji { font-family: inherit; font-size: clamp(3rem, 10vw, 4.2rem); }
.kn-quiz-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kn-quiz-choices button { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: #fff; border-radius: 18px; padding: 16px 8px;
  font-size: 1.25rem; font-weight: 600; transition: background .12s; }
.kn-quiz-choices button.jp { font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; font-size: 1.8rem; }
.kn-quiz-choices button:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.kn-quiz-choices button.right { background: #16a34a; border-color: #16a34a; }
.kn-quiz-choices button.wrong { background: #dc2626; border-color: #dc2626; }
.kn-quiz-feedback { min-height: 28px; text-align: center; margin-top: 14px; font-size: 14px; color: #c9ced8; }
.kn-quiz-result { text-align: center; }
.kn-result-score { color: #fff; margin-bottom: 4px; }
.kn-result-score b { font-size: 4rem; line-height: 1; }
.kn-result-score span { font-size: 1.4rem; color: #9aa1ad; }
.kn-result-miss { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kn-result-miss span { background: rgba(255,255,255,.08); border-radius: 12px; padding: 6px 12px; color: #fff; }
.kn-result-miss .ms-jp { font-size: 1.2rem; margin-right: 6px; }
.kn-pad { position: relative; max-width: 420px; margin: 0 auto; background: #fff; border: 1px solid var(--ms-line); border-radius: 26px; padding: 14px;
  box-shadow: 0 30px 60px -40px rgba(15,23,42,.5); }
.kn-pad canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: 18px; touch-action: none; cursor: crosshair;
  background: linear-gradient(var(--ms-line), var(--ms-line)) center / 100% 1px no-repeat, linear-gradient(var(--ms-line), var(--ms-line)) center / 1px 100% no-repeat, var(--ms-soft); }
.kn-pad-label { position: absolute; top: 24px; left: 26px; font-size: 14px; color: var(--ms-muted); z-index: 1; }
.kn-pad-label .ms-jp { color: var(--ms-ink); font-weight: 700; }
.kn-plan ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: d; }
.kn-plan li { border-top: 2px solid var(--ms-ink); padding-top: 12px; display: flex; flex-direction: column; }
.kn-plan b { font-size: 13px; color: var(--ms-muted); }
.kn-plan .ms-jp { color: var(--ms-ink); font-weight: 600; }
@media (max-width: 991.98px) {
  .kn-detail-col { position: sticky; top: 70px; z-index: 5; }   /* on phones the whole column sticks above the chart */
  .kn-detail { position: static; flex-direction: row; align-items: center; padding: 14px; gap: 14px; box-shadow: 0 16px 30px -24px rgba(15,23,42,.5); }
  .kn-detail-glyph { font-size: 3.6rem; padding: 10px 16px; flex-shrink: 0; }
  .kn-detail-main { min-width: 0; }
  .kn-detail-read b { font-size: 1.4rem; }
  .kn-detail-ex { padding: 8px 10px; margin-top: 6px; }
  .kn-detail .ms-btn-sm { padding: 6px 12px; font-size: 13px; }
}
@media (max-width: 767.98px) {
  .kn-progress { grid-template-columns: 1fr; }
  .kn-grid { gap: 6px; }
  .kn-cell { border-radius: 12px; padding: 8px 2px 6px; }
  .kn-cols-3 { max-width: none; }
  .kn-detail-other { display: none; }
  .kn-quiz { padding: 20px; }
  .kn-plan ol { grid-template-columns: 1fr 1fr; }
}

/* ── คันจิ.online (RYU KANJI) ─────────────────────────────── */
.kj-search { position: relative; max-width: 36rem; margin: 0 auto; text-align: left; }
.kj-search input { width: 100%; border: 1px solid #d4d6dc; border-radius: 999px; padding: 15px 22px 15px 50px; font-size: 1.05rem; background: #fff;
  box-shadow: 0 16px 34px -26px rgba(15,23,42,.5); outline: none; }
.kj-search input:focus { border-color: var(--ms-ink); }
.kj-search-ic { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--ms-muted); display: flex; }
.kj-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; background: #fff; border: 1px solid var(--ms-line); border-radius: 20px;
  box-shadow: 0 30px 60px -30px rgba(15,23,42,.5); max-height: 360px; overflow: auto; padding: 6px; }
.kj-results a { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 14px; text-decoration: none; color: var(--ms-text); }
.kj-results a:hover { background: var(--ms-soft); }
.kj-results .ms-jp { font-size: 1.8rem; font-weight: 600; color: var(--ms-ink); width: 44px; text-align: center; }
.kj-results .txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.kj-results b { color: var(--ms-ink); font-weight: 600; }
.kj-results small { color: var(--ms-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kj-noresult { padding: 14px; color: var(--ms-muted); text-align: center; }
.kj-levels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kj-levels a { display: flex; flex-direction: column; align-items: center; min-width: 86px; padding: 8px 14px; border-radius: 18px; border: 1px solid var(--ms-line);
  text-decoration: none; background: #fff; line-height: 1.3; transition: border-color .15s; }
.kj-levels a:hover { border-color: var(--ms-ink); }
.kj-levels b { color: var(--ms-ink); font-size: 1.1rem; }
.kj-levels small { color: var(--ms-muted); font-size: 12px; }
.kj-levels a.active { background: var(--ms-ink); border-color: var(--ms-ink); }
.kj-levels a.active b, .kj-levels a.active small { color: #fff; }
.kj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.kj-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border: 1px solid var(--ms-line);
  border-radius: 16px; text-decoration: none; background: #fff; transition: transform .12s, box-shadow .12s; }
.kj-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -18px rgba(15,23,42,.5); }
.kj-tile .ms-jp { font-size: 2.1rem; font-weight: 600; color: var(--ms-ink); line-height: 1.2; }
.kj-tile small { font-size: 11.5px; color: var(--ms-muted); text-align: center; line-height: 1.3; min-height: 2.6em; overflow: hidden; }
.kj-tile.learned { background: var(--ms-accent-soft); border-color: transparent; }
.kj-tile.learned::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ms-accent); }
.kj-choices button { font-size: 1rem !important; padding: 14px 10px !important; line-height: 1.4; }
.kj-crumb { font-size: 13px; color: var(--ms-muted); margin-bottom: 18px; }
.kj-crumb a { color: var(--ms-muted); text-decoration: none; }
.kj-crumb a:hover { color: var(--ms-ink); }
.kj-stroke-card { background: var(--ms-soft); border-radius: 28px; padding: 22px; }
.kj-svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 1; background: #fff; border-radius: 20px;
  background-image: linear-gradient(var(--ms-line), var(--ms-line)), linear-gradient(var(--ms-line), var(--ms-line));
  background-size: 100% 1px, 1px 100%; background-position: center; background-repeat: no-repeat; }
.kj-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kj-guide path { stroke: #e3e5ea; stroke-width: 3.2; }
.kj-ink path { stroke: var(--ms-ink); stroke-width: 3.4; }
.kj-meta { font-size: 13px; color: var(--ms-muted); }
.kj-char { font-size: clamp(4.5rem, 12vw, 6.5rem); line-height: 1; font-weight: 600; color: var(--ms-ink); }
.kj-th { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; color: var(--ms-ink); line-height: 1.3; }
.kj-en { color: var(--ms-muted); font-size: 14px; }
.kj-draft, .kj-approved { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border-radius: 999px; padding: 4px 12px; margin: 8px 0 4px; }
.kj-draft { background: #fef3c7; color: #92400e; }
.kj-approved { background: #dcfce7; color: #166534; }
.kj-readings { display: grid; gap: 12px; margin-top: 16px; }
.kj-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ms-muted); letter-spacing: .04em; margin-bottom: 6px; }
.kj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kj-reading { display: inline-flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--ms-line); background: #fff; border-radius: 14px; padding: 6px 12px; line-height: 1.3; }
.kj-reading:hover { border-color: var(--ms-ink); }
.kj-reading .ms-jp { font-size: 1.15rem; font-weight: 600; color: var(--ms-ink); }
.kj-reading small { color: var(--ms-muted); font-size: 12px; }
.kj-note { margin-top: 16px; background: var(--ms-soft); border-radius: 18px; padding: 14px 16px; }
.kj-example { width: 100%; text-align: left; position: relative; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--ms-line);
  border-radius: 20px; padding: 18px 20px; transition: box-shadow .15s, transform .15s; }
.kj-example:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -24px rgba(15,23,42,.5); }
.kj-ex-word { font-size: 1.7rem; font-weight: 600; color: var(--ms-ink); }
.kj-ex-read { color: var(--ms-muted); }
.kj-ex-th { color: var(--ms-text); }
.kj-ex-play { position: absolute; top: 16px; right: 16px; color: var(--ms-muted); font-size: 18px; }
.kj-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kj-pager a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border: 1px solid var(--ms-line); border-radius: 999px; padding: 8px 18px; color: var(--ms-ink); }
.kj-pager a .ms-jp { font-size: 1.3rem; font-weight: 600; }
.kj-credits li { margin-bottom: 10px; }
@media (max-width: 767.98px) {
  .kj-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .kj-tile { padding: 8px 2px; border-radius: 12px; }
  .kj-tile .ms-jp { font-size: 1.7rem; }
  .kj-tile small { font-size: 10.5px; }
  .kj-levels a { min-width: 0; flex: 1; padding: 6px 4px; }
}
.kn-detail-glyph-wrap { position: relative; }
.kn-strokes { display: block; width: 100%; height: clamp(7rem, 16vw, 10rem); background: #fff; border-radius: 20px; padding: 14px;
  box-shadow: 0 16px 36px -28px rgba(15,23,42,.5); }
.kn-strokes path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kn-stroke-btn { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--ms-line);
  background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--ms-text); }
@media (max-width: 991.98px) {
  .kn-strokes { height: 4.6rem; width: 4.6rem; padding: 6px; flex-shrink: 0; }
  .kn-detail-glyph-wrap { flex-shrink: 0; }
  .kn-stroke-btn span { display: none; }
  .kn-stroke-btn { right: -6px; bottom: -6px; padding: 4px; }
}
.kn-strokes[hidden], .kn-detail-glyph[hidden] { display: none; }

/* ── พจนานุกรมภาษาญี่ปุ่น.online (RYU DICTIONARY) ─────────────────────────────── */
.dc-search { position: relative; max-width: 38rem; margin: 0 auto; }
.dc-search input { width: 100%; border: 1px solid #d4d6dc; border-radius: 999px; padding: 17px 24px 17px 52px; font-size: 1.1rem; background: #fff;
  box-shadow: 0 16px 34px -26px rgba(15,23,42,.5); outline: none; }
.dc-search input:focus { border-color: var(--ms-ink); }
.dc-samples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.dc-samples button { border: 1px solid var(--ms-line); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 14px; color: var(--ms-text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Noto Sans Thai", sans-serif; }
.dc-samples button:hover { border-color: var(--ms-ink); }
.dc-results { display: grid; gap: 10px; }
.dc-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.dc-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--ms-line); border-radius: 18px; text-decoration: none;
  background: #fff; color: var(--ms-text); transition: box-shadow .15s, transform .15s; }
.dc-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -22px rgba(15,23,42,.5); }
.dc-card .w { font-size: 1.45rem; font-weight: 600; color: var(--ms-ink); line-height: 1.3; }
.dc-card .r { font-size: 13px; color: var(--ms-muted); }
.dc-card .m { font-size: 14.5px; color: var(--ms-ink); }
.dc-card .e { font-size: 12px; color: var(--ms-muted); }
.dc-ai-box { margin-top: 16px; background: var(--ms-soft); border-radius: 20px; padding: 18px 20px; }
.dc-suggest { margin-top: 14px; }
.dc-suggest .ms-jp { display: inline-block; background: var(--ms-soft); border-radius: 999px; padding: 4px 12px; margin: 0 6px 6px 0; }
.dc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dc-word { font-size: clamp(2.6rem, 8vw, 4.2rem); font-weight: 700; color: var(--ms-ink); line-height: 1.4; }
.dc-word rt { font-size: .32em; color: var(--ms-muted); font-weight: 500; }
.dc-read { color: var(--ms-muted); }
.dc-thai { background: var(--ms-soft); border-radius: 24px; padding: 20px 22px; margin-bottom: 18px; }
.dc-th-gloss { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; color: var(--ms-ink); margin-bottom: 6px; }
.dc-th-gloss:empty { display: none; }
.dc-ai-tag, .dc-ai-wait { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border-radius: 999px; padding: 4px 12px; }
.dc-ai-tag { background: #fef3c7; color: #92400e; }
.dc-ai-wait { background: #e0e7ff; color: #3730a3; }
.dc-ai-tag[hidden], .dc-ai-wait[hidden] { display: none; }
.dc-senses { padding-left: 1.3rem; margin: 0 0 12px; }
.dc-senses li { margin-bottom: 10px; }
.dc-pos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.dc-pos span { font-size: 12px; background: #fff; border: 1px solid var(--ms-line); border-radius: 999px; padding: 1px 10px; color: var(--ms-muted); }
.dc-examples { display: grid; gap: 10px; }
.dc-example { position: relative; text-align: left; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--ms-line);
  border-radius: 20px; padding: 16px 50px 16px 20px; transition: box-shadow .15s; }
.dc-example:hover { box-shadow: 0 14px 28px -22px rgba(15,23,42,.5); }
.dc-example .ja { font-size: 1.25rem; color: var(--ms-ink); font-weight: 600; }
.dc-example .rd { font-size: 13px; color: var(--ms-muted); }
.dc-kanji { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; font-size: 2rem; font-weight: 600; color: var(--ms-ink);
  border: 1px solid var(--ms-line); border-radius: 18px; text-decoration: none; background: #fff; }
.dc-kanji:hover { border-color: var(--ms-ink); }
@media (max-width: 767.98px) { .dc-grid { grid-template-columns: 1fr 1fr; } .dc-card { padding: 12px 14px; } .dc-card .w { font-size: 1.2rem; } }

/* ── แปลภาษาญี่ปุ่น.online (RYU TRANSLATOR) ─────────────────────────────── */
.tr-box { background: var(--ms-soft); border-radius: 30px; padding: 18px; }
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px 14px; }
.tr-dir { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ms-ink); }
.tr-swap { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ms-line); background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.tr-swap:hover { border-color: var(--ms-ink); }
.tr-auto { font-weight: 500; color: var(--ms-muted); font-size: 12px; }
.tr-styles button { border-color: var(--ms-line); color: var(--ms-text); background: #fff; }
.tr-styles button.active { background: var(--ms-ink); color: #fff; border-color: var(--ms-ink); }
.tr-styles.dim { opacity: .45; }
.tr-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tr-pane { background: #fff; border-radius: 22px; border: 1px solid var(--ms-line); padding: 16px; display: flex; flex-direction: column; min-height: 240px; }
.tr-pane textarea { flex: 1; border: 0; outline: none; resize: vertical; font-size: 1.15rem; line-height: 1.6; min-height: 150px; background: transparent; }
.tr-pane-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.tr-empty { color: var(--ms-muted); margin: auto; text-align: center; }
.tr-wait { display: inline-flex; align-items: center; gap: 8px; margin: auto; color: #3730a3; background: #e0e7ff; border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.tr-wait[hidden] { display: none; }
.tr-translation { font-size: 1.45rem; font-weight: 600; color: var(--ms-ink); line-height: 1.6; white-space: pre-wrap; }
.tr-reading { color: var(--ms-muted); margin-top: 6px; }
.tr-reading-th { color: var(--ms-muted); font-size: 14px; }
.tr-extra { margin-top: 18px; }
.tr-card { background: #fff; border: 1px solid var(--ms-line); border-radius: 22px; padding: 18px 20px; height: 100%; }
.tr-card h2 { display: flex; align-items: center; gap: 6px; }
.tr-alt { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--ms-line); background: var(--ms-soft); border-radius: 16px;
  padding: 10px 14px; margin-bottom: 8px; }
.tr-alt small { color: var(--ms-muted); font-size: 12px; }
.tr-alt .ms-jp { color: var(--ms-ink); font-weight: 600; font-size: 1.05rem; }
.tr-alt .rd { color: var(--ms-muted); font-weight: 400; font-size: 13px; }
.tr-words { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-word { display: inline-flex; flex-direction: column; text-decoration: none; border: 1px solid var(--ms-line); border-radius: 16px; padding: 8px 14px; line-height: 1.35; }
.tr-word:hover { border-color: var(--ms-ink); }
.tr-word .ms-jp { color: var(--ms-ink); font-weight: 600; font-size: 1.1rem; }
.tr-word small { color: var(--ms-muted); }
.tr-word em { font-style: normal; color: var(--ms-text); font-size: 13px; }
.tr-history { display: grid; gap: 8px; }
.tr-hist { text-align: left; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border: 1px solid var(--ms-line); background: #fff; border-radius: 16px; padding: 12px 16px; }
.tr-hist:hover { border-color: var(--ms-ink); }
.tr-hist span:last-child { color: var(--ms-ink); font-weight: 600; }
.ms-panel-first .tr-box ~ .tr-extra [hidden], [data-x][hidden] { display: none !important; }
@media (max-width: 767.98px) {
  .tr-panes { grid-template-columns: 1fr; }
  .tr-box { padding: 12px; border-radius: 22px; }
  .tr-hist { grid-template-columns: 1fr; gap: 4px; }
}

/* ── วัดระดับภาษาญี่ปุ่น.online (RYU JLPT TEST) ─────────────────────────────── */
.jl-placement { display: block; height: 100%; text-decoration: none; color: var(--ms-text); background: var(--ms-ink); border-radius: 28px; padding: 30px;
  background-image: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--ms-accent) 45%, transparent), transparent 60%); }
.jl-placement h2, .jl-placement .ms-kicker { color: #fff; }
.jl-placement p { color: #c9ced8; }
.jl-placement .ms-btn { background: #fff; color: var(--ms-ink) !important; border-color: #fff; }
.jl-last { display: block; font-size: 12.5px; color: #9aa1ad; margin-top: 12px; }
.jl-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.jl-level { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--ms-line); border-radius: 20px; padding: 16px 18px; text-decoration: none;
  color: var(--ms-text); background: #fff; transition: border-color .15s, transform .15s; }
.jl-level:hover { border-color: var(--ms-ink); transform: translateY(-2px); }
.jl-level b { font-size: 1.7rem; color: var(--ms-ink); line-height: 1.2; }
.jl-level span { font-size: 13px; color: var(--ms-muted); }
.jl-level .jl-last { margin-top: 4px; color: var(--ms-accent); }
.jl-level.off { opacity: .55; }
.jl-timer { font-variant-numeric: tabular-nums; font-weight: 700; background: var(--ms-ink); color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 14px; flex-shrink: 0; }
.jl-timer.low { background: #dc2626; }
.jl-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ms-muted); margin-bottom: 8px; }
.jl-bar { height: 5px; border-radius: 3px; background: var(--ms-line); overflow: hidden; margin-bottom: 22px; }
.jl-bar i { display: block; height: 100%; background: var(--ms-grad); width: 0; transition: width .3s; }
.jl-passage { background: var(--ms-soft); border-radius: 20px; padding: 18px 20px; margin-bottom: 18px; line-height: 2; white-space: pre-wrap;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; font-size: 1.05rem; color: var(--ms-ink); }
.jl-listen { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.jl-stem { font-size: 1.3rem; line-height: 1.9; color: var(--ms-ink); margin-bottom: 18px; }
.jl-stem u { text-decoration-thickness: 2px; text-underline-offset: 5px; }
.jl-choices { display: grid; gap: 10px; }
.jl-choice { display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--ms-line); background: #fff; border-radius: 18px; padding: 14px 18px;
  font-size: 1.1rem; color: var(--ms-ink); transition: border-color .12s; }
.jl-choice:hover { border-color: var(--ms-ink); }
.jl-choice .n { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--ms-line); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--ms-muted); }
.jl-choice.on { border-color: var(--ms-ink); background: var(--ms-soft); box-shadow: inset 0 0 0 1px var(--ms-ink); }
.jl-choice.on .n { background: var(--ms-ink); color: #fff; border-color: var(--ms-ink); }
.jl-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 26px; }
.jl-palette button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ms-line); background: #fff; font-size: 12.5px; color: var(--ms-muted); }
.jl-palette button.done { background: var(--ms-soft); color: var(--ms-ink); }
.jl-palette button.cur { border-color: var(--ms-ink); color: var(--ms-ink); font-weight: 700; }
.jl-score { margin: 14px 0 4px; color: var(--ms-ink); }
.jl-score b { font-size: 4rem; line-height: 1; }
.jl-score span { font-size: 1.5rem; color: var(--ms-muted); }
.jl-verdict { font-size: 1.1rem; }
.jl-sections { display: grid; gap: 8px; max-width: 32rem; }
.jl-sec { display: grid; grid-template-columns: 90px 1fr 50px; align-items: center; gap: 10px; font-size: 14px; }
.jl-sec b { text-align: right; color: var(--ms-ink); }
.jl-review { display: grid; gap: 12px; }
.jl-rev { border: 1px solid var(--ms-line); border-left: 4px solid #16a34a; border-radius: 16px; padding: 14px 18px; background: #fff; }
.jl-rev.bad { border-left-color: #dc2626; }
.jl-rev-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ms-muted); margin-bottom: 6px; }
.jl-rev-head .tag { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 1px 10px; }
.jl-rev-head .tag.ok { background: #dcfce7; color: #166534; }
.jl-rev-stem { font-size: 1.05rem; color: var(--ms-ink); margin-bottom: 6px; }
.jl-rev details { margin-bottom: 8px; font-size: 14px; }
.jl-rev summary { cursor: pointer; color: var(--ms-muted); }
.jl-rev-ans { font-size: 14px; margin-bottom: 6px; }
.jl-report { border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--ms-muted); text-decoration: underline; }

/* all-access plan card (replaces the per-level price table from SINGLE_PLAN_START) */
.ms-plan { max-width: 40rem; margin: 0 auto; border: 1px solid var(--ms-line); border-radius: var(--ms-radius); background: #fff; padding: 22px; }
.ms-plan-head { text-align: center; font-weight: 700; color: var(--ms-ink); margin: 0 0 16px; }
.ms-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ms-plan-opt { border: 1px solid var(--ms-line); border-radius: var(--ms-radius); padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.ms-plan-opt span { font-size: 14px; color: var(--ms-muted); }
.ms-plan-opt b { font-size: 30px; line-height: 1.1; color: var(--ms-ink); }
.ms-plan-opt small { font-size: 13px; font-weight: 700; color: var(--ms-ink); }
.ms-plan-opt.is-best { border: 2px solid var(--ms-ink); background: var(--ms-soft); }
@media (max-width: 480px) { .ms-plan-grid { grid-template-columns: 1fr; } }
