/* 기억 비서(웹) — 끝 카드·사람별 기억·회의록·통화 중 상대 정보(recall_*.js).
 *
 * 색은 앱 전체 토큰(base-layout.css — --bg-color·--surface-color·--text-color·--text-muted·--border-color·--primary-color·
 * --input-bg·--sidebar-hover)과 아래 --rc-* 만 쓴다. 다크 모드는 토큰이 바꾼다. 강조 파랑은 codoc·노트와 같은 #2383e2.
 */
:root {
    --rc-accent: #2383e2;
    --rc-accent-soft: rgba(35, 131, 226, 0.1);
    --rc-warn: #b45309;
    --rc-warn-soft: rgba(245, 158, 11, 0.12);
    --rc-ok: #15803d;
    --rc-radius: 12px;
}
html[data-theme="dark"] {
    --rc-accent-soft: rgba(35, 131, 226, 0.22);
    --rc-warn: #fbbf24;
    --rc-warn-soft: rgba(251, 191, 36, 0.14);
    --rc-ok: #4ade80;
}

/* ── 창 ── */
.rc-modal {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
}
.rc-modal__box {
    width: min(560px, 100%);
    max-height: min(86vh, 900px);
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.45);
    overflow: hidden;
}
.rc-modal--wide .rc-modal__box { width: min(880px, 100%); }
.rc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 14px 22px;
    border-bottom: 1px solid var(--border-color);
}
.rc-modal__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.rc-modal__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.rc-modal__close:hover { background: var(--sidebar-hover); color: var(--text-color); }
.rc-modal__body { overflow: auto; padding: 18px 22px 22px; }

