body{
  transition:background-color .18s ease,color .18s ease;
}

body.theme-paper{
  --bg:#fbf6ec;
  --bg2:#fffdf6;
  --gold:#9a7a1a;
  --cream:#241f17;
  --cream-muted:#6a5d4b;
  --border:#d8c98d;
  --eastern:#2a6048;
  --western:#315f82;
  --eastern-bg:rgba(42,96,72,.12);
  --western-bg:rgba(49,95,130,.12);
  --east-title:#1f5a40;
  --west-title:#285778;
  --page-link:#315f82;
  --page-link-hover:#173f2e;
  --argument-heading:#725710;
  --argument-kind:#68458f;
  --argument-text:#2d271f;
  --argument-link:#1f6b4e;
  --page-link-border:rgba(49,95,130,.45);
  --mode-hover-bg:rgba(154,122,26,.10);
  background:linear-gradient(180deg,#fbf6ec 0%,#f4ecd9 100%);
}

body.theme-dark{
  --bg:#0d0f15;
  --bg2:#16191f;
  --gold:#c9a84c;
  --cream:#f0e6cc;
  --cream-muted:#a89a7e;
  --border:#2e3239;
  --eastern:#6eb88a;
  --western:#7a9fd4;
  --eastern-bg:rgba(46,92,68,.28);
  --western-bg:rgba(52,72,110,.32);
  --east-title:#b8e6c8;
  --west-title:#c8daf0;
  --page-link:#c8e4ff;
  --page-link-hover:#ffffff;
  --argument-heading:#e8d070;
  --argument-kind:#d4b8ff;
  --argument-text:#f0e6cc;
  --argument-link:#8ee8b8;
  --page-link-border:rgba(200,228,255,.45);
  --mode-hover-bg:rgba(201,168,76,.10);
  background:var(--bg);
}

.biblio-mode-panel{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin:0 0 12px;
  padding:0;
  border:0;
  background:transparent;
}

.biblio-mode-title{
  color:var(--cream-muted);
  font-family:'Noto Serif KR',serif;
  font-size:10px;
  font-weight:600;
  letter-spacing:.12em;
  text-transform:none;
}

.biblio-mode-buttons{
  display:inline-flex;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--bg2);
}

.biblio-mode-buttons button{
  min-width:58px;
  min-height:36px;
  margin:0;
  padding:7px 12px;
  border:0;
  border-left:1px solid var(--border);
  border-radius:0;
  background:transparent;
  color:var(--cream-muted);
  font:600 12px/1.2 'Noto Serif KR',serif;
  cursor:pointer;
}

.biblio-mode-buttons button:first-child{
  border-left:0;
}

.biblio-mode-buttons button:hover{
  color:var(--cream);
  background:var(--mode-hover-bg);
}

.biblio-mode-buttons button.is-active{
  background:var(--gold);
  color:var(--bg);
}

.biblio-mode-status{
  min-width:54px;
  color:var(--cream-muted);
  font-size:10px;
  line-height:1.3;
}

.book-eastern .book-title{
  color:var(--east-title);
}

.book-western .book-title{
  color:var(--west-title);
}

.foundation-link a,
.book-eastern .foundation-link a,
.book-western .foundation-link a,
.book-eastern .argument-trail .arg-edge>a,
.book-western .argument-trail .arg-edge>a,
.arg-edge>a,
.arg-passage-box a{
  color:var(--page-link);
  border-bottom-color:var(--page-link-border);
}

.foundation-link a:hover,
.arg-edge>a:hover{
  color:var(--page-link-hover);
  border-bottom-color:var(--page-link-hover);
}

.arg-hd,
.arg-arrow,
.arg-more a{
  color:var(--argument-heading);
}

.arg-kind{
  color:var(--argument-kind);
}

.arg-thesis{
  color:var(--argument-text);
}

.arg-links a{
  color:var(--argument-link);
}

body.theme-paper .history-bridge{
  background:linear-gradient(90deg,rgba(49,95,130,.10),rgba(154,122,26,.08));
}

body.theme-paper .history-bridge-main{
  color:#244f73;
}

body.theme-paper .history-bridge-main:hover,
body.theme-paper .history-bridge-sub a:hover{
  color:#173f2e;
}

body.theme-paper .history-bridge-sub a{
  color:#1f6b4e;
  border-bottom-color:rgba(31,107,78,.45);
}

body.theme-paper .timeline-canvas text[fill="#ddd"],
body.theme-paper .timeline-canvas text[fill="#f0e6cc"]{
  fill:var(--cream);
}

body.theme-paper .timeline-canvas text[fill="#888"],
body.theme-paper .timeline-canvas text[fill="#a89a7e"]{
  fill:var(--cream-muted);
}

body.theme-paper .timeline-canvas line[stroke="#aaa"]{
  stroke:#9c927f;
}

body.theme-paper .timeline-canvas circle[fill="#aaa"]{
  fill:#9c927f;
}

body.theme-paper .timeline-canvas circle[stroke="#0d0f15"]{
  stroke:var(--bg2);
}

body.theme-paper .node:hover text{
  fill:#111;
}

body.theme-paper .timeline-scroll{
  box-shadow:0 8px 26px rgba(54,43,25,.08);
}

@media(max-width:720px){
  .biblio-mode-panel{
    align-items:center;
    flex-direction:row;
    flex-wrap:wrap;
    justify-content:flex-start;
  }

  .biblio-mode-buttons{
    flex:1 1 auto;
  }

  .biblio-mode-buttons button{
    flex:1 1 0;
    min-width:0;
    padding:8px 7px;
  }
}
