.fic__brand {
  display: grid;
  gap: 0;
  margin-bottom: 6px;
}

.fic__brand-link {
  display: inline-grid;
  gap: 6px;
  text-decoration: none;
}

.fic__brand-logo {
  display: block;
  width: 126px;
  max-width: 100%;
  height: auto;
}

.fic__brand-meta {
  color: var(--fic-muted);
}

.fic__brand small,
.fic__hint,
.fic__msg {
  color: var(--fic-muted);
}

.fic__intro {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.fic__head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.fic__menu {
  display: grid;
  gap: 6px;
  margin: 8px 0 10px;
}

.fic__section {
  display: none;
  gap: 6px;
}

.fic__section.is-active {
  display: grid;
}

.fic__control,
.fic__stack {
  display: grid;
  gap: 5px;
}

.fic__control-inline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.fic__control-inline .fic-btn {
  width: auto;
  min-width: 110px;
}

.fic-frame-clear {
  min-width: 36px !important;
  width: 36px !important;
  padding: 0;
}

.fic__stack {
  gap: 6px;
}

.fic-tab,
.fic-btn,
.fic :where(select, input[type="file"], textarea) {
  width: 100%;
  border-radius: var(--fic-radius-md);
}

.fic-tab,
.fic-btn {
  min-height: 36px;
  padding: 0 10px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.fic-tab {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.fic-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.fic-tab.is-active {
  background: linear-gradient(135deg, var(--fic-purple-soft), rgba(154, 121, 255, 0.22));
  border-color: rgba(154, 121, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.fic-btn {
  border: 1px solid rgba(154, 121, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.03));
}

.fic-btn:hover,
.fic-btn:focus-visible {
  background: linear-gradient(135deg, var(--fic-purple), var(--fic-purple-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 28px rgba(123, 92, 255, 0.3);
  outline: none;
}

.fic-btn[disabled] {
  opacity: 0.44;
  cursor: not-allowed;
  box-shadow: none;
}

.fic-btn.is-active {
  background: linear-gradient(135deg, var(--fic-purple), var(--fic-purple-2));
  border-color: transparent;
  color: #fff;
}

.fic__export {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.fic__export .fic-btn {
  width: 96px;
}

.fic__export-menu {
  position: relative;
}

.fic__export-actions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  width: 144px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(154, 121, 255, 0.22);
  background: rgba(12, 14, 22, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  z-index: 15;
}

.fic__export-actions[hidden] {
  display: none !important;
}

.fic-export-action {
  min-height: 34px;
}

.fic :where(select, input[type="file"], textarea) {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.fic select {
  min-height: 36px;
  padding: 0 40px 0 14px;
  color-scheme: dark;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.7) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.fic select option {
  background: #16181d;
  color: #fff;
}

.fic input[type="file"] {
  min-height: 36px;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fic input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(154, 121, 255, 0.24);
  background: rgba(154, 121, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.fic textarea {
  min-height: 60px;
  padding: 8px 10px;
  resize: vertical;
}

.fic-image,
.fic-frame,
.fic-logo,
.fic-result {
  display: block;
}

.fic__result-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
}

.fic__preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
}

.fic__preview-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fic__preview-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fic__preview-image > * {
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}

.fic-preview-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  transform-origin: center;
}

.fic-result {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.fic-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
}

.fic-erase-canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  z-index: 5;
  cursor: crosshair;
}

.fic-erase-canvas[hidden] {
  display: none !important;
}

.fic__editor.is-erasing .cropper-crop-box,
.fic__editor.is-erasing .cropper-view-box,
.fic__editor.is-erasing .cropper-dashed,
.fic__editor.is-erasing .cropper-center,
.fic__editor.is-erasing .cropper-point,
.fic__editor.is-erasing .cropper-line {
  opacity: 0 !important;
  pointer-events: none !important;
}

.fic__editor.is-erasing .cropper-container,
.fic__editor.is-erasing .cropper-hide,
.fic__editor.is-erasing .cropper-canvas,
.fic__editor.is-erasing .cropper-drag-box,
.fic__editor.is-erasing .cropper-wrap-box,
.fic__editor.is-erasing .cropper-modal {
  opacity: 0 !important;
  pointer-events: none !important;
}

.fic__editor.is-frame-mode .cropper-crop-box,
.fic__editor.is-frame-mode .cropper-view-box,
.fic__editor.is-frame-mode .cropper-dashed,
.fic__editor.is-frame-mode .cropper-center,
.fic__editor.is-frame-mode .cropper-point,
.fic__editor.is-frame-mode .cropper-line {
  opacity: 0 !important;
}

.fic-logo {
  position: absolute;
  pointer-events: auto;
  z-index: 4;
  max-width: 32%;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0));
  cursor: grab;
  touch-action: none;
}

.fic-logo[data-position="top-left"] {
  top: 4%;
  left: 4%;
}

.fic-logo[data-position="top-right"] {
  top: 4%;
  right: 4%;
}

.fic-logo[data-position="bottom-left"] {
  left: 4%;
  bottom: 4%;
}

.fic-logo[data-position="bottom-right"] {
  right: 4%;
  bottom: 4%;
}

.fic-logo[data-position="center"] {
  top: 50%;
  left: 50%;
  max-width: 44%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.34));
}

.fic-logo[data-position="custom"] {
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.18));
}

.fic-logo.is-dragging {
  cursor: grabbing;
}

.fic__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 12, 0.56);
  backdrop-filter: blur(6px);
  z-index: 8;
}

.fic__loading[hidden] {
  display: none !important;
}

.fic__loading-card {
  width: min(360px, calc(100% - 40px));
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(154, 121, 255, 0.24);
  background: linear-gradient(180deg, rgba(19, 15, 32, 0.96), rgba(12, 13, 20, 0.96));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.fic__loading-bar {
  height: 10px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.fic__loading-fill {
  display: block;
  width: 1%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fic-purple), #baabff);
  transition: width 0.28s ease;
}

.fic__loading-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fic__msg.is-error {
  color: var(--fic-danger);
}

.fic__footer {
  display: flex;
  justify-content: center;
  padding: 6px 0 0;
}

.fic__footer-link {
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.fic__footer-link:hover,
.fic__footer-link:focus-visible {
  color: #ffffff;
}

.fic__toolbars {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.fic__toolbar {
  display: none;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 6px;
  align-items: end;
  justify-content: flex-end;
  min-width: 0;
}

.fic__toolbar.is-active {
  display: grid;
}

.fic__toolbar-field {
  display: grid;
  gap: 4px;
  min-width: 110px;
}

.fic__toolbar-field span {
  color: var(--fic-muted);
  font-size: 11px;
  font-weight: 500;
}

.fic__toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.fic__toolbar-actions .fic-btn,
.fic__toolbar-field select {
  min-width: 96px;
}

.fic-zoom-in,
.fic-zoom-out {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

@media (max-width: 980px) {
  .fic__toolbars,
  .fic__toolbar,
  .fic__toolbar-actions {
    width: 100%;
  }

  .fic__head-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .fic__toolbar {
    grid-template-columns: 1fr;
  }

  .fic__export {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .fic__intro {
    white-space: normal;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .fic__export {
    display: grid;
    grid-template-columns: 1fr;
  }

  .fic__export .fic-btn {
    width: 100%;
  }
}
