:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-deep: #e9e1d2;
  --paper-light: #fbfaf6;
  --ink: #28241f;
  --ink-soft: #625c53;
  --line: #d8cfc0;
  --line-strong: #bdb09e;
  --cinnabar: #a44332;
  --cinnabar-dark: #773125;
  --blue-ink: #355d68;
  --blue-wash: #e8f0ef;
  --shadow: 0 18px 50px rgb(70 53 31 / 9%);
  --reader-scale: 1;
  --header-height: 142px;
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(164 67 50 / 28%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--cinnabar-dark);
  border-radius: 5px;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(244 240 231 / 96%);
  backdrop-filter: blur(16px);
}

.masthead,
.toolbar {
  width: min(100% - 40px, 1480px);
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: #fff8ee;
  background: var(--cinnabar);
  border: 1px solid var(--cinnabar-dark);
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 25px;
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / 13%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 21px;
  letter-spacing: 0.17em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.masthead-aside {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px 8px 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-light);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.site-back:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.site-back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dataset-summary {
  display: flex;
  gap: 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

.dataset-summary b {
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 540px) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding-bottom: 12px;
}

.search-box {
  display: flex;
  height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper-light);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgb(164 67 50 / 10%);
}

.search-box svg {
  width: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input::placeholder {
  color: #8a8277;
}

kbd {
  padding: 2px 7px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #eee9df;
  font: 14px/1.5 ui-monospace, monospace;
}

.view-switch,
.font-controls {
  display: flex;
  justify-self: end;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ece6dc;
}

.view-switch button,
.font-controls button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.view-switch button[aria-pressed="true"] {
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: 0 2px 5px rgb(40 36 31 / 18%);
}

.font-controls button:hover,
.view-switch button:not([aria-pressed="true"]):hover {
  color: var(--ink);
  background: rgb(255 255 255 / 45%);
}

.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  width: min(100%, 1540px);
  min-height: calc(100vh - var(--header-height));
  margin-inline: auto;
}

.sidebar {
  border-right: 1px solid var(--line);
}

.sidebar-inner {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100vh - var(--header-height));
  padding: 34px 28px 40px;
  overflow-y: auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cinnabar);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.volume-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 27px;
  border-block: 1px solid var(--line-strong);
}

.volume-tabs button {
  min-height: 54px;
  color: var(--ink-soft);
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 20px;
}

.volume-tabs button:last-child {
  border-right: 0;
}

.volume-tabs button[aria-selected="true"] {
  position: relative;
  color: var(--cinnabar-dark);
  background: rgb(255 255 255 / 35%);
  font-weight: 700;
}

.volume-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--cinnabar);
  content: "";
}

.mobile-section-picker {
  display: none;
}

.section-nav {
  display: grid;
  gap: 3px;
}

.section-link {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 9px 8px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.section-link:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 42%);
}

.section-link[aria-current="true"] {
  color: var(--ink);
  background: var(--paper-light);
  box-shadow: 0 1px 5px rgb(65 50 30 / 6%);
}

.section-index,
.section-count {
  color: #968b7c;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.section-name {
  min-width: 0;
}

.section-name strong,
.section-name small {
  display: block;
}

.section-name strong {
  overflow: hidden;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-name small {
  margin-top: 3px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-note {
  display: flex;
  gap: 10px;
  margin-top: 35px;
  padding-top: 20px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.65;
}

.source-note-mark {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--cinnabar);
  border: 1px solid var(--cinnabar);
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
}

.source-note p {
  margin: 0;
}

code {
  padding: 0.12em 0.35em;
  border-radius: 3px;
  background: rgb(95 79 57 / 8%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1em;
}

.reader {
  min-width: 0;
  padding: 48px clamp(28px, 4vw, 72px) 80px;
}

.reader:focus {
  outline: none;
}

.reader > div {
  max-width: 1120px;
  margin-inline: auto;
}

.loading-state {
  display: grid;
  min-height: 46vh;
  place-items: center;
  align-content: center;
  color: var(--ink-soft);
}

.loading-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--cinnabar);
  border: 1px solid currentColor;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 26px;
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.35;
    transform: scale(0.95);
  }
}

