body {
    margin: 0;
    padding: 20px;
    background: #f0f0f0;
    font-family: sans-serif;
}
.toolbar {
    margin-bottom: 10px;
}
.page {
    width: 816px;
    height: 1056px;
    background: white;
    border: 1px solid #ccc;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
}
.cell {
    position: absolute;
    border: 2px solid #333;
    background: #e0e0ff;
    box-sizing: border-box;
    padding: 2px;
    overflow: hidden;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    will-change: transform;
}
.cell.selected {
    border-color: red;
    background: #ffdede;
}
.cell textarea {
    flex: 1;
    resize: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    font-size: 12px;
}
.cell img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
button {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 5px;
}
.instructions {
    margin-top: 20px;
    font-size: 14px;
    color: #333;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #333;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
