/* =============================================================================
   Amby Tasks Panel — amby-tasks.css
   Styles scoped to the tasks panel embedded in the chat page.
   Loaded alongside main-chat.css; all selectors prefixed .at-* to prevent
   conflicts. No page-level resets or layout — those come from main-chat.css.
   Fonts: Syne (display) · Figtree (ui) · JetBrains Mono (technical)
   Created: 2026-03-15
   ============================================================================= */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
    --at-bg:              #ece9e2;
    --at-bg-alt:          #f0ede6;
    --at-surface:         #f8f5f0;
    --at-white:           #ffffff;
    --at-border:          #d8d3c8;
    --at-border-strong:   #b0ab9f;

    --at-text-1:          #1c1914;
    --at-text-2:          #5c5750;
    --at-text-3:          #9a9488;

    --at-accent:          #2d5f84;
    --at-accent-hover:    #245070;
    --at-accent-subtle:   rgba(45, 95, 132, 0.09);
    --at-accent-text:     #1d3e58;

    --at-green:           #2a7048;
    --at-green-bg:        #eaf4ee;
    --at-green-border:    rgba(42, 112, 72, 0.2);

    --at-amber:           #b86800;
    --at-amber-bg:        #fff4dc;
    --at-amber-border:    rgba(184, 104, 0, 0.2);

    --at-red:             #c0392b;
    --at-red-bg:          #fdecea;
    --at-red-border:      rgba(192, 57, 43, 0.2);

    --at-purple:          #6b4fa0;
    --at-purple-bg:       #f2eef9;
    --at-purple-border:   rgba(107, 79, 160, 0.2);

    --at-blue:            #0077b6;
    --at-blue-bg:         #e6f3fb;
    --at-blue-border:     rgba(0, 119, 182, 0.2);

    --at-sidebar-w:       310px;
    --at-r:               8px;
    --at-r-lg:            12px;
    --at-shadow-sm:       0 1px 3px rgba(28,25,20,0.08), 0 1px 2px rgba(28,25,20,0.05);
    --at-shadow-md:       0 4px 16px rgba(28,25,20,0.09), 0 2px 4px rgba(28,25,20,0.05);
    --at-t:               0.2s ease;

    --at-font-ui:         'Figtree', system-ui, sans-serif;
    --at-font-display:    'Syne', system-ui, sans-serif;
    --at-font-mono:       'JetBrains Mono', 'SFMono-Regular', monospace;
}

/* Dark theme overrides */
body.dark-theme {
    --at-bg:            #1a1a1a;
    --at-bg-alt:        #1e1e1e;
    --at-surface:       #242424;
    --at-white:         #2a2a2a;
    --at-border:        #3a3a3a;
    --at-border-strong: #555;
    --at-text-1:        #f0f0f0;
    --at-text-2:        #b0b0b0;
    --at-text-3:        #707070;
    --at-accent:        #71a4df;
    --at-accent-hover:  #5a90cc;
    --at-accent-subtle: rgba(113, 164, 223, 0.1);
    --at-accent-text:   #c8dff0;
}

/* ── Tasks panel layout ────────────────────────────────────────────────────── */
/* .at-sidebar lives inside the main .sidebar — override standalone sizing */
.at-sidebar {
    width: 100%;         /* fill the parent .sidebar column */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: transparent; /* inherit sidebar background */
    border-right: none;      /* sidebar already has its border */
    overflow: hidden;
    transition: none;
    flex: 1;
    min-height: 0;
}

.at-sidebar-header { padding: 14px 14px 10px; border-bottom: 1px solid var(--at-border); flex-shrink: 0; }

.at-search-wrap { position: relative; margin-bottom: 10px; }
.at-search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--at-text-3); font-size: 11px; pointer-events: none; }
.at-search {
    width: 100%; padding: 8px 10px 8px 28px;
    border: 1px solid var(--at-border); border-radius: 7px;
    background: var(--at-white); font-family: var(--at-font-ui);
    font-size: 13px; color: var(--at-text-1); outline: none;
    transition: border-color var(--at-t), box-shadow var(--at-t);
}
.at-search:focus { border-color: var(--at-accent); box-shadow: 0 0 0 3px var(--at-accent-subtle); }
.at-search::placeholder { color: var(--at-text-3); }

