/* ─── Theme Variables ─── */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1c1c1c;
    --bg-input: #111111;
    --bg-input-hover: #1a1a1a;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --accent-subtle: rgba(233,69,96,0.12);
    --text-primary: #e8e8e8;
    --text-secondary: #707070;
    --text-tertiary: #505050;
    --border: #222222;
    --border-hover: #333333;
    --border-strong: #333333;
    --shadow: none;
    --transcript-bg: #0e0e0e;
    --overlay: rgba(0, 0, 0, 0.7);
    --divider: #1a1a1a;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}
[data-theme="light"] {
    --bg-primary: #f8f8f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f5;
    --bg-input: #f2f2f2;
    --bg-input-hover: #e8e8e8;
    --accent: #e94560;
    --accent-hover: #d63851;
    --accent-subtle: rgba(233,69,96,0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #777777;
    --text-tertiary: #aaaaaa;
    --border: #e2e2e2;
    --border-hover: #cccccc;
    --border-strong: #cccccc;
    --shadow: 0 1px 2px rgba(0,0,0,0.04);
    --transcript-bg: #f2f2f2;
    --overlay: rgba(0, 0, 0, 0.4);
    --divider: #eeeeee;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', sans-serif;
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
a { color: inherit; }

/* ─── Utility ─── */
.hidden { display: none !important; }
.w-full { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }
.accent-text { color: var(--accent); }

/* ─── Card ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--shadow);
    transition: background 0.2s, border-color 0.2s;
}

.panel { padding: 20px; }
.panel-tight { padding: 16px; }
.sub-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ─── Buttons ─── */
.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 8px 20px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary,
.page-back {
    background: transparent;
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 3px;
    font-size: 13px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}
.btn-secondary:hover,
.page-back:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-input); }

.btn-danger {
    background: transparent;
    color: var(--text-tertiary);
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-danger:hover { color: var(--danger); border-color: rgba(239,68,68,0.3); }

.btn-link { text-decoration: none; }

/* ─── Inputs ─── */
.input-field {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--text-tertiary); }

.field-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* ─── Select ─── */
select.input-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    cursor: pointer;
}
select.input-field:hover { border-color: var(--border-hover); }

/* ─── Checkbox ─── */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-hover);
    border-radius: 3px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}
input[type="checkbox"]:hover,
input[type="radio"]:hover {
    border-color: var(--accent);
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ─── Sections & Headings ─── */
.section-heading {
    margin-bottom: 12px;
}
.section-heading.row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.section-heading h2 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.section-heading p { font-size: 12px; color: var(--text-secondary); }

.helper-text { font-size: 12px; color: var(--text-secondary); }

.action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* ─── Chip / Tag ─── */
.chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
    background: var(--accent-subtle);
    color: var(--accent);
}
.chip:empty { display: none; }

.tag { display: inline-block; padding: 1px 6px; border-radius: 2px; font-size: 11px; font-weight: 500; }
.tag-lang { background: var(--accent-subtle); color: var(--accent); }
.tag-active { background: rgba(34,197,94,0.15); color: #4ade80; }
.tag-summary { background: rgba(168,85,247,0.15); color: #a855f7; cursor: pointer; }
.tag-summary:hover { background: rgba(168,85,247,0.25); }

/* ─── Transcript Box ─── */
.transcript-box {
    background: var(--transcript-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.9;
    color: var(--text-primary);
}
.transcript-box::-webkit-scrollbar { width: 6px; }
.transcript-box::-webkit-scrollbar-track { background: transparent; }
.transcript-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.summary-box { max-height: none; min-height: 200px; font-size: 13px; }

/* ─── Form Error ─── */
.form-error,
.notice-inline {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 3px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--danger);
    margin-bottom: 12px;
}

/* ─── Login Screen ─── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
    background: var(--bg-primary);
}
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px 32px 32px;
}
.login-logo {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.login-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 28px;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 11px;
    color: var(--text-tertiary);
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── App Shell ─── */
.app-shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-email {
    font-size: 11px;
    color: var(--text-tertiary);
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--border);
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    flex-shrink: 0;
}
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    transition: transform 0.2s;
}
[data-theme="light"] .theme-toggle::after { transform: translateX(16px); }

