/**
 * css/story_state.css
 *
 * v6: ストーリー状態(現在の状況・関係性)機能に関するスタイルのみをまとめた新規ファイル。
 * 既存の style10.css / style9.css には手を加えず、使用するページ(index.php / chat.html)
 * だけでこのファイルを追加読み込みする。
 * --color-* 変数は style10.css の :root 定義を前提に利用する。
 */

/* index.php: entry-panel内「前回の続きから」チェックボックス */
.carry-over-wrap {
  padding: 4px 2px;
}

.carry-over-wrap__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.carry-over-wrap__label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.carry-over-wrap__label input[type="checkbox"]:disabled {
  cursor: default;
}

.carry-over-wrap__label input[type="checkbox"]:disabled + span {
  opacity: 0.6;
}

/* chat.html: ヘッダーの「状況を更新」ボタン */
.chat-header__story-state {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.chat-header__story-state:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* chat.html: 状況更新ポップアップ */
.story-state-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 16px;
}

.story-state-popup {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 20px;
  width: min(92vw, 400px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.story-state-popup__textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.story-state-popup__textarea:disabled {
  opacity: 0.6;
}

.story-state-popup__count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: right;
  margin: 0;
}

.story-state-popup__hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.story-state-popup__buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.story-state-popup__reset {
  color: var(--color-danger);
  background: transparent;
  border: none;
  font-size: 0.85rem;
  padding: 6px 4px;
}

.story-state-popup__reset:disabled {
  opacity: 0.5;
}

.story-state-popup__save {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.story-state-popup__save:hover {
  background: var(--color-primary-dark);
}

.story-state-popup__save:disabled {
  opacity: 0.6;
}

.character-card__story-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}