.at-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.at-filter {
    font-family: var(--at-font-ui); font-size: 11px; font-weight: 500;
    padding: 4px 10px; border-radius: 20px;
    border: 1px solid var(--at-border); background: var(--at-white);
    color: var(--at-text-2); cursor: pointer; transition: all var(--at-t);
}
.at-filter:hover { border-color: var(--at-accent); color: var(--at-accent); }
.at-filter.at-filter--active { background: var(--at-accent); border-color: var(--at-accent); color: #fff; }

.at-task-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.at-task-list::-webkit-scrollbar { width: 4px; }
.at-task-list::-webkit-scrollbar-thumb { background: var(--at-border-strong); border-radius: 2px; }

/* ── Task Cards ────────────────────────────────────────────────────────────── */
.at-card {
    margin: 2px 8px; padding: 11px 12px 10px 13px;
    border-radius: var(--at-r); border: 1px solid transparent;
    cursor: pointer; transition: all var(--at-t);
    border-left-width: 3px; border-left-style: solid; border-left-color: transparent;
    opacity: 0; animation: at-card-in 0.22s ease forwards;
}
.at-card:hover { 
    background: var(--at-white); 
    border-color: var(--at-border); 
    box-shadow: var(--at-shadow-sm); 
}

.at-card.at-card--active {
    background: var(--at-white); 
    border-color: var(--at-border);
    border-left-color: var(--at-accent) !important; 
    box-shadow: var(--at-shadow-md);
}

.at-card--ok    { border-left-color: var(--at-green); }
.at-card--fail  { border-left-color: var(--at-red); }
.at-card--pause { border-left-color: var(--at-border-strong); }
.at-card--run   { border-left-color: var(--at-blue); }
.at-card--new   { border-left-color: var(--at-amber); }

.at-card-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 5px; }
.at-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; margin-top: 4px;
}
.at-dot--active  { background: var(--at-green); }
.at-dot--paused  { background: var(--at-text-3); }
.at-dot--failed  { background: var(--at-red); }
.at-dot--new     { background: var(--at-amber); }
.at-dot--running { background: var(--at-blue); animation: at-pulse 1.5s ease-in-out infinite; }

.at-card-name { font-family: var(--at-font-display); font-size: 13.5px; font-weight: 600; color: var(--at-text-1); line-height: 1.3; flex: 1; }
.at-card-run  { font-family: var(--at-font-mono); font-size: 11px; color: var(--at-text-3); flex-shrink: 0; margin-top: 2px; }
.at-card-run.ok   { color: var(--at-green); }
.at-card-run.fail { color: var(--at-red); }

.at-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-left: 16px; }

/* ── Chips ─────────────────────────────────────────────────────────────────── */
.at-chip {
    font-family: var(--at-font-ui); font-size: 10.5px; font-weight: 500;
    padding: 2px 7px; border-radius: 4px; line-height: 1.5; white-space: nowrap;
}
.at-chip--cron   { background: var(--at-accent-subtle); color: var(--at-accent-text); }
.at-chip--manual { background: rgba(92,87,80,0.09); color: var(--at-text-2); }
.at-chip--event  { background: var(--at-purple-bg); color: var(--at-purple); }
.at-chip--agent  { background: rgba(26,39,51,0.07); color: #334e64; }
.at-chip--active { background: var(--at-green-bg); color: var(--at-green); }
.at-chip--paused { background: rgba(154,148,136,0.14); color: var(--at-text-3); font-style: italic; }
.at-chip--run    { background: var(--at-blue-bg); color: var(--at-blue); }
.at-chip--skill  { background: var(--at-amber-bg); color: var(--at-amber); }

/* ── Detail Panel ──────────────────────────────────────────────────────────── */
.at-detail {
    flex: 1; overflow-y: auto;
    background: var(--at-bg-alt); display: flex; flex-direction: column;
}
.at-detail::-webkit-scrollbar { width: 5px; }
.at-detail::-webkit-scrollbar-thumb { background: var(--at-border-strong); border-radius: 3px; }

/* Empty state */
.at-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px; text-align: center; gap: 14px;
}
.at-empty-icon {
    width: 88px; height: 88px; background: var(--at-white);
    border-radius: 22px; display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: var(--at-text-3); box-shadow: var(--at-shadow-sm);
    animation: at-float 4s ease-in-out infinite;
}
.at-empty h3 { font-family: var(--at-font-display); font-size: 24px; font-weight: 700; color: var(--at-text-1); }
.at-empty p  { font-size: 15px; color: var(--at-text-3); max-width: 320px; line-height: 1.65; }