/* ── 공용 ── */
.rc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-color);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.rc-btn:hover { background: var(--sidebar-hover); }
.rc-btn:disabled { opacity: 0.45; cursor: default; }
.rc-btn--primary { background: var(--rc-accent); border-color: var(--rc-accent); color: #fff; }
.rc-btn--primary:hover { background: color-mix(in srgb, var(--rc-accent) 88%, #000); }
.rc-btn--sm { padding: 5px 10px; font-size: 12px; }
.rc-linkish { border: 0; padding: 0; background: none; color: var(--rc-accent); font: inherit; cursor: pointer; text-align: left; }
.rc-linkish:hover { text-decoration: underline; }

.rc-cite {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rc-accent-soft);
    color: var(--rc-accent);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 18px;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
}
.rc-cite span { overflow: hidden; text-overflow: ellipsis; }
a.rc-cite:hover { background: color-mix(in srgb, var(--rc-accent) 18%, transparent); }
.rc-cite--static { cursor: default; }
.rc-cite-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 6px; }
.rc-quote { font-size: 12.5px; color: var(--text-muted); quotes: '“' '”'; line-height: 1.5; }

.rc-avatar {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    background: var(--rc-accent-soft);
    color: var(--rc-accent);
    font-size: 12px;
    font-weight: 700;
}
.rc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rc-avatar--lg { width: 52px; height: 52px; font-size: 20px; }

.rc-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; color: var(--text-muted); font-size: 14px; }
.rc-spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid var(--rc-accent-soft);
    border-top-color: var(--rc-accent);
    animation: rc-spin 0.8s linear infinite;
}
@keyframes rc-spin { to { transform: rotate(360deg); } }
.rc-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px 0; color: var(--text-color); }
.rc-empty__title { margin: 0; font-weight: 600; }
.rc-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 100060;
    transform: translate(-50%, 8px);
    max-width: min(440px, 86vw);
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.rc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── 끝 카드 ── */
.rc-hero { padding: 4px 0 14px; }
.rc-hero__eyebrow { margin: 0 0 4px; font-size: 12.5px; color: var(--text-muted); }
.rc-hero__title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.rc-hero__warn { margin: 6px 0 0; color: var(--rc-warn); font-weight: 600; font-size: 13.5px; }
.rc-hero__summary { margin: 10px 0 0; color: var(--text-color); font-size: 14px; line-height: 1.6; }
.rc-section { padding: 14px 0; border-top: 1px solid var(--border-color); }
.rc-section__title { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.rc-section__hint { margin: -4px 0 8px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.rc-count {
    min-width: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    line-height: 18px;
}
.rc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rc-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
}
.rc-item:hover { background: var(--sidebar-hover); }
.rc-item.is-done .rc-item__title { color: var(--text-muted); }
.rc-item__main { flex: 1; min-width: 0; }
.rc-item__title { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.45; }
.rc-item__meta { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.rc-item__dismiss {
    flex: none;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 17px;
    cursor: pointer;
    opacity: 0;
}
.rc-item:hover .rc-item__dismiss,
.rc-item__dismiss:focus-visible { opacity: 1; }
.rc-item__dismiss:hover { background: var(--input-bg); color: var(--text-color); }
@media (hover: none) { .rc-item__dismiss { opacity: 0.7; } }
.rc-check { flex: none; position: relative; width: 20px; height: 20px; margin-top: 1px; }
.rc-check input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.rc-check span {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    background: var(--surface-color);
}
.rc-check input:checked + span { background: var(--rc-accent); border-color: var(--rc-accent); }
.rc-check input:checked + span::after {
    content: '';
    display: block;
    width: 5px;
    height: 10px;
    margin: 2px 0 0 6px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.rc-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--rc-accent-soft); }
.rc-check--none::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    margin: 7px 0 0 7px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.6;
}
.rc-state { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--input-bg); color: var(--text-muted); font-size: 11px; font-weight: 600; vertical-align: middle; }
.rc-state--taken { background: color-mix(in srgb, var(--rc-ok) 14%, transparent); color: var(--rc-ok); }
.rc-section--warn .rc-item { background: var(--rc-warn-soft); }
.rc-warn-dot {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--rc-warn);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
html[data-theme="dark"] .rc-warn-dot { color: #1c1917; }
.rc-compare { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.rc-compare b { color: var(--text-color); font-weight: 600; margin-right: 2px; }
.rc-draft { margin-top: 8px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--input-bg); }
.rc-draft summary { display: flex; align-items: center; gap: 6px; padding: 7px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-color); }
.rc-draft__subject { margin: 0 10px 6px; font-weight: 600; font-size: 13px; }
.rc-draft__body { margin: 0 10px; white-space: pre-wrap; font: inherit; font-size: 13px; line-height: 1.6; color: var(--text-color); }
.rc-draft__actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.rc-result { margin: 10px 0 0; color: var(--rc-ok); font-weight: 600; font-size: 13.5px; }
.rc-take {
    position: sticky;
    bottom: -22px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px -22px 0;
    padding: 12px 22px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}
.rc-take__hint { font-size: 12.5px; color: var(--text-muted); }
.rc-people { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.rc-people label { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--border-color); border-radius: 10px; cursor: pointer; font-size: 13px; }
.rc-people label:has(input:checked) { border-color: var(--rc-accent); background: var(--rc-accent-soft); }
.rc-people input { accent-color: var(--rc-accent); }
.rc-people small { margin-left: auto; color: var(--text-muted); }
.rc-picker__actions { display: flex; justify-content: flex-end; gap: 8px; }
.rc-receipts { list-style: none; margin: 0 0 10px; padding: 0; }
.rc-receipts li { padding: 8px 10px; border-radius: 10px; background: var(--input-bg); }
.rc-receipts__head { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.rc-receipts__head b { color: var(--text-color); }
.rc-receipts__people { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.rc-receipts__people .is-read { color: var(--rc-ok); }

/* ── 사람별 기억 ── */
.rc-person__head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; }
.rc-person__who { flex: 1; min-width: 0; }
.rc-person__name { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.rc-person__stats { margin: 3px 0 0; font-size: 13px; color: var(--text-muted); }
.rc-person__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
.rc-memo {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-color);
    font: inherit;
    font-size: 13.5px;
    line-height: 1.55;
}
.rc-memo:focus { outline: none; border-color: var(--rc-accent); box-shadow: 0 0 0 3px var(--rc-accent-soft); }
.rc-memo__state { margin: 4px 0 0; min-height: 16px; font-size: 11.5px; color: var(--text-muted); }
.rc-terms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-terms li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.rc-terms__subject { color: var(--text-muted); }
.rc-terms__value { font-weight: 700; }
.rc-terms__before { flex-basis: 100%; font-size: 12px; color: var(--text-muted); }
.rc-digest { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
.rc-digest li { margin-bottom: 4px; }
.rc-digest__title { margin: 8px 0 4px; font-size: 12.5px; color: var(--text-muted); font-weight: 700; }
.rc-digest__at { margin: 0; font-size: 12px; color: var(--text-muted); }
.rc-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.rc-timeline__item { display: flex; gap: 10px; padding: 0 0 12px; position: relative; }
.rc-timeline__item::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--border-color); }
.rc-timeline__item:last-child::before { display: none; }
.rc-timeline__icon { flex: none; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--input-bg); color: var(--text-muted); }
.rc-timeline__item--call .rc-timeline__icon,
.rc-timeline__item--meeting .rc-timeline__icon { background: var(--rc-accent-soft); color: var(--rc-accent); }
.rc-timeline__body { flex: 1; min-width: 0; }
.rc-timeline__body time { font-size: 11.5px; color: var(--text-muted); }
.rc-timeline__title { margin: 1px 0 2px; font-size: 13.5px; font-weight: 600; }
.rc-timeline__text { margin: 0 0 4px; font-size: 13px; line-height: 1.5; color: var(--text-color); overflow-wrap: anywhere; }

