/* dic.hanja.ai: one stylesheet, phone first, no external fonts (the demo may be offline). */
:root {
  --ink: #1c1b18; --muted: #6b6760; --line: #e4e0d8; --paper: #fbfaf7; --card: #ffffff;
  --accent: #8a3b12; --hanja: #1f4e79; --component: #7a5a00; --component-bg: #fff7dd; --level: #eef3f8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.site { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); display: flex; gap: 10px; align-items: baseline; }
header.site a { font-weight: 700; color: var(--ink); }
.site-sub { color: var(--muted); font-size: 0.9rem; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
footer { max-width: 760px; margin: 32px auto 0; padding: 16px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 20px 0 8px; color: var(--ink); }
h2 small, summary small, h1 small { font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-left: 6px; }
section { margin-bottom: 8px; }

/* the head of a page: a big glyph rendered as text, never as a picture */
.head { display: flex; gap: 18px; align-items: flex-start; padding: 8px 0 12px; }
.glyph { font-family: "Noto Serif KR", "Batang", "AppleMyungjo", serif; font-size: 5rem; line-height: 1; color: var(--hanja); min-width: 1.2em; text-align: center; }
.glyph.component { color: var(--component); outline: 2px dashed var(--component); outline-offset: 6px; border-radius: 6px; }
.head-text .others { color: var(--muted); margin: 0 0 6px; }
.head-text .meta { margin: 0 0 4px; color: var(--muted); font-size: 0.9rem; }
.head-text .english { margin: 0; color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--level); font-size: 0.8rem; color: var(--ink); }
.badge.level { background: var(--level); }
.badge.component { background: var(--component-bg); color: var(--component); }

.picture { margin: 8px 0 16px; }
.picture img { width: 100%; height: auto; border-radius: 10px; display: block; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.card h2:first-child { margin-top: 4px; }
.card p { margin: 0 0 8px; }
.card.none { color: var(--muted); }
.mnemonic { font-size: 1.05rem; }
.sentences { list-style: none; padding: 0; margin: 0; }
.sentences li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.sentences .en { color: var(--muted); font-size: 0.9rem; }

.facts dl { display: grid; grid-template-columns: 6.5em 1fr; gap: 6px 10px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts dd small, .nodes small { color: var(--muted); }
.forms span { display: inline-block; margin-right: 14px; color: var(--muted); }
.forms b { color: var(--ink); font-size: 1.2rem; font-weight: 500; margin: 0 2px; }

/* links to nodes: a hanja is solid, a component is dashed and amber, so the two are told apart */
.node { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 8px; font-size: 1.15rem; line-height: 1.4; }
.node.hanja { background: var(--level); color: var(--hanja); }
.node.component { background: var(--component-bg); color: var(--component); outline: 1px dashed var(--component); }
.node small { font-size: 0.75rem; color: var(--muted); }
.node.plain { color: var(--muted); }

.words { list-style: none; padding: 0; margin: 0; }
.words li { border-top: 1px solid var(--line); }
.words .word { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; color: var(--ink); flex-wrap: wrap; }
.words .hangul { font-weight: 600; }
.words .origin { color: var(--hanja); }
.words .gloss { color: var(--muted); font-size: 0.9rem; flex-basis: 100%; }
.maps p a { margin-right: 16px; }

/* index */
.intro p { color: var(--muted); }
details { border-top: 1px solid var(--line); padding: 6px 0; }
summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin: 8px 0 12px; }
.cell { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.cell .g { font-family: "Noto Serif KR", "Batang", serif; font-size: 1.7rem; color: var(--hanja); line-height: 1.1; }
.cell .n { font-size: 0.72rem; color: var(--muted); text-align: center; margin-top: 2px; }
.cell.has-card { border-color: var(--accent); }
.cell.component .g { color: var(--component); }
.cell.component { background: var(--component-bg); border-style: dashed; }
@media (max-width: 480px) { .glyph { font-size: 4rem; } .facts dl { grid-template-columns: 5em 1fr; } }

/* D37: a sentence's words with the hanja above the page's level masked: 삼寸(촌) */
.sentences .masked { margin-top: 4px; }
.sentences .chip { display: inline-block; margin: 2px 6px 0 0; padding: 0 8px; border-radius: 8px; background: var(--level); font-size: 0.95rem; }
.sentences .chip b { color: var(--hanja); font-weight: 600; }