/* Task detail view */
.at-view { display: none; flex-direction: column; flex: 1; }
.at-view.at-view--on { display: flex; animation: at-fade-in 0.2s ease; }

.at-view-header {
    padding: 22px 28px 18px; border-bottom: 1px solid var(--at-border);
    background: var(--at-white); flex-shrink: 0;
}
.at-view-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.at-view-title { font-family: var(--at-font-display); font-size: 22px; font-weight: 700; color: var(--at-text-1); line-height: 1.2; }
.at-view-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; }
.at-view-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Buttons */
.at-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 7px; font-family: var(--at-font-ui);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all var(--at-t); border: none; outline: none; white-space: nowrap;
}
.at-btn--ghost { background: var(--at-surface); border: 1px solid var(--at-border); color: var(--at-text-2); }
.at-btn--ghost:hover { background: var(--at-white); border-color: var(--at-border-strong); color: var(--at-text-1); }
.at-btn--run {
    background: #1a2733; color: #ddd7cc; font-weight: 600;
    box-shadow: 0 2px 8px rgba(26,39,51,0.28);
}
.at-btn--run:hover { background: #253647; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,39,51,0.34); }
.at-btn--run:active { transform: none; }
.at-btn--run.running { background: var(--at-blue); animation: at-btn-glow 1.6s ease-in-out infinite; }
.at-btn--primary { background: var(--at-accent); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(45,95,132,0.35); }
.at-btn--primary:hover { background: var(--at-accent-hover); transform: translateY(-1px); }
.at-btn--primary:active { transform: none; }
.at-btn--danger { background: var(--at-red-bg); border: 1px solid var(--at-red-border); color: var(--at-red); }
.at-btn--danger:hover { background: var(--at-red); color: #fff; border-color: var(--at-red); }

/* Info grid */
.at-info-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 1px; background: var(--at-border);
    border: 1px solid var(--at-border); border-radius: var(--at-r);
    overflow: hidden; margin: 20px 28px; flex-shrink: 0;
}

.at-info-cell { 
    background: var(--at-white); 
    padding: 14px 18px; 
}

.at-info-label { 
    font-size: 10px; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.07em; 
    color: var(--at-text-3); 
    margin-bottom: 5px; 
}

.at-info-value { 
    font-family: var(--at-font-mono); 
    font-size: 13px; 
    color: var(--at-text-1); 
    font-weight: 500; 
}

.at-info-hint  { 
    font-size: 11px; 
    color: var(--at-text-3); 
    margin-top: 3px; 
    font-family: var(--at-font-ui); 
}

/* Sections */
.at-section { 
    margin: 0 28px 20px; 
    flex-shrink: 0; 
}

.at-section-label { 
    font-size: 10px; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.07em; 
    color: var(--at-text-3); 
    margin-bottom: 8px; 
}

.at-params-block {
    background: var(--at-white); 
    border: 1px solid var(--at-border);
    border-radius: var(--at-r); 
    padding: 12px 16px;
    font-family: var(--at-font-mono); 
    font-size: 12.5px; 
    color: var(--at-accent-text);
    white-space: pre; 
    line-height: 1.65; 
    overflow-x: auto;
    text-wrap: auto;
}

/* History table */
.at-history { margin: 0 28px 32px; }
.at-history-table {
    width: 100%; border-collapse: collapse;
    border: 1px solid var(--at-border); border-radius: var(--at-r); overflow: hidden;
}
.at-history-table thead th {
    background: var(--at-surface); padding: 9px 14px; text-align: left;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--at-text-3);
    border-bottom: 1px solid var(--at-border);
}
.at-history-table tbody tr { background: var(--at-white); transition: background var(--at-t); }
.at-history-table tbody tr:hover { background: var(--at-surface); }
.at-history-table tbody tr + tr { border-top: 1px solid var(--at-border); }
.at-history-table tbody td { padding: 10px 14px; font-size: 12.5px; color: var(--at-text-1); }
.at-history-table td.mono { font-family: var(--at-font-mono); font-size: 12px; color: var(--at-text-2); }