.error-state {
  padding: 48px;
  border: 1px solid #d3b4a8;
  background: #fbf5ee;
  box-shadow: var(--shadow);
}

.error-state h1 {
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 28px;
}

.breadcrumb {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.05em;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading-row h1 {
  margin: 0;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: clamp(31px, 4vw, 50px);
  font-weight: 650;
  letter-spacing: 0.04em;
}

.section-subtitle {
  margin: 8px 0 0;
  color: var(--blue-ink);
  font-size: 16px;
  font-weight: 650;
}

.result-count {
  flex: 0 0 auto;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.search-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 13px 15px;
  border: 1px solid #c7d5d6;
  background: var(--blue-wash);
  font-size: 14px;
}

.search-context span {
  color: var(--blue-ink);
}

.search-context strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-context button {
  margin-left: auto;
  padding: 5px 8px;
  color: var(--blue-ink);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}

.monthly-checker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 28px;
  padding: clamp(18px, 3vw, 30px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--paper-light);
  box-shadow: 0 7px 23px rgb(69 54 32 / 5%);
}

.monthly-checker-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.monthly-checker .eyebrow {
  margin: 0 0 6px;
  color: var(--cinnabar);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.monthly-checker h2 {
  margin: 0;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: clamp(21px, 2.5vw, 29px);
  font-weight: 650;
}

.monthly-checker-summary {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.monthly-checker-legend {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 14px;
}

.monthly-checker-legend span,
.monthly-calendar-grade {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4efe6;
  font-weight: 750;
}

.monthly-checker-legend .best,
.grade-best .monthly-calendar-grade {
  color: #8b3225;
  border-color: #d8b5ac;
  background: #faede8;
}

.monthly-checker-legend .next,
.grade-next .monthly-calendar-grade {
  color: #275a61;
  border-color: #b8d1d0;
  background: #eaf3f2;
}

.monthly-checker-legend .today {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: transparent;
}

.monthly-calendar-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.monthly-calendar {
  display: grid;
  width: 100%;
  min-width: 700px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.monthly-calendar-weekday {
  padding: 8px 5px;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f1ece2;
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.monthly-calendar-weekday.sunday {
  color: var(--cinnabar);
}

.monthly-calendar-weekday.saturday {
  color: var(--blue-ink);
}

.monthly-calendar-spacer,
.monthly-calendar-day {
  min-width: 0;
  min-height: 104px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.monthly-calendar-spacer {
  background: #f6f2ea;
}

.monthly-calendar-day {
  position: relative;
  overflow: hidden;
}

.monthly-calendar-day.grade-best {
  background: #fff7f3;
  box-shadow: inset 0 3px #b95643;
}

.monthly-calendar-day.grade-next {
  background: #f4f9f8;
  box-shadow: inset 0 3px #477b82;
}

.monthly-calendar-day.is-today {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
}

.monthly-calendar-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}

.monthly-calendar-date strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.monthly-calendar-date span {
  color: var(--ink-soft);
  font-size: 14px;
  white-space: nowrap;
}

.monthly-calendar-ganzhi {
  margin: 9px 0 7px;
  color: var(--ink-soft);
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 14px;
  line-height: 1.45;
}

.monthly-calendar-ganzhi-hanja::before {
  content: " · ";
}

.monthly-calendar-grade {
  display: inline-block;
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.2;
}

.monthly-checker-note {
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.unit-list {
  display: grid;
  gap: 18px;
  margin-top: 38px;
}

.unit-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-light);
  box-shadow: 0 7px 23px rgb(69 54 32 / 5%);
}

.unit-meta {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 8px 18px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  background: #f1ece2;
  font-size: 14px;
}

.unit-meta > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unit-number {
  color: var(--ink);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.unit-section::before {
  margin-right: 8px;
  color: var(--line-strong);
  content: "·";
}

.unit-status {
  padding: 2px 6px;
  color: #6c5f4c;
  border: 1px solid #d7ccba;
  border-radius: 999px;
  background: #f8f3e9;
}

.unit-status.reviewed {
  color: #356257;
  border-color: #b8cec7;
  background: #edf5f1;
}

.unit-source {
  flex: 0 0 auto;
  color: var(--ink-soft);
  text-underline-offset: 3px;
}

.unit-source:hover {
  color: var(--cinnabar);
}

.parallel-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.text-panel {
  min-width: 0;
  padding: clamp(23px, 3vw, 38px);
}

.translation-panel {
  background: rgb(232 240 239 / 34%);
}

.text-panel h2 {
  margin: 0 0 16px;
  color: var(--cinnabar);
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.translation-panel h2 {
  color: var(--blue-ink);
}

.text-panel h2 span {
  margin-left: 5px;
  color: var(--ink-soft);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0;
}

.text-panel p,
.original-text {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.original-text {
  color: #25211c;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: calc(19px * var(--reader-scale));
  line-height: 1.95;
}

.translation-text {
  color: #24383b;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: calc(17px * var(--reader-scale));
  line-height: 2;
  word-break: keep-all;
}

.easy-reading {
  margin-top: 28px;
  padding: 19px 20px 20px;
  border: 1px solid #9db8b6;
  border-radius: 5px;
  background: #f6faf8;
}

.easy-reading h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--blue-ink);
  font-size: calc(14px * var(--reader-scale));
  letter-spacing: 0.02em;
}

.easy-reading h3 span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid currentColor;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 14px;
}

.interpretation-text {
  color: #20373a;
  font-size: calc(16px * var(--reader-scale));
  font-weight: 600;
  line-height: 1.85;
  word-break: keep-all;
}

.interpretation-terms {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 12px;
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid #d7e2df;
  font-size: calc(14px * var(--reader-scale));
  line-height: 1.65;
}

.interpretation-terms dt {
  color: var(--blue-ink);
  font-weight: 750;
}

.interpretation-terms dd {
  margin: 0;
  color: var(--ink-soft);
}

.source-figure {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  margin: 0;
}

.source-figure img {
  /* 도판 원본이 180~430px 이다. width 로 34rem 을 강제하면 최대 3배로 늘어나 글자가 뭉갠다.
     원본 픽셀을 넘지 않게 두고, 좁은 화면에서만 줄인다. */
  display: block;
  width: auto;
  max-width: min(100%, 34rem);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #eeeae1;
}

.source-figure figcaption {
  color: var(--ink-soft);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.source-figure.missing img {
  display: none;
}

.source-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fffdf8;
  white-space: normal;
  overscroll-behavior-inline: contain;
}

.source-table-context {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: calc(15px * var(--reader-scale));
  line-height: 1.7;
}

.source-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: calc(15px * var(--reader-scale));
  line-height: 1.65;
}

.source-table th,
.source-table td {
  min-width: 3.3em;
  padding: 8px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: top;
}

.source-table tr:last-child > * {
  border-bottom: 0;
}

.source-table tr > *:last-child {
  border-right: 0;
}

.source-table-empty-cell {
  color: transparent;
}

.source-table th {
  color: var(--cinnabar-dark);
  background: #f3ede2;
  font-weight: 700;
}

.source-table .row-label {
  width: auto;
  min-width: 5.5rem;
  max-width: 9rem;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.source-table-medium-labels .row-label {
  width: 11rem;
  min-width: 8rem;
  max-width: 13rem;
}

.source-table-wide-labels .row-label {
  width: 18rem;
  min-width: 14rem;
  max-width: 18rem;
}

.source-table tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: var(--line-strong);
  background: #e9dfcf;
}

.unit-notes {
  padding: 11px 20px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: #f4efe6;
  font-size: 14px;
  line-height: 1.6;
}

.empty-state {
  margin-top: 18px;
  padding: 58px 25px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.section-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 35px;
}

.section-pager button {
  min-height: 74px;
  padding: 13px 17px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.section-pager button:last-child {
  text-align: right;
}

.section-pager button:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgb(255 255 255 / 35%);
}

.section-pager button:disabled {
  opacity: 0.38;
  cursor: default;
}

.section-pager span,
.section-pager strong {
  display: block;
}

.section-pager span {
  margin-bottom: 5px;
  font-size: 14px;
  letter-spacing: 0.1em;
}

.section-pager strong {
  overflow: hidden;
  color: var(--ink);
  font-family: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-to-top svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-to-top {
  position: fixed;
  z-index: 15;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--paper-light);
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 7px 20px rgb(30 25 18 / 20%);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mode-original .translation-panel,
.mode-translation .original-panel {
  display: none;
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  padding: 16px;
  color: white;
  background: var(--cinnabar-dark);
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  :root {
    --header-height: auto;
  }

  .site-header {
    position: relative;
  }

  .masthead,
  .toolbar {
    width: min(100% - 28px, 720px);
  }

  .dataset-summary {
    display: none;
  }

  .monthly-calendar-ganzhi-hanja {
    display: none;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .view-switch {
    justify-self: start;
  }

  .shell {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-inner {
    position: static;
    max-height: none;
    padding: 22px 20px;
    overflow: visible;
  }

  .sidebar .eyebrow,
  .section-nav,
  .source-note {
    display: none;
  }

  .volume-tabs {
    margin-bottom: 16px;
  }

  .mobile-section-picker {
    display: grid;
    gap: 7px;
    color: var(--ink-soft);
    font-size: 14px;
  }

  .mobile-section-picker select {
    width: 100%;
    height: 45px;
    padding: 0 12px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--paper-light);
  }

  .reader {
    padding: 35px 18px 64px;
  }
}

@media (max-width: 680px) {
  .masthead {
    min-height: 70px;
  }

  .brand-seal {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small,
  kbd {
    display: none;
  }

  .toolbar {
    gap: 9px;
  }

  .view-switch button,
  .font-controls button {
    padding-inline: 11px;
    font-size: 14px;
  }

  .section-heading-row {
    display: block;
  }

  .result-count {
    margin-top: 14px;
  }

  .unit-list {
    margin-top: 26px;
  }

  .unit-meta {
    align-items: flex-start;
    padding: 10px 13px;
  }

  .unit-meta > div {
    flex-wrap: wrap;
  }

  .unit-section {
    display: none;
  }

  .unit-source {
    padding-top: 2px;
  }

  .text-panel {
    padding: 24px 21px 27px;
  }

  .original-text {
    font-size: calc(18px * var(--reader-scale));
  }

  .translation-text {
    font-size: calc(16px * var(--reader-scale));
  }

  .search-context span {
    display: none;
  }

  .monthly-checker {
    margin-top: 22px;
    padding: 15px;
  }

  .monthly-checker-header {
    display: block;
  }

  .monthly-checker-legend {
    margin-top: 13px;
  }

  .monthly-calendar-spacer,
  .monthly-calendar-day {
    min-height: 78px;
    padding: 6px;
  }

  .monthly-calendar-date {
    display: block;
  }

  .monthly-calendar-date strong,
  .monthly-calendar-date span {
    display: block;
  }

  .monthly-calendar-date strong {
    font-size: 15px;
  }

  .monthly-calendar-date span {
    margin-top: 1px;
    font-size: 14px;
  }

  .monthly-calendar-ganzhi {
    margin: 5px 0 0;
    font-size: 14px;
  }

  .monthly-calendar-grade {
    margin-top: 4px;
    padding: 1px 4px;
    font-size: 14px;
  }

  /* 글자를 14px 로 올린 뒤에도 한 주 7칸이 한 화면에 들어와야 한다.
     여백을 줄이고 음력 표기의 줄바꿈을 허용해 폭 대신 높이를 쓴다. */
  .monthly-calendar {
    min-width: 0;
  }

  .monthly-calendar-weekday {
    padding: 7px 2px;
  }

  .monthly-calendar-spacer,
  .monthly-calendar-day {
    min-height: 96px;
    padding: 6px 4px;
  }

  .monthly-calendar-date span {
    white-space: normal;
  }

  .section-pager {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .sidebar,
  .unit-meta,
  .section-pager,
  .back-to-top,
  .search-context {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .reader {
    padding: 0;
  }

  .unit-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
