/* Basic plugin styles */
.terurun-redsheet-app {
  display: flex;
  gap: 18px;
  align-items: stretch;
  font-family: "Noto Sans JP", sans-serif;
  margin: 12px 0;
}

/* 左ペイン（ツリー） */
.trs-left {
  width: 320px;
  max-width: 40%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: auto;
  height: 600px;
}

.trs-tree .exam {
  margin-bottom: 12px;
}

.trs-tree .exam-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.trs-tree .category {
  margin-left: 8px;
  margin-bottom: 6px;
}

.trs-tree .category-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.trs-tree .subcategory-list {
  margin-left: 12px;
  list-style: none;
  padding: 0;
}

.trs-tree .subcategory-list li {
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  transition: background .12s;
}

.trs-tree .subcategory-list li:hover {
  background: #f0f0f0;
}

/* 右ペイン（問題表示） */
.trs-right {
  flex: 1;
  min-width: 360px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  height: 600px;
  overflow: auto;
  position: relative;
}

.trs-empty {
  color: #666;
  padding: 18px;
}

/* question card */
.trs-question {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fafafa;
  position: relative;
}

.trs-question h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
}

.trs-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.trs-buttons {
  margin-bottom: 8px;
}

.trs-buttons button {
  margin-right: 8px;
}

/* explanation area with red overlay */
.trs-explanation-wrap {
  position: relative;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  height: 200px;
  /* 調整可 */
  background: #fff;
}

/* the text beneath (scrollable if long) */
.trs-explanation-text {
  padding: 12px;
  height: 100%;
  overflow: auto;
  box-sizing: border-box;
}

/* overlay wrapper sits above the text and is scrollable to move the red sheet */
.trs-overlay-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  /* allow scrolling */
  background: transparent;
}

/* red sheet element that will be moved */
.trs-red-sheet {
  position: absolute;
  left: 0;
  width: 100%;
  height: 60%;
  /* シート高さ（見た目）: 調整可 */
  background: rgba(200, 0, 0, 0.92);
  mix-blend-mode: normal;
  pointer-events: auto;
  border-radius: 0;
}

/* overlay helper spacer to allow scrolling */
.trs-overlay-spacer {
  width: 1px;
  height: 300%;
  /* スクロールの大きさ（調整可） */
  pointer-events: none;
}

/* small controls inside each question */
.trs-answer {
  margin-top: 8px;
  padding: 10px;
  background: #fff;
  border-radius: 6px;
  border: 1px dashed #e0e0e0;
}

.trs-hidden {
  display: none;
}

/* make responsive */
@media (max-width: 800px) {
  .terurun-redsheet-app {
    flex-direction: column;
  }

  .trs-left {
    width: 100%;
    max-width: none;
    height: 260px;
  }

  .trs-right {
    height: 400px;
  }
}