/* =========================================================
   ÕÎÑÒÈÍÃÈ ÈÇÎÁÐÀÆÅÍÈÉ äëÿ mybb.ru Ñòèëü.
   Ïîðèòðîâàíî ñ Áîðäû.
   Âåðñèÿ 1.5. Ñäåëàíî Kolobdur74 ñ ïîìîùüþ ChatGPT.
   ========================================================= */

/* =========================================================
   ÊÍÎÏÊÀ Â BB-ÏÀÍÅËÈ
   ========================================================= */

.borda-image-host-toolbar-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   MODAL
   ========================================================= */

.borda-image-host-overlay {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .58);
}

.borda-image-host-window {
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  color: #222;
  font: 14px/1.4 Arial, sans-serif;
}

/* =========================================================
   HEADER
   ========================================================= */

.borda-image-host-header {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px 0 16px;
  background: #f2f2f2;
  border-bottom: 1px solid #ccc;
  box-sizing: border-box;
}

.borda-image-host-title {
  flex: 1;
  font-weight: 700;
}

/* =========================================================
   CONTENT
   ========================================================= */

.borda-image-host-view {
  padding: 16px;
  overflow: auto;
}

.borda-image-host-intro {margin: 0 0 14px;}

/* =========================================================
   ÑÏÈÑÎÊ ÑÅÐÂÈÑÎÂ
   ========================================================= */

.borda-image-host-services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.borda-image-host-service {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

.borda-image-host-service:hover {
  background: #f2f2f2;
  border-color: #999;
}

.borda-image-host-service-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: none;
}

.borda-image-host-service-name {
  font-weight: 600;
}

/* =========================================================
   ÑÅÐÂÈÑ
   ========================================================= */

.borda-image-host-service-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.borda-image-host-service-title {
  font-size: 17px;
  font-weight: 700;
}

/* =========================================================
   ÊÍÎÏÊÈ
   ========================================================= */

.borda-image-host-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  box-sizing: border-box;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #f5f5f5;
  color: #222;
  font: inherit;
  cursor: pointer;
}

.borda-image-host-button.borda-image-host-close {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 24px;
  line-height: 28px;
  background: transparent;
  border: 0;
}


.borda-image-host-button:hover:not(:disabled) {
  background: #e9e9e9;
  border-color: #888;
}

.borda-image-host-button:disabled {
  opacity: .55;
  cursor: default;
}

.borda-image-host-primary {
  font-weight: 700;
}

.borda-image-host-danger {
  color: #a00000;
}

/* =========================================================
   KEY
   ========================================================= */

.borda-image-host-keybox {
  margin-bottom: 14px;
  padding: 12px;
  background: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.borda-image-host-key-title {
  margin-bottom: 5px;
  font-weight: 700;
}

.borda-image-host-key-help {
  margin-bottom: 9px;
  font-size: 12px;
  color: #666;
}

.borda-image-host-key-help a {
  color: #0645ad;
}

.borda-image-host-key-saved {
  margin-bottom: 9px;
  color: #555;
}

.borda-image-host-key-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.borda-image-host-key-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.borda-image-host-key-input {
  flex: 1 1 300px;
  min-width: 180px;
  height: 34px;
  padding: 6px 9px;
  box-sizing: border-box;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font: inherit;
}

/* =========================================================
   DROP ZONE
   ========================================================= */

.borda-image-host-file-input {
  display: none;
}

.borda-image-host-drop {
  padding: 25px 15px;
  margin-bottom: 14px;
  border: 2px dashed #bbb;
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
  cursor: pointer;
}

.borda-image-host-drop:hover,
.borda-image-host-drop-active {
  background: #f1f1f1;
  border-color: #888;
}

.borda-image-host-drop-main {
  font-weight: 700;
}

.borda-image-host-drop-sub {
  margin-top: 4px;
  color: #777;
  font-size: 12px;
}

/* =========================================================
   ÐÀÇÌÅÐ
   ========================================================= */

.borda-image-host-size {
  margin: 0 0 14px;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.borda-image-host-size-label {
  margin-bottom: 6px;
  font-weight: 700;
}

.borda-image-host-size-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 14px;
  cursor: pointer;
}

/* =========================================================
   ÔÀÉËÛ
   ========================================================= */

.borda-image-host-file-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.borda-image-host-file {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
}

.borda-image-host-thumb {
  width: 64px;
  height: 64px;
  flex: none;
  object-fit: cover;
  border-radius: 3px;
  background: #eee;
}

.borda-image-host-file-info {
  min-width: 0;
  flex: 1;
}

.borda-image-host-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.borda-image-host-file-size {
  margin-top: 2px;
  font-size: 12px;
  color: #777;
}

.borda-image-host-file-status {
  margin-top: 5px;
  font-size: 12px;
}

.borda-image-host-working {color: #555;}

.borda-image-host-success {color: #16722b;}

.borda-image-host-error {color: #a00000;}

/* =========================================================
   PROGRESS
   ========================================================= */

.borda-image-host-progress {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: #e2e2e2;
}

.borda-image-host-progress-bar {
  width: 0;
  height: 100%;
  background: #777;
  transition: width .1s linear;
}

/* =========================================================
   FOOTER
   ========================================================= */

.borda-image-host-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.borda-image-host-spacer {
  flex: 1;
}

/* =========================================================
   ÑËÓÆÅÁÍÛÅ
   ========================================================= */

.borda-image-host-hidden {
  display: none !important;
}

/* =========================================================
   ÑÎÁÑÒÂÅÍÍÛÅ ÈÇÎÁÐÀÆÅÍÈß
   ========================================================= */

.post-content img {
  max-width: 100%;
  height: auto;
}

.post-content .image-50 {max-width: 50px;}
.post-content .image-100 {max-width: 100px;} 
.post-content .image-200 {max-width: 200px;}
.post-content .image-400 {max-width: 400px;}
.post-content .image-600 {max-width: 600px;}
.post-content .image-800 {max-width: 800px;}
.post-content .image-1000 {max-width: 1000px;}

.borda-image-host-select-all-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  cursor: pointer;
}

.borda-image-host-select-all,
.borda-image-host-file-select {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.borda-image-host-file-select {
  align-self: center;
}

/* =========================================================
   ÌÎÁÈËÜÍÀß ÂÅÐÑÈß
   ========================================================= */

@media (max-width: 600px) {
  .borda-image-host-overlay {padding: 8px;}
  
  .borda-image-host-window {max-height: 94vh;}
  
  .borda-image-host-view {padding: 10px;}
  
  .borda-image-host-services {grid-template-columns: 1fr;}
  
  .borda-image-host-size-option {margin-bottom: 6px;}
  
  .borda-image-host-footer {flex-wrap: wrap;}
  
  .borda-image-host-spacer {display: none;}
  
  .borda-image-host-footer .borda-image-host-button,
  .borda-image-host-key-row .borda-image-host-button {
    flex: 1;
  }
}