.at-run-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.at-run-badge.ok   { background: var(--at-green-bg); color: var(--at-green); }
.at-run-badge.fail { background: var(--at-red-bg); color: var(--at-red); }

.at-chat-link {
    font-size: 12px; color: var(--at-accent); text-decoration: none;
    font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
    transition: color var(--at-t);
}
.at-chat-link:hover { color: var(--at-accent-hover); }

/* ── Form ──────────────────────────────────────────────────────────────────── */
.at-form { display: none; flex-direction: column; flex: 1; }
.at-form.at-form--on { display: flex; animation: at-fade-in 0.2s ease; }

.at-form-header {
    padding: 20px 28px 16px; border-bottom: 1px solid var(--at-border);
    background: var(--at-white); display: flex; align-items: center;
    justify-content: space-between; flex-shrink: 0;
}
.at-form-title { font-family: var(--at-font-display); font-size: 18px; font-weight: 700; color: var(--at-text-1); }
.at-form-close {
    width: 30px; height: 30px; border-radius: 6px;
    background: none; border: 1px solid var(--at-border); color: var(--at-text-2);
    cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center;
    transition: all var(--at-t);
}
.at-form-close:hover { background: var(--at-red-bg); border-color: var(--at-red-border); color: var(--at-red); }

.at-form-body { flex: 1; overflow-y: auto; padding: 24px 28px 32px; }
.at-form-body::-webkit-scrollbar { width: 5px; }
.at-form-body::-webkit-scrollbar-thumb { background: var(--at-border-strong); border-radius: 3px; }

.at-field { margin-bottom: 20px; }
.at-field-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--at-text-2); margin-bottom: 6px; }
.at-field-hint { font-size: 11px; color: var(--at-text-3); margin-bottom: 6px; margin-top: -3px; }

.at-input, .at-select, .at-textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--at-border); border-radius: var(--at-r);
    background: var(--at-white); font-family: var(--at-font-ui);
    font-size: 13.5px; color: var(--at-text-1); outline: none;
    transition: border-color var(--at-t), box-shadow var(--at-t); appearance: none;
}
.at-input:focus, .at-select:focus, .at-textarea:focus { border-color: var(--at-accent); box-shadow: 0 0 0 3px var(--at-accent-subtle); }
.at-input::placeholder, .at-textarea::placeholder { color: var(--at-text-3); }
.at-textarea { resize: vertical; min-height: 90px; font-family: var(--at-font-mono); font-size: 12.5px; line-height: 1.65; }
.at-input.mono { font-family: var(--at-font-mono); letter-spacing: 0.04em; }

