.bbd-app {
  --bbd-accent: #ff4b00;
  --bbd-accent-dark: #d63f00;
  --bbd-ink: #171717;
  --bbd-muted: #6b7280;
  --bbd-line: #e5e7eb;
  --bbd-bg: #f3f4f6;
  --bbd-panel: #ffffff;
  --bbd-radius: 14px;
}

.bbd-entry {
  margin: 0 0 14px;
}

.bbd-open-editor {
  width: 100% !important;
  min-height: 52px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px !important;
  background: #111 !important;
  color: #fff !important;
  border: 0 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.bbd-open-editor:hover,
.bbd-open-editor:focus-visible {
  background: #007a63 !important;
  color: #fff !important;
}

.bbd-button-icon {
  display: inline-flex;
}

.bbd-entry-status {
  margin-top: 10px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #b7e2d6;
  border-radius: 10px;
  background: #f1fbf8;
  color: #155e4f;
  font-size: 14px;
  font-weight: 650;
}

.bbd-entry-status[hidden] {
  display: none !important;
}

.bbd-entry-status__dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0f9f78;
  box-shadow: 0 0 0 4px rgba(15, 159, 120, 0.12);
}

.bbd-entry-edit {
  margin-left: auto;
  border: 0;
  padding: 4px 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

html.bbd-editor-open,
body.bbd-editor-open {
  overflow: hidden !important;
}

.bbd-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  background: rgba(15, 18, 22, 0.56);
  backdrop-filter: blur(3px);
}

.bbd-modal[hidden] {
  display: none !important;
}

.bbd-app {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  background: var(--bbd-bg);
  color: var(--bbd-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bbd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--bbd-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(17, 24, 39, 0.04);
}

.bbd-topbar__left,
.bbd-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bbd-topbar__left strong,
.bbd-topbar__product {
  display: block;
  line-height: 1.25;
}

.bbd-topbar__left strong {
  font-size: 15px;
}

.bbd-topbar__product {
  margin-top: 3px;
  color: var(--bbd-muted);
  font-size: 12px;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bbd-icon-button,
.bbd-inline-actions button {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bbd-line);
  border-radius: 10px;
  background: #fff;
  color: #27272a;
  cursor: pointer;
}

.bbd-icon-button:hover,
.bbd-inline-actions button:hover {
  border-color: #c8cbd1;
  background: #f9fafb;
}

.bbd-icon-button:disabled,
.bbd-primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bbd-primary-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--bbd-accent);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.bbd-primary-button:hover {
  background: var(--bbd-accent-dark);
}

.bbd-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 82px 330px minmax(0, 1fr);
}

.bbd-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 8px;
  border-right: 1px solid var(--bbd-line);
  background: #18181b;
}

.bbd-tool {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #d4d4d8;
  font-size: 11px;
  cursor: pointer;
}

.bbd-tool:hover,
.bbd-tool.is-active {
  background: var(--bbd-accent);
  color: #fff;
}

.bbd-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  border-right: 1px solid var(--bbd-line);
  background: var(--bbd-panel);
}

.bbd-panel-section[hidden] {
  display: none !important;
}

.bbd-panel h2 {
  margin: 0 0 16px;
  color: var(--bbd-ink);
  font-size: 17px;
  line-height: 1.3;
}

.bbd-action-card,
.bbd-upload-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0 0 10px;
  border: 1px solid var(--bbd-line);
  border-radius: 10px;
  background: #fff;
  color: #222;
  font-weight: 650;
  cursor: pointer;
}

.bbd-action-card:hover,
.bbd-upload-card:hover {
  border-color: #f59b75;
  background: #fff8f5;
}

.bbd-action-card--danger {
  color: #b42318;
}

.bbd-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 650;
}

.bbd-field select,
.bbd-field input[type="number"] {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--bbd-line);
  border-radius: 9px;
  background: #fff;
  color: #18181b;
  box-shadow: none;
}

.bbd-field input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--bbd-line);
  border-radius: 9px;
  background: #fff;
}

