/* カンププレゼンター: 画像の一覧と編集のパネル（見せる部分は viewer.css） */

#app-comppresenter #drop-zone.drag-over {
  background-color: var(--bs-primary-bg-subtle) !important;
  border-color: var(--bs-primary) !important;
}

#app-comppresenter .cp-count {
  margin-left: 0.25rem;
  font-weight: 400;
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}

/* 一覧は枠の中でスクロールさせ、枚数でパネルの高さを伸ばさない */
#app-comppresenter .cp-list {
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#app-comppresenter .cp-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background: var(--bs-tertiary-bg);
}

#app-comppresenter .cp-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
}

#app-comppresenter .cp-group-name {
  font-weight: 700;
  font-size: 0.875rem;
}

#app-comppresenter .cp-group-note {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

#app-comppresenter .cp-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background: var(--bs-body-bg);
}

#app-comppresenter .cp-thumb {
  flex: none;
  width: 40px;
  height: 64px;
  object-fit: cover;
  object-position: top;
  background: var(--bs-secondary-bg);
}

#app-comppresenter .cp-row-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#app-comppresenter .cp-file {
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

#app-comppresenter .cp-size {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}

#app-comppresenter .cp-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.375rem;
}

#app-comppresenter .cp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
}

#app-comppresenter .cp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 0;
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

#app-comppresenter .cp-icon-btn:hover:not(:disabled) {
  background: var(--bs-tertiary-color);
  color: var(--bs-body-bg);
}

#app-comppresenter .cp-icon-btn:disabled {
  background: transparent;
  color: var(--bs-tertiary-color);
}

#app-comppresenter .cp-icon-btn-danger {
  color: var(--bs-danger-text-emphasis);
  background: var(--bs-danger-bg-subtle);
}

#app-comppresenter .cp-icon-btn-danger:hover:not(:disabled) {
  background: var(--bs-danger);
  color: #ffffff;
}

#app-comppresenter .cp-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 1.5rem;
}

/* 履歴のメニューがビューアの上に重なるよう、パネルを前面に置く */
#app-comppresenter .cp-panel {
  position: relative;
  z-index: 5;
}

@media (min-width: 992px) {
  #app-comppresenter .cp-panel {
    position: sticky;
    top: 80px;
  }
}

/* 見出しとリード文は、文節の切れ目で折り返す */
#app-comppresenter h1,
#app-comppresenter .lead {
  word-break: auto-phrase;
}

/* 画素が足りない画像の注意。印のあとの文は、2行目も文の頭にそろえる */
#app-comppresenter .cp-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  font-size: 0.75rem;
  line-height: 1.5;
}

#app-comppresenter .cp-warn .mach-mi {
  flex: none;
  font-size: 1rem;
  line-height: 1.125rem;
}

/* 保存の状態。出ていないときも2行ぶんの高さを取り、下のボタンを動かさない */
#app-comppresenter .cp-save-status {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  min-height: 2.25rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--bs-secondary-color);
}

#app-comppresenter .cp-save-status .mach-mi {
  flex: none;
  font-size: 1rem;
  line-height: 1.125rem;
}

#app-comppresenter .cp-save-saved .mach-mi {
  color: var(--bs-success-text-emphasis);
}

#app-comppresenter .cp-save-failed {
  color: var(--bs-warning-text-emphasis);
}

/* パネルの上: 履歴と新規作成 */
#app-comppresenter .cp-project-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* 履歴の一覧（ドロップダウンと、空の画面の「最近のプレゼン」で共用） */
#app-comppresenter .cp-history-menu {
  width: min(22rem, calc(100vw - 2rem));
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.375rem;
}

@media (max-width: 575.98px) {
  #app-comppresenter .cp-history-menu {
    width: 100%;
  }
}

#app-comppresenter .cp-history-none {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
}

#app-comppresenter .cp-history-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.375rem;
}

#app-comppresenter .cp-history-row:hover {
  background: var(--bs-tertiary-bg);
}

#app-comppresenter .cp-history-row.is-current {
  background: var(--bs-secondary-bg);
}

#app-comppresenter .cp-history-open {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem;
  border: 0;
  background: transparent;
  color: var(--bs-body-color);
  text-align: left;
}

#app-comppresenter .cp-history-open:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
  border-radius: 0.375rem;
}

#app-comppresenter .cp-history-thumb {
  flex: none;
  width: 32px;
  height: 48px;
  object-fit: cover;
  object-position: top;
  background: var(--bs-secondary-bg);
}

#app-comppresenter .cp-history-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#app-comppresenter .cp-history-name {
  font-size: 0.875rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

#app-comppresenter .cp-history-meta {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}

#app-comppresenter .cp-recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.375rem;
}

#app-comppresenter .cp-recent-list .cp-history-row {
  background: var(--bs-tertiary-bg);
}
