/* ==========================================================================
   LazyFlow AI — Modern, Local-first AI Studio Design System
   ========================================================================== */

:root {
    /* Color Palette - Light Theme */
    --primary: #7048e8;
    --primary-hover: #5f3dc4;
    --primary-light: #f3f0ff;
    --primary-glow: rgba(112, 72, 232, 0.2);

    --bg: #f8f9fc;
    --surface: #ffffff;
    --surface-secondary: #f1f3f9;
    --surface-hover: #f8f9fd;

    --line: #e4e7ee;
    --line-subtle: #edf0f7;
    --line-focus: #9775fa;

    --ink: #1e1b2e;
    --ink-secondary: #4b4860;
    --muted: #73708a;

    --code-bg: #1e1e2e;
    --code-ink: #cdd6f4;

    --card-shadow: 0 10px 30px -8px rgba(30, 27, 46, 0.07), 0 4px 12px -2px rgba(30, 27, 46, 0.04);
    --card-hover-shadow: 0 18px 40px -10px rgba(112, 72, 232, 0.16), 0 6px 16px -2px rgba(30, 27, 46, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
    /* Color Palette - Dark Theme */
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-light: rgba(139, 92, 246, 0.15);
    --primary-glow: rgba(139, 92, 246, 0.35);

    --bg: #0c0b14;
    --surface: #141224;
    --surface-secondary: #1a1730;
    --surface-hover: #211d3d;

    --line: #2a254a;
    --line-subtle: #1e1a38;
    --line-focus: #a78bfa;

    --ink: #f3f2fa;
    --ink-secondary: #c5c2de;
    --muted: #8d89a8;

    --code-bg: #090810;
    --code-ink: #e2e0f0;

    --card-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.5), 0 4px 14px -2px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 20px 48px -10px rgba(139, 92, 246, 0.3), 0 6px 20px -2px rgba(0, 0, 0, 0.4);
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(var(--surface), 0.85);
    border-bottom: 1px solid var(--line);
    padding: 14px 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: border-color 0.25s ease;
}

[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .topbar {
    background: rgba(20, 18, 36, 0.85);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-sparkle {
    color: var(--primary);
    animation: gentle-sparkle 3s ease-in-out infinite;
}

@keyframes gentle-sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
    50% { transform: scale(1.18) rotate(10deg); opacity: 1; }
}

.brand-badge {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 800;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

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

.status-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.status-demo {
    background: #fff4df;
    color: #925d18;
    border: 1px solid #ffe1a6;
}

[data-theme="dark"] .status-demo {
    background: #2d2414;
    color: #f7b955;
    border-color: #594019;
}

.status-connected {
    background: #e6fcf5;
    color: #0ca678;
    border: 1px solid #b2f2bb;
}

[data-theme="dark"] .status-connected {
    background: #0f2d22;
    color: #38d9a9;
    border-color: #1a5740;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.status-connected .status-dot {
    box-shadow: 0 0 8px currentColor;
    animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.icon-btn:hover {
    background: var(--surface-secondary);
    border-color: var(--line-focus);
    transform: translateY(-1px);
}

.history-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 15px;
    text-align: center;
}

/* ==========================================================================
   Main Layout & Hero
   ========================================================================== */

.container {
    width: min(1140px, 92%);
    margin: 0 auto;
    flex: 1;
}

.hero {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    align-items: center;
    gap: 40px;
    padding: 48px 0 32px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.hero h1 {
    font-size: clamp(34px, 4.5vw, 54px);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.14;
    margin-bottom: 18px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #ec4899 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-copy {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
    max-width: 580px;
    margin-bottom: 22px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
    background: var(--surface-secondary);
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

.hero-art {
    display: grid;
    place-items: center;
    position: relative;
}

.glow-card {
    position: relative;
    width: 250px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--card-hover-shadow);
    transform: rotate(-3deg);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.glow-card:hover {
    transform: rotate(0deg) scale(1.03);
}

.card-glow-orb {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.card-icon-wrap {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 14px;
}

.glow-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.glow-card p {
    color: var(--muted);
    font-size: 12px;
}

.progress-bar {
    height: 6px;
    margin-top: 20px;
    background: var(--surface-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    width: 82%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ec4899);
    border-radius: var(--radius-full);
    animation: progress-slide 2.5s infinite ease-in-out alternate;
}

@keyframes progress-slide {
    0% { width: 45%; }
    100% { width: 92%; }
}

.card-footer-metric {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    font-size: 11px;
    color: var(--muted);
}

.metric-highlight {
    color: var(--primary);
    font-weight: 700;
}

/* ==========================================================================
   Tools Section & Category Filters
   ========================================================================== */

.section {
    margin: 20px 0 35px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.section h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.filter-tabs {
    display: flex;
    background: var(--surface-secondary);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    gap: 4px;
}

.filter-tab {
    background: transparent;
    border: none;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    color: var(--ink);
}

.filter-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Task Grid */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.task-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--card-shadow);
}

.task-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-focus);
    box-shadow: var(--card-hover-shadow);
}

.task-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow), var(--card-hover-shadow);
    background: var(--surface-hover);
}

.task-card strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.task-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    flex-grow: 1;
}

.task-category-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--surface-secondary);
    color: var(--muted);
    margin-top: 6px;
}

.task-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    font-size: 20px;
    font-weight: 700;
}