.bbd-field-grid {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 10px;
}

.bbd-inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.bbd-inline-actions--wide button {
  flex: 1;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 650;
}

.bbd-upload-card {
  min-height: 170px;
  flex-direction: column;
  gap: 8px;
  border-style: dashed;
  text-align: center;
}

.bbd-upload-card span,
.bbd-help {
  color: var(--bbd-muted);
  font-size: 12px;
  line-height: 1.55;
}

.bbd-stage-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) minmax(34px, auto);
  overflow: hidden;
  background: #eceef1;
}

.bbd-stage-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid #dde0e4;
  color: #52525b;
  font-size: 12px;
}

.bbd-guide-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bbd-guide-legend i {
  width: 18px;
  height: 0;
  display: inline-block;
  border-top: 2px dashed;
}

.bbd-guide-legend .is-bleed {
  border-color: #ef4444;
}

.bbd-guide-legend .is-safe {
  margin-left: 6px;
  border-color: #16a34a;
}

.bbd-canvas-shell {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}

.bbd-canvas-shell .canvas-container {
  flex: 0 0 auto !important;
  max-width: none !important;
  max-height: none !important;
  box-shadow: 0 8px 28px rgba(31, 41, 55, 0.13);
}

/* XStore/Elementor gibi temaların genel canvas responsive kuralları,
 * Fabric'in lower/upper canvas katmanlarını wrapper'dan bağımsız küçültmemeli. */
.bbd-canvas-shell .canvas-container > canvas,
.bbd-canvas-shell canvas.lower-canvas,
.bbd-canvas-shell canvas.upper-canvas {
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  touch-action: none !important;
}

.bbd-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #52525b;
  font-size: 12px;
}

.bbd-status[data-type="success"] {
  color: #08775f;
}

.bbd-status[data-type="warning"] {
  color: #9a6700;
}

.bbd-status[data-type="error"] {
  color: #b42318;
}

