/* Keigo Converter: standalone, mobile-first. Logical properties throughout so RTL works. */
:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --text: #1d2420;
  --muted: #5d6862;
  --line: #e2e6e3;
  --brand: #198754;
  --brand-ink: #0f5c38;
  --brand-soft: #e8f4ee;
  --warn-bg: #fff6e0;
  --warn-line: #f0d48a;
  --warn-ink: #6b4d00;
  --err-bg: #fdecec;
  --err-ink: #8a1f1f;
  --del: #a03a3a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .05);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, Helvetica, Arial, sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --t-sonkeigo: #1f5fa8;  --t-sonkeigo-bg: #e8f0fa;
  --t-kenjogo1: #7a3fa0;  --t-kenjogo1-bg: #f3ebf8;
  --t-kenjogo2: #8a4b8f;  --t-kenjogo2-bg: #f6edf6;
  --t-teineigo: #0f6b45;  --t-teineigo-bg: #e5f4ec;
  --t-bikago:   #8a5a00;  --t-bikago-bg:   #fbf1dc;
  --t-expression: #4b5560; --t-expression-bg: #eef0f2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1311;
    --surface: #171c19;
    --text: #e6ebe8;
    --muted: #9aa59f;
    --line: #2a322e;
    --brand: #3fb47c;
    --brand-ink: #7fd8ab;
    --brand-soft: #16271e;
    --warn-bg: #2a2412;
    --warn-line: #5c4a1a;
    --warn-ink: #f0d48a;
    --err-bg: #2c1717;
    --err-ink: #f2a7a7;
    --del: #e48c8c;
    --shadow: none;
    --t-sonkeigo: #8db8ec;  --t-sonkeigo-bg: #17243a;
    --t-kenjogo1: #c9a3e3;  --t-kenjogo1-bg: #271b31;
    --t-kenjogo2: #d6a8da;  --t-kenjogo2-bg: #2a1c2b;
    --t-teineigo: #7fd8ab;  --t-teineigo-bg: #14271d;
    --t-bikago:   #e8c27a;  --t-bikago-bg:   #2b2311;
    --t-expression: #b4bdc6; --t-expression-bg: #22282d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  overflow-x: hidden;
}
[lang="ja"] { font-family: var(--font-ja); }
a { color: var(--brand-ink); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.wrap { max-width: 860px; margin: 0 auto; padding-inline: 16px; }

/* header */
.site-header { background: var(--surface); border-block-end: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: .95rem; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-link { font-size: .9rem; font-weight: 600; white-space: nowrap; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--muted); padding-block: 14px 0; }
.crumbs a { color: var(--muted); }

/* hero */
.hero { padding-block: 18px 8px; }
.hero h1 { font-size: clamp(1.75rem, 6vw, 2.4rem); letter-spacing: -.01em; }
.h1-ja { font-size: .55em; font-weight: 600; color: var(--muted); margin-inline-start: .35em; white-space: nowrap; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 40em; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.trust li::before { content: "✓"; color: var(--brand); font-weight: 700; margin-inline-end: 6px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-block: 18px; }
@media (min-width: 640px) { .card { padding: 24px; } }

/* form */
.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.field legend, .label { font-weight: 650; font-size: .95rem; margin-block-end: 8px; padding: 0; display: block; }
.field-row { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seg-opt { position: relative; display: block; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  min-height: 52px; height: 100%; padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.seg-opt b { font-weight: 600; font-size: .93rem; line-height: 1.3; }
.seg-opt small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.seg-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.seg-opt input:checked + span b { color: var(--brand-ink); }
.seg-opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
@media (hover: hover) { .seg-opt:hover span { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); } }

.input-wrap { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s; }
.input-wrap:focus-within { border-color: var(--brand); }
textarea {
  display: block; width: 100%; min-height: 128px; resize: vertical;
  border: 0; border-radius: 12px 12px 0 0; padding: 12px 14px; background: transparent; color: var(--text);
  font: 16px/1.7 var(--font-ja); /* 16px: no iOS zoom on focus */
}
textarea:focus { outline: none; }
textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 4px 12px 8px; }
.counter { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--err-ink); font-weight: 700; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-block-start: 10px; font-size: .85rem; color: var(--muted); }
.chip {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 34px;
}
.chip:hover { border-color: var(--brand); }
.chip:disabled { cursor: default; opacity: .6; }
.chip.picked { border-color: var(--brand); background: var(--brand-soft); opacity: 1; }

.link-btn { font: inherit; font-size: .85rem; background: none; border: 0; padding: 4px; color: var(--brand-ink); text-decoration: underline; cursor: pointer; }
.inline-link { font-weight: 600; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; border-radius: 10px; padding: 10px 18px; min-height: 44px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; width: 100%; min-height: 52px; font-size: 1.05rem; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-primary:disabled { opacity: .75; cursor: progress; }
.btn-ghost { background: var(--bg); color: var(--text); border-color: var(--line); padding: 6px 14px; min-height: 38px; font-size: .9rem; }
.btn-ghost.done { color: var(--brand-ink); border-color: var(--brand); }
.btn-outline { background: transparent; color: var(--brand-ink); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the convert button stays reachable on phones */
.submit-bar { position: sticky; bottom: 0; z-index: 2; margin-inline: -18px; margin-block-end: -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
@media (min-width: 640px) { .submit-bar { position: static; margin: 0; padding: 0; background: none; } .btn-primary { width: auto; min-width: 240px; } }
.quota { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.quota:empty { display: none; }

.alert { margin-block-start: 26px; padding: 12px 14px; border-radius: 10px; background: var(--err-bg); color: var(--err-ink); font-size: .93rem; }
.alert a, .alert .link-btn { color: inherit; }

/* result */
.result { scroll-margin-top: 12px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 6px; }
.result-head h2 { margin: 0; font-size: 1.05rem; color: var(--muted); font-weight: 650; }
.result-text { font-size: 1.22rem; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 8px 18px; padding: 14px 16px; background: var(--brand-soft); border-radius: 10px; border-inline-start: 4px solid var(--brand); }

.warnings { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; margin-block-end: 16px; }
.warnings h3 { font-size: .95rem; margin-block-end: 6px; }
.warnings ul { margin: 0; padding-inline-start: 1.2em; font-size: .92rem; }
.warnings li + li { margin-block-start: 4px; }
.warnings .sev-error { font-weight: 600; }
.advice { font-size: .93rem; color: var(--muted); }

.changes-head { margin-block-start: 6px; }
.changes { list-style: none; padding: 0; margin: 0 0 16px; counter-reset: c; }
.changes li { padding-block: 12px; border-block-start: 1px solid var(--line); }
.changes li:first-child { border-block-start: 0; padding-block-start: 4px; }
.pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pair del { color: var(--del); text-decoration-thickness: 1.5px; overflow-wrap: anywhere; }
.pair ins { text-decoration: none; font-weight: 700; overflow-wrap: anywhere; }
.arrow { color: var(--muted); }
[dir="rtl"] .arrow { transform: scaleX(-1); display: inline-block; }
.note { margin: 4px 0 0; font-size: .92rem; color: var(--muted); }

.badge { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; align-self: center; }
.badge-sonkeigo { color: var(--t-sonkeigo); background: var(--t-sonkeigo-bg); }
.badge-kenjogo1 { color: var(--t-kenjogo1); background: var(--t-kenjogo1-bg); }
.badge-kenjogo2 { color: var(--t-kenjogo2); background: var(--t-kenjogo2-bg); }
.badge-teineigo { color: var(--t-teineigo); background: var(--t-teineigo-bg); }
.badge-bikago { color: var(--t-bikago); background: var(--t-bikago-bg); }
.badge-expression { color: var(--t-expression); background: var(--t-expression-bg); }

.cta { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 10px; margin-block: 8px 14px; }
.cta p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
@media (min-width: 640px) { .cta { flex-direction: row; align-items: center; justify-content: space-between; } }
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.thanks { color: var(--brand-ink); }
.disclaimer { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }

.skeleton span { display: block; height: 18px; border-radius: 6px; margin-block: 12px; background: linear-gradient(90deg, var(--line), var(--bg), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton span.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span, .spinner { animation: none; } }

/* content */
.content { padding-block: 12px 24px; }
.content section { margin-block: 36px; }
.types { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .types { grid-template-columns: 1fr 1fr; } }
.type { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.type p { margin-block-end: .5em; font-size: .93rem; }
.type-term { font-size: 1.15rem !important; font-weight: 700; margin: 0 !important; }
.type-name { color: var(--muted); }
.type-ex { margin: 0 !important; padding-block-start: 6px; border-block-start: 1px solid var(--line); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.verbs { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.verbs th, .verbs td { text-align: start; padding: 10px 12px; border-block-end: 1px solid var(--line); vertical-align: top; }
.verbs thead th { font-size: .8rem; color: var(--muted); font-weight: 650; background: var(--bg); position: sticky; top: 0; }
.verbs tbody th { white-space: nowrap; }
.verbs tbody th small { display: block; color: var(--muted); font-weight: 400; }
.verbs tbody tr:last-child > * { border-block-end: 0; }
.verbs sup { font-size: .7em; color: var(--muted); margin-inline-start: 1px; }

.mistakes { display: grid; gap: 12px; }
.mistake { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mistake p { margin-block-end: .4em; font-size: .93rem; }
.mistake .wrong { color: var(--del); }
.mistake .wrong span[lang] { text-decoration: line-through; text-decoration-thickness: 1px; }
.mistake .right { color: var(--brand-ink); font-weight: 600; }

.method { padding-inline-start: 1.3em; }
.method li { margin-block-end: .6em; }

.faq details { border-block-end: 1px solid var(--line); padding-block: 12px; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.2em; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

.sources ul { padding-inline-start: 1.2em; }

/* footer */
.site-footer { border-block-start: 1px solid var(--line); background: var(--surface); padding-block: 24px calc(24px + env(safe-area-inset-bottom)); font-size: .92rem; }
.footer-title { font-weight: 700; margin-block-end: 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.langs { color: var(--muted); }
.resets { display: block; margin-block-start: 2px; opacity: .85; }
/* Particle Checker: additions on top of ../../common/assets/base.css */
:root {
  --pt-ok: #0f6b45;      --pt-ok-line: #9fd3b8;
  --pt-err: #a03a3a;     --pt-err-bg: #fdecec;   --pt-err-line: #e8a5a5;
  --pt-miss: #1f5fa8;    --pt-miss-bg: #e8f0fa;  --pt-miss-line: #9cbde6;
  --pt-both: #8a5a00;    --pt-both-bg: #fbf1dc;  --pt-both-line: #e3c27a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pt-ok: #7fd8ab;    --pt-ok-line: #2f6a4c;
    --pt-err: #f2a7a7;   --pt-err-bg: #2c1717;   --pt-err-line: #6b3030;
    --pt-miss: #8db8ec;  --pt-miss-bg: #17243a;  --pt-miss-line: #34507a;
    --pt-both: #e8c27a;  --pt-both-bg: #2b2311;  --pt-both-line: #6b5420;
  }
}

/* mode + toggle */
.mode-badge { font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.mode-badge.deep { color: var(--brand-ink); background: var(--brand-soft); border-color: transparent; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); cursor: pointer; min-height: 44px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }

.summary-line { margin: 10px 0 12px; font-size: 1rem; }
.summary-line .good { color: var(--brand-ink); }
.summary-line .warn { color: var(--pt-err); }
.summary-line .neutral { color: var(--text); }

/* the marked-up text */
.annotated {
  font-size: 1.22rem; line-height: 2.25; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.result.stale .annotated, .result.stale .issues, .result.stale .corrected { opacity: .5; }

.pt {
  display: inline-flex; align-items: baseline; gap: 2px;
  font: inherit; line-height: 1.35; padding: 1px 5px; margin: 0 1px; border-radius: 6px;
  border: 1.5px solid transparent; background: transparent; color: inherit;
}
button.pt { cursor: pointer; min-height: 32px; }
.pt s { text-decoration-thickness: 1.5px; opacity: .8; }
.pt b { font-weight: 700; }
.pt .arr { font-size: .8em; opacity: .75; margin: 0 1px; }
.pt-ok { color: var(--pt-ok); border-bottom: 2px solid var(--pt-ok-line); border-radius: 2px; padding: 0 1px; }
.hide-ok .pt-ok { color: inherit; border-bottom-color: transparent; }
/* Quick check: particles are found, not verified, so no green "correct" styling. */
.mode-quick .pt-ok { color: inherit; border-bottom: 2px dotted var(--muted); }
.hide-ok.mode-quick .pt-ok { border-bottom-color: transparent; }
.pt-error, .pt-extra { color: var(--pt-err); background: var(--pt-err-bg); border-color: var(--pt-err-line); }
.pt-missing { color: var(--pt-miss); background: var(--pt-miss-bg); border-color: var(--pt-miss-line); border-style: dashed; }
.pt-both { color: var(--pt-both); background: var(--pt-both-bg); border-color: var(--pt-both-line); }
button.pt[aria-expanded="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent); }


/* detail panel (under the text, not a tooltip: works on touch) */
.detail { margin: 12px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.detail-head .pt { font-size: 1.05rem; }
.detail-rule { font-weight: 650; margin-bottom: 4px; }
.detail-note { color: var(--muted); margin-bottom: 6px; }
.tag { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }

/* issue list */
.issues { list-style: none; margin: 0 0 16px; padding: 0; }
.issues li { border-block-start: 1px solid var(--line); padding-block: 8px; }
.issues li:first-child { border-block-start: 0; }
.issues li.active .issue-title { color: var(--brand-ink); }
.issue-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; text-align: start; font: inherit; background: none; border: 0; padding: 4px 0; color: inherit; cursor: pointer; min-height: 40px; }
.issue-btn .pt { font-size: 1.02rem; }
.issue-title { font-weight: 600; }

.corrected { margin-block: 8px 16px; }
.corrected h3 { margin: 0; font-size: 1rem; }
.corrected .result-text { font-size: 1.12rem; margin-block: 8px 0; }

/* deep check offer */
.deep-box { margin-block: 14px; padding: 14px 16px; border-radius: 10px; background: var(--brand-soft); }
.deep-box p { margin-bottom: 10px; }
.deep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.btn-deep { background: var(--surface); color: var(--brand-ink); border-color: var(--brand); min-height: 46px; }
.btn-deep:hover { background: var(--bg); }
.btn-deep:disabled { opacity: .6; cursor: not-allowed; }
.btn-deep .spinner { border-color: color-mix(in srgb, var(--brand) 35%, transparent); border-top-color: var(--brand); }
.btn-deep.busy .spinner { display: inline-block; }
.deep-left { font-size: .85rem; color: var(--muted); }
.deep-msg { margin-top: 10px; font-size: .9rem; }
.deep-msg.error { color: var(--err-ink); }
@media (max-width: 639px) { .btn-deep { width: 100%; } }

.other { margin-block: 14px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 10px; }
.other h3 { margin-bottom: 4px; font-size: 1rem; }
.other p { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.other ul { margin: 0 0 12px; padding-inline-start: 1.2em; font-size: .92rem; }
.other-text { font-weight: 600; }

/* content */
.cheat { min-width: 520px; }
.cheat-p { font-size: 1.25rem; font-weight: 700; color: var(--brand-ink); }
.cheat td small { display: block; color: var(--muted); }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.points li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.points p { margin-bottom: .4em; font-size: .95rem; }
.point-ex { margin: 0 !important; color: var(--muted); }
.point-ex span[lang] { color: var(--text); }
.rules { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .rules { grid-template-columns: 1fr 1fr; } }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; scroll-margin-top: 16px; }
.rule:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rule h3 { font-size: .98rem; }
.rule p { font-size: .92rem; margin-bottom: .4em; }
.rule .wrong { color: var(--del); }
.rule .wrong span[lang] { text-decoration: line-through; text-decoration-thickness: 1px; }
.rule .right { color: var(--brand-ink); font-weight: 600; }
