/* PLAN48: task detail "Agent note" section + card/row indicator. Matches .td-recurrence-section. */
.td-agent-note {
    position: relative;
    padding: .75rem .9rem;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    background: #f8fafc;
}
.td-agent-note-header { display: flex; align-items: center; gap: .6rem; min-height: 1.5rem; }
.td-agent-note-title { display: inline-flex; align-items: center; gap: .45rem; color: #475569; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.td-agent-note-title i { color: #7c3aed; font-size: 1rem; }
.td-agent-note-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; color: #94a3b8; font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }
.td-agent-note-actions { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; }
.td-agent-note-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border: 0; border-radius: .4rem; color: #64748b; background: transparent; cursor: pointer; }
.td-agent-note-icon-btn:hover { color: #1e293b; background: #e2e8f0; }
.td-agent-note-mode-btn,
.td-agent-note-text-btn { border: 0; padding: 0; background: transparent; color: #2563eb; cursor: pointer; font-size: .78rem; font-weight: 600; }
.td-agent-note-mode-btn:hover,
.td-agent-note-text-btn:hover { color: #1d4ed8; text-decoration: underline; }
.td-agent-note .hidden { display: none !important; }

.td-agent-note-empty { margin-top: .45rem; color: #64748b; font-size: .8rem; line-height: 1.45; }
.td-agent-note-empty code { padding: 0 .25rem; border-radius: .25rem; background: #e2e8f0; font-size: .75rem; }
.td-agent-note-empty-actions { display: flex; gap: .5rem; margin-top: .55rem; }
.td-agent-note-empty-actions .btn { display: inline-flex; align-items: center; gap: .3rem; }

.td-agent-note-input {
    display: block;
    width: 100%;
    min-height: 140px;
    margin-top: .5rem;
    padding: .6rem .7rem;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    background: #fff;
    color: #1e293b;
    font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
    resize: vertical;
}
.td-agent-note-input:focus { border-color: #7c3aed; outline: 2px solid #ddd6fe; outline-offset: 0; }
.td-agent-note-edit-bar { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; font-size: .72rem; }
.td-agent-note-edit-bar .td-agent-note-text-btn { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; }
.td-agent-note-hint { color: #94a3b8; }
.td-agent-note-status { margin-left: auto; color: #16a34a; }
.td-agent-note-status.is-error { color: #dc2626; }
.td-agent-note-conflict { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-top: .45rem; padding: .45rem .6rem; border-radius: .45rem; background: #fef3c7; color: #92400e; font-size: .76rem; }

/* Rendered Markdown */
.td-agent-note-preview { margin-top: .45rem; color: #1e293b; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; cursor: text; }
.td-agent-note-preview > :first-child { margin-top: 0; }
.td-agent-note-preview h3, .td-agent-note-preview h4,
.td-agent-note-preview h5, .td-agent-note-preview h6 { margin: .8rem 0 .25rem; color: #0f172a; font-weight: 700; }
.td-agent-note-preview h3 { font-size: .95rem; }
.td-agent-note-preview h4 { font-size: .85rem; }
.td-agent-note-preview h5, .td-agent-note-preview h6 { font-size: .8rem; }
.td-agent-note-preview p { margin: .3rem 0; }
.td-agent-note-preview ul, .td-agent-note-preview ol { margin: .25rem 0; padding-left: 1.2rem; }
.td-agent-note-preview ul { list-style: disc; }
.td-agent-note-preview ol { list-style: decimal; }
.td-agent-note-preview li { margin: .1rem 0; }
.td-agent-note-preview li.agent-note-check { display: flex; gap: .4rem; align-items: flex-start; margin-left: -1.2rem; list-style: none; }
.td-agent-note-preview li.agent-note-check.is-done > span:last-child { color: #94a3b8; text-decoration: line-through; }
.agent-note-checkbox { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: .9rem; height: .9rem; margin-top: .22rem; border: 1.5px solid #94a3b8; border-radius: .2rem; color: #fff; font-size: .6rem; }
.is-done > .agent-note-checkbox { border-color: #16a34a; background: #16a34a; }
.td-agent-note-preview blockquote { margin: .35rem 0; padding-left: .6rem; border-left: 3px solid #cbd5e1; color: #475569; }
.td-agent-note-preview code { padding: 0 .25rem; border-radius: .25rem; background: #e2e8f0; font-size: .76rem; }
.td-agent-note-preview pre { margin: .4rem 0; padding: .5rem .6rem; overflow-x: auto; border-radius: .4rem; background: #0f172a; color: #e2e8f0; font-size: .75rem; }
.td-agent-note-preview pre code { padding: 0; background: transparent; color: inherit; }
.td-agent-note-preview hr { margin: .6rem 0; border: 0; border-top: 1px solid #e2e8f0; }
.td-agent-note-preview a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.td-agent-note-preview a.agent-note-task-ref { padding: 0 .2rem; border-radius: .25rem; background: #ede9fe; color: #6d28d9; text-decoration: none; font-weight: 600; }

/* History popover */
.td-agent-note-history { position: absolute; top: 2.3rem; right: .6rem; z-index: 30; width: min(26rem, calc(100% - 1.2rem)); max-height: 22rem; overflow: auto; padding: .5rem; border: 1px solid #e2e8f0; border-radius: .6rem; background: #fff; box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .15); }
.td-agent-note-history-title { padding: .1rem .3rem .4rem; color: #475569; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.td-agent-note-history-empty { padding: .4rem; color: #64748b; font-size: .78rem; }
.td-agent-note-history-item { padding: .35rem .3rem; border-top: 1px solid #f1f5f9; }
.td-agent-note-history-row { display: flex; align-items: center; gap: .6rem; font-size: .76rem; }
.td-agent-note-history-label { flex: 1 1 auto; min-width: 0; color: #334155; }
.td-agent-note-history-preview { max-height: 12rem; overflow: auto; padding: .4rem .5rem; border-radius: .4rem; background: #f8fafc; }

/* Card / row indicator */
.task-agent-note-indicator { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; flex: 0 0 auto; border: 0; border-radius: .35rem; color: #7c3aed; background: #f5f3ff; cursor: pointer; font-size: .8rem; }
.task-agent-note-indicator:hover, .task-agent-note-indicator:focus-visible { color: #6d28d9; background: #ede9fe; outline: 2px solid #c4b5fd; outline-offset: 1px; }
.board-card .task-agent-note-indicator { width: 1.15rem; height: 1.15rem; font-size: .72rem; }