/* Colorful icon themes */
.purple { color: #8b5cf6; background: rgba(139, 92, 246, 0.14); }
.teal   { color: #14b8a6; background: rgba(20, 184, 166, 0.14); }
.green  { color: #10b981; background: rgba(16, 185, 129, 0.14); }
.orange { color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.indigo { color: #6366f1; background: rgba(99, 102, 241, 0.14); }
.cyan   { color: #06b6d4; background: rgba(6, 182, 212, 0.14); }
.blue   { color: #3b82f6; background: rgba(59, 130, 246, 0.14); }

/* ==========================================================================
   Panel System
   ========================================================================== */

.panel {
    margin: 28px 0;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.panel-header h2 {
    font-size: 22px;
    font-weight: 800;
}

.panel-header-actions {
    display: flex;
    gap: 8px;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.pill-btn.subtle {
    background: var(--surface-secondary);
    color: var(--muted);
    border-color: var(--line);
}

.pill-btn.subtle:hover {
    background: var(--line);
    color: var(--ink);
}

label {
    display: block;
    margin: 12px 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.textarea-wrapper {
    position: relative;
}

textarea,
input[type="text"],
input[type="url"],
select {
    width: 100%;
    padding: 14px 16px;
    color: var(--ink);
    background: var(--surface-secondary);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.7;
}

textarea:focus,
input[type="text"]:focus,
input[type="url"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface);
}

.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 12px;
    flex-wrap: wrap;
}

.counters {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.counter-dot {
    opacity: 0.5;
}

.privacy-tip {
    font-size: 11px;
}

.actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.model-field {
    width: 290px;
}

.model-field label {
    margin-top: 0;
    margin-bottom: 6px;
}

.select-wrapper {
    position: relative;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.primary-btn {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.primary-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.secondary-btn {
    color: var(--ink-secondary);
    background: var(--surface-secondary);
    border: 1px solid var(--line);
}

.secondary-btn:hover {
    background: var(--surface-hover);
    color: var(--ink);
    border-color: var(--line-focus);
}

.danger-btn {
    color: #ef4444;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 20px;
    background: rgba(245, 158, 11, 0.09);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    font-size: 13px;
}

[data-theme="dark"] .notice {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.notice p {
    margin: 0;
    flex: 1;
}

.notice button {
    background: transparent;
    border: none;
    color: inherit;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

/* ==========================================================================
   Result Output Panel
   ========================================================================== */

.result-panel {
    border-color: var(--primary-glow);
    background: var(--surface);
    animation: fade-in-up 0.3s ease forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.result-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: #fff4df;
    color: #95671d;
    border: 1px solid #ffe1a6;
}

[data-theme="dark"] .result-badge {
    background: #2d2414;
    color: #f7b955;
    border-color: #594019;
}

.result-badge.real {
    background: #e6fcf5;
    color: #0ca678;
    border-color: #b2f2bb;
}

[data-theme="dark"] .result-badge.real {
    background: #0f2d22;
    color: #38d9a9;
    border-color: #1a5740;
}

.time-badge {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-secondary);
}

.result-box {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--code-bg);
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.result-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.result-format-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a6adc8;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    color: #cdd6f4;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.result-text {
    padding: 22px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.8;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--code-ink);
    max-height: 520px;
    overflow-y: auto;
}

/* Custom scrollbar for result */
.result-text::-webkit-scrollbar {
    width: 8px;
}
.result-text::-webkit-scrollbar-track {
    background: var(--code-bg);
}
.result-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.result-footer {
    margin-top: 14px;
}

.fine-print {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

/* ==========================================================================
   Guide Panel & Command Boxes
   ========================================================================== */

.guide-panel {
    background: var(--surface);
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.guide-icon {
    font-size: 28px;
}

.command-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.command {
    flex: 1;
    padding: 14px 18px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #cdd6f4;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.cmd-prompt {
    color: #8b5cf6;
    margin-right: 6px;
    user-select: none;
}

.cmd-copy-btn {
    padding: 14px 18px;
    background: var(--surface-secondary);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cmd-copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.small-note {
    font-size: 13px;
}

/* ==========================================================================
   Dialogs & Drawers
   ========================================================================== */

.app-dialog {
    width: min(520px, 94%);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    margin: auto;
}

.app-dialog::backdrop {
    background: rgba(12, 11, 20, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.dialog-header h2,
.dialog-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.close-icon-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
}

.close-icon-btn:hover {
    color: var(--ink);
}

.dialog-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.quick-model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.quick-tag {
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-secondary);
    border: 1px solid var(--line);
    color: var(--ink-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-tag:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-glow);
}

.connection-status-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    font-size: 12px;
}

.connection-status-box p {
    margin: 0;
    color: var(--ink-secondary);
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: var(--surface-secondary);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* History List inside dialog */
.history-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 12px 16px;
    background: var(--surface-secondary);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: var(--line-focus);
    background: var(--surface-hover);
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
}

.history-item-title {
    font-weight: 700;
    color: var(--ink);
}

.history-item-time {
    color: var(--muted);
}

.history-item-preview {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 30px 10px;
}

/* ==========================================================================
   Toast Notifications & Helpers
   ========================================================================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 20px;
    color: white;
    background: #1e1b2e;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
}

[data-theme="dark"] .toast {
    background: #252238;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}

footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    transition: background-color 0.25s ease;
}

.footer-sub {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 32px 0 20px;
    }

    .hero-art {
        display: none;
    }

    .task-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .container {
        width: 92%;
    }

    .task-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: flex-start;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .model-field {
        width: 100%;
    }

    .run-actions button {
        width: 100%;
    }

    .topbar {
        padding: 12px 4%;
    }
}