.bbic {
  --bbic-ink: #172033;
  --bbic-muted: #647084;
  --bbic-line: #dce2ea;
  --bbic-soft: #f5f7fa;
  --bbic-accent: #f36b32;
  --bbic-accent-dark: #d94e18;
  --bbic-blue: #2764d8;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 32px auto;
  color: var(--bbic-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.bbic *, .bbic *::before, .bbic *::after { box-sizing: inherit; }
.bbic [hidden] { display: none !important; }

.bbic__app { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); min-height: 570px; overflow: hidden; border: 1px solid var(--bbic-line); border-radius: 20px; background: #fff; box-shadow: 0 18px 50px rgba(25, 42, 70, .1); }
.bbic__controls { padding: 26px; border-right: 1px solid var(--bbic-line); background: #fff; }
.bbic__workspace { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 28px; background: var(--bbic-soft); }

.bbic__step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.bbic__step > span { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--bbic-ink); color: #fff; font-size: 14px; font-weight: 800; }
.bbic__step h3 { margin: 1px 0 2px; color: var(--bbic-ink); font-size: 17px; line-height: 1.25; }
.bbic__step p { margin: 0; color: var(--bbic-muted); font-size: 12px; }
.bbic__step--compact { margin: 22px 0 14px; }

.bbic__dropzone { display: flex; min-height: 180px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; padding: 20px; border: 2px dashed #bdc7d5; border-radius: 14px; background: var(--bbic-soft); text-align: center; transition: border-color .2s, background .2s, transform .2s; }
.bbic__dropzone:hover, .bbic__dropzone--active { border-color: var(--bbic-blue); background: #edf4ff; transform: translateY(-1px); }
.bbic__dropzone strong { margin: 8px 0 2px; font-size: 15px; }
.bbic__dropzone span { color: var(--bbic-muted); font-size: 13px; }
.bbic__drop-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 3px 12px rgba(25, 42, 70, .12); color: var(--bbic-blue) !important; font-size: 28px !important; line-height: 1; }
.bbic__file { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; }
.bbic__dropzone:focus-within { outline: 3px solid rgba(39, 100, 216, .24); outline-offset: 3px; }

.bbic__field { display: grid; gap: 6px; margin: 14px 0; color: var(--bbic-ink); font-size: 13px; font-weight: 700; }
.bbic__field select, .bbic__field input[type="number"], .bbic__field input[type="text"] { width: 100%; min-height: 42px; margin: 0; padding: 8px 10px; border: 1px solid #cbd3df; border-radius: 9px; background: #fff; color: var(--bbic-ink); font: inherit; font-weight: 500; }
.bbic__field input[type="range"] { width: 100%; margin: 4px 0; accent-color: var(--bbic-accent); }
.bbic__field output { float: right; color: var(--bbic-muted); font-weight: 500; }
.bbic__mode { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; padding: 0; border: 0; }
.bbic__mode label { position: relative; display: block; cursor: pointer; }
.bbic__mode input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bbic__mode label > span { display: grid; min-height: 78px; align-content: center; padding: 7px 5px; border: 1px solid #cbd3df; border-radius: 10px; background: #fff; text-align: center; transition: border-color .2s, background .2s, box-shadow .2s; }
.bbic__mode strong { color: var(--bbic-ink); font-size: 12px; }
.bbic__mode small { margin-top: 3px; color: var(--bbic-muted); font-size: 10px; line-height: 1.25; }
.bbic__mode input:checked + span { border-color: var(--bbic-blue); background: #edf4ff; box-shadow: inset 0 0 0 1px var(--bbic-blue); }
.bbic__mode input:focus-visible + span { outline: 3px solid rgba(39, 100, 216, .25); outline-offset: 2px; }
.bbic__dimensions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.bbic__dimensions > span { display: grid; align-self: end; height: 42px; place-items: center; padding: 0; color: var(--bbic-muted); }
.bbic__dimensions .bbic__field { margin: 0; }
.bbic__selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.bbic .bbic__reset, .bbic .bbic__undo, .bbic .bbic__start-over { width: 100%; min-height: 40px; border: 1px solid #cbd3df; border-radius: 9px; background: #fff; color: var(--bbic-ink); font-weight: 700; }
.bbic .bbic__start-over { margin-top: 8px; }
.bbic .bbic__undo:not(:disabled):hover, .bbic .bbic__reset:hover, .bbic .bbic__start-over:not(:disabled):hover { border-color: var(--bbic-blue); color: var(--bbic-blue); }
.bbic .bbic__undo:disabled, .bbic .bbic__start-over:disabled { cursor: not-allowed; opacity: .45; }

.bbic__empty { display: grid; max-width: 440px; min-height: 260px; place-content: center; padding: 32px; border: 2px dashed #cfd6e0; border-radius: 16px; color: var(--bbic-muted); text-align: center; }
.bbic__empty strong { margin-bottom: 8px; color: var(--bbic-ink); font-size: 18px; }
.bbic__empty span { font-size: 14px; }

.bbic__preview { width: 100%; text-align: center; }
.bbic__zoom-controls { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 0 12px; }
.bbic__zoom-controls button { min-width: 38px; min-height: 36px; cursor: pointer; border: 1px solid #cbd3df; border-radius: 8px; background: #fff; color: var(--bbic-ink); font-size: 18px; font-weight: 800; line-height: 1; }
.bbic__zoom-controls button:hover:not(:disabled) { border-color: var(--bbic-blue); color: var(--bbic-blue); }
.bbic__zoom-controls button:focus-visible { outline: 3px solid rgba(39, 100, 216, .25); outline-offset: 2px; }
.bbic__zoom-controls button:disabled { cursor: not-allowed; opacity: .4; }
.bbic__zoom-controls .bbic__zoom-reset { width: auto; padding: 0 12px; font-size: 12px; }
.bbic__zoom-level { min-width: 54px; color: var(--bbic-ink); font-size: 13px; font-weight: 800; }
.bbic__image-info { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.bbic__image-info > div { display: grid; gap: 2px; min-width: 0; padding: 9px 12px; border: 1px solid var(--bbic-line); border-radius: 9px; background: #fff; text-align: left; }
.bbic__image-info span { color: var(--bbic-muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.bbic__image-info strong { overflow: hidden; color: var(--bbic-ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bbic__canvas-scroll { width: 100%; max-height: 650px; overflow: auto; border-radius: 8px; background: #e2e7ed; text-align: center; overscroll-behavior: auto; }
.bbic__canvas { display: block; width: auto; max-width: none; height: auto; max-height: none; margin: 0 auto; cursor: crosshair; border-radius: 6px; background: #e2e7ed; box-shadow: 0 8px 30px rgba(20, 33, 53, .18); touch-action: none; }
.bbic__canvas:focus { outline: 4px solid rgba(39, 100, 216, .3); outline-offset: 4px; }
.bbic__canvas--dragging { cursor: crosshair; }
.bbic__canvas--movable, .bbic__canvas--movable.bbic__canvas--dragging { cursor: move; }
.bbic__canvas--focused { cursor: default; }
.bbic__drag-help { margin: 12px 0 0; color: var(--bbic-muted); font-size: 12px; }
.bbic__selection-info { margin: 5px 0 0; color: var(--bbic-ink); font-size: 12px; font-weight: 700; }

.bbic__download-panel { width: 100%; max-width: 520px; margin-top: 20px; padding: 18px 20px; border: 1px solid var(--bbic-line); border-radius: 14px; background: #fff; }
.bbic__download-panel .bbic__step--compact { margin-top: 0; }
.bbic__download { width: 100%; min-height: 48px; cursor: pointer; border: 0; border-radius: 10px; background: var(--bbic-accent); color: #fff; font-size: 15px; font-weight: 800; box-shadow: 0 7px 18px rgba(243, 107, 50, .25); transition: background .2s, transform .2s; }
.bbic__download:hover { background: var(--bbic-accent-dark); transform: translateY(-1px); }
.bbic__download:focus { outline: 3px solid rgba(243, 107, 50, .3); outline-offset: 3px; }
.bbic__download:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.bbic__privacy { margin: 10px 0 0; color: var(--bbic-muted); font-size: 11px; text-align: center; }

.bbic__ad { display: grid; width: 100%; min-height: 90px; place-content: center; margin: 20px 0; padding: 14px; border: 1px dashed #c5cbd4; border-radius: 10px; background: #f7f7f7; color: #808894; text-align: center; }
.bbic__ad span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.bbic__ad small { margin-top: 4px; font-size: 10px; }
.bbic__ad--bottom { min-height: 120px; }
.bbic__message { min-height: 24px; margin: 10px 0 0; color: #287044; font-size: 13px; text-align: center; }
.bbic__message--error { color: #b42318; font-weight: 700; }
.bbic__noscript { padding: 12px; border-radius: 8px; background: #fff1f0; color: #b42318; }

@media (max-width: 780px) {
  .bbic { margin: 20px auto; }
  .bbic__app { grid-template-columns: 1fr; }
  .bbic__controls { border-right: 0; border-bottom: 1px solid var(--bbic-line); }
  .bbic__workspace { min-height: 380px; padding: 20px 14px; }
  .bbic__canvas-scroll { max-height: 520px; }
  .bbic__image-info { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bbic *, .bbic *::before, .bbic *::after { scroll-behavior: auto !important; transition: none !important; }
}