.at-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.at-sched-tabs { display: flex; border: 1px solid var(--at-border); border-radius: var(--at-r); overflow: hidden; background: var(--at-surface); }
.at-sched-tab {
    flex: 1; padding: 8px 10px; background: none; border: none;
    font-family: var(--at-font-ui); font-size: 13px; font-weight: 500;
    color: var(--at-text-2); cursor: pointer; transition: all var(--at-t);
    border-right: 1px solid var(--at-border);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.at-sched-tab:last-child { border-right: none; }
.at-sched-tab:hover { background: var(--at-white); color: var(--at-text-1); }
.at-sched-tab.on { background: var(--at-accent); color: #fff; }

.at-cron-row { display: flex; gap: 10px; align-items: flex-start; }
.at-cron-hint {
    padding: 9px 13px; background: var(--at-green-bg);
    border: 1px solid var(--at-green-border); border-radius: var(--at-r);
    font-size: 12px; color: var(--at-green); flex-shrink: 0;
    white-space: nowrap; display: flex; align-items: center; gap: 5px;
}
.at-cron-hint.error { background: var(--at-red-bg); border-color: var(--at-red-border); color: var(--at-red); }

.at-form-footer {
    padding: 14px 28px; border-top: 1px solid var(--at-border);
    background: var(--at-white); display: flex; justify-content: space-between;
    align-items: center; flex-shrink: 0; gap: 10px;
}
.at-form-footer-right { display: flex; gap: 8px; }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes at-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,119,182,0.45); }
    50%       { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(0,119,182,0); }
}
@keyframes at-btn-glow { 50% { box-shadow: 0 0 0 6px rgba(0,119,182,0.18); } }
@keyframes at-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-9px); }
}
@keyframes at-fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes at-card-in { from { opacity: 0; transform: translateX(-7px); } to { opacity: 1; transform: none; } }

/* ── Agent combobox ──────────────────────────────────────────────────────── */
.at-agent-combo { position: relative; }
.at-agent-dropdown {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
    background: var(--at-white); border: 1px solid var(--at-border);
    border-top: none; border-radius: 0 0 var(--at-r) var(--at-r);
    max-height: 220px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.10);
}
.at-agent-opt {
    padding: 9px 13px; font-size: 13px; cursor: pointer; color: var(--at-text-1);
}
.at-agent-opt:hover { background: var(--at-hover); }
.at-agent-opt[data-val=""] { color: var(--at-text-2); font-style: italic; }

/* ── Cron builder ────────────────────────────────────────────────────────── */
.at-cron-presets {
    display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px;
}
.at-cron-preset {
    padding: 6px 13px; border-radius: 20px; border: 1px solid var(--at-border);
    background: var(--at-surface); font-size: 12px; cursor: pointer;
    color: var(--at-text-2); transition: all .15s;
}
.at-cron-preset:hover { background: var(--at-hover); color: var(--at-text-1); }
.at-cron-preset.active {
    background: var(--at-accent); color: #fff; border-color: var(--at-accent);
}
.at-cron-time-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.at-cron-hint { font-size: 12px; color: var(--at-green); }

/* ── Advanced settings accordion ─────────────────────────────────────────── */
.at-advanced { 
    margin-top: 6px; 
    border: 1px solid var(--at-border); 
    border-radius: var(--at-r); 
}

.at-advanced-toggle {
    padding: 10px 14px; 
    font-size: 13px; 
    font-weight: 500; 
    cursor: pointer;
    color: var(--at-text-2); 
    user-select: none; 
    list-style: none;
    display: flex; 
    align-items: center; 
    gap: 7px;
}

.at-advanced-toggle:hover { 
    color: var(--at-text-1); 
}

.at-advanced-toggle::marker, .at-advanced-toggle::-webkit-details-marker {
     display: none; 
}

.at-advanced[open] .at-advanced-toggle { 
    border-bottom: 1px solid var(--at-border); 
}

.at-advanced-body { 
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    gap: 18px; 
}

.at-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 15px 0 20px;
    cursor: pointer;
    color: var(--at-text-2);
    border-top: 1px solid #9b9b9b;
    background: var(--at-accent-subtle);
    padding: 15px 0 20px;
}

.at-checkbox-row input { margin-top: 3px; }
.at-checkbox-row span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.at-checkbox-row small {
    color: var(--at-text-3);
    font-size: 12px;
    line-height: 1.45;
}

