@import url("assets/fonts/KFontM/result.css");
@import url("assets/fonts/KFontC/result.css");
* { box-sizing: border-box; }
:root { color-scheme: light; --bg: #f6f7f9; --panel: #ffffff; --text: #1f2328; --muted: #667085; --line: #d8dee4; --soft-line: #eef1f4; --hover: #eef6ff; --input: #ffffff; --mark: #fff1a8; --footer-h: 42px; }
:root[data-theme="dark"] { color-scheme: dark; --bg: #111418; --panel: #181c22; --text: #e6edf3; --muted: #9aa6b2; --line: #30363d; --soft-line: #262c34; --hover: #1f3147; --input: #0f1318; --mark: #5a4a16; }
html, body { height: 100%; }
body { min-height: 100vh; margin: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; font-family: "KDS_GT", Arial, "Noto Sans CJK KR", "Malgun Gothic", sans-serif; color: var(--text); background: var(--bg); }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.brand-copy { min-width: 0; }
.app-icon { width: 58px; height: 58px; object-fit: contain; flex: 0 0 auto; }
.brand-line { display: flex; align-items: center; gap: 10px; }
.brand-dictionary { max-width: 260px; height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 34px 0 10px; color: var(--text); background: var(--input); font-family: "KDS_GT",  "KDS_CP", serif; font-size: 21px; font-weight: 700; }
.app-icon { cursor: pointer; }
#orderToggle { height: 34px; min-width: 72px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; color: var(--text); background: var(--input); font-family: "KDS_GT",  "KDS_CP", serif; font-size: 13px; font-weight: 700; cursor: pointer; }
#orderToggle[hidden] { display: none; }
#orderToggle:hover:not(:disabled) { background: var(--hover); }
#orderToggle:disabled { color: var(--muted); cursor: default; opacity: .72; }
#status { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.searchtools { display: grid; grid-template-columns: 128px minmax(260px, 520px); gap: 10px; align-items: end; font-family: "KDS_GT",  "KDS_CP", serif; }
.selectbox, .searchbox { display: grid; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.searchtools select, .searchbox input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; font-size: 15px; color: var(--text); background: var(--input); font-family: "KDS_GT",  "KDS_CP", serif; }
.searchbox input { padding: 0 12px; font-size: 16px; }
.theme-toggle { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; padding: 0; font-family: "Times New Roman", serif; font-size: 18px; line-height: 1; color: var(--text); background: var(--input); cursor: pointer; }
.layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: 0; }
.results { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; max-height: calc(100vh - 96px - var(--footer-h)); }
.result-head { padding: 12px 14px; border-bottom: 1px solid var(--soft-line); color: var(--muted); font-size: 13px; }
#compactCurrentTitle { display: none; color: var(--text); font-family: "KDS_GT",  "KDS_CP", serif; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result { width: 100%; display: grid; gap: 4px; text-align: left; padding: 12px 14px; color: var(--text); background: var(--panel); border: 0; border-bottom: 1px solid var(--soft-line); cursor: pointer; font-family: "KDS_GT",  "KDS_CP", serif; }
.result:hover, .result.active { background: var(--hover); }
.result .title { font-size: 15px; font-weight: 700; color: var(--text); }
.result .meta, .result .match { font-size: 12px; color: var(--muted); }
.tree-result { gap: 4px; padding-left: calc(8px + min(var(--level), 7) * 12px); }
.tree-result .title { font-weight: 600; line-height: 1.35; }
.tree-heading { cursor: pointer; background: var(--bg); }
.tree-heading:hover { background: var(--bg); }
.tree-heading .title { font-family: "KDS_GT",  "KDS_CP", serif; font-weight: 800; }
.tree-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; column-gap: 9px; min-width: 0; }
.tree-main { display: grid; gap: 3px; min-width: 0; }
.tree-toggle { width: 34px; min-height: 34px; display: inline-grid; place-items: center; align-self: center; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 19px; line-height: 1; }
.tree-toggle:not(.tree-toggle-empty):hover { color: var(--text); background: var(--soft-line); }
.tree-toggle-empty { visibility: hidden; }
.tree-result .meta { margin-left: 0; }
.result .match { font-family: "KDS_CP", "KDS_GT", "Batang", serif; line-height: 1.45; }
.result .match mark { color: var(--text); background: var(--mark); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.entry { min-width: 0; padding: 28px 34px 64px; overflow: auto; max-height: calc(100vh - 96px - var(--footer-h)); }
.empty, .error { color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.entry-head { margin-bottom: 18px; }
.entry-id { display: inline-block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.entry h2 { margin: 0; font-size: 28px; line-height: 1.25; font-family: "KDS_GT",  "KDS_CP", serif; }
.entry-credit { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; color: var(--muted); font-family: "KDS_GT",  "KDS_CP", serif; font-size: 14px; }
.body-text { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; line-height: 1.75; font-size: 17px; font-family: "KDS_CP", "KDS_GT", "Batang", serif; }
.mobile-empty { display: none; }
.body-text p { margin: 0 0 14px; text-indent: 1em; }
.body-text p:last-child { margin-bottom: 0; }
.body-text .entry-title-line { font-family: "KDS_GT",  "KDS_CP", serif; font-weight: 700; font-size: 1.08em; text-indent: 0; }
.body-text .marker-section-heading { margin: 1.35em 0 .65em; text-indent: 0; font-family: "KDS_GT",  "KDS_CP", serif; font-weight: 800; font-size: 1.05em; }
.body-text .marker-subentry { font-family: "KDS_CP", "KDS_GT", "Batang", serif; font-weight: 700; }
.entry-quote { display: block; margin: 8px 0; padding-left: 14px; border-left: 3px solid var(--line); white-space: pre-wrap; }
.entry-example { display: block; margin: 4px 0 4px 16px; color: var(--muted); }
.body-text .marker-indent { margin-left: 2.4em; text-indent: 1em; }
.body-text .marker-deep-indent { margin-left: 4em; text-indent: 1em; }
.body-text .marker-hanging, .body-text .marker-list { margin-left: 2.8em; text-indent: -1.6em; padding-left: 1.6em; }
.body-text .marker-numbered-block { width: fit-content; max-width: 88%; margin: 0 auto 14px; text-align: left; }
.body-text .marker-numbered { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); column-gap: .35em; width: max-content; max-width: 100%; margin: 0 0 6px; padding-left: 0; text-indent: 0; text-align: left; }
.body-text .marker-numbered:last-child { margin-bottom: 0; }
.marker-list-label { text-align: right; }
.marker-list-body { min-width: 0; text-align: left; }
.body-text .marker-linegap { margin-top: 1.1em; margin-left: 2.4em; text-indent: 0; }
.body-text .marker-center { text-align: center; text-indent: 0; }
.body-text .marker-center-block { width: fit-content; max-width: 88%; margin-left: auto !important; margin-right: auto !important; text-align: left; }
.body-text .marker-bullet { margin-left: 1.6em; text-indent: -1.1em; }
.body-text .marker-bullet::before { content: "• "; }
.body-text .marker-quote { font-family: "KDS_GT",  "KDS_CP", Arial, "Noto Sans CJK KR", "Malgun Gothic", sans-serif; line-height: 1.7; text-indent: 1.2em; color: var(--text); }
.body-text .marker-table { width: auto; max-width: 100%; margin: 14px 0; border-collapse: collapse; font-family: "KDS_CP", "KDS_GT", "Batang", serif; font-size: .96em; text-indent: 0; }
.body-text .song-block { width: fit-content; max-width: 100%; margin: 0 auto; text-align: left; }
.body-text .song-stanza { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); column-gap: .45em; width: 100%; max-width: 100%; margin: 0 0 18px; text-align: left; text-indent: 0; }
.body-text .song-coda { margin: .95em 0 18px 2.85em; text-align: left; text-indent: 0; }
.song-stanza-label { text-align: right; font-family: "KDS_GT",  "KDS_CP", serif; font-weight: 700; }
.song-stanza-body { min-width: 0; }
.marker-table th, .marker-table td { border: 1px solid var(--line); padding: 5px 9px; text-align: right; vertical-align: top; white-space: nowrap; }
.marker-table th { font-family: "KDS_GT",  "KDS_CP", serif; font-weight: 700; background: var(--bg); }
.inline-image { margin: 18px 0 0; }
.inline-image img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.site-footer { min-height: var(--footer-h); display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-family: "KDS_CP", "KDS_GT", "Batang", serif; font-size: 13px; padding: 8px 24px; text-align: center; }
.site-footer button { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--text); background: var(--input); cursor: pointer; font-family: "KDS_CP", "KDS_GT", "Batang", serif; }
.about-modal[hidden] { display: none; }
.about-modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 28px; }
.about-backdrop { position: absolute; inset: 0; border: 0; background: rgba(12, 17, 24, .58); backdrop-filter: blur(7px); cursor: pointer; }
.about-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 56px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, .32); padding: 22px; font-family: "KDS_CP", "KDS_GT", "Batang", serif; }
.about-card img { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: 16px; background: var(--bg); }
.about-card h2 { margin: 0 42px 12px 0; font-size: 22px; font-family: "KDS_GT",  "KDS_CP", serif; }
.about-card p { margin: 0 0 10px; line-height: 1.65; }
.about-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--input); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-open { overflow: hidden; }
#toTopButton { display: none; }
@media (max-width: 980px) {
  .topbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .searchtools { grid-template-columns: 128px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  body { --footer-h: 58px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .topbar { min-height: 78px; padding: 8px 10px 9px; gap: 8px; }
  .brand { min-width: 0; gap: 8px; }
  .app-icon { width: 42px; height: 42px; }
  .brand-line { min-width: 0; justify-content: space-between; }
  .brand-dictionary { max-width: min(70vw, 230px); height: 34px; font-size: 17px; padding-left: 8px; }
  #orderToggle { height: 30px; min-width: 62px; padding: 0 8px; font-size: 12px; }
  #status { margin-top: 2px; font-size: 11px; }
  .theme-toggle { width: 30px; height: 30px; font-size: 16px; }
  .searchtools { grid-template-columns: 104px minmax(0, 1fr); gap: 8px; align-items: end; }
  .selectbox, .searchbox { gap: 0; }
  .selectbox span, .searchbox span { display: none; }
  .searchtools select, .searchbox input { height: 36px; padding: 0 8px; font-size: 13px; }
  .searchbox input { font-size: 16px; }
  .layout { grid-template-columns: 1fr; }
  .results { max-height: 36vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .result-head { padding: 7px 10px; font-size: 12px; }
  .result { padding: 8px 10px; gap: 2px; }
  .result .title { font-size: 14px; }
  .result .meta, .result .match { font-size: 11px; }
  .tree-result { padding-left: calc(4px + min(var(--level), 7) * 9px); }
  .tree-row { grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; }
  .tree-toggle { width: 32px; min-height: 32px; font-size: 18px; }
  .entry { max-height: none; padding: 14px 10px 42px; }
  .entry-head { margin-bottom: 10px; }
  .entry h2 { font-size: 22px; }
  .body-text { border-radius: 6px; padding: 14px 12px; font-size: 16px; line-height: 1.68; }
  .site-footer { font-size: 11px; padding: 7px 10px; line-height: 1.35; flex-wrap: wrap; row-gap: 3px; }
  .site-footer span { max-width: 100%; }
  .desktop-empty { display: none; }
  .mobile-empty { display: inline; }
  body.mobile-chrome-compact .topbar { min-height: 50px; padding-bottom: 7px; }
  body.mobile-chrome-compact #status,
  body.mobile-chrome-compact .searchtools,
  body.mobile-chrome-compact #orderToggle { display: none; }
  body.mobile-chrome-compact .app-icon { width: 32px; height: 32px; }
  body.mobile-chrome-compact .results { max-height: 32px; overflow: hidden; }
  body.mobile-chrome-compact .result-head { padding: 7px 10px; border-bottom: 1px solid var(--line); }
  body.mobile-chrome-compact #results { height: 0; max-height: 0; overflow: hidden; visibility: hidden; }
  body.mobile-chrome-compact #resultCount { display: none; }
  body.mobile-chrome-compact #compactCurrentTitle { display: block; font-size: 16px; line-height: 1.15; }
  body.mobile-chrome-compact .entry { padding-bottom: 150px; }
  body.mobile-chrome-compact #toTopButton { display: grid; position: fixed; right: 14px; bottom: calc(var(--footer-h) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 5; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: var(--panel); box-shadow: 0 8px 26px rgba(0, 0, 0, .22); font-size: 17px; line-height: 1; }
}