/* ─── Navigation ─── */
.nav-shell {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.nav-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    user-select: none;
    margin-bottom: -1px;
}
.nav-tab.active { border-bottom-color: var(--text-primary); color: var(--text-primary); font-weight: 500; }
.nav-tab:hover { color: var(--text-primary); }

/* ─── Page Section ─── */
.page-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-intro {
    margin-bottom: 4px;
}
.page-intro h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}
.page-intro p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ─── Extract ─── */
.extract-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* ─── URL Preview ─── */
.preview-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow: hidden;
}
.preview-thumb-wrap {
    flex-shrink: 0;
    width: 180px;
    height: 102px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-secondary);
}
.preview-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-copy { flex: 1; min-width: 0; }
.preview-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.preview-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.preview-meta.faint { color: var(--text-tertiary); }

/* ─── Loading ─── */
.loading-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ─── Notice (Duplicate) ─── */
.notice-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    overflow: hidden;
}
.notice-copy { flex: 1; min-width: 0; }
.notice-title { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.notice-main { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.notice-meta { font-size: 12px; color: var(--text-tertiary); }

/* ─── Spinner ─── */
.spinner {
    border: 2px solid var(--border);
    border-top: 2px solid var(--text-secondary);
    border-radius: 50%;
    width: 20px; height: 20px;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
.spinner-sm { width: 12px; height: 12px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── History ─── */
.history-grid {
    display: flex;
    flex-direction: column;
}

.history-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--divider);
    align-items: flex-start;
    overflow: hidden;
}
.history-card:last-child { border-bottom: none; }
.history-card:hover { background: var(--bg-card-hover); }

.history-thumb {
    flex-shrink: 0;
    width: 148px;
    height: 84px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-secondary);
    position: relative;
    border: none;
    cursor: pointer;
    padding: 0;
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.history-thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-tertiary); font-size: 20px;
}

.duration-badge {
    position: absolute; bottom: 4px; right: 4px;
    background: rgba(0,0,0,0.85); color: #fff;
    font-size: 10px; padding: 1px 5px;
    border-radius: 2px; font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.history-info { flex: 1; min-width: 0; }
.history-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    padding: 0;
}
.history-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.history-url {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.history-date { font-size: 11px; color: var(--text-tertiary); margin-bottom: 6px; }
.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

/* ─── Empty State ─── */
.empty-state {
    padding: 24px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
}

/* ─── Detail View ─── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.page-header-copy { flex: 1; min-width: 0; }
.page-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
}

.detail-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-hero {
    display: flex;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
}
.detail-thumb-wrap {
    flex-shrink: 0;
    width: 200px;
    height: 113px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-secondary);
}
.detail-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-copy { flex: 1; min-width: 0; }
.detail-copy h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}
.detail-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.detail-url {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.detail-url span {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 340px;
}

/* ─── Active Job Banner ─── */
.active-job-banner {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 3px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    font-size: 12px;
    color: var(--text-primary);
}

/* ─── Bulk Toolbar ─── */
.bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
}

/* ─── Summary List ─── */
.summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-input);
    cursor: pointer;
    transition: background 0.1s, border-color 0.15s;
}
.summary-item:hover { background: var(--bg-card-hover, var(--bg-input-hover)); border-color: var(--border-hover); }
.summary-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.summary-item-title { font-weight: 500; font-size: 13px; }
.summary-item-meta { font-size: 11px; color: var(--text-tertiary); }
.summary-preview {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 6px 0 8px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    line-height: 1.6;
}