/* ── Body-appended agent dropdown (same visual as admin PD panel) ──────────── */
.at-agent-body-dropdown {
    position: fixed; z-index: 9999;
    background: var(--at-white, #fff);
    border: 1px solid var(--at-border, #dde1e7);
    border-radius: var(--at-r, 8px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 280px; overflow-y: auto;
    font-size: 13px;
}
.at-agent-group-title {
    pointer-events: none;
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--at-text-2, #6b7280);
    pointer-events: none;
    border-top: 1px dotted var(--at-text-2);
    background: #f6f6f6;
    border-bottom: 1px dotted var(--at-text-2);
}
.at-agent-item {
    padding: 9px 14px; 
    cursor: pointer; 
    color: var(--at-text-1, #111827);
    display: list-item;
    list-style: inside;
}
.at-agent-item:hover { 
    background: var(--at-hover, #f3f4f6); 
}

.at-agent-item--blank {
    color: var(--at-text-2, #6b7280);
    font-style: italic;
}

/* ── Task Instructions — markdown preview in detail view ───────────────────── */
.at-params-block .at-prompt-preview {
    font-size: 13px;
    line-height: 1.65;
    color: var(--at-text-1);
    padding: 2px 0 8px;
    word-break: break-word;
}
.at-params-block .at-prompt-preview p      { margin: 0 0 8px; }
.at-params-block .at-prompt-preview ul,
.at-params-block .at-prompt-preview ol    { margin: 0 0 8px; padding-left: 20px; }
.at-params-block .at-prompt-preview li     { margin-bottom: 3px; }
.at-params-block .at-prompt-preview h1,
.at-params-block .at-prompt-preview h2,
.at-params-block .at-prompt-preview h3    { font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
.at-params-block .at-prompt-preview strong { font-weight: 600; }
.at-params-block .at-prompt-preview em     { font-style: italic; }
.at-params-block .at-prompt-preview code  {
    background: var(--at-bg-alt);
    border: 1px solid var(--at-border);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.at-params-block .at-params-extra {
    margin-top: 10px;
    background: var(--at-bg-alt);
    border: 1px solid var(--at-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.at-params-block .at-params-empty {
    color: var(--at-text-3);
    font-style: italic;
    font-size: 13px;
}

/* ── SimpleMDE overrides — scoped to the task form ─────────────────────────── */
#at-form .CodeMirror {
    font-family: 'Figtree', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    border: 1px solid var(--at-border);
    border-radius: 6px;
    background: var(--at-white);
    min-height: 120px;
}

#at-form .CodeMirror-scroll {
    max-height: 600px;
}

#at-form .CodeMirror-focused {
    border-color: var(--at-accent);
    box-shadow: 0 0 0 3px var(--at-accent-subtle);
}
#at-form .editor-toolbar {
    border: 1px solid var(--at-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: var(--at-bg-alt);
    opacity: 1;
}
#at-form .editor-toolbar button {
    color: var(--at-text-2) !important;
}
#at-form .editor-toolbar button:hover,
#at-form .editor-toolbar button.active {
    background: var(--at-accent-subtle);
    color: var(--at-accent) !important;
    border-color: var(--at-border);
}
#at-form .editor-toolbar.disabled-for-preview button:not(.no-disable) {
    opacity: 0.4;
}
#at-form .editor-preview {
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    font-size: 13px;
    line-height: 1.65;
    color: var(--at-text-1);
}
/* Dark mode */
.dark-mode #at-form .CodeMirror {
    background: #1e1e1e;
    color: #d4d4d4;
    border-color: #3e3e3e;
}
.dark-mode #at-form .editor-toolbar {
    background: #252525;
    border-color: #3e3e3e;
}
.dark-mode #at-form .editor-toolbar button { color: #aaa !important; }
.dark-mode #at-form .editor-preview {
    background: #1e1e1e;
    color: #d4d4d4;
    border-color: #3e3e3e;
}
