.bgb64-wrap {
  max-width: 860px;
  margin: 18px auto;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: #333;
  font-size: 14px;
  line-height: 1.7;
}

.bgb64-main-title {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.2;
  color: #2a76be;
  font-weight: 700;
}

.bgb64-main-description {
  margin: 0 0 14px;
  font-size: 13px;
  color: #666;
}

.bgb64-tab-head {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}

.bgb64-tab-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #b8b8b8;
  border-radius: 2px;
  background: #f9f9f9;
  color: #333;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bgb64-tab-btn.is-active {
  border-color: #3aa25c;
  background: #eaf8ef;
  color: #1d783d;
}

.bgb64-panel {
  border: 1px solid #cfcfcf;
  background: #fff;
}

.bgb64-form-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  border-top: 1px solid #dedede;
}

.bgb64-form-row:first-child {
  border-top: none;
}

.bgb64-row-label {
  background: #f5f5f5;
  border-right: 1px solid #dedede;
  padding: 11px 12px;
  font-weight: 700;
  font-size: 13px;
}

.bgb64-row-input {
  padding: 11px 12px;
}

.bgb64-textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid #bcbcbc;
  border-radius: 2px;
  padding: 8px;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}

.bgb64-help {
  margin: 6px 0 0;
  font-size: 12px;
  color: #666;
}

.bgb64-inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}

.bgb64-mt-8 {
  margin-top: 8px;
}

.bgb64-dropzone {
  border: 2px dashed #c8d0d7;
  background: #f9fbfd;
  border-radius: 4px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
}

.bgb64-dropzone.is-dragover {
  border-color: #2a76be;
  background: #edf5fc;
}

.bgb64-dropzone p {
  margin: 0;
}

.bgb64-file-btn {
  display: inline-flex;
  align-items: center;
}

.bgb64-file-btn span {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #b8b8b8;
  border-radius: 2px;
  background: #f9f9f9;
  color: #333;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.bgb64-actions {
  margin: 16px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bgb64-action-btn {
  height: 40px;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
}

.bgb64-convert {
  background: #26b24a;
}

.bgb64-reset {
  background: #444;
}

.bgb64-download,
.bgb64-copy {
  background: #2580d8;
}

.bgb64-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bgb64-error {
  border: 1px solid #dc9d9d;
  background: #fff2f2;
  color: #b04242;
  padding: 9px 10px;
  font-size: 13px;
  margin-top: 10px;
}

.bgb64-status {
  margin-top: 8px;
  font-size: 12px;
  color: #555;
}

.bgb64-result-block {
  margin-top: 12px;
  border: 1px solid #d0d0d0;
  background: #fff;
}

.bgb64-result-title {
  padding: 8px 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #dcdcdc;
  font-size: 13px;
  font-weight: 700;
}

.bgb64-preview-wrap {
  padding: 10px;
  border-bottom: 1px solid #ececec;
  min-height: 80px;
}

.bgb64-preview-placeholder {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 12px;
  border: 1px dashed #d7d7d7;
  background: #fafafa;
}

.bgb64-preview {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border: 1px solid #ececec;
}

.bgb64-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.bgb64-kv {
  border: 1px solid #ececec;
  background: #fafafa;
  padding: 8px;
}

.bgb64-kv .k {
  font-size: 12px;
  color: #666;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bgb64-kv .v {
  margin-top: 4px;
  display: block;
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.bgb64-help-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eaed;
  color: #3c4043;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.bgb64-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 340px;
  background: #202124;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

@media (max-width: 768px) {
  .bgb64-main-title {
    font-size: 24px;
  }

  .bgb64-form-row {
    grid-template-columns: 1fr;
  }

  .bgb64-row-label {
    border-right: none;
    border-bottom: 1px solid #dedede;
  }

  .bgb64-actions {
    flex-direction: column;
  }

  .bgb64-action-btn {
    width: 100%;
  }

  .bgb64-meta-grid {
    grid-template-columns: 1fr;
  }
}
