/* Task panel refinement, aligned to the existing public/style.css token system. */
.seo-task-history-fab {
    right: 24px;
    bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: var(--radius-pill, 100px);
    background: var(--text-dark, #0f172a);
    font: 600 14px/1.2 var(--font-family, Inter, system-ui, sans-serif);
    box-shadow: 0 8px 24px rgb(15 23 42 / 22%);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.seo-task-history-fab:hover { transform: translateY(-2px); background: var(--accent-1, #0ea5e9); box-shadow: 0 12px 28px rgb(15 23 42 / 25%); }
.seo-task-panel {
    right: 24px;
    bottom: 24px;
    width: min(420px, calc(100vw - 32px));
    max-height: min(640px, calc(100dvh - 48px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    background: var(--bg-surface, #fff);
    color: var(--text-main, #334155);
    box-shadow: 0 18px 48px rgb(15 23 42 / 20%);
    font-family: var(--font-family, Inter, system-ui, sans-serif);
}
.seo-task-panel.collapsed { max-height: 64px; }
.seo-task-panel.hidden { display: none !important; }
.seo-task-panel.hidden ~ .seo-task-history-fab,
.seo-task-panel.collapsed ~ .seo-task-history-fab { display: inline-flex !important; }
.seo-task-panel-head {
    flex: 0 0 auto;
    min-height: 68px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light, #e2e8f0);
    background: linear-gradient(135deg, #fff, #f8fafc);
}
.seo-task-heading { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.seo-task-panel-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; color: #fff; background: var(--accent-1, #0ea5e9); font-size: 18px; font-weight: 700; }
.seo-task-panel-title { display: block; color: var(--text-dark, #0f172a); font-size: 15px; line-height: 1.2; letter-spacing: -.02em; }
.seo-task-panel-count { display: block; margin-top: 4px; color: var(--text-muted, #64748b); font-size: 12px; line-height: 1.3; }
.seo-task-panel-controls { display: flex; gap: 6px; }
.seo-task-panel-controls button {
    display: grid;
    place-items: center;
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 10px;
    color: var(--text-main, #334155);
    background: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.seo-task-panel-controls button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.seo-task-panel-controls button[data-task-hide]:hover {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fca5a5;
}
.seo-task-clear-row {
    display: flex;
    justify-content: flex-end;
    padding: 4px 6px 10px;
}
.seo-task-clear-btn {
    min-height: 28px;
    padding: 0 10px;
    border: 1px dashed var(--border-light, #cbd5e1);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s ease;
}
.seo-task-clear-btn:hover {
    color: var(--text-dark, #0f172a);
    background: #f8fafc;
    border-color: #94a3b8;
}
.seo-task-panel [data-task-list] { overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 12px; }
.seo-task-row { margin: 6px 0; padding: 14px; border: 1px solid var(--border-light, #e2e8f0); border-radius: 12px; background: #fff; transition: border-color .16s ease, background .16s ease; }
.seo-task-row:hover { border-color: #cbd5e1; background: #fcfdff; }
.seo-task-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.seo-task-title { min-width: 0; color: var(--text-dark, #0f172a); font-size: 13px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.seo-task-status { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 24px; margin: 0; padding: 3px 9px; border: 0; border-radius: 999px; font-size: 11px; font-weight: 650; line-height: 1.2; color: #475569; background: #f1f5f9; }
.seo-task-status.status-running { color: #075985; background: #e0f2fe; }
.seo-task-status.status-pending, .seo-task-status.status-scheduled { color: #854d0e; background: #fef9c3; }
.seo-task-status.status-completed { color: #166534; background: #dcfce7; }
.seo-task-status.status-failed { color: #991b1b; background: #fee2e2; }
.seo-task-status.status-cancelled { color: #475569; background: #e2e8f0; }
.seo-task-message { margin: 8px 0 7px; color: var(--text-muted, #64748b); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.seo-task-row progress { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; appearance: none; background: #e9eef5; }
.seo-task-row progress::-webkit-progress-bar { border-radius: 999px; background: #e9eef5; }
.seo-task-row progress::-webkit-progress-value { border-radius: 999px; background: var(--accent-1, #0ea5e9); transition: width .25s ease; }
.seo-task-row progress::-moz-progress-bar { border-radius: 999px; background: var(--accent-1, #0ea5e9); }
.seo-task-row[data-status="completed"] progress::-webkit-progress-value { background: var(--accent-3, #10b981); }
.seo-task-row[data-status="completed"] progress::-moz-progress-bar { background: var(--accent-3, #10b981); }
.seo-task-row[data-status="failed"] progress::-webkit-progress-value { background: var(--accent-danger, #ef4444); }
.seo-task-row[data-status="failed"] progress::-moz-progress-bar { background: var(--accent-danger, #ef4444); }
.seo-task-error { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; color: #991b1b; background: #fef2f2; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.seo-task-actions { justify-content: flex-start; padding: 10px 0 0; }
.seo-task-actions button { min-height: 34px; padding: 0 11px; border: 1px solid var(--border-light, #e2e8f0); border-radius: 9px; color: var(--text-main, #334155); background: #fff; font-size: 12px; font-weight: 600; }
.seo-task-actions button:hover { border-color: var(--accent-1, #0ea5e9); color: var(--accent-1, #0ea5e9); }
.seo-task-actions button:first-child:is(:only-child) { }
.seo-task-empty { margin: 10px 4px; padding: 18px; border: 1px dashed var(--border-light, #cbd5e1); border-radius: 10px; text-align: center; line-height: 1.5; }
.seo-task-panel button:focus-visible, .seo-task-history-fab:focus-visible { outline: 3px solid #38bdf8 !important; outline-offset: 2px !important; }
@media (max-width: 768px) {
    .seo-task-panel { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); max-height: min(72dvh, 620px); border-radius: 14px; }
    .seo-task-history-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
    .seo-task-panel-head { padding: 10px 12px; }
    .seo-task-panel [data-task-list] { padding: 6px 8px 10px; }
    .seo-task-row { padding: 11px; }
    .seo-task-title { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .seo-task-row, .seo-task-history-fab, .seo-task-row progress::-webkit-progress-value { transition: none; }
}