/* ── 메시지 창·페이지 — 사진·이름을 누르면 기억 카드(data-person-open) ── */
.msg-person-face { display: inline-flex; border-radius: 50%; cursor: pointer; flex: none; }
.msg-person-face:hover { box-shadow: 0 0 0 2px var(--rc-accent); }
.is-person[data-person-open] { cursor: pointer; }
.is-person[data-person-open]:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 회의록 카드(채팅)·회의록 보기 ── */
.rc-mcard {
    display: flex;
    gap: 10px;
    width: min(270px, 100%);
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-color);
    color: var(--text-color);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.rc-mcard:hover { border-color: var(--rc-accent); }
.rc-mcard__icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--rc-accent-soft); color: var(--rc-accent); }
.rc-mcard__body { display: flex; flex-direction: column; min-width: 0; }
.rc-mcard__kicker { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.rc-mcard__title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-mcard__open { margin-top: 4px; font-size: 12.5px; color: var(--rc-accent); font-weight: 600; }
.rc-mcard__receipt { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }
.rc-mcard__receipt.is-read { color: var(--rc-ok); }
.rc-receipt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-receipt-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.rc-receipt-list small { margin-left: auto; color: var(--text-muted); }
.rc-receipt-list li.is-read small { color: var(--rc-ok); }

/* ── 통화 중 상대 정보(friend_call.js 의 가운데 칸 — 통화 화면 색 --fc-*) ── */
.fc-brief { display: flex; flex-direction: column; gap: 10px; max-height: 100%; overflow: auto; text-align: left; }
.fc-brief__memo { padding: 9px 11px; border-radius: 10px; background: rgba(15, 23, 42, 0.05); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
[data-theme="dark"] .fc-brief__memo { background: rgba(255, 255, 255, 0.08); }
.fc-brief__warn { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--rc-warn-soft); color: var(--rc-warn); font-size: 13px; font-weight: 600; line-height: 1.5; }
.fc-brief__row { display: flex; flex-direction: column; gap: 3px; }
.fc-brief__label { font-size: 11.5px; font-weight: 700; opacity: 0.7; letter-spacing: 0.02em; }
.fc-brief__row p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.fc-brief__row ul { margin: 0; padding-left: 16px; font-size: 13.5px; line-height: 1.55; }
.fc-brief__row small { opacity: 0.7; }
.fc-brief .rc-cite { background: rgba(35, 131, 226, 0.18); }

@media (max-width: 720px) {
    .rc-modal { padding: 0; align-items: flex-end; }
    .rc-modal__box { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
    .rc-modal__body { padding: 16px; }
    .rc-take { margin: 6px -16px 0; padding: 12px 16px; bottom: -16px; }
    .rc-person__grid { grid-template-columns: minmax(0, 1fr); }
}
