/**
 * daily-brief.css — Daily Brief on Home (js/daily-brief.js, DAILY_BRIEF_PLAN.md)
 * VERSION: 1.0.0 — 2026-12-01
 *
 * Lives inside .hm-container, so it reuses Home's tokens (--hm-ink, --hm-muted,
 * --hm-line, --hm-soft, --hm-accent-ink/-fill) and therefore follows Home's
 * light / dark handling. Phone width: the face stacks above the controls.
 */

.db-card { gap: 12px; }
.db-top { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; align-items: start; }

.db-face {
    position: relative; width: 148px; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
    background: var(--hm-soft); display: grid; place-items: center;
}
.db-face .db-photo { width: 100%; height: 100%; object-fit: cover; }
.db-face .db-initials { font-size: 2.4rem; font-weight: 700; color: var(--hm-accent-ink); }
.db-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; background: #000; }
.db-is-video .db-video.is-live { opacity: 1; }

.db-body { display: grid; gap: 8px; min-width: 0; }
.db-eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--hm-accent-ink); font-weight: 700; }
.db-title { margin: 0; font-size: 1.25rem; color: var(--hm-ink); }
.db-sub { margin: 0; color: var(--hm-muted); font-size: 0.92rem; }
.db-disclosure { font-size: 0.8rem; color: var(--hm-muted); display: inline-flex; align-items: center; gap: 6px; }
.db-disclosure::before { content: 'AI'; font-size: 0.62rem; font-weight: 800; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--hm-line); color: var(--hm-muted); }

.db-controls { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.db-play {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0;
    background: var(--hm-accent-fill); color: #fff; font-size: 1rem; display: grid; place-items: center;
}
.db-play:disabled { opacity: .7; cursor: progress; }
.db-progress { flex: 1; height: 6px; border-radius: 3px; background: var(--hm-line); cursor: pointer; overflow: hidden; }
.db-progress > span { display: block; height: 100%; width: 0; background: var(--hm-accent-fill); border-radius: 3px; transition: width .1s linear; }
.db-progress:focus-visible { outline: 3px solid var(--hm-accent-fill); outline-offset: 3px; }
.db-time { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--hm-muted); white-space: nowrap; }

.db-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.db-tool {
    border: 1px solid var(--hm-line); background: transparent; color: var(--hm-ink);
    border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; font-weight: 600;
}
.db-tool.primary { background: var(--hm-accent-fill); border-color: transparent; color: #fff; }
.db-tool[aria-pressed="false"] { color: var(--hm-muted); }
.db-tool:disabled { opacity: .6; }
.db-status { font-size: 0.82rem; color: var(--hm-muted); }

.db-chapters { display: flex; flex-wrap: wrap; gap: 6px; }
.db-chip {
    border: 1px solid var(--hm-line); background: var(--bg-card, #fff); color: var(--hm-ink);
    border-radius: 8px; padding: 3px 10px; font-size: 0.8rem;
}
.db-chip.on { background: var(--hm-soft); border-color: var(--hm-accent-fill); color: var(--hm-accent-ink); font-weight: 600; }

.db-today { justify-self: start; color: var(--hm-accent-ink); font-weight: 600; font-size: 0.92rem; text-decoration: none; }
.db-today:hover { text-decoration: underline; }

.db-transcript summary { cursor: pointer; color: var(--hm-accent-ink); font-weight: 600; font-size: 0.9rem; }
.db-transcript p { margin: 8px 0 0; font-size: 0.92rem; line-height: 1.55; color: var(--hm-ink); }

.db-chat-box { display: grid; gap: 10px; margin-top: 8px; border-top: 1px solid var(--hm-line); padding-top: 12px; }
.db-chat-box[hidden] { display: none; }
.db-chat-head { font-size: 0.82rem; color: var(--hm-muted); }
.db-ai { font-weight: 700; }
.db-thread { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.db-msg { display: grid; justify-items: start; }
.db-msg.me { justify-items: end; }
.db-bubble { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--hm-soft); color: var(--hm-ink); }
.db-msg.me .db-bubble { background: var(--hm-accent-fill); color: #fff; }
.db-routed { font-size: 0.75rem; color: var(--hm-muted); margin-top: 2px; }
.db-ask { display: flex; gap: 8px; }
.db-ask input {
    flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border-radius: 8px;
    border: 1px solid var(--border-secondary, #cbd5e1); background: var(--bg-input, #fff); color: var(--hm-ink);
}

/* ── Manager queue ── */
.db-auto { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--hm-ink); }
.db-auto small { grid-column: 2; font-weight: 400; color: var(--hm-muted); font-size: 0.78rem; }
.db-banner { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--hm-soft); font-size: 0.88rem; color: var(--hm-ink); }
.db-qgroup { display: grid; gap: 8px; }
.db-qgroup + .db-qgroup { border-top: 1px solid var(--hm-line); padding-top: 14px; }
.db-qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-qhead h3 { margin: 0; font-size: 1rem; color: var(--hm-ink); }
.db-qhead small { color: var(--hm-muted); font-size: 0.85rem; flex: 1; }
.db-note { display: grid; gap: 6px; font-size: 0.85rem; color: var(--hm-muted); }
.db-note textarea, .db-modal textarea {
    font: inherit; font-size: 0.92rem; padding: 8px 10px; border-radius: 8px; resize: vertical;
    border: 1px solid var(--border-secondary, #cbd5e1); background: var(--bg-input, #fff); color: var(--hm-ink);
}
.db-note .db-tool { justify-self: start; }
.db-qrow { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--hm-line); }
.db-qmain { display: grid; gap: 4px; min-width: 0; }
.db-qname { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--hm-ink); }
.db-qname .hm-pill { margin-top: 0; }
.db-qsum { color: var(--hm-muted); font-size: 0.88rem; }
.db-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.db-flag { font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--hm-warn) 18%, transparent); color: color-mix(in srgb, var(--hm-warn) 60%, var(--hm-ink)); }
.db-qq { font-size: 0.85rem; color: var(--hm-ink); display: grid; gap: 2px; }
.db-qact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; max-width: 50%; }

.db-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px; z-index: 1000; }
.db-modal {
    background: var(--bg-card, #fff); color: var(--text-primary, #1e293b); border-radius: 16px;
    width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; display: grid; gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.db-modal h3 { margin: 0; }
.db-modal .hm-field { display: grid; gap: 6px; font-size: 0.9rem; }
.db-modal .hm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.db-modal .hm-btn { border-radius: 10px; padding: 9px 18px; font-weight: 600; border: 1px solid var(--border-primary, #e2e8f0); background: transparent; color: inherit; cursor: pointer; }
.db-modal .hm-btn.primary { background: var(--brand-primary, #0EA5E9); border-color: transparent; color: #fff; }

@media (max-width: 640px) {
    .db-top { grid-template-columns: 1fr; }
    .db-face { width: 100%; max-width: 180px; justify-self: center; }
    .db-qrow { flex-direction: column; }
    .db-qact { max-width: none; justify-content: flex-start; }
    .db-ask { flex-direction: column; }
}
