/* Base */
:root {
  color-scheme: light;
  font-family: serif;
  background: #f8f2dc;
  color: #1f2937;
  overscroll-behavior: none;
  height: 100%;
  overflow: hidden;
  margin: 0;
}

.serif {
  font-family: serif;
}

.sans-serif {
  font-family: sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  display: flex;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 0.95;
}

h5 {
  margin: 0 0 5px;
}

p {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.3;
}

button {
  font: inherit;
  cursor: pointer;
}

.input-query {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
  font-weight: bold;
  width: min(100%, 420px);
}

.input-query::placeholder {
  font-weight: normal;
}

/* UNUSED (2026-04-24): no current references in HTML/JS */
.input-year {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
  width: min(20%, 220px);
}

.select-year {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
  /* width: min(20%, 300px); */
  width: min(45%, 300px);
  /* width: 50%; */
}

.yearrange_block {
  display:flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.yearrange_selectorblock {
  min-height: 45px;
  min-width: 350px;
}

.expandarea-buttonblock {
  display:flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
}

.viewer-sortblock{
  display:flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: small;
}

/* Layout */
.main {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.scroll-area {
  flex: 1;
  overflow-y: scroll; /* autoではなくscrollで常に領域確保 */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  padding-top: 15px;
}

.bottom-bar {
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 10px;
  margin-top: 5px;
  margin-right: 10px;
  margin-bottom: 4px;
}

.bottom-button {
  width: 60px;
  margin-right:10px;
}

.content-wrap {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 15px 15px 0px 15px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 24px 24px 24px 24px;
  background: rgba(255, 252, 245, 0.9);
  box-shadow: 0 24px 60px rgba(56, 45, 19, 0.12);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}

/* Components */
.review-group {
  display: block;
  margin: 15px 0 15px 0;
  padding: 0px;
  border-top: 1px solid #d1d5db;
  border-left: 1px solid #d1d5db;
  border-right: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  border-radius: 2px;
  background: #f7f3ed;
}

.review-group-header {
  margin-left: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.35em;
  row-gap: 0.25em;
}

.break {
  flex-basis: 100%; /* Makes the item take up the full width */
  height: 0;       /* Keeps it invisible */
}

.item-to-push {
  margin-left: auto; /* Pushes this item and everything after it to the right */
}

.review {
  border-top: 1px solid #d1d5db;
  padding: 8px;
  margin-bottom: 0px;
  background: rgba(255, 252, 245, 0.9);
}

.count {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pill {
  min-width: 48px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e5dcc5;
  text-align: center;
  font-weight: 700;
}

.input-with-clear {
  position: relative;
  width: min(100%, 420px);
}

.input-with-clear input {
  width: 100%;
  padding-right: 40px;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.clear-btn:hover {
  color: #111827;
  background: rgba(17, 24, 39, 0.08);
}

.suggestion-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fffdf7;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.14);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.suggestion-item button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 8px 12px;
}

.suggestion-item button:hover,
.suggestion-item button.is-active {
  background: #efe6d5;
}

.clickable-text {
  color: #0066cc;
  /* text-decoration: underline;
  text-underline-offset: 0.12em; */
}

.clickable-text:hover {
  color: #5f1530;
}

.clickable-text:active {
  opacity: 0.6;
}

.acc-item {
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.acc-item:first-child {
  border-top: 0.5px solid var(--color-border-tertiary);
}

.acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 0;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-align: left;
}

.acc-btn:hover {
  color: var(--color-text-secondary);
}

.acc-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s ease;
  color: var(--color-text-secondary);
}

.acc-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  /* padding-right: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px; */
  background-color: white;
}

.acc-body-statusarea {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  
  /* border: 1px solid #d1d5db;
  border-radius: 10px; */
  background-color: white;
}

/* Utilities */
[x-cloak] {
  display: none !important;
}
