
tei-div,tei-head,.manifest,.pb-icon {
  display: block;
  margin: 0 0.5rem; 
}
tei-p,tei-title,tei-respstmt{
  display: block;
  margin-top: .5em;
  margin-bottom: .5em;
}

tei-title{
  font-weight:bold;
}

.highlight {
  background-color: yellow; /* ハイライトの背景色 */
}

/*mirador埋め込み*/
#viewer {
  height: 100%;
  position: relative;
  width: 100%;
}

tei-back,#header{
  display: block;
  border: 1px solid #aaa;
  padding: 2em;
}

tei-p[style="text-indent:1em"] {
  text-indent:1em;
}

tei-p[style="text-indent:2em"] {
  text-indent:2em;
}

tei-p[style="text-indent:3em"] {
  text-indent:3em;
}


.warichu {
  display: inline-flex;
  flex-direction: column-reverse; /* ← ここで順序を逆に */
  -webkit-writing-mode: vertical-lr;
  writing-mode: vertical-lr;
  vertical-align: top;
  font-size: 50%;
  line-height: 1;
}

.warichu-left,
.warichu-right {
  display: block;
}


tei-persname {
  /*text-decoration: underline;*/
  /*color: darkblue;*/
  cursor: pointer;
}

[hand="#ougai"].hand-target {
  background-color: #fff0f5;
}
/*
#tei-metadata-container,#tei-person-container,#tei-timeline-container,.v-timeline {
  min-width: 700px;
  min-height: 600px;
  max-width: 80%;
  max-height: 80%;*/
  /*
  overflow: auto;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;*/
}

.v-timeline {
  overflow-x: auto;
}

/* 一時ハイライト */
.bg-warning {
  transition: background-color 0.5s ease;
}

/*青空文庫の見出し*/
[rend="midashi_anchor"] {
  font-weight: bold;
  display: block;
}

/*ハイライト表示*/
.bg-warning {
  background-color: #f4c839 !important;
}

tei-anchor[rend="linked"]::before {
  content: "🔗"; /* または "\1F517" */
  margin-right: 0.25em;
  color: #0d6efd;
  font-size: 0.9em;
}

.highlight-range {
  background-color: #fff3cd;
}


#tei-text-container-corresp,#aozora-text-container {
  flex-direction: column; 
  writing-mode: vertical-rl;
  /*overflow: auto;
  border-radius: 0.5rem;*/
  font-size: small;
  max-height: 50%;
}

#tei-main-scroll {
  /*min-width: 700px;
  min-height: 600px;
  
  max-width: 80%;
  max-height: 80%;*/
  padding: 1rem;
  border-radius: 0.5rem;
}
#tei-text-note {
  flex-direction: column; 
  writing-mode: vertical-rl;
  overflow-x: auto;
  /*overflow-x: hidden;
  overflow-y: hidden;*/
  min-height: 5em;  
}
#tei-text-note .note-top {
  padding: 0.75rem;
  box-sizing: border-box;
  font-size: 0.8em;
  overflow: visible; /* ← 個別にスクロールさせない */
  flex-shrink: 0;
}

#tei-text-container {
  writing-mode: vertical-rl;
  overflow: visible; /* ← 個別にスクロールさせない */
  flex-shrink: 0;
  overflow: auto;
}

/* noteのハイライト用クラス */
.highlight-match {
  background-color: #c3f0cd !important;
  transition: background 0.3s;
}

#teiTabContent {
  max-height: calc(100vh - 56px); /* navbar分引く */
  overflow-y: auto;
}

/*
#tei-text-note {
  writing-mode: vertical-rl;                
  padding: 0.5rem;
  font-size: 0.8em;
  max-width: 700px;
  max-height: 150px;
}

/*
.tooltip-bubble-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-bubble {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fefefe;
  border: 1px solid #aaa;
  border-radius: 6px;
  padding: 0.4em 0.8em;
  font-size: 0.85em;
  color: #333;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);

  display: inline-block;
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
  }

.tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #fefefe transparent transparent transparent;
}

.tooltip-bubble::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: #aaa transparent transparent transparent;
  z-index: -1;
}
*//*縦書き
#content{
  writing-mode: vertical-rl;
  overflow-y: auto;
  padding-top: 10em; 
  max-width:700px ; 
  max-height: 550px;
}*/


/*

.timeline-entry {
  margin-bottom: 2em;
  border-bottom: 1px dotted #aaa;
  padding-bottom: 1em;
}*/
/*
#tei-timeline-container{
  writing-mode: vertical-rl; 
  /*max-width: 700px;
  max-height: 600px;
  min-width: 700px;
  min-height: 600px;
  max-width: 80%;
  max-height: 80%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
}*/

/*
.popup-card {
  background: #fefefe;
  border: 1px solid #ccc;
  padding: 0.5em;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 0.85em;
  width: 220px;
}*//*
.note-warikaki {
  display: inline-block;
  vertical-align: text-top;
  font-size: 0.75em;
  line-height: 1.0;
  margin-left: 0.1em;
}
.note-line {
  display: block;
  margin: 0;
  padding: 0;
}*/
/*
.warichu {
    display: inline-table;
    -webkit-writing-mode: vertical-lr;
    vertical-align: top;
}
.warichu-right,.warichu-left {
 font-size:50%;
 display: table-row;
}*/