/* ─── Collapsible Panel (Transcript) ─── */
.collapsible-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 13px;
}
.collapsible-panel summary::-webkit-details-marker { display: none; }
.summary-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}
.transcript-panel-body { padding: 0 16px 16px; }

/* ─── Summary Detail ─── */
.summary-hero {
    padding: 16px;
    overflow: hidden;
}
.summary-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.summary-hero-copy { flex: 1; min-width: 0; }
.summary-hero-copy h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}
.source-link {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.source-link button,
.source-link a { margin-top: 8px; }

/* ─── Settings ─── */
.settings-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.settings-grid select.input-field:first-child { width: 140px; flex: none; }
.settings-grid select.input-field:last-child { width: 220px; flex: none; }
.settings-grid input.input-field { flex: 1; min-width: 180px; }

.provider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    margin-bottom: 6px;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── Toast ─── */
.toast {
    position: fixed; bottom: 20px; right: 20px;
    padding: 10px 20px;
    border-radius: 3px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    z-index: 1000;
    animation: fadeUp 0.25s ease;
}
.toast-success { background: #1a1a1a; border-left: 3px solid var(--success); }
.toast-error { background: #1a1a1a; border-left: 3px solid var(--danger); }
[data-theme="light"] .toast-success { background: #fff; color: #1a1a1a; border: 1px solid #e2e2e2; border-left: 3px solid var(--success); }
[data-theme="light"] .toast-error { background: #fff; color: #1a1a1a; border: 1px solid #e2e2e2; border-left: 3px solid var(--danger); }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } }

/* ─── Modal ─── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal {
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 4px;
}
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.modal-header h3 { font-size: 14px; font-weight: 600; }
.modal-header p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.summary-choice-grid {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.summary-choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 3px;
    flex: 1;
}
.summary-choice strong { font-weight: 500; }
.summary-choice span { display: block; font-size: 11px; color: var(--text-tertiary); }

/* ─── Task Launcher ─── */
.task-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.task-launcher strong {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
}

/* ─── Task Manager ─── */
.task-manager {
    position: fixed;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    min-width: 320px;
    max-width: 420px;
    width: 380px;
    bottom: 20px;
    right: 20px;
    user-select: none;
    transition: box-shadow 0.2s;
}
.task-manager.minimized { min-width: auto; width: auto; max-width: none; }
.task-manager.minimized .task-manager-body { display: none; }
.task-manager-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
    gap: 8px;
}
.task-manager.minimized .task-manager-header { border-radius: 6px; border-bottom: none; }
.task-manager-title { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.task-manager-subtitle { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.task-manager-controls { display: flex; gap: 4px; }
.task-manager-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.task-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-input);
    font-size: 12px;
}
.task-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.task-item-title { font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.task-item-status { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.task-item-status.success { color: var(--success); }
.task-item-status.error { color: var(--danger); }

.task-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.task-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 30%;
    animation: indeterminate 1.5s ease-in-out infinite;
}
@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .history-thumb { width: 120px; height: 68px; }
    .history-card { gap: 10px; padding: 10px 12px; }
    .app-topbar { flex-direction: column; gap: 12px; }
    .extract-row { flex-direction: column; }
    .detail-hero { flex-direction: column; }
    .detail-thumb-wrap { width: 100%; height: auto; aspect-ratio: 16/9; }
    .preview-card { flex-direction: column; }
    .preview-thumb-wrap { width: 100%; height: auto; aspect-ratio: 16/9; }
    .summary-choice-grid { flex-direction: column; }
    .summary-hero-main { flex-direction: column; }
    .settings-grid { flex-direction: column; }
    .settings-grid select.input-field:first-child,
    .settings-grid select.input-field:last-child { width: 100%; }
    .task-manager {
        min-width: 260px;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
    }
}

@media (min-width: 641px) {
    .settings-grid {
        flex-wrap: nowrap;
    }
}

/* ─── Section Label ─── */
.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 8px;
}
