* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f0f2f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #1a1a2e;
    color: #fff;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.header h1 { font-size: 16px; font-weight: 600; }
.header-info { display: flex; align-items: center; gap: 16px; }
.header-info span { font-size: 13px; color: #aaa; }
.header-actions { display: flex; gap: 6px; }
.header-actions button {
    background: #eee;
    border: 1px solid #ccc;
    padding: 4px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}
.header-actions button:hover { background: #ddd; }
#rerunBtn { background: #4a90d9; color: #fff; border: 1px solid #357abd; }
#rerunBtn:hover { background: #357abd; }

.viewer-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 12px;
    background: #d8d8d8;
}

.viewer-container {
    position: relative;
    display: inline-block;
}

.viewer-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

#overlayLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ocr-overlay {
    position: absolute;
    background: rgba(255, 255, 200, 0.85);
    border: 1px solid #c0a000;
    font-size: 25px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    overflow: hidden;
    padding: 2px 4px;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.ocr-overlay:hover {
    background: rgba(255, 255, 150, 0.95);
    border-color: #999;
    z-index: 10;
    white-space: normal;
    overflow: visible;
}

.ocr-overlay input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 25px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    outline: none;
    padding: 0;
}

/* 로딩 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.loading-overlay.active { display: flex; }
.loading-box {
    background: #fff;
    padding: 40px 60px;
    border-radius: 12px;
    text-align: center;
}
.loading-box p { margin-top: 16px; font-size: 14px; color: #333; }
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