.bbd-modal.is-busy::after {
  content: "";
  position: absolute;
  inset: 72px 0 0;
  z-index: 20;
  cursor: progress;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .bbd-app {
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .bbd-workspace {
    grid-template-columns: 68px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 230px;
  }

  .bbd-sidebar {
    grid-row: 1 / span 2;
  }

  .bbd-panel {
    grid-column: 2;
    grid-row: 2;
    border-top: 1px solid var(--bbd-line);
    border-right: 0;
    padding: 14px 16px;
  }

  .bbd-stage-area {
    grid-column: 2;
    grid-row: 1;
  }

  .bbd-panel-section {
    max-width: 760px;
    margin: 0 auto;
  }

  .bbd-panel h2 {
    margin-bottom: 10px;
  }

  .bbd-action-card {
    min-height: 42px;
  }

  .bbd-upload-card {
    min-height: 105px;
  }
}

@media (max-width: 640px) {
  .bbd-topbar {
    padding: 0 8px;
  }

  .bbd-topbar__product {
    max-width: 150px;
  }

  .bbd-topbar__actions {
    gap: 5px;
  }

  .bbd-topbar__actions .bbd-icon-button {
    display: none;
  }

  .bbd-primary-button {
    min-height: 42px;
    padding: 0 11px;
    font-size: 12px;
  }

  .bbd-workspace {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 248px;
  }

  .bbd-sidebar {
    padding: 8px 4px;
  }

  .bbd-tool {
    min-height: 60px;
    gap: 4px;
    font-size: 9px;
  }

  .bbd-panel {
    padding: 12px;
  }

  .bbd-field-grid {
    grid-template-columns: 1fr 72px;
  }

  .bbd-stage-meta {
    padding: 0 10px;
  }

  .bbd-guide-legend {
    font-size: 0;
  }

  .bbd-guide-legend i {
    margin: 0 2px !important;
  }

  .bbd-canvas-shell {
    padding: 10px;
  }
}


/* v0.2.0 temel araçlar */
.bbd-shape-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.bbd-shape-grid button { min-height:92px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; border:1px solid var(--bbd-line); border-radius:10px; background:#fff; font-weight:650; cursor:pointer; }
.bbd-shape-grid button:hover { border-color:#f59b75; background:#fff8f5; }
.bbd-shape-icon { width:34px; height:28px; display:block; border:2px solid currentColor; }
.bbd-shape-icon.is-circle { border-radius:50%; }
.bbd-shape-icon.is-triangle { width:0; height:0; border-left:18px solid transparent; border-right:18px solid transparent; border-bottom:30px solid currentColor; border-top:0; }
.bbd-shape-icon.is-line { width:38px; height:0; border:0; border-top:3px solid currentColor; transform:rotate(-25deg); }
.bbd-field input[type="range"] { width:100%; accent-color:var(--bbd-accent); }
.bbd-field output { float:right; color:var(--bbd-muted); font-weight:500; }
.bbd-layer-list { display:grid; gap:7px; margin-bottom:14px; }
.bbd-layer-row { width:100%; min-height:46px; display:grid; grid-template-columns:34px minmax(0,1fr) 28px; align-items:center; gap:8px; padding:6px 8px; border:1px solid var(--bbd-line); border-radius:9px; background:#fff; text-align:left; cursor:pointer; }
.bbd-layer-row:hover,.bbd-layer-row.is-selected { border-color:#ff9d75; background:#fff7f3; }
.bbd-layer-kind { width:30px; height:30px; display:grid; place-items:center; border-radius:7px; background:#f4f4f5; font-weight:800; }
.bbd-layer-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:650; }
.bbd-layer-state { text-align:center; font-size:12px; }
.bbd-layer-empty { padding:18px 10px; border:1px dashed var(--bbd-line); border-radius:9px; color:var(--bbd-muted); text-align:center; font-size:12px; }
.bbd-object-toolbar { position:absolute; z-index:8; top:54px; left:50%; transform:translateX(-50%); display:flex; gap:5px; padding:5px; border:1px solid var(--bbd-line); border-radius:11px; background:rgba(255,255,255,.96); box-shadow:0 8px 24px rgba(17,24,39,.12); }
.bbd-object-toolbar[hidden] { display:none !important; }
.bbd-object-toolbar button { width:36px; height:34px; border:0; border-radius:7px; background:transparent; font-size:17px; cursor:pointer; }
.bbd-object-toolbar button:hover { background:#f4f4f5; }
.bbd-object-toolbar button.is-danger { color:#b42318; }
.bbd-inline-actions button.is-active { border-color:#ff9d75; background:#fff7f3; color:var(--bbd-accent-dark); }
@media (max-width:640px) { .bbd-object-toolbar { top:50px; } .bbd-shape-grid button { min-height:72px; } }


/* v0.5.0 PRO TOOLING */
.bbd-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--bbd-line);
  border-radius: 11px;
  background: #fff;
}
.bbd-zoom-controls .bbd-icon-button {
  min-width: 34px;
  min-height: 34px;
  border: 0;
}
.bbd-zoom-controls output {
  min-width: 48px;
  text-align: center;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 700;
}
#bbd-toggle-guides.is-off { opacity: .45; }

.bbd-shape-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bbd-shape-grid button {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--bbd-line);
  border-radius: 10px;
  background: #fff;
  color: #222;
  font-weight: 650;
  cursor: pointer;
}
.bbd-shape-grid button:hover { border-color: #f59b75; background: #fff8f5; }
.bbd-shape-icon { width: 34px; height: 26px; display: inline-block; border: 2px solid #222; }
.bbd-shape-icon.is-rounded { border-radius: 9px; }
.bbd-shape-icon.is-circle { width: 30px; height: 30px; border-radius: 50%; }
.bbd-shape-icon.is-ellipse { width: 38px; height: 24px; border-radius: 50%; }
.bbd-shape-icon.is-triangle { width: 0; height: 0; border: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-bottom: 31px solid #222; }
.bbd-shape-icon.is-line { width: 38px; height: 0; border: 0; border-top: 3px solid #222; transform: rotate(-24deg); }
.bbd-shape-icon.is-polygon { width: 32px; height: 28px; border: 0; background:#222; clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%); }
.bbd-shape-icon.is-star, .bbd-shape-icon.is-arrow { width:auto; height:auto; border:0; font-size:30px; line-height:1; }

.bbd-layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
  border: 1px solid var(--bbd-line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.bbd-layer-row.is-selected { border-color: #ff8d5c; box-shadow: 0 0 0 2px rgba(255,75,0,.10); }
.bbd-layer-main, .bbd-layer-eye, .bbd-layer-lock {
  min-height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.bbd-layer-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr);
  align-items: center;
  text-align: left;
}
.bbd-layer-kind { font-weight:800; color:#71717a; text-align:center; }
.bbd-layer-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:650; }
.bbd-layer-eye, .bbd-layer-lock { color:#52525b; }
.bbd-layer-eye:hover, .bbd-layer-lock:hover { background:#f4f4f5; }

.bbd-object-toolbar {
  gap: 3px;
  max-width: calc(100% - 24px);
  overflow-x: auto;
}
.bbd-object-toolbar button { flex: 0 0 auto; }

.bbd-canvas-shell { position: relative; }
.bbd-snap-line {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: #0ea5e9;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7);
}
.bbd-snap-line.is-vertical { width:1px; top:16px; bottom:16px; left:50%; }
.bbd-snap-line.is-horizontal { height:1px; left:16px; right:16px; top:50%; }
.bbd-snap-line[hidden] { display:none !important; }

.bbd-busy-overlay {
  position: absolute;
  inset: 42px 0 34px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(244,245,247,.78);
  backdrop-filter: blur(4px);
}
.bbd-busy-overlay[hidden] { display:none !important; }
.bbd-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--bbd-accent);
  border-radius: 50%;
  animation: bbd-spin .8s linear infinite;
}
@keyframes bbd-spin { to { transform:rotate(360deg); } }

@media (max-width: 980px) {
  .bbd-topbar { gap:8px; }
  .bbd-zoom-controls { display:none; }
  .bbd-topbar__product { max-width:190px; }
  .bbd-workspace { grid-template-columns: 76px 300px minmax(0,1fr); }
}
@media (max-width: 760px) {
  .bbd-app { grid-template-rows: 64px minmax(0,1fr); }
  .bbd-topbar { padding:0 10px; }
  .bbd-topbar__left strong { font-size:14px; }
  .bbd-topbar__product { max-width:145px; }
  .bbd-primary-button { padding:0 12px; font-size:12px; }
  #bbd-toggle-guides { display:none; }
  .bbd-workspace {
    grid-template-columns: 70px minmax(0,1fr);
    grid-template-rows: minmax(300px, 52vh) minmax(260px, 1fr);
  }
  .bbd-sidebar { grid-row:1 / 3; }
  .bbd-panel { grid-column:2; grid-row:2; border-right:0; border-top:1px solid var(--bbd-line); padding:16px; }
  .bbd-stage-area { grid-column:2; grid-row:1; }
  .bbd-object-toolbar { top:52px; }
}


/* v0.8.0 SAVE + QUALITY */
.bbd-save-state {
  display:inline-flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  color:#52525b;
  font-size:12px;
  font-weight:650;
}
.bbd-save-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#a1a1aa;
}
.bbd-save-state[data-state="dirty"] .bbd-save-dot { background:#f59e0b; }
.bbd-save-state[data-state="saving"] .bbd-save-dot { background:#0ea5e9; animation:bbd-pulse 1s infinite; }
.bbd-save-state[data-state="saved"] .bbd-save-dot { background:#16a34a; }
.bbd-save-state[data-state="error"] .bbd-save-dot { background:#dc2626; }
@keyframes bbd-pulse { 50% { opacity:.35; } }

.bbd-stage-footer {
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:4px 12px;
}
.bbd-quality-summary {
  display:flex;
  align-items:center;
  gap:7px;
  max-width:720px;
  padding:5px 9px;
  border-radius:8px;
  background:#fff7ed;
  color:#9a3412;
  font-size:11px;
}
.bbd-quality-summary[hidden] { display:none !important; }
.bbd-quality-summary strong { white-space:nowrap; }

@media (max-width: 900px) {
  .bbd-save-state { display:none; }
}


/* v0.8.2 selection safety */
.bbd-stage-area {
  isolation: isolate;
}
.bbd-object-toolbar {
  z-index: 60 !important;
  position: absolute;
  max-width: calc(100% - 28px);
}
.bbd-canvas-shell {
  overflow: visible;
}


/* v0.8.3 pasteboard/artboard */
.bbd-canvas-shell {
  background: #e9edf2;
  overflow: hidden;
}


/* v0.9.0 upload queue + quality footer */
.bbd-upload-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.bbd-upload-list[hidden] { display: none !important; }
.bbd-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--bbd-line);
  border-radius: 9px;
  background: #fff;
}
.bbd-upload-row.is-failed,
.bbd-upload-row.is-cancelled {
  border-color: #fecaca;
  background: #fff5f5;
}
.bbd-upload-row__main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.bbd-upload-row__main strong,
.bbd-upload-row__main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bbd-upload-row__main strong { font-size: 12px; }
.bbd-upload-row__main span {
  color: var(--bbd-muted);
  font-size: 11px;
}
.bbd-upload-row progress {
  width: 100%;
  height: 6px;
  accent-color: var(--bbd-accent);
}
.bbd-upload-row__actions button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--bbd-line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}
.bbd-stage-footer {
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 4px 12px;
  border-top: 1px solid #dde0e4;
  background: #f6f7f8;
}
.bbd-stage-footer .bbd-status {
  min-height: 24px;
  padding: 0;
}


/* v0.10.0 non-blocking save, upload assets, and structured notices */
.bbd-icon-button:focus-visible,
.bbd-primary-button:focus-visible,
.bbd-action-card:focus-visible,
.bbd-upload-card:focus-visible,
.bbd-tool:focus-visible,
.bbd-inline-actions button:focus-visible,
.bbd-layer-row button:focus-visible,
.bbd-object-toolbar button:focus-visible,
.bbd-upload-asset button:focus-visible,
.bbd-notice-primary:focus-visible,
.bbd-notice-toggle:focus-visible,
.bbd-notice-detail:focus-visible {
  outline: 3px solid rgba(14, 165, 233, .55);
  outline-offset: 2px;
}

.bbd-upload-card.is-dragover {
  border-color: var(--bbd-accent);
  background: #fff7f2;
  box-shadow: inset 0 0 0 2px rgba(255, 75, 0, .12);
}

.bbd-upload-asset {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--bbd-line);
  border-radius: 8px;
  background: #fff;
}

.bbd-upload-asset.is-failed,
.bbd-upload-asset.is-cancelled {
  border-color: #fecaca;
  background: #fff7f7;
}

.bbd-upload-asset.is-processed,
.bbd-upload-asset.is-done {
  border-color: #bbf7d0;
  animation: bbd-upload-complete .45s ease-out;
}

@keyframes bbd-upload-complete {
  from { box-shadow: 0 0 0 0 rgba(22, 163, 74, .22); }
  to { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

.bbd-upload-asset__thumb {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #f4f4f5;
}

.bbd-upload-asset__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bbd-upload-asset__body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.bbd-upload-asset__title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.bbd-upload-asset__title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.bbd-upload-asset__title span {
  flex: 0 0 auto;
  color: #52525b;
  font-size: 11px;
  font-weight: 700;
}

.bbd-upload-asset__meta,
.bbd-upload-asset__quality,
.bbd-upload-asset__error {
  color: var(--bbd-muted);
  font-size: 11px;
  line-height: 1.35;
}

.bbd-upload-asset__error {
  color: #b42318;
}

.bbd-upload-asset__progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef1;
}

.bbd-upload-asset__progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--bbd-accent);
  transition: width .18s ease;
}

.bbd-upload-asset__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bbd-upload-asset__actions button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--bbd-line);
  border-radius: 7px;
  background: #fff;
  color: #27272a;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.bbd-upload-asset__actions button:hover {
  border-color: #c8cbd1;
  background: #f9fafb;
}

.bbd-quality-summary {
  position: relative;
  align-items: stretch;
  max-width: min(760px, 100%);
  padding: 0;
  background: transparent;
}

.bbd-notice-primary,
.bbd-notice-toggle,
.bbd-notice-detail {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.bbd-notice-primary {
  min-height: 28px;
  max-width: 520px;
  padding: 4px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bbd-notice-toggle {
  min-width: 34px;
  padding: 0 8px;
}

.bbd-quality-summary[data-level="error"] .bbd-notice-primary,
.bbd-quality-summary[data-level="error"] .bbd-notice-toggle {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.bbd-quality-summary[data-level="info"] .bbd-notice-primary,
.bbd-quality-summary[data-level="info"] .bbd-notice-toggle {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.bbd-notice-details {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 80;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--bbd-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(17, 24, 39, .16);
}

.bbd-notice-details[hidden] {
  display: none !important;
}

.bbd-notice-detail {
  min-height: 30px;
  padding: 5px 8px;
  text-align: left;
  white-space: normal;
}

.bbd-notice-detail.is-error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.bbd-notice-detail.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.bbd-canvas-shell {
  overflow: auto;
}

@media (max-width: 640px) {
  .bbd-upload-asset {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .bbd-upload-asset__thumb {
    width: 48px;
    height: 48px;
  }

  .bbd-notice-primary {
    max-width: 210px;
  }
}


/* v0.10.2 responsive drawer hotfix */
.bbd-workspace {
  position: relative;
}

.bbd-primary-button {
  white-space: nowrap;
}

.bbd-modal[data-layout="drawer"] .bbd-workspace,
.bbd-modal[data-layout="bottom-sheet"] .bbd-workspace {
  grid-template-columns: 70px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.bbd-modal[data-layout="drawer"] .bbd-sidebar,
.bbd-modal[data-layout="bottom-sheet"] .bbd-sidebar {
  grid-column: 1;
  grid-row: 1;
  z-index: 90;
}

.bbd-modal[data-layout="drawer"] .bbd-stage-area,
.bbd-modal[data-layout="bottom-sheet"] .bbd-stage-area {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.bbd-modal[data-layout="drawer"] .bbd-panel {
  position: absolute;
  z-index: 85;
  top: 0;
  bottom: 0;
  left: 70px;
  width: min(330px, calc(100% - 70px));
  max-width: calc(100% - 70px);
  border-right: 1px solid var(--bbd-line);
  box-shadow: 14px 0 30px rgba(17, 24, 39, .16);
}

.bbd-modal[data-layout="bottom-sheet"] .bbd-workspace {
  grid-template-columns: 56px minmax(0, 1fr);
}

.bbd-modal[data-layout="bottom-sheet"] .bbd-panel {
  position: absolute;
  z-index: 95;
  right: 0;
  bottom: 0;
  left: 56px;
  width: auto;
  max-height: min(46vh, 330px);
  min-height: 0;
  padding: 12px;
  border-top: 1px solid var(--bbd-line);
  border-right: 0;
  box-shadow: 0 -14px 30px rgba(17, 24, 39, .16);
}

.bbd-modal[data-layout="bottom-sheet"] .bbd-sidebar {
  padding: 8px 4px;
}

.bbd-modal[data-layout="bottom-sheet"] .bbd-tool {
  min-height: 58px;
  font-size: 9px;
}

.bbd-modal[data-layout="drawer"] .bbd-canvas-shell,
.bbd-modal[data-layout="bottom-sheet"] .bbd-canvas-shell {
  min-width: 0;
  overflow: auto;
}

@media (max-width: 640px) {
  .bbd-topbar__left strong {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bbd-topbar__product,
  .bbd-save-state {
    display: none;
  }

  .bbd-primary-button {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bbd-stage-footer {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-x: auto;
  }
}
