:root {
  color-scheme: light;
  --ink: #193b34;
  --ink-muted: #536059;
  --paper: #f7f3eb;
  --surface: #fffdf8;
  --line: #dfd7c6;
  --copper: #a94a36;
  --active: #e6eee6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 88% 18%, #fdf9ef, transparent 50%), var(--paper);
  color: var(--ink);
  font: 1rem/1.7 Tahoma, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 2; inset: .6rem auto auto .6rem; transform: translateY(-160%); background: white; padding: .5rem .8rem; }
.skip-link:focus { transform: none; }

.masthead {
  background: #183833;
  color: #fffbef;
  border-bottom: 3px solid #bb7350;
}
.masthead-inner, .shell { width: min(92%, 88rem); margin-inline: auto; }
.masthead-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: space-between;
  min-height: 4.35rem;
}
.site-name { display: flex; align-items: center; gap: .8rem; font-size: 1.12rem; font-weight: 700; letter-spacing: normal; }
.site-name small { margin-inline-start: .45rem; color: #d7e2d7; font-size: .8rem; font-weight: 400; }
.mark {
  display: grid;
  grid-template-columns: repeat(3, .26rem);
  gap: .16rem;
  align-items: end;
  justify-content: center;
  align-content: center;
  border: 1px solid #c99772;
  border-radius: 50%;
  width: 2.35rem;
  height: 2.35rem;
}
.mark i { background: #d7ac85; height: .72rem; border-radius: 1px; }
.mark i:nth-child(2) { height: 1.06rem; }
.mark i:nth-child(3) { height: .56rem; }
.pdf-link { display: flex; align-items: center; gap: .55rem; border: 1px solid #679184; border-radius: .45rem; padding: .35rem .7rem; font-size: .86rem; }
.pdf-link:hover { background: #2a4e46; }
.pdf-link bdi { color: #f0ceb2; font-size: .72rem; font-weight: 700; }

.shell { padding-block: clamp(1.6rem, 4vw, 3.8rem) 3rem; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding-bottom: clamp(1rem, 2.6vw, 1.9rem); }
.intro h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.55rem); line-height: 1.35; font-weight: 800; }
.intro h1 span { color: var(--copper); }
.intro p { margin: .35rem 0 0; color: var(--ink-muted); }
.slide-total { flex-shrink: 0; color: var(--ink-muted); border-bottom: 1px solid var(--line); padding-bottom: .2rem; font-size: .93rem; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 16.5rem); gap: 1rem; align-items: start; }
.viewer, .outline {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .8rem;
  min-width: 0;
}
.viewer { padding: clamp(.65rem, 1.5vw, 1.15rem); box-shadow: 0 8px 28px #573e1611; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .65rem; min-height: 2.5rem; }
.slide-topic { margin: 0; font-weight: 700; }
.frame { margin: 0; overflow: hidden; background: #eee6d5; border: 1px solid var(--line); border-radius: .45rem; }
.frame img { display: block; width: 100%; height: auto; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .55rem; margin-top: .9rem; }
.controls .pager:first-child { justify-self: start; }
.controls .pager:last-child { justify-self: end; }
.position { color: var(--ink-muted); margin: 0; text-align: center; font-weight: 700; }
.pager, .subtle {
  cursor: pointer;
  border: 1px solid #c8d1c6;
  border-radius: .45rem;
  color: var(--ink);
  min-height: 2.65rem;
  padding: .35rem .9rem;
  background: #f3f6f0;
  font-weight: 700;
  white-space: nowrap;
}
.subtle { min-height: 2.45rem; font-size: .85rem; }
.pager:hover, .subtle:hover { background: #dce9dc; }
.pager span { display: inline-block; font-size: 1.3em; line-height: 1; }
.pager.primary { background: #23483f; border-color: #23483f; color: #fff; }
.pager.primary:hover { background: #326153; }
.pager:disabled { cursor: default; color: #5e6860; background: #eeeae1; border-color: #e3ded2; }

.outline { padding: .85rem; }
.outline-heading { border-bottom: 1px solid var(--line); padding: .1rem .45rem .65rem; margin-bottom: .45rem; }
.outline h2 { margin: 0; font-size: 1rem; }
.outline ol { margin: 0; padding: 0; list-style: none; }
.outline li + li { margin-top: .12rem; }
.outline a {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.4rem;
  padding: .25rem .45rem;
  border-radius: .4rem;
  font-size: .92rem;
}
.outline a:hover { background: #f1f0e7; }
.outline a[aria-current] { background: var(--active); font-weight: 700; }
.index-number {
  flex: 0 0 1.65rem;
  text-align: center;
  font-size: .82rem;
  line-height: 1.65rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  color: var(--ink-muted);
}
.outline a[aria-current] .index-number { color: #fff; background: #23483f; border-color: #23483f; }

dialog {
  box-sizing: border-box;
  inset: 0;
  width: min(97vw, 95rem);
  max-width: none;
  max-height: 95vh;
  max-height: 95dvh;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: .75rem;
}
dialog::backdrop { background: #142c28c4; }
.dialog-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dialog-head h2 { flex: 1 0 auto; margin: 0; font-size: 1.08rem; }
.zoom-hint { margin: .45rem 0; color: var(--ink-muted); font-size: .85rem; }
.zoom-viewport { max-height: 73vh; max-height: 73dvh; overflow: auto; border: 1px solid var(--line); background: #eee6d5; direction: ltr; }
.zoom-viewport img { display: block; width: 1376px; height: auto; margin-inline: auto; }
.zoom-viewport.fit img { width: 100%; max-width: 1376px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .outline ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem; }
  .outline li + li { margin-top: 0; }
}
@media (max-width: 430px) {
  .site-name small, .slide-total { display: none; }
  .intro h1 { font-size: 1.8rem; }
  .outline ol { grid-template-columns: minmax(0, 1fr); }
  .pager, .subtle { padding-inline: .65rem; }
  .pdf-link { font-size: .79rem; }
}
