:root {
  --site-background: #f5f8f7;
  --site-ink: #19272a;
  --site-muted: #5d6c70;
  --site-line: #ccdae0;
  --site-header-background: #fbfeff;
  --site-accent: #0a7180;
  --site-accent-strong: #085764;
  --site-accent-soft: #e7f4f6;
  --site-voice: #b33b46;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.site-header > .site-brand, .site-app-header > .site-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--site-ink);
  text-decoration: none;
  font-family: "TLI Noto Sans", "Noto Sans", Arial, sans-serif;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.2;
}
.site-logo {
  display: block;
  flex: 0 0 96px;
  width: 96px;
  height: 64px;
  object-fit: contain;
}
.site-brand-names {
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: var(--site-ink);
  font-family: "TLI Noto Sans", "Noto Sans", Arial, sans-serif;
  font-size: 21px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}
.site-brand-names small {
  margin-top: 3px;
  color: var(--site-muted);
  font-size: 12px;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  line-height: 1.2;
}
.site-app-header .brand { color: var(--site-ink); text-decoration: none; }
.site-app-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  min-height: 84px;
  margin: 0 auto;
  padding: 20px 28px;
  border-bottom: 1px solid var(--site-line);
}
.site-app-header > .brand { flex: 0 0 auto; }
.site-app-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-left: auto;
  font-family: "TLI Western Punctuation", "Noto Sans KR", Calibri, sans-serif;
  font-size: 15px;
  line-height: 1.8;
}
.site-app-nav a {
  padding: 4px 0;
  color: var(--site-ink);
  text-decoration: none;
}
.site-app-nav a:hover { color: var(--site-accent); }
/* Dictionary and Translator open only for invited visitors (audit A4). */
.invite-only-note {
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 500;
  opacity: 0.75;
  white-space: nowrap;
  vertical-align: 0.1em;
}
.site-app-nav a[aria-current] { border-bottom: 2px solid var(--site-accent); color: var(--site-accent); }
.site-app-nav a:focus-visible { outline: 2px solid #2563eb; outline-offset: 4px; }
.site-nav-dropdown { position: relative; }
.site-nav-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  color: var(--site-ink);
  font: inherit;
  list-style: none;
  cursor: pointer;
}
.site-nav-trigger::-webkit-details-marker { display: none; }
.site-language-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("/assets/icons/languages.svg") center / contain no-repeat;
  mask: url("/assets/icons/languages.svg") center / contain no-repeat;
}
.site-nav-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.site-nav-dropdown[open] > .site-nav-trigger::after { transform: translateY(2px) rotate(225deg); }
.site-nav-trigger:hover { color: var(--site-accent); }
.site-nav-trigger.is-current { border-bottom: 2px solid var(--site-accent); color: var(--site-accent); }
.site-nav-trigger:focus-visible { outline: 2px solid #2563eb; outline-offset: 4px; }
.site-nav-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-width: calc(100vw - 40px);
  padding: 6px;
  border: 1px solid var(--site-line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 18px #17252b1a;
  line-height: 1.5;
}
.site-sandhi { margin-top: 6px; padding: 10px 10px 8px; border-top: 1px solid var(--site-line); }
.site-sandhi-label { display: block; margin-bottom: 6px; color: var(--site-muted, #5b6a70); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.site-sandhi-choices { display: flex; gap: 6px; }
.site-sandhi-choice { flex: 1 1 0; padding: 5px 8px; border: 1px solid var(--site-line); border-radius: 999px; color: var(--site-ink); background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.site-sandhi-choice:hover { border-color: var(--site-accent); color: var(--site-accent); }
.site-sandhi-choice[aria-pressed="true"] { border-color: var(--site-accent); color: #fff; background: var(--site-accent); }
.site-sandhi-choice:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
/* Singapore takes the site red used for its varying tones (.tli-sandhi-varies below). */
.site-sandhi-choice[data-sandhi-choice="singapore"]:hover { border-color: var(--site-voice, #b33b46); color: var(--site-voice, #b33b46); }
.site-sandhi-choice[data-sandhi-choice="singapore"][aria-pressed="true"] { border-color: var(--site-voice, #b33b46); color: #fff; background: var(--site-voice, #b33b46); }
.site-sandhi-note { margin: 8px 0 0; color: var(--site-muted, #5b6a70); font-size: 12px; line-height: 1.45; }
.site-nav-panel::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 0;
  right: 0;
  height: 9px;
}
.site-nav-dropdown .site-nav-panel a {
  display: block;
  padding: 10px 12px;
  border-bottom: 0;
  border-radius: 2px;
  color: var(--site-ink);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.site-nav-dropdown .site-nav-panel a:hover,
.site-nav-dropdown .site-nav-panel a:focus-visible,
.site-nav-dropdown .site-nav-panel a[aria-current] { background: var(--site-accent-soft); }
@media (max-width: 700px) {
  :is(.site-header nav, .site-app-nav) { position: relative; }
  .site-nav-dropdown { position: static; }
  .site-nav-panel { right: 0; left: 0; width: auto; }
}
@media (max-width: 640px) {
  .site-logo { flex-basis: 72px; width: 72px; height: 48px; }
  .site-app-header { align-items: flex-start; flex-direction: column; min-height: 0; padding: 16px 20px; }
  .site-app-nav { justify-content: flex-start; margin-left: 0; }
}

/* Written Voice: one quiet frame for every directory. */
.site-header, .site-app-header {
  width: 100%;
  max-width: none;
  padding: 20px max(24px, calc((100% - 1144px) / 2));
  background: var(--site-header-background);
  border-bottom: 1px solid var(--site-line);
}
.site-header nav, .site-app-nav { align-items: center; gap: 10px 18px; }
.site-header nav a, .site-app-nav a, .site-nav-trigger { color: var(--site-ink); }
.site-header nav a[aria-current], .site-app-nav a[aria-current], .site-nav-trigger.is-current {
  border-bottom-color: var(--site-accent); color: var(--site-accent);
}
.site-nav-dropdown .site-nav-panel a:hover,
.site-nav-dropdown .site-nav-panel a:focus-visible,
.site-nav-dropdown .site-nav-panel a[aria-current] { background: var(--site-accent-soft); }
.site-nav-trigger, .site-header nav > a, .site-app-nav > a { min-height: 40px; display: inline-flex; align-items: center; }
.site-header-search {
  position: relative;
  flex: 0 1 250px;
  min-width: 190px;
  height: 40px;
}
.site-header-search .tli-search,
.site-header-search .tli-search-input-wrap { height: 40px; }
.site-header-search .tli-search-input {
  width: 100%;
  height: 40px;
  padding: 0 116px 0 13px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-ink);
  background: #fff;
  font: inherit;
  line-height: 1;
  appearance: none;
}
.site-header-search .tli-search-input:hover { border-color: var(--site-accent); }
.site-header-search .tli-search-input:focus-visible { border-color: var(--site-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent) 18%, transparent); }
.site-header-search .tli-search-clear { right: 76px; width: 28px; height: 28px; }
.site-header-search .hangul-keyboard-toggle { right: 43px; }
.site-header-search .hanri-candidate-menu { top: calc(100% + 6px); right: 0; width: min(420px, calc(100vw - 32px)); max-width: none; }
.site-header-search-submit {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--site-ink);
  background: transparent;
  cursor: pointer;
}
.site-header-search-submit:hover { color: var(--site-accent); }
.site-header-search-submit:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.site-header-search-submit:active { transform: scale(.96); }
.site-search-icon {
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: url("/assets/icons/search.svg") center / contain no-repeat;
  mask: url("/assets/icons/search.svg") center / contain no-repeat;
}
/* Light/dark toggle, after the search field (added by shared/web-theme.js). */
.site-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 4px;
  color: inherit; background: transparent; cursor: pointer;
}
.site-theme-toggle:hover { color: var(--site-accent); }
.site-theme-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 4px; }
.site-theme-toggle svg { width: 19px; height: 19px; fill: currentColor; }
.site-footer {
  position: static;
  display: grid;
  gap: 18px;
  width: 100%;
  margin: 0;
  padding: 24px max(24px, calc((100% - 1144px) / 2));
  background: transparent;
  border-top: 1px solid var(--site-line);
  color: var(--site-muted);
  font-size: 14px;
  text-align: center;
}
.site-footer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: "TLI Western Punctuation", "Noto Sans KR", Calibri, sans-serif;
  font-size: 15px;
}
.site-footer-control,
.site-footer .site-language-dropdown > .site-nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-ink);
  background: transparent;
  font: inherit;
  line-height: 1.3;
  text-decoration: none;
}
.site-footer-control:hover,
.site-footer .site-language-dropdown > .site-nav-trigger:hover {
  border-color: var(--site-accent);
  color: var(--site-accent);
}
.site-footer-control:focus-visible,
.site-footer .site-language-dropdown > .site-nav-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}
.site-footer .site-theme-toggle { width: auto; padding: 8px 13px; }
.site-footer .site-theme-toggle svg,
.site-footer .site-language-icon { width: 18px; height: 18px; }
.site-footer-language .site-nav-panel { top: auto; bottom: calc(100% + 8px); }
.site-footer-meta { color: var(--site-muted); }
.site-back-to-top {
  position: fixed;
  z-index: 40;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-ink);
  background: color-mix(in srgb, var(--site-background) 92%, transparent);
  box-shadow: 0 6px 20px #17252b26;
  font: 600 14px/1.2 "TLI Western Punctuation", "Noto Sans KR", Calibri, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.site-back-to-top[hidden] { display: none; }
.site-back-to-top:hover { border-color: var(--site-accent); color: var(--site-accent); }
.site-back-to-top:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
body[data-site-section="songs"] .site-header nav [aria-current],
body[data-site-section="songs"] .site-app-nav [aria-current] { color: var(--site-voice); border-bottom-color: var(--site-voice); }
@media (max-width: 980px) {
  .site-header, .site-app-header { flex-wrap: wrap; }
  .site-header nav, .site-app-nav { justify-content: flex-start; margin-left: 0; }
}
@media (max-width: 700px) {
  .site-header, .site-app-header { padding: 16px 20px; gap: 12px; }
  .site-header nav, .site-app-nav { gap: 4px 16px; width: 100%; }
}
/* On a phone the search field gets a full row so its text, Hangul pill and submit button remain usable.
   Theme and language follow it, before the navigation links. */
@media (max-width: 640px) {
  :is(.site-header nav, .site-app-nav) > .site-header-search { order: -3; flex: 0 0 100%; width: 100%; min-width: 0; }
  :is(.site-header nav, .site-app-nav) > .site-theme-toggle { order: -2; }
  :is(.site-header nav, .site-app-nav) > .site-language-dropdown { order: -1; }
  /* A full-width empty item (order 0, ahead of the links) ends that first row. */
  :is(.site-header nav, .site-app-nav)::before { content: ""; flex: 0 0 100%; height: 0; }
  .site-footer { gap: 14px; }
  .site-footer-controls { gap: 8px; }
  .site-footer-control,
  .site-footer .site-language-dropdown > .site-nav-trigger { padding-inline: 11px; }
  .site-back-to-top { justify-content: center; width: 44px; padding: 0; }
  .site-back-to-top > span:last-child { display: none; }
}
.hangul-keyboard-hint::before {
  content: "ⓘ";
  display: inline-block;
  margin-right: 6px;
  color: #647278;
  font-family: "Segoe UI Symbol", Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  vertical-align: middle;
}

/* A tone mark that differs between Taipei and Singapore sandhi is coloured, so readers can see
   which tones vary by variety: cyan for Taipei, site red for Singapore.
   <html data-sandhi> is set by shared/web-sandhi-preference.js. The mark itself carries the
   tone, so the colour is never the only signal. */
:root { --tli-sandhi-varies: var(--site-voice, #b33b46); }
:root[data-sandhi="taipei"] { --tli-sandhi-varies: #0e7490; }
.tli-sandhi-varies { color: var(--tli-sandhi-varies); }

/* In Lomari only the tone accent is coloured. The vowel's real text stays (a selection and a copy
   use it) but is drawn invisibly; two copies of it are drawn exactly over it and cut where the
   letter ends, so nothing overlaps: the letter in the text colour, the accent in the accent
   colour. top: 50% with line-height: 0 centres each copy on the letter's own text box, and the
   cut is measured from that centre in TLI Noto Sans: 0.58em above the baseline for small letters
   (letter top 0.55em, accent bottom 0.61em) and 0.76em for capitals. */
.tli-lomari-tone { position: relative; -webkit-text-fill-color: transparent; --tli-tone-cut: -0.19em; }
.tli-lomari-tone[data-tone-upper] { --tli-tone-cut: -0.37em; }
.tli-lomari-tone::before, .tli-lomari-tone::after {
  content: attr(data-tone-text); position: absolute; left: 0; top: 50%; line-height: 0;
  -webkit-text-fill-color: currentColor; pointer-events: none; user-select: none;
}
.tli-lomari-tone::before { clip-path: inset(var(--tli-tone-cut) -0.5em -1.5em -0.5em); }
.tli-lomari-tone::after { color: var(--tli-sandhi-varies); clip-path: inset(-1.5em -0.5em calc(-1 * var(--tli-tone-cut)) -0.5em); }
/* While text is selected the real text is shown as usual, so the highlight looks normal. */
.tli-text-selected .tli-lomari-tone { -webkit-text-fill-color: currentColor; }
.tli-text-selected .tli-lomari-tone::before, .tli-text-selected .tli-lomari-tone::after { content: none; }

.site-nav-dropdown .site-nav-panel .site-sandhi-note .site-sandhi-guide { display: inline; padding: 0; color: var(--site-accent); text-decoration: underline; overflow-wrap: normal; }
