/* Detail-only styles, adapted from the supplied ngu-phap-kotoninatteiru.html. */
.grammar-detail-page .gd-wrap {
  --gd-paper: #f7f8fa; --gd-surface: #fff; --gd-ink: #1b2433;
  --gd-muted: #5b6576; --gd-line: #e2e6ec; --gd-indigo: #23406b;
  --gd-indigo-soft: #e8eef7; --gd-shu: #15803d; --gd-shu-soft: #ecfdf3;
  --gd-jp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gd-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--gd-paper); color: var(--gd-ink); color-scheme: light;
}
.grammar-detail-page .gd-wrap, .grammar-detail-page .gd-wrap * { box-sizing: border-box; }
.grammar-detail-page .gd-wrap { width: 100%; max-width: none; min-width: 0; padding: 0 20px 40px; margin: 0; font: 400 16px/1.65 var(--gd-font); }
.gd-wrap a { color: var(--gd-indigo); }
.gd-wrap :focus-visible { outline: 3px solid var(--gd-shu); outline-offset: 3px; border-radius: 4px; }
.gd-wrap [hidden] { display: none !important; }
.gd-topline { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 20px 0 0; }
.gd-topline > nav:first-child { flex: 1 1 420px; min-width: 0; }
.gd-wrap .breadcrumb { display: flex; flex-wrap: wrap; gap: 5px 8px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--gd-muted); }
.gd-wrap .breadcrumb-item + .breadcrumb-item::before { content: "/"; margin-right: 8px; opacity: .6; }
.gd-wrap .breadcrumb a { color: var(--gd-muted); text-decoration: none; }
.gd-wrap .breadcrumb a:hover { color: var(--gd-indigo); text-decoration: underline !important; }
.gd-languages { display: inline-flex; gap: 3px; flex-shrink: 0; padding: 3px; border: 1px solid var(--gd-line); border-radius: 7px; }
.gd-languages a { padding: 4px 9px; border-radius: 4px; text-decoration: none; font-size: 12px; white-space: nowrap; }
.gd-languages a[aria-current] { background: var(--gd-indigo-soft); font-weight: 600; }
.gd-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 28px 0 32px; border-bottom: 1px solid var(--gd-line); }
.gd-hero-copy { min-width: 0; }
.gd-hero-copy:only-child { grid-column: 1 / -1; }
.gd-pattern { font-family: var(--gd-jp); font-weight: 900; font-size: clamp(36px, 5.2vw, 68px); line-height: 1.3; margin: 0; letter-spacing: .02em; overflow-wrap: anywhere; }
.gd-tilde { color: var(--gd-muted); font-weight: 500; }
.gd-pattern--long { font-size: clamp(28px, 4vw, 44px); }
.gd-romaji { margin: 8px 0 0; color: var(--gd-muted); font-size: 15px; }
.gd-meaning { margin: 16px 0 0; font-size: clamp(19px, 2.6vw, 23px); font-weight: 600; color: var(--gd-indigo); line-height: 1.6; }
.gd-stamp { width: 92px; height: 92px; border: 3px solid var(--gd-shu); border-radius: 12px; color: var(--gd-shu); display: grid; place-items: center; text-align: center; transform: rotate(-6deg); font-family: var(--gd-jp); font-weight: 900; line-height: 1.1; }
.gd-stamp b { font-size: 32px; display: block; }
.gd-stamp small { font: 600 12px var(--gd-font); }
.gd-section { padding: 32px 0; border-bottom: 1px solid var(--gd-line); scroll-margin-top: 110px; min-width: 0; }
.gd-section:last-of-type { border-bottom: 0; }
.gd-section > h2 { font-size: 20px; margin: 0 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 700; line-height: 1.5; }
.gd-section > h2 > span { font: 700 18px var(--gd-jp); color: var(--gd-shu); }
.gd-prose { overflow-wrap: anywhere; }
.gd-prose p { margin: 0 0 12px; }
.gd-prose p:last-child { margin-bottom: 0; }
.gd-prose a { text-decoration: underline; text-underline-offset: 3px; }
.gd-prose table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; }
.gd-prose td, .gd-prose th { padding: 10px 12px; border: 1px solid var(--gd-line); text-align: left; }
.gd-formula { display: flex; flex-wrap: wrap; gap: 12px; }
.gd-formula-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--gd-surface); border: 1px solid var(--gd-line); border-radius: 10px; padding: 14px 16px; flex: 1 1 300px; min-width: 0; }
.gd-chip { background: var(--gd-indigo-soft); color: var(--gd-indigo); border-radius: 6px; padding: 4px 10px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.gd-plus { color: var(--gd-muted); }
.gd-fixed { font: 700 19px/1.8 var(--gd-jp); color: var(--gd-shu); overflow-wrap: anywhere; }
.gd-gloss { flex-basis: 100%; font-size: 14px; color: var(--gd-muted); }
.gd-formula-source { background: var(--gd-surface); padding: 16px 18px; border: 1px solid var(--gd-line); border-radius: 10px; }
.gd-formation-details { margin-top: 16px; font-size: 14px; color: var(--gd-muted); }
.gd-formation-details summary { cursor: pointer; width: fit-content; }
.gd-formation-details .gd-prose { margin-top: 12px; padding: 12px 16px; background: var(--gd-surface); border-radius: 8px; }
.gd-callout { border-left: 4px solid var(--gd-shu); background: var(--gd-shu-soft); padding: 12px 16px; border-radius: 0 8px 8px 0; margin-top: 16px; }
.gd-callout > strong { display: block; margin-bottom: 5px; color: var(--gd-shu); }
.gd-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.gd-toggle { font: 500 14px/1.5 var(--gd-font); cursor: pointer; border: 1px solid var(--gd-line); background: var(--gd-surface); color: var(--gd-ink); border-radius: 999px; padding: 8px 14px; min-height: 40px; }
.gd-toggle[aria-pressed="true"] { background: var(--gd-indigo); border-color: var(--gd-indigo); color: #fff; }
.gd-toggle:hover { border-color: var(--gd-indigo); }
.gd-examples { list-style: none; margin: 0; padding: 0; }
.gd-example { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 12px; padding: 18px 0; border-top: 1px dashed var(--gd-line); }
.gd-example:first-child { border-top: 0; padding-top: 4px; }
.gd-example-number { grid-column: 1; grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--gd-indigo-soft); color: var(--gd-indigo); font-weight: 700; font-size: 14px; display: grid; place-items: center; margin-top: 6px; }
.gd-ja { grid-column: 2; font: 500 clamp(19px, 3vw, 22px)/2.1 var(--gd-jp); margin: 0; overflow-wrap: anywhere; }
.gd-ja b, .gd-ja strong, .gd-ja em { color: var(--gd-shu); font-weight: 700; font-style: normal; }
.gd-ja u, .gd-ja em { text-decoration: underline; text-decoration-color: var(--gd-shu); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gd-wrap rt { font-size: .5em; color: var(--gd-muted); font-weight: 500; }
.gd-wrap.gd-no-furi rt { visibility: hidden; }
.gd-translation { grid-column: 2; position: relative; min-width: 0; }
.gd-translation-text { margin: 0; color: var(--gd-muted); font-size: 15.5px; line-height: 1.8; }
.gd-example-note { color: var(--gd-muted); font-size: 14px; margin: 5px 0 0; }
.gd-translation.is-masked [data-translation-text] { filter: blur(6px); user-select: none; pointer-events: none; }
.gd-reveal { font: 500 13px/1.5 var(--gd-font); cursor: pointer; position: absolute; inset: 0 auto auto 0; padding: 5px 10px; color: var(--gd-indigo); background: var(--gd-surface); border: 1px solid var(--gd-line); border-radius: 6px; }
.gd-legacy-examples { font-size: 18px; line-height: 2; }
.gd-legacy-examples b, .gd-legacy-examples strong, .gd-legacy-examples u { color: var(--gd-shu); }
.gd-table-scroll { overflow-x: auto; border: 1px solid var(--gd-line); border-radius: 10px; background: var(--gd-surface); }
.gd-comparison-note { margin-bottom: 18px; }
.gd-comparison-table { border-collapse: collapse; width: 100%; min-width: 650px; font-size: 14px; line-height: 1.8; }
.gd-comparison-table th, .gd-comparison-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--gd-line); vertical-align: top; }
.gd-comparison-table tr:last-child > * { border-bottom: 0; }
.gd-comparison-table thead th { font-size: 13px; color: var(--gd-muted); font-weight: 600; background: var(--gd-paper); }
.gd-comparison-table tbody th { font-family: var(--gd-jp); font-weight: 700; white-space: nowrap; }
.gd-comparison-table td [lang="ja"] { font-family: var(--gd-jp); }
.gd-current > * { background: var(--gd-shu-soft); }
.gd-current th { color: var(--gd-shu); }
.gd-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.gd-related li { min-width: 0; }
.gd-related a { display: flex; flex-direction: column; gap: 4px; height: 100%; text-decoration: none; color: var(--gd-ink); background: var(--gd-surface); border: 1px solid var(--gd-line); border-radius: 10px; padding: 12px 16px; overflow-wrap: anywhere; }
.gd-related a:hover { border-color: var(--gd-indigo); }
.gd-related [lang="ja"] { font: 700 18px/1.8 var(--gd-jp); }
.gd-related small { color: var(--gd-muted); font-size: 12px; line-height: 1.65; }
.gd-pager { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0 38px; border-top: 1px solid var(--gd-line); }
.gd-pager a { min-width: 0; max-width: 48%; text-decoration: none; font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.gd-pager small { display: block; color: var(--gd-muted); font-size: 12px; font-weight: 400; margin-bottom: 4px; }
.gd-pager [lang="ja"] { font-family: var(--gd-jp); }
.gd-next { margin-left: auto; text-align: right; }
.gd-search { display: flex; gap: 8px; padding: 0 0 30px; }
.gd-search input { flex: 1; min-width: 0; padding: 12px; border-radius: 8px; border: 1px solid var(--gd-line); color: var(--gd-ink); background: var(--gd-surface); font: inherit; font-size: 14px; }
.gd-search button { background: var(--gd-indigo); color: #fff; border: 0; border-radius: 8px; padding: 10px 14px; font: 600 14px var(--gd-font); cursor: pointer; }
.gd-comments { padding-top: 24px; border-top: 1px solid var(--gd-line); }
.gd-comments h4 { margin-top: 0; font-size: 18px; }
.gd-comments .gop_y { border-color: var(--gd-line); }
.gd-comments .YKienText { background: var(--gd-surface); color: var(--gd-ink); border-color: var(--gd-line); border-radius: 8px; }
.gd-comments .gui_y_kien { background: var(--gd-indigo); border-color: var(--gd-indigo); font-family: var(--gd-font); }
.gd-comments .commentlabel { overflow-wrap: anywhere; }
.gd-comments hr { display: none; }
.gd-comments .modal { z-index: 100010; }
.gd-comments .modal-content { background: var(--gd-surface); color: var(--gd-ink); border-color: var(--gd-line); }
.gd-comments .modal-header { background: var(--gd-indigo-soft); color: var(--gd-ink); }
.gd-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; }
@media (max-width: 560px) {
  .grammar-detail-page .gd-wrap { padding: 0 18px 28px; }
  .gd-topline { gap: 10px; }
  .gd-hero { gap: 12px; grid-template-columns: minmax(0, 1fr) 62px; padding: 24px 0 28px; align-items: start; }
  .gd-pattern { font-size: clamp(30px, 7vw, 40px); line-height: 1.5; }
  .gd-pattern--long { font-size: 27px; }
  .gd-stamp { width: 62px; height: 62px; border-width: 2px; border-radius: 8px; margin-top: 5px; }
  .gd-stamp b { font-size: 24px; }
  .gd-stamp small { font-size: 10px; }
  .gd-romaji { font-size: 13px; }
  .gd-meaning { font-size: 18px; }
  .gd-section { padding: 26px 0; }
  .gd-section > h2 { font-size: 19px; }
  .gd-example { grid-template-columns: 26px minmax(0, 1fr); column-gap: 9px; }
  .gd-example-number { width: 24px; height: 24px; font-size: 12px; }
  .gd-related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gd-related a { padding: 10px 12px; }
}
@media (prefers-color-scheme: dark) {
  .grammar-detail-page .gd-wrap { --gd-paper: #11161f; --gd-surface: #18202c; --gd-ink: #e8ecf2; --gd-muted: #a6b1c2; --gd-line: #2a3444; --gd-indigo: #abc6ee; --gd-indigo-soft: #1f2c42; --gd-shu: #86efac; --gd-shu-soft: #123321; color-scheme: dark; }
  .gd-toggle[aria-pressed="true"], .gd-search button { color: #11161f; }
}
@media (prefers-reduced-motion: no-preference) {
  .gd-stamp { animation: gd-press .5s ease-out .15s both; }
  .gd-translation-text { transition: filter .2s; }
  @keyframes gd-press { from { opacity: 0; transform: rotate(-6deg) scale(1.2); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
}
