/* Agent Dialogs (Story 6858, Felix Echo). House-only reading page for Felix <-> agent threads. */

:root {
    --ad-accent: #2f2a52;
    --ad-turn:   #B54708;   /* your turn */
    --ad-active: #0A66C2;
    --ad-done:   #1a7f37;   /* resolved -- color, never strike-through */
    --ad-chip:   #EEF0F6;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--picasso-text);
    background: #F3F4F8;
}

/* Left-justified / full-width (Story 6859, Tony: "left justified and/or go across, not centered"). */
.ad-shell { max-width: none; margin: 0; padding: 0 16px 48px; }

.ad-top { padding-top: 6px; }
.lw-nav { min-height: 0; }
.ad-crumbs { font-size: 13px; margin: 8px 0 2px; }
.ad-crumbs a { color: var(--picasso-link); text-decoration: none; }
.ad-title { font-size: 26px; margin: 2px 0 10px; }

.ad-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ad-stat {
    background: #fff; border: 1px solid var(--picasso-border); border-radius: 10px;
    padding: 8px 14px; min-width: 96px; text-align: center;
}
.ad-stat .n { display: block; font-size: 22px; font-weight: 700; }
.ad-stat .l { display: block; font-size: 12px; color: var(--picasso-text-muted); }
.ad-stat-turn .n { color: var(--ad-turn); }

.ad-toolbar {
    position: sticky; top: 0; z-index: 5; background: #F3F4F8;
    display: flex; align-items: center; gap: 8px; padding: 8px 0;
    border-bottom: 1px solid var(--picasso-border);
}
.ad-summary {
    flex: 1 1 auto; text-align: left; border: none; background: transparent;
    font-size: 14px; color: var(--picasso-text-muted); cursor: pointer; padding: 4px 2px;
}
.ad-btn {
    border: 1px solid var(--picasso-border); background: #fff; color: var(--picasso-text);
    border-radius: 8px; padding: 7px 12px; font-size: 14px; cursor: pointer;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.ad-btn:hover { background: var(--picasso-row-hover); }
.ad-btn.primary { background: var(--ad-accent); color: #fff; border-color: var(--ad-accent); }
.ad-btn.tiny { padding: 5px 9px; font-size: 13px; }
.ad-btn .ic { font-size: 15px; }

.ad-options { display: none; padding: 10px 0 4px; border-bottom: 1px solid var(--picasso-border); }
.ad-options.open { display: block; }
.ad-filterrow { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.ad-fld { display: flex; flex-direction: column; gap: 4px; }
.ad-fld .lbl { font-size: 12px; color: var(--picasso-text-muted); }
.ad-search {
    width: 100%; max-width: 420px; padding: 9px 12px; font-size: 15px;
    border: 1px solid var(--picasso-border); border-radius: 8px;
}
.ad-seg { display: inline-flex; border: 1px solid var(--picasso-border); border-radius: 8px; overflow: hidden; }
.ad-seg button {
    border: none; background: #fff; padding: 7px 11px; font-size: 13px; cursor: pointer;
    border-right: 1px solid var(--picasso-border);
}
.ad-seg button:last-child { border-right: none; }
.ad-seg button.active { background: var(--ad-accent); color: #fff; }

.ad-list { margin-top: 12px; }
.ad-loading { color: var(--picasso-text-muted); padding: 20px 4px; }

.ad-group { margin-bottom: 14px; }
.ad-group-head {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 8px 10px; background: #fff; border: 1px solid var(--picasso-border);
    border-radius: 10px; font-weight: 600;
}
.ad-group-head .fold { font-size: 13px; color: var(--picasso-text-muted); width: 14px; }
.ad-group-head .cnt { margin-left: auto; font-size: 13px; color: var(--picasso-text-muted); font-weight: 400; }
.ad-group.folded .ad-group-body { display: none; }
.ad-group-body { padding: 8px 0 0; }

.ad-card {
    background: #fff; border: 1px solid var(--picasso-border); border-left: 4px solid var(--picasso-border);
    border-radius: 10px; padding: 10px 12px; margin: 8px 0;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ad-card.turn { border-left-color: var(--ad-turn); }
.ad-card.active { border-left-color: var(--ad-active); }
.ad-card.done { border-left-color: var(--ad-done); }
.ad-card .ad-cardmain { flex: 1 1 260px; min-width: 200px; }
.ad-card .ad-cardtitle { font-size: 15px; font-weight: 600; }
.ad-card .ad-cardmeta { font-size: 12px; color: var(--picasso-text-muted); margin-top: 3px; }
.ad-card .ad-cardbtns { display: flex; gap: 6px; }

.ad-chip {
    display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: var(--ad-chip); color: #333; margin-right: 6px; white-space: nowrap;
}
.ad-chip.turn { background: #FDEAD7; color: var(--ad-turn); font-weight: 600; }
.ad-chip.active { background: #E3EEFB; color: var(--ad-active); }
.ad-chip.done { background: #E3F3E7; color: var(--ad-done); }
.ad-chip.agent { background: #EDE9F6; color: var(--ad-accent); }

.ad-statusbar { margin-top: 18px; font-size: 12px; color: var(--picasso-text-muted); }

/* Sepia read view -- colors from the Leonardo Reader's sepia theme */
.ad-overlay { position: fixed; inset: 0; background: rgba(20,16,10,.5); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; z-index: 50; overflow: auto; }
.ad-overlay[hidden] { display: none; }
.ad-sepia { position: relative; width: 100%; max-width: 760px; background: #f4ecd8; color: #3a3226; border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.35); padding: 20px 22px 16px; }
.ad-sheet-x { position: absolute; top: 10px; right: 12px; border: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: #6b5d45; }
.ad-sepia-sub { font-size: 12px; color: #8a7a5c; }
.ad-sepia-title { margin: 2px 0 4px; font-size: 21px; }
.ad-sepia-meta { font-size: 12px; color: #8a7a5c; margin-bottom: 10px; }
.ad-sepia-body { border-top: 1px solid #d9ccae; padding-top: 10px; }
.ad-msg { padding: 10px 0; border-bottom: 1px solid #e3d8bd; }
.ad-msg:last-child { border-bottom: none; }
.ad-msg-head { font-size: 12px; color: #7a6a4c; margin-bottom: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.ad-msg-who { font-weight: 700; color: #4a3f2c; }
.ad-msg-body { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.5; }
.ad-sepia-foot { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #d9ccae; margin-top: 10px; padding-top: 10px; }
.ad-redacted { font-style: italic; color: #9a3b2c; }
.ad-redactbtn { margin-left: auto; border: 1px solid #d9ccae; background: #efe6cf; color: #7a3b2c; border-radius: 6px; font-size: 11px; padding: 1px 7px; cursor: pointer; }
.ad-redactbtn:hover { background: #e7d9b8; }

@media (max-width: 520px) {
    .ad-filterrow { gap: 10px; }
    .ad-seg button { padding: 7px 9px; }
    .ad-card { align-items: flex-start; }
}
