/* ============================================================
 * app.css — Fotooptimering kunde-portal + admin
 * Konsolideret fra PROD's index.php inline <style>-blokke
 * (job-detail + landing) med duplikater fjernet.
 * ============================================================ */

/* ----- Layout-skelet ---------------------------------------- */

body.app-layout { background-color: #f3f4f6 !important; }

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: #fff; border-bottom: 1px solid #e5e7eb;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.app-topbar .brand { font-size: 16px; font-weight: 700; color: #111827; text-decoration: none; }
.app-topbar nav { display: flex; gap: 18px; align-items: center; }
.app-topbar nav a {
    color: #4b5563; font-size: 14px; text-decoration: none;
}
.app-topbar nav a:hover { color: #111827; }
.app-topbar .user-chip {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #6b7280;
}

.app-flash {
    margin: 12px auto; max-width: 1200px;
    padding: 10px 16px; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 14px;
}
.app-flash.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.app-flash.ok    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.app-flash.info  { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }


/* ----- Container + header ----------------------------------- */

.pp-container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

.pp-breadcrumb {
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: #6b7280; margin-bottom: 8px;
}
.pp-breadcrumb a { color: #6b7280; text-decoration: none; }
.pp-breadcrumb a:hover { color: #3b82f6; }

.pp-header { margin-bottom: 24px; }
.pp-header h1 {
    font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 700;
    color: #111827; margin: 0 0 4px 0;
}
.pp-header p {
    font-family: 'Inter', sans-serif; font-size: 14px;
    color: #6b7280; margin: 0;
}


/* ----- Card --------------------------------------------------- */

.pp-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 24px; margin-bottom: 20px;
}
.pp-card h2 {
    font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600;
    color: #111827; margin: 0 0 14px 0;
}
.pp-card p {
    font-family: 'Inter', sans-serif; font-size: 14px;
    color: #4b5563; margin: 0 0 12px 0; line-height: 1.55;
}
.pp-card-head-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.pp-card-head-row h2 { margin: 0; }


/* ----- Form-elementer --------------------------------------- */

.pp-label {
    display: block;
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
    color: #374151; margin-bottom: 6px;
}
.pp-input {
    width: 100%; padding: 9px 12px;
    border: 1px solid #d1d5db; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 14px; color: #111827;
    outline: none; box-sizing: border-box;
}
.pp-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.pp-help {
    font-family: 'Inter', sans-serif; font-size: 12px;
    color: #6b7280; margin-top: 6px;
}


/* ----- Drop-zone -------------------------------------------- */

.pp-dropzone {
    border: 2px dashed #d1d5db; border-radius: 12px; padding: 36px 20px;
    background: #f9fafb; text-align: center;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}
.pp-dropzone:hover, .pp-dropzone.dragover {
    border-color: #6366f1; background: #eef2ff;
}
.pp-dropzone-icon { font-size: 36px; color: #9ca3af; margin-bottom: 8px; }
.pp-dropzone h3 {
    font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600;
    color: #111827; margin: 0 0 4px 0;
}
.pp-dropzone p {
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: #6b7280; margin: 0;
}
.pp-dropzone.disabled { opacity: 0.5; pointer-events: none; }


/* ----- Upload-grid + thumbnails ------------------------------ */

.pp-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-top: 20px;
}
@media (max-width: 900px) { .pp-grid { grid-template-columns: repeat(2, 1fr); } }

.pp-thumb {
    position: relative; border-radius: 10px; overflow: hidden;
    border: 2px solid #e5e7eb; background: #f3f4f6;
    aspect-ratio: 3 / 4;
}
.pp-thumb.primary {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pp-thumb-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 50%);
    opacity: 0; transition: opacity 0.15s;
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 8px 10px;
    pointer-events: none;
}
.pp-thumb:hover .pp-thumb-overlay { opacity: 1; }

.pp-thumb-btn {
    background: rgba(255,255,255,0.95); border: none;
    padding: 4px 8px; border-radius: 5px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
    color: #111827; cursor: pointer;
    pointer-events: auto;
}
.pp-thumb-btn:hover { background: #fff; }
.pp-thumb-btn.danger { color: #dc2626; }

.pp-thumb-badge {
    position: absolute; top: 8px; left: 8px;
    background: #6366f1; color: #fff;
    padding: 3px 8px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}

.pp-thumb-role {
    position: absolute; bottom: 8px; left: 8px; right: 8px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 5px 8px;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: #111827; outline: none; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    z-index: 3;
}
.pp-thumb-role select {
    border: none; background: transparent; outline: none;
    font-family: inherit; font-size: 11px; color: inherit;
    flex: 1; cursor: pointer;
}
.pp-role-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pp-role-dot.identity_reference   { background: #6366f1; }
.pp-role-dot.style_reference      { background: #10b981; }
.pp-role-dot.background_reference { background: #f59e0b; }
.pp-role-dot.failed_comparison    { background: #ef4444; }

.pp-thumb-uploading {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif; font-size: 12px; color: #4b5563;
}


/* ----- Style-cards ------------------------------------------ */

.pp-style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .pp-style-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .pp-style-grid { grid-template-columns: 1fr; } }

.pp-style-card {
    position: relative;
    border: 2px solid #e5e7eb; background: #fff;
    border-radius: 10px; padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    display: flex; flex-direction: column; gap: 8px;
}
.pp-style-card:hover { border-color: #c7d2fe; background: #fafbff; }
.pp-style-card.selected {
    border-color: #6366f1; background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.pp-style-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: #eef2ff; color: #4338ca;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.pp-style-card.selected .pp-style-icon { background: #6366f1; color: #fff; }
.pp-style-name {
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
    color: #111827;
}
.pp-style-desc {
    font-family: 'Inter', sans-serif; font-size: 12px; color: #6b7280;
    line-height: 1.4;
}
.pp-style-check {
    position: absolute; top: 12px; right: 12px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #6366f1; color: #fff;
    display: none; align-items: center; justify-content: center;
    font-size: 11px;
}
.pp-style-card.selected .pp-style-check { display: flex; }
.pp-style-custom-badge {
    display: inline-block; padding: 1px 8px;
    background: #fef3c7; color: #92400e;
    border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-left: 6px;
}


/* ----- Preview-grid ----------------------------------------- */

.pp-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .pp-preview-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .pp-preview-grid { grid-template-columns: 1fr; } }

.pp-preview {
    position: relative; border-radius: 10px; overflow: hidden;
    border: 2px solid #e5e7eb; background: #f3f4f6;
    aspect-ratio: 2 / 3;
}
.pp-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-preview.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.pp-preview-num {
    position: absolute; top: 8px; left: 8px;
    background: rgba(17,24,39,0.85); color: #fff;
    padding: 3px 9px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600;
    z-index: 2;
}
.pp-preview-actions { position: absolute; top: 8px; right: 8px; z-index: 2; }
.pp-preview-actions select {
    background: rgba(255,255,255,0.95);
    border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 4px 8px;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: #111827; cursor: pointer; outline: none;
}
.pp-preview-actions select:hover {
    background: #fff; border-color: #6366f1;
}


/* ----- Pre-generate summary --------------------------------- */

.pp-send-list { display: flex; flex-direction: column; gap: 10px; }
.pp-send-row {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fff;
}
.pp-send-thumb {
    width: 56px; height: 75px; border-radius: 6px; overflow: hidden;
    background: #f3f4f6; flex-shrink: 0; border: 1px solid #e5e7eb;
}
.pp-send-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-send-meta {
    flex: 1; display: flex; flex-direction: column; gap: 4px;
    font-family: 'Inter', sans-serif;
}
.pp-send-role {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: #111827;
}
.pp-send-pos {
    color: #9ca3af; font-weight: 500;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
}
.pp-send-filename { font-size: 12px; color: #6b7280; }
.pp-send-empty {
    padding: 14px 16px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a;
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: #92400e; line-height: 1.5;
}
.pp-send-empty strong { color: #78350f; }


/* ----- Status / pills --------------------------------------- */

.pp-status {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 13px;
    margin-top: 12px;
}
.pp-status-info { background: #eef2ff; color: #4338ca; }
.pp-status-warn { background: #fffbeb; color: #92400e; }
.pp-status-ok   { background: #f0fdf4; color: #166534; }

.pp-pill {
    padding: 2px 8px; border-radius: 999px; font-size: 11px;
    font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em;
}
.pp-pill-draft    { background: #f3f4f6; color: #6b7280; }
.pp-pill-uploaded { background: #dbeafe; color: #1e40af; }
.pp-pill-generating  { background: #fef3c7; color: #92400e; }
.pp-pill-preview_ready { background: #dcfce7; color: #166534; }
.pp-pill-failed   { background: #fee2e2; color: #991b1b; }
.pp-pill-other    { background: #fef3c7; color: #92400e; }


/* ----- Buttons ---------------------------------------------- */

.pp-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px;
}

.pp-btn {
    padding: 9px 18px; background: #6366f1; color: #fff; border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
    cursor: pointer; text-decoration: none; display: inline-block;
}
.pp-btn:hover { background: #4f46e5; color: #fff; }
.pp-btn:disabled { background: #d1d5db; cursor: not-allowed; }
.pp-btn.secondary {
    background: #fff; color: #374151; border: 1px solid #d1d5db;
}
.pp-btn.secondary:hover { background: #f9fafb; color: #111827; }
.pp-btn.danger {
    background: #fff; color: #dc2626; border: 1px solid #fecaca;
}
.pp-btn.danger:hover {
    background: #fef2f2; color: #b91c1c; border-color: #fca5a5;
}

.pp-link-danger {
    font-family: 'Inter', sans-serif; font-size: 12px; color: #dc2626;
    background: none; border: none; cursor: pointer; padding: 4px 10px;
    border-radius: 6px; transition: background 0.15s;
}
.pp-link-danger:hover { background: #fef2f2; color: #b91c1c; }

.pp-cta {
    display: inline-block; padding: 11px 22px;
    background: #6366f1; color: #fff;
    border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
    text-decoration: none; margin-top: 8px;
}
.pp-cta:hover { background: #4f46e5; color: #fff; text-decoration: none; }


/* ----- Loading-overlay -------------------------------------- */

.pp-loading-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(17,24,39,0.65);
    z-index: 9999; align-items: center; justify-content: center;
}
.pp-loading-overlay.active { display: flex; }
.pp-loading-card {
    background: #fff; border-radius: 14px; padding: 28px 36px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    max-width: 380px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.pp-spinner {
    width: 44px; height: 44px;
    border: 4px solid #e5e7eb; border-top-color: #6366f1;
    border-radius: 50%;
    animation: pp-spin 0.9s linear infinite;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }
.pp-loading-card h3 {
    font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600;
    color: #111827; margin: 0;
}
.pp-loading-card p {
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: #6b7280; margin: 0; line-height: 1.5;
}


/* ----- Landing / dashboard --------------------------------- */

.pp-badge {
    display: inline-block; padding: 3px 10px;
    background: #eef2ff; color: #4338ca;
    border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500;
    margin-bottom: 12px;
}

.pp-steps { list-style: none; margin: 16px 0 0 0; padding: 0; }
.pp-steps li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-family: 'Inter', sans-serif; font-size: 13px; color: #374151;
}
.pp-steps li:last-child { border-bottom: none; }
.pp-steps li .pp-step-num {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    background: #6366f1; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
}

.pp-jobs { margin-top: 18px; }
.pp-job-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-family: 'Inter', sans-serif; font-size: 13px;
}
.pp-job-row:last-child { border-bottom: none; }
.pp-job-row a {
    color: #4338ca; text-decoration: none; font-weight: 500;
}
.pp-job-row .pp-job-meta { color: #6b7280; }


/* ----- Auth-sider (login/register/verify) ------------------- */

.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.auth-card h1 {
    font-family: 'Inter', sans-serif; font-size: 22px; font-weight: 700;
    color: #111827; margin: 0 0 6px 0;
}
.auth-card .lede {
    font-family: 'Inter', sans-serif; font-size: 14px;
    color: #6b7280; margin: 0 0 22px 0; line-height: 1.5;
}
.auth-card .field { margin-bottom: 14px; }
.auth-card .alt-action {
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: #6b7280; margin: 18px 0 0 0; text-align: center;
}
.auth-card .alt-action a { color: #4338ca; text-decoration: none; }


/* ============================================================
 * Quality Engine — 9-grid review
 * ============================================================ */

.qe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
}
@media (max-width: 1100px) {
    .qe-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .qe-grid { grid-template-columns: 1fr; }
}

.qe-cell {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.qe-cell-identity {
    background: #0f172a;
    border-color: #1e293b;
    position: relative;
}
.qe-cell-identity img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}
.qe-cell-label {
    position: absolute; top: 10px; left: 10px;
    background: #f59e0b; color: #0f172a;
    padding: 3px 10px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
    letter-spacing: 0.05em;
}
.qe-empty, .qe-cell-empty {
    padding: 50px 20px;
    text-align: center;
    color: #cbd5e1;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: #f8fafc;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qe-preview-card {
    display: flex;
    flex-direction: column;
}
.qe-preview-img-wrap {
    position: relative;
    background: #f3f4f6;
    aspect-ratio: 3/4;
    overflow: hidden;
}
.qe-preview-img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.qe-preview-num {
    position: absolute; top: 8px; left: 8px;
    background: rgba(17,24,39,0.85); color: #fff;
    padding: 3px 9px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600;
    z-index: 2;
}
.qe-preview-rank-badge {
    position: absolute; top: 8px; right: 8px;
    padding: 4px 10px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 2;
}
.qe-rank-best        { background: #16a34a; color: #fff; }
.qe-rank-second_best { background: #f59e0b; color: #0f172a; }
.qe-rank-worst       { background: #dc2626; color: #fff; }

.qe-score-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.qe-score-slider {
    flex: 1;
    accent-color: #4338ca;
}
.qe-score-display {
    width: 28px; text-align: center;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 16px; font-weight: 700; color: #0f172a;
}
.qe-score-display.qe-score-unset { color: #cbd5e1; }

.qe-rank-row {
    display: flex; gap: 6px; padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
}
.qe-rank-btn {
    flex: 1;
    padding: 6px 0;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.1s;
}
.qe-rank-btn:hover { background: #f8fafc; color: #0f172a; }
.qe-rank-btn.active.best   { background: #16a34a; color: #fff; border-color: #16a34a; }
.qe-rank-btn.active.second { background: #f59e0b; color: #0f172a; border-color: #f59e0b; }
.qe-rank-btn.active.worst  { background: #dc2626; color: #fff; border-color: #dc2626; }

.qe-tag-section {
    border-top: 1px solid #f1f5f9;
}
.qe-tag-section summary {
    padding: 8px 12px;
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500;
    color: #475569;
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.qe-tag-section summary::-webkit-details-marker { display: none; }
.qe-tag-section summary::before { content: '▸ '; color: #94a3b8; }
.qe-tag-section[open] summary::before { content: '▾ '; }
.qe-tag-section summary:hover { background: #f8fafc; }

.qe-chips {
    padding: 4px 12px 10px 12px;
    display: flex; flex-wrap: wrap; gap: 4px;
}
.qe-chip {
    padding: 3px 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.1s;
    line-height: 1.3;
}
.qe-chip:hover { background: #f8fafc; }
.qe-chip-positive.on { background: #dcfce7; color: #166534; border-color: #86efac; }
.qe-chip-negative.on { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

.qe-useas {
    padding: 4px 12px 10px 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.qe-useas-item {
    display: flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: #475569;
    cursor: pointer;
    padding: 2px 0;
}
.qe-useas-item input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: #4338ca;
}

.qe-save-status {
    padding: 6px 12px;
    border-top: 1px solid #f1f5f9;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: #94a3b8;
    text-align: right;
    min-height: 22px;
}
.qe-save-status[data-status="saving"] { color: #4338ca; }
.qe-save-status[data-status="saved"]  { color: #16a34a; }
.qe-save-status[data-status="error"]  { color: #dc2626; }

.qe-extra-note {
    grid-column: 1 / -1;
    padding: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 12px;
    color: #92400e;
    text-align: center;
}


/* ----- Library (top/bottom previews) ------------------------ */

.qe-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.qe-library-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s, box-shadow 0.15s;
}
.qe-library-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.qe-library-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}
.qe-library-meta {
    padding: 8px 10px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.qe-library-score {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 13px; font-weight: 700;
}
.qe-score-good { background: #dcfce7; color: #166534; }
.qe-score-bad  { background: #fee2e2; color: #991b1b; }


/* ============================================================
 * Admin Training (1-vs-1 prompt iteration)
 * ============================================================ */

.qt-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 800px) {
    .qt-matrix { grid-template-columns: 1fr; }
}
.qt-pane {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    aspect-ratio: 3/4;
}
.qt-pane img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.qt-pane-label {
    position: absolute; top: 10px; left: 10px;
    background: rgba(15,23,42,0.85); color: #fff;
    padding: 4px 12px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 2;
}
.qt-pane-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 30px;
    color: #94a3b8; font-family: 'Inter', sans-serif; font-size: 13px;
    text-align: center;
}

.qt-rating-row {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.qt-rating-score {
    flex: 1; min-width: 280px;
    display: flex; align-items: center; gap: 12px;
}
.qt-rating-actions {
    display: flex; gap: 8px;
}

.qt-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.qt-chip {
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: #475569;
    cursor: pointer;
}
.qt-chip:hover { background: #f8fafc; }
.qt-chip-positive.on { background: #dcfce7; color: #166534; border-color: #86efac; }
.qt-chip-negative.on { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

.qt-history {
    display: flex; flex-direction: column; gap: 8px;
}
.qt-history-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.qt-history-item.latest { border-color: #4338ca; background: #eef2ff; }
.qt-history-item img {
    width: 80px; height: 100px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.qt-history-meta {
    flex: 1; font-family: 'Inter', sans-serif; font-size: 12px; color: #475569;
    min-width: 0;
}

/* ----- Reference-thumbnails ----- */
.qt-ref-thumb {
    position: relative;
    width: 100px; height: 130px;
    border-radius: 8px; overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}
.qt-ref-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.qt-ref-thumb-label {
    position: absolute; bottom: 4px; left: 4px;
    color: #fff; padding: 2px 6px; border-radius: 4px;
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.qt-ref-thumb-delete {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,0.7); color: #fff; border: none;
    font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.qt-ref-thumb-delete:hover { background: #dc2626; }


/* ============================================================
 * Batch Review (3-column layout)
 * ============================================================ */

.qb-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 14px;
    align-items: start;
}
@media (max-width: 1100px) {
    .qb-layout { grid-template-columns: 200px 1fr; }
}

.qb-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    position: sticky;
    top: 14px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.qb-items-scroll {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}
.qb-item {
    display: flex;
    gap: 8px;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.qb-item:hover { background: #f8fafc; }
.qb-item-selected { background: #eef2ff; outline: 2px solid #4338ca; }
.qb-item-thumb {
    width: 48px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f3f4f6;
}
.qb-item-meta {
    flex: 1;
    min-width: 0;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
}
.qb-item-name {
    color: #0f172a;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qb-item-status {
    margin-top: 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.qb-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qb-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 900px) {
    .qb-pair { grid-template-columns: 1fr; }
}
.qb-pane {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3/4;
}
.qb-pane img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.qb-pane-label {
    position: absolute; top: 10px; left: 10px;
    background: rgba(15,23,42,0.85); color: #fff;
    padding: 4px 12px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 2;
}
.qb-pane-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 30px;
    color: #94a3b8; font-family: 'Inter', sans-serif; font-size: 13px;
    text-align: center;
}

.qb-history {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
}
.qb-history-label {
    font-family: 'Inter', sans-serif; font-size: 12px;
    color: #475569; font-weight: 500; margin-bottom: 6px;
}
.qb-history-strip {
    display: flex; gap: 8px; overflow-x: auto;
    padding-bottom: 4px;
}
.qb-history-thumb {
    position: relative;
    flex-shrink: 0;
    width: 70px;
    height: 90px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #f3f4f6;
}
.qb-history-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qb-history-thumb.current   { border-color: #4338ca; box-shadow: 0 0 0 2px rgba(67,56,202,0.2); }
.qb-history-thumb.approved  { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,0.2); }
.qb-history-num {
    position: absolute; top: 2px; left: 2px;
    background: rgba(15,23,42,0.85); color: #fff;
    font-size: 9px; padding: 1px 5px; border-radius: 3px;
    font-family: ui-monospace, monospace;
}
.qb-history-badge {
    position: absolute; top: 2px; right: 2px;
    background: #16a34a; color: #fff;
    font-size: 11px; font-weight: 700;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.qb-rating-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.qb-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.qb-chip {
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: #475569;
    cursor: pointer;
}
.qb-chip:hover { background: #f8fafc; }
.qb-chip-positive.on { background: #dcfce7; color: #166534; border-color: #86efac; }
.qb-chip-negative.on { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }


/* ============================================================
 * Batch review — Sidebar overlays + source badges
 * ============================================================ */

.qb-item-thumb-wrap {
    position: relative;
    width: 48px; height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f3f4f6;
}
.qb-item-thumb-wrap .qb-item-thumb {
    width: 48px; height: 60px;
    object-fit: cover; display: block;
}
.qb-thumb-dim {
    filter: grayscale(0.6) brightness(0.7);
    opacity: 0.85;
}
.qb-item-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1px 2px;
    font-family: 'Inter', sans-serif;
    font-size: 8px; font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    line-height: 1.3;
}
.qb-ov-queued     { background: rgba(75,85,99,0.92); }
.qb-ov-generating { background: rgba(245,158,11,0.92); color: #0f172a; }
.qb-ov-rerun      {
    background: rgba(234,88,12,0.95);  /* tydelig orange — adskiller "kører igen" fra første-gangs generation */
    color: #fff;
    animation: qb-rerun-pulse 1.6s ease-in-out infinite;
}
.qb-ov-ready      { background: rgba(67,56,202,0.92); }
.qb-ov-approved   { background: rgba(22,163,74,0.92); }
.qb-ov-rejected   { background: rgba(220,38,38,0.92); }
.qb-ov-failed     { background: rgba(220,38,38,0.92); }

@keyframes qb-rerun-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

.qb-item-source-badge {
    position: absolute;
    top: 2px; left: 2px;
    background: rgba(15,23,42,0.85);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 8px; font-weight: 700;
    letter-spacing: 0.04em;
}
.qb-item-version-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: rgba(234,88,12,0.95);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 9px; font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.qb-item-score {
    margin-top: 2px;
    font-size: 10px;
    color: #475569;
    font-family: ui-monospace, monospace;
    font-weight: 600;
}
.qb-item { align-items: stretch; }


/* ============================================================
 * Batch review — Main pane labels + placeholder
 * ============================================================ */

.qb-pane-label-grp {
    position: absolute; top: 10px; left: 10px;
    z-index: 2;
    display: flex; flex-direction: column; gap: 3px;
}
.qb-pane-label-grp .qb-pane-label {
    position: static;
    background: rgba(15,23,42,0.85); color: #fff;
    padding: 4px 12px; border-radius: 999px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
    letter-spacing: 0.05em;
    align-self: flex-start;
}
.qb-pane-label-approved { background: #16a34a !important; }
.qb-pane-source {
    background: rgba(15,23,42,0.65);
    color: #cbd5e1;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 9px; font-weight: 600;
    letter-spacing: 0.04em;
    align-self: flex-start;
}

.qb-pane-placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px;
    font-family: 'Inter', sans-serif;
    text-align: center;
    gap: 8px;
}
.qb-pane-placeholder-icon { font-size: 42px; opacity: 0.7; }
.qb-pane-placeholder-label { font-size: 14px; font-weight: 700; letter-spacing: 0.05em; }
.qb-pane-placeholder-sub { font-size: 12px; color: #64748b; max-width: 280px; line-height: 1.5; }
.qb-pane-placeholder-qb-ov-queued     { background: #f8fafc; color: #475569; }
.qb-pane-placeholder-qb-ov-generating { background: #fef3c7; color: #92400e; }
.qb-pane-placeholder-qb-ov-ready      { background: #eef2ff; color: #4338ca; }
.qb-pane-placeholder-qb-ov-approved   { background: #dcfce7; color: #166534; }
.qb-pane-placeholder-qb-ov-rejected   { background: #fee2e2; color: #991b1b; }
.qb-pane-placeholder-qb-ov-failed     { background: #fee2e2; color: #991b1b; }


/* ============================================================
 * Batch review — Actions panel (rating + buttons + tags)
 * ============================================================ */

.qb-actions { padding: 14px 18px; }

.qb-rating-block {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 12px;
}
.qb-rating-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px; font-weight: 700;
    color: #475569;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}
.qb-rating-numbers { display: flex; gap: 4px; flex-wrap: wrap; }
.qb-rating-num {
    width: 38px; height: 38px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px; font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.1s;
}
.qb-rating-num:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.qb-rating-num.active { transform: scale(1.06); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.qb-rating-good.active { background: #16a34a; color: #fff; border-color: #16a34a; }
.qb-rating-mid.active  { background: #4338ca; color: #fff; border-color: #4338ca; }
.qb-rating-bad.active  { background: #dc2626; color: #fff; border-color: #dc2626; }

.qb-action-row {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
}
.qb-btn-approve { background: #16a34a; }
.qb-btn-approve:hover { background: #15803d; }

.qb-tags-section { margin-bottom: 12px; }
.qb-tags-section summary {
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12px; font-weight: 600;
    color: #475569;
    padding: 6px 0;
    user-select: none;
}
.qb-tags-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 8px;
}
@media (max-width: 900px) { .qb-tags-grid { grid-template-columns: 1fr; } }
.qb-tags-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 4px;
}
.qb-correction-block { margin-top: 6px; }


/* ============================================================
 * Batch review — Compact versions strip
 * ============================================================ */

.qb-versions-card { padding: 12px 14px; }
.qb-versions-strip {
    display: flex; gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.qb-vstrip {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    width: 110px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: all 0.1s;
}
.qb-vstrip:hover { border-color: #4338ca; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.qb-vstrip.current  { border-color: #4338ca; background: #eef2ff; }
.qb-vstrip.approved { border-color: #16a34a; background: #f0fdf4; }
.qb-vstrip-thumb {
    position: relative;
    width: 110px; height: 140px;
    background: #f3f4f6;
}
.qb-vstrip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qb-vstrip-badge {
    position: absolute; top: 4px; right: 4px;
    background: #16a34a; color: #fff;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
}
.qb-vstrip-current {
    position: absolute; top: 4px; right: 4px;
    width: 12px; height: 12px;
    background: #4338ca;
    border-radius: 50%;
    border: 2px solid #fff;
}
.qb-vstrip-meta {
    padding: 6px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: #475569;
}
.qb-vstrip-row1 {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 2px;
}
.qb-vstrip-v { font-weight: 700; color: #0f172a; font-size: 11px; }
.qb-vstrip-id { font-family: ui-monospace, Menlo, monospace; font-size: 9px; color: #94a3b8; }
.qb-vstrip-source {
    font-size: 9px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: auto;
}
.qb-vstrip-row2 {
    display: flex; justify-content: space-between;
    color: #64748b; font-size: 10px;
}
.qb-vstrip-row3 {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 9px; color: #94a3b8;
    margin-top: 2px;
}
.qb-vstrip-correction {
    margin-top: 4px;
    padding: 3px 5px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 3px;
    font-size: 9px;
    line-height: 1.3;
    cursor: help;
}


/* ============================================================
 * Batch review — Debug metadata + Prompt-log modal
 * ============================================================ */

.qb-debug summary {
    cursor: pointer;
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    user-select: none;
}
.qb-debug-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}
.qb-debug-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    vertical-align: top;
}
.qb-debug-table td:first-child { color: #64748b; width: 220px; font-weight: 500; }
.qb-debug-table td:last-child { color: #0f172a; }
.qb-debug-table code {
    font-size: 11px;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
}

.qb-modal {
    position: fixed; inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qb-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.65); }
.qb-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.qb-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.qb-modal-close {
    background: none; border: none;
    font-size: 24px; color: #64748b;
    cursor: pointer; padding: 0; line-height: 1;
}
.qb-modal-close:hover { color: #0f172a; }
.qb-modal-body { padding: 14px 18px; overflow-y: auto; }


/* ============================================================
 * Batch review — slim top bar (erstatter den store progress-card)
 * ============================================================ */

.qb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #0f172a;
}


/* ============================================================
 * Tone Matrix (fase 1.5) — 3x3 lokal ImageMagick-grid + banner
 * ============================================================ */

/* Prominent strip mellem 2-pane og action-card — kan ikke overses */
.qb-tone-strip {
    margin: 12px 0;
    padding: 14px 18px;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(15,23,42,0.15);
}
.qb-tone-strip-text {
    flex: 1;
    min-width: 280px;
    font-size: 13px;
}
.qb-tone-strip-text strong {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fde68a;
}
.qb-tone-strip-text span { color: #cbd5e1; margin-left: 6px; }
.qb-tone-strip-btn {
    padding: 10px 18px;
    background: #fde68a;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.qb-tone-strip-btn:hover { background: #fcd34d; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.qb-tone-strip-btn:active { transform: translateY(0); }
/* B/W matrix-knap: invertet — sort knap med hvid tekst */
.qb-tone-strip-btn-bw {
    background: #f8fafc;
    color: #0f172a;
    border: 2px solid #f8fafc;
}
.qb-tone-strip-btn-bw:hover { background: #fff; }

/* Background matrix-knap: tydeligt anderledes farve (OpenAI-cost = ikke gratis) */
.qb-tone-strip-btn-bg {
    background: #4338ca;
    color: #fff;
    border: 2px solid #4338ca;
}
.qb-tone-strip-btn-bg:hover { background: #3730a3; }

/* Fixed BG-knap: grøn (gratis, lokal — fase 1.7b prototype) */
.qb-tone-strip-btn-fixed {
    background: #16a34a;
    color: #fff;
    border: 2px solid #16a34a;
}
.qb-tone-strip-btn-fixed:hover { background: #15803d; }

/* Pending-celler i bg-matrix mens variants genereres */
.qb-tone-cell-pending {
    border: 1px dashed #cbd5e1;
    background: #fafbfc;
}
.qb-tone-cell-pending:hover {
    border-color: #94a3b8;
    box-shadow: none;
}

.qb-tone-banner {
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #166534;
}
.qb-tone-banner i { color: #16a34a; }
.qb-tone-banner a { color: #166534; text-decoration: underline; font-weight: 600; }

/* Modal-størrelse — alle 9 celler skal kunne ses uden scroll */
.qb-tone-modal-content {
    max-width: 1500px;
    width: 96vw;
    max-height: 96vh;
    height: 96vh;
    display: flex;
    flex-direction: column;
}
.qb-tone-modal-body {
    flex: 1;
    overflow: hidden;  /* NO scroll */
    display: flex;
    flex-direction: row;
    gap: 14px;
    padding: 12px 14px !important;
}

/* Reference-kolonne: kundens originalfoto til venstre */
.qb-tone-reference {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}
.qb-tone-ref-label {
    font-size: 10px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.qb-tone-ref-thumb {
    flex: 1;
    min-height: 0;
    border: 2px solid #4338ca;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
}
.qb-tone-ref-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}
.qb-tone-ref-name {
    font-size: 10px;
    font-weight: 700;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qb-tone-ref-filename {
    font-size: 10px;
    color: #94a3b8;
    font-family: ui-monospace, Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .qb-tone-modal-body { flex-direction: column; }
    .qb-tone-reference { width: auto; flex-direction: row; align-items: center; }
    .qb-tone-ref-thumb { width: 80px; height: 80px; flex: 0 0 80px; }
}

.qb-tone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    font-family: 'Inter', sans-serif;
    flex: 1;
    min-height: 0;  /* tillader children at krymp */
}
@media (max-width: 720px) {
    .qb-tone-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    #qb-tone-modal .qb-modal-content { height: auto; max-height: 90vh; }
    #qb-tone-modal .qb-modal-body { overflow-y: auto; }
}

.qb-tone-loading {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    align-self: center;
}

.qb-tone-cell {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.12s;
    min-height: 0;
    min-width: 0;
}
.qb-tone-cell:hover { border-color: #4338ca; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.qb-tone-cell-ai {
    border: 2px solid #0f172a;
    background: #f8fafc;
}
.qb-tone-cell-ai:hover { border-color: #0f172a; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

.qb-tone-thumb {
    width: 100%;
    flex: 1;
    background: #f3f4f6;
    overflow: hidden;
    min-height: 0;
}
.qb-tone-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 30%;  /* vis ansigtet (øverst af portræt) frem for tøj */
    display: block;
}

.qb-tone-meta {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.qb-tone-name {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qb-tone-badge { display: none; }  /* skjul badges i kompakt-grid; AI-cellen bruger border + name */
.qb-tone-use {
    margin: 0 0 0 auto;
    font-size: 11px !important;
    padding: 4px 10px !important;
    flex-shrink: 0;
    white-space: nowrap;
}
.qb-tone-cell-ai .qb-tone-name::before { content: '★ '; color: #f59e0b; }

.qb-tone-cell-missing {
    border-color: #fecaca;
    background: #fef2f2;
}

.qb-tone-footer {
    grid-column: 1 / -1;
    display: none;  /* skjul i kompakt-grid — regen-knap flyttes til modal-header */
}
