.fcbt-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", Arial, sans-serif;
  max-width: 1100px;
  margin: 24px auto;
  padding: 16px;
}

.fcbt-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.fcbt-title-main {
  font-size: 18px;
  font-weight: 700;
}

.fcbt-title-sub {
  display: block;
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}

.fcbt-note {
  font-size: 12px;
  opacity: 0.8;
}

.fcbt-controls {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 14px 0 14px;
}

.fcbt-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fcbt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fcbt-field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.fcbt-field-col {
  flex: 1 1 0;
  min-width: 0;
}

.fcbt-field-col-main {
  flex: 1 1 0;
}

.fcbt-field-col-start {
  flex: 1 1 0;
  max-width: none;
}

@media (max-width: 640px) {
  .fcbt-field-row {
    flex-direction: column;
  }
  .fcbt-field-col-start {
    flex: 1 1 auto;
    max-width: none;
  }
}

.fcbt-label {
  font-size: 12px;
  font-weight: 700;
}

.fcbt-input, .fcbt-select {
  height: 38px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.18);
  padding: 0 10px;
  background: #fff;
  font-size: 14px;
  outline: none;
}

.fcbt-input:focus, .fcbt-select:focus {
  border-color: rgba(0,0,0,0.35);
}

.fcbt-field-row-base .fcbt-input {
  border-radius: 4px;
}

.fcbt-help {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.4;
}

.fcbt-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fcbt-size-x {
  opacity: 0.7;
  font-weight: 700;
}

.fcbt-radio {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.fcbt-dropzone {
  position: relative;
  border: 2px dashed rgba(0,0,0,0.25);
  border-radius: 14px;
  padding: 22px;
  background: rgba(0,0,0,0.02);
  cursor: pointer;
  transition: 120ms ease;
}

.fcbt-dropzone:focus {
  outline: 2px solid rgba(0,0,0,0.25);
  outline-offset: 2px;
}

.fcbt-dropzone.fcbt-dragover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.45);
}

.fcbt-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.fcbt-dropzone-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fcbt-dropzone-text {
  font-size: 14px;
  font-weight: 700;
}

.fcbt-dropzone-sub {
  font-size: 12px;
  opacity: 0.75;
}

.fcbt-dropzone-note {
  font-size: 11px;
  opacity: 0.7;
}

.fcbt-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  flex-wrap: wrap;
}

.fcbt-btn {
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.fcbt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fcbt-btn-primary {
  background: rgba(0,0,0,0.92);
  color: #fff;
  border-color: rgba(0,0,0,0.92);
}

.fcbt-status {
  font-size: 12px;
  opacity: 0.75;
}

.fcbt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .fcbt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fcbt-grid { grid-template-columns: 1fr; }
}

.fcbt-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.fcbt-preview {
  position: relative;
  width: 100%;
  background: rgba(0,0,0,0.06);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}

.fcbt-preview-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 4;
}

.fcbt-preview-actions .fcbt-btn-mini {
  padding: 4px 6px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(0,0,0,0.18);
  color: #1f1f1f;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  cursor: pointer;
}

.fcbt-preview-actions .fcbt-btn-mini.fcbt-btn-preview {
  border-color: #2b9a51;
  color: #2b9a51;
  background: rgba(43,154,81,0.14);
}

.fcbt-preview-actions .fcbt-btn-mini.fcbt-btn-download {
  border-color: #1d6efc;
  color: #1d6efc;
  background: rgba(29,110,252,0.12);
}

.fcbt-preview-actions .fcbt-btn-mini.fcbt-btn-danger {
  border-color: #d14343;
  color: #d14343;
  background: rgba(209,67,67,0.12);
}

.fcbt-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fcbt-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 9999;
}
.fcbt-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.fcbt-modal-dialog {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fcbt-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border-color: #d14343;
  color: #d14343;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.fcbt-modal-imgwrap {
  flex: 1;
  display: grid;
  place-items: center;
  min-width: 280px;
  min-height: 180px;
  overflow: auto;
}
.fcbt-modal-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.fcbt-modal-filename {
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.fcbt-cardbar {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fcbt-filename {
  font-weight: 800;
  font-size: 13px;
  word-break: break-word;
}

.fcbt-iconbtn {
  position: absolute;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  z-index: 3;
}

.fcbt-iconbtn:hover {
  background: rgba(0,0,0,0.68);
}

.fcbt-btn-edit {
  left: 10px;
}

.fcbt-btn-delete {
  right: 10px;
}

.fcbt-spinner {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.72);
  display: grid;
  place-items: center;
  z-index: 2;
}

.fcbt-spinner::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid rgba(0,0,0,0.15);
  border-top-color: rgba(0,0,0,0.55);
  border-radius: 999px;
  animation: fcbtspin 0.9s linear infinite;
}

@keyframes fcbtspin {
  to { transform: rotate(360deg); }
}

.fcbt-popover {
  position: absolute;
  top: 52px;
  left: 10px;
  z-index: 4;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 10px;
  width: 180px;
}

.fcbt-popover-title {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.fcbt-popover-actions {
  display: flex;
  gap: 8px;
}

.fcbt-chip {
  flex: 1;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.2;
}

.fcbt-chip.fcbt-chip-active {
  background: #e6f4e6;
  color: #256f28;
  border-color: #7bc286;
}

.fcbt-focusbar {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  gap: 6px;
}

.fcbt-focusbar .fcbt-chip {
  flex: 0;
  min-width: 40px;
  padding: 0 10px;
}

/* 上部：拡張子＋圧縮の2カラム行 */
.fcbt-field-row-extcomp {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .fcbt-field-row-extcomp {
    flex-direction: column;
  }
}

/* カード内：画像→操作行→詳細 にする */
.fcbt-preview {
  position: relative;
  width: 100%;
  background: rgba(0,0,0,0.06);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}

.fcbt-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 旧：画像に被せていたボタンは使わない（残してもOKだが表示しない） */
.fcbt-focusbar, .fcbt-iconbtn {
  display: none;
}

/* 新：操作行 */
.fcbt-ops {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.fcbt-ops-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.fcbt-ops-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.fcbt-ops-row-top {
  justify-content: space-between;
}

.fcbt-ops-group-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.fcbt-ops-label {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.75;
}

.fcbt-ops select {
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.18);
  padding: 0 10px;
  background: #fff;
  font-size: 13px;
}

.fcbt-ops .fcbt-btn-mini {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
}

.fcbt-ops .fcbt-btn-mini.fcbt-btn-download {
  border-color: #1d6efc;
  color: #1d6efc;
}

.fcbt-ops .fcbt-btn-mini:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fcbt-ops .fcbt-btn-danger {
  border-color: #d14343;
  background: transparent;
  color: #d14343;
}

.fcbt-comp-size {
  font-size: 11px;
  color: #444;
  opacity: 0.9;
}

.fcbt-ops-row-compinfo {
  gap: 6px;
}
